diff --git a/AUTHORS b/AUTHORS index 3a3ca7a..6c79e7f7 100644 --- a/AUTHORS +++ b/AUTHORS
@@ -668,6 +668,7 @@ Ravi Nanjundappa <nravi.n@samsung.com> Ravi Phaneendra Kasibhatla <r.kasibhatla@samsung.com> Ravi Phaneendra Kasibhatla <ravi.kasibhatla@motorola.com> +Réda Housni Alaoui <alaoui.rda@gmail.com> Refael Ackermann <refack@gmail.com> Renata Hodovan <rhodovan.u-szeged@partner.samsung.com> Rene Bolldorf <rb@radix.io> @@ -743,6 +744,7 @@ Shiliu Wang <aofdwsl@gmail.com> Shiliu Wang <shiliu.wang@intel.com> Shilpa Shri <shilpa.shri@samsung.com> +Shirish S <shirish.s@amd.com> Shiva Kumar <shiva.k1@samsung.com> Shivakumar JM <shiva.jm@samsung.com> Shouqun Liu <liushouqun@xiaomi.com> @@ -915,6 +917,7 @@ Code Aurora Forum <*@codeaurora.org> Collabora Limited <*@collabora.com> Comodo CA Limited +Cosium <*@cosium.com> Endless Mobile, Inc. <*@endlessm.com> Estimote, Inc. <*@estimote.com> Facebook, Inc. <*@fb.com>
diff --git a/DEPS b/DEPS index 5fee2e3..19c2241 100644 --- a/DEPS +++ b/DEPS
@@ -78,11 +78,11 @@ # 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': 'f4f3f0fb29d493108cbf0f3d1d648ea8bf7e2011', + 'skia_revision': 'd23d8d1d980bfd7afac9ec4bae7607bd65866fe6', # 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': '59d313a72fe632d6892139a5cec1dbf593b723d0', + 'v8_revision': '0c287882ea233f299a91f6b72b56d8faaecf52c0', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -90,7 +90,7 @@ # 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': '47c8ea3fb265682b6dd040bf04488747f0292da1', + 'angle_revision': 'eeda03b624b9faa369d085dd3fe73bdf94fdc2c5', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling build tools # and whatever else without interference from each other. @@ -102,7 +102,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '45da0f2d84c97a9856492265a1fc706d04bdfccd', + 'pdfium_revision': '5183e8679844eeff2c5dda2a2e02762487429a1f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling openmax_dl # and whatever else without interference from each other. @@ -110,7 +110,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. - 'boringssl_revision': '02e6256b16b54319b1c01d4133ca3317e82b2dbb', + 'boringssl_revision': 'ef16f19ef2ea7364a3645c8c48d68f91855305c7', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling google-toolbox-for-mac # and whatever else without interference from each other. @@ -134,7 +134,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '2de84c0d21c28eeb042dc4d6a1a88553f6d286da', + 'catapult_revision': 'd14d29762cc0d6fd8c4738a8be98a91b965258ec', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -263,7 +263,7 @@ }, 'src/third_party/android_tools': { - 'url': Var('chromium_git') + '/android_tools.git' + '@' + 'a2e9bc7c1b41d983577907df51d339fb1e0fd02f', + 'url': Var('chromium_git') + '/android_tools.git' + '@' + '7d781b3544ef67dfa8c7c0c1a347b818c49c42bc', 'condition': 'checkout_android', }, @@ -271,7 +271,7 @@ Var('chromium_git') + '/angle/angle.git' + '@' + Var('angle_revision'), 'src/third_party/apache-portable-runtime/src': { - 'url': Var('chromium_git') + '/external/apache-portable-runtime.git' + '@' + 'c76a8c4277e09a82eaa229e35246edea1ee0a6a1', + 'url': Var('chromium_git') + '/external/apache-portable-runtime.git' + '@' + 'c3f11fcd86b42922834cae91103cf068246c6bb6', 'condition': 'checkout_android', }, @@ -292,7 +292,7 @@ Var('boringssl_git') + '/boringssl.git' + '@' + Var('boringssl_revision'), 'src/third_party/breakpad/breakpad': - Var('chromium_git') + '/breakpad/breakpad.git' + '@' + '4af3e83b10b17bbd31099d55c2e272d56fb0ef13', + Var('chromium_git') + '/breakpad/breakpad.git' + '@' + '4a02ec03038d9d6f870f42d5070591512f488db0', 'src/third_party/catapult': Var('chromium_git') + '/catapult.git' + '@' + Var('catapult_revision'), @@ -302,7 +302,7 @@ # Build tools for Chrome OS. Note: This depends on third_party/pyelftools. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'a46ce69c97aff6df16b3233103af29e28275256c', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'cb67c15aeb0b4f87b2bb278a8fdd651e61862895', 'condition': 'checkout_linux', }, @@ -317,7 +317,7 @@ # For Linux and Chromium OS. 'src/third_party/cros_system_api': { - 'url': Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + 'b9797a0794435eecb9899ec13bc4ea3ea164e264', + 'url': Var('chromium_git') + '/chromiumos/platform/system_api.git' + '@' + '9efc03a3dca4b439e0ee7aa940009c73779a2b75', 'condition': 'checkout_linux', }, @@ -327,7 +327,7 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'edac7184bc0b8d75725d224c4f8d8c302ff9e9e3', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'df27bf6f0034ac718433f8c745f9229514aca960', 'src/third_party/devtools-node-modules': Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'), @@ -475,13 +475,13 @@ }, 'src/third_party/libvpx/source/libvpx': - Var('chromium_git') + '/webm/libvpx.git' + '@' + 'a2127236ae4742f329e5571d76b84de08cd3b8ea', + Var('chromium_git') + '/webm/libvpx.git' + '@' + '8a4336ed2edea09b67f49828df1f8c526a85a7a6', 'src/third_party/libwebm/source': - Var('chromium_git') + '/webm/libwebm.git' + '@' + '4956b2dec65352af32dc71bab553acb631c64177', + Var('chromium_git') + '/webm/libwebm.git' + '@' + 'b03c65468b06d097f27235d93d76bfc45f490ede', 'src/third_party/libyuv': - Var('chromium_git') + '/libyuv/libyuv.git' + '@' + 'c67db6053495a2744511a43ba7b6ba3fa49b26a5', # from r1685 + Var('chromium_git') + '/libyuv/libyuv.git' + '@' + '263243aadc3c30d548ffc36e6fdb0cc987511cc6', # from r1687 'src/third_party/lighttpd': { 'url': Var('chromium_git') + '/chromium/deps/lighttpd.git' + '@' + Var('lighttpd_revision'), @@ -640,7 +640,7 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd458ada06171a85af00367251a4ed55db7fe2018', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '8e126fca476a2264e65f3c311795fe1748d32a0f', # commit position 20628 + Var('webrtc_git') + '/src.git' + '@' + 'f641687a8070f646f6e073020a59bc288ec1b319', # commit position 20628 'src/third_party/xdg-utils': { 'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d', @@ -663,7 +663,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@a9073a99865e1df9ae31aa59e9a2710ea44bbe40', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@28396a3fae19369deefb60fd6dee84580d49a6d0', 'condition': 'checkout_src_internal', }, }
diff --git a/WATCHLISTS b/WATCHLISTS index 5fa4d49..0c09bd9 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -1369,6 +1369,9 @@ '|third_party/hunspell/'\ '|third_party/hunspell_dictionaries/', }, + 'startup': { + 'filepath': 'chrome/browser/ui/startup/', + }, 'streams': { 'filepath': 'content/browser/streams/', }, @@ -2238,6 +2241,8 @@ 'rlp+watch@chromium.org', 'rouslan+spell@chromium.org', 'timvolodine@chromium.org'], + 'startup': ['grt+watch@chromium.org', + 'pastarmovj+watch@chromium.org'], 'streams': ['zork+watch@chromium.org'], 'styleguide': ['danakj+watch@chromium.org', 'jbroman+cpp@chromium.org',
diff --git a/android_webview/browser/aw_content_browser_client.cc b/android_webview/browser/aw_content_browser_client.cc index 09ad80ff..df0d72d4 100644 --- a/android_webview/browser/aw_content_browser_client.cc +++ b/android_webview/browser/aw_content_browser_client.cc
@@ -572,7 +572,8 @@ std::vector<std::unique_ptr<content::URLLoaderThrottle>> AwContentBrowserClient::CreateURLLoaderThrottles( - const base::Callback<content::WebContents*()>& wc_getter) { + const base::Callback<content::WebContents*()>& wc_getter, + content::NavigationUIData* navigation_ui_data) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(base::FeatureList::IsEnabled(features::kNetworkService));
diff --git a/android_webview/browser/aw_content_browser_client.h b/android_webview/browser/aw_content_browser_client.h index 2b07fcb..e75fa928 100644 --- a/android_webview/browser/aw_content_browser_client.h +++ b/android_webview/browser/aw_content_browser_client.h
@@ -151,7 +151,8 @@ content::RenderProcessHost* render_process_host) override; std::vector<std::unique_ptr<content::URLLoaderThrottle>> CreateURLLoaderThrottles( - const base::Callback<content::WebContents*()>& wc_getter) override; + const base::Callback<content::WebContents*()>& wc_getter, + content::NavigationUIData* navigation_ui_data) override; bool ShouldOverrideUrlLoading(int frame_tree_node_id, bool browser_initiated, const GURL& gurl,
diff --git a/android_webview/browser/surfaces_instance.cc b/android_webview/browser/surfaces_instance.cc index 986ff36d..47ebf13 100644 --- a/android_webview/browser/surfaces_instance.cc +++ b/android_webview/browser/surfaces_instance.cc
@@ -74,8 +74,7 @@ begin_frame_source_.get(), nullptr /* current_task_runner */, output_surface_holder->capabilities().max_frames_pending); display_ = std::make_unique<viz::Display>( - nullptr /* shared_bitmap_manager */, - nullptr /* gpu_memory_buffer_manager */, settings, frame_sink_id_, + nullptr /* shared_bitmap_manager */, settings, frame_sink_id_, std::move(output_surface_holder), std::move(scheduler), nullptr /* current_task_runner */); display_->Initialize(this, frame_sink_manager_->surface_manager());
diff --git a/android_webview/browser/test/rendering_test.h b/android_webview/browser/test/rendering_test.h index 23ccd48..9708059 100644 --- a/android_webview/browser/test/rendering_test.h +++ b/android_webview/browser/test/rendering_test.h
@@ -13,7 +13,7 @@ #include "base/macros.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" -#include "cc/resources/resource.h" +#include "components/viz/common/resources/resource_id.h" #include "testing/gtest/include/gtest/gtest.h" namespace base {
diff --git a/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java b/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java index 89ffdc6a..be971f3 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java +++ b/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java
@@ -22,6 +22,7 @@ private static final String TAG = "AwSafeBrowsingConfi-"; private static final String OPT_IN_META_DATA_STR = "android.webkit.WebView.EnableSafeBrowsing"; + private static final boolean DEFAULT_USER_OPT_IN = false; private static Boolean sSafeBrowsingUserOptIn; @@ -32,20 +33,17 @@ // If the app specifies something, fallback to the app's preference, otherwise check for the // existence of the CLI switch. AwContentsStatics.setSafeBrowsingEnabledByManifest( - appOptIn == null ? getCommandLineOptIn() : appOptIn); + appOptIn == null ? !isDisabledByCommandLine() : appOptIn); - Callback<Boolean> cb = optin -> setSafeBrowsingUserOptIn(optin == null ? false : optin); + Callback<Boolean> cb = + optin -> setSafeBrowsingUserOptIn(optin == null ? DEFAULT_USER_OPT_IN : optin); PlatformServiceBridge.getInstance().querySafeBrowsingUserConsent(appContext, cb); } - private static boolean getCommandLineOptIn() { + private static boolean isDisabledByCommandLine() { CommandLine cli = CommandLine.getInstance(); - // Disable flag has higher precedence than the enable flag - if (cli.hasSwitch(AwSwitches.WEBVIEW_DISABLE_SAFEBROWSING_SUPPORT)) { - return false; - } - return cli.hasSwitch(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) - || cli.hasSwitch(AwSwitches.WEBVIEW_SAFEBROWSING_BLOCK_ALL_RESOURCES); + // Disable flag has higher precedence than the default + return cli.hasSwitch(AwSwitches.WEBVIEW_DISABLE_SAFEBROWSING_SUPPORT); } /**
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java index 9885399..5d69fe2d0 100644 --- a/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java +++ b/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java
@@ -455,7 +455,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingDoesNotBlockSafePages() throws Throwable { loadGreenPage(); final String responseUrl = mTestServer.getURL(SAFE_HTML_PATH); @@ -467,7 +466,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingDoesNotBlockUnwantedSoftwarePages() throws Throwable { // TODO(ntfschr): this is a temporary check until we add support for Unwanted Software // warnings (crbug/729272) @@ -481,7 +479,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingBlocksPhishingPages() throws Throwable { loadGreenPage(); loadPathAndWaitForInterstitial(PHISHING_HTML_PATH); @@ -494,7 +491,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingWhitelistedUnsafePagesDontShowInterstitial() throws Throwable { loadGreenPage(); final String responseUrl = mTestServer.getURL(MALWARE_HTML_PATH); @@ -512,7 +508,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testCallbackCalledOnSafeBrowsingBadWhitelistRule() throws Throwable { verifyWhiteListRule("http://www.google.com", false); } @@ -520,7 +515,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testCallbackCalledOnSafeBrowsingGoodWhitelistRule() throws Throwable { verifyWhiteListRule("www.google.com", true); } @@ -540,7 +534,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingShowsInterstitialForMainFrame() throws Throwable { loadGreenPage(); loadPathAndWaitForInterstitial(MALWARE_HTML_PATH); @@ -553,7 +546,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingShowsInterstitialForSubresource() throws Throwable { loadGreenPage(); loadPathAndWaitForInterstitial(IFRAME_HTML_PATH); @@ -567,7 +559,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingProceedThroughInterstitialForMainFrame() throws Throwable { int pageFinishedCount = mContentsClient.getOnPageFinishedHelper().getCallCount(); loadPathAndWaitForInterstitial(MALWARE_HTML_PATH); @@ -580,7 +571,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingProceedThroughInterstitialForSubresource() throws Throwable { int pageFinishedCount = mContentsClient.getOnPageFinishedHelper().getCallCount(); loadPathAndWaitForInterstitial(IFRAME_HTML_PATH); @@ -593,7 +583,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingDontProceedCausesNetworkErrorForMainFrame() throws Throwable { loadGreenPage(); loadPathAndWaitForInterstitial(MALWARE_HTML_PATH); @@ -612,7 +601,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) @DisabledTest(message = "crbug/737820") public void testSafeBrowsingDontProceedCausesNetworkErrorForSubresource() throws Throwable { loadPathAndWaitForInterstitial(IFRAME_HTML_PATH); @@ -631,7 +619,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingDontProceedNavigatesBackForMainFrame() throws Throwable { loadGreenPage(); final String originalTitle = mActivityTestRule.getTitleOnUiThread(mAwContents); @@ -652,7 +639,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingDontProceedNavigatesBackForSubResource() throws Throwable { loadGreenPage(); final String originalTitle = mActivityTestRule.getTitleOnUiThread(mAwContents); @@ -673,7 +659,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingCanBeDisabledPerWebview() throws Throwable { mActivityTestRule.getAwSettingsOnUiThread(mAwContents).setSafeBrowsingEnabled(false); @@ -704,7 +689,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingShowsNetworkErrorForInvisibleViews() throws Throwable { mAwContents.setCanShowInterstitial(false); mAwContents.setCanShowBigInterstitial(false); @@ -722,7 +706,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingShowsQuietInterstitialForOddSizedViews() throws Throwable { mAwContents.setCanShowBigInterstitial(false); loadGreenPage(); @@ -734,7 +717,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingCanShowQuietPhishingInterstitial() throws Throwable { mAwContents.setCanShowBigInterstitial(false); loadGreenPage(); @@ -746,7 +728,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingProceedQuietInterstitial() throws Throwable { mAwContents.setCanShowBigInterstitial(false); int pageFinishedCount = mContentsClient.getOnPageFinishedHelper().getCallCount(); @@ -760,7 +741,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingOnSafeBrowsingHitShowInterstitial() throws Throwable { mContentsClient.setSafeBrowsingAction(SafeBrowsingAction.SHOW_INTERSTITIAL); @@ -781,7 +761,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingOnSafeBrowsingHitProceed() throws Throwable { mContentsClient.setSafeBrowsingAction(SafeBrowsingAction.PROCEED); @@ -801,7 +780,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingOnSafeBrowsingHitBackToSafety() throws Throwable { mContentsClient.setSafeBrowsingAction(SafeBrowsingAction.BACK_TO_SAFETY); @@ -827,7 +805,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingOnSafeBrowsingHitForSubresourceNoPreviousPage() throws Throwable { mContentsClient.setSafeBrowsingAction(SafeBrowsingAction.BACK_TO_SAFETY); final String responseUrl = mTestServer.getURL(IFRAME_HTML_PATH); @@ -853,7 +830,6 @@ @SmallTest @RetryOnFailure // crbug/765932 @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingOnSafeBrowsingHitForSubresource() throws Throwable { mContentsClient.setSafeBrowsingAction(SafeBrowsingAction.BACK_TO_SAFETY); loadGreenPage(); @@ -894,7 +870,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingUserOptOutOverridesManifest() throws Throwable { AwSafeBrowsingConfigHelper.setSafeBrowsingUserOptIn(false); loadGreenPage(); @@ -920,7 +895,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingHardcodedMalwareUrl() throws Throwable { loadGreenPage(); int interstitialCount = @@ -933,7 +907,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingHardcodedPhishingUrl() throws Throwable { loadGreenPage(); int interstitialCount = @@ -946,7 +919,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingClickLearnMoreLink() throws Throwable { loadInterstitialAndClickLink(PHISHING_HTML_PATH, "learn-more-link", appendLocale("https://support.google.com/chrome/?p=cpn_safe_browsing_wv")); @@ -955,7 +927,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingClickReportErrorLink() throws Throwable { // Only phishing interstitials have the report-error-link loadInterstitialAndClickLink(PHISHING_HTML_PATH, "report-error-link", @@ -972,7 +943,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingClickDiagnosticLink() throws Throwable { final String responseUrl = mTestServer.getURL(MALWARE_HTML_PATH); final String diagnosticUrl = @@ -987,7 +957,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingClickWhitePaperLink() throws Throwable { final String whitepaperUrl = Uri.parse("https://www.google.com/chrome/browser/privacy/whitepaper.html") @@ -1001,7 +970,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testSafeBrowsingClickPrivacyPolicy() throws Throwable { final String privacyPolicyUrl = Uri.parse("https://www.google.com/chrome/browser/privacy/") @@ -1025,7 +993,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testInitSafeBrowsingCallbackOnUIThread() throws Throwable { Context ctx = InstrumentationRegistry.getInstrumentation() .getTargetContext() @@ -1046,7 +1013,6 @@ @Test @SmallTest @Feature({"AndroidWebView"}) - @CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) public void testInitSafeBrowsingUsesAppContext() throws Throwable { MockContext ctx = new MockContext(InstrumentationRegistry.getInstrumentation().getTargetContext());
diff --git a/android_webview/renderer/aw_content_renderer_client.cc b/android_webview/renderer/aw_content_renderer_client.cc index 7043379..bb307cc4 100644 --- a/android_webview/renderer/aw_content_renderer_client.cc +++ b/android_webview/renderer/aw_content_renderer_client.cc
@@ -299,6 +299,7 @@ blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, + content::ResourceType resource_type, std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles, GURL* new_url) { if (UsingSafeBrowsingMojoService()) {
diff --git a/android_webview/renderer/aw_content_renderer_client.h b/android_webview/renderer/aw_content_renderer_client.h index aeacee6c..c167fdf 100644 --- a/android_webview/renderer/aw_content_renderer_client.h +++ b/android_webview/renderer/aw_content_renderer_client.h
@@ -55,6 +55,7 @@ blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, + content::ResourceType resource_type, std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles, GURL* new_url) override;
diff --git a/ash/BUILD.gn b/ash/BUILD.gn index b2ebfbb..1f844d78 100644 --- a/ash/BUILD.gn +++ b/ash/BUILD.gn
@@ -577,6 +577,8 @@ "system/power/backlights_forced_off_setter.h", "system/power/battery_notification.cc", "system/power/battery_notification.h", + "system/power/convertible_power_button_controller.cc", + "system/power/convertible_power_button_controller.h", "system/power/dual_role_notification.cc", "system/power/dual_role_notification.h", "system/power/peripheral_battery_notifier.cc", @@ -595,8 +597,6 @@ "system/power/power_status_view.h", "system/power/scoped_backlights_forced_off.cc", "system/power/scoped_backlights_forced_off.h", - "system/power/tablet_power_button_controller.cc", - "system/power/tablet_power_button_controller.h", "system/power/tray_power.cc", "system/power/tray_power.h", "system/power/video_activity_notifier.cc", @@ -1462,12 +1462,12 @@ "system/palette/tools/metalayer_unittest.cc", "system/palette/tools/screenshot_unittest.cc", "system/power/backlights_forced_off_setter_unittest.cc", + "system/power/convertible_power_button_controller_unittest.cc", "system/power/peripheral_battery_notifier_unittest.cc", "system/power/power_button_screenshot_controller_unittest.cc", "system/power/power_event_observer_unittest.cc", "system/power/power_status_unittest.cc", "system/power/power_status_view_unittest.cc", - "system/power/tablet_power_button_controller_unittest.cc", "system/power/tray_power_unittest.cc", "system/power/video_activity_notifier_unittest.cc", "system/rotation/tray_rotation_lock_unittest.cc", @@ -1785,12 +1785,12 @@ "system/cast/tray_cast_test_api.h", "system/palette/palette_tray_test_api.cc", "system/palette/palette_tray_test_api.h", + "system/power/convertible_power_button_controller_test_api.cc", + "system/power/convertible_power_button_controller_test_api.h", "system/power/power_button_screenshot_controller_test_api.cc", "system/power/power_button_screenshot_controller_test_api.h", "system/power/power_button_test_base.cc", "system/power/power_button_test_base.h", - "system/power/tablet_power_button_controller_test_api.cc", - "system/power/tablet_power_button_controller_test_api.h", "system/status_area_widget_test_helper.cc", "system/status_area_widget_test_helper.h", "system/tray/system_tray_test_api.cc",
diff --git a/ash/DEPS b/ash/DEPS index 8bfecb5..a8d1b064 100644 --- a/ash/DEPS +++ b/ash/DEPS
@@ -54,6 +54,8 @@ "+chromeos/dbus/shill_device_client.h", "+chromeos/dbus/system_clock_client.h", "+chromeos/login", + # LoginState is deprecated and is not instantiated in mash. + "-chromeos/login/login_state.h", # TODO(jamescook): Eliminate this. http://crbug.com/644355 "+chromeos/network", # TODO(jamescook): Eliminate this. http://crbug.com/644361
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index d1fa22b3..24485e6 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc
@@ -33,7 +33,6 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" #include "ash/shell_delegate.h" -#include "ash/shell_port.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/brightness_control_delegate.h" #include "ash/system/ime_menu/ime_menu_tray.h" @@ -1627,7 +1626,7 @@ actions_allowed_in_app_mode_.end()) { return RESTRICTION_PREVENT_PROCESSING; } - if (ShellPort::Get()->IsSystemModalWindowOpen() && + if (Shell::IsSystemModalWindowOpen() && actions_allowed_at_modal_window_.find(action) == actions_allowed_at_modal_window_.end()) { // Note we prevent the shortcut from propagating so it will not
diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index b7d73682..5341e0426 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc
@@ -17,7 +17,7 @@ #include "ash/session/session_controller.h" #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" -#include "ash/shell_port.h" +#include "ash/shell_test_api.h" #include "ash/system/brightness_control_delegate.h" #include "ash/system/keyboard_brightness_control_delegate.h" #include "ash/test/ash_test_base.h" @@ -1121,7 +1121,7 @@ std::unique_ptr<aura::Window> window( CreateTestWindowInShellWithBounds(gfx::Rect(5, 5, 20, 20))); wm::ActivateWindow(window.get()); - ShellPort::Get()->SimulateModalWindowOpenForTesting(true); + ShellTestApi().SimulateModalWindowOpenForTest(true); for (const auto& action : all_actions) { if (actionsAllowedAtModalWindow.find(action) == actionsAllowedAtModalWindow.end()) { @@ -1359,11 +1359,7 @@ using AcceleratorControllerGuestModeTest = NoSessionAshTestBase; TEST_F(AcceleratorControllerGuestModeTest, IncognitoWindowDisabled) { - // Simulate a guest mode login. - TestSessionControllerClient* session = GetSessionControllerClient(); - session->Reset(); - session->AddUserSession("user1@test.com", user_manager::USER_TYPE_GUEST); - session->SetSessionState(session_manager::SessionState::ACTIVE); + SimulateGuestLogin(); // New incognito window is disabled. EXPECT_FALSE(Shell::Get()->accelerator_controller()->PerformActionIfEnabled(
diff --git a/ash/app_list/model/BUILD.gn b/ash/app_list/model/BUILD.gn index d0e60852..48eac628 100644 --- a/ash/app_list/model/BUILD.gn +++ b/ash/app_list/model/BUILD.gn
@@ -23,6 +23,7 @@ defines = [ "APP_LIST_MODEL_IMPLEMENTATION" ] deps = [ + "//ash/public/cpp:cpp", "//base:i18n", "//cc/paint", "//components/sync",
diff --git a/ash/app_list/model/app_list_folder_item.cc b/ash/app_list/model/app_list_folder_item.cc index f697677..9378311 100644 --- a/ash/app_list/model/app_list_folder_item.cc +++ b/ash/app_list/model/app_list_folder_item.cc
@@ -18,6 +18,7 @@ item_list_(new AppListItemList), folder_image_(item_list_.get()) { folder_image_.AddObserver(this); + set_is_folder(true); } AppListFolderItem::~AppListFolderItem() {
diff --git a/ash/app_list/model/app_list_item.cc b/ash/app_list/model/app_list_item.cc index d78dc8fd..d3a428b 100644 --- a/ash/app_list/model/app_list_item.cc +++ b/ash/app_list/model/app_list_item.cc
@@ -10,7 +10,11 @@ namespace app_list { AppListItem::AppListItem(const std::string& id) - : id_(id), + : metadata_(ash::mojom::AppListItemMetadata::New(id, + std::string(), + std::string(), + syncer::StringOrdinal(), + false)), highlighted_(false), is_installing_(false), percent_downloaded_(-1) {} @@ -73,23 +77,23 @@ } bool AppListItem::CompareForTest(const AppListItem* other) const { - return id_ == other->id_ && folder_id_ == other->folder_id_ && - name_ == other->name_ && short_name_ == other->short_name_ && + return id() == other->id() && folder_id() == other->folder_id() && + name() == other->name() && short_name_ == other->short_name_ && GetItemType() == other->GetItemType() && - position_.Equals(other->position_); + position().Equals(other->position()); } std::string AppListItem::ToDebugString() const { - return id_.substr(0, 8) + " '" + name_ + "'" + " [" + - position_.ToDebugString() + "]"; + return id().substr(0, 8) + " '" + name() + "'" + " [" + + position().ToDebugString() + "]"; } // Protected methods void AppListItem::SetName(const std::string& name) { - if (name_ == name && (short_name_.empty() || short_name_ == name)) + if (metadata_->name == name && (short_name_.empty() || short_name_ == name)) return; - name_ = name; + metadata_->name = name; short_name_.clear(); for (auto& observer : observers_) observer.ItemNameChanged(); @@ -97,9 +101,9 @@ void AppListItem::SetNameAndShortName(const std::string& name, const std::string& short_name) { - if (name_ == name && short_name_ == short_name) + if (metadata_->name == name && short_name_ == short_name) return; - name_ = name; + metadata_->name = name; short_name_ = short_name; for (auto& observer : observers_) observer.ItemNameChanged();
diff --git a/ash/app_list/model/app_list_item.h b/ash/app_list/model/app_list_item.h index 69aa3e05..3091adef 100644 --- a/ash/app_list/model/app_list_item.h +++ b/ash/app_list/model/app_list_item.h
@@ -8,8 +8,10 @@ #include <stddef.h> #include <string> +#include <utility> #include "ash/app_list/model/app_list_model_export.h" +#include "ash/public/interfaces/app_list.mojom.h" #include "base/macros.h" #include "base/observer_list.h" #include "components/sync/model/string_ordinal.h" @@ -40,11 +42,11 @@ const gfx::ImageSkia& icon() const { return icon_; } const std::string& GetDisplayName() const { - return short_name_.empty() ? name_ : short_name_; + return short_name_.empty() ? name() : short_name_; } - const std::string& name() const { return name_; } - // Should only be used in tests; otheriwse use GetDisplayName(). + const std::string& name() const { return metadata_->name; } + // Should only be used in tests; otherwise use GetDisplayName(). const std::string& short_name() const { return short_name_; } void set_highlighted(bool highlighted) { highlighted_ = highlighted; } @@ -56,11 +58,21 @@ void SetPercentDownloaded(int percent_downloaded); int percent_downloaded() const { return percent_downloaded_; } - bool IsInFolder() const { return !folder_id_.empty(); } + bool IsInFolder() const { return !folder_id().empty(); } - const std::string& id() const { return id_; } - const std::string& folder_id() const { return folder_id_; } - const syncer::StringOrdinal& position() const { return position_; } + const std::string& id() const { return metadata_->id; } + const std::string& folder_id() const { return metadata_->folder_id; } + const syncer::StringOrdinal& position() const { return metadata_->position; } + + void SetMetadata(ash::mojom::AppListItemMetadataPtr metadata) { + metadata_ = std::move(metadata); + } + const ash::mojom::AppListItemMetadata* GetMetadata() const { + return metadata_.get(); + } + ash::mojom::AppListItemMetadataPtr CloneMetadata() const { + return metadata_.Clone(); + } void AddObserver(AppListItemObserver* observer); void RemoveObserver(AppListItemObserver* observer); @@ -88,6 +100,8 @@ virtual bool CompareForTest(const AppListItem* other) const; virtual std::string ToDebugString() const; + bool is_folder() const { return metadata_->is_folder; } + protected: // TODO(hejq): remove this when we have mojo interfaces. friend class ::ChromeAppListModelUpdater; @@ -110,21 +124,21 @@ void set_position(const syncer::StringOrdinal& new_position) { DCHECK(new_position.IsValid()); - position_ = new_position; + metadata_->position = new_position; } - void set_folder_id(const std::string& folder_id) { folder_id_ = folder_id; } + void set_folder_id(const std::string& folder_id) { + metadata_->folder_id = folder_id; + } + + void set_is_folder(bool is_folder) { metadata_->is_folder = is_folder; } private: friend class AppListModelTest; - const std::string id_; - std::string folder_id_; // Id of containing folder; empty if top level item. - syncer::StringOrdinal position_; - gfx::ImageSkia icon_; + ash::mojom::AppListItemMetadataPtr metadata_; - // The full name of an item. Used for display if |short_name_| is empty. - std::string name_; + gfx::ImageSkia icon_; // A shortened name for the item, used for display. std::string short_name_;
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index 4a3ffdd6..e45b9a4 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -161,6 +161,7 @@ Shelf </message> + <!-- Shelf buttons --> <message name="IDS_ASH_SHELF_SHUTDOWN_BUTTON" desc="Text shown on shutdown button on login/lock screen."> Shut down </message> @@ -176,6 +177,12 @@ <message name="IDS_ASH_SHELF_CANCEL_BUTTON" desc="Text shown on cancel button on add user screen."> Cancel </message> + <message name="IDS_ASH_BROWSE_AS_GUEST_BUTTON" desc="Text shown on Chrome OS sign-in screen button that launches guest session. Should be short."> + Browse as Guest + </message> + <message name="IDS_ASH_ADD_USER_BUTTON" desc="Text shown on an add user button on login/locker screen"> + Add Person + </message> <message name="IDS_ASH_KEYBOARD_OVERLAY_TITLE" desc="The title of the keyboard overlay."> Keyboard overlay
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc index 8801722d..c2c0c97 100644 --- a/ash/display/display_manager_unittest.cc +++ b/ash/display/display_manager_unittest.cc
@@ -158,6 +158,11 @@ return false; } + void SetSoftwareMirrorMode(bool active) { + display_manager()->SetMirrorMode(active); + RunAllPendingInMessageLoop(); + } + private: vector<display::Display> changed_; vector<display::Display> added_; @@ -170,6 +175,22 @@ DISALLOW_COPY_AND_ASSIGN(DisplayManagerTest); }; +class DisplayManagerTestDisableMultiMirroring : public DisplayManagerTest { + public: + DisplayManagerTestDisableMultiMirroring() = default; + ~DisplayManagerTestDisableMultiMirroring() override = default; + + // DisplayManagerTest: + void SetUp() override { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + ::switches::kDisableMultiMirroring); + DisplayManagerTest::SetUp(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(DisplayManagerTestDisableMultiMirroring); +}; + TEST_F(DisplayManagerTest, UpdateDisplayTest) { EXPECT_EQ(1U, display_manager()->GetNumDisplays()); @@ -998,7 +1019,7 @@ } // TODO(weidongg/774795) Remove test when multi mirroring is enabled by default. -TEST_F(DisplayManagerTest, NoMirrorInThreeDisplays) { +TEST_F(DisplayManagerTestDisableMultiMirroring, NoMirrorInThreeDisplays) { UpdateDisplay("640x480,320x200,400x300"); ash::Shell::Get()->display_configuration_controller()->SetMirrorMode(true); EXPECT_FALSE(display_manager()->IsInMirrorMode()); @@ -2284,7 +2305,8 @@ // TODO(weidongg/774795) Remove test when multi mirroring is enabled by default. // Make sure this does not cause any crashes. See http://crbug.com/412910 -TEST_F(DisplayManagerTest, SoftwareMirroringWithCompositingCursor) { +TEST_F(DisplayManagerTestDisableMultiMirroring, + SoftwareMirroringWithCompositingCursor) { UpdateDisplay("300x400,400x500"); MirrorWindowTestApi test_api; @@ -3782,28 +3804,7 @@ EXPECT_EQ(display::Display::ROTATE_0, screen->GetPrimaryDisplay().rotation()); } -class MultiMirroringTest : public DisplayManagerTest { - public: - MultiMirroringTest() = default; - ~MultiMirroringTest() override = default; - - // DisplayManagerTest: - void SetUp() override { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - ::switches::kEnableMultiMirroring); - DisplayManagerTest::SetUp(); - } - - void ActivateSoftwareMirrorMode(bool active) { - display_manager()->SetMirrorMode(active); - RunAllPendingInMessageLoop(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(MultiMirroringTest); -}; - -TEST_F(MultiMirroringTest, HardwareMirrorMode) { +TEST_F(DisplayManagerTest, HardwareMirrorMode) { // Create three displays with the same origin in frame buffer. const int64_t internal_display_id = display::test::DisplayManagerTestApi(display_manager()) @@ -3839,7 +3840,7 @@ EXPECT_TRUE(display_manager()->IsInHardwareMirrorMode()); } -TEST_F(MultiMirroringTest, SoftwareMirrorModeBasics) { +TEST_F(DisplayManagerTest, SoftwareMirrorModeBasics) { UpdateDisplay("300x400,400x500,500x600"); // There's not mirror window by default. @@ -3850,7 +3851,7 @@ display::Screen::GetScreen()->AddObserver(&display_observer); // Turn on mirror mode. - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); EXPECT_TRUE(display_observer.changed_and_reset()); EXPECT_EQ(1U, display_manager()->GetNumDisplays()); EXPECT_EQ(gfx::Rect(0, 0, 300, 400), @@ -3867,7 +3868,7 @@ EXPECT_FALSE(display_manager()->IsInHardwareMirrorMode()); // Turn off mirror mode. - ActivateSoftwareMirrorMode(false); + SetSoftwareMirrorMode(false); EXPECT_TRUE(display_observer.changed_and_reset()); EXPECT_EQ(3U, display_manager()->GetNumDisplays()); @@ -3878,7 +3879,7 @@ // Make sure the mirror window has the pixel size of the // source display. - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); EXPECT_TRUE(display_observer.changed_and_reset()); UpdateDisplay("300x400@0.5,400x500,500x600"); @@ -3915,41 +3916,41 @@ display::Screen::GetScreen()->RemoveObserver(&display_observer); } -TEST_F(MultiMirroringTest, SwitchToAndFromSoftwareMirrorMode) { +TEST_F(DisplayManagerTest, SwitchToAndFromSoftwareMirrorMode) { // Don't check root window destruction in unified mode. Shell::GetPrimaryRootWindow()->RemoveObserver(this); UpdateDisplay("300x400,400x500,500x600"); // Switch from extended to mirroring. - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); EXPECT_TRUE(display_manager()->IsInSoftwareMirrorMode()); EXPECT_FALSE(display_manager()->IsInUnifiedMode()); // Switch from mirroring to extended. - ActivateSoftwareMirrorMode(false); + SetSoftwareMirrorMode(false); EXPECT_FALSE(display_manager()->IsInMirrorMode()); EXPECT_FALSE(display_manager()->IsInUnifiedMode()); // Switch from mirroring to unified, but it fails. - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); display_manager()->SetUnifiedDesktopEnabled(true); RunAllPendingInMessageLoop(); EXPECT_TRUE(display_manager()->IsInSoftwareMirrorMode()); EXPECT_FALSE(display_manager()->IsInUnifiedMode()); // Turn off mirroring, it switches to unified. - ActivateSoftwareMirrorMode(false); + SetSoftwareMirrorMode(false); EXPECT_FALSE(display_manager()->IsInMirrorMode()); EXPECT_TRUE(display_manager()->IsInUnifiedMode()); // Switch from unified to mirroring. - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); EXPECT_TRUE(display_manager()->IsInSoftwareMirrorMode()); EXPECT_FALSE(display_manager()->IsInUnifiedMode()); } -TEST_F(MultiMirroringTest, SourceAndDestinationInSoftwareMirrorMode) { +TEST_F(DisplayManagerTest, SourceAndDestinationInSoftwareMirrorMode) { constexpr int64_t first_display_id = 10; constexpr int64_t second_display_id = 11; constexpr int64_t third_display_id = 12; @@ -3970,7 +3971,7 @@ display_manager()->GetMirroringDestinationDisplayIdList().empty()); // Activate software mirror mode. - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); EXPECT_EQ(first_display_id, display_manager()->mirroring_source_id()); display::DisplayIdList id_list = display_manager()->GetMirroringDestinationDisplayIdList(); @@ -3979,11 +3980,11 @@ EXPECT_EQ(third_display_id, id_list[1]); // Set the second display as internal display. - ActivateSoftwareMirrorMode(false); + SetSoftwareMirrorMode(false); display::test::ScopedSetInternalDisplayId set_internal(display_manager(), second_display_id); - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); EXPECT_TRUE(display_manager()->IsInSoftwareMirrorMode()); EXPECT_EQ(second_display_id, display_manager()->mirroring_source_id()); id_list = display_manager()->GetMirroringDestinationDisplayIdList(); @@ -3992,7 +3993,7 @@ EXPECT_EQ(third_display_id, id_list[1]); } -TEST_F(MultiMirroringTest, CompositingCursorInMultiSoftwareMirroring) { +TEST_F(DisplayManagerTest, CompositingCursorInMultiSoftwareMirroring) { const int64_t internal_display_id = display::test::DisplayManagerTestApi(display_manager()) .SetFirstDisplayAsInternalDisplay(); @@ -4017,19 +4018,19 @@ // Turn on mirror mode, cursor compositing is enabled and cursor window is // composited in internal display's root window. - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); EXPECT_TRUE(cursor_window_controller->is_cursor_compositing_enabled()); EXPECT_TRUE(Shell::GetRootWindowForDisplayId(internal_display_id) ->Contains(test_api.GetCursorWindow())); // Turn off mirror mode, cursor compositing is disabled and cursor window does // not exist. - ActivateSoftwareMirrorMode(false); + SetSoftwareMirrorMode(false); EXPECT_FALSE(cursor_window_controller->is_cursor_compositing_enabled()); EXPECT_EQ(nullptr, test_api.GetCursorWindow()); } -TEST_F(MultiMirroringTest, MirrorModeRestore) { +TEST_F(DisplayManagerTest, MirrorModeRestore) { const int64_t internal_display_id = display::test::DisplayManagerTestApi(display_manager()) .SetFirstDisplayAsInternalDisplay(); @@ -4059,7 +4060,7 @@ EXPECT_TRUE(display_manager()->external_display_mirror_info().empty()); // Turn on mirror mode. - ActivateSoftwareMirrorMode(true); + SetSoftwareMirrorMode(true); EXPECT_TRUE(display_manager()->IsInMirrorMode()); EXPECT_EQ(1U, display_manager()->external_display_mirror_info().size()); EXPECT_TRUE(display_manager()->external_display_mirror_info().count( @@ -4141,7 +4142,7 @@ second_display_masked_id)); // Turn off mirror mode. - ActivateSoftwareMirrorMode(false); + SetSoftwareMirrorMode(false); EXPECT_FALSE(display_manager()->IsInMirrorMode()); EXPECT_EQ(1U, display_manager()->external_display_mirror_info().size()); EXPECT_TRUE(display_manager()->external_display_mirror_info().count(
diff --git a/ash/display/display_move_window_util.cc b/ash/display/display_move_window_util.cc index 5440da6..ac6bf0c 100644 --- a/ash/display/display_move_window_util.cc +++ b/ash/display/display_move_window_util.cc
@@ -15,6 +15,7 @@ #include "ui/display/display.h" #include "ui/display/screen.h" #include "ui/display/types/display_constants.h" +#include "ui/wm/core/window_util.h" namespace ash { @@ -142,12 +143,20 @@ if (!window) return; - // When |window_list| is not empty, |window| can only be the first one of the - // fresh built list if it is in the list. - MruWindowTracker::WindowList window_list = - Shell::Get()->mru_window_tracker()->BuildWindowForCycleList(); - if (window_list.empty() || window_list.front() != window) - return; + // If |window| is transient window, move its first non-transient + // transient-parent window instead. Otherwise, it should be the first one in + // window cycle list. + if (::wm::GetTransientParent(window)) { + while (::wm::GetTransientParent(window)) + window = ::wm::GetTransientParent(window); + if (window == window->GetRootWindow()) + return; + } else { + MruWindowTracker::WindowList window_list = + Shell::Get()->mru_window_tracker()->BuildWindowForCycleList(); + if (window_list.empty() || window_list.front() != window) + return; + } display::Display origin_display = display::Screen::GetScreen()->GetDisplayNearestWindow(window);
diff --git a/ash/display/display_move_window_util_unittest.cc b/ash/display/display_move_window_util_unittest.cc index 09e1773..880ce8c6 100644 --- a/ash/display/display_move_window_util_unittest.cc +++ b/ash/display/display_move_window_util_unittest.cc
@@ -22,6 +22,7 @@ #include "ui/display/manager/display_manager.h" #include "ui/display/screen.h" #include "ui/display/test/display_manager_test_api.h" +#include "ui/views/widget/widget.h" #include "ui/wm/core/window_util.h" namespace ash { @@ -440,4 +441,43 @@ EXPECT_EQ(gfx::Rect(430, 50, 40, 50), child->GetBoundsInScreen()); } +// Test that when operating move window between displays on activated transient +// child window, its first non-transient transient-parent window should be the +// target instead. +TEST_F(DisplayMoveWindowUtilTest, ActiveTransientChildWindow) { + UpdateDisplay("400x300,400x300"); + std::unique_ptr<views::Widget> window = CreateTestWidget(); + window->SetBounds(gfx::Rect(10, 20, 200, 100)); + + // Create a |child| transient widget of |window|. When |child| is shown, it is + // activated. + std::unique_ptr<views::Widget> child(new views::Widget); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); + params.delegate = nullptr; + params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; + params.bounds = gfx::Rect(20, 30, 40, 50); + params.parent = window->GetNativeWindow(); + child->Init(params); + child->Show(); + display::Screen* screen = display::Screen::GetScreen(); + EXPECT_EQ(display_manager()->GetDisplayAt(0).id(), + screen->GetDisplayNearestWindow(window->GetNativeWindow()).id()); + EXPECT_EQ(display_manager()->GetDisplayAt(0).id(), + screen->GetDisplayNearestWindow(child->GetNativeWindow()).id()); + // Ensure |child| window is activated. + EXPECT_FALSE(wm::IsActiveWindow(window->GetNativeWindow())); + EXPECT_TRUE(wm::IsActiveWindow(child->GetNativeWindow())); + + // Operate moving window to right display. Check display and bounds. + HandleMoveActiveWindowToDisplay(DisplayMoveWindowDirection::kRight); + EXPECT_EQ(display_manager()->GetDisplayAt(1).id(), + screen->GetDisplayNearestWindow(window->GetNativeWindow()).id()); + EXPECT_EQ(display_manager()->GetDisplayAt(1).id(), + screen->GetDisplayNearestWindow(child->GetNativeWindow()).id()); + EXPECT_EQ(gfx::Rect(410, 20, 200, 100), + window->GetNativeWindow()->GetBoundsInScreen()); + EXPECT_EQ(gfx::Rect(420, 30, 40, 50), + child->GetNativeWindow()->GetBoundsInScreen()); +} + } // namespace ash
diff --git a/ash/display/mirror_window_controller_unittest.cc b/ash/display/mirror_window_controller_unittest.cc index 693128d..cc14895e 100644 --- a/ash/display/mirror_window_controller_unittest.cc +++ b/ash/display/mirror_window_controller_unittest.cc
@@ -55,9 +55,24 @@ using MirrorWindowControllerTest = AshTestBase; +class MirrorWindowControllerTestDisableMultiMirroring : public AshTestBase { + public: + MirrorWindowControllerTestDisableMultiMirroring() = default; + ~MirrorWindowControllerTestDisableMultiMirroring() override = default; + + void SetUp() override { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + ::switches::kDisableMultiMirroring); + AshTestBase::SetUp(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(MirrorWindowControllerTestDisableMultiMirroring); +}; + // TODO(weidongg/774795) Remove this test when multi mirroring is enabled by // default, because cursor compositing will be enabled for software mirroring. -TEST_F(MirrorWindowControllerTest, MirrorCursorBasic) { +TEST_F(MirrorWindowControllerTestDisableMultiMirroring, MirrorCursorBasic) { // MirrorWindowController is not used in the MUS or MASH configs. if (Shell::GetAshConfig() != Config::CLASSIC) return; @@ -110,7 +125,7 @@ // TODO(weidongg/774795) Remove this test when multi mirroring is enabled by // default, because cursor compositing will be enabled for software mirroring. -TEST_F(MirrorWindowControllerTest, MirrorCursorRotate) { +TEST_F(MirrorWindowControllerTestDisableMultiMirroring, MirrorCursorRotate) { // MirrorWindowController is not used in the MUS or MASH configs. if (Shell::GetAshConfig() != Config::CLASSIC) return; @@ -171,7 +186,7 @@ // coordinates. // TODO(weidongg/774795) Remove this test when multi mirroring is enabled by // default, because cursor compositing will be enabled for software mirroring. -TEST_F(MirrorWindowControllerTest, MirrorCursorLocations) { +TEST_F(MirrorWindowControllerTestDisableMultiMirroring, MirrorCursorLocations) { // MirrorWindowController is not used in the MUS or MASH configs. if (Shell::GetAshConfig() != Config::CLASSIC) return; @@ -212,7 +227,8 @@ // cursor's display. // TODO(weidongg/774795) Remove this test when multi mirroring is enabled by // default, because cursor compositing will be enabled for software mirroring. -TEST_F(MirrorWindowControllerTest, MirrorCursorMoveOnEnter) { +TEST_F(MirrorWindowControllerTestDisableMultiMirroring, + MirrorCursorMoveOnEnter) { // MirrorWindowController is not used in the MUS or MASH configs. if (Shell::GetAshConfig() != Config::CLASSIC) return;
diff --git a/ash/display/resolution_notification_controller.h b/ash/display/resolution_notification_controller.h index ed2e406..130105b 100644 --- a/ash/display/resolution_notification_controller.h +++ b/ash/display/resolution_notification_controller.h
@@ -17,7 +17,7 @@ #include "ui/gfx/geometry/size.h" namespace chromeos { -FORWARD_DECLARE_TEST(DisplayPreferencesTest, PreventStore); +FORWARD_DECLARE_TEST(DisplayPrefsTest, PreventStore); } // namespace chromeos namespace ash { @@ -76,7 +76,7 @@ private: friend class ResolutionNotificationControllerTest; FRIEND_TEST_ALL_PREFIXES(ResolutionNotificationControllerTest, Timeout); - FRIEND_TEST_ALL_PREFIXES(chromeos::DisplayPreferencesTest, PreventStore); + FRIEND_TEST_ALL_PREFIXES(chromeos::DisplayPrefsTest, PreventStore); // A struct to bundle the data for a single resolution change. struct ResolutionChangeInfo;
diff --git a/ash/fast_ink/fast_ink_view.cc b/ash/fast_ink/fast_ink_view.cc index 5992d49..97bbab7 100644 --- a/ash/fast_ink/fast_ink_view.cc +++ b/ash/fast_ink/fast_ink_view.cc
@@ -11,7 +11,6 @@ #include <memory> #include "ash/public/cpp/config.h" -#include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" #include "ash/shell_observer.h" #include "base/threading/thread_task_runner_handle.h" @@ -27,7 +26,6 @@ #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/layout.h" -#include "ui/gfx/canvas.h" #include "ui/gfx/geometry/dip_util.h" #include "ui/gfx/geometry/rect.h" #include "ui/gfx/gpu_memory_buffer.h" @@ -36,12 +34,66 @@ namespace ash { namespace { -// The outset used to expand the surface damage rectangle in order to -// allow single buffer updates while a frame is in-flight. -const int kSurfaceDamageOutsetDIP = 100; +gfx::Rect BufferRectFromScreenRect( + const gfx::Transform& screen_to_buffer_transform, + const gfx::Size& buffer_size, + const gfx::Rect& screen_rect) { + gfx::Rect buffer_rect = cc::MathUtil::MapEnclosingClippedRect( + screen_to_buffer_transform, screen_rect); + buffer_rect.Intersect(gfx::Rect(buffer_size)); + return buffer_rect; +} } // namespace +FastInkView::ScopedPaint::ScopedPaint( + gfx::GpuMemoryBuffer* gpu_memory_buffer, + const gfx::Transform& screen_to_buffer_transform, + const gfx::Rect& screen_rect) + : gpu_memory_buffer_(gpu_memory_buffer), + buffer_rect_(BufferRectFromScreenRect(screen_to_buffer_transform, + gpu_memory_buffer->GetSize(), + screen_rect)), + canvas_(buffer_rect_.size(), 1.0f, false) { + canvas_.Translate(-buffer_rect_.OffsetFromOrigin()); + canvas_.Transform(screen_to_buffer_transform); +} + +FastInkView::ScopedPaint::~ScopedPaint() { + if (buffer_rect_.IsEmpty()) + return; + + { + TRACE_EVENT0("ui", "FastInkView::ScopedPaint::Map"); + + if (!gpu_memory_buffer_->Map()) { + LOG(ERROR) << "Failed to map GPU memory buffer"; + return; + } + } + + // Copy result to GPU memory buffer. This is effectively a memcpy and unlike + // drawing to the buffer directly this ensures that the buffer is never in a + // state that would result in flicker. + { + TRACE_EVENT1("ui", "FastInkView::ScopedPaint::Copy", "buffer_rect", + buffer_rect_.ToString()); + + uint8_t* data = static_cast<uint8_t*>(gpu_memory_buffer_->memory(0)); + int stride = gpu_memory_buffer_->stride(0); + canvas_.GetBitmap().readPixels( + SkImageInfo::MakeN32Premul(buffer_rect_.width(), buffer_rect_.height()), + data + buffer_rect_.y() * stride + buffer_rect_.x() * 4, stride, 0, 0); + } + + { + TRACE_EVENT0("ui", "FastInkView::UpdateBuffer::Unmap"); + + // Unmap to flush writes to buffer. + gpu_memory_buffer_->Unmap(); + } +} + struct FastInkView::Resource { Resource() = default; ~Resource() { @@ -63,6 +115,7 @@ uint32_t image = 0; gpu::Mailbox mailbox; gpu::SyncToken sync_token; + bool damaged = true; }; class FastInkView::LayerTreeFrameSinkHolder @@ -126,6 +179,11 @@ frame_sink_->SubmitCompositorFrame(std::move(frame)); } + void DamageExportedResources() { + for (auto& entry : exported_resources_) + entry.second->damaged = true; + } + // Overridden from cc::LayerTreeFrameSinkClient: void SetBeginFrameSource(viz::BeginFrameSource* source) override {} void ReclaimResources( @@ -196,7 +254,7 @@ DISALLOW_COPY_AND_ASSIGN(LayerTreeFrameSinkHolder); }; -FastInkView::FastInkView(aura::Window* root_window) : weak_ptr_factory_(this) { +FastInkView::FastInkView(aura::Window* container) : weak_ptr_factory_(this) { widget_.reset(new views::Widget); views::Widget::InitParams params; params.type = views::Widget::InitParams::TYPE_WINDOW_FRAMELESS; @@ -205,14 +263,14 @@ params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; - params.parent = - Shell::GetContainer(root_window, kShellWindowId_OverlayContainer); + params.parent = container; params.layer_type = ui::LAYER_SOLID_COLOR; + gfx::Rect screen_bounds = container->GetRootWindow()->GetBoundsInScreen(); widget_->Init(params); widget_->Show(); widget_->SetContentsView(this); - widget_->SetBounds(root_window->GetBoundsInScreen()); + widget_->SetBounds(screen_bounds); set_owned_by_client(); // Take the root transform and apply this during buffer update instead of @@ -224,6 +282,28 @@ screen_to_buffer_transform_ = widget_->GetNativeWindow()->GetHost()->GetRootTransform(); + buffer_size_ = gfx::ToEnclosedRect(cc::MathUtil::MapClippedRect( + screen_to_buffer_transform_, + gfx::RectF(screen_bounds.width(), + screen_bounds.height()))) + .size(); + + // Create a single GPU memory buffer. Content will be written into this + // buffer without any buffering. The result is that we might be modifying + // the buffer while it's being displayed. This provides minimal latency + // but with potential tearing. Note that we have to draw into a temporary + // surface and copy it into GPU memory buffer to avoid flicker. + gpu_memory_buffer_ = + aura::Env::GetInstance() + ->context_factory() + ->GetGpuMemoryBufferManager() + ->CreateGpuMemoryBuffer(buffer_size_, + SK_B32_SHIFT ? gfx::BufferFormat::RGBA_8888 + : gfx::BufferFormat::BGRA_8888, + gfx::BufferUsage::SCANOUT_CPU_READ_WRITE, + gpu::kNullSurfaceHandle); + LOG_IF(ERROR, !gpu_memory_buffer_) << "Failed to create GPU memory buffer"; + frame_sink_holder_ = std::make_unique<LayerTreeFrameSinkHolder>( this, widget_->GetNativeView()->CreateLayerTreeFrameSink()); } @@ -233,133 +313,50 @@ std::move(frame_sink_holder_)); } -void FastInkView::UpdateDamageRect(const gfx::Rect& rect) { - buffer_damage_rect_.Union(rect); +void FastInkView::UpdateSurface(const gfx::Rect& content_rect, + const gfx::Rect& damage_rect, + bool auto_refresh) { + content_rect_ = content_rect; + damage_rect_.Union(damage_rect); + auto_refresh_ = auto_refresh; + pending_compositor_frame_ = true; + + if (!damage_rect.IsEmpty()) { + frame_sink_holder_->DamageExportedResources(); + for (auto& resource : returned_resources_) + resource->damaged = true; + } + + if (!pending_compositor_frame_ack_) + SubmitCompositorFrame(); } -void FastInkView::RequestRedraw() { - if (pending_redraw_) - return; +void FastInkView::SubmitCompositorFrame() { + TRACE_EVENT1("ui", "FastInkView::SubmitCompositorFrame", "damage", + damage_rect_.ToString()); - pending_redraw_ = true; - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, - base::Bind(&FastInkView::Redraw, weak_ptr_factory_.GetWeakPtr())); -} + float device_scale_factor = widget_->GetLayer()->device_scale_factor(); + gfx::Rect output_rect(gfx::ConvertSizeToPixel( + device_scale_factor, + widget_->GetNativeView()->GetBoundsInScreen().size())); -void FastInkView::Redraw() { - DCHECK(pending_redraw_); - pending_redraw_ = false; - - if (!buffer_damage_rect_.IsEmpty()) { - // Defer buffer update if damage exceeds the bounds of the pending - // draw surface rectangle. This prevents visible artifacts at the - // border of the draw surface rectangle when compositing. - // Note: Draw surface rectangle is expanded to prevent this from - // causing a performance problem during normal usage. - if (pending_draw_surface_rect_.IsEmpty() || - pending_draw_surface_rect_.Contains(buffer_damage_rect_)) { - UpdateBuffer(); - } + gfx::Rect quad_rect; + gfx::Rect damage_rect; + // Continuously redraw the full output rectangle when in auto-refresh mode. + // This is necessary in order to allow single buffered updates without having + // buffer changes outside the contents area cause artifacts. + if (auto_refresh_) { + quad_rect = gfx::Rect(buffer_size_); + damage_rect = gfx::Rect(output_rect); + } else { + // Use minimal quad and damage rectangles when auto-refresh mode is off. + quad_rect = BufferRectFromScreenRect(screen_to_buffer_transform_, + buffer_size_, content_rect_); + damage_rect = gfx::ConvertRectToPixel(device_scale_factor, damage_rect_); + damage_rect.Intersect(output_rect); + pending_compositor_frame_ = false; } - - if (!surface_damage_rect_.IsEmpty()) { - // Defer surface update if a frame is already in-flight. - if (!pending_draw_surface_) - UpdateSurface(); - } -} - -void FastInkView::UpdateBuffer() { - TRACE_EVENT1("ui", "FastInkView::UpdateBuffer", "damage", - buffer_damage_rect_.ToString()); - - gfx::Rect screen_bounds = widget_->GetNativeView()->GetBoundsInScreen(); - gfx::Rect update_rect = buffer_damage_rect_; - buffer_damage_rect_ = gfx::Rect(); - - // Create and map a single GPU memory buffer. The fast ink will be - // written into this buffer without any buffering. The result is that we - // might be modifying the buffer while it's being displayed. This provides - // minimal latency but potential tearing. Note that we have to draw into - // a temporary surface and copy it into GPU memory buffer to avoid flicker. - if (!gpu_memory_buffer_) { - TRACE_EVENT0("ui", "FastInkView::UpdateBuffer::Create"); - - gpu_memory_buffer_ = - aura::Env::GetInstance() - ->context_factory() - ->GetGpuMemoryBufferManager() - ->CreateGpuMemoryBuffer( - gfx::ToEnclosedRect(cc::MathUtil::MapClippedRect( - screen_to_buffer_transform_, - gfx::RectF(screen_bounds.width(), - screen_bounds.height()))) - .size(), - SK_B32_SHIFT ? gfx::BufferFormat::RGBA_8888 - : gfx::BufferFormat::BGRA_8888, - gfx::BufferUsage::SCANOUT_CPU_READ_WRITE, - gpu::kNullSurfaceHandle); - if (!gpu_memory_buffer_) { - LOG(ERROR) << "Failed to allocate GPU memory buffer"; - return; - } - - // Make sure the first update rectangle covers the whole buffer. - update_rect = gfx::Rect(screen_bounds.size()); - } - - // Convert update rectangle to pixel coordinates. - gfx::Rect pixel_rect = cc::MathUtil::MapEnclosingClippedRect( - screen_to_buffer_transform_, update_rect); - - // Constrain pixel rectangle to buffer size and early out if empty. - pixel_rect.Intersect(gfx::Rect(gpu_memory_buffer_->GetSize())); - if (pixel_rect.IsEmpty()) - return; - - // Map buffer for writing. - if (!gpu_memory_buffer_->Map()) { - LOG(ERROR) << "Failed to map GPU memory buffer"; - return; - } - - // Create a temporary canvas for update rectangle. - gfx::Canvas canvas(pixel_rect.size(), 1.0f, false); - canvas.Translate(-pixel_rect.OffsetFromOrigin()); - canvas.Transform(screen_to_buffer_transform_); - - { - TRACE_EVENT1("ui", "FastInkView::UpdateBuffer::Paint", "pixel_rect", - pixel_rect.ToString()); - - OnRedraw(canvas); - } - - // Copy result to GPU memory buffer. This is effectively a memcpy and unlike - // drawing to the buffer directly this ensures that the buffer is never in a - // state that would result in flicker. - { - TRACE_EVENT1("ui", "FastInkView::UpdateBuffer::Copy", "pixel_rect", - pixel_rect.ToString()); - - uint8_t* data = static_cast<uint8_t*>(gpu_memory_buffer_->memory(0)); - int stride = gpu_memory_buffer_->stride(0); - canvas.GetBitmap().readPixels( - SkImageInfo::MakeN32Premul(pixel_rect.width(), pixel_rect.height()), - data + pixel_rect.y() * stride + pixel_rect.x() * 4, stride, 0, 0); - } - - // Unmap to flush writes to buffer. - gpu_memory_buffer_->Unmap(); - - // Update surface damage rectangle. - surface_damage_rect_.Union(update_rect); -} - -void FastInkView::UpdateSurface() { - TRACE_EVENT1("ui", "FastInkView::UpdateSurface", "damage", - surface_damage_rect_.ToString()); + damage_rect_ = gfx::Rect(); std::unique_ptr<Resource> resource; // Reuse returned resource if available. @@ -372,78 +369,79 @@ if (!resource) resource = std::make_unique<Resource>(); - // Acquire context provider for resource if needed. - // Note: We make no attempts to recover if the context provider is later - // lost. It is expected that this class is short-lived and requiring a - // new instance to be created in lost context situations is acceptable and - // keeps the code simple. - if (!resource->context_provider) { - resource->context_provider = aura::Env::GetInstance() - ->context_factory() - ->SharedMainThreadContextProvider(); + if (resource->damaged) { + // Acquire context provider for resource if needed. + // Note: We make no attempts to recover if the context provider is later + // lost. It is expected that this class is short-lived and requiring a + // new instance to be created in lost context situations is acceptable and + // keeps the code simple. if (!resource->context_provider) { - LOG(ERROR) << "Failed to acquire a context provider"; - return; + resource->context_provider = aura::Env::GetInstance() + ->context_factory() + ->SharedMainThreadContextProvider(); + if (!resource->context_provider) { + LOG(ERROR) << "Failed to acquire a context provider"; + return; + } } - } - gpu::gles2::GLES2Interface* gles2 = resource->context_provider->ContextGL(); + gpu::gles2::GLES2Interface* gles2 = resource->context_provider->ContextGL(); - if (resource->sync_token.HasData()) { - gles2->WaitSyncTokenCHROMIUM(resource->sync_token.GetConstData()); - resource->sync_token = gpu::SyncToken(); - } - - if (resource->texture) { - gles2->ActiveTexture(GL_TEXTURE0); - gles2->BindTexture(GL_TEXTURE_2D, resource->texture); - } else { - gles2->GenTextures(1, &resource->texture); - gles2->ActiveTexture(GL_TEXTURE0); - gles2->BindTexture(GL_TEXTURE_2D, resource->texture); - gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - gles2->GenMailboxCHROMIUM(resource->mailbox.name); - gles2->ProduceTextureDirectCHROMIUM(resource->texture, - resource->mailbox.name); - } - - gfx::Size buffer_size = gpu_memory_buffer_->GetSize(); - - if (resource->image) { - gles2->ReleaseTexImage2DCHROMIUM(GL_TEXTURE_2D, resource->image); - } else { - resource->image = gles2->CreateImageCHROMIUM( - gpu_memory_buffer_->AsClientBuffer(), buffer_size.width(), - buffer_size.height(), SK_B32_SHIFT ? GL_RGBA : GL_BGRA_EXT); - if (!resource->image) { - LOG(ERROR) << "Failed to create image"; - return; + if (resource->sync_token.HasData()) { + gles2->WaitSyncTokenCHROMIUM(resource->sync_token.GetConstData()); + resource->sync_token = gpu::SyncToken(); } - } - gles2->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, resource->image); - gpu::SyncToken sync_token; - // For mus and mash, the compositor isn't sharing the GPU channel with - // FastInkView, so it cannot consume unverified sync token generated here. - // We need generate verified sync token for mus and mash. - if (ash::Shell::GetAshConfig() == ash::Config::CLASSIC) - gles2->GenUnverifiedSyncTokenCHROMIUM(sync_token.GetData()); - else - gles2->GenSyncTokenCHROMIUM(sync_token.GetData()); + if (resource->texture) { + gles2->ActiveTexture(GL_TEXTURE0); + gles2->BindTexture(GL_TEXTURE_2D, resource->texture); + } else { + gles2->GenTextures(1, &resource->texture); + gles2->ActiveTexture(GL_TEXTURE0); + gles2->BindTexture(GL_TEXTURE_2D, resource->texture); + gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + gles2->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + gles2->GenMailboxCHROMIUM(resource->mailbox.name); + gles2->ProduceTextureDirectCHROMIUM(resource->texture, + resource->mailbox.name); + } + + if (resource->image) { + gles2->ReleaseTexImage2DCHROMIUM(GL_TEXTURE_2D, resource->image); + } else { + resource->image = gles2->CreateImageCHROMIUM( + gpu_memory_buffer_->AsClientBuffer(), buffer_size_.width(), + buffer_size_.height(), SK_B32_SHIFT ? GL_RGBA : GL_BGRA_EXT); + if (!resource->image) { + LOG(ERROR) << "Failed to create image"; + return; + } + } + gles2->BindTexImage2DCHROMIUM(GL_TEXTURE_2D, resource->image); + + // For mus and mash, the compositor isn't sharing the GPU channel with + // FastInkView, so it cannot consume unverified sync token generated here. + // We need generate verified sync token for mus and mash. + if (ash::Shell::GetAshConfig() == ash::Config::CLASSIC) + gles2->GenUnverifiedSyncTokenCHROMIUM(resource->sync_token.GetData()); + else + gles2->GenSyncTokenCHROMIUM(resource->sync_token.GetData()); + + resource->damaged = false; + } viz::TransferableResource transferable_resource; transferable_resource.id = next_resource_id_++; transferable_resource.format = viz::RGBA_8888; transferable_resource.filter = GL_LINEAR; - transferable_resource.size = buffer_size; - transferable_resource.mailbox_holder = - gpu::MailboxHolder(resource->mailbox, sync_token, GL_TEXTURE_2D); - transferable_resource.is_overlay_candidate = true; + transferable_resource.size = buffer_size_; + transferable_resource.mailbox_holder = gpu::MailboxHolder( + resource->mailbox, resource->sync_token, GL_TEXTURE_2D); + // Use HW overlay if continuous updates are expected. + transferable_resource.is_overlay_candidate = auto_refresh_; - float device_scale_factor = widget_->GetLayer()->device_scale_factor(); gfx::Transform target_to_buffer_transform(screen_to_buffer_transform_); target_to_buffer_transform.Scale(1.f / device_scale_factor, 1.f / device_scale_factor); @@ -452,24 +450,6 @@ bool rv = target_to_buffer_transform.GetInverse(&buffer_to_target_transform); DCHECK(rv); - gfx::Rect output_rect(gfx::ConvertSizeToPixel( - device_scale_factor, - widget_->GetNativeView()->GetBoundsInScreen().size())); - gfx::Rect quad_rect(buffer_size); - bool needs_blending = true; - - // Expand surface damage to allow single buffer updates while frame - // is in-flight. - surface_damage_rect_.Inset(-kSurfaceDamageOutsetDIP, - -kSurfaceDamageOutsetDIP); - pending_draw_surface_rect_ = surface_damage_rect_; - - gfx::Rect damage_rect = - gfx::ConvertRectToPixel(device_scale_factor, surface_damage_rect_); - surface_damage_rect_ = gfx::Rect(); - // Constrain damage rectangle to output rectangle. - damage_rect.Intersect(output_rect); - const int kRenderPassId = 1; std::unique_ptr<viz::RenderPass> render_pass = viz::RenderPass::Create(); render_pass->SetNew(kRenderPassId, output_rect, damage_rect, @@ -491,43 +471,47 @@ frame.metadata.begin_frame_ack = viz::BeginFrameAck::CreateManualAckWithDamage(); frame.metadata.device_scale_factor = device_scale_factor; + viz::TextureDrawQuad* texture_quad = render_pass->CreateAndAppendDrawQuad<viz::TextureDrawQuad>(); - float vertex_opacity[4] = {1.0, 1.0, 1.0, 1.0}; - gfx::PointF uv_top_left(0.f, 0.f); - gfx::PointF uv_bottom_right(1.f, 1.f); - texture_quad->SetNew(quad_state, quad_rect, quad_rect, needs_blending, - transferable_resource.id, true, uv_top_left, - uv_bottom_right, SK_ColorTRANSPARENT, vertex_opacity, - false, false, false); + float vertex_opacity[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + gfx::RectF uv_crop(quad_rect); + uv_crop.Scale(1.f / buffer_size_.width(), 1.f / buffer_size_.height()); + texture_quad->SetNew(quad_state, quad_rect, quad_rect, + /*needs_blending=*/true, transferable_resource.id, + /*premultiplied_alpha=*/true, uv_crop.origin(), + uv_crop.bottom_right(), + /*background_color=*/SK_ColorTRANSPARENT, vertex_opacity, + /*y_flipped=*/false, + /*nearest_neighbor=*/false, + /*secure_output_only=*/false); texture_quad->set_resource_size_in_pixels(transferable_resource.size); frame.resource_list.push_back(transferable_resource); - frame.render_pass_list.push_back(std::move(render_pass)); + DCHECK(!pending_compositor_frame_ack_); + pending_compositor_frame_ack_ = true; + + frame.render_pass_list.push_back(std::move(render_pass)); frame_sink_holder_->SubmitCompositorFrame( std::move(frame), transferable_resource.id, std::move(resource)); +} - DCHECK(!pending_draw_surface_); - pending_draw_surface_ = true; +void FastInkView::SubmitPendingCompositorFrame() { + if (pending_compositor_frame_ && !pending_compositor_frame_ack_) + SubmitCompositorFrame(); } void FastInkView::DidReceiveCompositorFrameAck() { - base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(&FastInkView::OnDidDrawSurface, - weak_ptr_factory_.GetWeakPtr())); + pending_compositor_frame_ack_ = false; + if (pending_compositor_frame_) { + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&FastInkView::SubmitPendingCompositorFrame, + weak_ptr_factory_.GetWeakPtr())); + } } void FastInkView::ReclaimResource(std::unique_ptr<Resource> resource) { returned_resources_.push_back(std::move(resource)); } -void FastInkView::OnDidDrawSurface() { - pending_draw_surface_ = false; - pending_draw_surface_rect_ = gfx::Rect(); - if (!buffer_damage_rect_.IsEmpty()) - UpdateBuffer(); - if (!surface_damage_rect_.IsEmpty()) - UpdateSurface(); -} - } // namespace ash
diff --git a/ash/fast_ink/fast_ink_view.h b/ash/fast_ink/fast_ink_view.h index 2e47bfe..ad32cde 100644 --- a/ash/fast_ink/fast_ink_view.h +++ b/ash/fast_ink/fast_ink_view.h
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "components/viz/common/resources/resource_id.h" +#include "ui/gfx/canvas.h" #include "ui/views/view.h" namespace aura { @@ -28,43 +29,63 @@ namespace ash { -// FastInkView is a view supporting low-latency rendering. +// FastInkView is a view supporting low-latency rendering. The view can enter +// 'auto-refresh' mode in order to provide minimum latency updates for the +// associated widget. 'auto-refresh' mode will take advantage of HW overlays +// when possible and trigger continious updates. class FastInkView : public views::View { public: // Creates a FastInkView filling the bounds of |root_window|. // If |root_window| is resized (e.g. due to a screen size change), // a new instance of FastInkView should be created. - explicit FastInkView(aura::Window* root_window); + explicit FastInkView(aura::Window* container); ~FastInkView() override; protected: - // Unions |rect| with the current damage rect. - void UpdateDamageRect(const gfx::Rect& rect); + // Helper class that provides flicker free painting to a GPU memory buffer. + class ScopedPaint { + public: + ScopedPaint(gfx::GpuMemoryBuffer* gpu_memory_buffer, + const gfx::Transform& screen_to_buffer_transform, + const gfx::Rect& rect); + ~ScopedPaint(); - void RequestRedraw(); + gfx::Canvas& canvas() { return canvas_; } - // Draw the contents of the view in the provided canvas. - virtual void OnRedraw(gfx::Canvas& canvas) = 0; + private: + gfx::GpuMemoryBuffer* const gpu_memory_buffer_; + const gfx::Rect buffer_rect_; + gfx::Canvas canvas_; + + DISALLOW_COPY_AND_ASSIGN(ScopedPaint); + }; + + // Update content and damage rectangles for surface. |auto_refresh| should + // be set to true if continous updates are expected within content rectangle. + void UpdateSurface(const gfx::Rect& content_rect, + const gfx::Rect& damage_rect, + bool auto_refresh); + + // Constants initialized in constructor. + gfx::Transform screen_to_buffer_transform_; + gfx::Size buffer_size_; + std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer_; private: class LayerTreeFrameSinkHolder; struct Resource; - void Redraw(); - void UpdateBuffer(); - void UpdateSurface(); + void SubmitCompositorFrame(); + void SubmitPendingCompositorFrame(); void ReclaimResource(std::unique_ptr<Resource> resource); void DidReceiveCompositorFrameAck(); - void OnDidDrawSurface(); std::unique_ptr<views::Widget> widget_; - gfx::Transform screen_to_buffer_transform_; - std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer_; - gfx::Rect buffer_damage_rect_; - bool pending_redraw_ = false; - gfx::Rect surface_damage_rect_; - bool pending_draw_surface_ = false; - gfx::Rect pending_draw_surface_rect_; + gfx::Rect content_rect_; + gfx::Rect damage_rect_; + bool auto_refresh_ = false; + bool pending_compositor_frame_ = false; + bool pending_compositor_frame_ack_ = false; int next_resource_id_ = 1; std::vector<std::unique_ptr<Resource>> returned_resources_; std::unique_ptr<LayerTreeFrameSinkHolder> frame_sink_holder_;
diff --git a/ash/highlighter/highlighter_controller.cc b/ash/highlighter/highlighter_controller.cc index 9f89de8..3267f76 100644 --- a/ash/highlighter/highlighter_controller.cc +++ b/ash/highlighter/highlighter_controller.cc
@@ -11,6 +11,8 @@ #include "ash/highlighter/highlighter_result_view.h" #include "ash/highlighter/highlighter_view.h" #include "ash/public/cpp/scale_utility.h" +#include "ash/public/cpp/shell_window_ids.h" +#include "ash/shell.h" #include "base/metrics/histogram_macros.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" @@ -110,8 +112,9 @@ void HighlighterController::CreatePointerView( base::TimeDelta presentation_delay, aura::Window* root_window) { - highlighter_view_ = - std::make_unique<HighlighterView>(presentation_delay, root_window); + highlighter_view_ = std::make_unique<HighlighterView>( + presentation_delay, + Shell::GetContainer(root_window, kShellWindowId_OverlayContainer)); result_view_.reset(); }
diff --git a/ash/highlighter/highlighter_view.cc b/ash/highlighter/highlighter_view.cc index 6d984d7..9bed51d66 100644 --- a/ash/highlighter/highlighter_view.cc +++ b/ash/highlighter/highlighter_view.cc
@@ -7,6 +7,7 @@ #include <memory> #include "ash/highlighter/highlighter_gesture_util.h" +#include "base/threading/thread_task_runner_handle.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkTypes.h" #include "ui/aura/window.h" @@ -69,11 +70,12 @@ const gfx::SizeF HighlighterView::kPenTipSize(kPenTipWidth, kPenTipHeight); HighlighterView::HighlighterView(base::TimeDelta presentation_delay, - aura::Window* root_window) - : FastInkView(root_window), + aura::Window* container) + : FastInkView(container), points_(base::TimeDelta()), predicted_points_(base::TimeDelta()), - presentation_delay_(presentation_delay) {} + presentation_delay_(presentation_delay), + weak_ptr_factory_(this) {} HighlighterView::~HighlighterView() = default; @@ -89,26 +91,30 @@ : 0); // The new segment needs to be drawn. if (!points_.IsEmpty()) { - UpdateDamageRect(InflateDamageRect(gfx::ToEnclosingRect( + highlighter_damage_rect_.Union(InflateDamageRect(gfx::ToEnclosingRect( gfx::BoundingRect(points_.GetNewest().location, point)))); } // Previous prediction needs to be erased. - if (!predicted_points_.IsEmpty()) - UpdateDamageRect(InflateDamageRect(predicted_points_.GetBoundingBox())); + if (!predicted_points_.IsEmpty()) { + highlighter_damage_rect_.Union( + InflateDamageRect(predicted_points_.GetBoundingBox())); + } points_.AddPoint(point, time); base::TimeTicks current_time = ui::EventTimeForNow(); - predicted_points_.Predict( - points_, current_time, presentation_delay_, - GetWidget()->GetNativeView()->GetBoundsInScreen().size()); + gfx::Rect screen_bounds = GetWidget()->GetNativeView()->GetBoundsInScreen(); + predicted_points_.Predict(points_, current_time, presentation_delay_, + screen_bounds.size()); // New prediction needs to be drawn. - if (!predicted_points_.IsEmpty()) - UpdateDamageRect(InflateDamageRect(predicted_points_.GetBoundingBox())); + if (!predicted_points_.IsEmpty()) { + highlighter_damage_rect_.Union( + InflateDamageRect(predicted_points_.GetBoundingBox())); + } - RequestRedraw(); + ScheduleUpdateBuffer(); } void HighlighterView::AddGap() { @@ -121,8 +127,8 @@ animation_timer_ = std::make_unique<base::OneShotTimer>(); animation_timer_->Start( FROM_HERE, base::TimeDelta::FromMilliseconds(kStrokeFadeoutDelayMs), - base::Bind(&HighlighterView::FadeOut, base::Unretained(this), pivot, - gesture_type, done)); + base::BindRepeating(&HighlighterView::FadeOut, base::Unretained(this), + pivot, gesture_type, done)); } void HighlighterView::FadeOut(const gfx::PointF& pivot, @@ -162,7 +168,36 @@ animation_timer_->Start(FROM_HERE, duration, done); } -void HighlighterView::OnRedraw(gfx::Canvas& canvas) { +void HighlighterView::ScheduleUpdateBuffer() { + if (pending_update_buffer_) + return; + + pending_update_buffer_ = true; + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&HighlighterView::UpdateBuffer, + weak_ptr_factory_.GetWeakPtr())); +} + +void HighlighterView::UpdateBuffer() { + TRACE_EVENT1("ui", "FastInkView::UpdateBuffer", "damage", + highlighter_damage_rect_.ToString()); + + DCHECK(pending_update_buffer_); + pending_update_buffer_ = false; + + { + ScopedPaint paint(gpu_memory_buffer_.get(), screen_to_buffer_transform_, + highlighter_damage_rect_); + + Draw(paint.canvas()); + } + + gfx::Rect screen_bounds = GetWidget()->GetNativeView()->GetBoundsInScreen(); + UpdateSurface(screen_bounds, highlighter_damage_rect_, /*auto_refresh=*/true); + highlighter_damage_rect_ = gfx::Rect(); +} + +void HighlighterView::Draw(gfx::Canvas& canvas) { const int num_points = points_.GetNumberOfPoints() + predicted_points_.GetNumberOfPoints(); if (num_points < 2)
diff --git a/ash/highlighter/highlighter_view.h b/ash/highlighter/highlighter_view.h index 36e8e4f8..e508e4f5 100644 --- a/ash/highlighter/highlighter_view.h +++ b/ash/highlighter/highlighter_view.h
@@ -32,17 +32,14 @@ static const gfx::SizeF kPenTipSize; HighlighterView(const base::TimeDelta presentation_delay, - aura::Window* root_window); + aura::Window* container); ~HighlighterView() override; const FastInkPoints& points() const { return points_; } - bool animating() const { return animation_timer_.get(); } void AddNewPoint(const gfx::PointF& new_point, const base::TimeTicks& time); - void AddGap(); - void Animate(const gfx::PointF& pivot, HighlighterGestureType gesture_type, const base::Closure& done); @@ -50,17 +47,20 @@ private: friend class HighlighterControllerTestApi; - void OnRedraw(gfx::Canvas& canvas) override; - void FadeOut(const gfx::PointF& pivot, HighlighterGestureType gesture_type, const base::Closure& done); + void ScheduleUpdateBuffer(); + void UpdateBuffer(); + void Draw(gfx::Canvas& canvas); FastInkPoints points_; FastInkPoints predicted_points_; const base::TimeDelta presentation_delay_; - std::unique_ptr<base::OneShotTimer> animation_timer_; + gfx::Rect highlighter_damage_rect_; + bool pending_update_buffer_ = false; + base::WeakPtrFactory<HighlighterView> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(HighlighterView); };
diff --git a/ash/laser/laser_pointer_controller.cc b/ash/laser/laser_pointer_controller.cc index 3fca5c0..ed6f097 100644 --- a/ash/laser/laser_pointer_controller.cc +++ b/ash/laser/laser_pointer_controller.cc
@@ -7,6 +7,8 @@ #include <memory> #include "ash/laser/laser_pointer_view.h" +#include "ash/public/cpp/shell_window_ids.h" +#include "ash/shell.h" #include "ui/display/screen.h" #include "ui/events/base_event_utils.h" #include "ui/views/widget/widget.h" @@ -50,14 +52,14 @@ base::TimeDelta::FromMilliseconds(kPointLifeDurationMs), presentation_delay, base::TimeDelta::FromMilliseconds(kAddStationaryPointsDelayMs), - root_window); + Shell::GetContainer(root_window, kShellWindowId_OverlayContainer)); } void LaserPointerController::UpdatePointerView(ui::TouchEvent* event) { laser_pointer_view_->AddNewPoint(event->root_location_f(), event->time_stamp()); if (event->type() == ui::ET_TOUCH_RELEASED) { - laser_pointer_view_->FadeOut(base::Bind( + laser_pointer_view_->FadeOut(base::BindOnce( &LaserPointerController::DestroyPointerView, base::Unretained(this))); } }
diff --git a/ash/laser/laser_pointer_view.cc b/ash/laser/laser_pointer_view.cc index c4feab6..49ada7ae 100644 --- a/ash/laser/laser_pointer_view.cc +++ b/ash/laser/laser_pointer_view.cc
@@ -5,6 +5,7 @@ #include "ash/laser/laser_pointer_view.h" #include "ash/laser/laser_segment_utils.h" +#include "base/threading/thread_task_runner_handle.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkTypes.h" #include "ui/aura/window.h" @@ -158,16 +159,18 @@ LaserPointerView::LaserPointerView(base::TimeDelta life_duration, base::TimeDelta presentation_delay, base::TimeDelta stationary_point_delay, - aura::Window* root_window) - : FastInkView(root_window), + aura::Window* container) + : FastInkView(container), laser_points_(life_duration), predicted_laser_points_(life_duration), presentation_delay_(presentation_delay), - stationary_timer_(new base::Timer( - FROM_HERE, - stationary_point_delay, - base::Bind(&LaserPointerView::UpdateTime, base::Unretained(this)), - true /* is_repeating */)) {} + stationary_timer_( + new base::Timer(FROM_HERE, + stationary_point_delay, + base::BindRepeating(&LaserPointerView::UpdateTime, + base::Unretained(this)), + /*is_repeating=*/true)), + weak_ptr_factory_(this) {} LaserPointerView::~LaserPointerView() = default; @@ -186,9 +189,12 @@ stationary_timer_->Reset(); } +void LaserPointerView::FadeOut(base::OnceClosure done) { + fadeout_done_ = std::move(done); +} + void LaserPointerView::AddPoint(const gfx::PointF& point, const base::TimeTicks& time) { - UpdateDamageRect(GetBoundingBox()); laser_points_.AddPoint(point, time); // Current time is needed to determine presentation time and the number of @@ -203,12 +209,37 @@ laser_points_.MoveForwardToTime(next_presentation_time); predicted_laser_points_.MoveForwardToTime(next_presentation_time); - UpdateDamageRect(GetBoundingBox()); - RequestRedraw(); + ScheduleUpdateBuffer(); } -void LaserPointerView::FadeOut(const base::Closure& done) { - fadeout_done_ = done; +void LaserPointerView::ScheduleUpdateBuffer() { + if (pending_update_buffer_) + return; + + pending_update_buffer_ = true; + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&LaserPointerView::UpdateBuffer, + weak_ptr_factory_.GetWeakPtr())); +} + +void LaserPointerView::UpdateBuffer() { + DCHECK(pending_update_buffer_); + pending_update_buffer_ = false; + + gfx::Rect damage_rect = laser_content_rect_; + laser_content_rect_ = GetBoundingBox(); + damage_rect.Union(laser_content_rect_); + + { + TRACE_EVENT1("ui", "LaserPointerView::UpdateBuffer::Paint", "damage", + damage_rect.ToString()); + + ScopedPaint paint(gpu_memory_buffer_.get(), screen_to_buffer_transform_, + damage_rect); + Draw(paint.canvas()); + } + + UpdateSurface(laser_content_rect_, damage_rect, /*auto_refresh=*/true); } void LaserPointerView::UpdateTime() { @@ -220,20 +251,18 @@ if (laser_points_.IsEmpty() && predicted_laser_points_.IsEmpty()) { // No points left to show, complete the fadeout. - fadeout_done_.Run(); // this will delete this LaserPointerView instance. + std::move(fadeout_done_).Run(); // This will delete the LaserPointerView. return; } - // Continue fading out the existing points - UpdateDamageRect(GetBoundingBox()); // Do not add the point but advance the time if the view is in process of // fading away. base::TimeTicks next_presentation_time = ui::EventTimeForNow() + presentation_delay_; laser_points_.MoveForwardToTime(next_presentation_time); predicted_laser_points_.MoveForwardToTime(next_presentation_time); - UpdateDamageRect(GetBoundingBox()); - RequestRedraw(); + + ScheduleUpdateBuffer(); } gfx::Rect LaserPointerView::GetBoundingBox() { @@ -265,7 +294,7 @@ return bounding_box; } -void LaserPointerView::OnRedraw(gfx::Canvas& canvas) { +void LaserPointerView::Draw(gfx::Canvas& canvas) { cc::PaintFlags flags; flags.setStyle(cc::PaintFlags::kFill_Style); flags.setAntiAlias(true);
diff --git a/ash/laser/laser_pointer_view.h b/ash/laser/laser_pointer_view.h index f731d46e..4fd9b330 100644 --- a/ash/laser/laser_pointer_view.h +++ b/ash/laser/laser_pointer_view.h
@@ -18,39 +18,37 @@ LaserPointerView(base::TimeDelta life_duration, base::TimeDelta presentation_delay, base::TimeDelta stationary_point_delay, - aura::Window* root_window); + aura::Window* container); ~LaserPointerView() override; void AddNewPoint(const gfx::PointF& new_point, const base::TimeTicks& new_time); - - void FadeOut(const base::Closure& done); + void FadeOut(base::OnceClosure done); private: friend class LaserPointerControllerTestApi; - gfx::Rect GetBoundingBox(); - void AddPoint(const gfx::PointF& point, const base::TimeTicks& time); - + void ScheduleUpdateBuffer(); + void UpdateBuffer(); // Timer callback which adds a point where the stylus was last seen. // This allows the trail to fade away when the stylus is stationary. void UpdateTime(); - - // FastInkView: - void OnRedraw(gfx::Canvas& canvas) override; + gfx::Rect GetBoundingBox(); + void Draw(gfx::Canvas& canvas); FastInkPoints laser_points_; FastInkPoints predicted_laser_points_; const base::TimeDelta presentation_delay_; - // Timer which will add a new stationary point when the stylus stops moving. // This will remove points that are too old. std::unique_ptr<base::Timer> stationary_timer_; gfx::PointF stationary_point_location_; - // A callback for when the fadeout is complete. - base::Closure fadeout_done_; + base::OnceClosure fadeout_done_; + gfx::Rect laser_content_rect_; + bool pending_update_buffer_ = false; + base::WeakPtrFactory<LaserPointerView> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(LaserPointerView); };
diff --git a/ash/login/login_screen_controller.cc b/ash/login/login_screen_controller.cc index 0bcbf74..52a0855 100644 --- a/ash/login/login_screen_controller.cc +++ b/ash/login/login_screen_controller.cc
@@ -238,6 +238,12 @@ login_screen_client_->CancelAddUser(); } +void LoginScreenController::LoginAsGuest() { + if (!login_screen_client_) + return; + login_screen_client_->LoginAsGuest(); +} + void LoginScreenController::OnMaxIncorrectPasswordAttempted( const AccountId& account_id) { if (!login_screen_client_)
diff --git a/ash/login/login_screen_controller.h b/ash/login/login_screen_controller.h index 0de0dc57..f59325a 100644 --- a/ash/login/login_screen_controller.h +++ b/ash/login/login_screen_controller.h
@@ -83,6 +83,7 @@ void LoadWallpaper(const AccountId& account_id); void SignOutUser(); void CancelAddUser(); + void LoginAsGuest(); void OnMaxIncorrectPasswordAttempted(const AccountId& account_id); void FocusLockScreenApps(bool reverse);
diff --git a/ash/login/mock_login_screen_client.h b/ash/login/mock_login_screen_client.h index d6de8130..d03be3c 100644 --- a/ash/login/mock_login_screen_client.h +++ b/ash/login/mock_login_screen_client.h
@@ -49,6 +49,7 @@ MOCK_METHOD1(LoadWallpaper, void(const AccountId& account_id)); MOCK_METHOD0(SignOutUser, void()); MOCK_METHOD0(CancelAddUser, void()); + MOCK_METHOD0(LoginAsGuest, void()); MOCK_METHOD1(OnMaxIncorrectPasswordAttempted, void(const AccountId& account_id)); MOCK_METHOD1(FocusLockScreenApps, void(bool reverse));
diff --git a/ash/login/ui/login_bubble.cc b/ash/login/ui/login_bubble.cc index 30e38ec..aa3fb6a 100644 --- a/ash/login/ui/login_bubble.cc +++ b/ash/login/ui/login_bubble.cc
@@ -138,8 +138,10 @@ LoginBubble::~LoginBubble() { Shell::Get()->RemovePreTargetHandler(this); - if (bubble_view_) + if (bubble_view_) { bubble_view_->GetWidget()->RemoveObserver(this); + CloseImmediately(); + } } void LoginBubble::ShowErrorBubble(views::StyledLabel* label,
diff --git a/ash/manifest.json b/ash/manifest.json index 504a49a..2d7caa5 100644 --- a/ash/manifest.json +++ b/ash/manifest.json
@@ -35,6 +35,7 @@ // Test-only interfaces. "test": [ "ash::mojom::ShelfTestApi", + "ash::mojom::ShellTestApi", "ash::mojom::SystemTrayTestApi", "ash::mojom::TimeToFirstPresentRecorderTestApi" ], @@ -50,7 +51,8 @@ "catalog": [ "directory" ], "local_state": [ "pref_client" ], "ui": [ "display_dev", "window_manager", "video_detector" ], - "touch_hud": [ "mash:launchable" ] + "touch_hud": [ "mash:launchable" ], + "data_decoder": [ "image_decoder" ] } } }
diff --git a/ash/mojo_test_interface_factory.cc b/ash/mojo_test_interface_factory.cc index c5d9be2..260dad9 100644 --- a/ash/mojo_test_interface_factory.cc +++ b/ash/mojo_test_interface_factory.cc
@@ -8,9 +8,11 @@ #include "ash/metrics/time_to_first_present_recorder_test_api.h" #include "ash/public/interfaces/shelf_test_api.mojom.h" +#include "ash/public/interfaces/shell_test_api.mojom.h" #include "ash/public/interfaces/system_tray_test_api.mojom.h" #include "ash/public/interfaces/time_to_first_present_recorder_test_api.mojom.h" #include "ash/shelf/shelf_test_api.h" +#include "ash/shell_test_api.h" #include "ash/system/tray/system_tray_test_api.h" #include "base/bind.h" #include "base/single_thread_task_runner.h" @@ -26,6 +28,10 @@ ShelfTestApi::BindRequest(std::move(request)); } +void BindShellTestApiOnMainThread(mojom::ShellTestApiRequest request) { + ShellTestApi::BindRequest(std::move(request)); +} + void BindSystemTrayTestApiOnMainThread( mojom::SystemTrayTestApiRequest request) { SystemTrayTestApi::BindRequest(std::move(request)); @@ -43,6 +49,8 @@ scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner) { registry->AddInterface(base::Bind(&BindShelfTestApiOnMainThread), main_thread_task_runner); + registry->AddInterface(base::Bind(&BindShellTestApiOnMainThread), + main_thread_task_runner); registry->AddInterface(base::Bind(&BindSystemTrayTestApiOnMainThread), main_thread_task_runner); registry->AddInterface(
diff --git a/ash/public/cpp/ash_switches.cc b/ash/public/cpp/ash_switches.cc index 1d53dcd..98d3c3c 100644 --- a/ash/public/cpp/ash_switches.cc +++ b/ash/public/cpp/ash_switches.cc
@@ -64,6 +64,10 @@ const char kAshEnableMagnifierKeyScroller[] = "ash-enable-magnifier-key-scroller"; +// Enables the new overview ui. +// TODO(sammiequon): Remove this once the feature is launched. crbug.com/782330. +const char kAshEnableNewOverviewUi[] = "ash-enable-new-overview-ui"; + // Enable the Night Light feature. const char kAshEnableNightLight[] = "ash-enable-night-light";
diff --git a/ash/public/cpp/ash_switches.h b/ash/public/cpp/ash_switches.h index 90d1550d..77e67ea 100644 --- a/ash/public/cpp/ash_switches.h +++ b/ash/public/cpp/ash_switches.h
@@ -29,6 +29,7 @@ ASH_PUBLIC_EXPORT extern const char kAshEnableDisplayMoveWindowAccels[]; ASH_PUBLIC_EXPORT extern const char kAshEnableKeyboardShortcutViewer[]; ASH_PUBLIC_EXPORT extern const char kAshEnableMagnifierKeyScroller[]; +ASH_PUBLIC_EXPORT extern const char kAshEnableNewOverviewUi[]; ASH_PUBLIC_EXPORT extern const char kAshEnableNightLight[]; ASH_PUBLIC_EXPORT extern const char kAshEnablePaletteOnAllDisplays[]; ASH_PUBLIC_EXPORT extern const char kAshEnableScaleSettingsTray[];
diff --git a/ash/public/interfaces/BUILD.gn b/ash/public/interfaces/BUILD.gn index 85b3c36..af26099 100644 --- a/ash/public/interfaces/BUILD.gn +++ b/ash/public/interfaces/BUILD.gn
@@ -14,6 +14,7 @@ sources = [ "accelerator_controller.mojom", "accessibility_controller.mojom", + "app_list.mojom", "ash_display_controller.mojom", "ash_message_center_controller.mojom", "cast_config.mojom", @@ -53,6 +54,7 @@ public_deps = [ "//components/proximity_auth/public/interfaces", "//components/signin/public/interfaces", + "//components/sync/mojo:interfaces", "//mojo/common:common_custom_types", "//services/preferences/public/interfaces", "//skia/public/interfaces", @@ -71,6 +73,7 @@ testonly = true sources = [ "shelf_test_api.mojom", + "shell_test_api.mojom", "system_tray_test_api.mojom", "time_to_first_present_recorder_test_api.mojom", ]
diff --git a/ash/public/interfaces/app_list.mojom b/ash/public/interfaces/app_list.mojom new file mode 100644 index 0000000..066dd377 --- /dev/null +++ b/ash/public/interfaces/app_list.mojom
@@ -0,0 +1,21 @@ +// Copyright 2018 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 ash.mojom; + +import "components/sync/mojo/syncer.mojom"; + +// A structure holding the common information of AppListItem and +// ChromeAppListItem, which is sent between ash and chrome representing +// an app list item. +// This structure should be kept as small as possible so that minimum data +// is sent via mojo calls when an item is moved or reparented. +struct AppListItemMetadata { + string id; // The id of the app list item. + string name; // The app name of the item. + string folder_id; // The id of the item's folder. + syncer.mojom.StringOrdinal position; // The position of the item. + bool is_folder; // Whether this item is a folder. +}; +
diff --git a/ash/public/interfaces/login_screen.mojom b/ash/public/interfaces/login_screen.mojom index e2e097d..513eecc5 100644 --- a/ash/public/interfaces/login_screen.mojom +++ b/ash/public/interfaces/login_screen.mojom
@@ -127,6 +127,9 @@ // Close add user screen. CancelAddUser(); + // Launches guest mode. + LoginAsGuest(); + // User with |account_id| has reached maximum incorrect password attempts. OnMaxIncorrectPasswordAttempted(signin.mojom.AccountId account_id);
diff --git a/ash/public/interfaces/shell_test_api.mojom b/ash/public/interfaces/shell_test_api.mojom new file mode 100644 index 0000000..f54650cd --- /dev/null +++ b/ash/public/interfaces/shell_test_api.mojom
@@ -0,0 +1,11 @@ +// Copyright 2017 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 ash.mojom; + +interface ShellTestApi { + // Returns true if a system modal window is open (e.g. the Wi-Fi network + // password dialog). + IsSystemModalWindowOpen() => (bool visible); +};
diff --git a/ash/public/interfaces/wallpaper.mojom b/ash/public/interfaces/wallpaper.mojom index f0f75789..1bdcf0e6 100644 --- a/ash/public/interfaces/wallpaper.mojom +++ b/ash/public/interfaces/wallpaper.mojom
@@ -138,6 +138,13 @@ // clears the device policy controlled wallpaper if applicable. SetDeviceWallpaperPolicyEnforced(bool enforced); + // Updates the layout for the user's custom wallpaper and reloads the + // wallpaper with the new layout. + // |user_info|: The user's information related to wallpaper. + // |layout|: The new layout of the wallpaper. + UpdateCustomWallpaperLayout(WallpaperUserInfo user_info, + WallpaperLayout layout); + // Shows the user's wallpaper, which is determined in the following order: // 1) Use device policy wallpaper if it exists AND we are at the login screen. // 2) Use user policy wallpaper if it exists.
diff --git a/ash/resources/vector_icons/BUILD.gn b/ash/resources/vector_icons/BUILD.gn index c721c93..193adbe 100644 --- a/ash/resources/vector_icons/BUILD.gn +++ b/ash/resources/vector_icons/BUILD.gn
@@ -118,8 +118,12 @@ "palette_tray_icon_magnify.icon", "palette_tray_icon_metalayer.1x.icon", "palette_tray_icon_metalayer.icon", + "shelf_add_person_button.1x.icon", + "shelf_add_person_button.icon", "shelf_back.1x.icon", "shelf_back.icon", + "shelf_browse_as_guest_button.1x.icon", + "shelf_browse_as_guest_button.icon", "shelf_cancel_button.1x.icon", "shelf_cancel_button.icon", "shelf_keyboard.1x.icon",
diff --git a/ash/resources/vector_icons/shelf_add_person_button.1x.icon b/ash/resources/vector_icons/shelf_add_person_button.1x.icon new file mode 100644 index 0000000..f0833e4 --- /dev/null +++ b/ash/resources/vector_icons/shelf_add_person_button.1x.icon
@@ -0,0 +1,29 @@ +CANVAS_DIMENSIONS, 20, +MOVE_TO, 7.6f, 9.8f, +R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1, +R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1, +R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, +R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1, +CLOSE, +R_MOVE_TO, 4.8f, 0, +R_CUBIC_TO, -0.55f, 0, -1, 0.45f, -1, 1, +R_CUBIC_TO, 0, 0.55f, 0.45f, 1, 1, 1, +R_CUBIC_TO, 0.55f, 0, 1, -0.45f, 1, -1, +R_CUBIC_TO, 0, -0.55f, -0.45f, -1, -1, -1, +CLOSE, +MOVE_TO, 10, 2, +R_CUBIC_TO, -4.42f, 0, -8, 3.58f, -8, 8, +R_CUBIC_TO, 0, 4.42f, 3.58f, 8, 8, 8, +R_CUBIC_TO, 4.42f, 0, 8, -3.58f, 8, -8, +R_CUBIC_TO, 0, -4.42f, -3.58f, -8, -8, -8, +CLOSE, +R_MOVE_TO, 0, 14.4f, +R_CUBIC_TO, -3.53f, 0, -6.4f, -2.87f, -6.4f, -6.4f, +R_CUBIC_TO, 0, -0.23f, 0.02f, -0.46f, 0.04f, -0.69f, +R_CUBIC_TO, 1.89f, -0.84f, 3.38f, -2.38f, 4.17f, -4.3f, +CUBIC_TO, 9.26f, 7.06f, 11.64f, 8.4f, 14.34f, 8.4f, +R_CUBIC_TO, 0.62f, 0, 1.22f, -0.07f, 1.8f, -0.21f, +R_CUBIC_TO, 0.17f, 0.57f, 0.26f, 1.18f, 0.26f, 1.81f, +R_CUBIC_TO, 0, 3.53f, -2.87f, 6.4f, -6.4f, 6.4f, +CLOSE, +END \ No newline at end of file
diff --git a/ash/resources/vector_icons/shelf_add_person_button.icon b/ash/resources/vector_icons/shelf_add_person_button.icon new file mode 100644 index 0000000..6a49c948 --- /dev/null +++ b/ash/resources/vector_icons/shelf_add_person_button.icon
@@ -0,0 +1,29 @@ +CANVAS_DIMENSIONS, 40, +MOVE_TO, 15.2f, 19.6f, +R_CUBIC_TO, -1.1f, 0, -2, 0.9f, -2, 2, +R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, +R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, +R_CUBIC_TO, 0, -1.1f, -0.9f, -2, -2, -2, +CLOSE, +R_MOVE_TO, 9.6f, 0, +R_CUBIC_TO, -1.1f, 0, -2, 0.9f, -2, 2, +R_CUBIC_TO, 0, 1.1f, 0.9f, 2, 2, 2, +R_CUBIC_TO, 1.1f, 0, 2, -0.9f, 2, -2, +R_CUBIC_TO, 0, -1.1f, -0.9f, -2, -2, -2, +CLOSE, +MOVE_TO, 20, 4, +CUBIC_TO, 11.17f, 4, 4, 11.17f, 4, 20, +R_CUBIC_TO, 0, 8.83f, 7.17f, 16, 16, 16, +R_CUBIC_TO, 8.83f, 0, 16, -7.17f, 16, -16, +CUBIC_TO_SHORTHAND, 28.83f, 4, 20, 4, +CLOSE, +R_MOVE_TO, 0, 28.8f, +R_CUBIC_TO, -7.06f, 0, -12.8f, -5.74f, -12.8f, -12.8f, +R_CUBIC_TO, 0, -0.46f, 0.03f, -0.93f, 0.08f, -1.38f, +R_CUBIC_TO, 3.78f, -1.68f, 6.77f, -4.77f, 8.34f, -8.59f, +R_CUBIC_TO, 2.9f, 4.1f, 7.66f, 6.77f, 13.06f, 6.77f, +R_CUBIC_TO, 1.25f, 0, 2.45f, -0.14f, 3.6f, -0.42f, +R_CUBIC_TO, 0.34f, 1.14f, 0.53f, 2.35f, 0.53f, 3.62f, +R_CUBIC_TO, 0, 7.06f, -5.74f, 12.8f, -12.8f, 12.8f, +CLOSE, +END \ No newline at end of file
diff --git a/ash/resources/vector_icons/shelf_browse_as_guest_button.1x.icon b/ash/resources/vector_icons/shelf_browse_as_guest_button.1x.icon new file mode 100644 index 0000000..1f37af71 --- /dev/null +++ b/ash/resources/vector_icons/shelf_browse_as_guest_button.1x.icon
@@ -0,0 +1,20 @@ +CANVAS_DIMENSIONS, 20, +MOVE_TO, 10, 2, +R_CUBIC_TO, -4.42f, 0, -8, 3.58f, -8, 8, +R_CUBIC_TO, 0, 4.42f, 3.58f, 8, 8, 8, +R_CUBIC_TO, 4.42f, 0, 8, -3.58f, 8, -8, +R_CUBIC_TO, 0, -4.42f, -3.58f, -8, -8, -8, +CLOSE, +R_MOVE_TO, 0, 2.4f, +R_CUBIC_TO, 1.33f, 0, 2.4f, 1.07f, 2.4f, 2.4f, +R_CUBIC_TO, 0, 1.33f, -1.07f, 2.4f, -2.4f, 2.4f, +R_CUBIC_TO, -1.33f, 0, -2.4f, -1.07f, -2.4f, -2.4f, +R_CUBIC_TO, 0, -1.33f, 1.07f, -2.4f, 2.4f, -2.4f, +CLOSE, +R_MOVE_TO, -5, 8.79f, +R_CUBIC_TO, 0.03f, -1.74f, 3.33f, -2.69f, 5, -2.69f, +R_CUBIC_TO, 1.66f, 0, 4.97f, 0.95f, 5, 2.69f, +R_CUBIC_TO, -1.07f, 1.69f, -2.92f, 2.81f, -5, 2.81f, +R_CUBIC_TO, -2.08f, 0, -3.92f, -1.12f, -5, -2.81f, +CLOSE, +END \ No newline at end of file
diff --git a/ash/resources/vector_icons/shelf_browse_as_guest_button.icon b/ash/resources/vector_icons/shelf_browse_as_guest_button.icon new file mode 100644 index 0000000..3f7b0473 --- /dev/null +++ b/ash/resources/vector_icons/shelf_browse_as_guest_button.icon
@@ -0,0 +1,20 @@ +CANVAS_DIMENSIONS, 40, +MOVE_TO, 20, 4, +CUBIC_TO, 11.17f, 4, 4, 11.17f, 4, 20, +R_CUBIC_TO, 0, 8.83f, 7.17f, 16, 16, 16, +R_CUBIC_TO, 8.83f, 0, 16, -7.17f, 16, -16, +CUBIC_TO_SHORTHAND, 28.83f, 4, 20, 4, +CLOSE, +R_MOVE_TO, 0, 4.8f, +R_CUBIC_TO, 2.66f, 0, 4.8f, 2.14f, 4.8f, 4.8f, +R_CUBIC_TO, 0, 2.66f, -2.14f, 4.8f, -4.8f, 4.8f, +R_CUBIC_TO, -2.66f, 0, -4.8f, -2.14f, -4.8f, -4.8f, +R_CUBIC_TO, 0, -2.66f, 2.14f, -4.8f, 4.8f, -4.8f, +CLOSE, +MOVE_TO, 10, 26.38f, +CUBIC_TO, 10.05f, 22.9f, 16.67f, 21, 20, 21, +R_CUBIC_TO, 3.32f, 0, 9.95f, 1.9f, 10, 5.38f, +CUBIC_TO, 27.85f, 29.77f, 24.17f, 32, 20, 32, +R_CUBIC_TO, -4.17f, 0, -7.85f, -2.23f, -10, -5.62f, +CLOSE, +END \ No newline at end of file
diff --git a/ash/shelf/login_shelf_view.cc b/ash/shelf/login_shelf_view.cc index 3aeb431..331aa03 100644 --- a/ash/shelf/login_shelf_view.cc +++ b/ash/shelf/login_shelf_view.cc
@@ -46,6 +46,8 @@ LoginMetricsRecorder::LockScreenUserClickTarget GetUserClickTarget( int button_id) { + // TODO(agawronska): Add metrics for login screen only buttons. + // https://crbug.com/798848 switch (button_id) { case LoginShelfView::kShutdown: return LoginMetricsRecorder::LockScreenUserClickTarget::kShutDownButton; @@ -143,6 +145,9 @@ add_button(kSignOut, IDS_ASH_SHELF_SIGN_OUT_BUTTON, kShelfSignOutButtonIcon); add_button(kCloseNote, IDS_ASH_SHELF_UNLOCK_BUTTON, kShelfUnlockButtonIcon); add_button(kCancel, IDS_ASH_SHELF_CANCEL_BUTTON, kShelfCancelButtonIcon); + add_button(kBrowseAsGuest, IDS_ASH_BROWSE_AS_GUEST_BUTTON, + kShelfBrowseAsGuestButtonIcon); + add_button(kAddUser, IDS_ASH_ADD_USER_BUTTON, kShelfAddPersonButtonIcon); // Adds observers for states that affect the visiblity of different buttons. tray_action_observer_.Add(Shell::Get()->tray_action()); @@ -219,6 +224,12 @@ case kCancel: Shell::Get()->login_screen_controller()->CancelAddUser(); break; + case kBrowseAsGuest: + Shell::Get()->login_screen_controller()->LoginAsGuest(); + break; + case kAddUser: + NOTIMPLEMENTED(); + break; } } @@ -273,6 +284,11 @@ is_lock_screen_note_in_foreground); GetViewByID(kCancel)->SetVisible(session_state == SessionState::LOGIN_SECONDARY); + // TODO(agawronska): Implement full list of conditions for buttons visibility. + // https://crbug.com/798869 + bool is_login_primary = (session_state == SessionState::LOGIN_PRIMARY); + GetViewByID(kBrowseAsGuest)->SetVisible(is_login_primary); + GetViewByID(kAddUser)->SetVisible(is_login_primary); Layout(); }
diff --git a/ash/shelf/login_shelf_view.h b/ash/shelf/login_shelf_view.h index 203150cd..7a968b6 100644 --- a/ash/shelf/login_shelf_view.h +++ b/ash/shelf/login_shelf_view.h
@@ -36,11 +36,13 @@ public ShutdownController::Observer { public: enum ButtonId { - kShutdown = 1, // Shut down the device. - kRestart, // Restart the device. - kSignOut, // Sign out the active user session. - kCloseNote, // Close the lock screen note. - kCancel, // Cancel multiple user sign-in. + kShutdown = 1, // Shut down the device. + kRestart, // Restart the device. + kSignOut, // Sign out the active user session. + kCloseNote, // Close the lock screen note. + kCancel, // Cancel multiple user sign-in. + kBrowseAsGuest, // Use in guest mode. + kAddUser, // Add a new user. }; explicit LoginShelfView(
diff --git a/ash/shelf/login_shelf_view_unittest.cc b/ash/shelf/login_shelf_view_unittest.cc index 9f7d27c..de04c9d 100644 --- a/ash/shelf/login_shelf_view_unittest.cc +++ b/ash/shelf/login_shelf_view_unittest.cc
@@ -156,7 +156,9 @@ EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown})); NotifySessionStateChanged(SessionState::LOGIN_PRIMARY); - EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown})); + EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown, + LoginShelfView::kBrowseAsGuest, + LoginShelfView::kAddUser})); NotifySessionStateChanged(SessionState::LOGGED_IN_NOT_ACTIVE); EXPECT_TRUE(ShowsShelfButtons({LoginShelfView::kShutdown})); @@ -301,6 +303,12 @@ Click(LoginShelfView::kCancel); } +TEST_F(LoginShelfViewTest, ClickBrowseAsGuestButton) { + std::unique_ptr<MockLoginScreenClient> client = BindMockLoginScreenClient(); + EXPECT_CALL(*client, LoginAsGuest()); + Click(LoginShelfView::kBrowseAsGuest); +} + TEST_F(LoginShelfViewTest, TabGoesFromShelfToStatusAreaAndBackToShelf) { NotifySessionStateChanged(SessionState::LOCKED); EXPECT_TRUE(
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc index 38b29f4..31dca8c 100644 --- a/ash/shelf/shelf_layout_manager_unittest.cc +++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -20,7 +20,7 @@ #include "ash/shelf/shelf_view.h" #include "ash/shelf/shelf_widget.h" #include "ash/shell.h" -#include "ash/shell_port.h" +#include "ash/shell_test_api.h" #include "ash/system/status_area_widget.h" #include "ash/system/tray/system_tray.h" #include "ash/system/tray/system_tray_item.h" @@ -1201,8 +1201,8 @@ wm::ActivateWindow(window); // Enable system modal dialog, and make sure shelf is still hidden. - ShellPort::Get()->SimulateModalWindowOpenForTesting(true); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + ShellTestApi().SimulateModalWindowOpenForTest(true); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(wm::CanActivateWindow(window)); Shell::Get()->UpdateShelfVisibility(); EXPECT_EQ(SHELF_AUTO_HIDE, shelf->GetVisibilityState()); @@ -1244,8 +1244,8 @@ EXPECT_TRUE(window_2->IsVisible()); // Enable system modal dialog, and make sure both shelves are still hidden. - ShellPort::Get()->SimulateModalWindowOpenForTesting(true); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + ShellTestApi().SimulateModalWindowOpenForTest(true); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(wm::CanActivateWindow(window_1)); EXPECT_FALSE(wm::CanActivateWindow(window_2)); Shell::Get()->UpdateShelfVisibility();
diff --git a/ash/shell.cc b/ash/shell.cc index 353008e..07ee6a6f 100644 --- a/ash/shell.cc +++ b/ash/shell.cc
@@ -325,6 +325,40 @@ } // static +int Shell::GetOpenSystemModalWindowContainerId() { + // The test boolean is not static to avoid leaking state between tests. + if (Get()->simulate_modal_window_open_for_test_) + return kShellWindowId_SystemModalContainer; + + // Traverse all system modal containers, and find its direct child window + // with "SystemModal" setting, and visible. + // Note: LockSystemModalContainer is more restrictive, so make it preferable + // to SystemModalCotainer. + constexpr int modal_window_ids[] = {kShellWindowId_LockSystemModalContainer, + kShellWindowId_SystemModalContainer}; + for (aura::Window* root : Shell::GetAllRootWindows()) { + for (int modal_window_id : modal_window_ids) { + aura::Window* system_modal = root->GetChildById(modal_window_id); + if (!system_modal) + continue; + for (const aura::Window* child : system_modal->children()) { + if (child->GetProperty(aura::client::kModalKey) == + ui::MODAL_TYPE_SYSTEM && + child->layer()->GetTargetVisibility()) { + return modal_window_id; + } + } + } + } + return -1; +} + +// static +bool Shell::IsSystemModalWindowOpen() { + return GetOpenSystemModalWindowContainerId() >= 0; +} + +// static Config Shell::GetAshConfig() { return Get()->shell_port_->GetAshConfig(); } @@ -606,7 +640,6 @@ tray_bluetooth_helper_(std::make_unique<TrayBluetoothHelper>()), display_configurator_(new display::DisplayConfigurator()), native_cursor_manager_(nullptr), - simulate_modal_window_open_for_testing_(false), weak_factory_(this) { // TODO(sky): better refactor cash/mash dependencies. Perhaps put all cash // state on ShellPortClassic. http://crbug.com/671246.
diff --git a/ash/shell.h b/ash/shell.h index 890db6b..b8e87b6b 100644 --- a/ash/shell.h +++ b/ash/shell.h
@@ -232,6 +232,14 @@ static const aura::Window* GetContainer(const aura::Window* root_window, int container_id); + // If a system-modal dialog window is currently open, returns the ID of the + // system modal window container that contains the window. + // If no system-modal dialogs are open it returns -1. + static int GetOpenSystemModalWindowContainerId(); + + // Returns true if a system-modal dialog window is currently open. + static bool IsSystemModalWindowOpen(); + // TODO(sky): move this and WindowManagerClient into ShellMash that is owned // by Shell. Doing the move is gated on having mash create Shell. static void set_window_tree_client(aura::WindowTreeClient* client) { @@ -778,7 +786,7 @@ std::unique_ptr<::wm::CursorManager> cursor_manager_; // For testing only: simulate that a modal window is open - bool simulate_modal_window_open_for_testing_; + bool simulate_modal_window_open_for_test_ = false; // See comment for GetRootWindowForNewWindows(). aura::Window* root_window_for_new_windows_ = nullptr;
diff --git a/ash/shell_port.cc b/ash/shell_port.cc index 21cbb06..afd022f8 100644 --- a/ash/shell_port.cc +++ b/ash/shell_port.cc
@@ -65,35 +65,4 @@ instance_ = this; } -int ShellPort::GetOpenSystemModalWindowContainerId() { - if (simulate_modal_window_open_for_testing_) - return kShellWindowId_SystemModalContainer; - - // Traverse all system modal containers, and find its direct child window - // with "SystemModal" setting, and visible. - // Note: LockSystemModalContainer is more restrictive, so make it preferable - // to SystemModalCotainer. - constexpr int modal_window_ids[] = {kShellWindowId_LockSystemModalContainer, - kShellWindowId_SystemModalContainer}; - for (aura::Window* root : Shell::GetAllRootWindows()) { - for (int modal_window_id : modal_window_ids) { - aura::Window* system_modal = root->GetChildById(modal_window_id); - if (!system_modal) - continue; - for (const aura::Window* child : system_modal->children()) { - if (child->GetProperty(aura::client::kModalKey) == - ui::MODAL_TYPE_SYSTEM && - child->layer()->GetTargetVisibility()) { - return modal_window_id; - } - } - } - } - return -1; -} - -bool ShellPort::IsSystemModalWindowOpen() { - return GetOpenSystemModalWindowContainerId() >= 0; -} - } // namespace ash
diff --git a/ash/shell_port.h b/ash/shell_port.h index 6a2ae8c..4ccbfd1 100644 --- a/ash/shell_port.h +++ b/ash/shell_port.h
@@ -72,24 +72,11 @@ virtual Config GetAshConfig() const = 0; - // If a system-modal dialog window is currently open, returns the ID of the - // system modal window container that contains the window. - // If no system-modal dialogs are open it returns -1. - int GetOpenSystemModalWindowContainerId(); - - // Returns true if a system-modal dialog window is currently open. - bool IsSystemModalWindowOpen(); - // The return value from this is supplied to AshTouchTransformController; see // it and TouchTransformSetter for details. virtual std::unique_ptr<display::TouchTransformSetter> CreateTouchTransformDelegate() = 0; - // For testing only: set simulation that a modal window is open - void SimulateModalWindowOpenForTesting(bool modal_window_open) { - simulate_modal_window_open_for_testing_ = modal_window_open; - } - // See aura::client::CursorClient for details on these. virtual void LockCursor() = 0; virtual void UnlockCursor() = 0; @@ -193,8 +180,6 @@ static ShellPort* instance_; base::ObserverList<LockStateObserver> lock_state_observers_; - - bool simulate_modal_window_open_for_testing_ = false; }; } // namespace ash
diff --git a/ash/shell_test_api.cc b/ash/shell_test_api.cc index 60d9122..5579671 100644 --- a/ash/shell_test_api.cc +++ b/ash/shell_test_api.cc
@@ -11,6 +11,7 @@ #include "ash/system/power/backlights_forced_off_setter.h" #include "ash/system/power/power_button_controller.h" #include "components/prefs/testing_pref_service.h" +#include "mojo/public/cpp/bindings/strong_binding.h" namespace ash { @@ -18,6 +19,11 @@ ShellTestApi::ShellTestApi(Shell* shell) : shell_(shell) {} +// static +void ShellTestApi::BindRequest(mojom::ShellTestApiRequest request) { + mojo::MakeStrongBinding(std::make_unique<ShellTestApi>(), std::move(request)); +} + MessageCenterController* ShellTestApi::message_center_controller() { return shell_->message_center_controller_.get(); } @@ -53,4 +59,12 @@ shell_->backlights_forced_off_setter_.get()); } +void ShellTestApi::SimulateModalWindowOpenForTest(bool modal_window_open) { + shell_->simulate_modal_window_open_for_test_ = modal_window_open; +} + +void ShellTestApi::IsSystemModalWindowOpen(IsSystemModalWindowOpenCallback cb) { + std::move(cb).Run(Shell::IsSystemModalWindowOpen()); +} + } // namespace ash
diff --git a/ash/shell_test_api.h b/ash/shell_test_api.h index 869e0c6..5dcb2c2 100644 --- a/ash/shell_test_api.h +++ b/ash/shell_test_api.h
@@ -7,6 +7,7 @@ #include <memory> +#include "ash/public/interfaces/shell_test_api.mojom.h" #include "base/macros.h" class PrefService; @@ -21,11 +22,14 @@ class WorkspaceController; // Accesses private data from a Shell for testing. -class ShellTestApi { +class ShellTestApi : public mojom::ShellTestApi { public: ShellTestApi(); explicit ShellTestApi(Shell* shell); + // Creates and binds an instance from a remote request (e.g. from chrome). + static void BindRequest(mojom::ShellTestApiRequest request); + MessageCenterController* message_center_controller(); SystemGestureEventFilter* system_gesture_event_filter(); WorkspaceController* workspace_controller(); @@ -41,6 +45,12 @@ // Chrome starting. void ResetPowerButtonControllerForTest(); + // Simulates a modal dialog being open. + void SimulateModalWindowOpenForTest(bool modal_window_open); + + // mojom::ShellTestApi: + void IsSystemModalWindowOpen(IsSystemModalWindowOpenCallback cb) override; + private: Shell* shell_; // not owned
diff --git a/ash/system/network/network_list.cc b/ash/system/network/network_list.cc index bac51ff..9ad3ede 100644 --- a/ash/system/network/network_list.cc +++ b/ash/system/network/network_list.cc
@@ -38,7 +38,6 @@ #include "base/strings/utf_string_conversions.h" #include "base/timer/timer.h" #include "chromeos/dbus/dbus_thread_manager.h" -#include "chromeos/login/login_state.h" #include "chromeos/network/device_state.h" #include "chromeos/network/managed_network_configuration_handler.h" #include "chromeos/network/network_state.h" @@ -67,7 +66,6 @@ #include "ui/views/view.h" -using chromeos::LoginState; using chromeos::NetworkHandler; using chromeos::NetworkStateHandler; using chromeos::ManagedNetworkConfigurationHandler; @@ -84,7 +82,7 @@ bool IsProhibitedByPolicy(const chromeos::NetworkState* network) { if (!NetworkTypePattern::WiFi().MatchesType(network->type())) return false; - if (!LoginState::IsInitialized() || !LoginState::Get()->IsUserLoggedIn()) + if (!Shell::Get()->session_controller()->IsActiveUserSessionStarted()) return false; ManagedNetworkConfigurationHandler* managed_configuration_handler = NetworkHandler::Get()->managed_network_configuration_handler();
diff --git a/ash/system/overview/overview_button_tray_unittest.cc b/ash/system/overview/overview_button_tray_unittest.cc index 7341bfdb..342f856 100644 --- a/ash/system/overview/overview_button_tray_unittest.cc +++ b/ash/system/overview/overview_button_tray_unittest.cc
@@ -11,7 +11,6 @@ #include "ash/rotator/screen_rotation_animator.h" #include "ash/session/session_controller.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/system/status_area_widget.h" #include "ash/system/status_area_widget_test_helper.h" #include "ash/test/ash_test_base.h" @@ -294,7 +293,7 @@ window->Show(); ParentWindowInPrimaryRootWindow(window.get()); - ASSERT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + ASSERT_TRUE(Shell::IsSystemModalWindowOpen()); Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(true); EXPECT_TRUE(GetTray()->visible()); Shell::Get()->tablet_mode_controller()->EnableTabletModeWindowManager(false);
diff --git a/ash/system/power/tablet_power_button_controller.cc b/ash/system/power/convertible_power_button_controller.cc similarity index 85% rename from ash/system/power/tablet_power_button_controller.cc rename to ash/system/power/convertible_power_button_controller.cc index 54cf055..9cefe9cf 100644 --- a/ash/system/power/tablet_power_button_controller.cc +++ b/ash/system/power/convertible_power_button_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 "ash/system/power/tablet_power_button_controller.h" +#include "ash/system/power/convertible_power_button_controller.h" #include "ash/accessibility/accessibility_delegate.h" #include "ash/public/cpp/ash_switches.h" @@ -45,12 +45,13 @@ } // namespace -constexpr base::TimeDelta TabletPowerButtonController::kScreenStateChangeDelay; +constexpr base::TimeDelta + ConvertiblePowerButtonController::kScreenStateChangeDelay; constexpr base::TimeDelta - TabletPowerButtonController::kIgnoreRepeatedButtonUpDelay; + ConvertiblePowerButtonController::kIgnoreRepeatedButtonUpDelay; -TabletPowerButtonController::TabletPowerButtonController( +ConvertiblePowerButtonController::ConvertiblePowerButtonController( PowerButtonDisplayController* display_controller, base::TickClock* tick_clock) : lock_state_controller_(Shell::Get()->lock_state_controller()), @@ -61,14 +62,14 @@ Shell::Get()->tablet_mode_controller()->AddObserver(this); } -TabletPowerButtonController::~TabletPowerButtonController() { +ConvertiblePowerButtonController::~ConvertiblePowerButtonController() { if (Shell::Get()->tablet_mode_controller()) Shell::Get()->tablet_mode_controller()->RemoveObserver(this); chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver( this); } -void TabletPowerButtonController::OnPowerButtonEvent( +void ConvertiblePowerButtonController::OnPowerButtonEvent( bool down, const base::TimeTicks& timestamp) { if (down) { @@ -119,43 +120,43 @@ } } -void TabletPowerButtonController::SuspendDone( +void ConvertiblePowerButtonController::SuspendDone( const base::TimeDelta& sleep_duration) { last_resume_time_ = tick_clock_->NowTicks(); } -void TabletPowerButtonController::OnTabletModeStarted() { +void ConvertiblePowerButtonController::OnTabletModeStarted() { shutdown_timer_.Stop(); if (lock_state_controller_->CanCancelShutdownAnimation()) lock_state_controller_->CancelShutdownAnimation(); } -void TabletPowerButtonController::OnTabletModeEnded() { +void ConvertiblePowerButtonController::OnTabletModeEnded() { shutdown_timer_.Stop(); if (lock_state_controller_->CanCancelShutdownAnimation()) lock_state_controller_->CancelShutdownAnimation(); } -void TabletPowerButtonController::CancelTabletPowerButton() { +void ConvertiblePowerButtonController::CancelTabletPowerButton() { if (lock_state_controller_->CanCancelShutdownAnimation()) lock_state_controller_->CancelShutdownAnimation(); force_off_on_button_up_ = false; shutdown_timer_.Stop(); } -void TabletPowerButtonController::StartShutdownTimer() { +void ConvertiblePowerButtonController::StartShutdownTimer() { base::TimeDelta timeout = screen_off_when_power_button_down_ ? kShutdownWhenScreenOffTimeout : kShutdownWhenScreenOnTimeout; shutdown_timer_.Start(FROM_HERE, timeout, this, - &TabletPowerButtonController::OnShutdownTimeout); + &ConvertiblePowerButtonController::OnShutdownTimeout); } -void TabletPowerButtonController::OnShutdownTimeout() { +void ConvertiblePowerButtonController::OnShutdownTimeout() { lock_state_controller_->StartShutdownAnimation(ShutdownReason::POWER_BUTTON); } -void TabletPowerButtonController::LockScreenIfRequired() { +void ConvertiblePowerButtonController::LockScreenIfRequired() { SessionController* session_controller = Shell::Get()->session_controller(); if (session_controller->ShouldLockScreenAutomatically() && session_controller->CanLockScreen() &&
diff --git a/ash/system/power/tablet_power_button_controller.h b/ash/system/power/convertible_power_button_controller.h similarity index 80% rename from ash/system/power/tablet_power_button_controller.h rename to ash/system/power/convertible_power_button_controller.h index eb17b48..ad2efa95 100644 --- a/ash/system/power/tablet_power_button_controller.h +++ b/ash/system/power/convertible_power_button_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 ASH_SYSTEM_POWER_TABLET_POWER_BUTTON_CONTROLLER_H_ -#define ASH_SYSTEM_POWER_TABLET_POWER_BUTTON_CONTROLLER_H_ +#ifndef ASH_SYSTEM_POWER_CONVERTIBLE_POWER_BUTTON_CONTROLLER_H_ +#define ASH_SYSTEM_POWER_CONVERTIBLE_POWER_BUTTON_CONTROLLER_H_ #include <memory> #include <utility> @@ -28,9 +28,9 @@ class LockStateController; class PowerButtonDisplayController; -// Handles power button events on convertible/tablet device. This class is +// Handles power button events on convertible device. This class is // instantiated and used in PowerButtonController. -class ASH_EXPORT TabletPowerButtonController +class ASH_EXPORT ConvertiblePowerButtonController : public chromeos::PowerManagerClient::Observer, public TabletModeObserver { public: @@ -48,9 +48,10 @@ static constexpr base::TimeDelta kIgnoreRepeatedButtonUpDelay = base::TimeDelta::FromMilliseconds(500); - TabletPowerButtonController(PowerButtonDisplayController* display_controller, - base::TickClock* tick_clock); - ~TabletPowerButtonController() override; + ConvertiblePowerButtonController( + PowerButtonDisplayController* display_controller, + base::TickClock* tick_clock); + ~ConvertiblePowerButtonController() override; // Handles a power button event. void OnPowerButtonEvent(bool down, const base::TimeTicks& timestamp); @@ -62,11 +63,11 @@ void OnTabletModeStarted() override; void OnTabletModeEnded() override; - // Cancel the ongoing tablet power button behavior. + // Cancel the ongoing power button behavior of convertible devices. void CancelTabletPowerButton(); private: - friend class TabletPowerButtonControllerTestApi; + friend class ConvertiblePowerButtonControllerTestApi; // Starts |shutdown_timer_| when the power button is pressed while in // tablet mode. @@ -92,7 +93,7 @@ // True if power button released should force off display. bool force_off_on_button_up_ = true; - // Started when the tablet power button is pressed and stopped when it's + // Started when the convertible power button is pressed and stopped when it's // released. Runs OnShutdownTimeout() to start shutdown. base::OneShotTimer shutdown_timer_; @@ -104,9 +105,9 @@ // Time source for performed action times. base::TickClock* tick_clock_; // Not owned. - DISALLOW_COPY_AND_ASSIGN(TabletPowerButtonController); + DISALLOW_COPY_AND_ASSIGN(ConvertiblePowerButtonController); }; } // namespace ash -#endif // ASH_SYSTEM_POWER_TABLET_POWER_BUTTON_CONTROLLER_H_ +#endif // ASH_SYSTEM_POWER_CONVERTIBLE_POWER_BUTTON_CONTROLLER_H_
diff --git a/ash/system/power/convertible_power_button_controller_test_api.cc b/ash/system/power/convertible_power_button_controller_test_api.cc new file mode 100644 index 0000000..65f7f76 --- /dev/null +++ b/ash/system/power/convertible_power_button_controller_test_api.cc
@@ -0,0 +1,39 @@ +// Copyright 2017 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/power/convertible_power_button_controller_test_api.h" + +#include "ash/system/power/convertible_power_button_controller.h" +#include "ash/system/power/power_button_display_controller.h" + +namespace ash { + +ConvertiblePowerButtonControllerTestApi:: + ConvertiblePowerButtonControllerTestApi( + ConvertiblePowerButtonController* controller) + : controller_(controller) {} + +ConvertiblePowerButtonControllerTestApi:: + ~ConvertiblePowerButtonControllerTestApi() = default; + +bool ConvertiblePowerButtonControllerTestApi::ShutdownTimerIsRunning() const { + return controller_->shutdown_timer_.IsRunning(); +} + +bool ConvertiblePowerButtonControllerTestApi::TriggerShutdownTimeout() { + if (!controller_->shutdown_timer_.IsRunning()) + return false; + + base::Closure task = controller_->shutdown_timer_.user_task(); + controller_->shutdown_timer_.Stop(); + task.Run(); + return true; +} + +void ConvertiblePowerButtonControllerTestApi::SendKeyEvent( + ui::KeyEvent* event) { + controller_->display_controller_->OnKeyEvent(event); +} + +} // namespace ash
diff --git a/ash/system/power/convertible_power_button_controller_test_api.h b/ash/system/power/convertible_power_button_controller_test_api.h new file mode 100644 index 0000000..71d0438 --- /dev/null +++ b/ash/system/power/convertible_power_button_controller_test_api.h
@@ -0,0 +1,45 @@ +// Copyright 2017 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_POWER_CONVERTIBLE_POWER_BUTTON_CONTROLLER_TEST_API_H_ +#define ASH_SYSTEM_POWER_CONVERTIBLE_POWER_BUTTON_CONTROLLER_TEST_API_H_ + +#include "base/compiler_specific.h" +#include "base/macros.h" + +namespace ui { +class KeyEvent; +} // namespace ui + +namespace ash { + +class ConvertiblePowerButtonController; + +// Helper class used by tests to access ConvertiblePowerButtonController's +// internal state. +class ConvertiblePowerButtonControllerTestApi { + public: + explicit ConvertiblePowerButtonControllerTestApi( + ConvertiblePowerButtonController* controller); + ~ConvertiblePowerButtonControllerTestApi(); + + // Returns true when |controller_->shutdown_timer_| is running. + bool ShutdownTimerIsRunning() const; + + // If |controller_->shutdown_timer_| is running, stops it, runs its task, and + // returns true. Otherwise, returns false. + bool TriggerShutdownTimeout() WARN_UNUSED_RESULT; + + // Sends |event| to |controller_->display_controller_|. + void SendKeyEvent(ui::KeyEvent* event); + + private: + ConvertiblePowerButtonController* controller_; // Not owned. + + DISALLOW_COPY_AND_ASSIGN(ConvertiblePowerButtonControllerTestApi); +}; + +} // namespace ash + +#endif // ASH_SYSTEM_POWER_CONVERTIBLE_POWER_BUTTON_CONTROLLER_TEST_API_H_
diff --git a/ash/system/power/tablet_power_button_controller_unittest.cc b/ash/system/power/convertible_power_button_controller_unittest.cc similarity index 85% rename from ash/system/power/tablet_power_button_controller_unittest.cc rename to ash/system/power/convertible_power_button_controller_unittest.cc index e45ebe18..0142d00 100644 --- a/ash/system/power/tablet_power_button_controller_unittest.cc +++ b/ash/system/power/convertible_power_button_controller_unittest.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 "ash/system/power/tablet_power_button_controller.h" +#include "ash/system/power/convertible_power_button_controller.h" #include "ash/accessibility/accessibility_controller.h" #include "ash/accessibility/test_accessibility_controller_client.h" @@ -10,8 +10,8 @@ #include "ash/public/cpp/ash_switches.h" #include "ash/session/session_controller.h" #include "ash/shell.h" +#include "ash/system/power/convertible_power_button_controller_test_api.h" #include "ash/system/power/power_button_test_base.h" -#include "ash/system/power/tablet_power_button_controller_test_api.h" #include "ash/test_media_client.h" #include "ash/touch/touch_devices_controller.h" #include "ash/wm/lock_state_controller_test_api.h" @@ -33,10 +33,10 @@ } // namespace -class TabletPowerButtonControllerTest : public PowerButtonTestBase { +class ConvertiblePowerButtonControllerTest : public PowerButtonTestBase { public: - TabletPowerButtonControllerTest() = default; - ~TabletPowerButtonControllerTest() override = default; + ConvertiblePowerButtonControllerTest() = default; + ~ConvertiblePowerButtonControllerTest() override = default; void SetUp() override { PowerButtonTestBase::SetUp(); @@ -45,7 +45,7 @@ EXPECT_FALSE(power_manager_client_->backlights_forced_off()); // Advance a long duration from initialized last resume time in - // |tablet_controller_| to avoid cross interference. + // |convertible_controller_| to avoid cross interference. tick_clock_->Advance(base::TimeDelta::FromMilliseconds(3000)); // Run the event loop so that PowerButtonDisplayController can receive the @@ -72,14 +72,14 @@ // they come too close. void AdvanceClockToAvoidIgnoring() { tick_clock_->Advance( - TabletPowerButtonController::kIgnoreRepeatedButtonUpDelay + + ConvertiblePowerButtonController::kIgnoreRepeatedButtonUpDelay + base::TimeDelta::FromMilliseconds(1)); } - DISALLOW_COPY_AND_ASSIGN(TabletPowerButtonControllerTest); + DISALLOW_COPY_AND_ASSIGN(ConvertiblePowerButtonControllerTest); }; -TEST_F(TabletPowerButtonControllerTest, LockScreenIfRequired) { +TEST_F(ConvertiblePowerButtonControllerTest, LockScreenIfRequired) { Initialize(ButtonType::NORMAL, LoginStatus::USER); SetShouldLockScreenAutomatically(true); ASSERT_FALSE(GetLockedState()); @@ -109,31 +109,31 @@ // Tests that shutdown animation is not started if the power button is released // quickly. -TEST_F(TabletPowerButtonControllerTest, +TEST_F(ConvertiblePowerButtonControllerTest, ReleasePowerButtonBeforeStartingShutdownAnimation) { PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); ReleasePowerButton(); power_manager_client_->SendBrightnessChanged(0, true); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); EXPECT_TRUE(power_manager_client_->backlights_forced_off()); PressPowerButton(); power_manager_client_->SendBrightnessChanged(kNonZeroBrightness, true); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); ReleasePowerButton(); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); } // Tests that the shutdown animation is started when the power button is // released after the timer fires. -TEST_F(TabletPowerButtonControllerTest, +TEST_F(ConvertiblePowerButtonControllerTest, ReleasePowerButtonDuringShutdownAnimation) { PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->TriggerShutdownTimeout()); + EXPECT_TRUE(convertible_test_api_->TriggerShutdownTimeout()); EXPECT_TRUE(lock_state_test_api_->shutdown_timer_is_running()); ReleasePowerButton(); EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); @@ -149,7 +149,7 @@ PressPowerButton(); power_manager_client_->SendBrightnessChanged(kNonZeroBrightness, true); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); - EXPECT_TRUE(tablet_test_api_->TriggerShutdownTimeout()); + EXPECT_TRUE(convertible_test_api_->TriggerShutdownTimeout()); EXPECT_TRUE(lock_state_test_api_->shutdown_timer_is_running()); ReleasePowerButton(); EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); @@ -157,7 +157,8 @@ } // Tests tapping power button when screen is idle off. -TEST_F(TabletPowerButtonControllerTest, TappingPowerButtonWhenScreenIsIdleOff) { +TEST_F(ConvertiblePowerButtonControllerTest, + TappingPowerButtonWhenScreenIsIdleOff) { power_manager_client_->SendBrightnessChanged(0, true); PressPowerButton(); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); @@ -168,7 +169,7 @@ // Tests tapping power button when device is suspended without backlights forced // off. -TEST_F(TabletPowerButtonControllerTest, +TEST_F(ConvertiblePowerButtonControllerTest, TappingPowerButtonWhenSuspendedWithoutBacklightsForcedOff) { power_manager_client_->SendSuspendImminent( power_manager::SuspendImminent_Reason_OTHER); @@ -181,25 +182,25 @@ // are not forced off. tick_clock_->Advance(base::TimeDelta::FromMilliseconds(500)); PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); ReleasePowerButton(); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); // Send the power button event after a longer delay and check that backlights // are forced off. tick_clock_->Advance(base::TimeDelta::FromMilliseconds(1600)); PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); ReleasePowerButton(); power_manager_client_->SendBrightnessChanged(0, true); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); EXPECT_TRUE(power_manager_client_->backlights_forced_off()); } // Tests tapping power button when device is suspended with backlights forced // off. -TEST_F(TabletPowerButtonControllerTest, +TEST_F(ConvertiblePowerButtonControllerTest, TappingPowerButtonWhenSuspendedWithBacklightsForcedOff) { PressPowerButton(); ReleasePowerButton(); @@ -217,25 +218,25 @@ tick_clock_->Advance(base::TimeDelta::FromMilliseconds(500)); PressPowerButton(); power_manager_client_->SendBrightnessChanged(kNonZeroBrightness, true); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); ReleasePowerButton(); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); // Send the power button event after a longer delay and check that backlights // are forced off. tick_clock_->Advance(base::TimeDelta::FromMilliseconds(1600)); PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); ReleasePowerButton(); power_manager_client_->SendBrightnessChanged(0, true); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); EXPECT_TRUE(power_manager_client_->backlights_forced_off()); } // For convertible device working on laptop mode, tests keyboard/mouse event // when screen is off. -TEST_F(TabletPowerButtonControllerTest, ConvertibleOnLaptopMode) { +TEST_F(ConvertiblePowerButtonControllerTest, ConvertibleOnLaptopMode) { EnableTabletMode(false); // KeyEvent should SetBacklightsForcedOff(false). @@ -271,7 +272,7 @@ // For convertible device working on tablet mode, keyboard/mouse event should // not SetBacklightsForcedOff(false) when screen is off. -TEST_F(TabletPowerButtonControllerTest, ConvertibleOnTabletMode) { +TEST_F(ConvertiblePowerButtonControllerTest, ConvertibleOnTabletMode) { EnableTabletMode(true); PressPowerButton(); @@ -287,7 +288,7 @@ // Tests that a single set of power button pressed-and-released operation should // cause only one SetBacklightsForcedOff call. -TEST_F(TabletPowerButtonControllerTest, IgnorePowerOnKeyEvent) { +TEST_F(ConvertiblePowerButtonControllerTest, IgnorePowerOnKeyEvent) { ui::KeyEvent power_key_pressed(ui::ET_KEY_PRESSED, ui::VKEY_POWER, ui::EF_NONE); ui::KeyEvent power_key_released(ui::ET_KEY_RELEASED, ui::VKEY_POWER, @@ -297,22 +298,22 @@ // generated for each pressing and releasing, and multiple repeating pressed // events depending on holding. ASSERT_EQ(0, power_manager_client_->num_set_backlights_forced_off_calls()); - tablet_test_api_->SendKeyEvent(&power_key_pressed); - tablet_test_api_->SendKeyEvent(&power_key_pressed); + convertible_test_api_->SendKeyEvent(&power_key_pressed); + convertible_test_api_->SendKeyEvent(&power_key_pressed); PressPowerButton(); - tablet_test_api_->SendKeyEvent(&power_key_pressed); - tablet_test_api_->SendKeyEvent(&power_key_pressed); - tablet_test_api_->SendKeyEvent(&power_key_pressed); + convertible_test_api_->SendKeyEvent(&power_key_pressed); + convertible_test_api_->SendKeyEvent(&power_key_pressed); + convertible_test_api_->SendKeyEvent(&power_key_pressed); ReleasePowerButton(); - tablet_test_api_->SendKeyEvent(&power_key_released); - tablet_test_api_->SendKeyEvent(&power_key_released); + convertible_test_api_->SendKeyEvent(&power_key_released); + convertible_test_api_->SendKeyEvent(&power_key_released); EXPECT_EQ(1, power_manager_client_->num_set_backlights_forced_off_calls()); } // Tests that under (1) tablet power button pressed/released, (2) keyboard/mouse // events on laptop mode when screen is off, requesting/stopping backlights // forced off should update the global touchscreen enabled status. -TEST_F(TabletPowerButtonControllerTest, DisableTouchscreenWhileForcedOff) { +TEST_F(ConvertiblePowerButtonControllerTest, DisableTouchscreenWhileForcedOff) { // Tests tablet power button. ASSERT_TRUE(GetGlobalTouchscreenEnabled()); PressPowerButton(); @@ -351,7 +352,7 @@ // When the screen is turned off automatically, the touchscreen should also be // disabled. -TEST_F(TabletPowerButtonControllerTest, DisableTouchscreenForInactivity) { +TEST_F(ConvertiblePowerButtonControllerTest, DisableTouchscreenForInactivity) { ASSERT_TRUE(GetGlobalTouchscreenEnabled()); // Turn screen off for automated change (e.g. user is inactive). @@ -368,25 +369,25 @@ // When user switches convertible device between laptop mode and tablet mode, // power button may be pressed and held, which may cause unwanted shutdown. -TEST_F(TabletPowerButtonControllerTest, +TEST_F(ConvertiblePowerButtonControllerTest, EnterOrLeaveTabletModeWhilePressingPowerButton) { Initialize(ButtonType::NORMAL, LoginStatus::USER); SetShouldLockScreenAutomatically(true); ASSERT_FALSE(GetLockedState()); PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); - tablet_controller_->OnTabletModeStarted(); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); + convertible_controller_->OnTabletModeStarted(); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); tick_clock_->Advance(base::TimeDelta::FromMilliseconds(1500)); ReleasePowerButton(); EXPECT_FALSE(GetLockedState()); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->TriggerShutdownTimeout()); + EXPECT_TRUE(convertible_test_api_->TriggerShutdownTimeout()); EXPECT_TRUE(lock_state_test_api_->shutdown_timer_is_running()); - tablet_controller_->OnTabletModeStarted(); + convertible_controller_->OnTabletModeStarted(); EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); tick_clock_->Advance(base::TimeDelta::FromMilliseconds(2500)); ReleasePowerButton(); @@ -394,18 +395,18 @@ EXPECT_FALSE(power_manager_client_->backlights_forced_off()); PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); - tablet_controller_->OnTabletModeEnded(); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); + convertible_controller_->OnTabletModeEnded(); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); tick_clock_->Advance(base::TimeDelta::FromMilliseconds(3500)); ReleasePowerButton(); EXPECT_FALSE(GetLockedState()); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->TriggerShutdownTimeout()); + EXPECT_TRUE(convertible_test_api_->TriggerShutdownTimeout()); EXPECT_TRUE(lock_state_test_api_->shutdown_timer_is_running()); - tablet_controller_->OnTabletModeEnded(); + convertible_controller_->OnTabletModeEnded(); EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); tick_clock_->Advance(base::TimeDelta::FromMilliseconds(4500)); ReleasePowerButton(); @@ -414,7 +415,8 @@ } // Tests that repeated power button releases are ignored (crbug.com/675291). -TEST_F(TabletPowerButtonControllerTest, IgnoreRepeatedPowerButtonReleases) { +TEST_F(ConvertiblePowerButtonControllerTest, + IgnoreRepeatedPowerButtonReleases) { // Set backlights forced off for starting point. PressPowerButton(); ReleasePowerButton(); @@ -445,7 +447,7 @@ } // Tests that lid closed/open events stop forcing off backlights. -TEST_F(TabletPowerButtonControllerTest, LidEventsStopForcingOff) { +TEST_F(ConvertiblePowerButtonControllerTest, LidEventsStopForcingOff) { // Pressing/releasing power button to set backlights forced off. PressPowerButton(); ReleasePowerButton(); @@ -471,7 +473,7 @@ } // Tests that tablet mode events from powerd stop forcing off backlights. -TEST_F(TabletPowerButtonControllerTest, TabletModeEventsStopForcingOff) { +TEST_F(ConvertiblePowerButtonControllerTest, TabletModeEventsStopForcingOff) { PressPowerButton(); ReleasePowerButton(); ASSERT_TRUE(power_manager_client_->backlights_forced_off()); @@ -490,7 +492,7 @@ // Tests that with system reboot, the global touchscreen enabled status should // be synced with new backlights forced off state from powerd. -TEST_F(TabletPowerButtonControllerTest, SyncTouchscreenEnabled) { +TEST_F(ConvertiblePowerButtonControllerTest, SyncTouchscreenEnabled) { Shell::Get()->touch_devices_controller()->SetTouchscreenEnabled( false, TouchscreenEnabledSource::GLOBAL); ASSERT_FALSE(GetGlobalTouchscreenEnabled()); @@ -510,27 +512,27 @@ // Tests that tablet power button behavior is enabled on having seen // accelerometer update, otherwise it is disabled. -TEST_F(TabletPowerButtonControllerTest, EnableOnAccelerometerUpdate) { - ASSERT_TRUE(tablet_controller_); +TEST_F(ConvertiblePowerButtonControllerTest, EnableOnAccelerometerUpdate) { + ASSERT_TRUE(convertible_controller_); ResetPowerButtonController(); - EXPECT_FALSE(tablet_controller_); + EXPECT_FALSE(convertible_controller_); SendAccelerometerUpdate(kSidewaysVector, kSidewaysVector); - EXPECT_TRUE(tablet_controller_); + EXPECT_TRUE(convertible_controller_); // If clamshell-like power button behavior is requested via a flag, the - // TabletPowerButtonController shouldn't be initialized in response to + // ConvertiblePowerButtonController shouldn't be initialized in response to // accelerometer events. base::CommandLine::ForCurrentProcess()->AppendSwitch( switches::kForceClamshellPowerButton); ResetPowerButtonController(); SendAccelerometerUpdate(kSidewaysVector, kSidewaysVector); - EXPECT_FALSE(tablet_controller_); + EXPECT_FALSE(convertible_controller_); } // Tests that when backlights get forced off due to tablet power button, media // sessions should be suspended. -TEST_F(TabletPowerButtonControllerTest, SuspendMediaSessions) { +TEST_F(ConvertiblePowerButtonControllerTest, SuspendMediaSessions) { TestMediaClient client; Shell::Get()->media_controller()->SetClient(client.CreateAssociatedPtrInfo()); ASSERT_FALSE(client.media_sessions_suspended()); @@ -546,7 +548,7 @@ // Tests that when system is suspended with backlights forced off, and then // system resumes due to power button pressed without power button event fired // (crbug.com/735291), that we stop forcing off backlights. -TEST_F(TabletPowerButtonControllerTest, SuspendDoneStopsForcingOff) { +TEST_F(ConvertiblePowerButtonControllerTest, SuspendDoneStopsForcingOff) { PressPowerButton(); ReleasePowerButton(); power_manager_client_->SendBrightnessChanged(0, true); @@ -561,7 +563,7 @@ // Tests that for tablet power button induced locking screen, locking animations // are immediate. -TEST_F(TabletPowerButtonControllerTest, ImmediateLockAnimations) { +TEST_F(ConvertiblePowerButtonControllerTest, ImmediateLockAnimations) { TestSessionStateAnimator* test_animator = new TestSessionStateAnimator; lock_state_controller_->set_animator_for_test(test_animator); Initialize(ButtonType::NORMAL, LoginStatus::USER); @@ -607,7 +609,7 @@ // Tests that updating power button behavior from tablet behavior to clamshell // behavior will initially enable touchscreen on global touchscreen enabled // status (b/64972736). -TEST_F(TabletPowerButtonControllerTest, TouchscreenEnabledClamshell) { +TEST_F(ConvertiblePowerButtonControllerTest, TouchscreenEnabledClamshell) { PressPowerButton(); ReleasePowerButton(); ASSERT_TRUE(power_manager_client_->backlights_forced_off()); @@ -628,7 +630,7 @@ // Tests that during the interval that the display is turning on, tablet power // button should not set display off (crbug.com/735225). -TEST_F(TabletPowerButtonControllerTest, +TEST_F(ConvertiblePowerButtonControllerTest, IgnoreForcingOffWhenDisplayIsTurningOn) { PressPowerButton(); ReleasePowerButton(); @@ -642,8 +644,9 @@ EXPECT_FALSE(power_manager_client_->backlights_forced_off()); // Since display could still be off, ignore forcing off. - tick_clock_->Advance(TabletPowerButtonController::kScreenStateChangeDelay - - base::TimeDelta::FromMilliseconds(1)); + tick_clock_->Advance( + ConvertiblePowerButtonController::kScreenStateChangeDelay - + base::TimeDelta::FromMilliseconds(1)); PressPowerButton(); ReleasePowerButton(); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); @@ -659,7 +662,7 @@ // Tests that a11y alert is sent on tablet power button induced screen state // change. -TEST_F(TabletPowerButtonControllerTest, A11yAlert) { +TEST_F(ConvertiblePowerButtonControllerTest, A11yAlert) { TestAccessibilityControllerClient client; AccessibilityController* controller = Shell::Get()->accessibility_controller(); @@ -686,7 +689,7 @@ InitPowerButtonControllerMembers(true /* send_accelerometer_update */); ASSERT_FALSE(base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kAshEnableTabletMode)); - EXPECT_FALSE(tablet_controller_); + EXPECT_FALSE(convertible_controller_); } } // namespace ash
diff --git a/ash/system/power/power_button_controller.cc b/ash/system/power/power_button_controller.cc index 21c6eac..d52b9984 100644 --- a/ash/system/power/power_button_controller.cc +++ b/ash/system/power/power_button_controller.cc
@@ -12,9 +12,9 @@ #include "ash/session/session_controller.h" #include "ash/shell.h" #include "ash/shutdown_reason.h" +#include "ash/system/power/convertible_power_button_controller.h" #include "ash/system/power/power_button_display_controller.h" #include "ash/system/power/power_button_screenshot_controller.h" -#include "ash/system/power/tablet_power_button_controller.h" #include "ash/wm/lock_state_controller.h" #include "ash/wm/session_state_animator.h" #include "base/command_line.h" @@ -187,8 +187,8 @@ return; // PowerButtonDisplayController ignores power button events, so tell it to - // stop forcing the display off if TabletPowerButtonController isn't being - // used. + // stop forcing the display off if ConvertiblePowerButtonController isn't + // being used. if (down && force_clamshell_power_button_) display_controller_->SetBacklightsForcedOff(false); @@ -199,8 +199,8 @@ } // Handle tablet power button behavior. - if (button_type_ == ButtonType::NORMAL && tablet_controller_) { - tablet_controller_->OnPowerButtonEvent(down, timestamp); + if (button_type_ == ButtonType::NORMAL && convertible_controller_) { + convertible_controller_->OnPowerButtonEvent(down, timestamp); return; } @@ -215,14 +215,15 @@ // tablet mode, which must have seen accelerometer data before user actions. if (!enable_tablet_mode_) return; - if (!force_clamshell_power_button_ && !tablet_controller_) { - tablet_controller_ = std::make_unique<TabletPowerButtonController>( - display_controller_.get(), tick_clock_.get()); + if (!force_clamshell_power_button_ && !convertible_controller_) { + convertible_controller_ = + std::make_unique<ConvertiblePowerButtonController>( + display_controller_.get(), tick_clock_.get()); } if (!screenshot_controller_) { screenshot_controller_ = std::make_unique<PowerButtonScreenshotController>( - tablet_controller_.get(), tick_clock_.get(), + convertible_controller_.get(), tick_clock_.get(), force_clamshell_power_button_); } }
diff --git a/ash/system/power/power_button_controller.h b/ash/system/power/power_button_controller.h index a39af2f3..57f77ad 100644 --- a/ash/system/power/power_button_controller.h +++ b/ash/system/power/power_button_controller.h
@@ -23,16 +23,16 @@ namespace ash { class BacklightsForcedOffSetter; +class ConvertiblePowerButtonController; class LockStateController; class PowerButtonDisplayController; class PowerButtonScreenshotController; -class TabletPowerButtonController; -// Handles power button and lock button events. For convertible/tablet devices, -// power button events are handled by TabletPowerButtonController to perform -// tablet power button behavior, except forced clamshell set by command line. -// For clamshell devices, power button acts locking or shutdown. On tablet mode, -// power button may also be consumed to take a screenshot. +// Handles power button and lock button events. For convertible devices, +// power button events are handled by ConvertiblePowerButtonController to +// perform corresponding power button behavior, except forced clamshell set by +// command line. For clamshell devices, power button acts locking or shutdown. +// On tablet mode, power button may also be consumed to take a screenshot. class ASH_EXPORT PowerButtonController : public ui::EventHandler, public display::DisplayConfigurator::Observer, @@ -88,8 +88,9 @@ return screenshot_controller_.get(); } - TabletPowerButtonController* tablet_power_button_controller_for_test() { - return tablet_controller_.get(); + ConvertiblePowerButtonController* + convertible_power_button_controller_for_test() { + return convertible_controller_.get(); } void set_power_button_type_for_test(ButtonType button_type) { @@ -146,8 +147,8 @@ // Handles events for power button screenshot. std::unique_ptr<PowerButtonScreenshotController> screenshot_controller_; - // Handles events for convertible/tablet devices. - std::unique_ptr<TabletPowerButtonController> tablet_controller_; + // Handles events for convertible devices. + std::unique_ptr<ConvertiblePowerButtonController> convertible_controller_; // Used to run ForceDisplayOffAfterLock() shortly after the screen is locked. // Only started when |force_clamshell_power_button_| is true.
diff --git a/ash/system/power/power_button_screenshot_controller.cc b/ash/system/power/power_button_screenshot_controller.cc index 7208eb8b51..a21a91f 100644 --- a/ash/system/power/power_button_screenshot_controller.cc +++ b/ash/system/power/power_button_screenshot_controller.cc
@@ -6,8 +6,8 @@ #include "ash/accelerators/accelerator_controller.h" #include "ash/shell.h" +#include "ash/system/power/convertible_power_button_controller.h" #include "ash/system/power/power_button_controller.h" -#include "ash/system/power/tablet_power_button_controller.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/user_metrics.h" @@ -30,10 +30,10 @@ PowerButtonScreenshotController::kScreenshotChordDelay; PowerButtonScreenshotController::PowerButtonScreenshotController( - TabletPowerButtonController* tablet_controller, + ConvertiblePowerButtonController* convertible_controller, base::TickClock* tick_clock, bool force_clamshell_power_button) - : tablet_controller_(tablet_controller), + : convertible_controller_(convertible_controller), tick_clock_(tick_clock), force_clamshell_power_button_(force_clamshell_power_button) { DCHECK(tick_clock_); @@ -113,11 +113,11 @@ if (key_code == ui::VKEY_VOLUME_UP) volume_up_key_pressed_ = event->type() == ui::ET_KEY_PRESSED; - // When volume key is pressed, cancel the ongoing tablet power button + // When volume key is pressed, cancel the ongoing convertible power button // behavior. if ((volume_down_key_pressed_ || volume_up_key_pressed_) && - tablet_controller_) { - tablet_controller_->CancelTabletPowerButton(); + convertible_controller_) { + convertible_controller_->CancelTabletPowerButton(); } // On volume down key pressed while power button not pressed yet state, do not
diff --git a/ash/system/power/power_button_screenshot_controller.h b/ash/system/power/power_button_screenshot_controller.h index 42c2935..69b56fd 100644 --- a/ash/system/power/power_button_screenshot_controller.h +++ b/ash/system/power/power_button_screenshot_controller.h
@@ -19,7 +19,7 @@ namespace ash { -class TabletPowerButtonController; +class ConvertiblePowerButtonController; // Handles power button screenshot accelerator. The screenshot condition is // pressing power button and volume down key simultaneously, similar to Android @@ -32,7 +32,7 @@ base::TimeDelta::FromMilliseconds(150); PowerButtonScreenshotController( - TabletPowerButtonController* tablet_controller, + ConvertiblePowerButtonController* tablet_controller, base::TickClock* tick_clock, bool force_clamshell_power_button); ~PowerButtonScreenshotController() override; @@ -86,7 +86,7 @@ // Runs OnClamshellTimeout to start clamshell power button behavior. base::OneShotTimer clamshell_power_button_timer_; - TabletPowerButtonController* tablet_controller_; // Not owned. + ConvertiblePowerButtonController* convertible_controller_; // Not owned. // Time source for performed action times. base::TickClock* tick_clock_; // Not owned.
diff --git a/ash/system/power/power_button_screenshot_controller_unittest.cc b/ash/system/power/power_button_screenshot_controller_unittest.cc index 17cb8961..dab32b3 100644 --- a/ash/system/power/power_button_screenshot_controller_unittest.cc +++ b/ash/system/power/power_button_screenshot_controller_unittest.cc
@@ -8,10 +8,10 @@ #include "ash/login_status.h" #include "ash/shell.h" +#include "ash/system/power/convertible_power_button_controller_test_api.h" #include "ash/system/power/power_button_controller.h" #include "ash/system/power/power_button_screenshot_controller_test_api.h" #include "ash/system/power/power_button_test_base.h" -#include "ash/system/power/tablet_power_button_controller_test_api.h" #include "ash/test_screenshot_delegate.h" #include "ash/wm/lock_state_controller_test_api.h" #include "base/test/simple_test_tick_clock.h" @@ -178,21 +178,21 @@ EXPECT_FALSE(LastKeyConsumed()); } -// Tests volume key pressed cancels the ongoing tablet power button. +// Tests volume key pressed cancels the ongoing convertible power button. TEST_F(PowerButtonScreenshotControllerTest, - PowerButtonPressedFirst_VolumeKeyCancelTabletPowerButton) { - // Tests volume down key can stop tablet power button's shutdown timer. + PowerButtonPressedFirst_VolumeKeyCancelConvertiblePowerButton) { + // Tests volume down key can stop convertible power button's shutdown timer. PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); PressKey(ui::VKEY_VOLUME_DOWN); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); ReleasePowerButton(); ReleaseKey(ui::VKEY_VOLUME_DOWN); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); // Tests volume down key can stop shutdown animation timer. PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->TriggerShutdownTimeout()); + EXPECT_TRUE(convertible_test_api_->TriggerShutdownTimeout()); EXPECT_TRUE(lock_state_test_api_->shutdown_timer_is_running()); PressKey(ui::VKEY_VOLUME_DOWN); EXPECT_FALSE(lock_state_test_api_->shutdown_timer_is_running()); @@ -200,13 +200,13 @@ ReleaseKey(ui::VKEY_VOLUME_DOWN); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); - // Tests volume up key can stop tablet power button's shutdown timer. + // Tests volume up key can stop convertible power button's shutdown timer. // Also tests that volume up key is not consumed. PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_TRUE(convertible_test_api_->ShutdownTimerIsRunning()); PressKey(ui::VKEY_VOLUME_UP); EXPECT_FALSE(LastKeyConsumed()); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); ReleasePowerButton(); ReleaseKey(ui::VKEY_VOLUME_UP); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); @@ -215,7 +215,7 @@ // Tests volume up key can stop shutdown animation timer. // Also tests that volume up key is not consumed. PressPowerButton(); - EXPECT_TRUE(tablet_test_api_->TriggerShutdownTimeout()); + EXPECT_TRUE(convertible_test_api_->TriggerShutdownTimeout()); EXPECT_TRUE(lock_state_test_api_->shutdown_timer_is_running()); PressKey(ui::VKEY_VOLUME_UP); EXPECT_FALSE(LastKeyConsumed()); @@ -293,23 +293,23 @@ EXPECT_FALSE(LastKeyConsumed()); } -// Tests volume key pressed first invalidates tablet power button behavior. +// Tests volume key pressed first invalidates convertible power button behavior. TEST_F(PowerButtonScreenshotControllerTest, - VolumeKeyPressedFirst_InvalidateTabletPowerButton) { - // Tests volume down key invalidates tablet power button behavior. + VolumeKeyPressedFirst_InvalidateConvertiblePowerButton) { + // Tests volume down key invalidates convertible power button behavior. PressKey(ui::VKEY_VOLUME_DOWN); PressPowerButton(); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); ReleasePowerButton(); ReleaseKey(ui::VKEY_VOLUME_DOWN); EXPECT_FALSE(power_manager_client_->backlights_forced_off()); - // Tests volume up key invalidates tablet power button behavior. Also tests - // that volume up key is not consumed. + // Tests volume up key invalidates convertible power button behavior. Also + // tests that volume up key is not consumed. PressKey(ui::VKEY_VOLUME_UP); PressPowerButton(); EXPECT_FALSE(LastKeyConsumed()); - EXPECT_FALSE(tablet_test_api_->ShutdownTimerIsRunning()); + EXPECT_FALSE(convertible_test_api_->ShutdownTimerIsRunning()); ReleasePowerButton(); ReleaseKey(ui::VKEY_VOLUME_UP); EXPECT_FALSE(power_manager_client_->backlights_forced_off());
diff --git a/ash/system/power/power_button_test_base.cc b/ash/system/power/power_button_test_base.cc index c8a4f9c..88ea6ad0 100644 --- a/ash/system/power/power_button_test_base.cc +++ b/ash/system/power/power_button_test_base.cc
@@ -10,8 +10,8 @@ #include "ash/session/test_session_controller_client.h" #include "ash/shell.h" #include "ash/shell_test_api.h" +#include "ash/system/power/convertible_power_button_controller_test_api.h" #include "ash/system/power/power_button_controller.h" -#include "ash/system/power/tablet_power_button_controller_test_api.h" #include "ash/wm/lock_state_controller.h" #include "ash/wm/lock_state_controller_test_api.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" @@ -78,15 +78,17 @@ if (send_accelerometer_update) { SendAccelerometerUpdate(kSidewaysVector, kUpVector); - tablet_controller_ = - power_button_controller_->tablet_power_button_controller_for_test(); - tablet_test_api_ = std::make_unique<TabletPowerButtonControllerTestApi>( - tablet_controller_); + convertible_controller_ = + power_button_controller_ + ->convertible_power_button_controller_for_test(); + convertible_test_api_ = + std::make_unique<ConvertiblePowerButtonControllerTestApi>( + convertible_controller_); screenshot_controller_ = power_button_controller_->screenshot_controller_for_test(); } else { - tablet_test_api_ = nullptr; - tablet_controller_ = nullptr; + convertible_test_api_ = nullptr; + convertible_controller_ = nullptr; screenshot_controller_ = nullptr; } } @@ -102,8 +104,8 @@ keyboard.y(), keyboard.z()); power_button_controller_->OnAccelerometerUpdated(update); - tablet_controller_ = - power_button_controller_->tablet_power_button_controller_for_test(); + convertible_controller_ = + power_button_controller_->convertible_power_button_controller_for_test(); screenshot_controller_ = power_button_controller_->screenshot_controller_for_test(); }
diff --git a/ash/system/power/power_button_test_base.h b/ash/system/power/power_button_test_base.h index 5228a12..37cc60c 100644 --- a/ash/system/power/power_button_test_base.h +++ b/ash/system/power/power_button_test_base.h
@@ -7,8 +7,8 @@ #include <memory> +#include "ash/system/power/convertible_power_button_controller.h" #include "ash/system/power/power_button_controller.h" -#include "ash/system/power/tablet_power_button_controller.h" #include "ash/test/ash_test_base.h" #include "ui/events/keycodes/keyboard_codes_posix.h" @@ -27,10 +27,10 @@ namespace ash { +class ConvertiblePowerButtonControllerTestApi; class LockStateController; class LockStateControllerTestApi; class PowerButtonScreenshotController; -class TabletPowerButtonControllerTestApi; enum class LoginStatus; // Base test fixture and utils for testing power button related functions. @@ -43,15 +43,15 @@ // Vector pointing up (e.g. keyboard in clamshell). static constexpr gfx::Vector3dF kUpVector = { - 0, 0, TabletPowerButtonController::kGravity}; + 0, 0, ConvertiblePowerButtonController::kGravity}; // Vector pointing down (e.g. keyboard in tablet sitting on table). static constexpr gfx::Vector3dF kDownVector = { - 0, 0, -TabletPowerButtonController::kGravity}; + 0, 0, -ConvertiblePowerButtonController::kGravity}; // Vector pointing sideways (e.g. screen in 90-degree clamshell). static constexpr gfx::Vector3dF kSidewaysVector = { - 0, TabletPowerButtonController::kGravity, 0}; + 0, ConvertiblePowerButtonController::kGravity, 0}; // AshTestBase: void SetUp() override; @@ -63,7 +63,7 @@ // Initializes |power_button_controller_| and other members that point at // objects owned by it. If |send_accelerometer_update| is true, an - // accelerometer update is sent to create TabletPowerButtonController and + // accelerometer update is sent to create ConvertiblePowerButtonController and // PowerButtonScreenshotController. void InitPowerButtonControllerMembers(bool send_accelerometer_update); @@ -114,11 +114,13 @@ PowerButtonController* power_button_controller_ = nullptr; // Not owned. LockStateController* lock_state_controller_ = nullptr; // Not owned. - TabletPowerButtonController* tablet_controller_ = nullptr; // Not owned. + ConvertiblePowerButtonController* convertible_controller_ = + nullptr; // Not owned. PowerButtonScreenshotController* screenshot_controller_ = nullptr; // Not owned. std::unique_ptr<LockStateControllerTestApi> lock_state_test_api_; - std::unique_ptr<TabletPowerButtonControllerTestApi> tablet_test_api_; + std::unique_ptr<ConvertiblePowerButtonControllerTestApi> + convertible_test_api_; base::SimpleTestTickClock* tick_clock_ = nullptr; // Not owned. // Indicates whether switches::kAshEnableTabletMode is appended.
diff --git a/ash/system/power/tablet_power_button_controller_test_api.cc b/ash/system/power/tablet_power_button_controller_test_api.cc deleted file mode 100644 index 183217a2..0000000 --- a/ash/system/power/tablet_power_button_controller_test_api.cc +++ /dev/null
@@ -1,37 +0,0 @@ -// Copyright 2017 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/power/tablet_power_button_controller_test_api.h" - -#include "ash/system/power/power_button_display_controller.h" -#include "ash/system/power/tablet_power_button_controller.h" - -namespace ash { - -TabletPowerButtonControllerTestApi::TabletPowerButtonControllerTestApi( - TabletPowerButtonController* controller) - : controller_(controller) {} - -TabletPowerButtonControllerTestApi::~TabletPowerButtonControllerTestApi() = - default; - -bool TabletPowerButtonControllerTestApi::ShutdownTimerIsRunning() const { - return controller_->shutdown_timer_.IsRunning(); -} - -bool TabletPowerButtonControllerTestApi::TriggerShutdownTimeout() { - if (!controller_->shutdown_timer_.IsRunning()) - return false; - - base::Closure task = controller_->shutdown_timer_.user_task(); - controller_->shutdown_timer_.Stop(); - task.Run(); - return true; -} - -void TabletPowerButtonControllerTestApi::SendKeyEvent(ui::KeyEvent* event) { - controller_->display_controller_->OnKeyEvent(event); -} - -} // namespace ash
diff --git a/ash/system/power/tablet_power_button_controller_test_api.h b/ash/system/power/tablet_power_button_controller_test_api.h deleted file mode 100644 index f97c50c2..0000000 --- a/ash/system/power/tablet_power_button_controller_test_api.h +++ /dev/null
@@ -1,45 +0,0 @@ -// Copyright 2017 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_POWER_TABLET_POWER_BUTTON_CONTROLLER_TEST_API_H_ -#define ASH_SYSTEM_POWER_TABLET_POWER_BUTTON_CONTROLLER_TEST_API_H_ - -#include "base/compiler_specific.h" -#include "base/macros.h" - -namespace ui { -class KeyEvent; -} // namespace ui - -namespace ash { - -class TabletPowerButtonController; - -// Helper class used by tests to access TabletPowerButtonController's internal -// state. -class TabletPowerButtonControllerTestApi { - public: - explicit TabletPowerButtonControllerTestApi( - TabletPowerButtonController* controller); - ~TabletPowerButtonControllerTestApi(); - - // Returns true when |controller_->shutdown_timer_| is running. - bool ShutdownTimerIsRunning() const; - - // If |controller_->shutdown_timer_| is running, stops it, runs its task, and - // returns true. Otherwise, returns false. - bool TriggerShutdownTimeout() WARN_UNUSED_RESULT; - - // Sends |event| to |controller_->display_controller_|. - void SendKeyEvent(ui::KeyEvent* event); - - private: - TabletPowerButtonController* controller_; // Not owned. - - DISALLOW_COPY_AND_ASSIGN(TabletPowerButtonControllerTestApi); -}; - -} // namespace ash - -#endif // ASH_SYSTEM_POWER_TABLET_POWER_BUTTON_CONTROLLER_TEST_API_H_
diff --git a/ash/system/screen_layout_observer_unittest.cc b/ash/system/screen_layout_observer_unittest.cc index aab99c6..8246e2d 100644 --- a/ash/system/screen_layout_observer_unittest.cc +++ b/ash/system/screen_layout_observer_unittest.cc
@@ -125,7 +125,34 @@ return nullptr; } -TEST_F(ScreenLayoutObserverTest, DisplayNotifications) { +class ScreenLayoutObserverTestMultiMirroring + : public ScreenLayoutObserverTest, + public testing::WithParamInterface<bool> { + public: + ScreenLayoutObserverTestMultiMirroring() = default; + ~ScreenLayoutObserverTestMultiMirroring() override = default; + + protected: + void SetUp() override { + bool should_disable_multi_mirroring = GetParam(); + if (should_disable_multi_mirroring) { + base::CommandLine::ForCurrentProcess()->AppendSwitch( + ::switches::kDisableMultiMirroring); + } + ScreenLayoutObserverTest::SetUp(); + } + + private: + DISALLOW_COPY_AND_ASSIGN(ScreenLayoutObserverTestMultiMirroring); +}; + +// Instantiate the boolean which is used to enable/disable multi-mirroring in +// the parameterized tests. +INSTANTIATE_TEST_CASE_P(, + ScreenLayoutObserverTestMultiMirroring, + testing::Bool()); + +TEST_P(ScreenLayoutObserverTestMultiMirroring, DisplayNotifications) { Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing( true); @@ -227,10 +254,15 @@ // Turn off mirror mode. CloseNotification(); display_manager()->SetMirrorMode(false); - display_manager()->OnNativeDisplaysChanged(display_info_list); - EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, - GetSecondDisplayName()), - GetDisplayNotificationText()); + if (display_manager()->is_multi_mirroring_enabled()) { + EXPECT_EQ( + l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_MIRROR_EXIT), + GetDisplayNotificationText()); + } else { + EXPECT_EQ(l10n_util::GetStringFUTF16(IDS_ASH_STATUS_TRAY_DISPLAY_EXTENDED, + GetSecondDisplayName()), + GetDisplayNotificationText()); + } EXPECT_TRUE(GetDisplayNotificationAdditionalText().empty()); // Resize the first display. @@ -351,7 +383,13 @@ // default. // Tests that exiting mirror mode because of adding a third display shows the // correct "3+ displays mirror mode is not supported" message. -TEST_F(ScreenLayoutObserverTest, ExitMirrorModeBecauseOfThirdDisplayMessage) { +TEST_P(ScreenLayoutObserverTestMultiMirroring, + ExitMirrorModeBecauseOfThirdDisplayMessage) { + if (display_manager()->is_multi_mirroring_enabled()) { + // This test is not neccessary when mirroring across 3+ displays is + // supported. + return; + } Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing( true); UpdateDisplay("400x400,200x200"); @@ -548,25 +586,7 @@ EXPECT_TRUE(GetDisplayNotificationText().empty()); } -// Test ScreenLayoutObserver with multi-mirroring enabled. -class ScreenLayoutObserverMultiMirroringTest : public ScreenLayoutObserverTest { - public: - ScreenLayoutObserverMultiMirroringTest() = default; - ~ScreenLayoutObserverMultiMirroringTest() override = default; - - // ScreenLayoutObserverTest: - void SetUp() override { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - ::switches::kEnableMultiMirroring); - ScreenLayoutObserverTest::SetUp(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(ScreenLayoutObserverMultiMirroringTest); -}; - -TEST_F(ScreenLayoutObserverMultiMirroringTest, - MirrorModeAddOrRemoveDisplayMessage) { +TEST_F(ScreenLayoutObserverTest, MirrorModeAddOrRemoveDisplayMessage) { Shell::Get()->screen_layout_observer()->set_show_notifications_for_testing( true);
diff --git a/ash/system/supervised/tray_supervised_user.cc b/ash/system/supervised/tray_supervised_user.cc index ca850f0d..8c62331 100644 --- a/ash/system/supervised/tray_supervised_user.cc +++ b/ash/system/supervised/tray_supervised_user.cc
@@ -62,9 +62,16 @@ return tray_view; } +void TraySupervisedUser::OnActiveUserSessionChanged( + const AccountId& account_id) { + OnUserSessionUpdated(account_id); +} + +void TraySupervisedUser::OnUserSessionAdded(const AccountId& account_id) { + OnUserSessionUpdated(account_id); +} + void TraySupervisedUser::OnUserSessionUpdated(const AccountId& account_id) { - // NOTE: This doesn't use OnUserSessionAdded() because the custodian info - // isn't available until after the session starts. SessionController* session_controller = Shell::Get()->session_controller(); if (!session_controller->IsUserSupervised()) return;
diff --git a/ash/system/supervised/tray_supervised_user.h b/ash/system/supervised/tray_supervised_user.h index dd04292..3d83363 100644 --- a/ash/system/supervised/tray_supervised_user.h +++ b/ash/system/supervised/tray_supervised_user.h
@@ -28,6 +28,8 @@ views::View* CreateDefaultView(LoginStatus status) override; // SessionObserver: + void OnActiveUserSessionChanged(const AccountId& account_id) override; + void OnUserSessionAdded(const AccountId& account_id) override; void OnUserSessionUpdated(const AccountId& account_id) override; private:
diff --git a/ash/system/tray/system_tray_view.cc b/ash/system/tray/system_tray_view.cc index 0936a0d..c4d2745 100644 --- a/ash/system/tray/system_tray_view.cc +++ b/ash/system/tray/system_tray_view.cc
@@ -4,7 +4,7 @@ #include "ash/system/tray/system_tray_view.h" -#include "ash/shell_port.h" +#include "ash/shell.h" #include "ash/system/tray/system_tray_item.h" #include "base/metrics/histogram_macros.h" #include "ui/views/layout/box_layout.h" @@ -61,7 +61,7 @@ // If a system modal dialog is present, create the same tray as // in locked state. - if (ShellPort::Get()->IsSystemModalWindowOpen() && + if (Shell::IsSystemModalWindowOpen() && login_status != LoginStatus::NOT_LOGGED_IN) { login_status = LoginStatus::LOCKED; }
diff --git a/ash/system/user/user_view.cc b/ash/system/user/user_view.cc index 0017f864..5354e7a 100644 --- a/ash/system/user/user_view.cc +++ b/ash/system/user/user_view.cc
@@ -15,7 +15,6 @@ #include "ash/root_window_controller.h" #include "ash/session/session_controller.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/tray/system_tray.h" #include "ash/system/tray/tray_constants.h" @@ -71,7 +70,7 @@ bool IsUserDropdownEnabled() { // Don't allow user add or switch when screen cast warning dialog is open. // See http://crrev.com/291276 and http://crbug.com/353170. - if (ShellPort::Get()->IsSystemModalWindowOpen()) + if (Shell::IsSystemModalWindowOpen()) return false; // Don't allow at login, lock or when adding a multi-profile user.
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc index 65d69af..76cea012 100644 --- a/ash/test/ash_test_base.cc +++ b/ash/test/ash_test_base.cc
@@ -30,6 +30,7 @@ #include "ash/wm/window_positioner.h" #include "base/memory/ptr_util.h" #include "components/signin/core/account_id/account_id.h" +#include "components/user_manager/user_names.h" #include "services/ui/public/cpp/property_type_converters.h" #include "services/ui/public/interfaces/window_manager.mojom.h" #include "services/ui/public/interfaces/window_manager_constants.mojom.h" @@ -398,6 +399,14 @@ session_controller_client->SetSessionState(SessionState::ACTIVE); } +void AshTestBase::SimulateGuestLogin() { + const std::string guest = user_manager::kGuestUserName; + TestSessionControllerClient* session = GetSessionControllerClient(); + session->AddUserSession(guest, user_manager::USER_TYPE_GUEST); + session->SwitchActiveUser(AccountId::FromUserEmail(guest)); + session->SetSessionState(SessionState::ACTIVE); +} + void AshTestBase::ClearLogin() { GetSessionControllerClient()->Reset(); }
diff --git a/ash/test/ash_test_base.h b/ash/test/ash_test_base.h index 37354da9..5e479684 100644 --- a/ash/test/ash_test_base.h +++ b/ash/test/ash_test_base.h
@@ -185,6 +185,9 @@ // existing user sessions and makes it the active user session. void SimulateUserLogin(const std::string& user_email); + // Similar to SimulateUserLogin but for a guest user. + void SimulateGuestLogin(); + // Clears all user sessions and resets to the primary login screen state. void ClearLogin();
diff --git a/ash/test/ash_test_suite.cc b/ash/test/ash_test_suite.cc index 40d7d7f2..31bb959 100644 --- a/ash/test/ash_test_suite.cc +++ b/ash/test/ash_test_suite.cc
@@ -10,7 +10,6 @@ #include "base/command_line.h" #include "base/files/file_path.h" #include "base/i18n/rtl.h" -#include "base/metrics/statistics_recorder.h" #include "base/path_service.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" @@ -30,8 +29,6 @@ void AshTestSuite::Initialize() { base::TestSuite::Initialize(); - // Ensure histograms hit during tests are registered properly. - base::StatisticsRecorder::Initialize(); gl::GLSurfaceTestSupport::InitializeOneOff(); gfx::RegisterPathProvider();
diff --git a/ash/wallpaper/wallpaper_controller.cc b/ash/wallpaper/wallpaper_controller.cc index dc235d01..b5050586b 100644 --- a/ash/wallpaper/wallpaper_controller.cc +++ b/ash/wallpaper/wallpaper_controller.cc
@@ -37,7 +37,6 @@ #include "chromeos/chromeos_switches.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/scoped_user_pref_update.h" -#include "components/user_manager/user_image/user_image.h" #include "components/wallpaper/wallpaper_color_calculator.h" #include "components/wallpaper/wallpaper_color_profile.h" #include "components/wallpaper/wallpaper_files_id.h" @@ -533,9 +532,7 @@ if (!data_is_ready || !Shell::Get()->shell_delegate()->GetShellConnector()) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, - base::BindOnce( - std::move(callback), - base::Passed(std::make_unique<user_manager::UserImage>()))); + base::BindOnce(std::move(callback), base::Passed(gfx::ImageSkia()))); } else { DecodeWallpaper(std::move(data), std::move(callback)); } @@ -684,15 +681,14 @@ file_path = command_line->GetSwitchValuePath(switch_string); } - // We need to decode the image if the cached default wallpaper doesn't exist, - // or if the two file paths don't match; otherwise, directly run the callback - // with the cached decoded image. - if (default_wallpaper_image_.get() && - default_wallpaper_image_->file_path() == file_path) { + // We need to decode the image if there's no cache, or if the file path + // doesn't match the cached value (i.e. the cache is outdated). Otherwise, + // directly run the callback with the cached image. + if (!cached_default_wallpaper_.image.isNull() && + cached_default_wallpaper_.file_path == file_path) { OnDefaultWallpaperDecoded(file_path, layout, show_wallpaper, - std::move(default_wallpaper_image_)); + cached_default_wallpaper_.image); } else { - default_wallpaper_image_.reset(); ReadAndDecodeWallpaper( base::Bind(&WallpaperController::OnDefaultWallpaperDecoded, weak_factory_.GetWeakPtr(), file_path, layout, @@ -701,44 +697,23 @@ } } -void WallpaperController::SetCustomizedDefaultWallpaperImpl( +void WallpaperController::SetCustomizedDefaultWallpaperPaths( const base::FilePath& customized_default_wallpaper_file_small, - std::unique_ptr<gfx::ImageSkia> small_wallpaper_image, - const base::FilePath& customized_default_wallpaper_file_large, - std::unique_ptr<gfx::ImageSkia> large_wallpaper_image) { + const base::FilePath& customized_default_wallpaper_file_large) { customized_default_wallpaper_small_ = customized_default_wallpaper_file_small; customized_default_wallpaper_large_ = customized_default_wallpaper_file_large; - // |show_wallpaper| is true if the previous default wallpaper is visible now, - // so we need to update wallpaper on the screen. Layout is ignored here, so - // wallpaper::WALLPAPER_LAYOUT_CENTER is used as a placeholder only. - const bool show_wallpaper = - default_wallpaper_image_.get() && - WallpaperIsAlreadyLoaded(default_wallpaper_image_->image(), - false /*compare_layouts=*/, - wallpaper::WALLPAPER_LAYOUT_CENTER); - - default_wallpaper_image_.reset(); - if (GetAppropriateResolution() == WALLPAPER_RESOLUTION_SMALL) { - if (small_wallpaper_image) { - default_wallpaper_image_.reset( - new user_manager::UserImage(*small_wallpaper_image)); - default_wallpaper_image_->set_file_path( - customized_default_wallpaper_file_small); - } - } else { - if (large_wallpaper_image) { - default_wallpaper_image_.reset( - new user_manager::UserImage(*large_wallpaper_image)); - default_wallpaper_image_->set_file_path( - customized_default_wallpaper_file_large); - } - } + // If the current wallpaper is the default one, then the new customized + // default wallpaper should be shown immediately to update the screen. It + // shouldn't replace wallpapers of other types. + bool show_wallpaper = true; + if (current_wallpaper_ && GetWallpaperType() != wallpaper::DEFAULT) + show_wallpaper = false; // Customized default wallpapers are subject to the same restrictions as other // default wallpapers, e.g. they should not be set during guest sessions. // TODO(crbug.com/776464): Find a way to directly set wallpaper from here, or - // combine this with |SetDefaultWallpaperImpl| since there's duplicate code. + // combine this method with |SetDefaultWallpaperImpl|. SetDefaultWallpaperImpl(EmptyAccountId(), user_manager::USER_TYPE_REGULAR, show_wallpaper); } @@ -1184,6 +1159,32 @@ } } +void WallpaperController::UpdateCustomWallpaperLayout( + mojom::WallpaperUserInfoPtr user_info, + wallpaper::WallpaperLayout layout) { + // This method has a very specific use case: the user should be active and + // have a custom wallpaper. + // The currently active user has index 0. + const mojom::UserSession* const active_user_session = + Shell::Get()->session_controller()->GetUserSession(0 /*user index=*/); + if (!active_user_session || + active_user_session->user_info->account_id != user_info->account_id) { + return; + } + WallpaperInfo info; + if (!GetUserWallpaperInfo(user_info->account_id, &info, + !user_info->is_ephemeral) || + info.type != wallpaper::CUSTOMIZED) { + return; + } + if (info.layout == layout) + return; + + info.layout = layout; + SetUserWallpaperInfo(user_info->account_id, info, !user_info->is_ephemeral); + ShowUserWallpaper(std::move(user_info)); +} + void WallpaperController::ShowUserWallpaper( mojom::WallpaperUserInfoPtr user_info) { current_user_ = std::move(user_info); @@ -1325,9 +1326,9 @@ } void WallpaperController::ShowDefaultWallpaperForTesting() { - default_wallpaper_image_.reset( - new user_manager::UserImage(CreateSolidColorWallpaper())); - SetWallpaperImage(default_wallpaper_image_->image(), + cached_default_wallpaper_.image = CreateSolidColorWallpaper(); + cached_default_wallpaper_.file_path.clear(); + SetWallpaperImage(cached_default_wallpaper_.image, wallpaper::WallpaperInfo( "", wallpaper::WALLPAPER_LAYOUT_STRETCH, wallpaper::DEFAULT, base::Time::Now().LocalMidnight())); @@ -1548,28 +1549,25 @@ const base::FilePath& path, wallpaper::WallpaperLayout layout, bool show_wallpaper, - std::unique_ptr<user_manager::UserImage> user_image) { - if (user_image->image().isNull()) { + const gfx::ImageSkia& image) { + if (image.isNull()) { // Create a solid color wallpaper if the default wallpaper decoding fails. - default_wallpaper_image_.reset( - new user_manager::UserImage(CreateSolidColorWallpaper())); + cached_default_wallpaper_.image = CreateSolidColorWallpaper(); + cached_default_wallpaper_.file_path.clear(); } else { - default_wallpaper_image_ = std::move(user_image); - // Make sure the file path is updated. - // TODO(crbug.com/776464): Use |ImageSkia| and |FilePath| directly to cache - // the decoded image and file path. Nothing else in |UserImage| is relevant. - default_wallpaper_image_->set_file_path(path); + cached_default_wallpaper_.image = image; + cached_default_wallpaper_.file_path = path; } if (show_wallpaper) { // 1x1 wallpaper is actually solid color, so it should be stretched. - if (default_wallpaper_image_->image().width() == 1 && - default_wallpaper_image_->image().height() == 1) { + if (cached_default_wallpaper_.image.width() == 1 && + cached_default_wallpaper_.image.height() == 1) { layout = wallpaper::WALLPAPER_LAYOUT_STRETCH; } - WallpaperInfo info(default_wallpaper_image_->file_path().value(), layout, + WallpaperInfo info(cached_default_wallpaper_.file_path.value(), layout, wallpaper::DEFAULT, base::Time::Now().LocalMidnight()); - SetWallpaperImage(default_wallpaper_image_->image(), info); + SetWallpaperImage(cached_default_wallpaper_.image, info); } } @@ -1646,19 +1644,18 @@ const base::FilePath& path, const wallpaper::WallpaperInfo& info, bool show_wallpaper, - std::unique_ptr<user_manager::UserImage> user_image) { + const gfx::ImageSkia& image) { // Empty image indicates decode failure. Use default wallpaper in this case. - if (user_image->image().isNull()) { + if (image.isNull()) { LOG(ERROR) << "Failed to decode user wallpaper at " << path.value() << " Falls back to default wallpaper. "; SetDefaultWallpaperImpl(account_id, user_type, show_wallpaper); return; } - wallpaper_cache_map_[account_id] = - CustomWallpaperElement(path, user_image->image()); + wallpaper_cache_map_[account_id] = CustomWallpaperElement(path, image); if (show_wallpaper) - SetWallpaperImage(user_image->image(), info); + SetWallpaperImage(image, info); } void WallpaperController::ReloadWallpaper(bool clear_cache) { @@ -1774,13 +1771,13 @@ } void WallpaperController::OnDevicePolicyWallpaperDecoded( - std::unique_ptr<user_manager::UserImage> device_wallpaper_image) { + const gfx::ImageSkia& image) { // It might be possible that the device policy controlled wallpaper finishes // decoding after the user logs in. In this case do nothing. if (!ShouldSetDevicePolicyWallpaper()) return; - if (device_wallpaper_image->image().isNull()) { + if (image.isNull()) { // If device policy wallpaper failed decoding, fall back to the default // wallpaper. SetDefaultWallpaperImpl(EmptyAccountId(), user_manager::USER_TYPE_REGULAR, @@ -1789,7 +1786,7 @@ WallpaperInfo info(GetDevicePolicyWallpaperFilePath().value(), wallpaper::WALLPAPER_LAYOUT_CENTER_CROPPED, wallpaper::DEVICE, base::Time::Now().LocalMidnight()); - SetWallpaperImage(device_wallpaper_image->image(), info); + SetWallpaperImage(image, info); } }
diff --git a/ash/wallpaper/wallpaper_controller.h b/ash/wallpaper/wallpaper_controller.h index 7e5bc27..1c1e53e 100644 --- a/ash/wallpaper/wallpaper_controller.h +++ b/ash/wallpaper/wallpaper_controller.h
@@ -36,10 +36,6 @@ struct ColorProfile; } // namespace color_utils -namespace user_manager { -class UserImage; -} // namespace user_manager - namespace wallpaper { class WallpaperColorCalculator; class WallpaperResizer; @@ -55,8 +51,7 @@ using CustomWallpaperElement = std::pair<base::FilePath, gfx::ImageSkia>; using CustomWallpaperMap = std::map<AccountId, CustomWallpaperElement>; -using LoadedCallback = - base::Callback<void(std::unique_ptr<user_manager::UserImage>)>; +using LoadedCallback = base::Callback<void(const gfx::ImageSkia& image)>; // Controls the desktop background wallpaper: // - Sets a wallpaper image and layout; @@ -251,14 +246,15 @@ const user_manager::UserType& user_type, bool show_wallpaper); - // Implementation of |SetCustomizedDefaultWallpaper|. Sets - // |default_wallpaper_image_| either to |small_wallpaper_image| or - // |large_wallpaper_image| depending on |GetAppropriateResolution|. - void SetCustomizedDefaultWallpaperImpl( + // TODO(crbug.com/776464): Convert this to a mojo call to replace + // |SetCustomizedDefaultWallpaper|. If possible, send the paths together with + // |SetClientAndPaths|. + // Sets the paths of customized default wallpaper to be used wherever a + // default wallpaper is needed. Note: it doesn't change the default wallpaper + // for guest and child accounts. + void SetCustomizedDefaultWallpaperPaths( const base::FilePath& customized_default_wallpaper_file_small, - std::unique_ptr<gfx::ImageSkia> small_wallpaper_image, - const base::FilePath& customized_default_wallpaper_file_large, - std::unique_ptr<gfx::ImageSkia> large_wallpaper_image); + const base::FilePath& customized_default_wallpaper_file_large); // Creates an empty wallpaper. Some tests require a wallpaper widget is ready // when running. However, the wallpaper widgets are now created @@ -322,8 +318,7 @@ // Returns whether the current wallpaper is blurred. bool IsWallpaperBlurred() const { return is_wallpaper_blurred_; } - // TODO(crbug.com/776464): Make this private. WallpaperInfo should be an - // internal concept. In addition, change |is_persistent| to |is_ephemeral| to + // TODO(crbug.com/776464): Change |is_persistent| to |is_ephemeral| to // be consistent with |mojom::WallpaperUserInfo|. // Sets wallpaper info for |account_id| and saves it to local state if // |is_persistent| is true. @@ -402,6 +397,8 @@ const base::FilePath& file_path, const base::FilePath& resized_directory) override; void SetDeviceWallpaperPolicyEnforced(bool enforced) override; + void UpdateCustomWallpaperLayout(mojom::WallpaperUserInfoPtr user_info, + wallpaper::WallpaperLayout layout) override; // TODO(crbug.com/776464): |ShowUserWallpaper| is incomplete until device // policy wallpaper is migrated. Callers from chrome should use // |WallpaperManager::ShowUserWallpaper| instead. Callers in ash can't use it @@ -440,6 +437,13 @@ WallpaperMovementDuringUnlock); friend class WallpaperControllerTest; + // Cached default wallpaper image and file path. The file path can be used to + // check if the image is outdated (i.e. when there's a new default wallpaper). + struct CachedDefaultWallpaper { + gfx::ImageSkia image; + base::FilePath file_path; + }; + // Creates a WallpaperWidgetController for |root_window|. void InstallDesktopController(aura::Window* root_window); @@ -471,11 +475,10 @@ // Used as the callback of default wallpaper decoding. Sets default wallpaper // to be the decoded image, and shows the wallpaper now if |show_wallpaper| // is true. - void OnDefaultWallpaperDecoded( - const base::FilePath& path, - wallpaper::WallpaperLayout layout, - bool show_wallpaper, - std::unique_ptr<user_manager::UserImage> user_image); + void OnDefaultWallpaperDecoded(const base::FilePath& path, + wallpaper::WallpaperLayout layout, + bool show_wallpaper, + const gfx::ImageSkia& image); // Saves |image| to disk if |user_info->is_ephemeral| is false, or if it is a // policy wallpaper for public accounts. Shows the wallpaper immediately if @@ -505,7 +508,7 @@ const base::FilePath& path, const wallpaper::WallpaperInfo& info, bool show_wallpaper, - std::unique_ptr<user_manager::UserImage> user_image); + const gfx::ImageSkia& image); // Reloads the current wallpaper. It may change the wallpaper size based on // the current display's resolution. If |clear_cache| is true, all wallpaper @@ -551,8 +554,7 @@ void SetDevicePolicyWallpaper(); // Called when the device policy controlled wallpaper has been decoded. - void OnDevicePolicyWallpaperDecoded( - std::unique_ptr<user_manager::UserImage> device_wallpaper_image); + void OnDevicePolicyWallpaperDecoded(const gfx::ImageSkia& image); // When wallpaper resizes, we can check which displays will be affected. For // simplicity, we only lock the compositor for the internal display. @@ -598,8 +600,8 @@ // Cached wallpapers of users. CustomWallpaperMap wallpaper_cache_map_; - // Current decoded default image is stored in cache. - std::unique_ptr<user_manager::UserImage> default_wallpaper_image_; + // Cached default wallpaper. + CachedDefaultWallpaper cached_default_wallpaper_; // The paths of the customized default wallpapers, if they exist. base::FilePath customized_default_wallpaper_small_;
diff --git a/ash/wallpaper/wallpaper_controller_unittest.cc b/ash/wallpaper/wallpaper_controller_unittest.cc index 342e2da..65cb8ad 100644 --- a/ash/wallpaper/wallpaper_controller_unittest.cc +++ b/ash/wallpaper/wallpaper_controller_unittest.cc
@@ -1021,12 +1021,7 @@ wallpaper::DEFAULT, base::Time::Now().LocalMidnight()); EXPECT_NE(wallpaper_info.type, default_wallpaper_info.type); - // Simulate guest login. - const std::string guest = "guest@test.com"; - TestSessionControllerClient* session = GetSessionControllerClient(); - session->AddUserSession(guest, user_manager::USER_TYPE_GUEST); - session->SwitchActiveUser(AccountId::FromUserEmail(guest)); - session->SetSessionState(SessionState::ACTIVE); + SimulateGuestLogin(); // Verify that during a guest session, |SetDefaultWallpaper| removes the user // custom wallpaper info, but a guest specific wallpaper should be set, @@ -1306,6 +1301,69 @@ EXPECT_EQ(0, GetWallpaperCount()); } +TEST_F(WallpaperControllerTest, UpdateCustomWallpaperLayout) { + gfx::ImageSkia image = CreateImage(640, 480, kSmallCustomWallpaperColor); + WallpaperLayout layout = WALLPAPER_LAYOUT_CENTER; + wallpaper::WallpaperType type = wallpaper::CUSTOMIZED; + SimulateUserLogin(user_1); + + // Set a custom wallpaper for the user. Verify that it's set successfully + // and the wallpaper info is updated. + controller_->SetCustomWallpaper( + InitializeUser(account_id_1), wallpaper_files_id_1, file_name_1, layout, + type, *image.bitmap(), true /*show_wallpaper=*/); + RunAllTasksUntilIdle(); + EXPECT_EQ(1, GetWallpaperCount()); + EXPECT_EQ(controller_->GetWallpaperLayout(), layout); + wallpaper::WallpaperInfo wallpaper_info; + EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info, + true /* is_persistent */)); + wallpaper::WallpaperInfo expected_wallpaper_info( + base::FilePath(wallpaper_files_id_1).Append(file_name_1).value(), layout, + type, base::Time::Now().LocalMidnight()); + EXPECT_EQ(wallpaper_info, expected_wallpaper_info); + + // Now change to a different layout. Verify that the layout is updated for + // both the current wallpaper and the saved wallpaper info. + layout = WALLPAPER_LAYOUT_CENTER_CROPPED; + controller_->UpdateCustomWallpaperLayout(InitializeUser(account_id_1), + layout); + RunAllTasksUntilIdle(); + EXPECT_EQ(1, GetWallpaperCount()); + EXPECT_EQ(controller_->GetWallpaperLayout(), layout); + EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info, + true /* is_persistent */)); + expected_wallpaper_info.layout = layout; + EXPECT_EQ(wallpaper_info, expected_wallpaper_info); + + // Now set an online wallpaper. Verify that it's set successfully and the + // wallpaper info is updated. + const std::string url = "dummy_url"; + image = CreateImage(640, 480, kWallpaperColor); + controller_->SetOnlineWallpaper(InitializeUser(account_id_1), *image.bitmap(), + url, layout, true /*show_wallpaper=*/); + RunAllTasksUntilIdle(); + EXPECT_EQ(1, GetWallpaperCount()); + EXPECT_EQ(controller_->GetWallpaperType(), wallpaper::ONLINE); + EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info, + true /*is_persistent=*/)); + expected_wallpaper_info.type = wallpaper::ONLINE; + expected_wallpaper_info.location = url; + EXPECT_EQ(wallpaper_info, expected_wallpaper_info); + + // Now change the layout of the online wallpaper. Verify that it's a no-op. + controller_->UpdateCustomWallpaperLayout(InitializeUser(account_id_1), + WALLPAPER_LAYOUT_CENTER); + RunAllTasksUntilIdle(); + // The wallpaper is not updated. + EXPECT_EQ(0, GetWallpaperCount()); + EXPECT_EQ(controller_->GetWallpaperLayout(), layout); + // The saved wallpaper info is not updated. + EXPECT_TRUE(controller_->GetUserWallpaperInfo(account_id_1, &wallpaper_info, + true /* is_persistent */)); + EXPECT_EQ(wallpaper_info, expected_wallpaper_info); +} + // Tests that if a user who has a custom wallpaper is removed from the device, // only the directory that contains the user's custom wallpapers gets removed. // The other user's custom wallpaper is not affected.
diff --git a/ash/wallpaper/wallpaper_decoder.cc b/ash/wallpaper/wallpaper_decoder.cc index d48a4ae3..8f3f97b 100644 --- a/ash/wallpaper/wallpaper_decoder.cc +++ b/ash/wallpaper/wallpaper_decoder.cc
@@ -7,7 +7,6 @@ #include "ash/shell.h" #include "ash/shell_delegate.h" #include "base/sequenced_task_runner.h" -#include "components/user_manager/user_image/user_image.h" #include "ipc/ipc_channel.h" #include "services/data_decoder/public/cpp/decode_image.h" @@ -17,22 +16,17 @@ const int64_t kMaxImageSizeInBytes = static_cast<int64_t>(IPC::Channel::kMaximumMessageSize); -// TODO(crbug.com/776464): This should be changed to |ConvertToImageSkia| after -// the use of |UserImage| in |WallpaperManager| is deprecated. -void ConvertToUserImage(OnWallpaperDecoded callback, const SkBitmap& image) { +void ConvertToImageSkia(OnWallpaperDecoded callback, const SkBitmap& image) { if (image.isNull()) { - std::move(callback).Run(std::make_unique<user_manager::UserImage>()); + std::move(callback).Run(gfx::ImageSkia()); return; } SkBitmap final_image = image; final_image.setImmutable(); gfx::ImageSkia image_skia = gfx::ImageSkia::CreateFrom1xBitmap(final_image); image_skia.MakeThreadSafe(); - auto user_image = std::make_unique<user_manager::UserImage>( - image_skia, new base::RefCountedBytes() /* unused */, - user_manager::UserImage::FORMAT_JPEG /* unused */); - std::move(callback).Run(std::move(user_image)); + std::move(callback).Run(image_skia); } } // namespace @@ -46,7 +40,7 @@ std::move(image_bytes), data_decoder::mojom::ImageCodec::ROBUST_JPEG, false /* shrink_to_fit */, kMaxImageSizeInBytes, gfx::Size() /* desired_image_frame_size */, - base::BindOnce(&ConvertToUserImage, std::move(callback))); + base::BindOnce(&ConvertToImageSkia, std::move(callback))); } } // namespace ash \ No newline at end of file
diff --git a/ash/wallpaper/wallpaper_decoder.h b/ash/wallpaper/wallpaper_decoder.h index 5931f6e..8f559aa 100644 --- a/ash/wallpaper/wallpaper_decoder.h +++ b/ash/wallpaper/wallpaper_decoder.h
@@ -9,14 +9,14 @@ #include "base/callback_forward.h" #include "base/memory/scoped_refptr.h" -namespace user_manager { -class UserImage; +namespace gfx { +class ImageSkia; } namespace ash { -using OnWallpaperDecoded = base::OnceCallback<void( - std::unique_ptr<user_manager::UserImage> user_image)>; +using OnWallpaperDecoded = + base::OnceCallback<void(const gfx::ImageSkia& image)>; // Do an async wallpaper decode; |on_decoded| is run on the calling thread when // the decode has finished.
diff --git a/ash/wm/ash_focus_rules.cc b/ash/wm/ash_focus_rules.cc index 7c984e4..c4f875ad 100644 --- a/ash/wm/ash_focus_rules.cc +++ b/ash/wm/ash_focus_rules.cc
@@ -6,7 +6,6 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/wm/container_finder.h" #include "ash/wm/focus_rules.h" #include "ash/wm/mru_window_tracker.h" @@ -62,8 +61,7 @@ return false; } - int modal_container_id = - ShellPort::Get()->GetOpenSystemModalWindowContainerId(); + int modal_container_id = Shell::GetOpenSystemModalWindowContainerId(); if (modal_container_id >= 0) return BelongsToContainerWithEqualOrGreaterId(window, modal_container_id);
diff --git a/ash/wm/overview/overview_window_drag_controller.cc b/ash/wm/overview/overview_window_drag_controller.cc index 0f28593..b7b063c 100644 --- a/ash/wm/overview/overview_window_drag_controller.cc +++ b/ash/wm/overview/overview_window_drag_controller.cc
@@ -166,9 +166,21 @@ SplitViewController::SnapPosition last_snap_position = snap_position_; snap_position_ = GetSnapPosition(location_in_screen); + // If there is already a snapped window in |snap_position_|, do not allow + // another window snap in the same position. + SplitViewController::State snapped_state = split_view_controller_->state(); + if ((snap_position_ == SplitViewController::LEFT && + snapped_state == SplitViewController::LEFT_SNAPPED) || + (snap_position_ == SplitViewController::RIGHT && + snapped_state == SplitViewController::RIGHT_SNAPPED)) { + snap_position_ = SplitViewController::NONE; + phantom_window_controller_.reset(); + return; + } + // If there is no current snapped window, update the window grid size if the // dragged window can be snapped if dropped. - if (split_view_controller_->state() == SplitViewController::NO_SNAP && + if (snapped_state == SplitViewController::NO_SNAP && snap_position_ != last_snap_position) { // Do not reposition the item that is currently being dragged. window_selector_->SetBoundsForWindowGridsInScreenIgnoringWindow(
diff --git a/ash/wm/overview/window_selector_controller.cc b/ash/wm/overview/window_selector_controller.cc index 773ea79..3b0025c 100644 --- a/ash/wm/overview/window_selector_controller.cc +++ b/ash/wm/overview/window_selector_controller.cc
@@ -9,7 +9,6 @@ #include "ash/public/cpp/window_properties.h" #include "ash/session/session_controller.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/wm/mru_window_tracker.h" #include "ash/wm/overview/window_grid.h" #include "ash/wm/overview/window_selector.h" @@ -49,7 +48,7 @@ SessionController* session_controller = Shell::Get()->session_controller(); return session_controller->GetSessionState() == session_manager::SessionState::ACTIVE && - !ShellPort::Get()->IsSystemModalWindowOpen() && + !Shell::IsSystemModalWindowOpen() && !Shell::Get()->screen_pinning_controller()->IsPinned() && !session_controller->IsRunningInAppMode(); }
diff --git a/ash/wm/overview/window_selector_item.cc b/ash/wm/overview/window_selector_item.cc index 4930ddb..c57c34b 100644 --- a/ash/wm/overview/window_selector_item.cc +++ b/ash/wm/overview/window_selector_item.cc
@@ -7,6 +7,7 @@ #include <algorithm> #include <vector> +#include "ash/public/cpp/ash_switches.h" #include "ash/public/cpp/shell_window_ids.h" #include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" @@ -25,10 +26,12 @@ #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "ash/wm/window_state.h" #include "base/auto_reset.h" +#include "base/command_line.h" #include "base/metrics/user_metrics.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" +#include "ui/aura/client/aura_constants.h" #include "ui/base/l10n/l10n_util.h" #include "ui/compositor/layer_animation_sequence.h" #include "ui/compositor/scoped_animation_duration_scale_mode.h" @@ -37,9 +40,11 @@ #include "ui/gfx/canvas.h" #include "ui/gfx/color_utils.h" #include "ui/gfx/geometry/safe_integer_conversions.h" +#include "ui/gfx/image/image_skia_operations.h" #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/transform_util.h" #include "ui/views/background.h" +#include "ui/views/controls/image_view.h" #include "ui/views/layout/box_layout.h" #include "ui/views/window/non_client_view.h" #include "ui/wm/core/coordinate_conversion.h" @@ -109,6 +114,10 @@ // to indicate its selection. static const float kDragWindowScale = 0.04f; +// The size in dp of the window icon shown on the overview window next to the +// title. +constexpr gfx::Size kIconSize = gfx::Size(16, 16); + // Convenience method to fade in a Window with predefined animation settings. // Note: The fade in animation will occur after a delay where the delay is how // long the lay out animations take. @@ -389,15 +398,19 @@ class WindowSelectorItem::CaptionContainerView : public views::View { public: CaptionContainerView(ButtonListener* listener, + views::ImageView* image_view, views::Label* title_label, views::Label* cannot_snap_label, views::ImageButton* close_button, WindowSelectorItem::RoundedContainerView* background) : listener_button_(new ShieldButton(listener, title_label->text())), background_(background), + image_view_(image_view), title_label_(title_label), cannot_snap_label_(cannot_snap_label), close_button_(close_button) { + if (image_view_) + background_->AddChildView(image_view_); background_->AddChildView(title_label_); background_->AddChildView(close_button_); listener_button_->AddChildView(background_); @@ -457,14 +470,20 @@ background_->SetBoundsRect(background_bounds); bounds = background_bounds; - bounds.Inset(kHorizontalLabelPadding, 0, - kHorizontalLabelPadding + visible_height, 0); + bounds.Inset(kHorizontalLabelPadding + (image_view_ ? visible_height : 0), + 0, kHorizontalLabelPadding + visible_height, 0); title_label_->SetBoundsRect(bounds); bounds = background_bounds; bounds.set_x(bounds.width() - visible_height); bounds.set_width(visible_height); close_button_->SetBoundsRect(bounds); + + if (image_view_) { + bounds.set_x(0); + bounds.ClampToCenteredSize(image_view_->size()); + image_view_->SetBoundsRect(bounds); + } } const char* GetClassName() const override { return "CaptionContainerView"; } @@ -472,6 +491,7 @@ private: ShieldButton* listener_button_; WindowSelectorItem::RoundedContainerView* background_; + views::ImageView* image_view_; views::Label* title_label_; views::Label* cannot_snap_label_; RoundedRectView* cannot_snap_container_; @@ -757,6 +777,22 @@ widget_window->parent()->StackChildBelow(widget_window, transform_window_.window()); } + + // Create an image view for and scale down the windows window icon, if it + // exists. + views::ImageView* image_view = nullptr; + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + ash::switches::kAshEnableNewOverviewUi)) { + gfx::ImageSkia* icon = + transform_window_.window()->GetProperty(aura::client::kWindowIconKey); + if (icon && !icon->size().IsEmpty()) { + image_view = new views::ImageView(); + image_view->SetImage(gfx::ImageSkiaOperations::CreateResizedImage( + *icon, skia::ImageOperations::RESIZE_GOOD, kIconSize)); + image_view->SetSize(kIconSize); + } + } + label_view_ = new views::Label(title); label_view_->SetHorizontalAlignment(gfx::ALIGN_LEFT); label_view_->SetAutoColorReadabilityEnabled(false); @@ -774,9 +810,9 @@ cannot_snap_label_view_->SetText( l10n_util::GetStringUTF16(IDS_ASH_SPLIT_VIEW_CANNOT_SNAP)); - caption_container_view_ = - new CaptionContainerView(this, label_view_, cannot_snap_label_view_, - close_button_, background_view_); + caption_container_view_ = new CaptionContainerView( + this, image_view, label_view_, cannot_snap_label_view_, close_button_, + background_view_); UpdateCannotSnapWarningVisibility(); item_widget_->SetContentsView(caption_container_view_);
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc index d2605dc..72c18b0 100644 --- a/ash/wm/overview/window_selector_unittest.cc +++ b/ash/wm/overview/window_selector_unittest.cc
@@ -2085,14 +2085,15 @@ SplitViewController::LEFT_SNAPPED); EXPECT_EQ(split_view_controller()->left_window(), window1.get()); - // Drag |window2| selector item to snap to left. + // Drag |window2| selector item to attempt to snap to left. Since there is + // already one left snapped window, we do not allow |window2| snap to left. WindowSelectorItem* selector_item2 = GetWindowItemForWindow(grid_index, window2.get()); DragWindowTo(selector_item2, gfx::Point(0, 0)); EXPECT_EQ(split_view_controller()->state(), SplitViewController::LEFT_SNAPPED); - EXPECT_EQ(split_view_controller()->left_window(), window2.get()); + EXPECT_EQ(split_view_controller()->left_window(), window1.get()); // Drag |window3| selector item to snap to right. WindowSelectorItem* selector_item3 =
diff --git a/ash/wm/system_modal_container_event_filter.cc b/ash/wm/system_modal_container_event_filter.cc index 5046410..7266cb09 100644 --- a/ash/wm/system_modal_container_event_filter.cc +++ b/ash/wm/system_modal_container_event_filter.cc
@@ -3,7 +3,8 @@ // found in the LICENSE file. #include "ash/wm/system_modal_container_event_filter.h" -#include "ash/shell_port.h" + +#include "ash/shell.h" #include "ash/wm/system_modal_container_event_filter_delegate.h" #include "ui/aura/window.h" #include "ui/events/event.h" @@ -18,7 +19,7 @@ void SystemModalContainerEventFilter::OnEvent(ui::Event* event) { // Only filter modal events if a modal window is open. - if (!ShellPort::Get()->IsSystemModalWindowOpen()) + if (!Shell::IsSystemModalWindowOpen()) return; aura::Window* target = static_cast<aura::Window*>(event->target()); if (!delegate_->CanWindowReceiveEvents(target))
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc index 216bb87..d5cfb83 100644 --- a/ash/wm/system_modal_container_layout_manager_unittest.cc +++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -9,7 +9,6 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/root_window_controller.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/test/ash_test_base.h" #include "ash/wm/container_finder.h" #include "ash/wm/window_util.h" @@ -763,23 +762,23 @@ new TestWindow(false), modal_container); widget->Show(); aura::Window* window = widget->GetNativeWindow(); - EXPECT_FALSE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(Shell::IsSystemModalWindowOpen()); window->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_SYSTEM); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); // Setting twice should not cause error. window->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_SYSTEM); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); window->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_NONE); - EXPECT_FALSE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(Shell::IsSystemModalWindowOpen()); window->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_SYSTEM); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); widget->Close(); - EXPECT_FALSE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(Shell::IsSystemModalWindowOpen()); } TEST_F(SystemModalContainerLayoutManagerTest, VisibilityChange) { @@ -792,11 +791,11 @@ Shell::GetPrimaryRootWindowController()->GetSystemModalLayoutManager( modal_window.get()); - EXPECT_FALSE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(layout_manager->has_window_dimmer()); modal_window->Show(); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); EXPECT_TRUE(layout_manager->has_window_dimmer()); // Make sure that a child visibility change should not cause @@ -806,15 +805,15 @@ child->Init(ui::LAYER_TEXTURED); modal_window->AddChild(child.get()); child->Show(); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); EXPECT_TRUE(layout_manager->has_window_dimmer()); modal_window->Hide(); - EXPECT_FALSE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(layout_manager->has_window_dimmer()); modal_window->Show(); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); EXPECT_TRUE(layout_manager->has_window_dimmer()); } @@ -843,7 +842,7 @@ new TestWindow(true), Shell::GetPrimaryRootWindow(), gfx::Rect(200, 200, 100, 100)); widget->Show(); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); // Events should be blocked. GenerateEvents(window.get()); @@ -855,7 +854,7 @@ Reset(); widget->Close(); - EXPECT_FALSE(ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(Shell::IsSystemModalWindowOpen()); GenerateEvents(window.get());
diff --git a/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc b/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc index 85eaa4c..9124579 100644 --- a/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc +++ b/ash/wm/tablet_mode/tablet_mode_window_manager_unittest.cc
@@ -14,7 +14,6 @@ #include "ash/session/test_session_controller_client.h" #include "ash/shelf/shelf.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/shell_test_api.h" #include "ash/test/ash_test_base.h" #include "ash/wm/mru_window_tracker.h" @@ -287,8 +286,8 @@ EXPECT_EQ(rect3.ToString(), w3->bounds().ToString()); // Enable system modal dialog, and make sure both shelves are still hidden. - ShellPort::Get()->SimulateModalWindowOpenForTesting(true); - EXPECT_TRUE(ShellPort::Get()->IsSystemModalWindowOpen()); + ShellTestApi().SimulateModalWindowOpenForTest(true); + EXPECT_TRUE(Shell::IsSystemModalWindowOpen()); // Create the manager and make sure that all qualifying windows were detected // and changed.
diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc index 0803bb1..2e8caa32 100644 --- a/ash/wm/window_cycle_controller.cc +++ b/ash/wm/window_cycle_controller.cc
@@ -41,7 +41,7 @@ bool WindowCycleController::CanCycle() { // Prevent window cycling if the screen is locked or a modal dialog is open. return !Shell::Get()->session_controller()->IsScreenLocked() && - !ShellPort::Get()->IsSystemModalWindowOpen() && + !Shell::IsSystemModalWindowOpen() && !Shell::Get()->screen_pinning_controller()->IsPinned(); }
diff --git a/base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc b/base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc index e33754a..c351a7c9 100644 --- a/base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc +++ b/base/allocator/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc
@@ -9,6 +9,9 @@ #if defined(OS_ANDROID) && __ANDROID_API__ < 17 #include <dlfcn.h> +// This is defined in malloc.h on other platforms. We just need the definition +// for the decltype(malloc_usable_size)* call to work. +size_t malloc_usable_size(const void*); #endif // This translation unit defines a default dispatch for the allocator shim which
diff --git a/base/allocator/partition_allocator/OWNERS b/base/allocator/partition_allocator/OWNERS index 374d1ae..b0a2a850 100644 --- a/base/allocator/partition_allocator/OWNERS +++ b/base/allocator/partition_allocator/OWNERS
@@ -1,5 +1,8 @@ +ajwong@chromium.org haraken@chromium.org palmer@chromium.org +tsepez@chromium.org # TEAM: platform-architecture-dev@chromium.org -# COMPONENT: Blink>MemoryAllocator +# Also: security-dev@chromium.org +# COMPONENT: Blink>MemoryAllocator>Partition
diff --git a/base/allocator/partition_allocator/page_allocator.h b/base/allocator/partition_allocator/page_allocator.h index fa13019..a25ce8c7 100644 --- a/base/allocator/partition_allocator/page_allocator.h +++ b/base/allocator/partition_allocator/page_allocator.h
@@ -17,6 +17,8 @@ #if defined(OS_WIN) static const size_t kPageAllocationGranularityShift = 16; // 64KB +#elif defined(_MIPS_ARCH_LOONGSON) +static const size_t kPageAllocationGranularityShift = 14; // 16KB #else static const size_t kPageAllocationGranularityShift = 12; // 4KB #endif @@ -29,7 +31,12 @@ // All Blink-supported systems have 4096 sized system pages and can handle // permissions and commit / decommit at this granularity. +// Loongson have 16384 sized system pages. +#if defined(_MIPS_ARCH_LOONGSON) +static const size_t kSystemPageSize = 16384; +#else static const size_t kSystemPageSize = 4096; +#endif static const size_t kSystemPageOffsetMask = kSystemPageSize - 1; static_assert((kSystemPageSize & (kSystemPageSize - 1)) == 0, "kSystemPageSize must be power of 2");
diff --git a/base/allocator/partition_allocator/partition_alloc.h b/base/allocator/partition_allocator/partition_alloc.h index 10cb931..df8a7fe 100644 --- a/base/allocator/partition_allocator/partition_alloc.h +++ b/base/allocator/partition_allocator/partition_alloc.h
@@ -97,7 +97,11 @@ // system page of the span. For our current max slot span size of 64k and other // constant values, we pack _all_ PartitionRootGeneric::Alloc() sizes perfectly // up against the end of a system page. +#if defined(_MIPS_ARCH_LOONGSON) +static const size_t kPartitionPageShift = 16; // 64KB +#else static const size_t kPartitionPageShift = 14; // 16KB +#endif static const size_t kPartitionPageSize = 1 << kPartitionPageShift; static const size_t kPartitionPageOffsetMask = kPartitionPageSize - 1; static const size_t kPartitionPageBaseMask = ~kPartitionPageOffsetMask;
diff --git a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java index 0d25b81..9185776 100644 --- a/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java +++ b/base/android/java/src/org/chromium/base/library_loader/LibraryLoader.java
@@ -318,9 +318,6 @@ Log.w(TAG, "Forking a process to prefetch the native library failed."); } } - // As this runs in a background thread, it can be called before histograms are - // initialized. In this instance, histograms are dropped. - RecordHistogram.initialize(); if (prefetch) { RecordHistogram.recordBooleanHistogram("LibraryLoader.PrefetchStatus", success); }
diff --git a/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java b/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java index 0751264..ed3959e3 100644 --- a/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java +++ b/base/android/java/src/org/chromium/base/metrics/RecordHistogram.java
@@ -292,14 +292,6 @@ return nativeGetHistogramTotalCountForTesting(name); } - /** - * Initializes the metrics system. - */ - public static void initialize() { - if (sDisabledBy != null) return; - nativeInitialize(); - } - private static native long nativeRecordCustomTimesHistogramMilliseconds( String name, long key, int duration, int min, int max, int numBuckets); @@ -314,5 +306,4 @@ private static native int nativeGetHistogramValueCountForTesting(String name, int sample); private static native int nativeGetHistogramTotalCountForTesting(String name); - private static native void nativeInitialize(); }
diff --git a/base/android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.java b/base/android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.java index daf639b..8979611 100644 --- a/base/android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.java +++ b/base/android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.java
@@ -26,7 +26,6 @@ @Before public void setUp() throws Exception { LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized(); - RecordHistogram.initialize(); } /**
diff --git a/base/android/linker/legacy_linker_jni.cc b/base/android/linker/legacy_linker_jni.cc index c2c393e..5208deea 100644 --- a/base/android/linker/legacy_linker_jni.cc +++ b/base/android/linker/legacy_linker_jni.cc
@@ -93,7 +93,8 @@ crazy_context_t* context = GetCrazyContext(); if (!IsValidAddress(load_address)) { - LOG_ERROR("Invalid address 0x%llx", load_address); + LOG_ERROR("Invalid address 0x%llx", + static_cast<unsigned long long>(load_address)); return false; } @@ -328,7 +329,8 @@ LOG_INFO("Called for %s", lib_name.c_str()); if (!IsValidAddress(load_address)) { - LOG_ERROR("Invalid address 0x%llx", load_address); + LOG_ERROR("Invalid address 0x%llx", + static_cast<unsigned long long>(load_address)); return false; }
diff --git a/base/android/record_histogram.cc b/base/android/record_histogram.cc index 02f44934..0bc8423 100644 --- a/base/android/record_histogram.cc +++ b/base/android/record_histogram.cc
@@ -304,10 +304,6 @@ return reinterpret_cast<jlong>(histogram); } -void JNI_RecordHistogram_Initialize(JNIEnv* env, const JavaParamRef<jclass>&) { - StatisticsRecorder::Initialize(); -} - // This backs a Java test util for testing histograms - // MetricsUtils.HistogramDelta. It should live in a test-specific file, but we // currently can't have test-specific native code packaged in test-specific Java
diff --git a/base/containers/circular_deque.h b/base/containers/circular_deque.h index 9883316..688ef89 100644 --- a/base/containers/circular_deque.h +++ b/base/containers/circular_deque.h
@@ -106,8 +106,8 @@ // void push_front(T&&); // void push_back(const T&); // void push_back(T&&); -// void emplace_front(Args&&...); -// void emplace_back(Args&&...); +// T& emplace_front(Args&&...); +// T& emplace_back(Args&&...); // void pop_front(); // void pop_back(); // @@ -835,7 +835,7 @@ void push_back(T&& value) { emplace_back(std::move(value)); } template <class... Args> - void emplace_front(Args&&... args) { + reference emplace_front(Args&&... args) { ExpandCapacityIfNecessary(1); if (begin_ == 0) begin_ = buffer_.capacity() - 1; @@ -843,10 +843,11 @@ begin_--; IncrementGeneration(); new (&buffer_[begin_]) T(std::forward<Args>(args)...); + return front(); } template <class... Args> - void emplace_back(Args&&... args) { + reference emplace_back(Args&&... args) { ExpandCapacityIfNecessary(1); new (&buffer_[end_]) T(std::forward<Args>(args)...); if (end_ == buffer_.capacity() - 1) @@ -854,6 +855,7 @@ else end_++; IncrementGeneration(); + return back(); } void pop_front() {
diff --git a/base/containers/circular_deque_unittest.cc b/base/containers/circular_deque_unittest.cc index 413b27c..df960c3 100644 --- a/base/containers/circular_deque_unittest.cc +++ b/base/containers/circular_deque_unittest.cc
@@ -839,6 +839,30 @@ EXPECT_EQ(4, q[4].data()); } +TEST(CircularDeque, EmplaceFrontBackReturnsReference) { + circular_deque<int> q; + q.reserve(2); + + int& front = q.emplace_front(1); + int& back = q.emplace_back(2); + ASSERT_EQ(2u, q.size()); + EXPECT_EQ(1, q[0]); + EXPECT_EQ(2, q[1]); + + EXPECT_EQ(&front, &q.front()); + EXPECT_EQ(&back, &q.back()); + + front = 3; + back = 4; + + ASSERT_EQ(2u, q.size()); + EXPECT_EQ(3, q[0]); + EXPECT_EQ(4, q[1]); + + EXPECT_EQ(&front, &q.front()); + EXPECT_EQ(&back, &q.back()); +} + /* This test should assert in a debug build. It tries to dereference an iterator after mutating the container. Uncomment to double-check that this works.
diff --git a/base/files/file.h b/base/files/file.h index b01e58d..1b2f6d4 100644 --- a/base/files/file.h +++ b/base/files/file.h
@@ -24,7 +24,8 @@ namespace base { -#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) +#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \ + defined(OS_ANDROID) && __ANDROID_API__ < 21 typedef struct stat stat_wrapper_t; #elif defined(OS_POSIX) typedef struct stat64 stat_wrapper_t;
diff --git a/base/files/file_posix.cc b/base/files/file_posix.cc index ef0ab6a2..d538b66 100644 --- a/base/files/file_posix.cc +++ b/base/files/file_posix.cc
@@ -30,7 +30,8 @@ namespace { -#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) +#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \ + defined(OS_ANDROID) && __ANDROID_API__ < 21 int CallFstat(int fd, stat_wrapper_t *sb) { AssertBlockingAllowed(); return fstat(fd, sb);
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc index 8971b7e..27cd58a9 100644 --- a/base/files/file_util_posix.cc +++ b/base/files/file_util_posix.cc
@@ -68,7 +68,8 @@ namespace { -#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) +#if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || \ + defined(OS_ANDROID) && __ANDROID_API__ < 21 static int CallStat(const char *path, stat_wrapper_t *sb) { AssertBlockingAllowed(); return stat(path, sb); @@ -77,7 +78,8 @@ AssertBlockingAllowed(); return lstat(path, sb); } -#else // defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) +#else // defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) || +// defined(OS_ANDROID) && __ANDROID_API__ < 21 static int CallStat(const char *path, stat_wrapper_t *sb) { AssertBlockingAllowed(); return stat64(path, sb);
diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc index ceb64a6..d6bea4a 100644 --- a/base/json/json_parser.cc +++ b/base/json/json_parser.cc
@@ -6,10 +6,11 @@ #include <cmath> #include <utility> +#include <vector> +#include "base/debug/alias.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" @@ -72,7 +73,7 @@ JSONParser::~JSONParser() = default; -std::unique_ptr<Value> JSONParser::Parse(StringPiece input) { +Optional<Value> JSONParser::Parse(StringPiece input) { start_pos_ = input.data(); pos_ = start_pos_; end_pos_ = start_pos_ + input.length(); @@ -95,15 +96,15 @@ } // Parse the first and any nested tokens. - std::unique_ptr<Value> root(ParseNextToken()); + Optional<Value> root(ParseNextToken()); if (!root) - return nullptr; + return nullopt; // Make sure the input stream is at an end. if (GetNextToken() != T_END_OF_INPUT) { if (!CanConsume(1) || (NextChar() && GetNextToken() != T_END_OF_INPUT)) { ReportError(JSONReader::JSON_UNEXPECTED_DATA_AFTER_ROOT, 1); - return nullptr; + return nullopt; } } @@ -302,11 +303,11 @@ return false; } -std::unique_ptr<Value> JSONParser::ParseNextToken() { +Optional<Value> JSONParser::ParseNextToken() { return ParseToken(GetNextToken()); } -std::unique_ptr<Value> JSONParser::ParseToken(Token token) { +Optional<Value> JSONParser::ParseToken(Token token) { switch (token) { case T_OBJECT_BEGIN: return ConsumeDictionary(); @@ -322,20 +323,30 @@ return ConsumeLiteral(); default: ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1); - return nullptr; + return nullopt; } } -std::unique_ptr<Value> JSONParser::ConsumeDictionary() { +Optional<Value> JSONParser::ConsumeDictionary() { + // Attempt to alias 4KB of the buffer about to be read. Need to alias multiple + // sites as the crashpad heuristics only grab a few hundred bytes in + // front/behind heap pointers on the stack. + // TODO(gab): Remove this after diagnosis of https://crbug.com/791487 is + // complete. + const char* initial_pos[16]; + for (size_t i = 0; i < arraysize(initial_pos); ++i) + initial_pos[i] = pos_ + i * 256; + debug::Alias(&initial_pos); + if (*pos_ != '{') { ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1); - return nullptr; + return nullopt; } StackMarker depth_check(&stack_depth_); if (depth_check.IsTooDeep()) { ReportError(JSONReader::JSON_TOO_MUCH_NESTING, 1); - return nullptr; + return nullopt; } std::vector<Value::DictStorage::value_type> dict_storage; @@ -345,13 +356,13 @@ while (token != T_OBJECT_END) { if (token != T_STRING) { ReportError(JSONReader::JSON_UNQUOTED_DICTIONARY_KEY, 1); - return nullptr; + return nullopt; } // First consume the key. StringBuilder key; if (!ConsumeStringRaw(&key)) { - return nullptr; + return nullopt; } // Read the separator. @@ -359,18 +370,19 @@ token = GetNextToken(); if (token != T_OBJECT_PAIR_SEPARATOR) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } // The next token is the value. Ownership transfers to |dict|. NextChar(); - std::unique_ptr<Value> value = ParseNextToken(); + Optional<Value> value = ParseNextToken(); if (!value) { // ReportError from deeper level. - return nullptr; + return nullopt; } - dict_storage.emplace_back(key.DestructiveAsString(), std::move(value)); + dict_storage.emplace_back(key.DestructiveAsString(), + std::make_unique<Value>(std::move(*value))); NextChar(); token = GetNextToken(); @@ -379,42 +391,41 @@ token = GetNextToken(); if (token == T_OBJECT_END && !(options_ & JSON_ALLOW_TRAILING_COMMAS)) { ReportError(JSONReader::JSON_TRAILING_COMMA, 1); - return nullptr; + return nullopt; } } else if (token != T_OBJECT_END) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 0); - return nullptr; + return nullopt; } } - return std::make_unique<Value>( - Value::DictStorage(std::move(dict_storage), KEEP_LAST_OF_DUPES)); + return Value(Value::DictStorage(std::move(dict_storage), KEEP_LAST_OF_DUPES)); } -std::unique_ptr<Value> JSONParser::ConsumeList() { +Optional<Value> JSONParser::ConsumeList() { if (*pos_ != '[') { ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1); - return nullptr; + return nullopt; } StackMarker depth_check(&stack_depth_); if (depth_check.IsTooDeep()) { ReportError(JSONReader::JSON_TOO_MUCH_NESTING, 1); - return nullptr; + return nullopt; } - std::unique_ptr<ListValue> list(new ListValue); + Value::ListStorage list_storage; NextChar(); Token token = GetNextToken(); while (token != T_ARRAY_END) { - std::unique_ptr<Value> item = ParseToken(token); + Optional<Value> item = ParseToken(token); if (!item) { // ReportError from deeper level. - return nullptr; + return nullopt; } - list->Append(std::move(item)); + list_storage.push_back(std::move(*item)); NextChar(); token = GetNextToken(); @@ -423,23 +434,23 @@ token = GetNextToken(); if (token == T_ARRAY_END && !(options_ & JSON_ALLOW_TRAILING_COMMAS)) { ReportError(JSONReader::JSON_TRAILING_COMMA, 1); - return nullptr; + return nullopt; } } else if (token != T_ARRAY_END) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } } - return std::move(list); + return Value(std::move(list_storage)); } -std::unique_ptr<Value> JSONParser::ConsumeString() { +Optional<Value> JSONParser::ConsumeString() { StringBuilder string; if (!ConsumeStringRaw(&string)) - return nullptr; + return nullopt; - return std::make_unique<Value>(string.DestructiveAsString()); + return Value(string.DestructiveAsString()); } bool JSONParser::ConsumeStringRaw(StringBuilder* out) { @@ -690,7 +701,7 @@ } } -std::unique_ptr<Value> JSONParser::ConsumeNumber() { +Optional<Value> JSONParser::ConsumeNumber() { const char* num_start = pos_; const int start_index = index_; int end_index = start_index; @@ -700,7 +711,7 @@ if (!ReadInt(false)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } end_index = index_; @@ -709,7 +720,7 @@ NextChar(); if (!ReadInt(true)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } end_index = index_; } @@ -719,14 +730,14 @@ NextChar(); if (!CanConsume(1)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } if (*pos_ == '-' || *pos_ == '+') { NextChar(); } if (!ReadInt(true)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } end_index = index_; } @@ -746,7 +757,7 @@ break; default: ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } pos_ = exit_pos; @@ -756,15 +767,15 @@ int num_int; if (StringToInt(num_string, &num_int)) - return std::make_unique<Value>(num_int); + return Value(num_int); double num_double; if (StringToDouble(num_string.as_string(), &num_double) && std::isfinite(num_double)) { - return std::make_unique<Value>(num_double); + return Value(num_double); } - return nullptr; + return nullopt; } bool JSONParser::ReadInt(bool allow_leading_zeros) { @@ -791,7 +802,7 @@ return true; } -std::unique_ptr<Value> JSONParser::ConsumeLiteral() { +Optional<Value> JSONParser::ConsumeLiteral() { switch (*pos_) { case 't': { const char kTrueLiteral[] = "true"; @@ -799,10 +810,10 @@ if (!CanConsume(kTrueLen) || !StringsAreEqual(pos_, kTrueLiteral, kTrueLen)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } NextNChars(kTrueLen - 1); - return std::make_unique<Value>(true); + return Value(true); } case 'f': { const char kFalseLiteral[] = "false"; @@ -810,10 +821,10 @@ if (!CanConsume(kFalseLen) || !StringsAreEqual(pos_, kFalseLiteral, kFalseLen)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } NextNChars(kFalseLen - 1); - return std::make_unique<Value>(false); + return Value(false); } case 'n': { const char kNullLiteral[] = "null"; @@ -821,14 +832,14 @@ if (!CanConsume(kNullLen) || !StringsAreEqual(pos_, kNullLiteral, kNullLen)) { ReportError(JSONReader::JSON_SYNTAX_ERROR, 1); - return nullptr; + return nullopt; } NextNChars(kNullLen - 1); - return std::make_unique<Value>(); + return Value(Value::Type::NONE); } default: ReportError(JSONReader::JSON_UNEXPECTED_TOKEN, 1); - return nullptr; + return nullopt; } }
diff --git a/base/json/json_parser.h b/base/json/json_parser.h index d27bf7d..1359879 100644 --- a/base/json/json_parser.h +++ b/base/json/json_parser.h
@@ -30,14 +30,11 @@ // The implementation behind the JSONReader interface. This class is not meant // to be used directly; it encapsulates logic that need not be exposed publicly. // -// This parser guarantees O(n) time through the input string. It also optimizes -// base::Value by using StringPiece where possible when returning Value -// objects by using "hidden roots," discussed in the implementation. -// -// Iteration happens on the byte level, with the functions CanConsume and -// NextChar. The conversion from byte to JSON token happens without advancing -// the parser in GetNextToken/ParseToken, that is tokenization operates on -// the current parser position without advancing. +// This parser guarantees O(n) time through the input string. Iteration happens +// on the byte level, with the functions CanConsume and NextChar. The conversion +// from byte to JSON token happens without advancing the parser in +// GetNextToken/ParseToken, that is tokenization operates on the current parser +// position without advancing. // // Built on top of these are a family of Consume functions that iterate // internally. Invariant: on entry of a Consume function, the parser is wound @@ -54,7 +51,7 @@ // result as a Value. // Wrap this in base::FooValue::From() to check the Value is of type Foo and // convert to a FooValue at the same time. - std::unique_ptr<Value> Parse(StringPiece input); + Optional<Value> Parse(StringPiece input); // Returns the error code. JSONReader::JsonParseError error_code() const; @@ -163,22 +160,22 @@ bool EatComment(); // Calls GetNextToken() and then ParseToken(). - std::unique_ptr<Value> ParseNextToken(); + Optional<Value> ParseNextToken(); // Takes a token that represents the start of a Value ("a structural token" // in RFC terms) and consumes it, returning the result as a Value. - std::unique_ptr<Value> ParseToken(Token token); + Optional<Value> ParseToken(Token token); // Assuming that the parser is currently wound to '{', this parses a JSON - // object into a DictionaryValue. - std::unique_ptr<Value> ConsumeDictionary(); + // object into a Value. + Optional<Value> ConsumeDictionary(); // Assuming that the parser is wound to '[', this parses a JSON list into a - // std::unique_ptr<ListValue>. - std::unique_ptr<Value> ConsumeList(); + // Value. + Optional<Value> ConsumeList(); // Calls through ConsumeStringRaw and wraps it in a value. - std::unique_ptr<Value> ConsumeString(); + Optional<Value> ConsumeString(); // Assuming that the parser is wound to a double quote, this parses a string, // decoding any escape sequences and converts UTF-16 to UTF-8. Returns true on @@ -198,14 +195,14 @@ // Assuming that the parser is wound to the start of a valid JSON number, // this parses and converts it to either an int or double value. - std::unique_ptr<Value> ConsumeNumber(); + Optional<Value> ConsumeNumber(); // Helper that reads characters that are ints. Returns true if a number was // read and false on error. bool ReadInt(bool allow_leading_zeros); // Consumes the literal values of |true|, |false|, and |null|, assuming the // parser is wound to the first character of any of those. - std::unique_ptr<Value> ConsumeLiteral(); + Optional<Value> ConsumeLiteral(); // Compares two string buffers of a given length. static bool StringsAreEqual(const char* left, const char* right, size_t len);
diff --git a/base/json/json_parser_unittest.cc b/base/json/json_parser_unittest.cc index c58317c..e2f9e32e 100644 --- a/base/json/json_parser_unittest.cc +++ b/base/json/json_parser_unittest.cc
@@ -10,6 +10,7 @@ #include "base/json/json_reader.h" #include "base/memory/ptr_util.h" +#include "base/optional.h" #include "base/strings/stringprintf.h" #include "base/values.h" #include "testing/gtest/include/gtest/gtest.h" @@ -61,12 +62,12 @@ TEST_F(JSONParserTest, ConsumeString) { std::string input("\"test\",|"); std::unique_ptr<JSONParser> parser(NewTestParser(input)); - std::unique_ptr<Value> value(parser->ConsumeString()); + Optional<Value> value(parser->ConsumeString()); EXPECT_EQ('"', *parser->pos_); TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); std::string str; EXPECT_TRUE(value->GetAsString(&str)); EXPECT_EQ("test", str); @@ -75,12 +76,12 @@ TEST_F(JSONParserTest, ConsumeList) { std::string input("[true, false],|"); std::unique_ptr<JSONParser> parser(NewTestParser(input)); - std::unique_ptr<Value> value(parser->ConsumeList()); + Optional<Value> value(parser->ConsumeList()); EXPECT_EQ(']', *parser->pos_); TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); base::ListValue* list; EXPECT_TRUE(value->GetAsList(&list)); EXPECT_EQ(2u, list->GetSize()); @@ -89,12 +90,12 @@ TEST_F(JSONParserTest, ConsumeDictionary) { std::string input("{\"abc\":\"def\"},|"); std::unique_ptr<JSONParser> parser(NewTestParser(input)); - std::unique_ptr<Value> value(parser->ConsumeDictionary()); + Optional<Value> value(parser->ConsumeDictionary()); EXPECT_EQ('}', *parser->pos_); TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); base::DictionaryValue* dict; EXPECT_TRUE(value->GetAsDictionary(&dict)); std::string str; @@ -106,12 +107,12 @@ // Literal |true|. std::string input("true,|"); std::unique_ptr<JSONParser> parser(NewTestParser(input)); - std::unique_ptr<Value> value(parser->ConsumeLiteral()); + Optional<Value> value(parser->ConsumeLiteral()); EXPECT_EQ('e', *parser->pos_); TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); bool bool_value = false; EXPECT_TRUE(value->GetAsBoolean(&bool_value)); EXPECT_TRUE(bool_value); @@ -124,7 +125,7 @@ TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); EXPECT_TRUE(value->GetAsBoolean(&bool_value)); EXPECT_FALSE(bool_value); @@ -136,7 +137,7 @@ TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); EXPECT_TRUE(value->is_none()); } @@ -144,12 +145,12 @@ // Integer. std::string input("1234,|"); std::unique_ptr<JSONParser> parser(NewTestParser(input)); - std::unique_ptr<Value> value(parser->ConsumeNumber()); + Optional<Value> value(parser->ConsumeNumber()); EXPECT_EQ('4', *parser->pos_); TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); int number_i; EXPECT_TRUE(value->GetAsInteger(&number_i)); EXPECT_EQ(1234, number_i); @@ -162,7 +163,7 @@ TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); EXPECT_TRUE(value->GetAsInteger(&number_i)); EXPECT_EQ(-1234, number_i); @@ -174,7 +175,7 @@ TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); double number_d; EXPECT_TRUE(value->GetAsDouble(&number_d)); EXPECT_EQ(12.34, number_d); @@ -187,7 +188,7 @@ TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); EXPECT_TRUE(value->GetAsDouble(&number_d)); EXPECT_EQ(42000, number_d); @@ -199,7 +200,7 @@ TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); EXPECT_TRUE(value->GetAsDouble(&number_d)); EXPECT_EQ(3.14159, number_d); @@ -211,7 +212,7 @@ TestLastThree(parser.get()); - ASSERT_TRUE(value.get()); + ASSERT_TRUE(value); EXPECT_TRUE(value->GetAsDouble(&number_d)); EXPECT_EQ(420, number_d); } @@ -359,8 +360,8 @@ const std::string quoted_bogus_char = "\"" + bogus_char + "\""; std::unique_ptr<JSONParser> parser( NewTestParser(quoted_bogus_char, JSON_REPLACE_INVALID_CHARACTERS)); - std::unique_ptr<Value> value(parser->ConsumeString()); - ASSERT_TRUE(value.get()); + Optional<Value> value(parser->ConsumeString()); + ASSERT_TRUE(value); std::string str; EXPECT_TRUE(value->GetAsString(&str)); EXPECT_EQ(kUnicodeReplacementString, str); @@ -370,8 +371,8 @@ const std::string invalid = "\"\\ufffe\""; std::unique_ptr<JSONParser> parser( NewTestParser(invalid, JSON_REPLACE_INVALID_CHARACTERS)); - std::unique_ptr<Value> value(parser->ConsumeString()); - ASSERT_TRUE(value.get()); + Optional<Value> value(parser->ConsumeString()); + ASSERT_TRUE(value); std::string str; EXPECT_TRUE(value->GetAsString(&str)); EXPECT_EQ(kUnicodeReplacementString, str);
diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc index e18f4a5..aa6a737 100644 --- a/base/json/json_reader.cc +++ b/base/json/json_reader.cc
@@ -4,8 +4,12 @@ #include "base/json/json_reader.h" +#include <utility> +#include <vector> + #include "base/json/json_parser.h" #include "base/logging.h" +#include "base/optional.h" #include "base/values.h" namespace base { @@ -44,26 +48,28 @@ // static std::unique_ptr<Value> JSONReader::Read(StringPiece json) { internal::JSONParser parser(JSON_PARSE_RFC); - return parser.Parse(json); + Optional<Value> root = parser.Parse(json); + return root ? std::make_unique<Value>(std::move(*root)) : nullptr; } // static std::unique_ptr<Value> JSONReader::Read(StringPiece json, int options) { internal::JSONParser parser(options); - return parser.Parse(json); + Optional<Value> root = parser.Parse(json); + return root ? std::make_unique<Value>(std::move(*root)) : nullptr; } // static std::unique_ptr<Value> JSONReader::ReadAndReturnError( - const StringPiece& json, + StringPiece json, int options, int* error_code_out, std::string* error_msg_out, int* error_line_out, int* error_column_out) { internal::JSONParser parser(options); - std::unique_ptr<Value> root(parser.Parse(json)); + Optional<Value> root = parser.Parse(json); if (!root) { if (error_code_out) *error_code_out = parser.error_code(); @@ -75,7 +81,7 @@ *error_column_out = parser.error_column(); } - return root; + return root ? std::make_unique<Value>(std::move(*root)) : nullptr; } // static @@ -106,7 +112,8 @@ } std::unique_ptr<Value> JSONReader::ReadToValue(StringPiece json) { - return parser_->Parse(json); + Optional<Value> value = parser_->Parse(json); + return value ? std::make_unique<Value>(std::move(*value)) : nullptr; } JSONReader::JsonParseError JSONReader::error_code() const {
diff --git a/base/json/json_reader.h b/base/json/json_reader.h index e1a9524..d3719d8 100644 --- a/base/json/json_reader.h +++ b/base/json/json_reader.h
@@ -104,7 +104,7 @@ // an error code and a formatted error message (including error location if // appropriate). Otherwise, they will be unmodified. static std::unique_ptr<Value> ReadAndReturnError( - const StringPiece& json, + StringPiece json, int options, // JSONParserOptions int* error_code_out, std::string* error_msg_out,
diff --git a/base/json/json_value_converter.h b/base/json/json_value_converter.h index 25fb2fb..ef081150 100644 --- a/base/json/json_value_converter.h +++ b/base/json/json_value_converter.h
@@ -72,7 +72,7 @@ // Sometimes JSON format uses string representations for other types such // like enum, timestamp, or URL. You can use RegisterCustomField method // and specify a function to convert a StringPiece to your type. -// bool ConvertFunc(const StringPiece& s, YourEnum* result) { +// bool ConvertFunc(StringPiece s, YourEnum* result) { // // do something and return true if succeed... // } // struct Message { @@ -215,7 +215,7 @@ template <typename FieldType> class CustomFieldConverter : public ValueConverter<FieldType> { public: - typedef bool(*ConvertFunc)(const StringPiece& value, FieldType* field); + typedef bool (*ConvertFunc)(StringPiece value, FieldType* field); explicit CustomFieldConverter(ConvertFunc convert_func) : convert_func_(convert_func) {} @@ -407,10 +407,9 @@ } template <typename FieldType> - void RegisterCustomField( - const std::string& field_name, - FieldType StructType::* field, - bool (*convert_func)(const StringPiece&, FieldType*)) { + void RegisterCustomField(const std::string& field_name, + FieldType StructType::*field, + bool (*convert_func)(StringPiece, FieldType*)) { fields_.push_back( std::make_unique<internal::FieldConverter<StructType, FieldType>>( field_name, field,
diff --git a/base/json/json_value_converter_unittest.cc b/base/json/json_value_converter_unittest.cc index 805b05b..322f5f0 100644 --- a/base/json/json_value_converter_unittest.cc +++ b/base/json/json_value_converter_unittest.cc
@@ -30,7 +30,7 @@ std::vector<std::unique_ptr<std::string>> string_values; SimpleMessage() : foo(0), baz(false), bstruct(false), simple_enum(FOO) {} - static bool ParseSimpleEnum(const StringPiece& value, SimpleEnum* field) { + static bool ParseSimpleEnum(StringPiece value, SimpleEnum* field) { if (value == "foo") { *field = FOO; return true;
diff --git a/base/json/string_escape.cc b/base/json/string_escape.cc index 9a26ff7..471a9d30 100644 --- a/base/json/string_escape.cc +++ b/base/json/string_escape.cc
@@ -116,33 +116,31 @@ } // namespace -bool EscapeJSONString(const StringPiece& str, +bool EscapeJSONString(StringPiece str, bool put_in_quotes, std::string* dest) { + return EscapeJSONStringImpl(str, put_in_quotes, dest); +} + +bool EscapeJSONString(StringPiece16 str, bool put_in_quotes, std::string* dest) { return EscapeJSONStringImpl(str, put_in_quotes, dest); } -bool EscapeJSONString(const StringPiece16& str, - bool put_in_quotes, - std::string* dest) { - return EscapeJSONStringImpl(str, put_in_quotes, dest); -} - -std::string GetQuotedJSONString(const StringPiece& str) { +std::string GetQuotedJSONString(StringPiece str) { std::string dest; bool ok = EscapeJSONStringImpl(str, true, &dest); DCHECK(ok); return dest; } -std::string GetQuotedJSONString(const StringPiece16& str) { +std::string GetQuotedJSONString(StringPiece16 str) { std::string dest; bool ok = EscapeJSONStringImpl(str, true, &dest); DCHECK(ok); return dest; } -std::string EscapeBytesAsInvalidJSONString(const StringPiece& str, +std::string EscapeBytesAsInvalidJSONString(StringPiece str, bool put_in_quotes) { std::string dest;
diff --git a/base/json/string_escape.h b/base/json/string_escape.h index c6a5b33..f75f475 100644 --- a/base/json/string_escape.h +++ b/base/json/string_escape.h
@@ -26,21 +26,21 @@ // // If |put_in_quotes| is true, then a leading and trailing double-quote mark // will be appended to |dest| as well. -BASE_EXPORT bool EscapeJSONString(const StringPiece& str, +BASE_EXPORT bool EscapeJSONString(StringPiece str, bool put_in_quotes, std::string* dest); // Performs a similar function to the UTF-8 StringPiece version above, // converting UTF-16 code units to UTF-8 code units and escaping non-printing // control characters. On return, |dest| will contain a valid UTF-8 JSON string. -BASE_EXPORT bool EscapeJSONString(const StringPiece16& str, +BASE_EXPORT bool EscapeJSONString(StringPiece16 str, bool put_in_quotes, std::string* dest); // Helper functions that wrap the above two functions but return the value // instead of appending. |put_in_quotes| is always true. -BASE_EXPORT std::string GetQuotedJSONString(const StringPiece& str); -BASE_EXPORT std::string GetQuotedJSONString(const StringPiece16& str); +BASE_EXPORT std::string GetQuotedJSONString(StringPiece str); +BASE_EXPORT std::string GetQuotedJSONString(StringPiece16 str); // Given an arbitrary byte string |str|, this will escape all non-ASCII bytes // as \uXXXX escape sequences. This function is *NOT* meant to be used with @@ -53,7 +53,7 @@ // // The output of this function takes the *appearance* of JSON but is not in // fact valid according to RFC 4627. -BASE_EXPORT std::string EscapeBytesAsInvalidJSONString(const StringPiece& str, +BASE_EXPORT std::string EscapeBytesAsInvalidJSONString(StringPiece str, bool put_in_quotes); } // namespace base
diff --git a/base/lazy_instance.cc b/base/lazy_instance.cc index c18cf52..de143ca 100644 --- a/base/lazy_instance.cc +++ b/base/lazy_instance.cc
@@ -29,8 +29,19 @@ // state_ == STATE_CREATED needs to acquire visibility over // the associated data (buf_). Pairing Release_Store is in // CompleteLazyInstance(). - while (subtle::Acquire_Load(state) == kLazyInstanceStateCreating) { - PlatformThread::YieldCurrentThread(); + if (subtle::Acquire_Load(state) == kLazyInstanceStateCreating) { + const base::Time start = base::Time::Now(); + do { + const base::TimeDelta elapsed = base::Time::Now() - start; + // Spin with YieldCurrentThread for at most one ms - this ensures maximum + // responsiveness. After that spin with Sleep(1ms) so that we don't burn + // excessive CPU time - this also avoids infinite loops due to priority + // inversions (https://crbug.com/797129). + if (elapsed < TimeDelta::FromMilliseconds(1)) + PlatformThread::YieldCurrentThread(); + else + PlatformThread::Sleep(TimeDelta::FromMilliseconds(1)); + } while (subtle::Acquire_Load(state) == kLazyInstanceStateCreating); } // Someone else created the instance. return false;
diff --git a/base/message_loop/incoming_task_queue.cc b/base/message_loop/incoming_task_queue.cc index f84b326..941cbd8 100644 --- a/base/message_loop/incoming_task_queue.cc +++ b/base/message_loop/incoming_task_queue.cc
@@ -85,6 +85,11 @@ return PostPendingTask(&pending_task); } +bool IncomingTaskQueue::IsIdleForTesting() { + AutoLock lock(incoming_queue_lock_); + return incoming_queue_.empty(); +} + void IncomingTaskQueue::WillDestroyCurrentMessageLoop() { { AutoLock auto_lock(incoming_queue_lock_); @@ -176,7 +181,6 @@ } void IncomingTaskQueue::TriageQueue::ReloadFromIncomingQueueIfEmpty() { - DCHECK_CALLED_ON_VALID_SEQUENCE(outer_->sequence_checker_); if (queue_.empty()) { // TODO(robliao): Since these high resolution tasks aren't yet in the // delayed queue, they technically shouldn't trigger high resolution timers @@ -347,8 +351,6 @@ } int IncomingTaskQueue::ReloadWorkQueue(TaskQueue* work_queue) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - // Make sure no tasks are lost. DCHECK(work_queue->empty());
diff --git a/base/message_loop/incoming_task_queue.h b/base/message_loop/incoming_task_queue.h index 0a476365..861f0fc 100644 --- a/base/message_loop/incoming_task_queue.h +++ b/base/message_loop/incoming_task_queue.h
@@ -77,6 +77,9 @@ TimeDelta delay, Nestable nestable); + // Returns true if the message loop is "idle". Provided for testing. + bool IsIdleForTesting(); + // Disconnects |this| from the parent message loop. void WillDestroyCurrentMessageLoop(); @@ -106,9 +109,8 @@ // maintaining three queue queues to process tasks: // // TriageQueue - // The first queue to receive all tasks for the processing sequence (when - // reloading from the thread-safe |incoming_queue_|). Tasks are generally - // either dispatched immediately or sent to the queues below. + // The first queue to receive all tasks for the processing sequence. Tasks are + // generally either dispatched immediately or sent to the queues below. // // DelayedQueue // The queue for holding tasks that should be run later and sorted by expected @@ -240,7 +242,7 @@ // An incoming queue of tasks that are acquired under a mutex for processing // on this instance's thread. These tasks have not yet been been pushed to - // |triage_tasks_|. + // |message_loop_|. TaskQueue incoming_queue_; // True if new tasks should be accepted.
diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc index 455a7d0..41c58bf 100644 --- a/base/message_loop/message_loop.cc +++ b/base/message_loop/message_loop.cc
@@ -258,12 +258,9 @@ } bool MessageLoop::IsIdleForTesting() { - return !incoming_task_queue_->triage_tasks().HasTasks() && - (!incoming_task_queue_->deferred_tasks().HasTasks() || - RunLoop::IsNestedOnCurrentThread()) && - (!incoming_task_queue_->delayed_tasks().HasTasks() || - incoming_task_queue_->delayed_tasks().Peek().delayed_run_time > - TimeTicks::Now()); + // We only check the incoming queue, since we don't want to lock the work + // queue. + return incoming_task_queue_->IsIdleForTesting(); } //------------------------------------------------------------------------------
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h index 90715a0..46c7ab9 100644 --- a/base/message_loop/message_loop.h +++ b/base/message_loop/message_loop.h
@@ -266,10 +266,7 @@ void AddTaskObserver(TaskObserver* task_observer); void RemoveTaskObserver(TaskObserver* task_observer); - // Returns true if the message loop is idle (same condition which triggers - // RunLoop::RunUntilIdle() to return: i.e. out of tasks which can be processed - // at the current run-level -- there might be deferred non-nestable tasks - // remaining if currently in a nested run level). Provided for testing. + // Returns true if the message loop is "idle". Provided for testing. bool IsIdleForTesting(); // Runs the specified PendingTask.
diff --git a/base/message_loop/message_pump_default.cc b/base/message_loop/message_pump_default.cc index dba0f5b..4104e73 100644 --- a/base/message_loop/message_pump_default.cc +++ b/base/message_loop/message_pump_default.cc
@@ -89,7 +89,7 @@ void MessagePumpDefault::SetTimerSlack(TimerSlack timer_slack) { thread_latency_qos_policy_data_t policy{}; policy.thread_latency_qos_tier = timer_slack == TIMER_SLACK_MAXIMUM - ? LATENCY_QOS_TIER_5 + ? LATENCY_QOS_TIER_3 : LATENCY_QOS_TIER_UNSPECIFIED; mac::ScopedMachSendRight thread_port(mach_thread_self()); kern_return_t kr =
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc index 79a903e..6178b21 100644 --- a/base/metrics/persistent_histogram_allocator.cc +++ b/base/metrics/persistent_histogram_allocator.cc
@@ -1090,9 +1090,6 @@ std::unique_ptr<PersistentMemoryAllocator> memory) : PersistentHistogramAllocator(std::move(memory)), import_iterator_(this) { - // Make sure the StatisticsRecorder is initialized to prevent duplicate - // histograms from being created. It's safe to call this multiple times. - StatisticsRecorder::Initialize(); } void GlobalHistogramAllocator::ImportHistogramsToStatisticsRecorder() {
diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc index 82d7a93..6f455c4 100644 --- a/base/metrics/statistics_recorder.cc +++ b/base/metrics/statistics_recorder.cc
@@ -20,12 +20,9 @@ #include "base/strings/stringprintf.h" #include "base/values.h" +namespace base { namespace { -// Initialize histogram statistics gathering system. -base::LazyInstance<base::StatisticsRecorder>::Leaky g_statistics_recorder_ = - LAZY_INSTANCE_INITIALIZER; - bool HistogramNameLesser(const base::HistogramBase* a, const base::HistogramBase* b) { return strcmp(a->histogram_name(), b->histogram_name()) < 0; @@ -33,7 +30,14 @@ } // namespace -namespace base { +// static +LazyInstance<Lock>::Leaky StatisticsRecorder::lock_; + +// static +StatisticsRecorder* StatisticsRecorder::top_ = nullptr; + +// static +bool StatisticsRecorder::is_vlog_initialized_ = false; size_t StatisticsRecorder::BucketRangesHash::operator()( const BucketRanges* const a) const { @@ -47,67 +51,41 @@ } StatisticsRecorder::~StatisticsRecorder() { - DCHECK(histograms_); - DCHECK(ranges_); - - // Clean out what this object created and then restore what existed before. - Reset(); - base::AutoLock auto_lock(lock_.Get()); - histograms_ = existing_histograms_.release(); - callbacks_ = existing_callbacks_.release(); - ranges_ = existing_ranges_.release(); - providers_ = existing_providers_.release(); - record_checker_ = existing_record_checker_.release(); + const AutoLock auto_lock(lock_.Get()); + DCHECK_EQ(this, top_); + top_ = previous_; } // static -void StatisticsRecorder::Initialize() { - // Tests sometimes create local StatisticsRecorders in order to provide a - // contained environment of histograms that can be later discarded. If a - // true global instance gets created in this environment then it will - // eventually get disconnected when the local instance destructs and - // restores the previous state, resulting in no StatisticsRecorder at all. - // The global lazy instance, however, will remain valid thus ensuring that - // another never gets installed via this method. If a |histograms_| map - // exists then assume the StatisticsRecorder is already "initialized". - if (histograms_) +void StatisticsRecorder::EnsureGlobalRecorderWhileLocked() { + lock_.Get().AssertAcquired(); + if (top_) return; - // Ensure that an instance of the StatisticsRecorder object is created. - g_statistics_recorder_.Get(); -} - -// static -bool StatisticsRecorder::IsActive() { - base::AutoLock auto_lock(lock_.Get()); - return histograms_ != nullptr; + const StatisticsRecorder* const p = new StatisticsRecorder; + // The global recorder is never deleted. + ANNOTATE_LEAKING_OBJECT_PTR(p); + DCHECK_EQ(p, top_); } // static void StatisticsRecorder::RegisterHistogramProvider( const WeakPtr<HistogramProvider>& provider) { - providers_->push_back(provider); + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); + top_->providers_.push_back(provider); } // static HistogramBase* StatisticsRecorder::RegisterOrDeleteDuplicate( HistogramBase* histogram) { - // Declared before auto_lock to ensure correct destruction order. + // Declared before |auto_lock| to ensure correct destruction order. std::unique_ptr<HistogramBase> histogram_deleter; - base::AutoLock auto_lock(lock_.Get()); - - if (!histograms_) { - // As per crbug.com/79322 the histograms are intentionally leaked, so we - // need to annotate them. Because ANNOTATE_LEAKING_OBJECT_PTR may be used - // only once for an object, the duplicates should not be annotated. - // Callers are responsible for not calling RegisterOrDeleteDuplicate(ptr) - // twice |if (!histograms_)|. - ANNOTATE_LEAKING_OBJECT_PTR(histogram); // see crbug.com/79322 - return histogram; - } + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); const char* const name = histogram->histogram_name(); - HistogramBase*& registered = (*histograms_)[name]; + HistogramBase*& registered = top_->histograms_[name]; if (!registered) { // |name| is guaranteed to never change or be deallocated so long @@ -116,8 +94,8 @@ ANNOTATE_LEAKING_OBJECT_PTR(histogram); // see crbug.com/79322 // If there are callbacks for this histogram, we set the kCallbackExists // flag. - const auto callback_iterator = callbacks_->find(name); - if (callback_iterator != callbacks_->end()) { + const auto callback_iterator = top_->callbacks_.find(name); + if (callback_iterator != top_->callbacks_.end()) { if (!callback_iterator->second.is_null()) histogram->SetFlags(HistogramBase::kCallbackExists); else @@ -141,16 +119,12 @@ const BucketRanges* ranges) { DCHECK(ranges->HasValidChecksum()); - // Declared before auto_lock to ensure correct destruction order. + // Declared before |auto_lock| to ensure correct destruction order. std::unique_ptr<const BucketRanges> ranges_deleter; - base::AutoLock auto_lock(lock_.Get()); + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); - if (!ranges_) { - ANNOTATE_LEAKING_OBJECT_PTR(ranges); - return ranges; - } - - const BucketRanges* const registered = *ranges_->insert(ranges).first; + const BucketRanges* const registered = *top_->ranges_.insert(ranges).first; if (registered == ranges) { ANNOTATE_LEAKING_OBJECT_PTR(ranges); } else { @@ -163,9 +137,6 @@ // static void StatisticsRecorder::WriteHTMLGraph(const std::string& query, std::string* output) { - if (!IsActive()) - return; - Histograms snapshot; GetSnapshot(query, &snapshot); std::sort(snapshot.begin(), snapshot.end(), &HistogramNameLesser); @@ -178,8 +149,6 @@ // static void StatisticsRecorder::WriteGraph(const std::string& query, std::string* output) { - if (!IsActive()) - return; if (query.length()) StringAppendF(output, "Collections of histograms for %s\n", query.c_str()); else @@ -196,9 +165,6 @@ // static std::string StatisticsRecorder::ToJSON(JSONVerbosityLevel verbosity_level) { - if (!IsActive()) - return std::string(); - Histograms snapshot; GetSnapshot(std::string(), &snapshot); @@ -217,11 +183,10 @@ // static void StatisticsRecorder::GetHistograms(Histograms* output) { - base::AutoLock auto_lock(lock_.Get()); - if (!histograms_) - return; + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); - for (const auto& entry : *histograms_) { + for (const auto& entry : top_->histograms_) { output->push_back(entry.second); } } @@ -229,11 +194,10 @@ // static void StatisticsRecorder::GetBucketRanges( std::vector<const BucketRanges*>* output) { - base::AutoLock auto_lock(lock_.Get()); - if (!ranges_) - return; + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); - for (const BucketRanges* const p : *ranges_) { + for (const BucketRanges* const p : top_->ranges_) { output->push_back(p); } } @@ -245,21 +209,25 @@ // will acquire the lock at that time. ImportGlobalPersistentHistograms(); - base::AutoLock auto_lock(lock_.Get()); - if (!histograms_) - return nullptr; + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); - const HistogramMap::const_iterator it = histograms_->find(name); - return it != histograms_->end() ? it->second : nullptr; + const HistogramMap::const_iterator it = top_->histograms_.find(name); + return it != top_->histograms_.end() ? it->second : nullptr; +} + +// static +StatisticsRecorder::HistogramProviders +StatisticsRecorder::GetHistogramProviders() { + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); + return top_->providers_; } // static void StatisticsRecorder::ImportProvidedHistograms() { - if (!providers_) - return; - // Merge histogram data from each provider in turn. - for (const WeakPtr<HistogramProvider>& provider : *providers_) { + for (const WeakPtr<HistogramProvider>& provider : GetHistogramProviders()) { // Weak-pointer may be invalid if the provider was destructed, though they // generally never are. if (provider) @@ -283,11 +251,8 @@ // static void StatisticsRecorder::InitLogOnShutdown() { - if (!histograms_) - return; - - base::AutoLock auto_lock(lock_.Get()); - g_statistics_recorder_.Get().InitLogOnShutdownWithoutLock(); + const AutoLock auto_lock(lock_.Get()); + InitLogOnShutdownWhileLocked(); } // static @@ -298,14 +263,13 @@ // will acquire the lock at that time. ImportGlobalPersistentHistograms(); - base::AutoLock auto_lock(lock_.Get()); - if (!histograms_) - return; + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); - // Need a c-string query for comparisons against c-string histogram name. - const char* query_string = query.c_str(); + // Need a C-string query for comparisons against C-string histogram name. + const char* const query_string = query.c_str(); - for (const auto& entry : *histograms_) { + for (const auto& entry : top_->histograms_) { if (strstr(entry.second->histogram_name(), query_string) != nullptr) snapshot->push_back(entry.second); } @@ -316,15 +280,14 @@ const std::string& name, const StatisticsRecorder::OnSampleCallback& cb) { DCHECK(!cb.is_null()); - base::AutoLock auto_lock(lock_.Get()); - if (!histograms_) + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); + + if (!top_->callbacks_.insert({name, cb}).second) return false; - if (!callbacks_->insert({name, cb}).second) - return false; - - const HistogramMap::const_iterator it = histograms_->find(name); - if (it != histograms_->end()) + const HistogramMap::const_iterator it = top_->histograms_.find(name); + if (it != top_->histograms_.end()) it->second->SetFlags(HistogramBase::kCallbackExists); return true; @@ -332,42 +295,40 @@ // static void StatisticsRecorder::ClearCallback(const std::string& name) { - base::AutoLock auto_lock(lock_.Get()); - if (!histograms_) - return; + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); - callbacks_->erase(name); + top_->callbacks_.erase(name); // We also clear the flag from the histogram (if it exists). - const HistogramMap::const_iterator it = histograms_->find(name); - if (it != histograms_->end()) + const HistogramMap::const_iterator it = top_->histograms_.find(name); + if (it != top_->histograms_.end()) it->second->ClearFlags(HistogramBase::kCallbackExists); } // static StatisticsRecorder::OnSampleCallback StatisticsRecorder::FindCallback( const std::string& name) { - base::AutoLock auto_lock(lock_.Get()); - if (!histograms_) - return OnSampleCallback(); - - const auto it = callbacks_->find(name); - return it != callbacks_->end() ? it->second : OnSampleCallback(); + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); + const auto it = top_->callbacks_.find(name); + return it != top_->callbacks_.end() ? it->second : OnSampleCallback(); } // static size_t StatisticsRecorder::GetHistogramCount() { - base::AutoLock auto_lock(lock_.Get()); - return histograms_ ? histograms_->size() : 0; + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); + return top_->histograms_.size(); } // static void StatisticsRecorder::ForgetHistogramForTesting(base::StringPiece name) { - if (!histograms_) - return; + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); - const HistogramMap::iterator found = histograms_->find(name); - if (found == histograms_->end()) + const HistogramMap::iterator found = top_->histograms_.find(name); + if (found == top_->histograms_.end()) return; HistogramBase* const base = found->second; @@ -379,53 +340,40 @@ static_cast<Histogram*>(base)->bucket_ranges()->set_persistent_reference(0); } - histograms_->erase(found); + top_->histograms_.erase(found); } // static std::unique_ptr<StatisticsRecorder> StatisticsRecorder::CreateTemporaryForTesting() { + const AutoLock auto_lock(lock_.Get()); return WrapUnique(new StatisticsRecorder()); } // static -void StatisticsRecorder::UninitializeForTesting() { - // Stop now if it's never been initialized. - if (!histograms_) - return; - - // Get the global instance and destruct it. It's held in static memory so - // can't "delete" it; call the destructor explicitly. - DCHECK(g_statistics_recorder_.private_instance_); - g_statistics_recorder_.Get().~StatisticsRecorder(); - - // Now the ugly part. There's no official way to release a LazyInstance once - // created so it's necessary to clear out an internal variable which - // shouldn't be publicly visible but is for initialization reasons. - g_statistics_recorder_.private_instance_ = 0; -} - -// static void StatisticsRecorder::SetRecordChecker( std::unique_ptr<RecordHistogramChecker> record_checker) { - record_checker_ = record_checker.release(); + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); + top_->record_checker_ = std::move(record_checker); } // static bool StatisticsRecorder::ShouldRecordHistogram(uint64_t histogram_hash) { - return !record_checker_ || record_checker_->ShouldRecord(histogram_hash); + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); + return !top_->record_checker_ || + top_->record_checker_->ShouldRecord(histogram_hash); } // static StatisticsRecorder::Histograms StatisticsRecorder::GetKnownHistograms( bool include_persistent) { Histograms known; - base::AutoLock auto_lock(lock_.Get()); - if (!histograms_ || histograms_->empty()) - return known; - - known.reserve(histograms_->size()); - for (const auto& h : *histograms_) { + const AutoLock auto_lock(lock_.Get()); + EnsureGlobalRecorderWhileLocked(); + known.reserve(top_->histograms_.size()); + for (const auto& h : top_->histograms_) { if (include_persistent || (h.second->flags() & HistogramBase::kIsPersistent) == 0) known.push_back(h.second); @@ -436,9 +384,6 @@ // static void StatisticsRecorder::ImportGlobalPersistentHistograms() { - if (!histograms_) - return; - // Import histograms from known persistent storage. Histograms could have been // added by other processes and they must be fetched and recognized locally. // If the persistent memory segment is not shared between processes, this call @@ -451,73 +396,24 @@ // of main(), and hence it is not thread safe. It initializes globals to provide // support for all future calls. StatisticsRecorder::StatisticsRecorder() { - base::AutoLock auto_lock(lock_.Get()); - - existing_histograms_.reset(histograms_); - existing_callbacks_.reset(callbacks_); - existing_ranges_.reset(ranges_); - existing_providers_.reset(providers_); - existing_record_checker_.reset(record_checker_); - - histograms_ = new HistogramMap; - callbacks_ = new CallbackMap; - ranges_ = new RangesMap; - providers_ = new HistogramProviders; - record_checker_ = nullptr; - - InitLogOnShutdownWithoutLock(); + lock_.Get().AssertAcquired(); + previous_ = top_; + top_ = this; + InitLogOnShutdownWhileLocked(); } -void StatisticsRecorder::InitLogOnShutdownWithoutLock() { - if (!vlog_initialized_ && VLOG_IS_ON(1)) { - vlog_initialized_ = true; - AtExitManager::RegisterCallback(&DumpHistogramsToVlog, this); +// static +void StatisticsRecorder::InitLogOnShutdownWhileLocked() { + lock_.Get().AssertAcquired(); + if (!is_vlog_initialized_ && VLOG_IS_ON(1)) { + is_vlog_initialized_ = true; + const auto dump_to_vlog = [](void*) { + std::string output; + WriteGraph("", &output); + VLOG(1) << output; + }; + AtExitManager::RegisterCallback(dump_to_vlog, nullptr); } } -// static -void StatisticsRecorder::Reset() { - // Declared before auto_lock to ensure correct destruction order. - std::unique_ptr<HistogramMap> histograms_deleter; - std::unique_ptr<CallbackMap> callbacks_deleter; - std::unique_ptr<RangesMap> ranges_deleter; - std::unique_ptr<HistogramProviders> providers_deleter; - std::unique_ptr<RecordHistogramChecker> record_checker_deleter; - base::AutoLock auto_lock(lock_.Get()); - histograms_deleter.reset(histograms_); - callbacks_deleter.reset(callbacks_); - ranges_deleter.reset(ranges_); - providers_deleter.reset(providers_); - record_checker_deleter.reset(record_checker_); - histograms_ = nullptr; - callbacks_ = nullptr; - ranges_ = nullptr; - providers_ = nullptr; - record_checker_ = nullptr; - - // We are going to leak the histograms and the ranges. -} - -// static -void StatisticsRecorder::DumpHistogramsToVlog(void* instance) { - std::string output; - StatisticsRecorder::WriteGraph(std::string(), &output); - VLOG(1) << output; -} - -// static -StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = nullptr; -// static -StatisticsRecorder::CallbackMap* StatisticsRecorder::callbacks_ = nullptr; -// static -StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = nullptr; -// static -StatisticsRecorder::HistogramProviders* StatisticsRecorder::providers_ = - nullptr; -// static -RecordHistogramChecker* StatisticsRecorder::record_checker_ = nullptr; -// static -base::LazyInstance<base::Lock>::Leaky StatisticsRecorder::lock_ = - LAZY_INSTANCE_INITIALIZER; - } // namespace base
diff --git a/base/metrics/statistics_recorder.h b/base/metrics/statistics_recorder.h index 25427fd..75352d1b 100644 --- a/base/metrics/statistics_recorder.h +++ b/base/metrics/statistics_recorder.h
@@ -34,6 +34,17 @@ class BucketRanges; class HistogramSnapshotManager; +// In-memory recorder of usage statistics (aka metrics, aka histograms). +// +// All the public methods are static and act on a global recorder. This global +// recorder is internally synchronized and all the static methods are thread +// safe. +// +// StatisticsRecorder doesn't have any public constructor. For testing purpose, +// you can create a temporary recorder using the factory method +// CreateTemporaryForTesting(). This temporary recorder becomes the global one +// until deleted. When this temporary recorder is deleted, it restores the +// previous global one. class BASE_EXPORT StatisticsRecorder { public: // An interface class that allows the StatisticsRecorder to forcibly merge @@ -46,58 +57,73 @@ typedef std::vector<HistogramBase*> Histograms; + // Restores the previous global recorder. + // + // When several temporary recorders are created using + // CreateTemporaryForTesting(), these recorders must be deleted in reverse + // order of creation. + // + // This method is thread safe. + // + // Precondition: The recorder being deleted is the current global recorder. ~StatisticsRecorder(); - // Initializes the StatisticsRecorder system. Safe to call multiple times. - static void Initialize(); - - // Find out if histograms can now be registered into our list. - static bool IsActive(); - - // Register a provider of histograms that can be called to merge those into - // the global StatisticsRecorder. Calls to ImportProvidedHistograms() will - // fetch from registered providers. + // Registers a provider of histograms that can be called to merge those into + // the global recorder. Calls to ImportProvidedHistograms() will fetch from + // registered providers. + // + // This method is thread safe. static void RegisterHistogramProvider( const WeakPtr<HistogramProvider>& provider); - // Register, or add a new histogram to the collection of statistics. If an + // Registers or adds a new histogram to the collection of statistics. If an // identically named histogram is already registered, then the argument - // |histogram| will deleted. The returned value is always the registered + // |histogram| will be deleted. The returned value is always the registered // histogram (either the argument, or the pre-existing registered histogram). + // + // This method is thread safe. static HistogramBase* RegisterOrDeleteDuplicate(HistogramBase* histogram); - // Register, or add a new BucketRanges. If an identically BucketRanges is - // already registered, then the argument |ranges| will deleted. The returned - // value is always the registered BucketRanges (either the argument, or the - // pre-existing one). + // Registers or adds a new BucketRanges. If an equivalent BucketRanges is + // already registered, then the argument |ranges| will be deleted. The + // returned value is always the registered BucketRanges (either the argument, + // or the pre-existing one). + // + // This method is thread safe. static const BucketRanges* RegisterOrDeleteDuplicateRanges( const BucketRanges* ranges); // Methods for appending histogram data to a string. Only histograms which // have |query| as a substring are written to |output| (an empty string will // process all registered histograms). + // + // These methods are thread safe. static void WriteHTMLGraph(const std::string& query, std::string* output); static void WriteGraph(const std::string& query, std::string* output); // Returns the histograms with |verbosity_level| as the serialization // verbosity. + // + // This method is thread safe. static std::string ToJSON(JSONVerbosityLevel verbosity_level); - // Method for extracting histograms which were marked for use by UMA. + // Extracts histograms which were marked for use by UMA. // // This method is thread safe. static void GetHistograms(Histograms* output); - // Method for extracting BucketRanges used by all histograms registered. + // Extracts BucketRanges used by all histograms registered. static void GetBucketRanges(std::vector<const BucketRanges*>* output); - // Find a histogram by name. It matches the exact name. - // It returns NULL if a matching histogram is not found. + // Finds a histogram by name. Matches the exact name. Returns a null pointer + // if a matching histogram is not found. // // This method is thread safe. static HistogramBase* FindHistogram(base::StringPiece name); - // Imports histograms from providers. This must be called on the UI thread. + // Imports histograms from providers. + // + // This method must be called on the UI thread. static void ImportProvidedHistograms(); // Snapshots all histograms via |snapshot_manager|. |flags_to_set| is used to @@ -110,71 +136,81 @@ HistogramBase::Flags required_flags, HistogramSnapshotManager* snapshot_manager); - // GetSnapshot copies some of the pointers to registered histograms into the - // caller supplied vector (Histograms). Only histograms which have |query| as - // a substring are copied (an empty string will process all registered - // histograms). + // Extracts registered histograms. Only histograms which have |query| as a + // substring are extracted. An empty query will extract all registered + // histograms. // // This method is thread safe. static void GetSnapshot(const std::string& query, Histograms* snapshot); typedef base::Callback<void(HistogramBase::Sample)> OnSampleCallback; - // SetCallback sets the callback to notify when a new sample is recorded on - // the histogram referred to by |histogram_name|. The call to this method can - // be be done before or after the histogram is created. This method is thread - // safe. The return value is whether or not the callback was successfully set. + // Sets the callback to notify when a new sample is recorded on the histogram + // referred to by |histogram_name|. Can be called before or after the + // histogram is created. Returns whether the callback was successfully set. + // + // This method is thread safe. static bool SetCallback(const std::string& histogram_name, const OnSampleCallback& callback); - // ClearCallback clears any callback set on the histogram referred to by - // |histogram_name|. This method is thread safe. + // Clears any callback set on the histogram referred to by |histogram_name|. + // + // This method is thread safe. static void ClearCallback(const std::string& histogram_name); - // FindCallback retrieves the callback for the histogram referred to by - // |histogram_name|, or a null callback if no callback exists for this - // histogram. This method is thread safe. + // Retrieves the callback for the histogram referred to by |histogram_name|, + // or a null callback if no callback exists for this histogram. + // + // This method is thread safe. static OnSampleCallback FindCallback(const std::string& histogram_name); // Returns the number of known histograms. + // + // This method is thread safe. static size_t GetHistogramCount(); // Initializes logging histograms with --v=1. Safe to call multiple times. // Is called from ctor but for browser it seems that it is more useful to // start logging after statistics recorder, so we need to init log-on-shutdown // later. + // + // This method is thread safe. static void InitLogOnShutdown(); // Removes a histogram from the internal set of known ones. This can be // necessary during testing persistent histograms where the underlying // memory is being released. + // + // This method is thread safe. static void ForgetHistogramForTesting(base::StringPiece name); - // Creates a local StatisticsRecorder object for testing purposes. All new - // histograms will be registered in it until it is destructed or pushed - // aside for the lifetime of yet another SR object. The destruction of the - // returned object will re-activate the previous one. Always release SR - // objects in the opposite order to which they're created. + // Creates a temporary StatisticsRecorder object for testing purposes. All new + // histograms will be registered in it until it is destructed or pushed aside + // for the lifetime of yet another StatisticsRecorder object. The destruction + // of the returned object will re-activate the previous one. + // StatisticsRecorder objects must be deleted in the opposite order to which + // they're created. + // + // This method is thread safe. static std::unique_ptr<StatisticsRecorder> CreateTemporaryForTesting() WARN_UNUSED_RESULT; - // Resets any global instance of the statistics-recorder that was created - // by a call to Initialize(). - static void UninitializeForTesting(); - // Sets the record checker for determining if a histogram should be recorded. // Record checker doesn't affect any already recorded histograms, so this // method must be called very early, before any threads have started. // Record checker methods can be called on any thread, so they shouldn't // mutate any state. + // // TODO(iburak): This is not yet hooked up to histogram recording // infrastructure. static void SetRecordChecker( std::unique_ptr<RecordHistogramChecker> record_checker); - // Returns true iff the given histogram should be recorded based on - // the ShouldRecord() method of the record checker. - // If the record checker is not set, returns true. + // Checks if the given histogram should be recorded based on the + // ShouldRecord() method of the record checker. If the record checker is not + // set, returns true. + // + // This method is thread safe. static bool ShouldRecordHistogram(uint64_t histogram_hash); private: @@ -199,52 +235,63 @@ unordered_set<const BucketRanges*, BucketRangesHash, BucketRangesEqual> RangesMap; - friend struct LazyInstanceTraitsBase<StatisticsRecorder>; friend class StatisticsRecorderTest; FRIEND_TEST_ALL_PREFIXES(StatisticsRecorderTest, IterationTest); - // Fetch set of existing histograms. Ownership of the individual histograms + // Initializes the global recorder if it doesn't already exist. Safe to call + // multiple times. + // + // Precondition: The global lock is already acquired. + static void EnsureGlobalRecorderWhileLocked(); + + // Fetches set of existing histograms. Ownership of the individual histograms // remains with the StatisticsRecorder. + // + // This method is thread safe. static Histograms GetKnownHistograms(bool include_persistent); - // Imports histograms from global persistent memory. The global lock must - // not be held during this call. + // Gets histogram providers. + // + // This method is thread safe. + static HistogramProviders GetHistogramProviders(); + + // Imports histograms from global persistent memory. + // + // Precondition: The global lock must not be held during this call. static void ImportGlobalPersistentHistograms(); - // The constructor just initializes static members. Usually client code should - // use Initialize to do this. But in test code, you can friend this class and - // call the constructor to get a clean StatisticsRecorder. + // Constructs a new StatisticsRecorder and sets it as the current global + // recorder. + // + // Precondition: The global lock is already acquired. StatisticsRecorder(); // Initialize implementation but without lock. Caller should guard // StatisticsRecorder by itself if needed (it isn't in unit tests). - void InitLogOnShutdownWithoutLock(); + // + // Precondition: The global lock is already acquired. + static void InitLogOnShutdownWhileLocked(); - // These are copies of everything that existed when the (test) Statistics- - // Recorder was created. The global ones have to be moved aside to create a - // clean environment. - std::unique_ptr<HistogramMap> existing_histograms_; - std::unique_ptr<CallbackMap> existing_callbacks_; - std::unique_ptr<RangesMap> existing_ranges_; - std::unique_ptr<HistogramProviders> existing_providers_; - std::unique_ptr<RecordHistogramChecker> existing_record_checker_; + HistogramMap histograms_; + CallbackMap callbacks_; + RangesMap ranges_; + HistogramProviders providers_; + std::unique_ptr<RecordHistogramChecker> record_checker_; - bool vlog_initialized_ = false; + // Previous global recorder that existed when this one was created. + StatisticsRecorder* previous_ = nullptr; - static void Reset(); - static void DumpHistogramsToVlog(void* instance); + // Global lock for internal synchronization. + static LazyInstance<Lock>::Leaky lock_; - static HistogramMap* histograms_; - static CallbackMap* callbacks_; - static RangesMap* ranges_; - static HistogramProviders* providers_; - static RecordHistogramChecker* record_checker_; + // Current global recorder. This recorder is used by static methods. When a + // new global recorder is created by CreateTemporaryForTesting(), then the + // previous global recorder is referenced by top_->previous_. + static StatisticsRecorder* top_; - // Lock protects access to above maps. This is a LazyInstance to avoid races - // when the above methods are used before Initialize(). Previously each method - // would do |if (!lock_) return;| which would race with - // |lock_ = new Lock;| in StatisticsRecorder(). http://crbug.com/672852. - static base::LazyInstance<base::Lock>::Leaky lock_; + // Tracks whether InitLogOnShutdownWhileLocked() has registered a logging + // function that will be called when the program finishes. + static bool is_vlog_initialized_; DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); };
diff --git a/base/metrics/statistics_recorder_unittest.cc b/base/metrics/statistics_recorder_unittest.cc index 92d1bba6..c3b6e24e 100644 --- a/base/metrics/statistics_recorder_unittest.cc +++ b/base/metrics/statistics_recorder_unittest.cc
@@ -30,9 +30,7 @@ public: LogStateSaver() : old_min_log_level_(logging::GetMinLogLevel()) {} - ~LogStateSaver() { - logging::SetMinLogLevel(old_min_log_level_); - } + ~LogStateSaver() { logging::SetMinLogLevel(old_min_log_level_); } private: int old_min_log_level_; @@ -70,8 +68,8 @@ // Use persistent memory for histograms if so indicated by test parameter. if (use_persistent_histogram_allocator_) { - GlobalHistogramAllocator::CreateWithLocalMemory( - kAllocatorMemorySize, 0, "StatisticsRecorderTest"); + GlobalHistogramAllocator::CreateWithLocalMemory(kAllocatorMemorySize, 0, + "StatisticsRecorderTest"); } } @@ -82,15 +80,19 @@ void InitializeStatisticsRecorder() { DCHECK(!statistics_recorder_); - StatisticsRecorder::UninitializeForTesting(); statistics_recorder_ = StatisticsRecorder::CreateTemporaryForTesting(); } + // Deletes the global recorder if there is any. This is used by test + // NotInitialized to ensure a clean global state. void UninitializeStatisticsRecorder() { statistics_recorder_.reset(); - StatisticsRecorder::UninitializeForTesting(); + delete StatisticsRecorder::top_; + DCHECK(!StatisticsRecorder::top_); } + bool HasGlobalRecorder() { return StatisticsRecorder::top_ != nullptr; } + Histogram* CreateHistogram(const char* name, HistogramBase::Sample min, HistogramBase::Sample max, @@ -102,18 +104,13 @@ return new Histogram(name, min, max, registered_ranges); } - void DeleteHistogram(HistogramBase* histogram) { - delete histogram; - } + void InitLogOnShutdown() { StatisticsRecorder::InitLogOnShutdown(); } - void InitLogOnShutdown() { - DCHECK(statistics_recorder_); - statistics_recorder_->InitLogOnShutdownWithoutLock(); - } + bool IsVLogInitialized() { return StatisticsRecorder::is_vlog_initialized_; } - bool VLogInitialized() { - DCHECK(statistics_recorder_); - return statistics_recorder_->vlog_initialized_; + void ResetVLogInitialized() { + UninitializeStatisticsRecorder(); + StatisticsRecorder::is_vlog_initialized_ = false; } const bool use_persistent_histogram_allocator_; @@ -132,30 +129,27 @@ TEST_P(StatisticsRecorderTest, NotInitialized) { UninitializeStatisticsRecorder(); + EXPECT_FALSE(HasGlobalRecorder()); - ASSERT_FALSE(StatisticsRecorder::IsActive()); + HistogramBase* histogram = CreateHistogram("TestHistogram", 1, 1000, 10); + EXPECT_TRUE(StatisticsRecorder::RegisterOrDeleteDuplicate(histogram)); + EXPECT_TRUE(HasGlobalRecorder()); StatisticsRecorder::Histograms registered_histograms; - std::vector<const BucketRanges*> registered_ranges; - StatisticsRecorder::GetHistograms(®istered_histograms); - EXPECT_EQ(0u, registered_histograms.size()); + EXPECT_GT(registered_histograms.size(), 0u); - Histogram* histogram = CreateHistogram("TestHistogram", 1, 1000, 10); + UninitializeStatisticsRecorder(); + EXPECT_FALSE(HasGlobalRecorder()); - // When StatisticsRecorder is not initialized, register is a noop. - EXPECT_EQ(histogram, - StatisticsRecorder::RegisterOrDeleteDuplicate(histogram)); - // Manually delete histogram that was not registered. - DeleteHistogram(histogram); - - // RegisterOrDeleteDuplicateRanges is a no-op. BucketRanges* ranges = new BucketRanges(3); ranges->ResetChecksum(); - EXPECT_EQ(ranges, - StatisticsRecorder::RegisterOrDeleteDuplicateRanges(ranges)); + EXPECT_TRUE(StatisticsRecorder::RegisterOrDeleteDuplicateRanges(ranges)); + EXPECT_TRUE(HasGlobalRecorder()); + + std::vector<const BucketRanges*> registered_ranges; StatisticsRecorder::GetBucketRanges(®istered_ranges); - EXPECT_EQ(0u, registered_ranges.size()); + EXPECT_GT(registered_ranges.size(), 0u); } TEST_P(StatisticsRecorderTest, RegisterBucketRanges) { @@ -277,8 +271,8 @@ ASSERT_EQ(0u, registered_histograms.size()); // Create a histogram. - HistogramBase* histogram = Histogram::FactoryGet( - "TestHistogram", 1, 1000, 10, HistogramBase::kNoFlags); + HistogramBase* histogram = Histogram::FactoryGet("TestHistogram", 1, 1000, 10, + HistogramBase::kNoFlags); registered_histograms.clear(); StatisticsRecorder::GetHistograms(®istered_histograms); EXPECT_EQ(1u, registered_histograms.size()); @@ -292,15 +286,15 @@ EXPECT_EQ(histogram, histogram2); // Create a LinearHistogram. - histogram = LinearHistogram::FactoryGet( - "TestLinearHistogram", 1, 1000, 10, HistogramBase::kNoFlags); + histogram = LinearHistogram::FactoryGet("TestLinearHistogram", 1, 1000, 10, + HistogramBase::kNoFlags); registered_histograms.clear(); StatisticsRecorder::GetHistograms(®istered_histograms); EXPECT_EQ(2u, registered_histograms.size()); // Create a BooleanHistogram. - histogram = BooleanHistogram::FactoryGet( - "TestBooleanHistogram", HistogramBase::kNoFlags); + histogram = BooleanHistogram::FactoryGet("TestBooleanHistogram", + HistogramBase::kNoFlags); registered_histograms.clear(); StatisticsRecorder::GetHistograms(®istered_histograms); EXPECT_EQ(3u, registered_histograms.size()); @@ -309,8 +303,8 @@ std::vector<int> custom_ranges; custom_ranges.push_back(1); custom_ranges.push_back(5); - histogram = CustomHistogram::FactoryGet( - "TestCustomHistogram", custom_ranges, HistogramBase::kNoFlags); + histogram = CustomHistogram::FactoryGet("TestCustomHistogram", custom_ranges, + HistogramBase::kNoFlags); registered_histograms.clear(); StatisticsRecorder::GetHistograms(®istered_histograms); EXPECT_EQ(4u, registered_histograms.size()); @@ -624,33 +618,33 @@ } TEST_P(StatisticsRecorderTest, LogOnShutdownNotInitialized) { - UninitializeStatisticsRecorder(); + ResetVLogInitialized(); logging::SetMinLogLevel(logging::LOG_WARNING); InitializeStatisticsRecorder(); EXPECT_FALSE(VLOG_IS_ON(1)); - EXPECT_FALSE(VLogInitialized()); + EXPECT_FALSE(IsVLogInitialized()); InitLogOnShutdown(); - EXPECT_FALSE(VLogInitialized()); + EXPECT_FALSE(IsVLogInitialized()); } TEST_P(StatisticsRecorderTest, LogOnShutdownInitializedExplicitly) { - UninitializeStatisticsRecorder(); + ResetVLogInitialized(); logging::SetMinLogLevel(logging::LOG_WARNING); InitializeStatisticsRecorder(); EXPECT_FALSE(VLOG_IS_ON(1)); - EXPECT_FALSE(VLogInitialized()); + EXPECT_FALSE(IsVLogInitialized()); logging::SetMinLogLevel(logging::LOG_VERBOSE); EXPECT_TRUE(VLOG_IS_ON(1)); InitLogOnShutdown(); - EXPECT_TRUE(VLogInitialized()); + EXPECT_TRUE(IsVLogInitialized()); } TEST_P(StatisticsRecorderTest, LogOnShutdownInitialized) { - UninitializeStatisticsRecorder(); + ResetVLogInitialized(); logging::SetMinLogLevel(logging::LOG_VERBOSE); InitializeStatisticsRecorder(); EXPECT_TRUE(VLOG_IS_ON(1)); - EXPECT_TRUE(VLogInitialized()); + EXPECT_TRUE(IsVLogInitialized()); } class TestHistogramProvider : public StatisticsRecorder::HistogramProvider {
diff --git a/base/os_compat_android.cc b/base/os_compat_android.cc index 1eb6536..c1a2ac86d 100644 --- a/base/os_compat_android.cc +++ b/base/os_compat_android.cc
@@ -10,6 +10,7 @@ #include <math.h> #include <sys/stat.h> #include <sys/syscall.h> +#include <unistd.h> #if !defined(__LP64__) #include <time64.h>
diff --git a/base/os_compat_android.h b/base/os_compat_android.h index bfdf2c8..e33b1f7a 100644 --- a/base/os_compat_android.h +++ b/base/os_compat_android.h
@@ -18,15 +18,4 @@ // Android has no timegm(). extern "C" time_t timegm(struct tm* const t); -// The lockf() function is not available on Android; we translate to flock(). -#define F_LOCK LOCK_EX -#define F_ULOCK LOCK_UN -inline int lockf(int fd, int cmd, off_t ignored_len) { - return flock(fd, cmd); -} - -// In case __USE_FILE_OFFSET64 is not used, we need to call pwrite64() instead -// of pwrite() -#define pwrite(fd, buf, count, offset) pwrite64(fd, buf, count, offset) - #endif // BASE_OS_COMPAT_ANDROID_H_
diff --git a/base/run_loop.cc b/base/run_loop.cc index 3cda1cb0..3b7bfde 100644 --- a/base/run_loop.cc +++ b/base/run_loop.cc
@@ -321,6 +321,11 @@ RunLoop* previous_run_loop = active_run_loops_.empty() ? nullptr : active_run_loops_.top(); + if (previous_run_loop) { + for (auto& observer : delegate_->nesting_observers_) + observer.OnExitNestedRunLoop(); + } + // Execute deferred Quit, if any: if (previous_run_loop && previous_run_loop->quit_called_) delegate_->Quit();
diff --git a/base/run_loop.h b/base/run_loop.h index e43c4fc..b7c594e1 100644 --- a/base/run_loop.h +++ b/base/run_loop.h
@@ -130,12 +130,13 @@ // Safe to call before RegisterDelegateForCurrentThread(). static bool IsNestedOnCurrentThread(); - // A NestingObserver is notified when a nested RunLoop begins. The observers - // are notified before the current thread's RunLoop::Delegate::Run() is - // invoked and nested work begins. + // A NestingObserver is notified when a nested RunLoop begins and ends. class BASE_EXPORT NestingObserver { public: + // Notified before a nested loop starts running work on the current thread. virtual void OnBeginNestedRunLoop() = 0; + // Notified after a nested loop is done running work on the current thread. + virtual void OnExitNestedRunLoop() {} protected: virtual ~NestingObserver() = default;
diff --git a/base/run_loop_unittest.cc b/base/run_loop_unittest.cc index 714bf82..96060f4a 100644 --- a/base/run_loop_unittest.cc +++ b/base/run_loop_unittest.cc
@@ -570,21 +570,37 @@ run_loop_.Run(); } +namespace { + class MockNestingObserver : public RunLoop::NestingObserver { public: MockNestingObserver() = default; // RunLoop::NestingObserver: MOCK_METHOD0(OnBeginNestedRunLoop, void()); + MOCK_METHOD0(OnExitNestedRunLoop, void()); private: DISALLOW_COPY_AND_ASSIGN(MockNestingObserver); }; +class MockTask { + public: + MockTask() = default; + MOCK_METHOD0(Task, void()); + + private: + DISALLOW_COPY_AND_ASSIGN(MockTask); +}; + +} // namespace + TEST_P(RunLoopTest, NestingObservers) { EXPECT_TRUE(RunLoop::IsNestingAllowedOnCurrentThread()); testing::StrictMock<MockNestingObserver> nesting_observer; + testing::StrictMock<MockTask> mock_task_a; + testing::StrictMock<MockTask> mock_task_b; RunLoop::AddNestingObserverOnCurrentThread(&nesting_observer); @@ -599,14 +615,27 @@ nested_run_loop.Run(); }); - // Generate a stack of nested RunLoops, an OnBeginNestedRunLoop() is - // expected when beginning each nesting depth. + // Generate a stack of nested RunLoops. OnBeginNestedRunLoop() is expected + // when beginning each nesting depth and OnExitNestedRunLoop() is expected + // when exiting each nesting depth. ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, run_nested_loop); + ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(&MockTask::Task, base::Unretained(&mock_task_a))); ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, run_nested_loop); - ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, run_loop_.QuitClosure()); + ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, + base::BindOnce(&MockTask::Task, base::Unretained(&mock_task_b))); - EXPECT_CALL(nesting_observer, OnBeginNestedRunLoop()).Times(2); - run_loop_.Run(); + { + testing::InSequence in_sequence; + EXPECT_CALL(nesting_observer, OnBeginNestedRunLoop()); + EXPECT_CALL(mock_task_a, Task()); + EXPECT_CALL(nesting_observer, OnBeginNestedRunLoop()); + EXPECT_CALL(mock_task_b, Task()); + EXPECT_CALL(nesting_observer, OnExitNestedRunLoop()).Times(2); + } + run_loop_.RunUntilIdle(); RunLoop::RemoveNestingObserverOnCurrentThread(&nesting_observer); }
diff --git a/base/strings/pattern.cc b/base/strings/pattern.cc index e10d4ac..5a0a055 100644 --- a/base/strings/pattern.cc +++ b/base/strings/pattern.cc
@@ -154,13 +154,13 @@ } // namespace -bool MatchPattern(const StringPiece& eval, const StringPiece& pattern) { +bool MatchPattern(StringPiece eval, StringPiece pattern) { return MatchPatternT(eval.data(), eval.data() + eval.size(), pattern.data(), pattern.data() + pattern.size(), 0, NextCharUTF8()); } -bool MatchPattern(const StringPiece16& eval, const StringPiece16& pattern) { +bool MatchPattern(StringPiece16 eval, StringPiece16 pattern) { return MatchPatternT(eval.data(), eval.data() + eval.size(), pattern.data(), pattern.data() + pattern.size(), 0, NextCharUTF16());
diff --git a/base/strings/pattern.h b/base/strings/pattern.h index b698207..15f96e2 100644 --- a/base/strings/pattern.h +++ b/base/strings/pattern.h
@@ -16,10 +16,8 @@ // The backslash character (\) is an escape character for * and ? // We limit the patterns to having a max of 16 * or ? characters. // ? matches 0 or 1 character, while * matches 0 or more characters. -BASE_EXPORT bool MatchPattern(const StringPiece& string, - const StringPiece& pattern); -BASE_EXPORT bool MatchPattern(const StringPiece16& string, - const StringPiece16& pattern); +BASE_EXPORT bool MatchPattern(StringPiece string, StringPiece pattern); +BASE_EXPORT bool MatchPattern(StringPiece16 string, StringPiece16 pattern); } // namespace base
diff --git a/base/strings/string_number_conversions.cc b/base/strings/string_number_conversions.cc index 46c229a..86fa2e3 100644 --- a/base/strings/string_number_conversions.cc +++ b/base/strings/string_number_conversions.cc
@@ -292,7 +292,7 @@ }; template <typename VALUE> -bool StringToIntImpl(const StringPiece& input, VALUE* output) { +bool StringToIntImpl(StringPiece input, VALUE* output) { return IteratorRangeToNumber<StringPieceToNumberTraits<VALUE, 10> >::Invoke( input.begin(), input.end(), output); } @@ -305,7 +305,7 @@ }; template <typename VALUE> -bool String16ToIntImpl(const StringPiece16& input, VALUE* output) { +bool String16ToIntImpl(StringPiece16 input, VALUE* output) { return IteratorRangeToNumber<StringPiece16ToNumberTraits<VALUE, 10> >::Invoke( input.begin(), input.end(), output); } @@ -377,43 +377,43 @@ return base::string16(&buffer[0], &buffer[strlen(buffer)]); } -bool StringToInt(const StringPiece& input, int* output) { +bool StringToInt(StringPiece input, int* output) { return StringToIntImpl(input, output); } -bool StringToInt(const StringPiece16& input, int* output) { +bool StringToInt(StringPiece16 input, int* output) { return String16ToIntImpl(input, output); } -bool StringToUint(const StringPiece& input, unsigned* output) { +bool StringToUint(StringPiece input, unsigned* output) { return StringToIntImpl(input, output); } -bool StringToUint(const StringPiece16& input, unsigned* output) { +bool StringToUint(StringPiece16 input, unsigned* output) { return String16ToIntImpl(input, output); } -bool StringToInt64(const StringPiece& input, int64_t* output) { +bool StringToInt64(StringPiece input, int64_t* output) { return StringToIntImpl(input, output); } -bool StringToInt64(const StringPiece16& input, int64_t* output) { +bool StringToInt64(StringPiece16 input, int64_t* output) { return String16ToIntImpl(input, output); } -bool StringToUint64(const StringPiece& input, uint64_t* output) { +bool StringToUint64(StringPiece input, uint64_t* output) { return StringToIntImpl(input, output); } -bool StringToUint64(const StringPiece16& input, uint64_t* output) { +bool StringToUint64(StringPiece16 input, uint64_t* output) { return String16ToIntImpl(input, output); } -bool StringToSizeT(const StringPiece& input, size_t* output) { +bool StringToSizeT(StringPiece input, size_t* output) { return StringToIntImpl(input, output); } -bool StringToSizeT(const StringPiece16& input, size_t* output) { +bool StringToSizeT(StringPiece16 input, size_t* output) { return String16ToIntImpl(input, output); } @@ -461,27 +461,27 @@ return ret; } -bool HexStringToInt(const StringPiece& input, int* output) { +bool HexStringToInt(StringPiece input, int* output) { return IteratorRangeToNumber<HexIteratorRangeToIntTraits>::Invoke( input.begin(), input.end(), output); } -bool HexStringToUInt(const StringPiece& input, uint32_t* output) { +bool HexStringToUInt(StringPiece input, uint32_t* output) { return IteratorRangeToNumber<HexIteratorRangeToUIntTraits>::Invoke( input.begin(), input.end(), output); } -bool HexStringToInt64(const StringPiece& input, int64_t* output) { +bool HexStringToInt64(StringPiece input, int64_t* output) { return IteratorRangeToNumber<HexIteratorRangeToInt64Traits>::Invoke( input.begin(), input.end(), output); } -bool HexStringToUInt64(const StringPiece& input, uint64_t* output) { +bool HexStringToUInt64(StringPiece input, uint64_t* output) { return IteratorRangeToNumber<HexIteratorRangeToUInt64Traits>::Invoke( input.begin(), input.end(), output); } -bool HexStringToBytes(const StringPiece& input, std::vector<uint8_t>* output) { +bool HexStringToBytes(StringPiece input, std::vector<uint8_t>* output) { DCHECK_EQ(output->size(), 0u); size_t count = input.size(); if (count == 0 || (count % 2) != 0)
diff --git a/base/strings/string_number_conversions.h b/base/strings/string_number_conversions.h index 798ce2f..057b60ab 100644 --- a/base/strings/string_number_conversions.h +++ b/base/strings/string_number_conversions.h
@@ -97,20 +97,20 @@ // - Empty string. |*output| will be set to 0. // WARNING: Will write to |output| even when returning false. // Read the comments above carefully. -BASE_EXPORT bool StringToInt(const StringPiece& input, int* output); -BASE_EXPORT bool StringToInt(const StringPiece16& input, int* output); +BASE_EXPORT bool StringToInt(StringPiece input, int* output); +BASE_EXPORT bool StringToInt(StringPiece16 input, int* output); -BASE_EXPORT bool StringToUint(const StringPiece& input, unsigned* output); -BASE_EXPORT bool StringToUint(const StringPiece16& input, unsigned* output); +BASE_EXPORT bool StringToUint(StringPiece input, unsigned* output); +BASE_EXPORT bool StringToUint(StringPiece16 input, unsigned* output); -BASE_EXPORT bool StringToInt64(const StringPiece& input, int64_t* output); -BASE_EXPORT bool StringToInt64(const StringPiece16& input, int64_t* output); +BASE_EXPORT bool StringToInt64(StringPiece input, int64_t* output); +BASE_EXPORT bool StringToInt64(StringPiece16 input, int64_t* output); -BASE_EXPORT bool StringToUint64(const StringPiece& input, uint64_t* output); -BASE_EXPORT bool StringToUint64(const StringPiece16& input, uint64_t* output); +BASE_EXPORT bool StringToUint64(StringPiece input, uint64_t* output); +BASE_EXPORT bool StringToUint64(StringPiece16 input, uint64_t* output); -BASE_EXPORT bool StringToSizeT(const StringPiece& input, size_t* output); -BASE_EXPORT bool StringToSizeT(const StringPiece16& input, size_t* output); +BASE_EXPORT bool StringToSizeT(StringPiece input, size_t* output); +BASE_EXPORT bool StringToSizeT(StringPiece16 input, size_t* output); // For floating-point conversions, only conversions of input strings in decimal // form are defined to work. Behavior with strings representing floating-point @@ -135,30 +135,30 @@ // Best effort conversion, see StringToInt above for restrictions. // Will only successful parse hex values that will fit into |output|, i.e. // -0x80000000 < |input| < 0x7FFFFFFF. -BASE_EXPORT bool HexStringToInt(const StringPiece& input, int* output); +BASE_EXPORT bool HexStringToInt(StringPiece input, int* output); // Best effort conversion, see StringToInt above for restrictions. // Will only successful parse hex values that will fit into |output|, i.e. // 0x00000000 < |input| < 0xFFFFFFFF. // The string is not required to start with 0x. -BASE_EXPORT bool HexStringToUInt(const StringPiece& input, uint32_t* output); +BASE_EXPORT bool HexStringToUInt(StringPiece input, uint32_t* output); // Best effort conversion, see StringToInt above for restrictions. // Will only successful parse hex values that will fit into |output|, i.e. // -0x8000000000000000 < |input| < 0x7FFFFFFFFFFFFFFF. -BASE_EXPORT bool HexStringToInt64(const StringPiece& input, int64_t* output); +BASE_EXPORT bool HexStringToInt64(StringPiece input, int64_t* output); // Best effort conversion, see StringToInt above for restrictions. // Will only successful parse hex values that will fit into |output|, i.e. // 0x0000000000000000 < |input| < 0xFFFFFFFFFFFFFFFF. // The string is not required to start with 0x. -BASE_EXPORT bool HexStringToUInt64(const StringPiece& input, uint64_t* output); +BASE_EXPORT bool HexStringToUInt64(StringPiece input, uint64_t* output); // Similar to the previous functions, except that output is a vector of bytes. // |*output| will contain as many bytes as were successfully parsed prior to the // error. There is no overflow, but input.size() must be evenly divisible by 2. // Leading 0x or +/- are not allowed. -BASE_EXPORT bool HexStringToBytes(const StringPiece& input, +BASE_EXPORT bool HexStringToBytes(StringPiece input, std::vector<uint8_t>* output); } // namespace base
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc index 2112f230..8a42b56 100644 --- a/base/strings/string_util.cc +++ b/base/strings/string_util.cc
@@ -252,7 +252,7 @@ StringType* output); bool ReplaceChars(const string16& input, - const StringPiece16& replace_chars, + StringPiece16 replace_chars, const string16& replace_with, string16* output) { return ReplaceCharsT(input, replace_chars, StringPiece16(replace_with), @@ -260,20 +260,20 @@ } bool ReplaceChars(const std::string& input, - const StringPiece& replace_chars, + StringPiece replace_chars, const std::string& replace_with, std::string* output) { return ReplaceCharsT(input, replace_chars, StringPiece(replace_with), output); } bool RemoveChars(const string16& input, - const StringPiece16& remove_chars, + StringPiece16 remove_chars, string16* output) { return ReplaceCharsT(input, remove_chars, StringPiece16(), output); } bool RemoveChars(const std::string& input, - const StringPiece& remove_chars, + StringPiece remove_chars, std::string* output) { return ReplaceCharsT(input, remove_chars, StringPiece(), output); } @@ -338,13 +338,13 @@ } StringPiece16 TrimString(StringPiece16 input, - const StringPiece16& trim_chars, + StringPiece16 trim_chars, TrimPositions positions) { return TrimStringPieceT(input, trim_chars, positions); } StringPiece TrimString(StringPiece input, - const StringPiece& trim_chars, + StringPiece trim_chars, TrimPositions positions) { return TrimStringPieceT(input, trim_chars, positions); } @@ -459,13 +459,11 @@ return CollapseWhitespaceT(text, trim_sequences_with_line_breaks); } -bool ContainsOnlyChars(const StringPiece& input, - const StringPiece& characters) { +bool ContainsOnlyChars(StringPiece input, StringPiece characters) { return input.find_first_not_of(characters) == StringPiece::npos; } -bool ContainsOnlyChars(const StringPiece16& input, - const StringPiece16& characters) { +bool ContainsOnlyChars(StringPiece16 input, StringPiece16 characters) { return input.find_first_not_of(characters) == StringPiece16::npos; } @@ -499,11 +497,11 @@ return !(all_char_bits & non_ascii_bit_mask); } -bool IsStringASCII(const StringPiece& str) { +bool IsStringASCII(StringPiece str) { return DoIsStringASCII(str.data(), str.length()); } -bool IsStringASCII(const StringPiece16& str) { +bool IsStringASCII(StringPiece16 str) { return DoIsStringASCII(str.data(), str.length()); } @@ -517,7 +515,7 @@ } #endif -bool IsStringUTF8(const StringPiece& str) { +bool IsStringUTF8(StringPiece str) { const char *src = str.data(); int32_t src_len = static_cast<int32_t>(str.length()); int32_t char_index = 0; @@ -1066,7 +1064,7 @@ return DoReplaceStringPlaceholders(format_string, subst, offsets); } -std::string ReplaceStringPlaceholders(const StringPiece& format_string, +std::string ReplaceStringPlaceholders(StringPiece format_string, const std::vector<std::string>& subst, std::vector<size_t>* offsets) { return DoReplaceStringPlaceholders(format_string, subst, offsets);
diff --git a/base/strings/string_util.h b/base/strings/string_util.h index 7603eed..a4cba63 100644 --- a/base/strings/string_util.h +++ b/base/strings/string_util.h
@@ -174,10 +174,10 @@ // if any characters were removed. |remove_chars| must be null-terminated. // NOTE: Safe to use the same variable for both |input| and |output|. BASE_EXPORT bool RemoveChars(const string16& input, - const StringPiece16& remove_chars, + StringPiece16 remove_chars, string16* output); BASE_EXPORT bool RemoveChars(const std::string& input, - const StringPiece& remove_chars, + StringPiece remove_chars, std::string* output); // Replaces characters in |replace_chars| from anywhere in |input| with @@ -186,11 +186,11 @@ // |replace_chars| must be null-terminated. // NOTE: Safe to use the same variable for both |input| and |output|. BASE_EXPORT bool ReplaceChars(const string16& input, - const StringPiece16& replace_chars, + StringPiece16 replace_chars, const string16& replace_with, string16* output); BASE_EXPORT bool ReplaceChars(const std::string& input, - const StringPiece& replace_chars, + StringPiece replace_chars, const std::string& replace_with, std::string* output); @@ -217,10 +217,10 @@ // StringPiece versions of the above. The returned pieces refer to the original // buffer. BASE_EXPORT StringPiece16 TrimString(StringPiece16 input, - const StringPiece16& trim_chars, + StringPiece16 trim_chars, TrimPositions positions); BASE_EXPORT StringPiece TrimString(StringPiece input, - const StringPiece& trim_chars, + StringPiece trim_chars, TrimPositions positions); // Truncates a string to the nearest UTF-8 character that will leave @@ -264,10 +264,9 @@ // Returns true if |input| is empty or contains only characters found in // |characters|. -BASE_EXPORT bool ContainsOnlyChars(const StringPiece& input, - const StringPiece& characters); -BASE_EXPORT bool ContainsOnlyChars(const StringPiece16& input, - const StringPiece16& characters); +BASE_EXPORT bool ContainsOnlyChars(StringPiece input, StringPiece characters); +BASE_EXPORT bool ContainsOnlyChars(StringPiece16 input, + StringPiece16 characters); // Returns true if the specified string matches the criteria. How can a wide // string be 8-bit or UTF8? It contains only characters that are < 256 (in the @@ -283,9 +282,9 @@ // // IsStringASCII assumes the input is likely all ASCII, and does not leave early // if it is not the case. -BASE_EXPORT bool IsStringUTF8(const StringPiece& str); -BASE_EXPORT bool IsStringASCII(const StringPiece& str); -BASE_EXPORT bool IsStringASCII(const StringPiece16& str); +BASE_EXPORT bool IsStringUTF8(StringPiece str); +BASE_EXPORT bool IsStringASCII(StringPiece str); +BASE_EXPORT bool IsStringASCII(StringPiece16 str); BASE_EXPORT bool IsStringASCII(const string16& str); #if defined(WCHAR_T_IS_UTF32) BASE_EXPORT bool IsStringASCII(const std::wstring& str); @@ -465,7 +464,7 @@ std::vector<size_t>* offsets); BASE_EXPORT std::string ReplaceStringPlaceholders( - const StringPiece& format_string, + StringPiece format_string, const std::vector<std::string>& subst, std::vector<size_t>* offsets);
diff --git a/base/strings/sys_string_conversions.h b/base/strings/sys_string_conversions.h index b41a228..1ad0307 100644 --- a/base/strings/sys_string_conversions.h +++ b/base/strings/sys_string_conversions.h
@@ -32,13 +32,13 @@ // Converts between wide and UTF-8 representations of a string. On error, the // result is system-dependent. BASE_EXPORT std::string SysWideToUTF8(const std::wstring& wide); -BASE_EXPORT std::wstring SysUTF8ToWide(const StringPiece& utf8); +BASE_EXPORT std::wstring SysUTF8ToWide(StringPiece utf8); // Converts between wide and the system multi-byte representations of a string. // DANGER: This will lose information and can change (on Windows, this can // change between reboots). BASE_EXPORT std::string SysWideToNativeMB(const std::wstring& wide); -BASE_EXPORT std::wstring SysNativeMBToWide(const StringPiece& native_mb); +BASE_EXPORT std::wstring SysNativeMBToWide(StringPiece native_mb); // Windows-specific ------------------------------------------------------------ @@ -47,8 +47,7 @@ // Converts between 8-bit and wide strings, using the given code page. The // code page identifier is one accepted by the Windows function // MultiByteToWideChar(). -BASE_EXPORT std::wstring SysMultiByteToWide(const StringPiece& mb, - uint32_t code_page); +BASE_EXPORT std::wstring SysMultiByteToWide(StringPiece mb, uint32_t code_page); BASE_EXPORT std::string SysWideToMultiByte(const std::wstring& wide, uint32_t code_page);
diff --git a/base/strings/sys_string_conversions_mac.mm b/base/strings/sys_string_conversions_mac.mm index 32fe89c..637d941 100644 --- a/base/strings/sys_string_conversions_mac.mm +++ b/base/strings/sys_string_conversions_mac.mm
@@ -131,7 +131,7 @@ } // Do not assert in this function since it is used by the asssertion code! -std::wstring SysUTF8ToWide(const StringPiece& utf8) { +std::wstring SysUTF8ToWide(StringPiece utf8) { return STLStringToSTLStringWithEncodingsT<StringPiece, std::wstring>( utf8, kNarrowStringEncoding, kWideStringEncoding); } @@ -140,7 +140,7 @@ return SysWideToUTF8(wide); } -std::wstring SysNativeMBToWide(const StringPiece& native_mb) { +std::wstring SysNativeMBToWide(StringPiece native_mb) { return SysUTF8ToWide(native_mb); }
diff --git a/base/strings/sys_string_conversions_posix.cc b/base/strings/sys_string_conversions_posix.cc index cc039db..6b1591c7 100644 --- a/base/strings/sys_string_conversions_posix.cc +++ b/base/strings/sys_string_conversions_posix.cc
@@ -18,7 +18,7 @@ // than our ICU, but this will do for now. return WideToUTF8(wide); } -std::wstring SysUTF8ToWide(const StringPiece& utf8) { +std::wstring SysUTF8ToWide(StringPiece utf8) { // In theory this should be using the system-provided conversion rather // than our ICU, but this will do for now. std::wstring out; @@ -34,7 +34,7 @@ return WideToUTF8(wide); } -std::wstring SysNativeMBToWide(const StringPiece& native_mb) { +std::wstring SysNativeMBToWide(StringPiece native_mb) { return SysUTF8ToWide(native_mb); } @@ -100,7 +100,7 @@ return out; } -std::wstring SysNativeMBToWide(const StringPiece& native_mb) { +std::wstring SysNativeMBToWide(StringPiece native_mb) { mbstate_t ps; // Calculate the number of wide characters. We walk through the string
diff --git a/base/strings/sys_string_conversions_win.cc b/base/strings/sys_string_conversions_win.cc index b708544..356064f 100644 --- a/base/strings/sys_string_conversions_win.cc +++ b/base/strings/sys_string_conversions_win.cc
@@ -17,7 +17,7 @@ } // Do not assert in this function since it is used by the asssertion code! -std::wstring SysUTF8ToWide(const StringPiece& utf8) { +std::wstring SysUTF8ToWide(StringPiece utf8) { return SysMultiByteToWide(utf8, CP_UTF8); } @@ -25,12 +25,12 @@ return SysWideToMultiByte(wide, CP_ACP); } -std::wstring SysNativeMBToWide(const StringPiece& native_mb) { +std::wstring SysNativeMBToWide(StringPiece native_mb) { return SysMultiByteToWide(native_mb, CP_ACP); } // Do not assert in this function since it is used by the asssertion code! -std::wstring SysMultiByteToWide(const StringPiece& mb, uint32_t code_page) { +std::wstring SysMultiByteToWide(StringPiece mb, uint32_t code_page) { if (mb.empty()) return std::wstring();
diff --git a/base/test/histogram_tester.cc b/base/test/histogram_tester.cc index 64b4ca2..8949133 100644 --- a/base/test/histogram_tester.cc +++ b/base/test/histogram_tester.cc
@@ -17,8 +17,6 @@ namespace base { HistogramTester::HistogramTester() { - StatisticsRecorder::Initialize(); // Safe to call multiple times. - // Record any histogram data that exists when the object is created so it can // be subtracted later. StatisticsRecorder::Histograms histograms;
diff --git a/base/test/histogram_tester.h b/base/test/histogram_tester.h index 1bd024c..b31c631 100644 --- a/base/test/histogram_tester.h +++ b/base/test/histogram_tester.h
@@ -29,8 +29,7 @@ public: using CountsMap = std::map<std::string, HistogramBase::Count>; - // The constructor will call StatisticsRecorder::Initialize() for you. Also, - // this takes a snapshot of all current histograms counts. + // Takes a snapshot of all current histograms counts. HistogramTester(); ~HistogramTester();
diff --git a/base/third_party/dmg_fp/dtoa_wrapper.cc b/base/third_party/dmg_fp/dtoa_wrapper.cc index 5141e23..fb1ac8f 100644 --- a/base/third_party/dmg_fp/dtoa_wrapper.cc +++ b/base/third_party/dmg_fp/dtoa_wrapper.cc
@@ -45,4 +45,5 @@ #include "base/third_party/dmg_fp/dtoa.cc" +#undef Bias // Avoid windows jumbo build breakage. #undef Long // To avoid breaking jni code in jumbo builds
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc index 2b11711..dc746c62 100644 --- a/base/trace_event/trace_log.cc +++ b/base/trace_event/trace_log.cc
@@ -971,12 +971,19 @@ // This will flush the thread local buffer. delete thread_local_event_buffer_.Get(); - AutoLock lock(lock_); - if (!CheckGeneration(generation) || !flush_task_runner_ || - !thread_message_loops_.empty()) - return; - - flush_task_runner_->PostTask( + // Scheduler uses TRACE_EVENT macros when posting a task, which can lead + // to acquiring a tracing lock. Given that posting a task requires grabbing + // a scheduler lock, we need to post this task outside tracing lock to avoid + // deadlocks. + scoped_refptr<SingleThreadTaskRunner> cached_flush_task_runner; + { + AutoLock lock(lock_); + cached_flush_task_runner = flush_task_runner_; + if (!CheckGeneration(generation) || !flush_task_runner_ || + !thread_message_loops_.empty()) + return; + } + cached_flush_task_runner->PostTask( FROM_HERE, BindOnce(&TraceLog::FinishFlush, Unretained(this), generation, discard_events)); }
diff --git a/base/win/OWNERS b/base/win/OWNERS index 082fae6..25fafc3d 100644 --- a/base/win/OWNERS +++ b/base/win/OWNERS
@@ -2,5 +2,6 @@ jschuh@chromium.org robliao@chromium.org scottmg@chromium.org +brucedawson@chromium.org # COMPONENT: Internals>PlatformIntegration
diff --git a/build/android/gradle/root.jinja b/build/android/gradle/root.jinja index 76b0446..d3a259f 100644 --- a/build/android/gradle/root.jinja +++ b/build/android/gradle/root.jinja
@@ -12,7 +12,7 @@ } dependencies { {% if canary %} - classpath "com.android.tools.build:gradle:3.1.0-alpha01" + classpath "com.android.tools.build:gradle:3.1.0-alpha04" {% else %} classpath "com.android.tools.build:gradle:3.0.0" {% endif %}
diff --git a/build/android/gyp/process_resources.py b/build/android/gyp/process_resources.py index c09c3e3..034a196 100755 --- a/build/android/gyp/process_resources.py +++ b/build/android/gyp/process_resources.py
@@ -582,7 +582,7 @@ dst_dir = os.path.join(res_root, dst_dir_name) build_utils.MakeDirectory(dst_dir) for src_file_name in os.listdir(src_dir): - if not src_file_name.endswith('.png'): + if not os.path.splitext(src_file_name)[1] in ('.png', '.webp'): continue src_file = os.path.join(src_dir, src_file_name) dst_file = os.path.join(dst_dir, src_file_name) @@ -665,16 +665,36 @@ return link_command -def _EnableDebugInManifest(manifest_path, temp_dir): +def _ExtractVersionFromSdk(aapt_path, sdk_path): + output = subprocess.check_output([aapt_path, 'dump', 'badging', sdk_path]) + version_code = re.search(r"versionCode='(.*?)'", output).group(1) + version_name = re.search(r"versionName='(.*?)'", output).group(1) + return version_code, version_name, + + +def _FixManifest(options, temp_dir): debug_manifest_path = os.path.join(temp_dir, 'AndroidManifest.xml') _ANDROID_NAMESPACE = 'http://schemas.android.com/apk/res/android' _TOOLS_NAMESPACE = 'http://schemas.android.com/tools' ElementTree.register_namespace('android', _ANDROID_NAMESPACE) ElementTree.register_namespace('tools', _TOOLS_NAMESPACE) - original_manifest = ElementTree.parse(manifest_path) + original_manifest = ElementTree.parse(options.android_manifest) - app_node = original_manifest.find('application') - app_node.set('{%s}%s' % (_ANDROID_NAMESPACE, 'debuggable'), 'true') + version_code, version_name = _ExtractVersionFromSdk( + options.aapt_path, options.android_sdk_jar) + + # ElementTree.find does not work if the required tag is the root. + if original_manifest.getroot().tag == 'manifest': + manifest_node = original_manifest.getroot() + else: + manifest_node = original_manifest.find('manifest') + + manifest_node.set('platformBuildVersionCode', version_code) + manifest_node.set('platformBuildVersionName', version_name) + + if options.debuggable: + app_node = original_manifest.find('application') + app_node.set('{%s}%s' % (_ANDROID_NAMESPACE, 'debuggable'), 'true') with open(debug_manifest_path, 'w') as debug_manifest: debug_manifest.write(ElementTree.tostring( @@ -775,11 +795,8 @@ link_command += ['--output-text-symbols', r_txt_path] link_command += ['--java', gen_dir] - if options.debuggable: - debug_manifest = _EnableDebugInManifest(options.android_manifest, temp_dir) - link_command += ['--manifest', debug_manifest] - else: - link_command += ['--manifest', options.android_manifest] + fixed_manifest = _FixManifest(options, temp_dir) + link_command += ['--manifest', fixed_manifest] partials = _CompileDeps(options.aapt_path, dep_subdirs, temp_dir) for partial in partials:
diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn index e92818c..762faae 100644 --- a/build/config/android/BUILD.gn +++ b/build/config/android/BUILD.gn
@@ -48,27 +48,54 @@ "-Wl,--exclude-libs=libvpx_assembly_arm.a", ] + # $compile_api_level corresponds to the API level used for the sysroot path + # calculation in //build/config/android/config.gni if (current_cpu == "arm") { abi_target = "arm-linux-androideabi" + compile_api_level = 16 } else if (current_cpu == "x86") { - abi_target = "i686-linux-androideabi" + abi_target = "i686-linux-android" + compile_api_level = 16 } else if (current_cpu == "arm64") { abi_target = "aarch64-linux-android" + compile_api_level = 21 } else if (current_cpu == "x64") { # Place holder for x64 support, not tested. # TODO: Enable clang support for Android x64. http://crbug.com/539781 - abi_target = "x86_64-linux-androideabi" + abi_target = "x86_64-linux-android" + compile_api_level = 21 } else if (current_cpu == "mipsel") { abi_target = "mipsel-linux-android" + compile_api_level = 16 } else if (current_cpu == "mips64el") { # Place holder for mips64 support, not tested. abi_target = "mips64el-linux-androideabi" + compile_api_level = 21 } else { assert(false, "Architecture not supported") } - cflags += [ "--target=$abi_target" ] + cflags += [ + "--target=$abi_target", + "-isystem" + + rebase_path("$android_ndk_root/sysroot/usr/include/$abi_target", + root_build_dir), + "-D__ANDROID_API__=$compile_api_level", + + # Temporary workaround for third party dependencies requiring this to be + # defined. + # TODO(crbug.com/771171): Remove this once the third party deps have been + # fixed to be compatible with newer NDK versions + "-D__NDK_FPABI__=", + ] ldflags += [ "--target=$abi_target" ] + # TODO(crbug.com/771171): Remove this define once code that uses it has been + # updated to no longer need it. This is leftover from older Android NDK + # versions. + if (compile_api_level < 20) { + cflags += [ "-DHAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC=1" ] + } + # Assign any flags set for the C compiler to asmflags so that they are sent # to the assembler. asmflags = cflags
diff --git a/build/config/android/config.gni b/build/config/android/config.gni index d8eb8db..f62eedc 100644 --- a/build/config/android/config.gni +++ b/build/config/android/config.gni
@@ -33,6 +33,16 @@ # Android SDK release. Currently, only "o_mr1" is publicly supported. android_sdk_release = default_android_sdk_release } + + # This is the result of profiling Chromium. Blindly applying it to arbitrary + # downstream projects and hoping it'll grant a speedup seems fragile. (Not + # to mention that it resides in a Chromium-specific directory.) + if (build_with_chromium) { + # The default AFDO profile used by public builds. Value may differ in + # internal builds. + clang_default_afdo_profile = + rebase_path("//chrome/android/profiles/chrome-profile-3309-text.prof") + } } if (!defined(extra_chrome_shared_library_configs)) { @@ -44,8 +54,8 @@ if (!defined(default_android_ndk_root)) { default_android_ndk_root = "//third_party/android_tools/ndk" - default_android_ndk_version = "r12b" - default_android_ndk_major_version = 12 + default_android_ndk_version = "r16" + default_android_ndk_major_version = 16 } else { assert(defined(default_android_ndk_version)) assert(defined(default_android_ndk_major_version))
diff --git a/build/config/android/sdk.gni b/build/config/android/sdk.gni index 0493cfaf..2fe04000 100644 --- a/build/config/android/sdk.gni +++ b/build/config/android/sdk.gni
@@ -8,8 +8,3 @@ # SDK releases against which public builds are supported. public_sdk_releases = [ "o_mr1" ] - -# The default AFDO profile used by public builds. Value may differ in -# internal builds. -clang_default_afdo_profile = - rebase_path("//chrome/android/profiles/chrome-profile-3309-text.prof")
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 5154ead..c31d2d0 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn
@@ -324,10 +324,12 @@ ldflags += [ "-Wl,--build-id=sha1" ] } - defines += [ "_FILE_OFFSET_BITS=64" ] - if (!is_android) { defines += [ + # _FILE_OFFSET_BITS=64 should not be set on Android in order to maintain + # the behavior of the Android NDK from earlier versions. + # See https://android-developers.googleblog.com/2017/09/introducing-android-native-development.html + "_FILE_OFFSET_BITS=64", "_LARGEFILE_SOURCE", "_LARGEFILE64_SOURCE", ] @@ -623,6 +625,7 @@ config("compiler_cpu_abi") { cflags = [] ldflags = [] + defines = [] if (is_posix && !(is_mac || is_ios)) { # CPU architecture. We may or may not be doing a cross compile now, so for @@ -741,6 +744,7 @@ ] } } else if (mips_arch_variant == "loongson3") { + defines += [ "_MIPS_ARCH_LOONGSON" ] cflags += [ "-march=loongson3a", "-mno-branch-likely", @@ -847,6 +851,7 @@ ] ldflags += [ "-mips64r2" ] } else if (mips_arch_variant == "loongson3") { + defines += [ "_MIPS_ARCH_LOONGSON" ] cflags += [ "-march=loongson3a", "-mno-branch-likely",
diff --git a/build/config/jumbo.gni b/build/config/jumbo.gni index 8f923a1..427bb1fb 100644 --- a/build/config/jumbo.gni +++ b/build/config/jumbo.gni
@@ -127,9 +127,19 @@ merge_limit = jumbo_file_merge_default } } + has_c_file = false + has_objective_c_file = false + has_S_file = false assert(merge_limit > 0) foreach(source_file, invoker_sources) { - if (get_path_info(source_file, "extension") != "h") { + source_ext = get_path_info(source_file, "extension") + if (source_ext == "c") { + has_c_file = true + } else if (source_ext == "mm") { + has_objective_c_file = true + } else if (source_ext == "S") { + has_S_file = true + } else if (source_ext == "cc" || source_ext == "cpp") { if (current_file_index == next_chunk_start) { jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_" + next_chunk_number + ".cc" ] @@ -148,22 +158,7 @@ assert(next_chunk_start >= 0) # Prevent "unused variable" assert(next_chunk_number <= 2) # Prevent "unused variable" } - } - if (use_jumbo_build_for_target) { - has_c_file = false - has_objective_c_file = false - has_S_file = false - foreach(source_file, invoker_sources) { - source_ext = get_path_info(source_file, "extension") - if (source_ext == "c") { - has_c_file = true - } else if (source_ext == "mm") { - has_objective_c_file = true - } else if (source_ext == "S") { - has_S_file = true - } - } if (has_c_file) { jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_c.c" ] } @@ -173,7 +168,9 @@ if (has_S_file) { jumbo_files += [ "$gen_target_dir/" + target_name + "_jumbo_S.S" ] } + } + if (use_jumbo_build_for_target) { merge_action_name = target_name + "__jumbo_merge" # Create an action that calls a script that merges all the source files.
diff --git a/build/config/posix/BUILD.gn b/build/config/posix/BUILD.gn index 4ab2544..26a96c5 100644 --- a/build/config/posix/BUILD.gn +++ b/build/config/posix/BUILD.gn
@@ -92,8 +92,33 @@ if (!is_mac && !is_ios && sysroot != "") { # Pass the sysroot to all C compiler variants, the assembler, and linker. sysroot_flags = [ "--sysroot=" + rebase_path(sysroot, root_build_dir) ] + + # Android uses unified headers in NDK r16 and later, meaning that the + # compile time sysroot and link time sysroot are different + link_sysroot = sysroot + if (is_android) { + if (current_cpu == "arm") { + link_sysroot = "$android_ndk_root/$arm_android_sysroot_subdir" + } else if (current_cpu == "arm64") { + link_sysroot = "$android_ndk_root/$arm64_android_sysroot_subdir" + } else if (current_cpu == "x86") { + link_sysroot = "$android_ndk_root/$x86_android_sysroot_subdir" + } else if (current_cpu == "x64") { + link_sysroot = "$android_ndk_root/$x86_64_android_sysroot_subdir" + } else if (current_cpu == "mipsel") { + link_sysroot = "$android_ndk_root/$mips_android_sysroot_subdir" + } else if (current_cpu == "mips64el") { + link_sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" + } else { + assert(false, "No android link sysroot for cpu: $target_cpu") + } + } + asmflags += sysroot_flags - ldflags += sysroot_flags + + link_sysroot_flags = + [ "--sysroot=" + rebase_path(link_sysroot, root_build_dir) ] + ldflags += link_sysroot_flags # When use_custom_libcxx=true, some -isystem flags get passed to # cflags_cc to set up libc++ include paths. We want to make sure @@ -113,7 +138,7 @@ [ rebase_path("//build/linux/sysroot_ld_path.sh", root_build_dir), - rebase_path(sysroot), + rebase_path(link_sysroot), ], "list lines") foreach(ld_path, ld_paths) {
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn index 9265025..6e651a6 100644 --- a/build/config/sanitizers/BUILD.gn +++ b/build/config/sanitizers/BUILD.gn
@@ -200,13 +200,7 @@ ldflags += [ "-fsanitize=vptr" ] } - if (use_fuzzing_engine) { - ldflags += [ - "-fsanitize=fuzzer-no-link", - # Disable PC-Table coverage as per https://crbug.com/764514#c21. - "-fno-sanitize-coverage=pc-table", - ] - } else if (use_sanitizer_coverage) { + if (use_sanitizer_coverage) { ldflags += [ "-fsanitize-coverage=$sanitizer_coverage_flags" ] } @@ -403,14 +397,7 @@ config("coverage_flags") { cflags = [] - if (use_fuzzing_engine) { - cflags += [ - "-fsanitize=fuzzer-no-link", - # Disable PC-Table coverage as per https://crbug.com/764514#c21. - "-fno-sanitize-coverage=pc-table", - ] - defines = [ "SANITIZER_COVERAGE" ] - } else if (use_sanitizer_coverage) { + if (use_sanitizer_coverage) { cflags += [ "-fsanitize-coverage=$sanitizer_coverage_flags", "-mllvm",
diff --git a/build/config/sanitizers/sanitizers.gni b/build/config/sanitizers/sanitizers.gni index cb17ea04..efea1d48 100644 --- a/build/config/sanitizers/sanitizers.gni +++ b/build/config/sanitizers/sanitizers.gni
@@ -96,6 +96,8 @@ # Value for -fsanitize-coverage flag. Setting this causes # use_sanitizer_coverage to be enabled. + # Default value when unset and use_fuzzing_engine=true: + # trace-pc-guard # Default value when unset and use_sanitizer_coverage=true: # trace-pc-guard,indirect-calls sanitizer_coverage_flags = "" @@ -132,11 +134,16 @@ use_sanitizer_coverage = false } +# Whether we are doing a fuzzer build. Normally this should be checked instead +# of checking "use_libfuzzer || use_afl" because often developers forget to +# check for "use_afl". +use_fuzzing_engine = use_libfuzzer || use_afl + # Args that are in turn dependent on other args must be in a separate # declare_args block. User overrides are only applied at the end of a # declare_args block. declare_args() { - use_sanitizer_coverage = false + use_sanitizer_coverage = use_fuzzing_engine || sanitizer_coverage_flags != "" # Detect overflow/underflow for global objects. # @@ -144,19 +151,9 @@ asan_globals = !is_mac } -# Whether we are doing a fuzzer build. Normally this should be checked instead -# of checking "use_libfuzzer || use_afl" because often developers forget to -# check for "use_afl". -use_fuzzing_engine = use_libfuzzer || use_afl - -assert( - !(use_fuzzing_engine && - (use_sanitizer_coverage || sanitizer_coverage_flags != "")), - "Sanitizer coverage (either use_sanitizer_coverage or " + - "sanitizer_coverage_flags) should not be used if use_fuzzing_engine " + - "is true, i.e. when libFuzzer or AFL is being used.") - -if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { +if (use_fuzzing_engine && sanitizer_coverage_flags == "") { + sanitizer_coverage_flags = "trace-pc-guard" +} else if (use_sanitizer_coverage && sanitizer_coverage_flags == "") { sanitizer_coverage_flags = "trace-pc-guard,indirect-calls" }
diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni index f26a55f..daab5f8 100644 --- a/build/config/sysroot.gni +++ b/build/config/sysroot.gni
@@ -25,21 +25,9 @@ sysroot = target_sysroot } else if (is_android) { import("//build/config/android/config.gni") - if (current_cpu == "x86") { - sysroot = "$android_ndk_root/$x86_android_sysroot_subdir" - } else if (current_cpu == "arm") { - sysroot = "$android_ndk_root/$arm_android_sysroot_subdir" - } else if (current_cpu == "mipsel") { - sysroot = "$android_ndk_root/$mips_android_sysroot_subdir" - } else if (current_cpu == "x64") { - sysroot = "$android_ndk_root/$x86_64_android_sysroot_subdir" - } else if (current_cpu == "arm64") { - sysroot = "$android_ndk_root/$arm64_android_sysroot_subdir" - } else if (current_cpu == "mips64el") { - sysroot = "$android_ndk_root/$mips64_android_sysroot_subdir" - } else { - assert(false, "No android sysroot for cpu: $target_cpu") - } + + # Android uses unified headers, and thus a single compile time sysroot + sysroot = "$android_ndk_root/sysroot" } else if (is_linux && use_sysroot) { # By default build against a sysroot image downloaded from Cloud Storage # during gclient runhooks.
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index cae0a6a..172aa9c 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh
@@ -156,7 +156,6 @@ fakeroot flex fonts-ipafont - fonts-tlwg-garuda g++ git-core git-svn
diff --git a/build/linux/chrome.map b/build/linux/chrome.map index 28ca6d4..914f37b 100644 --- a/build/linux/chrome.map +++ b/build/linux/chrome.map
@@ -48,10 +48,6 @@ pvalloc; realloc; __realloc_hook; - __start_google_malloc; - __start_malloc_hook; - __stop_google_malloc; - __stop_malloc_hook; valloc; # Various flavors of operator new and operator delete.
diff --git a/build/toolchain/win/midl.gni b/build/toolchain/win/midl.gni index c89cd56..9ff29c67 100644 --- a/build/toolchain/win/midl.gni +++ b/build/toolchain/win/midl.gni
@@ -14,6 +14,10 @@ # sources # List of .idl file to process. # +# header_file (optional) +# File name of generated header file. Defaults to the basename of the +# source idl file with a .h extension. +# # out_dir (optional) # Directory to write the generated files to. Defaults to target_gen_dir. # @@ -41,7 +45,12 @@ dynamic_guid = "none" } - header_file = "{{source_name_part}}.h" + if (defined(invoker.header_file)) { + header_file = invoker.header_file + } else { + header_file = "{{source_name_part}}.h" + } + dlldata_file = "{{source_name_part}}.dlldata.c" interface_identifier_file = "{{source_name_part}}_i.c" proxy_file = "{{source_name_part}}_p.c"
diff --git a/cc/ipc/BUILD.gn b/cc/ipc/BUILD.gn index 4a03d24e..8692a3c 100644 --- a/cc/ipc/BUILD.gn +++ b/cc/ipc/BUILD.gn
@@ -31,6 +31,7 @@ "//ipc", "//ui/gfx", "//ui/gfx/ipc", + "//ui/gfx/ipc/buffer_types", "//ui/gfx/ipc/color", "//ui/gfx/ipc/geometry", "//ui/gfx/ipc/skia",
diff --git a/cc/ipc/cc_param_traits_macros.h b/cc/ipc/cc_param_traits_macros.h index daae363..a14d36a 100644 --- a/cc/ipc/cc_param_traits_macros.h +++ b/cc/ipc/cc_param_traits_macros.h
@@ -24,6 +24,7 @@ #include "components/viz/common/surfaces/surface_id.h" #include "components/viz/common/surfaces/surface_info.h" #include "components/viz/common/surfaces/surface_sequence.h" +#include "ui/gfx/ipc/buffer_types/gfx_param_traits.h" #include "ui/gfx/ipc/color/gfx_param_traits.h" #include "ui/gfx/ipc/gfx_param_traits.h" #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h"
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index 7a9cafe..1c6fe290 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -89,7 +89,7 @@ void HeadsUpDisplayLayerImpl::AcquireResource( DrawMode draw_mode, - ResourceProvider* resource_provider) { + LayerTreeResourceProvider* resource_provider) { for (auto& resource : resources_) { if (!resource_provider->InUseByConsumer(resource->id())) { resource.swap(resources_.back()); @@ -116,7 +116,7 @@ } void HeadsUpDisplayLayerImpl::ReleaseUnmatchedSizeResources( - ResourceProvider* resource_provider) { + LayerTreeResourceProvider* resource_provider) { base::EraseIf(resources_, [this](const std::unique_ptr<ScopedResource>& resource) { return internal_content_bounds_ != resource->size(); @@ -170,7 +170,7 @@ void HeadsUpDisplayLayerImpl::UpdateHudTexture( DrawMode draw_mode, - ResourceProvider* resource_provider, + LayerTreeResourceProvider* resource_provider, viz::ContextProvider* context_provider, const viz::RenderPassList& list) { if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id()) @@ -179,8 +179,8 @@ if (context_provider) { ScopedGpuRaster gpu_raster(context_provider); - ResourceProvider::ScopedWriteLockGL lock(resource_provider, - resources_.back()->id()); + LayerTreeResourceProvider::ScopedWriteLockGL lock(resource_provider, + resources_.back()->id()); ResourceProvider::ScopedSkSurface scoped_surface( context_provider->GrContext(), lock.GetTexture(), lock.target(),
diff --git a/cc/layers/heads_up_display_layer_impl.h b/cc/layers/heads_up_display_layer_impl.h index 24d6641..03e1f435 100644 --- a/cc/layers/heads_up_display_layer_impl.h +++ b/cc/layers/heads_up_display_layer_impl.h
@@ -24,9 +24,13 @@ class SkTypeface; struct SkRect; -namespace cc { +namespace viz { +class ContextProvider; +} +namespace cc { class FrameRateCounter; +class LayerTreeResourceProvider; class CC_EXPORT HeadsUpDisplayLayerImpl : public LayerImpl { public: @@ -44,7 +48,7 @@ void AppendQuads(viz::RenderPass* render_pass, AppendQuadsData* append_quads_data) override; void UpdateHudTexture(DrawMode draw_mode, - ResourceProvider* resource_provider, + LayerTreeResourceProvider* resource_provider, viz::ContextProvider* context_provider, const viz::RenderPassList& list); @@ -133,8 +137,10 @@ const std::string& label_text) const; void DrawDebugRects(SkCanvas* canvas, DebugRectHistory* debug_rect_history); - void AcquireResource(DrawMode draw_mode, ResourceProvider* resource_provider); - void ReleaseUnmatchedSizeResources(ResourceProvider* resource_provider); + void AcquireResource(DrawMode draw_mode, + LayerTreeResourceProvider* resource_provider); + void ReleaseUnmatchedSizeResources( + LayerTreeResourceProvider* resource_provider); std::vector<std::unique_ptr<ScopedResource>> resources_; sk_sp<SkSurface> hud_surface_;
diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index 64fbb171..9a55ad9 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc
@@ -38,7 +38,6 @@ #include "cc/trees/layer_tree_impl.h" #include "components/viz/common/quads/draw_quad.h" #include "components/viz/common/quads/tile_draw_quad.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "components/viz/test/begin_frame_args_test.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/geometry/rect_conversions.h"
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc index 20ad2b0f..f5a04dc 100644 --- a/cc/layers/surface_layer.cc +++ b/cc/layers/surface_layer.cc
@@ -90,13 +90,6 @@ SetNeedsCommit(); } -void SurfaceLayer::SetDefaultBackgroundColor(SkColor background_color) { - if (default_background_color_ == background_color) - return; - default_background_color_ = background_color; - SetNeedsPushProperties(); -} - void SurfaceLayer::SetStretchContentToFillBounds( bool stretch_content_to_fill_bounds) { if (stretch_content_to_fill_bounds_ == stretch_content_to_fill_bounds) @@ -139,7 +132,6 @@ layer_impl->SetPrimarySurfaceId(primary_surface_id_); layer_impl->SetFallbackSurfaceId(fallback_surface_id_); layer_impl->SetStretchContentToFillBounds(stretch_content_to_fill_bounds_); - layer_impl->SetDefaultBackgroundColor(default_background_color_); } void SurfaceLayer::RemoveReference(base::Closure reference_returner) {
diff --git a/cc/layers/surface_layer.h b/cc/layers/surface_layer.h index 6cba8a9..8357a81a 100644 --- a/cc/layers/surface_layer.h +++ b/cc/layers/surface_layer.h
@@ -29,10 +29,6 @@ // surface is ignored and the content will be stretched to fill the bounds. void SetStretchContentToFillBounds(bool stretch_content_to_fill_bounds); - // Specifies the |background_color| to use when a primary surface is - // specified, and a fallback surface is unavailable. - void SetDefaultBackgroundColor(SkColor background_color); - // Layer overrides. std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; void SetLayerTreeHost(LayerTreeHost* host) override; @@ -66,7 +62,6 @@ scoped_refptr<viz::SurfaceReferenceFactory> ref_factory_; bool stretch_content_to_fill_bounds_ = false; - SkColor default_background_color_ = SK_ColorWHITE; DISALLOW_COPY_AND_ASSIGN(SurfaceLayer); };
diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc index 6fe043b..964c702b 100644 --- a/cc/layers/surface_layer_impl.cc +++ b/cc/layers/surface_layer_impl.cc
@@ -50,21 +50,12 @@ NoteLayerPropertyChanged(); } -void SurfaceLayerImpl::SetDefaultBackgroundColor(SkColor background_color) { - if (default_background_color_ == background_color) - return; - - default_background_color_ = background_color; - NoteLayerPropertyChanged(); -} - void SurfaceLayerImpl::PushPropertiesTo(LayerImpl* layer) { LayerImpl::PushPropertiesTo(layer); SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer); layer_impl->SetPrimarySurfaceId(primary_surface_id_); layer_impl->SetFallbackSurfaceId(fallback_surface_id_); layer_impl->SetStretchContentToFillBounds(stretch_content_to_fill_bounds_); - layer_impl->SetDefaultBackgroundColor(default_background_color_); } void SurfaceLayerImpl::AppendQuads(viz::RenderPass* render_pass, @@ -119,10 +110,9 @@ auto* surface_draw_quad = render_pass->CreateAndAppendDrawQuad<viz::SurfaceDrawQuad>(); - surface_draw_quad->SetNew(shared_quad_state, quad_rect, visible_quad_rect, - primary_surface_id, fallback_surface_id, - default_background_color_, - stretch_content_to_fill_bounds_); + surface_draw_quad->SetNew( + shared_quad_state, quad_rect, visible_quad_rect, primary_surface_id, + fallback_surface_id, background_color(), stretch_content_to_fill_bounds_); return surface_draw_quad; }
diff --git a/cc/layers/surface_layer_impl.h b/cc/layers/surface_layer_impl.h index a078bf2..3574bdd 100644 --- a/cc/layers/surface_layer_impl.h +++ b/cc/layers/surface_layer_impl.h
@@ -45,9 +45,6 @@ return stretch_content_to_fill_bounds_; } - void SetDefaultBackgroundColor(SkColor background_color); - SkColor default_background_color() const { return default_background_color_; } - // LayerImpl overrides. std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; void PushPropertiesTo(LayerImpl* layer) override; @@ -72,7 +69,6 @@ viz::SurfaceId fallback_surface_id_; bool stretch_content_to_fill_bounds_ = false; - SkColor default_background_color_ = SK_ColorWHITE; DISALLOW_COPY_AND_ASSIGN(SurfaceLayerImpl); };
diff --git a/cc/layers/surface_layer_impl_unittest.cc b/cc/layers/surface_layer_impl_unittest.cc index 8ffa8bf7..a3f7d8e 100644 --- a/cc/layers/surface_layer_impl_unittest.cc +++ b/cc/layers/surface_layer_impl_unittest.cc
@@ -94,7 +94,7 @@ surface_layer_impl->SetDrawsContent(true); surface_layer_impl->SetPrimarySurfaceId(surface_id1); surface_layer_impl->SetFallbackSurfaceId(surface_id2); - surface_layer_impl->SetDefaultBackgroundColor(SK_ColorBLUE); + surface_layer_impl->SetBackgroundColor(SK_ColorBLUE); gfx::Size viewport_size(1000, 1000); impl.CalcDrawProps(viewport_size); @@ -178,7 +178,7 @@ surface_layer_impl->SetDrawsContent(true); surface_layer_impl->SetPrimarySurfaceId(surface_id1); surface_layer_impl->SetFallbackSurfaceId(surface_id1); - surface_layer_impl->SetDefaultBackgroundColor(SK_ColorBLUE); + surface_layer_impl->SetBackgroundColor(SK_ColorBLUE); gfx::Size viewport_size(1000, 1000); impl.CalcDrawProps(viewport_size);
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc index 555d56b..afb73fa9 100644 --- a/cc/layers/surface_layer_unittest.cc +++ b/cc/layers/surface_layer_unittest.cc
@@ -170,7 +170,7 @@ viz::LocalSurfaceId(1, base::UnguessableToken::Create())); layer->SetPrimarySurfaceId(primary_id); layer->SetFallbackSurfaceId(primary_id); - layer->SetDefaultBackgroundColor(SK_ColorBLUE); + layer->SetBackgroundColor(SK_ColorBLUE); layer->SetStretchContentToFillBounds(true); EXPECT_TRUE(layer_tree_host_->needs_surface_ids_sync()); @@ -195,14 +195,14 @@ // Verify that the primary and fallback SurfaceIds are pushed through. EXPECT_EQ(primary_id, layer_impl->primary_surface_id()); EXPECT_EQ(primary_id, layer_impl->fallback_surface_id()); - EXPECT_EQ(SK_ColorBLUE, layer_impl->default_background_color()); + EXPECT_EQ(SK_ColorBLUE, layer_impl->background_color()); EXPECT_TRUE(layer_impl->stretch_content_to_fill_bounds()); viz::SurfaceId fallback_id( kArbitraryFrameSinkId, viz::LocalSurfaceId(2, base::UnguessableToken::Create())); layer->SetFallbackSurfaceId(fallback_id); - layer->SetDefaultBackgroundColor(SK_ColorGREEN); + layer->SetBackgroundColor(SK_ColorGREEN); layer->SetStretchContentToFillBounds(false); // Verify that fallback surface id is not recorded on the layer tree host as @@ -218,7 +218,7 @@ // fallback viz::SurfaceId is pushed through. EXPECT_EQ(primary_id, layer_impl->primary_surface_id()); EXPECT_EQ(fallback_id, layer_impl->fallback_surface_id()); - EXPECT_EQ(SK_ColorGREEN, layer_impl->default_background_color()); + EXPECT_EQ(SK_ColorGREEN, layer_impl->background_color()); EXPECT_FALSE(layer_impl->stretch_content_to_fill_bounds()); }
diff --git a/cc/paint/decode_stashing_image_provider.cc b/cc/paint/decode_stashing_image_provider.cc index 8b8c462..e995f51 100644 --- a/cc/paint/decode_stashing_image_provider.cc +++ b/cc/paint/decode_stashing_image_provider.cc
@@ -25,4 +25,8 @@ return image_to_return; } +void DecodeStashingImageProvider::Reset() { + decoded_images_->clear(); +} + } // namespace cc
diff --git a/cc/paint/decode_stashing_image_provider.h b/cc/paint/decode_stashing_image_provider.h index 6ca0a752..1f8f847 100644 --- a/cc/paint/decode_stashing_image_provider.h +++ b/cc/paint/decode_stashing_image_provider.h
@@ -7,12 +7,13 @@ #include "base/containers/stack_container.h" #include "cc/paint/image_provider.h" +#include "cc/paint/paint_export.h" namespace cc { // An ImageProvider that passes decode requests through to the // |source_provider| but keeps the decode cached throughtout its lifetime, // instead of passing the ref to the caller. -class DecodeStashingImageProvider : public ImageProvider { +class CC_PAINT_EXPORT DecodeStashingImageProvider : public ImageProvider { public: // |source_provider| must outlive this class. explicit DecodeStashingImageProvider(ImageProvider* source_provider); @@ -22,6 +23,9 @@ ScopedDecodedDrawImage GetDecodedDrawImage( const DrawImage& draw_image) override; + // Releases all stashed images. + void Reset(); + private: ImageProvider* source_provider_; base::StackVector<ScopedDecodedDrawImage, 1> decoded_images_;
diff --git a/cc/paint/decoded_draw_image.cc b/cc/paint/decoded_draw_image.cc index a8f82ee..ac38caf 100644 --- a/cc/paint/decoded_draw_image.cc +++ b/cc/paint/decoded_draw_image.cc
@@ -15,6 +15,16 @@ scale_adjustment_(scale_adjustment), filter_quality_(filter_quality) {} +DecodedDrawImage::DecodedDrawImage( + base::Optional<uint32_t> transfer_cache_entry_id, + const SkSize& src_rect_offset, + const SkSize& scale_adjustment, + SkFilterQuality filter_quality) + : transfer_cache_entry_id_(transfer_cache_entry_id), + src_rect_offset_(src_rect_offset), + scale_adjustment_(scale_adjustment), + filter_quality_(filter_quality) {} + DecodedDrawImage::DecodedDrawImage() : DecodedDrawImage(nullptr, kNone_SkFilterQuality) {}
diff --git a/cc/paint/decoded_draw_image.h b/cc/paint/decoded_draw_image.h index 32c202f..d66f56b 100644 --- a/cc/paint/decoded_draw_image.h +++ b/cc/paint/decoded_draw_image.h
@@ -8,6 +8,7 @@ #include <cfloat> #include <cmath> +#include "base/optional.h" #include "cc/paint/paint_export.h" #include "third_party/skia/include/core/SkFilterQuality.h" #include "third_party/skia/include/core/SkImage.h" @@ -22,12 +23,19 @@ const SkSize& src_rect_offset, const SkSize& scale_adjustment, SkFilterQuality filter_quality); + DecodedDrawImage(base::Optional<uint32_t> transfer_cache_entry_id, + const SkSize& src_rect_offset, + const SkSize& scale_adjustment, + SkFilterQuality filter_quality); DecodedDrawImage(sk_sp<const SkImage> image, SkFilterQuality filter_quality); DecodedDrawImage(const DecodedDrawImage& other); DecodedDrawImage(); ~DecodedDrawImage(); const sk_sp<const SkImage>& image() const { return image_; } + base::Optional<uint32_t> transfer_cache_entry_id() const { + return transfer_cache_entry_id_; + } const SkSize& src_rect_offset() const { return src_rect_offset_; } const SkSize& scale_adjustment() const { return scale_adjustment_; } SkFilterQuality filter_quality() const { return filter_quality_; } @@ -38,6 +46,7 @@ private: sk_sp<const SkImage> image_; + base::Optional<uint32_t> transfer_cache_entry_id_; SkSize src_rect_offset_; SkSize scale_adjustment_; SkFilterQuality filter_quality_;
diff --git a/cc/paint/image_provider.h b/cc/paint/image_provider.h index 3c2fc9b3..935fe0b1 100644 --- a/cc/paint/image_provider.h +++ b/cc/paint/image_provider.h
@@ -32,7 +32,9 @@ ScopedDecodedDrawImage(ScopedDecodedDrawImage&& other); ScopedDecodedDrawImage& operator=(ScopedDecodedDrawImage&& other); - operator bool() const { return image_.image(); } + operator bool() const { + return image_.image() || image_.transfer_cache_entry_id(); + } const DecodedDrawImage& decoded_image() const { return image_; } private:
diff --git a/cc/paint/image_transfer_cache_entry.cc b/cc/paint/image_transfer_cache_entry.cc index 53eec3d4..f4bec7f3 100644 --- a/cc/paint/image_transfer_cache_entry.cc +++ b/cc/paint/image_transfer_cache_entry.cc
@@ -8,6 +8,7 @@ #include "base/numerics/checked_math.h" #include "cc/paint/paint_op_reader.h" #include "cc/paint/paint_op_writer.h" +#include "third_party/skia/include/gpu/GrContext.h" namespace cc { @@ -48,7 +49,7 @@ bool ClientImageTransferCacheEntry::Serialize(base::span<uint8_t> data) const { DCHECK_GE(data.size(), SerializedSize()); - PaintOpWriter writer(data.data(), data.size()); + PaintOpWriter writer(data.data(), data.size(), nullptr, nullptr); writer.Write(pixmap_->colorType()); writer.Write(pixmap_->width()); writer.Write(pixmap_->height()); @@ -72,7 +73,7 @@ bool ServiceImageTransferCacheEntry::Deserialize(GrContext* context, base::span<uint8_t> data) { - PaintOpReader reader(data.data(), data.size()); + PaintOpReader reader(data.data(), data.size(), nullptr); SkColorType color_type; reader.Read(&color_type); uint32_t width; @@ -97,11 +98,19 @@ // this as the worst case scenario is visual corruption. SkPixmap pixmap(image_info, const_cast<const void*>(pixel_data), image_info.minRowBytes()); - sk_sp<SkImage> image = SkImage::MakeFromRaster(pixmap, nullptr, nullptr); - if (!image) - return false; - image_ = image->makeTextureImage(context, nullptr); + // Depending on whether the pixmap will fit in a GPU texture, either create + // a software or GPU SkImage. + uint32_t max_size = context->caps()->maxTextureSize(); + bool fits_on_gpu = width <= max_size && height <= max_size; + if (fits_on_gpu) { + sk_sp<SkImage> image = SkImage::MakeFromRaster(pixmap, nullptr, nullptr); + DCHECK(image); + image_ = image->makeTextureImage(context, nullptr); + } else { + image_ = SkImage::MakeRasterCopy(pixmap); + } + return image_; }
diff --git a/cc/paint/image_transfer_cache_entry.h b/cc/paint/image_transfer_cache_entry.h index b78aa8f..47688b7 100644 --- a/cc/paint/image_transfer_cache_entry.h +++ b/cc/paint/image_transfer_cache_entry.h
@@ -14,6 +14,9 @@ namespace cc { +static constexpr uint32_t kInvalidImageTransferCacheEntryId = + static_cast<uint32_t>(-1); + // Client/ServiceImageTransferCacheEntry implement a transfer cache entry // for transferring image data. On the client side, this is a CPU SkPixmap, // on the service side the image is uploaded and is a GPU SkImage.
diff --git a/cc/paint/oop_pixeltest.cc b/cc/paint/oop_pixeltest.cc index b16abc4..38862327 100644 --- a/cc/paint/oop_pixeltest.cc +++ b/cc/paint/oop_pixeltest.cc
@@ -33,6 +33,21 @@ namespace cc { namespace { +class NoOpImageProvider : public ImageProvider { + public: + ~NoOpImageProvider() override = default; + + ScopedDecodedDrawImage GetDecodedDrawImage( + const DrawImage& draw_image) override { + SkBitmap bitmap; + bitmap.allocPixelsFlags(SkImageInfo::MakeN32Premul(10, 10), + SkBitmap::kZeroPixels_AllocFlag); + sk_sp<SkImage> image = SkImage::MakeFromBitmap(bitmap); + return ScopedDecodedDrawImage(DecodedDrawImage( + image, SkSize::Make(10, 10), SkSize::Make(1, 1), kLow_SkFilterQuality)); + } +}; + class OopPixelTest : public testing::Test { public: void SetUp() override { @@ -77,8 +92,7 @@ GrPixelConfig pixel_config = kRGBA_8888_GrPixelConfig; gfx::Rect bitmap_rect; gfx::Rect playback_rect; - float post_translate_x = 0.f; - float post_translate_y = 0.f; + gfx::Vector2dF post_translate = {0.f, 0.f}; float post_scale = 1.f; }; @@ -118,11 +132,10 @@ options.msaa_sample_count, options.use_lcd_text, options.use_distance_field_text, options.pixel_config); - gl->RasterCHROMIUM(display_item_list.get(), options.bitmap_rect.x(), - options.bitmap_rect.y(), options.playback_rect.x(), - options.playback_rect.y(), options.playback_rect.width(), - options.playback_rect.height(), options.post_translate_x, - options.post_translate_y, options.post_scale); + gl->RasterCHROMIUM(display_item_list.get(), &image_provider_, + options.bitmap_rect.OffsetFromOrigin(), + options.playback_rect, options.post_translate, + options.post_scale); gl->EndRasterCHROMIUM(); gl->Flush(); @@ -213,9 +226,8 @@ SkCanvas* canvas = surface->getCanvas(); canvas->drawColor(options.background_color); - gfx::AxisTransform2d raster_transform( - options.post_scale, - gfx::Vector2dF(options.post_translate_x, options.post_translate_y)); + gfx::AxisTransform2d raster_transform(options.post_scale, + options.post_translate); // TODO(enne): add a target colorspace to BeginRasterCHROMIUM etc. gfx::ColorSpace target_color_space; raster_source->PlaybackToCanvas(canvas, target_color_space, @@ -250,6 +262,7 @@ TestImageFactory image_factory_; std::unique_ptr<gpu::GLInProcessContext> context_; gl::DisableNullDrawGLBindings enable_pixel_output_; + NoOpImageProvider image_provider_; }; TEST_F(OopPixelTest, DrawColor) { @@ -369,8 +382,7 @@ options.bitmap_rect = {5, 5, 20, 20}; options.playback_rect = {3, 2, 15, 12}; options.background_color = SK_ColorCYAN; - options.post_translate_x = 0.5f; - options.post_translate_y = 0.25f; + options.post_translate = {0.5f, 0.25f}; options.post_scale = 2.f; auto actual = Raster(display_item_list, options); @@ -401,8 +413,7 @@ options.bitmap_rect = {0, 10, 1, 10}; options.playback_rect = {0, 10, 1, 10}; options.background_color = SK_ColorGRAY; - options.post_translate_x = 0.f; - options.post_translate_y = 0.f; + options.post_translate = {0.f, 0.f}; options.post_scale = 2.f; auto actual = Raster(display_item_list, options);
diff --git a/cc/paint/paint_filter.cc b/cc/paint/paint_filter.cc index a8773da3..649ce8f2 100644 --- a/cc/paint/paint_filter.cc +++ b/cc/paint/paint_filter.cc
@@ -35,6 +35,8 @@ // static std::string PaintFilter::TypeToString(Type type) { switch (type) { + case Type::kNullFilter: + return "kNullFilter"; case Type::kColorFilter: return "kColorFilter"; case Type::kBlur: @@ -211,14 +213,16 @@ sk_sp<PaintFilter> foreground, const CropRect* crop_rect) : PaintFilter(kType, crop_rect), - floats_{k1, k2, k3, k4}, + k1_(k1), + k2_(k2), + k3_(k3), + k4_(k4), enforce_pm_color_(enforce_pm_color), background_(std::move(background)), foreground_(std::move(foreground)) { cached_sk_filter_ = SkArithmeticImageFilter::Make( - floats_[0], floats_[1], floats_[2], floats_[3], enforce_pm_color_, - GetSkFilter(background_.get()), GetSkFilter(foreground_.get()), - crop_rect); + k1_, k2_, k3_, k4_, enforce_pm_color_, GetSkFilter(background_.get()), + GetSkFilter(foreground_.get()), crop_rect); } ArithmeticPaintFilter::~ArithmeticPaintFilter() = default;
diff --git a/cc/paint/paint_filter.h b/cc/paint/paint_filter.h index fadc3cb..c815bfc 100644 --- a/cc/paint/paint_filter.h +++ b/cc/paint/paint_filter.h
@@ -46,6 +46,9 @@ class CC_PAINT_EXPORT PaintFilter : public SkRefCnt { public: enum class Type : uint8_t { + // For serialization purposes, we reserve one enum to indicate that there + // was no PaintFilter, ie the filter is "null". + kNullFilter, kColorFilter, kBlur, kDropShadow, @@ -72,10 +75,14 @@ kLightingDistant, kLightingPoint, kLightingSpot, + // Update the following if kLightingSpot is not the max anymore. + kMaxFilterType = kLightingSpot }; enum class LightingType : uint8_t { kDiffuse, kSpecular, + // Update the following if kSpecular is not the max anymore. + kMaxLightingType = kSpecular }; using MapDirection = SkImageFilter::MapDirection; @@ -163,6 +170,10 @@ const sk_sp<PaintFilter>& input() const { return input_; } + SkScalar sigma_x() const { return sigma_x_; } + SkScalar sigma_y() const { return sigma_y_; } + TileMode tile_mode() const { return tile_mode_; } + private: SkScalar sigma_x_; SkScalar sigma_y_; @@ -184,6 +195,14 @@ const CropRect* crop_rect = nullptr); ~DropShadowPaintFilter() override; + SkScalar dx() const { return dx_; } + SkScalar dy() const { return dy_; } + SkScalar sigma_x() const { return sigma_x_; } + SkScalar sigma_y() const { return sigma_y_; } + SkColor color() const { return color_; } + ShadowMode shadow_mode() const { return shadow_mode_; } + const sk_sp<PaintFilter> input() const { return input_; } + private: SkScalar dx_; SkScalar dy_; @@ -215,6 +234,9 @@ ComposePaintFilter(sk_sp<PaintFilter> outer, sk_sp<PaintFilter> inner); ~ComposePaintFilter() override; + const sk_sp<PaintFilter>& outer() const { return outer_; } + const sk_sp<PaintFilter>& inner() const { return inner_; } + private: sk_sp<PaintFilter> outer_; sk_sp<PaintFilter> inner_; @@ -264,6 +286,7 @@ const CropRect* crop_rect = nullptr); ~XfermodePaintFilter() override; + SkBlendMode blend_mode() const { return blend_mode_; } const sk_sp<PaintFilter>& background() const { return background_; } const sk_sp<PaintFilter>& foreground() const { return foreground_; } @@ -286,8 +309,19 @@ const CropRect* crop_rect); ~ArithmeticPaintFilter() override; + float k1() const { return k1_; } + float k2() const { return k2_; } + float k3() const { return k3_; } + float k4() const { return k4_; } + bool enforce_pm_color() const { return enforce_pm_color_; } + const sk_sp<PaintFilter> background() const { return background_; } + const sk_sp<PaintFilter> foreground() const { return foreground_; } + private: - float floats_[4]; + float k1_; + float k2_; + float k3_; + float k4_; bool enforce_pm_color_; sk_sp<PaintFilter> background_; sk_sp<PaintFilter> foreground_; @@ -362,6 +396,9 @@ RecordPaintFilter(sk_sp<PaintRecord> record, const SkRect& record_bounds); ~RecordPaintFilter() override; + const sk_sp<PaintRecord>& record() const { return record_; } + SkRect record_bounds() const { return record_bounds_; } + private: sk_sp<PaintRecord> record_; SkRect record_bounds_; @@ -387,7 +424,7 @@ class CC_PAINT_EXPORT MorphologyPaintFilter final : public PaintFilter { public: - enum class MorphType : uint8_t { kDilate, kErode }; + enum class MorphType : uint8_t { kDilate, kErode, kMaxMorphType = kErode }; static constexpr Type kType = Type::kMorphology; MorphologyPaintFilter(MorphType morph_type, int radius_x, @@ -396,6 +433,11 @@ const CropRect* crop_rect = nullptr); ~MorphologyPaintFilter() override; + MorphType morph_type() const { return morph_type_; } + int radius_x() const { return radius_x_; } + int radius_y() const { return radius_y_; } + const sk_sp<PaintFilter>& input() const { return input_; } + private: MorphType morph_type_; int radius_x_; @@ -412,6 +454,10 @@ const CropRect* crop_rect = nullptr); ~OffsetPaintFilter() override; + SkScalar dx() const { return dx_; } + SkScalar dy() const { return dy_; } + const sk_sp<PaintFilter> input() const { return input_; } + private: SkScalar dx_; SkScalar dy_; @@ -435,7 +481,11 @@ class CC_PAINT_EXPORT TurbulencePaintFilter final : public PaintFilter { public: static constexpr Type kType = Type::kTurbulence; - enum class TurbulenceType : uint8_t { kTurbulence, kFractalNoise }; + enum class TurbulenceType : uint8_t { + kTurbulence, + kFractalNoise, + kMaxTurbulenceType = kFractalNoise + }; TurbulencePaintFilter(TurbulenceType turbulence_type, SkScalar base_frequency_x, SkScalar base_frequency_y, @@ -445,6 +495,13 @@ const CropRect* crop_rect = nullptr); ~TurbulencePaintFilter() override; + TurbulenceType turbulence_type() const { return turbulence_type_; } + SkScalar base_frequency_x() const { return base_frequency_x_; } + SkScalar base_frequency_y() const { return base_frequency_y_; } + int num_octaves() const { return num_octaves_; } + SkScalar seed() const { return seed_; } + SkISize tile_size() const { return tile_size_; } + private: TurbulenceType turbulence_type_; SkScalar base_frequency_x_; @@ -473,6 +530,10 @@ sk_sp<PaintFilter> input); ~MatrixPaintFilter() override; + const SkMatrix& matrix() const { return matrix_; } + SkFilterQuality filter_quality() const { return filter_quality_; } + const sk_sp<PaintFilter>& input() const { return input_; } + private: SkMatrix matrix_; SkFilterQuality filter_quality_; @@ -495,6 +556,14 @@ const CropRect* crop_rect = nullptr); ~LightingDistantPaintFilter() override; + LightingType lighting_type() const { return lighting_type_; } + const SkPoint3& direction() const { return direction_; } + SkColor light_color() const { return light_color_; } + SkScalar surface_scale() const { return surface_scale_; } + SkScalar kconstant() const { return kconstant_; } + SkScalar shininess() const { return shininess_; } + const sk_sp<PaintFilter> input() const { return input_; } + private: LightingType lighting_type_; SkPoint3 direction_; @@ -521,6 +590,14 @@ const CropRect* crop_rect = nullptr); ~LightingPointPaintFilter() override; + LightingType lighting_type() const { return lighting_type_; } + const SkPoint3& location() const { return location_; } + SkColor light_color() const { return light_color_; } + SkScalar surface_scale() const { return surface_scale_; } + SkScalar kconstant() const { return kconstant_; } + SkScalar shininess() const { return shininess_; } + const sk_sp<PaintFilter>& input() const { return input_; } + private: LightingType lighting_type_; SkPoint3 location_; @@ -550,6 +627,17 @@ const CropRect* crop_rect = nullptr); ~LightingSpotPaintFilter() override; + LightingType lighting_type() const { return lighting_type_; } + const SkPoint3& location() const { return location_; } + const SkPoint3& target() const { return target_; } + SkScalar specular_exponent() const { return specular_exponent_; } + SkScalar cutoff_angle() const { return cutoff_angle_; } + SkColor light_color() const { return light_color_; } + SkScalar surface_scale() const { return surface_scale_; } + SkScalar kconstant() const { return kconstant_; } + SkScalar shininess() const { return shininess_; } + const sk_sp<PaintFilter>& input() const { return input_; } + private: LightingType lighting_type_; SkPoint3 location_;
diff --git a/cc/paint/paint_op_buffer.cc b/cc/paint/paint_op_buffer.cc index d953ccf..be31f65 100644 --- a/cc/paint/paint_op_buffer.cc +++ b/cc/paint/paint_op_buffer.cc
@@ -19,6 +19,16 @@ #include "third_party/skia/include/core/SkSerialProcs.h" namespace cc { +namespace { +DrawImage CreateDrawImage(const PaintImage& image, + const PaintFlags* flags, + const SkMatrix& matrix) { + return DrawImage(image, SkIRect::MakeWH(image.width(), image.height()), + flags ? flags->getFilterQuality() : kLow_SkFilterQuality, + matrix); +} +} // namespace + #define TYPES(M) \ M(AnnotateOp) \ M(ClipPathOp) \ @@ -277,7 +287,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const AnnotateOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); helper.Write(op->annotation_type); helper.Write(op->rect); helper.Write(op->data); @@ -289,7 +300,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const ClipPathOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); helper.Write(op->path); helper.Write(op->op); helper.Write(op->antialias); @@ -329,7 +341,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const DrawDRRectOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -343,13 +356,16 @@ void* memory, size_t size, const SerializeOptions& options) { + DCHECK(options.canvas); auto* op = static_cast<const DrawImageOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; helper.Write(*serialized_flags); - helper.Write(op->image, options.image_provider); + helper.Write(CreateDrawImage(op->image, serialized_flags, + options.canvas->getTotalMatrix())); helper.AlignMemory(alignof(SkScalar)); helper.Write(op->left); helper.Write(op->top); @@ -360,13 +376,16 @@ void* memory, size_t size, const SerializeOptions& options) { + DCHECK(options.canvas); auto* op = static_cast<const DrawImageRectOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; helper.Write(*serialized_flags); - helper.Write(op->image, options.image_provider); + helper.Write(CreateDrawImage(op->image, serialized_flags, + options.canvas->getTotalMatrix())); helper.Write(op->src); helper.Write(op->dst); helper.Write(op->constraint); @@ -378,7 +397,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const DrawIRectOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -392,7 +412,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const DrawLineOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -410,7 +431,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const DrawOvalOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -424,7 +446,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const DrawPathOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -448,7 +471,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const DrawRectOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -462,7 +486,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const DrawRRectOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -476,7 +501,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const DrawTextBlobOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -484,7 +510,7 @@ helper.AlignMemory(alignof(SkScalar)); helper.Write(op->x); helper.Write(op->y); - helper.Write(op->blob, options.transfer_cache); + helper.Write(op->blob); return helper.size(); } @@ -521,7 +547,8 @@ size_t size, const SerializeOptions& options) { auto* op = static_cast<const SaveLayerOp*>(base_op); - PaintOpWriter helper(memory, size); + PaintOpWriter helper(memory, size, options.transfer_cache, + options.image_provider); const auto* serialized_flags = options.flags_to_serialize; if (!serialized_flags) serialized_flags = &op->flags; @@ -595,7 +622,7 @@ DCHECK_GE(output_size, sizeof(AnnotateOp)); AnnotateOp* op = new (output) AnnotateOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->annotation_type); helper.Read(&op->rect); helper.Read(&op->data); @@ -616,7 +643,7 @@ DCHECK_GE(output_size, sizeof(ClipPathOp)); ClipPathOp* op = new (output) ClipPathOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->path); helper.Read(&op->op); helper.Read(&op->antialias); @@ -677,7 +704,7 @@ DCHECK_GE(output_size, sizeof(DrawDRRectOp)); DrawDRRectOp* op = new (output) DrawDRRectOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->outer); helper.Read(&op->inner); @@ -697,7 +724,7 @@ DCHECK_GE(output_size, sizeof(DrawImageOp)); DrawImageOp* op = new (output) DrawImageOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->image); helper.AlignMemory(alignof(SkScalar)); @@ -719,7 +746,7 @@ DCHECK_GE(output_size, sizeof(DrawImageRectOp)); DrawImageRectOp* op = new (output) DrawImageRectOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->image); helper.Read(&op->src); @@ -741,7 +768,7 @@ DCHECK_GE(output_size, sizeof(DrawIRectOp)); DrawIRectOp* op = new (output) DrawIRectOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->rect); if (!helper.valid() || !op->IsValid()) { @@ -760,7 +787,7 @@ DCHECK_GE(output_size, sizeof(DrawLineOp)); DrawLineOp* op = new (output) DrawLineOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.AlignMemory(alignof(SkScalar)); helper.Read(&op->x0); @@ -783,7 +810,7 @@ DCHECK_GE(output_size, sizeof(DrawOvalOp)); DrawOvalOp* op = new (output) DrawOvalOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->oval); if (!helper.valid() || !op->IsValid()) { @@ -802,7 +829,7 @@ DCHECK_GE(output_size, sizeof(DrawPathOp)); DrawPathOp* op = new (output) DrawPathOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->path); if (!helper.valid() || !op->IsValid()) { @@ -831,7 +858,7 @@ DCHECK_GE(output_size, sizeof(DrawRectOp)); DrawRectOp* op = new (output) DrawRectOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->rect); if (!helper.valid() || !op->IsValid()) { @@ -850,7 +877,7 @@ DCHECK_GE(output_size, sizeof(DrawRRectOp)); DrawRRectOp* op = new (output) DrawRRectOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->rrect); if (!helper.valid() || !op->IsValid()) { @@ -869,12 +896,12 @@ DCHECK_GE(output_size, sizeof(DrawTextBlobOp)); DrawTextBlobOp* op = new (output) DrawTextBlobOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.AlignMemory(alignof(SkScalar)); helper.Read(&op->x); helper.Read(&op->y); - helper.Read(&op->blob, options.transfer_cache); + helper.Read(&op->blob); if (!helper.valid() || !op->IsValid()) { op->~DrawTextBlobOp(); return nullptr; @@ -927,7 +954,7 @@ DCHECK_GE(output_size, sizeof(SaveLayerOp)); SaveLayerOp* op = new (output) SaveLayerOp; - PaintOpReader helper(input, input_size); + PaintOpReader helper(input, input_size, options.transfer_cache); helper.Read(&op->flags); helper.Read(&op->bounds); if (!helper.valid() || !op->IsValid()) {
diff --git a/cc/paint/paint_op_buffer_eq_fuzzer.cc b/cc/paint/paint_op_buffer_eq_fuzzer.cc index 49e6228c..e2e9f2a 100644 --- a/cc/paint/paint_op_buffer_eq_fuzzer.cc +++ b/cc/paint/paint_op_buffer_eq_fuzzer.cc
@@ -65,17 +65,23 @@ if (!deserialized_op1) return 0; - // TODO(enne): Text blobs sometimes are "valid" but null, which is an - // interim state as text blob serialization has not been completed. - // It needs to be valid in practice (so that web pages don't crash) but - // should be invalid for the fuzzer (as this cannot reserialize). - // See also: TODO in PaintOpReader::Read(scoped_refptr<PaintTextBlob>*) + // DrawTextBlob ops contain two pieces of information: a text blob, and a + // vector of typefaces that are used in the blob. However, during + // deserialization we never need to reconstruct the vector of typefaces, since + // it is only used to reconstruct the blob directly. This, however, poses a + // problem for this fuzzer since we will then try to serialize the op again, + // resulting in an assert. The assert says that we don't have typefaces + // (serialized from the vector) that are required to serialize the text blob. + // The solution is to skip the equality fuzzer for DrawTextBlob ops. + // + // Normally the initial deserialization would also fail and we would early out + // above, since the transfer cache doesn't have any entries to reconstruct the + // text blob. However, Skia, given some data, seems to be able to construct an + // SkTextBlob without accessing the given cataloger. See crbug.com/798939 for + // an example of such a test case. if (deserialized_op1->GetType() == cc::PaintOpType::DrawTextBlob) { - auto* draw_text_op = static_cast<cc::DrawTextBlobOp*>(deserialized_op1); - if (!draw_text_op->blob->ToSkTextBlob()) { - deserialized_op1->DestroyThis(); - return 0; - } + deserialized_op1->DestroyThis(); + return 0; } // If we get to this point, then the op should be ok to serialize/deserialize
diff --git a/cc/paint/paint_op_buffer_serializer.cc b/cc/paint/paint_op_buffer_serializer.cc index 8bd2605..2cf35ee 100644 --- a/cc/paint/paint_op_buffer_serializer.cc +++ b/cc/paint/paint_op_buffer_serializer.cc
@@ -42,15 +42,26 @@ void PaintOpBufferSerializer::Serialize(const PaintOpBuffer* buffer, const std::vector<size_t>* offsets, const Preamble& preamble) { + // Reset the canvas to the maximum extents of our playback rect, ensuring this + // rect will not be clipped. + canvas_.resetCanvas(preamble.playback_rect.right(), + preamble.playback_rect.bottom()); + DCHECK(canvas_.getTotalMatrix().isIdentity()); + static const int kInitialSaveCount = 1; + DCHECK_EQ(kInitialSaveCount, canvas_.getSaveCount()); + + // These SerializeOptions and PlaybackParams use the initial (identity) canvas + // matrix, as they are only used for serializing the preamble and the initial + // save / final restore. SerializeBuffer will create its own SerializeOptions + // and PlaybackParams based on the post-preamble canvas. PaintOp::SerializeOptions options(image_provider_, transfer_cache_, &canvas_, canvas_.getTotalMatrix()); PlaybackParams params(image_provider_, canvas_.getTotalMatrix()); - int save_count = canvas_.getSaveCount(); Save(options, params); SerializePreamble(preamble, options, params); SerializeBuffer(buffer, offsets); - RestoreToCount(save_count, options, params); + RestoreToCount(kInitialSaveCount, options, params); } void PaintOpBufferSerializer::SerializePreamble(
diff --git a/cc/paint/paint_op_buffer_unittest.cc b/cc/paint/paint_op_buffer_unittest.cc index 81246ab..2eac177 100644 --- a/cc/paint/paint_op_buffer_unittest.cc +++ b/cc/paint/paint_op_buffer_unittest.cc
@@ -74,6 +74,55 @@ } }; +class TestOptionsProvider { + public: + TestOptionsProvider() { + serialize_options_.canvas = &canvas_; + serialize_options_.image_provider = &image_provider_; + serialize_options_.transfer_cache = &transfer_cache_helper_; + deserialize_options_.transfer_cache = &transfer_cache_helper_; + } + + const PaintOp::SerializeOptions& serialize_options() const { + return serialize_options_; + } + PaintOp::SerializeOptions& mutable_serialize_options() { + return serialize_options_; + } + const PaintOp::DeserializeOptions deserialize_options() const { + return deserialize_options_; + } + PaintOp::DeserializeOptions mutable_deserialize_options() { + return deserialize_options_; + } + ImageProvider* image_provider() { return &image_provider_; } + TransferCacheTestHelper* transfer_cache_helper() { + return &transfer_cache_helper_; + } + + private: + class NoOpImageProvider : public ImageProvider { + public: + ~NoOpImageProvider() override = default; + + ScopedDecodedDrawImage GetDecodedDrawImage( + const DrawImage& draw_image) override { + SkBitmap bitmap; + bitmap.allocPixelsFlags(SkImageInfo::MakeN32Premul(10, 10), + SkBitmap::kZeroPixels_AllocFlag); + sk_sp<SkImage> image = SkImage::MakeFromBitmap(bitmap); + return ScopedDecodedDrawImage(DecodedDrawImage( + image, SkSize::Make(0, 0), SkSize::Make(1, 1), kLow_SkFilterQuality)); + } + }; + + PaintOp::SerializeOptions serialize_options_; + PaintOp::DeserializeOptions deserialize_options_; + NoOpImageProvider image_provider_; + MockCanvas canvas_; + TransferCacheTestHelper transfer_cache_helper_; +}; + TEST(PaintOpBufferTest, Empty) { PaintOpBuffer buffer; EXPECT_EQ(buffer.size(), 0u); @@ -1218,12 +1267,10 @@ for (size_t i = 0; i < buffer.size(); ++i) bytes_written_[i] = 0; - PaintOp::SerializeOptions options; - options.transfer_cache = &transfer_cache_helper_; - size_t op_idx = 0; for (const auto* op : PaintOpBuffer::Iterator(&buffer)) { - size_t bytes_written = op->Serialize(current_, remaining_, options); + size_t bytes_written = op->Serialize( + current_, remaining_, options_provider_.serialize_options()); if (!bytes_written) return; @@ -1245,14 +1292,14 @@ const std::vector<size_t>& bytes_written() const { return bytes_written_; } size_t TotalBytesWritten() const { return output_size_ - remaining_; } - TransferCacheTestHelper* transfer_cache() { return &transfer_cache_helper_; } + TestOptionsProvider* options_provider() { return &options_provider_; } private: char* current_ = nullptr; size_t output_size_ = 0u; size_t remaining_ = 0u; std::vector<size_t> bytes_written_; - TransferCacheTestHelper transfer_cache_helper_; + TestOptionsProvider options_provider_; }; class DeserializerIterator { @@ -1700,9 +1747,9 @@ PaintOpBuffer::Iterator iter(&buffer_); size_t i = 0; - for (auto* base_written : - DeserializerIterator(output_.get(), serializer.TotalBytesWritten(), - serializer.transfer_cache())) { + for (auto* base_written : DeserializerIterator( + output_.get(), serializer.TotalBytesWritten(), + serializer.options_provider()->transfer_cache_helper())) { SCOPED_TRACE(base::StringPrintf( "%s #%zu", PaintOpTypeToString(GetParamType()).c_str(), i)); ASSERT_EQ(!*iter, !base_written); @@ -1728,8 +1775,7 @@ serializer.Serialize(buffer_); std::vector<size_t> bytes_written = serializer.bytes_written(); - PaintOp::SerializeOptions options; - options.transfer_cache = serializer.transfer_cache(); + TestOptionsProvider options_provider; size_t op_idx = 0; for (PaintOpBuffer::Iterator iter(&buffer_); iter; ++iter, ++op_idx) { @@ -1741,7 +1787,8 @@ // Attempt to write op into a buffer of size |i|, and only expect // it to succeed if the buffer is large enough. for (size_t i = 0; i < bytes_written[op_idx] + 2; ++i) { - size_t written_bytes = iter->Serialize(output_.get(), i, options); + size_t written_bytes = iter->Serialize( + output_.get(), i, options_provider.serialize_options()); if (i >= expected_bytes) { EXPECT_EQ(expected_bytes, written_bytes) << "i: " << i; } else { @@ -1763,6 +1810,7 @@ SimpleSerializer serializer(output_.get(), output_size_); serializer.Serialize(buffer_); + TestOptionsProvider* options_provider = serializer.options_provider(); char* first = static_cast<char*>(output_.get()); char* current = first; @@ -1771,8 +1819,6 @@ static constexpr size_t kOutputOpSize = kBufferBytesPerOp; std::unique_ptr<char, base::AlignedFreeDeleter> deserialize_buffer_( static_cast<char*>(base::AlignedAlloc(kOutputOpSize, kAlign))); - PaintOp::DeserializeOptions deserialize_options; - deserialize_options.transfer_cache = serializer.transfer_cache(); size_t op_idx = 0; size_t total_read = 0; @@ -1794,15 +1840,16 @@ // properly when presented with invalid offsets. serialized->skip = read_size; size_t bytes_read = 0; - PaintOp* written = - PaintOp::Deserialize(current, read_size, deserialize_buffer_.get(), - kOutputOpSize, &bytes_read, deserialize_options); + PaintOp* written = PaintOp::Deserialize( + current, read_size, deserialize_buffer_.get(), kOutputOpSize, + &bytes_read, options_provider->deserialize_options()); // Deserialize buffers with valid ops until the last op. This verifies // that the complete buffer is invalidated on encountering the first // corrupted op. auto deserialized_buffer = PaintOpBuffer::MakeFromMemory( - first, total_read + read_size, deserialize_options); + first, total_read + read_size, + options_provider->deserialize_options()); // Skips are only valid if they are aligned. if (read_size >= skip && read_size % kAlign == 0) { @@ -1842,24 +1889,21 @@ PushTestOps(GetParamType()); ResizeOutputBuffer(); - TransferCacheTestHelper transfer_cache_helper; - PaintOp::SerializeOptions options; - options.transfer_cache = &transfer_cache_helper; - PaintOp::DeserializeOptions deserialize_options; - deserialize_options.transfer_cache = &transfer_cache_helper; + TestOptionsProvider options_provider; size_t deserialized_size = sizeof(LargestPaintOp) + PaintOp::kMaxSkip; std::unique_ptr<char, base::AlignedFreeDeleter> deserialized( static_cast<char*>( base::AlignedAlloc(deserialized_size, PaintOpBuffer::PaintOpAlign))); for (const auto* op : PaintOpBuffer::Iterator(&buffer_)) { - options.flags_to_serialize = + options_provider.mutable_serialize_options().flags_to_serialize = &static_cast<const PaintOpWithFlags*>(op)->flags; - size_t bytes_written = op->Serialize(output_.get(), output_size_, options); + size_t bytes_written = op->Serialize(output_.get(), output_size_, + options_provider.serialize_options()); size_t bytes_read = 0u; PaintOp* written = PaintOp::Deserialize( output_.get(), bytes_written, deserialized.get(), deserialized_size, - &bytes_read, deserialize_options); + &bytes_read, options_provider.deserialize_options()); ASSERT_TRUE(written); EXPECT_EQ(*op, *written); written->DestroyThis(); @@ -1867,11 +1911,13 @@ PaintFlags override_flags = static_cast<const PaintOpWithFlags*>(op)->flags; override_flags.setAlpha(override_flags.getAlpha() * 0.5); - options.flags_to_serialize = &override_flags; - bytes_written = op->Serialize(output_.get(), output_size_, options); - written = PaintOp::Deserialize(output_.get(), bytes_written, - deserialized.get(), deserialized_size, - &bytes_read, deserialize_options); + options_provider.mutable_serialize_options().flags_to_serialize = + &override_flags; + bytes_written = op->Serialize(output_.get(), output_size_, + options_provider.serialize_options()); + written = PaintOp::Deserialize( + output_.get(), bytes_written, deserialized.get(), deserialized_size, + &bytes_read, options_provider.deserialize_options()); ASSERT_TRUE(written); ASSERT_TRUE(written->IsPaintOpWithFlags()); EXPECT_EQ(static_cast<const PaintOpWithFlags*>(written)->flags.getAlpha(), @@ -1891,17 +1937,17 @@ std::unique_ptr<char, base::AlignedFreeDeleter> memory( static_cast<char*>(base::AlignedAlloc(PaintOpBuffer::kInitialBufferSize, PaintOpBuffer::PaintOpAlign))); - TransferCacheTestHelper transfer_cache_helper; + TestOptionsProvider options_proivder; SimpleBufferSerializer serializer(memory.get(), - PaintOpBuffer::kInitialBufferSize, nullptr, - &transfer_cache_helper); + PaintOpBuffer::kInitialBufferSize, + options_proivder.image_provider(), + options_proivder.transfer_cache_helper()); serializer.Serialize(&buffer, nullptr, preamble); ASSERT_NE(serializer.written(), 0u); - PaintOp::DeserializeOptions deserialized_options; - deserialized_options.transfer_cache = &transfer_cache_helper; - auto deserialized_buffer = PaintOpBuffer::MakeFromMemory( - memory.get(), serializer.written(), deserialized_options); + auto deserialized_buffer = + PaintOpBuffer::MakeFromMemory(memory.get(), serializer.written(), + options_proivder.deserialize_options()); ASSERT_TRUE(deserialized_buffer); // The deserialized buffer has an extra pair of save/restores, for the @@ -1959,17 +2005,17 @@ std::unique_ptr<char, base::AlignedFreeDeleter> memory( static_cast<char*>(base::AlignedAlloc(PaintOpBuffer::kInitialBufferSize, PaintOpBuffer::PaintOpAlign))); - TransferCacheTestHelper transfer_cache_helper; + TestOptionsProvider options_provider; SimpleBufferSerializer serializer(memory.get(), - PaintOpBuffer::kInitialBufferSize, nullptr, - &transfer_cache_helper); + PaintOpBuffer::kInitialBufferSize, + options_provider.image_provider(), + options_provider.transfer_cache_helper()); serializer.Serialize(&buffer, nullptr, preamble); ASSERT_NE(serializer.written(), 0u); - PaintOp::DeserializeOptions deserialized_options; - deserialized_options.transfer_cache = &transfer_cache_helper; - auto deserialized_buffer = PaintOpBuffer::MakeFromMemory( - memory.get(), serializer.written(), deserialized_options); + auto deserialized_buffer = + PaintOpBuffer::MakeFromMemory(memory.get(), serializer.written(), + options_provider.deserialize_options()); ASSERT_TRUE(deserialized_buffer); // 4 ops for the preamble and 2 for save/restore. ASSERT_EQ(deserialized_buffer->size(), buffer.size() + 6u); @@ -2046,18 +2092,18 @@ std::unique_ptr<char, base::AlignedFreeDeleter> memory( static_cast<char*>(base::AlignedAlloc(PaintOpBuffer::kInitialBufferSize, PaintOpBuffer::PaintOpAlign))); - TransferCacheTestHelper transfer_cache_helper; + TestOptionsProvider options_provider; SimpleBufferSerializer serializer(memory.get(), - PaintOpBuffer::kInitialBufferSize, nullptr, - &transfer_cache_helper); + PaintOpBuffer::kInitialBufferSize, + options_provider.image_provider(), + options_provider.transfer_cache_helper()); PaintOpBufferSerializer::Preamble preamble; serializer.Serialize(&buffer, nullptr, preamble); ASSERT_NE(serializer.written(), 0u); - PaintOp::DeserializeOptions deserialized_options; - deserialized_options.transfer_cache = &transfer_cache_helper; - auto deserialized_buffer = PaintOpBuffer::MakeFromMemory( - memory.get(), serializer.written(), deserialized_options); + auto deserialized_buffer = + PaintOpBuffer::MakeFromMemory(memory.get(), serializer.written(), + options_provider.deserialize_options()); ASSERT_TRUE(deserialized_buffer); ASSERT_EQ(deserialized_buffer->size(), record->size() + 4u); @@ -2088,62 +2134,61 @@ } TEST(PaintOpBufferTest, ClipsImagesDuringSerialization) { - PaintOpBuffer buffer; - buffer.push<ClipRectOp>(SkRect::MakeWH(100.f, 100.f), SkClipOp::kIntersect, - false); - buffer.push<DrawImageOp>(CreateDiscardablePaintImage(gfx::Size(10, 10)), 0.f, - 0.f, nullptr); - buffer.push<DrawImageOp>(CreateDiscardablePaintImage(gfx::Size(10, 10)), - 200.f, 200.f, nullptr); + struct { + gfx::Rect clip_rect; + gfx::Rect image_rect; + bool should_draw; + } test_cases[] = { + {gfx::Rect(0, 0, 100, 100), gfx::Rect(50, 50, 100, 100), true}, + {gfx::Rect(0, 0, 100, 100), gfx::Rect(105, 105, 100, 100), false}, + {gfx::Rect(0, 0, 500, 500), gfx::Rect(450, 450, 100, 100), true}, + {gfx::Rect(0, 0, 500, 500), gfx::Rect(750, 750, 100, 100), false}, + {gfx::Rect(250, 250, 250, 250), gfx::Rect(450, 450, 100, 100), true}, + {gfx::Rect(250, 250, 250, 250), gfx::Rect(50, 50, 100, 100), false}, + {gfx::Rect(0, 0, 100, 500), gfx::Rect(250, 250, 100, 100), false}, + {gfx::Rect(0, 0, 200, 500), gfx::Rect(100, 250, 100, 100), true}}; - std::unique_ptr<char, base::AlignedFreeDeleter> memory( - static_cast<char*>(base::AlignedAlloc(PaintOpBuffer::kInitialBufferSize, - PaintOpBuffer::PaintOpAlign))); - TransferCacheTestHelper transfer_cache_helper; - SimpleBufferSerializer serializer(memory.get(), - PaintOpBuffer::kInitialBufferSize, nullptr, - &transfer_cache_helper); - PaintOpBufferSerializer::Preamble preamble; - serializer.Serialize(&buffer, nullptr, preamble); - ASSERT_NE(serializer.written(), 0u); + for (const auto& test_case : test_cases) { + PaintOpBuffer buffer; + buffer.push<DrawImageOp>( + CreateDiscardablePaintImage(test_case.image_rect.size()), + static_cast<SkScalar>(test_case.image_rect.x()), + static_cast<SkScalar>(test_case.image_rect.y()), nullptr); - PaintOp::DeserializeOptions deserialized_options; - deserialized_options.transfer_cache = &transfer_cache_helper; - auto deserialized_buffer = PaintOpBuffer::MakeFromMemory( - memory.get(), serializer.written(), deserialized_options); - ASSERT_TRUE(deserialized_buffer); - ASSERT_EQ(deserialized_buffer->size(), buffer.size() + 1); + std::unique_ptr<char, base::AlignedFreeDeleter> memory( + static_cast<char*>(base::AlignedAlloc(PaintOpBuffer::kInitialBufferSize, + PaintOpBuffer::PaintOpAlign))); + TestOptionsProvider options_provider; + SimpleBufferSerializer serializer(memory.get(), + PaintOpBuffer::kInitialBufferSize, + options_provider.image_provider(), + options_provider.transfer_cache_helper()); + PaintOpBufferSerializer::Preamble preamble; + preamble.playback_rect = test_case.clip_rect; + serializer.Serialize(&buffer, nullptr, preamble); + ASSERT_NE(serializer.written(), 0u); - int i = 0; - auto serialized_iter = PaintOpBuffer::Iterator(&buffer); - for (const auto* op : PaintOpBuffer::Iterator(deserialized_buffer.get())) { - i++; - if (i == 1) { - // First save. - ASSERT_EQ(op->GetType(), PaintOpType::Save) - << PaintOpTypeToString(op->GetType()); - continue; + auto deserialized_buffer = + PaintOpBuffer::MakeFromMemory(memory.get(), serializer.written(), + options_provider.deserialize_options()); + ASSERT_TRUE(deserialized_buffer); + + auto deserialized_iter = PaintOpBuffer::Iterator(deserialized_buffer.get()); + ASSERT_EQ((*deserialized_iter)->GetType(), PaintOpType::Save) + << PaintOpTypeToString((*deserialized_iter)->GetType()); + ++deserialized_iter; + ASSERT_EQ((*deserialized_iter)->GetType(), PaintOpType::ClipRect) + << PaintOpTypeToString((*deserialized_iter)->GetType()); + ++deserialized_iter; + if (test_case.should_draw) { + ASSERT_EQ((*deserialized_iter)->GetType(), PaintOpType::DrawImage) + << PaintOpTypeToString((*deserialized_iter)->GetType()); + ++deserialized_iter; } - - if (i < 4) { - // Root buffer. - ASSERT_EQ(op->GetType(), (*serialized_iter)->GetType()) - << PaintOpTypeToString(op->GetType()); - EXPECT_EQ(*op, **serialized_iter); - ++serialized_iter; - continue; - } - - if (i == 4) { - // The second image should be skipped. - ASSERT_TRUE(serialized_iter); - ASSERT_EQ((*serialized_iter)->GetType(), PaintOpType::DrawImage) - << PaintOpTypeToString(op->GetType()); - } - - // End restores. - ASSERT_EQ(op->GetType(), PaintOpType::Restore) - << PaintOpTypeToString(op->GetType()); + ASSERT_EQ((*deserialized_iter)->GetType(), PaintOpType::Restore) + << PaintOpTypeToString((*deserialized_iter)->GetType()); + ++deserialized_iter; + ASSERT_EQ(deserialized_iter.end(), deserialized_iter); } } @@ -2166,17 +2211,17 @@ std::unique_ptr<char, base::AlignedFreeDeleter> memory( static_cast<char*>(base::AlignedAlloc(PaintOpBuffer::kInitialBufferSize, PaintOpBuffer::PaintOpAlign))); - TransferCacheTestHelper transfer_cache_helper; + TestOptionsProvider options_provider; SimpleBufferSerializer serializer(memory.get(), - PaintOpBuffer::kInitialBufferSize, nullptr, - &transfer_cache_helper); + PaintOpBuffer::kInitialBufferSize, + options_provider.image_provider(), + options_provider.transfer_cache_helper()); serializer.Serialize(&buffer, nullptr, preamble); ASSERT_NE(serializer.written(), 0u); - PaintOp::DeserializeOptions deserialized_options; - deserialized_options.transfer_cache = &transfer_cache_helper; - auto deserialized_buffer = PaintOpBuffer::MakeFromMemory( - memory.get(), serializer.written(), deserialized_options); + auto deserialized_buffer = + PaintOpBuffer::MakeFromMemory(memory.get(), serializer.written(), + options_provider.deserialize_options()); ASSERT_TRUE(deserialized_buffer); // 3 additional ops for save, clip and restore. @@ -2217,7 +2262,6 @@ static_cast<char*>(base::AlignedAlloc(kSize, kAlign))); std::unique_ptr<char, base::AlignedFreeDeleter> output_( static_cast<char*>(base::AlignedAlloc(kSize, kAlign))); - PaintOp::DeserializeOptions deserialize_options; PaintOpBuffer buffer; buffer.push<DrawColorOp>(SK_ColorMAGENTA, SkBlendMode::kSrc); @@ -2226,15 +2270,16 @@ PaintOp* op = *iter; ASSERT_TRUE(op); - PaintOp::SerializeOptions serialize_options; - size_t bytes_written = op->Serialize(input_.get(), kSize, serialize_options); + TestOptionsProvider options_provider; + size_t bytes_written = + op->Serialize(input_.get(), kSize, options_provider.serialize_options()); ASSERT_GT(bytes_written, 0u); // can deserialize from exactly the right size size_t bytes_read = 0; PaintOp* success = PaintOp::Deserialize(input_.get(), bytes_written, output_.get(), kSize, - &bytes_read, deserialize_options); + &bytes_read, options_provider.deserialize_options()); ASSERT_TRUE(success); EXPECT_EQ(bytes_written, bytes_read); success->DestroyThis(); @@ -2243,20 +2288,23 @@ // (the DeserializationFailures test above tests if the skip is lying) for (size_t i = 0; i < bytes_written - 1; ++i) EXPECT_FALSE(PaintOp::Deserialize(input_.get(), i, output_.get(), kSize, - &bytes_read, deserialize_options)); + &bytes_read, + options_provider.deserialize_options())); // unaligned skips fail to deserialize PaintOp* serialized = reinterpret_cast<PaintOp*>(input_.get()); EXPECT_EQ(0u, serialized->skip % kAlign); serialized->skip -= 1; EXPECT_FALSE(PaintOp::Deserialize(input_.get(), bytes_written, output_.get(), - kSize, &bytes_read, deserialize_options)); + kSize, &bytes_read, + options_provider.deserialize_options())); serialized->skip += 1; // bogus types fail to deserialize serialized->type = static_cast<uint8_t>(PaintOpType::LastPaintOpType) + 1; EXPECT_FALSE(PaintOp::Deserialize(input_.get(), bytes_written, output_.get(), - kSize, &bytes_read, deserialize_options)); + kSize, &bytes_read, + options_provider.deserialize_options())); } // Test that deserializing invalid SkClipOp enums fails silently. @@ -2287,19 +2335,18 @@ SkClipOp bad_clip_max = static_cast<SkClipOp>(~static_cast<uint32_t>(0)); buffer.push<ClipRectOp>(test_rects[1], bad_clip_max, false); - PaintOp::SerializeOptions serialize_options; - PaintOp::DeserializeOptions deserialize_options; + TestOptionsProvider options_provider; int op_idx = 0; for (PaintOpBuffer::Iterator iter(&buffer); iter; ++iter) { const PaintOp* op = *iter; - size_t bytes_written = - op->Serialize(serialized.get(), buffer_size, serialize_options); + size_t bytes_written = op->Serialize(serialized.get(), buffer_size, + options_provider.serialize_options()); ASSERT_GT(bytes_written, 0u); size_t bytes_read = 0; - PaintOp* written = PaintOp::Deserialize(serialized.get(), bytes_written, - deserialized.get(), buffer_size, - &bytes_read, deserialize_options); + PaintOp* written = PaintOp::Deserialize( + serialized.get(), bytes_written, deserialized.get(), buffer_size, + &bytes_read, options_provider.deserialize_options()); // First op should succeed. Other ops with bad enums should // serialize correctly but fail to deserialize due to the bad // SkClipOp enum. @@ -2368,19 +2415,18 @@ buffer.push<DrawRectOp>(test_rects[i % test_rects.size()], flags); } - PaintOp::SerializeOptions serialize_options; - PaintOp::DeserializeOptions deserialize_options; + TestOptionsProvider options_provider; int op_idx = 0; for (PaintOpBuffer::Iterator iter(&buffer); iter; ++iter) { const PaintOp* op = *iter; - size_t bytes_written = - op->Serialize(serialized.get(), buffer_size, serialize_options); + size_t bytes_written = op->Serialize(serialized.get(), buffer_size, + options_provider.serialize_options()); ASSERT_GT(bytes_written, 0u); size_t bytes_read = 0; - PaintOp* written = PaintOp::Deserialize(serialized.get(), bytes_written, - deserialized.get(), buffer_size, - &bytes_read, deserialize_options); + PaintOp* written = PaintOp::Deserialize( + serialized.get(), bytes_written, deserialized.get(), buffer_size, + &bytes_read, options_provider.deserialize_options()); // First two ops should succeed. Other ops with bad enums should // serialize correctly but fail to deserialize due to the bad // SkBlendMode enum. @@ -2424,20 +2470,19 @@ buffer.push<SaveLayerOp>(&bad_rect, &test_flags[0]); buffer.push<SaveLayerAlphaOp>(&bad_rect, test_uint8s[0], true); - PaintOp::SerializeOptions serialize_options; - PaintOp::DeserializeOptions deserialize_options; + TestOptionsProvider options_provider; // Every op should serialize but fail to deserialize due to the bad rect. int op_idx = 0; for (PaintOpBuffer::Iterator iter(&buffer); iter; ++iter) { const PaintOp* op = *iter; - size_t bytes_written = - op->Serialize(serialized.get(), buffer_size, serialize_options); + size_t bytes_written = op->Serialize(serialized.get(), buffer_size, + options_provider.serialize_options()); ASSERT_GT(bytes_written, 0u); size_t bytes_read = 0; - PaintOp* written = PaintOp::Deserialize(serialized.get(), bytes_written, - deserialized.get(), buffer_size, - &bytes_read, deserialize_options); + PaintOp* written = PaintOp::Deserialize( + serialized.get(), bytes_written, deserialized.get(), buffer_size, + &bytes_read, options_provider.deserialize_options()); EXPECT_FALSE(written) << "op: " << op_idx; ++op_idx; } @@ -2602,7 +2647,8 @@ return ScopedDecodedDrawImage(); SkBitmap bitmap; - bitmap.allocN32Pixels(10, 10); + bitmap.allocPixelsFlags(SkImageInfo::MakeN32Premul(10, 10), + SkBitmap::kZeroPixels_AllocFlag); sk_sp<SkImage> image = SkImage::MakeFromBitmap(bitmap); size_t i = index_++; return ScopedDecodedDrawImage(
diff --git a/cc/paint/paint_op_reader.cc b/cc/paint/paint_op_reader.cc index 9ae2b1c..f2ec7be 100644 --- a/cc/paint/paint_op_reader.cc +++ b/cc/paint/paint_op_reader.cc
@@ -7,7 +7,9 @@ #include <stddef.h> #include <algorithm> +#include "cc/paint/image_transfer_cache_entry.h" #include "cc/paint/paint_flags.h" +#include "cc/paint/paint_image_builder.h" #include "cc/paint/paint_op_buffer.h" #include "cc/paint/paint_shader.h" #include "cc/paint/paint_typeface_transfer_cache_entry.h" @@ -22,6 +24,7 @@ // If we have more than this many colors, abort deserialization. const size_t kMaxShaderColorsSupported = 10000; +const size_t kMaxMergeFilterCount = 10000; struct TypefacesCatalog { TransferCacheDeserializeHelper* transfer_cache; @@ -233,11 +236,26 @@ AlignMemory(4); ReadFlattenable(&flags->draw_looper_); + Read(&flags->image_filter_); Read(&flags->shader_); } void PaintOpReader::Read(PaintImage* image) { - // TODO(enne): implement PaintImage serialization: http://crbug.com/737629 + uint32_t transfer_cache_entry_id; + ReadSimple(&transfer_cache_entry_id); + + // If we encountered a decode failure, we may write an invalid id for the + // image. In these cases, just return, leaving the image as nullptr. + if (transfer_cache_entry_id == kInvalidImageTransferCacheEntryId) + return; + + if (auto* entry = transfer_cache_->GetEntryAs<ServiceImageTransferCacheEntry>( + transfer_cache_entry_id)) { + *image = PaintImageBuilder::WithDefault() + .set_id(PaintImage::GetNextId()) + .set_image(entry->image()) + .TakePaintImage(); + } } void PaintOpReader::Read(sk_sp<SkData>* data) { @@ -264,8 +282,7 @@ remaining_bytes_ -= bytes; } -void PaintOpReader::Read(scoped_refptr<PaintTextBlob>* paint_blob, - TransferCacheDeserializeHelper* transfer_cache) { +void PaintOpReader::Read(scoped_refptr<PaintTextBlob>* paint_blob) { sk_sp<SkData> data; Read(&data); if (!data || !valid_) { @@ -281,7 +298,7 @@ } TypefacesCatalog catalog; - catalog.transfer_cache = transfer_cache; + catalog.transfer_cache = transfer_cache_; sk_sp<SkTextBlob> blob = SkTextBlob::Deserialize(data->data(), data->size(), &ResolveTypeface, &catalog); // TODO(vmpstr): If we couldn't serialize |blob|, we should make |paint_blob| @@ -439,4 +456,517 @@ return extracted_memory; } +void PaintOpReader::Read(sk_sp<PaintFilter>* filter) { + uint32_t type_int = 0; + ReadSimple(&type_int); + if (type_int > static_cast<uint32_t>(PaintFilter::Type::kMaxFilterType)) + SetInvalid(); + if (!valid_) + return; + + auto type = static_cast<PaintFilter::Type>(type_int); + if (type == PaintFilter::Type::kNullFilter) { + *filter = nullptr; + return; + } + + uint32_t has_crop_rect = 0; + base::Optional<PaintFilter::CropRect> crop_rect; + ReadSimple(&has_crop_rect); + if (has_crop_rect) { + uint32_t flags = 0; + SkRect rect = SkRect::MakeEmpty(); + ReadSimple(&flags); + ReadSimple(&rect); + crop_rect.emplace(rect, flags); + } + + switch (type) { + case PaintFilter::Type::kNullFilter: + NOTREACHED(); + break; + case PaintFilter::Type::kColorFilter: + ReadColorFilterPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kBlur: + ReadBlurPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kDropShadow: + ReadDropShadowPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kMagnifier: + ReadMagnifierPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kCompose: + ReadComposePaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kAlphaThreshold: + ReadAlphaThresholdPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kSkImageFilter: + ReadImageFilterPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kXfermode: + ReadXfermodePaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kArithmetic: + ReadArithmeticPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kMatrixConvolution: + ReadMatrixConvolutionPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kDisplacementMapEffect: + ReadDisplacementMapEffectPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kImage: + ReadImagePaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kPaintRecord: + ReadRecordPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kMerge: + ReadMergePaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kMorphology: + ReadMorphologyPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kOffset: + ReadOffsetPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kTile: + ReadTilePaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kTurbulence: + ReadTurbulencePaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kPaintFlags: + ReadPaintFlagsPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kMatrix: + ReadMatrixPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kLightingDistant: + ReadLightingDistantPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kLightingPoint: + ReadLightingPointPaintFilter(filter, crop_rect); + break; + case PaintFilter::Type::kLightingSpot: + ReadLightingSpotPaintFilter(filter, crop_rect); + break; + } +} + +void PaintOpReader::ReadColorFilterPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + sk_sp<SkColorFilter> color_filter; + sk_sp<PaintFilter> input; + + AlignMemory(4); + ReadFlattenable(&color_filter); + Read(&input); + if (!valid_) + return; + filter->reset(new ColorFilterPaintFilter(std::move(color_filter), + std::move(input), + crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadBlurPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + SkScalar sigma_x = 0.f; + SkScalar sigma_y = 0.f; + BlurPaintFilter::TileMode tile_mode = SkBlurImageFilter::kClamp_TileMode; + sk_sp<PaintFilter> input; + + ReadSimple(&sigma_x); + ReadSimple(&sigma_y); + ReadSimple(&tile_mode); + Read(&input); + if (!valid_) + return; + filter->reset(new BlurPaintFilter(sigma_x, sigma_y, tile_mode, + std::move(input), + crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadDropShadowPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + SkScalar dx = 0.f; + SkScalar dy = 0.f; + SkScalar sigma_x = 0.f; + SkScalar sigma_y = 0.f; + SkColor color = SK_ColorBLACK; + DropShadowPaintFilter::ShadowMode shadow_mode = + SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode; + sk_sp<PaintFilter> input; + + ReadSimple(&dx); + ReadSimple(&dy); + ReadSimple(&sigma_x); + ReadSimple(&sigma_y); + ReadSimple(&color); + ReadSimple(&shadow_mode); + Read(&input); + + if (shadow_mode > SkDropShadowImageFilter::kLast_ShadowMode) + SetInvalid(); + if (!valid_) + return; + filter->reset(new DropShadowPaintFilter(dx, dy, sigma_x, sigma_y, color, + shadow_mode, std::move(input), + crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadMagnifierPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + // TODO(vmpstr): Implement this. +} + +void PaintOpReader::ReadComposePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + sk_sp<PaintFilter> outer; + sk_sp<PaintFilter> inner; + + Read(&outer); + Read(&inner); + if (!valid_) + return; + filter->reset(new ComposePaintFilter(std::move(outer), std::move(inner))); +} + +void PaintOpReader::ReadAlphaThresholdPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + // TODO(vmpstr): Implement this. +} + +void PaintOpReader::ReadImageFilterPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + // TODO(vmpstr): Implement this. +} + +void PaintOpReader::ReadXfermodePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + uint32_t blend_mode_int = 0; + sk_sp<PaintFilter> background; + sk_sp<PaintFilter> foreground; + + ReadSimple(&blend_mode_int); + Read(&background); + Read(&foreground); + SkBlendMode blend_mode = SkBlendMode::kClear; + if (blend_mode_int > static_cast<uint32_t>(SkBlendMode::kLastMode)) + SetInvalid(); + if (!valid_) + return; + blend_mode = static_cast<SkBlendMode>(blend_mode_int); + + filter->reset(new XfermodePaintFilter(blend_mode, std::move(background), + std::move(foreground), + crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadArithmeticPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + float k1 = 0.f; + float k2 = 0.f; + float k3 = 0.f; + float k4 = 0.f; + bool enforce_pm_color = false; + sk_sp<PaintFilter> background; + sk_sp<PaintFilter> foreground; + ReadSimple(&k1); + ReadSimple(&k2); + ReadSimple(&k3); + ReadSimple(&k4); + ReadSimple(&enforce_pm_color); + Read(&background); + Read(&foreground); + if (!valid_) + return; + filter->reset(new ArithmeticPaintFilter( + k1, k2, k3, k4, enforce_pm_color, std::move(background), + std::move(foreground), crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadMatrixConvolutionPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + // TODO(vmpstr): Implement this. +} + +void PaintOpReader::ReadDisplacementMapEffectPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + // TODO(vmpstr): Implement this. +} + +void PaintOpReader::ReadImagePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + // TODO(vmpstr): Implement this. +} + +void PaintOpReader::ReadRecordPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + SkRect record_bounds; + sk_sp<PaintRecord> record; + ReadSimple(&record_bounds); + Read(&record); + if (!valid_) + return; + filter->reset(new RecordPaintFilter(std::move(record), record_bounds)); +} + +void PaintOpReader::ReadMergePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + size_t input_count = 0; + ReadSimple(&input_count); + if (input_count > kMaxMergeFilterCount) + SetInvalid(); + if (!valid_) + return; + std::vector<sk_sp<PaintFilter>> inputs(input_count); + for (auto& input : inputs) + Read(&input); + if (!valid_) + return; + filter->reset(new MergePaintFilter(inputs.data(), + static_cast<int>(input_count), + crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadMorphologyPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + uint32_t morph_type_int = 0; + int radius_x = 0; + int radius_y = 0; + sk_sp<PaintFilter> input; + ReadSimple(&morph_type_int); + ReadSimple(&radius_x); + ReadSimple(&radius_y); + Read(&input); + if (morph_type_int > + static_cast<uint32_t>(MorphologyPaintFilter::MorphType::kMaxMorphType)) { + SetInvalid(); + } + if (!valid_) + return; + MorphologyPaintFilter::MorphType morph_type = + static_cast<MorphologyPaintFilter::MorphType>(morph_type_int); + filter->reset(new MorphologyPaintFilter(morph_type, radius_x, radius_y, + std::move(input), + crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadOffsetPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + SkScalar dx = 0.f; + SkScalar dy = 0.f; + sk_sp<PaintFilter> input; + + ReadSimple(&dx); + ReadSimple(&dy); + Read(&input); + if (!valid_) + return; + filter->reset(new OffsetPaintFilter(dx, dy, std::move(input), + crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadTilePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + // TODO(vmpstr): Implement this. +} + +void PaintOpReader::ReadTurbulencePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + uint32_t turbulence_type_int = 0; + SkScalar base_frequency_x = 0.f; + SkScalar base_frequency_y = 0.f; + int num_octaves = 0; + SkScalar seed = 0.f; + SkISize tile_size = SkISize::MakeEmpty(); + + ReadSimple(&turbulence_type_int); + ReadSimple(&base_frequency_x); + ReadSimple(&base_frequency_y); + ReadSimple(&num_octaves); + ReadSimple(&seed); + ReadSimple(&tile_size); + if (turbulence_type_int > + static_cast<uint32_t>( + TurbulencePaintFilter::TurbulenceType::kMaxTurbulenceType)) { + SetInvalid(); + } + if (!valid_) + return; + TurbulencePaintFilter::TurbulenceType turbulence_type = + static_cast<TurbulencePaintFilter::TurbulenceType>(turbulence_type_int); + filter->reset(new TurbulencePaintFilter( + turbulence_type, base_frequency_x, base_frequency_y, num_octaves, seed, + &tile_size, crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadPaintFlagsPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + // TODO(vmpstr): Implement this. +} + +void PaintOpReader::ReadMatrixPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + SkMatrix matrix = SkMatrix::I(); + SkFilterQuality filter_quality = kNone_SkFilterQuality; + sk_sp<PaintFilter> input; + + ReadSimple(&matrix); + ReadSimple(&filter_quality); + Read(&input); + if (filter_quality > kLast_SkFilterQuality) + SetInvalid(); + if (!valid_) + return; + filter->reset( + new MatrixPaintFilter(matrix, filter_quality, std::move(input))); +} + +void PaintOpReader::ReadLightingDistantPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + uint32_t lighting_type_int = 0; + SkPoint3 direction = SkPoint3::Make(0.f, 0.f, 0.f); + SkColor light_color = SK_ColorBLACK; + SkScalar surface_scale = 0.f; + SkScalar kconstant = 0.f; + SkScalar shininess = 0.f; + sk_sp<PaintFilter> input; + + ReadSimple(&lighting_type_int); + ReadSimple(&direction); + ReadSimple(&light_color); + ReadSimple(&surface_scale); + ReadSimple(&kconstant); + ReadSimple(&shininess); + Read(&input); + if (lighting_type_int > + static_cast<uint32_t>(PaintFilter::LightingType::kMaxLightingType)) { + SetInvalid(); + } + if (!valid_) + return; + PaintFilter::LightingType lighting_type = + static_cast<PaintFilter::LightingType>(lighting_type_int); + filter->reset(new LightingDistantPaintFilter( + lighting_type, direction, light_color, surface_scale, kconstant, + shininess, std::move(input), crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadLightingPointPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + uint32_t lighting_type_int = 0; + SkPoint3 location = SkPoint3::Make(0.f, 0.f, 0.f); + SkColor light_color = SK_ColorBLACK; + SkScalar surface_scale = 0.f; + SkScalar kconstant = 0.f; + SkScalar shininess = 0.f; + sk_sp<PaintFilter> input; + + ReadSimple(&lighting_type_int); + ReadSimple(&location); + ReadSimple(&light_color); + ReadSimple(&surface_scale); + ReadSimple(&kconstant); + ReadSimple(&shininess); + Read(&input); + if (lighting_type_int > + static_cast<uint32_t>(PaintFilter::LightingType::kMaxLightingType)) { + SetInvalid(); + } + if (!valid_) + return; + PaintFilter::LightingType lighting_type = + static_cast<PaintFilter::LightingType>(lighting_type_int); + filter->reset(new LightingPointPaintFilter( + lighting_type, location, light_color, surface_scale, kconstant, shininess, + std::move(input), crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::ReadLightingSpotPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect) { + uint32_t lighting_type_int = 0; + SkPoint3 location = SkPoint3::Make(0.f, 0.f, 0.f); + SkPoint3 target = SkPoint3::Make(0.f, 0.f, 0.f); + SkScalar specular_exponent = 0.f; + SkScalar cutoff_angle = 0.f; + SkColor light_color = SK_ColorBLACK; + SkScalar surface_scale = 0.f; + SkScalar kconstant = 0.f; + SkScalar shininess = 0.f; + sk_sp<PaintFilter> input; + + ReadSimple(&lighting_type_int); + ReadSimple(&location); + ReadSimple(&target); + ReadSimple(&specular_exponent); + ReadSimple(&cutoff_angle); + ReadSimple(&light_color); + ReadSimple(&surface_scale); + ReadSimple(&kconstant); + ReadSimple(&shininess); + Read(&input); + + if (lighting_type_int > + static_cast<uint32_t>(PaintFilter::LightingType::kMaxLightingType)) { + SetInvalid(); + } + if (!valid_) + return; + PaintFilter::LightingType lighting_type = + static_cast<PaintFilter::LightingType>(lighting_type_int); + filter->reset(new LightingSpotPaintFilter( + lighting_type, location, target, specular_exponent, cutoff_angle, + light_color, surface_scale, kconstant, shininess, std::move(input), + crop_rect ? &*crop_rect : nullptr)); +} + +void PaintOpReader::Read(sk_sp<PaintRecord>* record) { + size_t size_bytes = 0; + ReadSimple(&size_bytes); + AlignMemory(PaintOpBuffer::PaintOpAlign); + if (size_bytes > remaining_bytes_) + SetInvalid(); + if (!valid_) + return; + + PaintOp::DeserializeOptions options; + options.transfer_cache = transfer_cache_; + + *record = PaintOpBuffer::MakeFromMemory(memory_, size_bytes, options); + if (!*record) { + SetInvalid(); + return; + } + memory_ += size_bytes; + remaining_bytes_ -= size_bytes; +} + } // namespace cc
diff --git a/cc/paint/paint_op_reader.h b/cc/paint/paint_op_reader.h index 0cc71ac..4b2aefc 100644 --- a/cc/paint/paint_op_reader.h +++ b/cc/paint/paint_op_reader.h
@@ -8,7 +8,9 @@ #include <vector> #include "cc/paint/paint_export.h" +#include "cc/paint/paint_filter.h" #include "cc/paint/paint_op_writer.h" +#include "cc/paint/transfer_cache_deserialize_helper.h" namespace cc { @@ -19,10 +21,13 @@ class TransferCacheDeserializeHelper; class CC_PAINT_EXPORT PaintOpReader { public: - PaintOpReader(const volatile void* memory, size_t size) + PaintOpReader(const volatile void* memory, + size_t size, + TransferCacheDeserializeHelper* transfer_cache) : memory_(static_cast<const volatile char*>(memory) + PaintOpWriter::HeaderBytes()), - remaining_bytes_(size - PaintOpWriter::HeaderBytes()) { + remaining_bytes_(size - PaintOpWriter::HeaderBytes()), + transfer_cache_(transfer_cache) { if (size < PaintOpWriter::HeaderBytes()) valid_ = false; } @@ -52,8 +57,7 @@ void Read(PaintFlags* flags); void Read(PaintImage* image); void Read(sk_sp<SkData>* data); - void Read(scoped_refptr<PaintTextBlob>* blob, - TransferCacheDeserializeHelper* transfer_cache); + void Read(scoped_refptr<PaintTextBlob>* blob); void Read(sk_sp<PaintShader>* shader); void Read(SkMatrix* matrix); void Read(SkColorType* color_type); @@ -96,9 +100,86 @@ void SetInvalid(); + void Read(sk_sp<PaintFilter>* filter); + + // The main entry point is Read(sk_sp<PaintFilter>* filter) which calls one of + // the following functions depending on read type. + void ReadColorFilterPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadBlurPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadDropShadowPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadMagnifierPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadComposePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadAlphaThresholdPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadImageFilterPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadXfermodePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadArithmeticPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadMatrixConvolutionPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadDisplacementMapEffectPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadImagePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadRecordPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadMergePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadMorphologyPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadOffsetPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadTilePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadTurbulencePaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadPaintFlagsPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadMatrixPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadLightingDistantPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadLightingPointPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + void ReadLightingSpotPaintFilter( + sk_sp<PaintFilter>* filter, + const base::Optional<PaintFilter::CropRect>& crop_rect); + + void Read(sk_sp<PaintRecord>* record); + const volatile char* memory_ = nullptr; size_t remaining_bytes_ = 0u; bool valid_ = true; + TransferCacheDeserializeHelper* transfer_cache_; }; } // namespace cc
diff --git a/cc/paint/paint_op_writer.cc b/cc/paint/paint_op_writer.cc index 8a921a20..62c8b03 100644 --- a/cc/paint/paint_op_writer.cc +++ b/cc/paint/paint_op_writer.cc
@@ -4,7 +4,11 @@ #include "cc/paint/paint_op_writer.h" +#include "cc/paint/draw_image.h" +#include "cc/paint/image_provider.h" +#include "cc/paint/image_transfer_cache_entry.h" #include "cc/paint/paint_flags.h" +#include "cc/paint/paint_op_buffer_serializer.h" #include "cc/paint/paint_shader.h" #include "cc/paint/paint_typeface_transfer_cache_entry.h" #include "cc/paint/transfer_cache_serialize_helper.h" @@ -19,10 +23,15 @@ } } // namespace -PaintOpWriter::PaintOpWriter(void* memory, size_t size) +PaintOpWriter::PaintOpWriter(void* memory, + size_t size, + TransferCacheSerializeHelper* transfer_cache, + ImageProvider* image_provider) : memory_(static_cast<char*>(memory) + HeaderBytes()), size_(size), - remaining_bytes_(size - HeaderBytes()) { + remaining_bytes_(size - HeaderBytes()), + transfer_cache_(transfer_cache), + image_provider_(image_provider) { // Leave space for header of type/skip. DCHECK_GE(size, HeaderBytes()); } @@ -128,12 +137,17 @@ AlignMemory(4); WriteFlattenable(flags.draw_looper_.get()); + Write(flags.image_filter_.get()); Write(flags.shader_.get()); } -void PaintOpWriter::Write(const PaintImage& image, - ImageProvider* image_provider) { - // TODO(enne): implement PaintImage serialization: http://crbug.com/737629 +void PaintOpWriter::Write(const DrawImage& image) { + auto decoded_image = image_provider_->GetDecodedDrawImage(image); + base::Optional<uint32_t> id = + decoded_image.decoded_image().transfer_cache_entry_id(); + + // In the case of a decode failure, id may not be set. Send an invalid ID. + Write(id ? *id : kInvalidImageTransferCacheEntryId); } void PaintOpWriter::Write(const sk_sp<SkData>& data) { @@ -148,29 +162,27 @@ } } -void PaintOpWriter::Write(const sk_sp<SkTextBlob>& blob, - TransferCacheSerializeHelper* transfer_cache) { - auto data = blob->serialize(&TypefaceCataloger, transfer_cache); +void PaintOpWriter::Write(const sk_sp<SkTextBlob>& blob) { + auto data = blob->serialize(&TypefaceCataloger, transfer_cache_); Write(data); } -void PaintOpWriter::Write(const scoped_refptr<PaintTextBlob>& blob, - TransferCacheSerializeHelper* transfer_cache) { +void PaintOpWriter::Write(const scoped_refptr<PaintTextBlob>& blob) { if (!valid_) return; for (auto& typeface : blob->typefaces()) { - auto locked = transfer_cache->LockEntry( + auto locked = transfer_cache_->LockEntry( TransferCacheEntryType::kPaintTypeface, typeface.sk_id()); if (locked) continue; - transfer_cache->CreateEntry( + transfer_cache_->CreateEntry( ClientPaintTypefaceTransferCacheEntry(typeface)); - transfer_cache->AssertLocked(TransferCacheEntryType::kPaintTypeface, - typeface.sk_id()); + transfer_cache_->AssertLocked(TransferCacheEntryType::kPaintTypeface, + typeface.sk_id()); } - Write(blob->ToSkTextBlob(), transfer_cache); + Write(blob->ToSkTextBlob()); } void PaintOpWriter::Write(const PaintShader* shader) { @@ -255,4 +267,285 @@ remaining_bytes_ -= padding; } +void PaintOpWriter::Write(const PaintFilter* filter) { + if (!filter) { + WriteSimple(static_cast<uint32_t>(PaintFilter::Type::kNullFilter)); + return; + } + WriteSimple(static_cast<uint32_t>(filter->type())); + auto* crop_rect = filter->crop_rect(); + WriteSimple(static_cast<uint32_t>(!!crop_rect)); + if (crop_rect) { + WriteSimple(crop_rect->flags()); + WriteSimple(crop_rect->rect()); + } + + if (!valid_) + return; + + switch (filter->type()) { + case PaintFilter::Type::kNullFilter: + NOTREACHED(); + break; + case PaintFilter::Type::kColorFilter: + Write(static_cast<const ColorFilterPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kBlur: + Write(static_cast<const BlurPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kDropShadow: + Write(static_cast<const DropShadowPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kMagnifier: + Write(static_cast<const MagnifierPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kCompose: + Write(static_cast<const ComposePaintFilter&>(*filter)); + break; + case PaintFilter::Type::kAlphaThreshold: + Write(static_cast<const AlphaThresholdPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kSkImageFilter: + Write(static_cast<const ImageFilterPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kXfermode: + Write(static_cast<const XfermodePaintFilter&>(*filter)); + break; + case PaintFilter::Type::kArithmetic: + Write(static_cast<const ArithmeticPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kMatrixConvolution: + Write(static_cast<const MatrixConvolutionPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kDisplacementMapEffect: + Write(static_cast<const DisplacementMapEffectPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kImage: + Write(static_cast<const ImagePaintFilter&>(*filter)); + break; + case PaintFilter::Type::kPaintRecord: + Write(static_cast<const RecordPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kMerge: + Write(static_cast<const MergePaintFilter&>(*filter)); + break; + case PaintFilter::Type::kMorphology: + Write(static_cast<const MorphologyPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kOffset: + Write(static_cast<const OffsetPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kTile: + Write(static_cast<const TilePaintFilter&>(*filter)); + break; + case PaintFilter::Type::kTurbulence: + Write(static_cast<const TurbulencePaintFilter&>(*filter)); + break; + case PaintFilter::Type::kPaintFlags: + Write(static_cast<const PaintFlagsPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kMatrix: + Write(static_cast<const MatrixPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kLightingDistant: + Write(static_cast<const LightingDistantPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kLightingPoint: + Write(static_cast<const LightingPointPaintFilter&>(*filter)); + break; + case PaintFilter::Type::kLightingSpot: + Write(static_cast<const LightingSpotPaintFilter&>(*filter)); + break; + } +} + +void PaintOpWriter::Write(const ColorFilterPaintFilter& filter) { + AlignMemory(4); + WriteFlattenable(filter.color_filter().get()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const BlurPaintFilter& filter) { + WriteSimple(filter.sigma_x()); + WriteSimple(filter.sigma_y()); + WriteSimple(filter.tile_mode()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const DropShadowPaintFilter& filter) { + WriteSimple(filter.dx()); + WriteSimple(filter.dy()); + WriteSimple(filter.sigma_x()); + WriteSimple(filter.sigma_y()); + WriteSimple(filter.color()); + WriteSimple(filter.shadow_mode()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const MagnifierPaintFilter& filter) { + // TODO(vmpstr): Implement this. +} + +void PaintOpWriter::Write(const ComposePaintFilter& filter) { + Write(filter.outer().get()); + Write(filter.inner().get()); +} + +void PaintOpWriter::Write(const AlphaThresholdPaintFilter& filter) { + // TODO(vmpstr): Implement this. +} + +void PaintOpWriter::Write(const ImageFilterPaintFilter& filter) { + // TODO(vmpstr): Implement this? (See comment in ImageFilterPaintFilter.) +} + +void PaintOpWriter::Write(const XfermodePaintFilter& filter) { + WriteSimple(static_cast<uint32_t>(filter.blend_mode())); + Write(filter.background().get()); + Write(filter.foreground().get()); +} + +void PaintOpWriter::Write(const ArithmeticPaintFilter& filter) { + WriteSimple(filter.k1()); + WriteSimple(filter.k2()); + WriteSimple(filter.k3()); + WriteSimple(filter.k4()); + WriteSimple(filter.enforce_pm_color()); + Write(filter.background().get()); + Write(filter.foreground().get()); +} + +void PaintOpWriter::Write(const MatrixConvolutionPaintFilter& filter) { + // TODO(vmpstr): Implement this. +} + +void PaintOpWriter::Write(const DisplacementMapEffectPaintFilter& filter) { + // TODO(vmpstr): Implement this. +} + +void PaintOpWriter::Write(const ImagePaintFilter& filter) { + // TODO(vmpstr): Implement this. +} + +void PaintOpWriter::Write(const RecordPaintFilter& filter) { + WriteSimple(filter.record_bounds()); + Write(filter.record().get()); +} + +void PaintOpWriter::Write(const MergePaintFilter& filter) { + WriteSimple(filter.input_count()); + for (size_t i = 0; i < filter.input_count(); ++i) + Write(filter.input_at(i)); +} + +void PaintOpWriter::Write(const MorphologyPaintFilter& filter) { + WriteSimple(static_cast<uint32_t>(filter.morph_type())); + WriteSimple(filter.radius_x()); + WriteSimple(filter.radius_y()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const OffsetPaintFilter& filter) { + WriteSimple(filter.dx()); + WriteSimple(filter.dy()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const TilePaintFilter& filter) { + // TODO(vmpstr): Implement this. +} + +void PaintOpWriter::Write(const TurbulencePaintFilter& filter) { + WriteSimple(static_cast<uint32_t>(filter.turbulence_type())); + WriteSimple(filter.base_frequency_x()); + WriteSimple(filter.base_frequency_y()); + WriteSimple(filter.num_octaves()); + WriteSimple(filter.seed()); + WriteSimple(filter.tile_size()); +} + +void PaintOpWriter::Write(const PaintFlagsPaintFilter& filter) { + // TODO(vmpstr): Implement this. +} + +void PaintOpWriter::Write(const MatrixPaintFilter& filter) { + WriteSimple(filter.matrix()); + WriteSimple(filter.filter_quality()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const LightingDistantPaintFilter& filter) { + WriteSimple(static_cast<uint32_t>(filter.lighting_type())); + WriteSimple(filter.direction()); + WriteSimple(filter.light_color()); + WriteSimple(filter.surface_scale()); + WriteSimple(filter.kconstant()); + WriteSimple(filter.shininess()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const LightingPointPaintFilter& filter) { + WriteSimple(static_cast<uint32_t>(filter.lighting_type())); + WriteSimple(filter.location()); + WriteSimple(filter.light_color()); + WriteSimple(filter.surface_scale()); + WriteSimple(filter.kconstant()); + WriteSimple(filter.shininess()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const LightingSpotPaintFilter& filter) { + WriteSimple(static_cast<uint32_t>(filter.lighting_type())); + WriteSimple(filter.location()); + WriteSimple(filter.target()); + WriteSimple(filter.specular_exponent()); + WriteSimple(filter.cutoff_angle()); + WriteSimple(filter.light_color()); + WriteSimple(filter.surface_scale()); + WriteSimple(filter.kconstant()); + WriteSimple(filter.shininess()); + Write(filter.input().get()); +} + +void PaintOpWriter::Write(const PaintRecord* record) { + // We need to record how many bytes we will serialize, but we don't know this + // information until we do the serialization. So, skip the amount needed + // before writing. + size_t size_offset = sizeof(size_t); + if (size_offset > remaining_bytes_) { + valid_ = false; + return; + } + + char* size_memory = memory_; + + memory_ += size_offset; + remaining_bytes_ -= size_offset; + AlignMemory(PaintOpBuffer::PaintOpAlign); + if (!valid_) + return; + + SimpleBufferSerializer serializer(memory_, remaining_bytes_, image_provider_, + transfer_cache_); + serializer.Serialize(record, nullptr, PaintOpBufferSerializer::Preamble()); + if (!serializer.valid()) { + valid_ = false; + return; + } + // Now we can write the number of bytes we used. Ensure this amount is size_t, + // since that's what we allocated for it. + static_assert(sizeof(serializer.written()) == sizeof(size_t), + "written() return type size is different from sizeof(size_t)"); + + // Write the size to the size memory, which preceeds the memory for the + // record. + reinterpret_cast<size_t*>(size_memory)[0] = serializer.written(); + + // The serializer should have failed if it ran out of space. DCHECK to verify + // that it wrote fewer bytes than we have. + DCHECK_LT(serializer.written(), remaining_bytes_); + memory_ += serializer.written(); + remaining_bytes_ -= serializer.written(); +} + } // namespace cc
diff --git a/cc/paint/paint_op_writer.h b/cc/paint/paint_op_writer.h index 18d49c5..fbec13b8 100644 --- a/cc/paint/paint_op_writer.h +++ b/cc/paint/paint_op_writer.h
@@ -9,6 +9,7 @@ #include "cc/paint/paint_canvas.h" #include "cc/paint/paint_export.h" +#include "cc/paint/paint_filter.h" struct SkRect; struct SkIRect; @@ -16,13 +17,17 @@ namespace cc { +class DrawImage; class ImageProvider; class PaintShader; class TransferCacheSerializeHelper; class CC_PAINT_EXPORT PaintOpWriter { public: - PaintOpWriter(void* memory, size_t size); + PaintOpWriter(void* memory, + size_t size, + TransferCacheSerializeHelper* transfer_cache, + ImageProvider* image_provider); ~PaintOpWriter(); static size_t constexpr HeaderBytes() { return 4u; } @@ -47,11 +52,10 @@ void Write(const SkPath& path); void Write(const PaintFlags& flags); - void Write(const PaintImage& image, ImageProvider* image_provider); + void Write(const DrawImage& image); void Write(const sk_sp<SkData>& data); void Write(const PaintShader* shader); - void Write(const scoped_refptr<PaintTextBlob>& blob, - TransferCacheSerializeHelper* transfer_cache); + void Write(const scoped_refptr<PaintTextBlob>& blob); void Write(SkColorType color_type); void Write(SkClipOp op) { Write(static_cast<uint8_t>(op)); } @@ -66,18 +70,60 @@ // Aligns the memory to the given alignment. void AlignMemory(size_t alignment); + // sk_sp is implicitly convertible to uint8_t (likely via implicit bool + // conversion). In order to avoid accidentally calling that overload instead + // of a specific function (such as would be the case if one forgets to call + // .get() on it), the following template asserts if it's instantiated. + template <typename T> + void Write(const sk_sp<T>&) { + // Note that this is essentially static_assert(false, ...) but it needs to + // be dependent on T in order to only trigger if instantiated. + static_assert(sizeof(T) == 0, + "Attempted to call a non-existent sk_sp override."); + } + private: template <typename T> void WriteSimple(const T& val); void WriteFlattenable(const SkFlattenable* val); - void Write(const sk_sp<SkTextBlob>& blob, - TransferCacheSerializeHelper* transfer_cache); + void Write(const sk_sp<SkTextBlob>& blob); + void Write(const PaintFilter* filter); + + // The main entry point is Write(const PaintFilter* filter) which casts the + // filter and calls one of the following functions. + void Write(const ColorFilterPaintFilter& filter); + void Write(const BlurPaintFilter& filter); + void Write(const DropShadowPaintFilter& filter); + void Write(const MagnifierPaintFilter& filter); + void Write(const ComposePaintFilter& filter); + void Write(const AlphaThresholdPaintFilter& filter); + void Write(const ImageFilterPaintFilter& filter); + void Write(const XfermodePaintFilter& filter); + void Write(const ArithmeticPaintFilter& filter); + void Write(const MatrixConvolutionPaintFilter& filter); + void Write(const DisplacementMapEffectPaintFilter& filter); + void Write(const ImagePaintFilter& filter); + void Write(const RecordPaintFilter& filter); + void Write(const MergePaintFilter& filter); + void Write(const MorphologyPaintFilter& filter); + void Write(const OffsetPaintFilter& filter); + void Write(const TilePaintFilter& filter); + void Write(const TurbulencePaintFilter& filter); + void Write(const PaintFlagsPaintFilter& filter); + void Write(const MatrixPaintFilter& filter); + void Write(const LightingDistantPaintFilter& filter); + void Write(const LightingPointPaintFilter& filter); + void Write(const LightingSpotPaintFilter& filter); + + void Write(const PaintRecord* record); char* memory_ = nullptr; size_t size_ = 0u; size_t remaining_bytes_ = 0u; bool valid_ = true; + TransferCacheSerializeHelper* transfer_cache_; + ImageProvider* image_provider_; }; } // namespace cc
diff --git a/cc/paint/scoped_raster_flags.cc b/cc/paint/scoped_raster_flags.cc index bd6b75b..3ba91f8 100644 --- a/cc/paint/scoped_raster_flags.cc +++ b/cc/paint/scoped_raster_flags.cc
@@ -61,7 +61,7 @@ } const auto& decoded_image = decoded_draw_image.decoded_image(); - DCHECK(decoded_image.image()); + DCHECK(decoded_image.image() || decoded_image.transfer_cache_entry_id()); bool need_scale = !decoded_image.is_scale_adjustment_identity(); if (need_scale) {
diff --git a/cc/raster/bitmap_raster_buffer_provider.cc b/cc/raster/bitmap_raster_buffer_provider.cc index 15d6872..6af8d61 100644 --- a/cc/raster/bitmap_raster_buffer_provider.cc +++ b/cc/raster/bitmap_raster_buffer_provider.cc
@@ -58,7 +58,7 @@ } private: - ResourceProvider::ScopedWriteLockSoftware lock_; + LayerTreeResourceProvider::ScopedWriteLockSoftware lock_; const Resource* resource_; bool resource_has_previous_content_;
diff --git a/cc/raster/gpu_raster_buffer_provider.cc b/cc/raster/gpu_raster_buffer_provider.cc index d7fb043..bf95539e 100644 --- a/cc/raster/gpu_raster_buffer_provider.cc +++ b/cc/raster/gpu_raster_buffer_provider.cc
@@ -21,6 +21,7 @@ #include "cc/resources/resource.h" #include "components/viz/common/gpu/context_provider.h" #include "components/viz/common/gpu/raster_context_provider.h" +#include "components/viz/common/resources/resource_format_utils.h" #include "gpu/command_buffer/client/context_support.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/client/raster_interface.h" @@ -42,7 +43,7 @@ const gfx::AxisTransform2d& transform, const RasterSource::PlaybackSettings& playback_settings, viz::RasterContextProvider* context_provider, - ResourceProvider::ScopedWriteLockRaster* resource_lock, + LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, bool use_distance_field_text, int msaa_sample_count) { gpu::raster::RasterInterface* ri = context_provider->RasterInterface(); @@ -56,11 +57,9 @@ float recording_to_raster_scale = transform.scale() / raster_source->recording_scale_factor(); ri->RasterCHROMIUM(raster_source->GetDisplayItemList().get(), - raster_full_rect.x(), raster_full_rect.y(), - playback_rect.x(), playback_rect.y(), - playback_rect.width(), playback_rect.height(), - transform.translation().x(), transform.translation().y(), - recording_to_raster_scale); + playback_settings.image_provider, + raster_full_rect.OffsetFromOrigin(), playback_rect, + transform.translation(), recording_to_raster_scale); ri->EndRasterCHROMIUM(); ri->DeleteTextures(1, &texture_id); @@ -96,7 +95,7 @@ const gfx::AxisTransform2d& transform, const RasterSource::PlaybackSettings& playback_settings, viz::RasterContextProvider* context_provider, - ResourceProvider::ScopedWriteLockRaster* resource_lock, + LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, bool use_distance_field_text, int msaa_sample_count) { ScopedGrContextAccess gr_context_access(context_provider); @@ -276,7 +275,7 @@ } void GpuRasterBufferProvider::PlaybackOnWorkerThread( - ResourceProvider::ScopedWriteLockRaster* resource_lock, + LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, const gpu::SyncToken& sync_token, bool resource_has_previous_content, const RasterSource* raster_source,
diff --git a/cc/raster/gpu_raster_buffer_provider.h b/cc/raster/gpu_raster_buffer_provider.h index 48a1296..fe7c1cb 100644 --- a/cc/raster/gpu_raster_buffer_provider.h +++ b/cc/raster/gpu_raster_buffer_provider.h
@@ -48,7 +48,7 @@ void Shutdown() override; void PlaybackOnWorkerThread( - ResourceProvider::ScopedWriteLockRaster* resource_lock, + LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, const gpu::SyncToken& sync_token, bool resource_has_previous_content, const RasterSource* raster_source, @@ -82,7 +82,7 @@ private: GpuRasterBufferProvider* const client_; - ResourceProvider::ScopedWriteLockRaster lock_; + LayerTreeResourceProvider::ScopedWriteLockRaster lock_; const bool resource_has_previous_content_; gpu::SyncToken sync_token_;
diff --git a/cc/raster/one_copy_raster_buffer_provider.cc b/cc/raster/one_copy_raster_buffer_provider.cc index 0313db5..4181744 100644 --- a/cc/raster/one_copy_raster_buffer_provider.cc +++ b/cc/raster/one_copy_raster_buffer_provider.cc
@@ -191,7 +191,7 @@ void OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread( const Resource* resource, - ResourceProvider::ScopedWriteLockRaster* resource_lock, + LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, const gpu::SyncToken& sync_token, const RasterSource* raster_source, const gfx::Rect& raster_full_rect, @@ -290,7 +290,7 @@ void OneCopyRasterBufferProvider::CopyOnWorkerThread( StagingBuffer* staging_buffer, - ResourceProvider::ScopedWriteLockRaster* resource_lock, + LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, const RasterSource* raster_source, const gfx::Rect& rect_to_copy) { viz::RasterContextProvider::ScopedRasterContextLock scoped_context( @@ -301,7 +301,8 @@ GLuint texture_id = resource_lock->ConsumeTexture(ri); GLenum image_target = resource_provider_->GetImageTextureTarget( - StagingBufferUsage(), staging_buffer->format); + worker_context_provider_->ContextCapabilities(), StagingBufferUsage(), + staging_buffer->format); // Create and bind staging texture. if (!staging_buffer->texture_id) {
diff --git a/cc/raster/one_copy_raster_buffer_provider.h b/cc/raster/one_copy_raster_buffer_provider.h index 989f758..bcab146d 100644 --- a/cc/raster/one_copy_raster_buffer_provider.h +++ b/cc/raster/one_copy_raster_buffer_provider.h
@@ -55,7 +55,7 @@ // Playback raster source and copy result into |resource|. void PlaybackAndCopyOnWorkerThread( const Resource* resource, - ResourceProvider::ScopedWriteLockRaster* resource_lock, + LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, const gpu::SyncToken& sync_token, const RasterSource* raster_source, const gfx::Rect& raster_full_rect, @@ -90,7 +90,7 @@ private: OneCopyRasterBufferProvider* client_; const Resource* resource_; - ResourceProvider::ScopedWriteLockRaster lock_; + LayerTreeResourceProvider::ScopedWriteLockRaster lock_; uint64_t previous_content_id_; gpu::SyncToken sync_token_; @@ -112,7 +112,7 @@ uint64_t new_content_id); void CopyOnWorkerThread( StagingBuffer* staging_buffer, - ResourceProvider::ScopedWriteLockRaster* resource_lock, + LayerTreeResourceProvider::ScopedWriteLockRaster* resource_lock, const RasterSource* raster_source, const gfx::Rect& rect_to_copy); gfx::BufferUsage StagingBufferUsage() const;
diff --git a/cc/raster/staging_buffer_pool.cc b/cc/raster/staging_buffer_pool.cc index a6346f5..57e631c 100644 --- a/cc/raster/staging_buffer_pool.cc +++ b/cc/raster/staging_buffer_pool.cc
@@ -12,6 +12,7 @@ #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/memory_dump_manager.h" #include "cc/base/container_util.h" +#include "cc/resources/resource_util.h" #include "cc/resources/scoped_resource.h" #include "components/viz/common/gpu/raster_context_provider.h" #include "gpu/command_buffer/client/raster_interface.h"
diff --git a/cc/raster/zero_copy_raster_buffer_provider.cc b/cc/raster/zero_copy_raster_buffer_provider.cc index c4a58851..49ef21e 100644 --- a/cc/raster/zero_copy_raster_buffer_provider.cc +++ b/cc/raster/zero_copy_raster_buffer_provider.cc
@@ -16,6 +16,7 @@ #include "cc/resources/layer_tree_resource_provider.h" #include "cc/resources/resource.h" #include "components/viz/common/resources/platform_color.h" +#include "components/viz/common/resources/resource_format_utils.h" #include "ui/gfx/buffer_format_util.h" #include "ui/gfx/gpu_memory_buffer.h"
diff --git a/cc/resources/display_resource_provider.cc b/cc/resources/display_resource_provider.cc index c80df4d4..daeb7a0 100644 --- a/cc/resources/display_resource_provider.cc +++ b/cc/resources/display_resource_provider.cc
@@ -24,18 +24,20 @@ DisplayResourceProvider::DisplayResourceProvider( viz::ContextProvider* compositor_context_provider, viz::SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const viz::ResourceSettings& resource_settings) : ResourceProvider(compositor_context_provider, shared_bitmap_manager, - gpu_memory_buffer_manager, false, - resource_settings, - kDisplayInitialResourceId) {} + resource_settings), + next_id_(kDisplayInitialResourceId) {} DisplayResourceProvider::~DisplayResourceProvider() { while (!children_.empty()) DestroyChildInternal(children_.begin(), FOR_SHUTDOWN); + + GLES2Interface* gl = ContextGL(); + if (gl) + gl->Finish(); } #if defined(OS_ANDROID)
diff --git a/cc/resources/display_resource_provider.h b/cc/resources/display_resource_provider.h index 093629f2..6702a7d 100644 --- a/cc/resources/display_resource_provider.h +++ b/cc/resources/display_resource_provider.h
@@ -22,7 +22,6 @@ DisplayResourceProvider( viz::ContextProvider* compositor_context_provider, viz::SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const viz::ResourceSettings& resource_settings); ~DisplayResourceProvider() override; @@ -209,6 +208,7 @@ scoped_refptr<viz::ResourceFence> current_read_lock_fence_; ChildMap children_; base::flat_map<viz::ResourceId, sk_sp<SkImage>> resource_sk_image_; + viz::ResourceId next_id_; DISALLOW_COPY_AND_ASSIGN(DisplayResourceProvider); };
diff --git a/cc/resources/layer_tree_resource_provider.cc b/cc/resources/layer_tree_resource_provider.cc index 67803bb..dfb5194 100644 --- a/cc/resources/layer_tree_resource_provider.cc +++ b/cc/resources/layer_tree_resource_provider.cc
@@ -4,18 +4,62 @@ #include "cc/resources/layer_tree_resource_provider.h" +#include "base/bits.h" #include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" +#include "cc/resources/resource_util.h" #include "components/viz/common/gpu/context_provider.h" #include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_bitmap_manager.h" +#include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/context_support.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" +#include "gpu/command_buffer/client/raster_interface.h" +#include "third_party/skia/include/core/SkCanvas.h" using gpu::gles2::GLES2Interface; namespace cc { +class TextureIdAllocator { + public: + TextureIdAllocator(GLES2Interface* gl, + size_t texture_id_allocation_chunk_size) + : gl_(gl), + id_allocation_chunk_size_(texture_id_allocation_chunk_size), + ids_(new GLuint[texture_id_allocation_chunk_size]), + next_id_index_(texture_id_allocation_chunk_size) { + DCHECK(id_allocation_chunk_size_); + DCHECK_LE(id_allocation_chunk_size_, + static_cast<size_t>(std::numeric_limits<int>::max())); + } + + ~TextureIdAllocator() { + if (gl_) + gl_->DeleteTextures( + static_cast<int>(id_allocation_chunk_size_ - next_id_index_), + ids_.get() + next_id_index_); + } + + GLuint NextId() { + if (next_id_index_ == id_allocation_chunk_size_) { + gl_->GenTextures(static_cast<int>(id_allocation_chunk_size_), ids_.get()); + next_id_index_ = 0; + } + + return ids_[next_id_index_++]; + } + + private: + GLES2Interface* gl_; + const size_t id_allocation_chunk_size_; + std::unique_ptr<GLuint[]> ids_; + size_t next_id_index_; + + DISALLOW_COPY_AND_ASSIGN(TextureIdAllocator); +}; + namespace { // The resource id in LayerTreeResourceProvider starts from 1 to avoid // conflicts with id from DisplayResourceProvider. @@ -53,10 +97,14 @@ const viz::ResourceSettings& resource_settings) : ResourceProvider(compositor_context_provider, shared_bitmap_manager, - gpu_memory_buffer_manager, delegated_sync_points_required, - resource_settings, - kLayerTreeInitialResourceId) {} + resource_settings), + gpu_memory_buffer_manager_(gpu_memory_buffer_manager), + next_id_(kLayerTreeInitialResourceId) { + GLES2Interface* gl = ContextGL(); + texture_id_allocator_ = std::make_unique<TextureIdAllocator>( + gl, resource_settings.texture_id_allocation_chunk_size); +} LayerTreeResourceProvider::~LayerTreeResourceProvider() { for (auto& pair : imported_resources_) { @@ -66,6 +114,10 @@ bool is_lost = imported.exported_count || imported.returned_lost; imported.release_callback->Run(imported.returned_sync_token, is_lost); } + texture_id_allocator_ = nullptr; + GLES2Interface* gl = ContextGL(); + if (gl) + gl->Finish(); } gpu::SyncToken LayerTreeResourceProvider::GetSyncTokenForResources( @@ -79,6 +131,11 @@ return latest_sync_token; } +gfx::ColorSpace LayerTreeResourceProvider::GetResourceColorSpaceForRaster( + const viz::internal::Resource* resource) const { + return resource->color_space; +} + void LayerTreeResourceProvider::PrepareSendToParent( const ResourceIdArray& export_ids, std::vector<viz::TransferableResource>* list) { @@ -250,6 +307,93 @@ } } +viz::ResourceId LayerTreeResourceProvider::CreateGpuTextureResource( + const gfx::Size& size, + viz::ResourceTextureHint hint, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space) { + DCHECK(compositor_context_provider_); + DCHECK(!size.IsEmpty()); + DCHECK_LE(size.width(), settings_.max_texture_size); + DCHECK_LE(size.height(), settings_.max_texture_size); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(IsTextureFormatSupported(format)); + + bool use_overlay = settings_.use_gpu_memory_buffer_resources || + (hint & viz::ResourceTextureHint::kOverlay); + DCHECK(!use_overlay || !(hint & viz::ResourceTextureHint::kMipmap)); + + viz::ResourceId id = next_id_++; + viz::internal::Resource* resource = + InsertResource(id, viz::internal::Resource( + size, viz::internal::Resource::INTERNAL, hint, + viz::ResourceType::kTexture, format, color_space)); + if (use_overlay && settings_.use_texture_storage_image && + IsGpuMemoryBufferFormatSupported(format, gfx::BufferUsage::SCANOUT)) { + resource->usage = gfx::BufferUsage::SCANOUT; + resource->target = GetImageTextureTarget( + compositor_context_provider_->ContextCapabilities(), resource->usage, + format); + resource->buffer_format = BufferFormat(format); + resource->is_overlay_candidate = true; + } + return id; +} + +viz::ResourceId LayerTreeResourceProvider::CreateGpuMemoryBufferResource( + const gfx::Size& size, + viz::ResourceTextureHint hint, + viz::ResourceFormat format, + gfx::BufferUsage usage, + const gfx::ColorSpace& color_space) { + DCHECK(compositor_context_provider_); + DCHECK(!size.IsEmpty()); + DCHECK(compositor_context_provider_); + DCHECK_LE(size.width(), settings_.max_texture_size); + DCHECK_LE(size.height(), settings_.max_texture_size); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + + viz::ResourceId id = next_id_++; + viz::internal::Resource* resource = InsertResource( + id, viz::internal::Resource(size, viz::internal::Resource::INTERNAL, hint, + viz::ResourceType::kGpuMemoryBuffer, format, + color_space)); + resource->target = GetImageTextureTarget( + compositor_context_provider_->ContextCapabilities(), usage, format); + resource->buffer_format = BufferFormat(format); + resource->usage = usage; + resource->is_overlay_candidate = true; + // GpuMemoryBuffer provides direct access to the memory used by the GPU. Read + // lock fences are required to ensure that we're not trying to map a buffer + // that is currently in-use by the GPU. + resource->read_lock_fences_enabled = true; + return id; +} + +viz::ResourceId LayerTreeResourceProvider::CreateBitmapResource( + const gfx::Size& size, + const gfx::ColorSpace& color_space) { + DCHECK(!compositor_context_provider_); + DCHECK(!size.IsEmpty()); + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + + // TODO(danakj): Allocate this outside ResourceProvider. + std::unique_ptr<viz::SharedBitmap> bitmap = + shared_bitmap_manager_->AllocateSharedBitmap(size); + DCHECK(bitmap); + DCHECK(bitmap->pixels()); + + viz::ResourceId id = next_id_++; + viz::internal::Resource* resource = InsertResource( + id, viz::internal::Resource(size, viz::internal::Resource::INTERNAL, + viz::ResourceTextureHint::kDefault, + viz::ResourceType::kBitmap, viz::RGBA_8888, + color_space)); + resource->SetSharedBitmap(bitmap.get()); + resource->owned_shared_bitmap = std::move(bitmap); + return id; +} + viz::ResourceId LayerTreeResourceProvider::ImportResource( const viz::TransferableResource& resource, std::unique_ptr<viz::SingleReleaseCallback> release_callback) { @@ -274,6 +418,157 @@ } } +void LayerTreeResourceProvider::CopyToResource(viz::ResourceId id, + const uint8_t* image, + const gfx::Size& image_size) { + viz::internal::Resource* resource = GetResource(id); + DCHECK(!resource->locked_for_write); + DCHECK(!resource->lock_for_read_count); + DCHECK_EQ(resource->origin, viz::internal::Resource::INTERNAL); + DCHECK_NE(resource->synchronization_state(), + viz::internal::Resource::NEEDS_WAIT); + DCHECK_EQ(resource->exported_count, 0); + DCHECK(ReadLockFenceHasPassed(resource)); + + DCHECK_EQ(image_size.width(), resource->size.width()); + DCHECK_EQ(image_size.height(), resource->size.height()); + + if (resource->type == viz::ResourceType::kBitmap) { + DCHECK_EQ(viz::ResourceType::kBitmap, resource->type); + DCHECK(resource->allocated); + DCHECK_EQ(viz::RGBA_8888, resource->format); + SkImageInfo source_info = + SkImageInfo::MakeN32Premul(image_size.width(), image_size.height()); + size_t image_stride = image_size.width() * 4; + + ScopedWriteLockSoftware lock(this, id); + SkCanvas dest(lock.sk_bitmap()); + dest.writePixels(source_info, image, image_stride, 0, 0); + } else { + // No sync token needed because the lock will set synchronization state to + // LOCALLY_USED and a sync token will be generated in PrepareSendToParent. + ScopedWriteLockGL lock(this, id); + GLuint texture_id = lock.GetTexture(); + DCHECK(texture_id); + GLES2Interface* gl = ContextGL(); + DCHECK(gl); + gl->BindTexture(resource->target, texture_id); + if (resource->format == viz::ETC1) { + DCHECK_EQ(resource->target, static_cast<GLenum>(GL_TEXTURE_2D)); + int image_bytes = + ResourceUtil::CheckedSizeInBytes<int>(image_size, viz::ETC1); + gl->CompressedTexImage2D(resource->target, 0, GLInternalFormat(viz::ETC1), + image_size.width(), image_size.height(), 0, + image_bytes, image); + lock.set_allocated(); + } else { + gl->TexSubImage2D(resource->target, 0, 0, 0, image_size.width(), + image_size.height(), GLDataFormat(resource->format), + GLDataType(resource->format), image); + } + } + DCHECK(resource->allocated); +} + +void LayerTreeResourceProvider::CreateForTesting(viz::ResourceId id) { + CreateTexture(GetResource(id)); +} + +void LayerTreeResourceProvider::CreateTexture( + viz::internal::Resource* resource) { + if (!resource->is_gpu_resource_type()) + return; + + if (resource->gl_id) + return; + + DCHECK_EQ(resource->origin, viz::internal::Resource::INTERNAL); + DCHECK(resource->mailbox.IsZero()); + + resource->gl_id = texture_id_allocator_->NextId(); + DCHECK(resource->gl_id); + + GLES2Interface* gl = ContextGL(); + DCHECK(gl); + + // Create and set texture properties. Allocation is delayed until needed. + gl->BindTexture(resource->target, resource->gl_id); + gl->TexParameteri(resource->target, GL_TEXTURE_MIN_FILTER, + resource->original_filter); + gl->TexParameteri(resource->target, GL_TEXTURE_MAG_FILTER, + resource->original_filter); + gl->TexParameteri(resource->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + gl->TexParameteri(resource->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + if (settings_.use_texture_usage_hint && + (resource->hint & viz::ResourceTextureHint::kFramebuffer)) { + gl->TexParameteri(resource->target, GL_TEXTURE_USAGE_ANGLE, + GL_FRAMEBUFFER_ATTACHMENT_ANGLE); + } +} + +void LayerTreeResourceProvider::CreateMailbox( + viz::internal::Resource* resource) { + if (!resource->is_gpu_resource_type()) + return; + + if (!resource->mailbox.IsZero()) + return; + + CreateTexture(resource); + + DCHECK(resource->gl_id); + DCHECK_EQ(resource->origin, viz::internal::Resource::INTERNAL); + + gpu::gles2::GLES2Interface* gl = ContextGL(); + DCHECK(gl); + gl->GenMailboxCHROMIUM(resource->mailbox.name); + gl->ProduceTextureDirectCHROMIUM(resource->gl_id, resource->mailbox.name); + resource->SetLocallyUsed(); +} + +void LayerTreeResourceProvider::CreateAndBindImage( + viz::internal::Resource* resource) { + DCHECK(resource->gpu_memory_buffer); +#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) + // TODO(reveman): This avoids a performance problem on ARM ChromeOS + // devices. This only works with shared memory backed buffers. + // https://crbug.com/580166 + DCHECK_EQ(resource->gpu_memory_buffer->GetHandle().type, + gfx::SHARED_MEMORY_BUFFER); +#endif + CreateTexture(resource); + + gpu::gles2::GLES2Interface* gl = ContextGL(); + DCHECK(gl); + + gl->BindTexture(resource->target, resource->gl_id); + + if (!resource->image_id) { + resource->image_id = gl->CreateImageCHROMIUM( + resource->gpu_memory_buffer->AsClientBuffer(), resource->size.width(), + resource->size.height(), GLInternalFormat(resource->format)); + + DCHECK(resource->image_id || + gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR); + + gl->BindTexImage2DCHROMIUM(resource->target, resource->image_id); + } else { + gl->ReleaseTexImage2DCHROMIUM(resource->target, resource->image_id); + gl->BindTexImage2DCHROMIUM(resource->target, resource->image_id); + } +} + +void LayerTreeResourceProvider::AllocateForTesting(viz::ResourceId id) { + viz::internal::Resource* resource = GetResource(id); + if (!resource->allocated) { + // Software and external resources are marked allocated on creation. + DCHECK(resource->is_gpu_resource_type()); + DCHECK_EQ(resource->origin, viz::internal::Resource::INTERNAL); + ScopedWriteLockGL resource_lock(this, id); + resource_lock.GetTexture(); // Allocates texture. + } +} + void LayerTreeResourceProvider::TransferResource( viz::internal::Resource* source, viz::ResourceId id, @@ -306,6 +601,174 @@ } } +bool LayerTreeResourceProvider::CanLockForWrite(viz::ResourceId id) { + viz::internal::Resource* resource = GetResource(id); + return !resource->locked_for_write && !resource->lock_for_read_count && + !resource->exported_count && + resource->origin == viz::internal::Resource::INTERNAL && + !resource->lost && ReadLockFenceHasPassed(resource); +} + +viz::internal::Resource* LayerTreeResourceProvider::LockForWrite( + viz::ResourceId id) { + DCHECK(CanLockForWrite(id)); + viz::internal::Resource* resource = GetResource(id); + WaitSyncTokenInternal(resource); + resource->SetLocallyUsed(); + resource->locked_for_write = true; + resource->mipmap_state = viz::internal::Resource::INVALID; + return resource; +} + +void LayerTreeResourceProvider::UnlockForWrite( + viz::internal::Resource* resource) { + DCHECK(resource->locked_for_write); + DCHECK_EQ(resource->exported_count, 0); + DCHECK(resource->origin == viz::internal::Resource::INTERNAL); + resource->locked_for_write = false; +} + +LayerTreeResourceProvider::ScopedWriteLockGpu::ScopedWriteLockGpu( + LayerTreeResourceProvider* resource_provider, + viz::ResourceId resource_id) + : resource_provider_(resource_provider), resource_id_(resource_id) { + viz::internal::Resource* resource = + resource_provider->LockForWrite(resource_id); + DCHECK_EQ(resource->type, viz::ResourceType::kTexture); + resource_provider->CreateTexture(resource); + size_ = resource->size; + format_ = resource->format; + color_space_ = resource_provider_->GetResourceColorSpaceForRaster(resource); + texture_id_ = resource->gl_id; + target_ = resource->target; + hint_ = resource->hint; + mailbox_ = resource->mailbox; + is_overlay_ = resource->is_overlay_candidate; + allocated_ = resource->allocated; +} + +LayerTreeResourceProvider::ScopedWriteLockGpu::~ScopedWriteLockGpu() { + viz::internal::Resource* resource = + resource_provider_->GetResource(resource_id_); + DCHECK(resource->locked_for_write); + resource->allocated = allocated_; + resource->mailbox = mailbox_; + // Don't set empty sync token otherwise resource will be marked synchronized. + if (has_sync_token_) + resource->UpdateSyncToken(sync_token_); + if (synchronized_) + resource->SetSynchronized(); + if (generate_mipmap_) + resource->SetGenerateMipmap(); + resource_provider_->UnlockForWrite(resource); +} + +GrPixelConfig LayerTreeResourceProvider::ScopedWriteLockGpu::PixelConfig() + const { + return ToGrPixelConfig(format_); +} + +void LayerTreeResourceProvider::ScopedWriteLockGpu::CreateMailbox() { + if (!mailbox_.IsZero()) + return; + gpu::gles2::GLES2Interface* gl = resource_provider_->ContextGL(); + DCHECK(gl); + gl->GenMailboxCHROMIUM(mailbox_.name); + gl->ProduceTextureDirectCHROMIUM(texture_id_, mailbox_.name); +} + +LayerTreeResourceProvider::ScopedWriteLockGL::ScopedWriteLockGL( + LayerTreeResourceProvider* resource_provider, + viz::ResourceId resource_id) + : ScopedWriteLockGpu(resource_provider, resource_id) {} + +LayerTreeResourceProvider::ScopedWriteLockGL::~ScopedWriteLockGL() {} + +GLuint LayerTreeResourceProvider::ScopedWriteLockGL::GetTexture() { + LazyAllocate(resource_provider_->ContextGL(), texture_id_); + return texture_id_; +} + +void LayerTreeResourceProvider::ScopedWriteLockGL::LazyAllocate( + gpu::gles2::GLES2Interface* gl, + GLuint texture_id) { + // ETC1 resources cannot be preallocated. + if (format_ == viz::ETC1) + return; + + if (allocated_) + return; + allocated_ = true; + + const ResourceProvider::Settings& settings = resource_provider_->settings_; + + gl->BindTexture(target_, texture_id); + + if (is_overlay_) { + DCHECK(settings.use_texture_storage_image); + gl->TexStorage2DImageCHROMIUM(target_, viz::TextureStorageFormat(format_), + GL_SCANOUT_CHROMIUM, size_.width(), + size_.height()); + if (color_space_.IsValid()) { + gl->SetColorSpaceMetadataCHROMIUM( + texture_id, reinterpret_cast<GLColorSpace>(&color_space_)); + } + } else if (settings.use_texture_storage) { + GLint levels = 1; + if (settings.use_texture_npot && + (hint_ & viz::ResourceTextureHint::kMipmap)) { + levels += base::bits::Log2Floor(std::max(size_.width(), size_.height())); + } + gl->TexStorage2DEXT(target_, levels, viz::TextureStorageFormat(format_), + size_.width(), size_.height()); + } else { + gl->TexImage2D(target_, 0, GLInternalFormat(format_), size_.width(), + size_.height(), 0, GLDataFormat(format_), + GLDataType(format_), nullptr); + } +} + +LayerTreeResourceProvider::ScopedWriteLockRaster::ScopedWriteLockRaster( + LayerTreeResourceProvider* resource_provider, + viz::ResourceId resource_id) + : ScopedWriteLockGpu(resource_provider, resource_id) {} + +LayerTreeResourceProvider::ScopedWriteLockRaster::~ScopedWriteLockRaster() {} + +GLuint LayerTreeResourceProvider::ScopedWriteLockRaster::ConsumeTexture( + gpu::raster::RasterInterface* ri) { + DCHECK(ri); + DCHECK(!mailbox_.IsZero()); + + GLuint texture_id = ri->CreateAndConsumeTextureCHROMIUM(mailbox_.name); + DCHECK(texture_id); + + LazyAllocate(ri, texture_id); + + return texture_id; +} + +void LayerTreeResourceProvider::ScopedWriteLockRaster::LazyAllocate( + gpu::raster::RasterInterface* ri, + GLuint texture_id) { + // ETC1 resources cannot be preallocated. + if (format_ == viz::ETC1) + return; + + if (allocated_) + return; + allocated_ = true; + + ri->BindTexture(target_, texture_id); + ri->TexStorageForRaster( + target_, format_, size_.width(), size_.height(), + is_overlay_ ? gpu::raster::kOverlay : gpu::raster::kNone); + if (is_overlay_ && color_space_.IsValid()) { + ri->SetColorSpaceMetadataCHROMIUM( + texture_id, reinterpret_cast<GLColorSpace>(&color_space_)); + } +} + LayerTreeResourceProvider::ScopedWriteLockGpuMemoryBuffer :: ScopedWriteLockGpuMemoryBuffer(LayerTreeResourceProvider* resource_provider, viz::ResourceId resource_id) @@ -348,6 +811,24 @@ return gpu_memory_buffer_.get(); } +LayerTreeResourceProvider::ScopedWriteLockSoftware::ScopedWriteLockSoftware( + LayerTreeResourceProvider* resource_provider, + viz::ResourceId resource_id) + : resource_provider_(resource_provider), resource_id_(resource_id) { + viz::internal::Resource* resource = + resource_provider->LockForWrite(resource_id); + resource_provider->PopulateSkBitmapWithResource(&sk_bitmap_, resource); + color_space_ = resource_provider->GetResourceColorSpaceForRaster(resource); + DCHECK(valid()); +} + +LayerTreeResourceProvider::ScopedWriteLockSoftware::~ScopedWriteLockSoftware() { + viz::internal::Resource* resource = + resource_provider_->GetResource(resource_id_); + resource->SetSynchronized(); + resource_provider_->UnlockForWrite(resource); +} + void LayerTreeResourceProvider::ValidateResource(viz::ResourceId id) const { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(id);
diff --git a/cc/resources/layer_tree_resource_provider.h b/cc/resources/layer_tree_resource_provider.h index 08e33e17..bba192d 100644 --- a/cc/resources/layer_tree_resource_provider.h +++ b/cc/resources/layer_tree_resource_provider.h
@@ -11,7 +11,15 @@ class SharedBitmapManager; } // namespace viz +namespace gpu { +class GpuMemoryBufferManager; +namespace raster { +class RasterInterface; +} +} // namespace gpu + namespace cc { +class TextureIdAllocator; // This class is not thread-safe and can only be called from the thread it was // created on (in practice, the impl thread). @@ -43,6 +51,19 @@ void ReceiveReturnsFromParent( const std::vector<viz::ReturnedResource>& transferable_resources); + viz::ResourceId CreateGpuTextureResource(const gfx::Size& size, + viz::ResourceTextureHint hint, + viz::ResourceFormat format, + const gfx::ColorSpace& color_space); + viz::ResourceId CreateGpuMemoryBufferResource( + const gfx::Size& size, + viz::ResourceTextureHint hint, + viz::ResourceFormat format, + gfx::BufferUsage usage, + const gfx::ColorSpace& color_space); + viz::ResourceId CreateBitmapResource(const gfx::Size& size, + const gfx::ColorSpace& color_space); + // Receives a resource from an external client that can be used in compositor // frames, via the returned ResourceId. viz::ResourceId ImportResource(const viz::TransferableResource&, @@ -50,15 +71,120 @@ // Removes an imported resource, which will call the ReleaseCallback given // originally, once the resource is no longer in use by any compositor frame. void RemoveImportedResource(viz::ResourceId); + // Update pixels from image, copying source_rect (in image) to dest_offset (in + // the resource). + void CopyToResource(viz::ResourceId id, + const uint8_t* image, + const gfx::Size& image_size); + + // For tests only! This prevents detecting uninitialized reads. + // Use SetPixels or LockForWrite to allocate implicitly. + void AllocateForTesting(viz::ResourceId id); + + // For tests only! + void CreateForTesting(viz::ResourceId id); // Verify that the ResourceId is valid and is known to this class, for debug // checks. void ValidateResource(viz::ResourceId id) const; - // The following lock classes are part of the LayerTreeResourceProvider API - // and are needed to write the resource contents. The user must ensure that - // they only use GL locks on GL resources, etc, and this is enforced by - // assertions. + // Indicates if we can currently lock this resource for write. + bool CanLockForWrite(viz::ResourceId id); + + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { + return gpu_memory_buffer_manager_; + } + + // The following lock classes are part of the ResourceProvider API and are + // needed to read and write the resource contents. The user must ensure + // that they only use GL locks on GL resources, etc, and this is enforced + // by assertions. + class CC_EXPORT ScopedWriteLockGpu { + public: + ScopedWriteLockGpu(LayerTreeResourceProvider* resource_provider, + viz::ResourceId resource_id); + ~ScopedWriteLockGpu(); + + GLenum target() const { return target_; } + viz::ResourceFormat format() const { return format_; } + const gfx::Size& size() const { return size_; } + const gfx::ColorSpace& color_space_for_raster() const { + return color_space_; + } + + GrPixelConfig PixelConfig() const; + + void set_allocated() { allocated_ = true; } + + void set_sync_token(const gpu::SyncToken& sync_token) { + sync_token_ = sync_token; + has_sync_token_ = true; + } + + void set_synchronized() { synchronized_ = true; } + + void set_generate_mipmap() { generate_mipmap_ = true; } + + // Creates mailbox on compositor context that can be consumed on another + // context. + void CreateMailbox(); + + protected: + LayerTreeResourceProvider* const resource_provider_; + const viz::ResourceId resource_id_; + + // The following are copied from the resource. + gfx::Size size_; + viz::ResourceFormat format_; + gfx::ColorSpace color_space_; + GLuint texture_id_; + GLenum target_; + viz::ResourceTextureHint hint_; + gpu::Mailbox mailbox_; + bool is_overlay_; + bool allocated_; + + // Set by the user. + gpu::SyncToken sync_token_; + bool has_sync_token_ = false; + bool synchronized_ = false; + bool generate_mipmap_ = false; + + private: + DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpu); + }; + + class CC_EXPORT ScopedWriteLockGL : public ScopedWriteLockGpu { + public: + ScopedWriteLockGL(LayerTreeResourceProvider* resource_provider, + viz::ResourceId resource_id); + ~ScopedWriteLockGL(); + + // Returns texture id on compositor context, allocating if necessary. + GLuint GetTexture(); + + private: + void LazyAllocate(gpu::gles2::GLES2Interface* gl, GLuint texture_id); + + DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGL); + }; + + class CC_EXPORT ScopedWriteLockRaster : public ScopedWriteLockGpu { + public: + ScopedWriteLockRaster(LayerTreeResourceProvider* resource_provider, + viz::ResourceId resource_id); + ~ScopedWriteLockRaster(); + + // Creates a texture id, allocating if necessary, on the given context. The + // texture id must be deleted by the caller. + GLuint ConsumeTexture(gpu::raster::RasterInterface* ri); + + private: + void LazyAllocate(gpu::raster::RasterInterface* gl, GLuint texture_id); + + DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockRaster); + }; + class CC_EXPORT ScopedWriteLockGpuMemoryBuffer { public: ScopedWriteLockGpuMemoryBuffer(LayerTreeResourceProvider* resource_provider, @@ -82,17 +208,50 @@ DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); }; + class CC_EXPORT ScopedWriteLockSoftware { + public: + ScopedWriteLockSoftware(LayerTreeResourceProvider* resource_provider, + viz::ResourceId resource_id); + ~ScopedWriteLockSoftware(); + + SkBitmap& sk_bitmap() { return sk_bitmap_; } + bool valid() const { return !!sk_bitmap_.getPixels(); } + const gfx::ColorSpace& color_space_for_raster() const { + return color_space_; + } + + private: + LayerTreeResourceProvider* const resource_provider_; + const viz::ResourceId resource_id_; + gfx::ColorSpace color_space_; + SkBitmap sk_bitmap_; + DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); + }; + + protected: + viz::internal::Resource* LockForWrite(viz::ResourceId id); + void UnlockForWrite(viz::internal::Resource* resource); + void CreateMailbox(viz::internal::Resource* resource); + private: // base::trace_event::MemoryDumpProvider implementation. bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, base::trace_event::ProcessMemoryDump* pmd) override; + gfx::ColorSpace GetResourceColorSpaceForRaster( + const viz::internal::Resource* resource) const; + + void CreateTexture(viz::internal::Resource* resource); + void CreateAndBindImage(viz::internal::Resource* resource); void TransferResource(viz::internal::Resource* source, viz::ResourceId id, viz::TransferableResource* resource); struct ImportedResource; base::flat_map<viz::ResourceId, ImportedResource> imported_resources_; + std::unique_ptr<TextureIdAllocator> texture_id_allocator_; + gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; + viz::ResourceId next_id_; DISALLOW_COPY_AND_ASSIGN(LayerTreeResourceProvider); };
diff --git a/cc/resources/resource.h b/cc/resources/resource.h index f7978d50..f35fa0b 100644 --- a/cc/resources/resource.h +++ b/cc/resources/resource.h
@@ -5,11 +5,11 @@ #ifndef CC_RESOURCES_RESOURCE_H_ #define CC_RESOURCES_RESOURCE_H_ -#include "base/logging.h" #include "base/macros.h" #include "cc/cc_export.h" -#include "cc/resources/resource_provider.h" -#include "cc/resources/resource_util.h" +#include "components/viz/common/resources/resource_format.h" +#include "components/viz/common/resources/resource_id.h" +#include "ui/gfx/color_space.h" #include "ui/gfx/geometry/size.h" namespace cc {
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc index ab9801e2..37cd2edd 100644 --- a/cc/resources/resource_pool.cc +++ b/cc/resources/resource_pool.cc
@@ -17,7 +17,7 @@ #include "base/trace_event/memory_dump_manager.h" #include "build/build_config.h" #include "cc/base/container_util.h" -#include "cc/resources/resource_provider.h" +#include "cc/resources/layer_tree_resource_provider.h" #include "cc/resources/resource_util.h" #include "cc/resources/scoped_resource.h" @@ -42,8 +42,8 @@ return false; // GetArea will crash on overflow, however all sizes in use are tile sizes. - // These are capped at ResourceProvider::max_texture_size(), and will not - // overflow. + // These are capped at LayerTreeResourceProvider::max_texture_size(), and will + // not overflow. float actual_area = actual_size.GetArea(); float requested_area = requested_size.GetArea(); // Don't use a resource that is more than |kReuseThreshold| times the @@ -60,10 +60,10 @@ void ResourcePool::PoolResource::OnMemoryDump( base::trace_event::ProcessMemoryDump* pmd, - const ResourceProvider* resource_provider, + const LayerTreeResourceProvider* resource_provider, bool is_free) const { - // Resource IDs are not process-unique, so log with the ResourceProvider's - // unique id. + // Resource IDs are not process-unique, so log with the + // LayerTreeResourceProvider's unique id. std::string parent_node = base::StringPrintf("cc/resource_memory/provider_%d/resource_%d", resource_provider->tracing_id(), id()); @@ -84,7 +84,7 @@ } } -ResourcePool::ResourcePool(ResourceProvider* resource_provider, +ResourcePool::ResourcePool(LayerTreeResourceProvider* resource_provider, base::SingleThreadTaskRunner* task_runner, gfx::BufferUsage usage, const base::TimeDelta& expiration_delay, @@ -109,7 +109,7 @@ base::MemoryCoordinatorClientRegistry::GetInstance()->Register(this); } -ResourcePool::ResourcePool(ResourceProvider* resource_provider, +ResourcePool::ResourcePool(LayerTreeResourceProvider* resource_provider, bool gpu_resources, base::SingleThreadTaskRunner* task_runner, viz::ResourceTextureHint hint,
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h index 402622fb..706dded 100644 --- a/cc/resources/resource_pool.h +++ b/cc/resources/resource_pool.h
@@ -15,11 +15,17 @@ #include "base/macros.h" #include "base/memory/memory_coordinator_client.h" #include "base/memory/ptr_util.h" +#include "base/memory/weak_ptr.h" #include "base/trace_event/memory_dump_provider.h" #include "cc/cc_export.h" #include "cc/resources/resource.h" #include "cc/resources/scoped_resource.h" #include "components/viz/common/resources/resource_format.h" +#include "ui/gfx/geometry/rect.h" + +namespace base { +class SingleThreadTaskRunner; +} namespace cc { @@ -31,7 +37,7 @@ base::TimeDelta::FromSeconds(5); static std::unique_ptr<ResourcePool> CreateForGpuMemoryBufferResources( - ResourceProvider* resource_provider, + LayerTreeResourceProvider* resource_provider, base::SingleThreadTaskRunner* task_runner, gfx::BufferUsage usage, const base::TimeDelta& expiration_delay, @@ -42,7 +48,7 @@ } static std::unique_ptr<ResourcePool> Create( - ResourceProvider* resource_provider, + LayerTreeResourceProvider* resource_provider, bool gpu_resources, base::SingleThreadTaskRunner* task_runner, viz::ResourceTextureHint hint, @@ -108,14 +114,14 @@ protected: // Constructor for creating GPU memory buffer resources. - ResourcePool(ResourceProvider* resource_provider, + ResourcePool(LayerTreeResourceProvider* resource_provider, base::SingleThreadTaskRunner* task_runner, gfx::BufferUsage usage, const base::TimeDelta& expiration_delay, bool disallow_non_exact_reuse); // Constructor for creating standard resources. - ResourcePool(ResourceProvider* resource_provider, + ResourcePool(LayerTreeResourceProvider* resource_provider, bool gpu_resources, base::SingleThreadTaskRunner* task_runner, viz::ResourceTextureHint hint, @@ -128,11 +134,11 @@ class PoolResource : public ScopedResource { public: static std::unique_ptr<PoolResource> Create( - ResourceProvider* resource_provider) { + LayerTreeResourceProvider* resource_provider) { return base::WrapUnique(new PoolResource(resource_provider)); } void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, - const ResourceProvider* resource_provider, + const LayerTreeResourceProvider* resource_provider, bool is_free) const; uint64_t content_id() const { return content_id_; } @@ -147,7 +153,7 @@ } private: - explicit PoolResource(ResourceProvider* resource_provider) + explicit PoolResource(LayerTreeResourceProvider* resource_provider) : ScopedResource(resource_provider), content_id_(0) {} uint64_t content_id_; base::TimeTicks last_usage_; @@ -178,7 +184,7 @@ bool HasEvictableResources() const; base::TimeTicks GetUsageTimeForLRUResource() const; - ResourceProvider* resource_provider_ = nullptr; + LayerTreeResourceProvider* resource_provider_ = nullptr; bool use_gpu_resources_ = false; bool use_gpu_memory_buffers_ = false; gfx::BufferUsage usage_ = gfx::BufferUsage::GPU_READ_CPU_READ_WRITE;
diff --git a/cc/resources/resource_pool_unittest.cc b/cc/resources/resource_pool_unittest.cc index db930ce..61fde69 100644 --- a/cc/resources/resource_pool_unittest.cc +++ b/cc/resources/resource_pool_unittest.cc
@@ -22,8 +22,8 @@ void SetUp() override { context_provider_ = TestContextProvider::Create(); context_provider_->BindToCurrentThread(); - resource_provider_ = - FakeResourceProvider::Create(context_provider_.get(), nullptr); + resource_provider_ = FakeResourceProvider::CreateLayerTreeResourceProvider( + context_provider_.get(), nullptr); task_runner_ = base::ThreadTaskRunnerHandle::Get(); resource_pool_ = ResourcePool::Create(resource_provider_.get(), true, task_runner_.get(), @@ -39,7 +39,7 @@ } scoped_refptr<TestContextProvider> context_provider_; - std::unique_ptr<ResourceProvider> resource_provider_; + std::unique_ptr<LayerTreeResourceProvider> resource_provider_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_; std::unique_ptr<ResourcePool> resource_pool_; };
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc index 06e1aa9b..2df25f4 100644 --- a/cc/resources/resource_provider.cc +++ b/cc/resources/resource_provider.cc
@@ -12,7 +12,6 @@ #include <unordered_map> #include "base/atomic_sequence_num.h" -#include "base/bits.h" #include "base/macros.h" #include "base/metrics/histogram.h" #include "base/numerics/safe_math.h" @@ -30,7 +29,6 @@ #include "components/viz/common/resources/returned_resource.h" #include "components/viz/common/resources/shared_bitmap_manager.h" #include "components/viz/common/resources/transferable_resource.h" -#include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/context_support.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" @@ -39,7 +37,6 @@ #include "skia/ext/texture_handle.h" #include "third_party/khronos/GLES2/gl2.h" #include "third_party/khronos/GLES2/gl2ext.h" -#include "third_party/skia/include/core/SkCanvas.h" #include "third_party/skia/include/core/SkSurface.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrContext.h" @@ -53,43 +50,6 @@ namespace cc { -class TextureIdAllocator { - public: - TextureIdAllocator(GLES2Interface* gl, - size_t texture_id_allocation_chunk_size) - : gl_(gl), - id_allocation_chunk_size_(texture_id_allocation_chunk_size), - ids_(new GLuint[texture_id_allocation_chunk_size]), - next_id_index_(texture_id_allocation_chunk_size) { - DCHECK(id_allocation_chunk_size_); - DCHECK_LE(id_allocation_chunk_size_, - static_cast<size_t>(std::numeric_limits<int>::max())); - } - - ~TextureIdAllocator() { - gl_->DeleteTextures( - static_cast<int>(id_allocation_chunk_size_ - next_id_index_), - ids_.get() + next_id_index_); - } - - GLuint NextId() { - if (next_id_index_ == id_allocation_chunk_size_) { - gl_->GenTextures(static_cast<int>(id_allocation_chunk_size_), ids_.get()); - next_id_index_ = 0; - } - - return ids_[next_id_index_++]; - } - - private: - GLES2Interface* gl_; - const size_t id_allocation_chunk_size_; - std::unique_ptr<GLuint[]> ids_; - size_t next_id_index_; - - DISALLOW_COPY_AND_ASSIGN(TextureIdAllocator); -}; - namespace { class ScopedSetActiveTexture { @@ -166,25 +126,18 @@ ResourceProvider::ResourceProvider( viz::ContextProvider* compositor_context_provider, viz::SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, bool delegated_sync_points_required, - const viz::ResourceSettings& resource_settings, - viz::ResourceId next_id) + const viz::ResourceSettings& resource_settings) : settings_(compositor_context_provider, delegated_sync_points_required, resource_settings), compositor_context_provider_(compositor_context_provider), shared_bitmap_manager_(shared_bitmap_manager), - gpu_memory_buffer_manager_(gpu_memory_buffer_manager), - next_id_(next_id), next_child_(1), lost_context_provider_(false), - texture_target_exception_list_( - resource_settings.texture_target_exception_list), tracing_id_(g_next_resource_provider_tracing_id.GetNext()) { DCHECK(resource_settings.texture_id_allocation_chunk_size); DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - DCHECK_GT(next_id_, viz::kInvalidResourceId); // In certain cases, ThreadTaskRunnerHandle isn't set (Android Webview). // Don't register a dump provider in these cases. @@ -196,11 +149,6 @@ if (!compositor_context_provider) return; - - DCHECK(!texture_id_allocator_); - GLES2Interface* gl = ContextGL(); - texture_id_allocator_.reset(new TextureIdAllocator( - gl, resource_settings.texture_id_allocation_chunk_size)); } ResourceProvider::~ResourceProvider() { @@ -218,12 +166,6 @@ for (const auto& pair : resources_) DCHECK(!pair.second.is_gpu_resource_type()); #endif // DCHECK_IS_ON() - - texture_id_allocator_ = nullptr; - - GLES2Interface* gl = ContextGL(); - DCHECK(gl); - gl->Finish(); } bool ResourceProvider::IsTextureFormatSupported( @@ -338,90 +280,6 @@ } } -viz::ResourceId ResourceProvider::CreateGpuTextureResource( - const gfx::Size& size, - viz::ResourceTextureHint hint, - viz::ResourceFormat format, - const gfx::ColorSpace& color_space) { - DCHECK(compositor_context_provider_); - DCHECK(!size.IsEmpty()); - DCHECK_LE(size.width(), settings_.max_texture_size); - DCHECK_LE(size.height(), settings_.max_texture_size); - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - DCHECK(IsTextureFormatSupported(format)); - - bool use_overlay = settings_.use_gpu_memory_buffer_resources || - (hint & viz::ResourceTextureHint::kOverlay); - DCHECK(!use_overlay || !(hint & viz::ResourceTextureHint::kMipmap)); - - viz::ResourceId id = next_id_++; - viz::internal::Resource* resource = - InsertResource(id, viz::internal::Resource( - size, viz::internal::Resource::INTERNAL, hint, - viz::ResourceType::kTexture, format, color_space)); - if (use_overlay && settings_.use_texture_storage_image && - IsGpuMemoryBufferFormatSupported(format, gfx::BufferUsage::SCANOUT)) { - resource->usage = gfx::BufferUsage::SCANOUT; - resource->target = GetImageTextureTarget(resource->usage, format); - resource->buffer_format = BufferFormat(format); - resource->is_overlay_candidate = true; - } - return id; -} - -viz::ResourceId ResourceProvider::CreateGpuMemoryBufferResource( - const gfx::Size& size, - viz::ResourceTextureHint hint, - viz::ResourceFormat format, - gfx::BufferUsage usage, - const gfx::ColorSpace& color_space) { - DCHECK(compositor_context_provider_); - DCHECK(!size.IsEmpty()); - DCHECK(compositor_context_provider_); - DCHECK_LE(size.width(), settings_.max_texture_size); - DCHECK_LE(size.height(), settings_.max_texture_size); - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - - viz::ResourceId id = next_id_++; - viz::internal::Resource* resource = InsertResource( - id, viz::internal::Resource(size, viz::internal::Resource::INTERNAL, hint, - viz::ResourceType::kGpuMemoryBuffer, format, - color_space)); - resource->target = GetImageTextureTarget(usage, format); - resource->buffer_format = BufferFormat(format); - resource->usage = usage; - resource->is_overlay_candidate = true; - // GpuMemoryBuffer provides direct access to the memory used by the GPU. Read - // lock fences are required to ensure that we're not trying to map a buffer - // that is currently in-use by the GPU. - resource->read_lock_fences_enabled = true; - return id; -} - -viz::ResourceId ResourceProvider::CreateBitmapResource( - const gfx::Size& size, - const gfx::ColorSpace& color_space) { - DCHECK(!compositor_context_provider_); - DCHECK(!size.IsEmpty()); - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - - // TODO(danakj): Allocate this outside ResourceProvider. - std::unique_ptr<viz::SharedBitmap> bitmap = - shared_bitmap_manager_->AllocateSharedBitmap(size); - DCHECK(bitmap); - DCHECK(bitmap->pixels()); - - viz::ResourceId id = next_id_++; - viz::internal::Resource* resource = InsertResource( - id, viz::internal::Resource(size, viz::internal::Resource::INTERNAL, - viz::ResourceTextureHint::kDefault, - viz::ResourceType::kBitmap, viz::RGBA_8888, - color_space)); - resource->SetSharedBitmap(bitmap.get()); - resource->owned_shared_bitmap = std::move(bitmap); - return id; -} - void ResourceProvider::DeleteResource(viz::ResourceId id) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); ResourceMap::iterator it = resources_.find(id); @@ -508,67 +366,6 @@ return GetResource(id)->target; } -viz::ResourceTextureHint ResourceProvider::GetTextureHint(viz::ResourceId id) { - return GetResource(id)->hint; -} - -gfx::ColorSpace ResourceProvider::GetResourceColorSpaceForRaster( - const viz::internal::Resource* resource) const { - return resource->color_space; -} - -void ResourceProvider::CopyToResource(viz::ResourceId id, - const uint8_t* image, - const gfx::Size& image_size) { - viz::internal::Resource* resource = GetResource(id); - DCHECK(!resource->locked_for_write); - DCHECK(!resource->lock_for_read_count); - DCHECK_EQ(resource->origin, viz::internal::Resource::INTERNAL); - DCHECK_NE(resource->synchronization_state(), - viz::internal::Resource::NEEDS_WAIT); - DCHECK_EQ(resource->exported_count, 0); - DCHECK(ReadLockFenceHasPassed(resource)); - - DCHECK_EQ(image_size.width(), resource->size.width()); - DCHECK_EQ(image_size.height(), resource->size.height()); - - if (resource->type == viz::ResourceType::kBitmap) { - DCHECK_EQ(viz::ResourceType::kBitmap, resource->type); - DCHECK(resource->allocated); - DCHECK_EQ(viz::RGBA_8888, resource->format); - SkImageInfo source_info = - SkImageInfo::MakeN32Premul(image_size.width(), image_size.height()); - size_t image_stride = image_size.width() * 4; - - ScopedWriteLockSoftware lock(this, id); - SkCanvas dest(lock.sk_bitmap()); - dest.writePixels(source_info, image, image_stride, 0, 0); - } else { - // No sync token needed because the lock will set synchronization state to - // LOCALLY_USED and a sync token will be generated in PrepareSendToParent. - ScopedWriteLockGL lock(this, id); - GLuint texture_id = lock.GetTexture(); - DCHECK(texture_id); - GLES2Interface* gl = ContextGL(); - DCHECK(gl); - gl->BindTexture(resource->target, texture_id); - if (resource->format == viz::ETC1) { - DCHECK_EQ(resource->target, static_cast<GLenum>(GL_TEXTURE_2D)); - int image_bytes = - ResourceUtil::CheckedSizeInBytes<int>(image_size, viz::ETC1); - gl->CompressedTexImage2D(resource->target, 0, GLInternalFormat(viz::ETC1), - image_size.width(), image_size.height(), 0, - image_bytes, image); - lock.set_allocated(); - } else { - gl->TexSubImage2D(resource->target, 0, 0, 0, image_size.width(), - image_size.height(), GLDataFormat(resource->format), - GLDataType(resource->format), image); - } - } - DCHECK(resource->allocated); -} - viz::internal::Resource* ResourceProvider::InsertResource( viz::ResourceId id, viz::internal::Resource resource) { @@ -586,24 +383,6 @@ return &it->second; } -viz::internal::Resource* ResourceProvider::LockForWrite(viz::ResourceId id) { - DCHECK(CanLockForWrite(id)); - viz::internal::Resource* resource = GetResource(id); - WaitSyncTokenInternal(resource); - resource->SetLocallyUsed(); - resource->locked_for_write = true; - resource->mipmap_state = viz::internal::Resource::INVALID; - return resource; -} - -bool ResourceProvider::CanLockForWrite(viz::ResourceId id) { - viz::internal::Resource* resource = GetResource(id); - return !resource->locked_for_write && !resource->lock_for_read_count && - !resource->exported_count && - resource->origin == viz::internal::Resource::INTERNAL && - !resource->lost && ReadLockFenceHasPassed(resource); -} - bool ResourceProvider::IsOverlayCandidate(viz::ResourceId id) { viz::internal::Resource* resource = GetResource(id); return resource->is_overlay_candidate; @@ -629,159 +408,12 @@ } #endif -void ResourceProvider::UnlockForWrite(viz::internal::Resource* resource) { - DCHECK(resource->locked_for_write); - DCHECK_EQ(resource->exported_count, 0); - DCHECK(resource->origin == viz::internal::Resource::INTERNAL); - resource->locked_for_write = false; -} - void ResourceProvider::EnableReadLockFencesForTesting(viz::ResourceId id) { viz::internal::Resource* resource = GetResource(id); DCHECK(resource); resource->read_lock_fences_enabled = true; } -ResourceProvider::ScopedWriteLockGpu::ScopedWriteLockGpu( - ResourceProvider* resource_provider, - viz::ResourceId resource_id) - : resource_provider_(resource_provider), resource_id_(resource_id) { - viz::internal::Resource* resource = - resource_provider->LockForWrite(resource_id); - DCHECK_EQ(resource->type, viz::ResourceType::kTexture); - resource_provider->CreateTexture(resource); - size_ = resource->size; - format_ = resource->format; - color_space_ = resource_provider_->GetResourceColorSpaceForRaster(resource); - texture_id_ = resource->gl_id; - target_ = resource->target; - hint_ = resource->hint; - mailbox_ = resource->mailbox; - is_overlay_ = resource->is_overlay_candidate; - allocated_ = resource->allocated; -} - -ResourceProvider::ScopedWriteLockGpu::~ScopedWriteLockGpu() { - viz::internal::Resource* resource = - resource_provider_->GetResource(resource_id_); - DCHECK(resource->locked_for_write); - resource->allocated = allocated_; - resource->mailbox = mailbox_; - // Don't set empty sync token otherwise resource will be marked synchronized. - if (has_sync_token_) - resource->UpdateSyncToken(sync_token_); - if (synchronized_) - resource->SetSynchronized(); - if (generate_mipmap_) - resource->SetGenerateMipmap(); - resource_provider_->UnlockForWrite(resource); -} - -GrPixelConfig ResourceProvider::ScopedWriteLockGpu::PixelConfig() const { - return ToGrPixelConfig(format_); -} - -void ResourceProvider::ScopedWriteLockGpu::CreateMailbox() { - if (!mailbox_.IsZero()) - return; - gpu::gles2::GLES2Interface* gl = resource_provider_->ContextGL(); - DCHECK(gl); - gl->GenMailboxCHROMIUM(mailbox_.name); - gl->ProduceTextureDirectCHROMIUM(texture_id_, mailbox_.name); -} - -ResourceProvider::ScopedWriteLockGL::ScopedWriteLockGL( - ResourceProvider* resource_provider, - viz::ResourceId resource_id) - : ScopedWriteLockGpu(resource_provider, resource_id) {} - -ResourceProvider::ScopedWriteLockGL::~ScopedWriteLockGL() {} - -GLuint ResourceProvider::ScopedWriteLockGL::GetTexture() { - LazyAllocate(resource_provider_->ContextGL(), texture_id_); - return texture_id_; -} - -void ResourceProvider::ScopedWriteLockGL::LazyAllocate( - gpu::gles2::GLES2Interface* gl, - GLuint texture_id) { - // ETC1 resources cannot be preallocated. - if (format_ == viz::ETC1) - return; - - if (allocated_) - return; - allocated_ = true; - - const ResourceProvider::Settings& settings = resource_provider_->settings_; - - gl->BindTexture(target_, texture_id); - - if (is_overlay_) { - DCHECK(settings.use_texture_storage_image); - gl->TexStorage2DImageCHROMIUM(target_, viz::TextureStorageFormat(format_), - GL_SCANOUT_CHROMIUM, size_.width(), - size_.height()); - if (color_space_.IsValid()) { - gl->SetColorSpaceMetadataCHROMIUM( - texture_id, reinterpret_cast<GLColorSpace>(&color_space_)); - } - } else if (settings.use_texture_storage) { - GLint levels = 1; - if (settings.use_texture_npot && - (hint_ & viz::ResourceTextureHint::kMipmap)) { - levels += base::bits::Log2Floor(std::max(size_.width(), size_.height())); - } - gl->TexStorage2DEXT(target_, levels, viz::TextureStorageFormat(format_), - size_.width(), size_.height()); - } else { - gl->TexImage2D(target_, 0, GLInternalFormat(format_), size_.width(), - size_.height(), 0, GLDataFormat(format_), - GLDataType(format_), nullptr); - } -} - -ResourceProvider::ScopedWriteLockRaster::ScopedWriteLockRaster( - ResourceProvider* resource_provider, - viz::ResourceId resource_id) - : ScopedWriteLockGpu(resource_provider, resource_id) {} - -ResourceProvider::ScopedWriteLockRaster::~ScopedWriteLockRaster() {} - -GLuint ResourceProvider::ScopedWriteLockRaster::ConsumeTexture( - gpu::raster::RasterInterface* ri) { - DCHECK(ri); - DCHECK(!mailbox_.IsZero()); - - GLuint texture_id = ri->CreateAndConsumeTextureCHROMIUM(mailbox_.name); - DCHECK(texture_id); - - LazyAllocate(ri, texture_id); - - return texture_id; -} - -void ResourceProvider::ScopedWriteLockRaster::LazyAllocate( - gpu::raster::RasterInterface* ri, - GLuint texture_id) { - // ETC1 resources cannot be preallocated. - if (format_ == viz::ETC1) - return; - - if (allocated_) - return; - allocated_ = true; - - ri->BindTexture(target_, texture_id); - ri->TexStorageForRaster( - target_, format_, size_.width(), size_.height(), - is_overlay_ ? gpu::raster::kOverlay : gpu::raster::kNone); - if (is_overlay_ && color_space_.IsValid()) { - ri->SetColorSpaceMetadataCHROMIUM( - texture_id, reinterpret_cast<GLColorSpace>(&color_space_)); - } -} - ResourceProvider::ScopedSkSurface::ScopedSkSurface(GrContext* gr_context, GLuint texture_id, GLenum texture_target, @@ -823,24 +455,6 @@ sk_bitmap->installPixels(info, resource->pixels, info.minRowBytes()); } -ResourceProvider::ScopedWriteLockSoftware::ScopedWriteLockSoftware( - ResourceProvider* resource_provider, - viz::ResourceId resource_id) - : resource_provider_(resource_provider), resource_id_(resource_id) { - viz::internal::Resource* resource = - resource_provider->LockForWrite(resource_id); - resource_provider->PopulateSkBitmapWithResource(&sk_bitmap_, resource); - color_space_ = resource_provider->GetResourceColorSpaceForRaster(resource); - DCHECK(valid()); -} - -ResourceProvider::ScopedWriteLockSoftware::~ScopedWriteLockSoftware() { - viz::internal::Resource* resource = - resource_provider_->GetResource(resource_id_); - resource->SetSynchronized(); - resource_provider_->UnlockForWrite(resource); -} - ResourceProvider::SynchronousFence::SynchronousFence( gpu::gles2::GLES2Interface* gl) : gl_(gl), has_synchronized_(true) {} @@ -909,102 +523,6 @@ return target; } -void ResourceProvider::CreateForTesting(viz::ResourceId id) { - CreateTexture(GetResource(id)); -} - -void ResourceProvider::CreateTexture(viz::internal::Resource* resource) { - if (!resource->is_gpu_resource_type()) - return; - - if (resource->gl_id) - return; - - DCHECK_EQ(resource->origin, viz::internal::Resource::INTERNAL); - DCHECK(resource->mailbox.IsZero()); - - resource->gl_id = texture_id_allocator_->NextId(); - DCHECK(resource->gl_id); - - GLES2Interface* gl = ContextGL(); - DCHECK(gl); - - // Create and set texture properties. Allocation is delayed until needed. - gl->BindTexture(resource->target, resource->gl_id); - gl->TexParameteri(resource->target, GL_TEXTURE_MIN_FILTER, - resource->original_filter); - gl->TexParameteri(resource->target, GL_TEXTURE_MAG_FILTER, - resource->original_filter); - gl->TexParameteri(resource->target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - gl->TexParameteri(resource->target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - if (settings_.use_texture_usage_hint && - (resource->hint & viz::ResourceTextureHint::kFramebuffer)) { - gl->TexParameteri(resource->target, GL_TEXTURE_USAGE_ANGLE, - GL_FRAMEBUFFER_ATTACHMENT_ANGLE); - } -} - -void ResourceProvider::CreateMailbox(viz::internal::Resource* resource) { - if (!resource->is_gpu_resource_type()) - return; - - if (!resource->mailbox.IsZero()) - return; - - CreateTexture(resource); - - DCHECK(resource->gl_id); - DCHECK_EQ(resource->origin, viz::internal::Resource::INTERNAL); - - gpu::gles2::GLES2Interface* gl = ContextGL(); - DCHECK(gl); - gl->GenMailboxCHROMIUM(resource->mailbox.name); - gl->ProduceTextureDirectCHROMIUM(resource->gl_id, resource->mailbox.name); - resource->SetLocallyUsed(); -} - -void ResourceProvider::AllocateForTesting(viz::ResourceId id) { - viz::internal::Resource* resource = GetResource(id); - if (!resource->allocated) { - // Software and external resources are marked allocated on creation. - DCHECK(resource->is_gpu_resource_type()); - DCHECK_EQ(resource->origin, viz::internal::Resource::INTERNAL); - ScopedWriteLockGL resource_lock(this, id); - resource_lock.GetTexture(); // Allocates texture. - } -} - -void ResourceProvider::CreateAndBindImage(viz::internal::Resource* resource) { - DCHECK(resource->gpu_memory_buffer); -#if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARM_FAMILY) - // TODO(reveman): This avoids a performance problem on ARM ChromeOS - // devices. This only works with shared memory backed buffers. - // crbug.com/580166 - DCHECK_EQ(resource->gpu_memory_buffer->GetHandle().type, - gfx::SHARED_MEMORY_BUFFER); -#endif - CreateTexture(resource); - - gpu::gles2::GLES2Interface* gl = ContextGL(); - DCHECK(gl); - - gl->BindTexture(resource->target, resource->gl_id); - - if (!resource->image_id) { - resource->image_id = gl->CreateImageCHROMIUM( - resource->gpu_memory_buffer->AsClientBuffer(), resource->size.width(), - resource->size.height(), GLInternalFormat(resource->format)); - - DCHECK(resource->image_id || - gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR); - - gl->BindTexImage2DCHROMIUM(resource->target, resource->image_id); - } else { - gl->ReleaseTexImage2DCHROMIUM(resource->target, resource->image_id); - gl->BindTexImage2DCHROMIUM(resource->target, resource->image_id); - } -} - void ResourceProvider::WaitSyncTokenInternal( viz::internal::Resource* resource) { DCHECK(resource); @@ -1047,12 +565,10 @@ } GLenum ResourceProvider::GetImageTextureTarget( + const gpu::Capabilities& caps, gfx::BufferUsage usage, viz::ResourceFormat format) const { - gfx::BufferFormat buffer_format = BufferFormat(format); - bool found = base::ContainsValue(texture_target_exception_list_, - std::make_pair(usage, buffer_format)); - return found ? gpu::GetPlatformSpecificTextureTarget() : GL_TEXTURE_2D; + return gpu::GetBufferTextureTarget(usage, BufferFormat(format), caps); } GLES2Interface* ResourceProvider::ContextGL() const {
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h index e6edffd..0374a2b0 100644 --- a/cc/resources/resource_provider.h +++ b/cc/resources/resource_provider.h
@@ -49,7 +49,7 @@ #include "ui/gfx/gpu_memory_buffer.h" namespace gpu { -class GpuMemoryBufferManager; +struct Capabilities; namespace gles2 { class GLES2Interface; } @@ -64,7 +64,6 @@ } // namespace viz namespace cc { -class TextureIdAllocator; // This class provides abstractions for allocating and transferring resources // between modules/threads/processes. It abstracts away GL textures vs @@ -87,10 +86,8 @@ ResourceProvider(viz::ContextProvider* compositor_context_provider, viz::SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, bool delegated_sync_points_required, - const viz::ResourceSettings& resource_settings, - viz::ResourceId next_id); + const viz::ResourceSettings& resource_settings); ~ResourceProvider() override; void Initialize(); @@ -111,9 +108,6 @@ } viz::ResourceFormat YuvResourceFormat(int bits) const; bool use_sync_query() const { return settings_.use_sync_query; } - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { - return gpu_memory_buffer_manager_; - } size_t num_resources() const { return resources_.size(); } bool IsTextureFormatSupported(viz::ResourceFormat format) const; @@ -136,20 +130,6 @@ // Producer interface. viz::ResourceType GetResourceType(viz::ResourceId id); GLenum GetResourceTextureTarget(viz::ResourceId id); - viz::ResourceTextureHint GetTextureHint(viz::ResourceId id); - - viz::ResourceId CreateGpuTextureResource(const gfx::Size& size, - viz::ResourceTextureHint hint, - viz::ResourceFormat format, - const gfx::ColorSpace& color_space); - viz::ResourceId CreateGpuMemoryBufferResource( - const gfx::Size& size, - viz::ResourceTextureHint hint, - viz::ResourceFormat format, - gfx::BufferUsage usage, - const gfx::ColorSpace& color_space); - viz::ResourceId CreateBitmapResource(const gfx::Size& size, - const gfx::ColorSpace& color_space); void DeleteResource(viz::ResourceId id); // In the case of GPU resources, we may need to flush the GL context to ensure @@ -157,103 +137,6 @@ // be called after texture deletions that may happen during an idle state. void FlushPendingDeletions() const; - // Update pixels from image, copying source_rect (in image) to dest_offset (in - // the resource). - void CopyToResource(viz::ResourceId id, - const uint8_t* image, - const gfx::Size& image_size); - - - // The following lock classes are part of the ResourceProvider API and are - // needed to read and write the resource contents. The user must ensure - // that they only use GL locks on GL resources, etc, and this is enforced - // by assertions. - class CC_EXPORT ScopedWriteLockGpu { - public: - ScopedWriteLockGpu(ResourceProvider* resource_provider, - viz::ResourceId resource_id); - ~ScopedWriteLockGpu(); - - GLenum target() const { return target_; } - viz::ResourceFormat format() const { return format_; } - const gfx::Size& size() const { return size_; } - const gfx::ColorSpace& color_space_for_raster() const { - return color_space_; - } - - GrPixelConfig PixelConfig() const; - - void set_allocated() { allocated_ = true; } - - void set_sync_token(const gpu::SyncToken& sync_token) { - sync_token_ = sync_token; - has_sync_token_ = true; - } - - void set_synchronized() { synchronized_ = true; } - - void set_generate_mipmap() { generate_mipmap_ = true; } - - // Creates mailbox on compositor context that can be consumed on another - // context. - void CreateMailbox(); - - protected: - ResourceProvider* const resource_provider_; - const viz::ResourceId resource_id_; - - // The following are copied from the resource. - gfx::Size size_; - viz::ResourceFormat format_; - gfx::ColorSpace color_space_; - GLuint texture_id_; - GLenum target_; - viz::ResourceTextureHint hint_; - gpu::Mailbox mailbox_; - bool is_overlay_; - bool allocated_; - - // Set by the user. - gpu::SyncToken sync_token_; - bool has_sync_token_ = false; - bool synchronized_ = false; - bool generate_mipmap_ = false; - - private: - DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpu); - }; - - class CC_EXPORT ScopedWriteLockGL : public ScopedWriteLockGpu { - public: - ScopedWriteLockGL(ResourceProvider* resource_provider, - viz::ResourceId resource_id); - ~ScopedWriteLockGL(); - - // Returns texture id on compositor context, allocating if necessary. - GLuint GetTexture(); - - private: - void LazyAllocate(gpu::gles2::GLES2Interface* gl, GLuint texture_id); - - DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGL); - }; - - class CC_EXPORT ScopedWriteLockRaster : public ScopedWriteLockGpu { - public: - ScopedWriteLockRaster(ResourceProvider* resource_provider, - viz::ResourceId resource_id); - ~ScopedWriteLockRaster(); - - // Creates a texture id, allocating if necessary, on the given context. The - // texture id must be deleted by the caller. - GLuint ConsumeTexture(gpu::raster::RasterInterface* ri); - - private: - void LazyAllocate(gpu::raster::RasterInterface* gl, GLuint texture_id); - - DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockRaster); - }; - // TODO(sunnyps): Move to //components/viz/common/gl_helper.h ? class CC_EXPORT ScopedSkSurface { public: @@ -275,27 +158,6 @@ DISALLOW_COPY_AND_ASSIGN(ScopedSkSurface); }; - class CC_EXPORT ScopedWriteLockSoftware { - public: - ScopedWriteLockSoftware(ResourceProvider* resource_provider, - viz::ResourceId resource_id); - ~ScopedWriteLockSoftware(); - - SkBitmap& sk_bitmap() { return sk_bitmap_; } - bool valid() const { return !!sk_bitmap_.getPixels(); } - const gfx::ColorSpace& color_space_for_raster() const { - return color_space_; - } - - private: - ResourceProvider* const resource_provider_; - const viz::ResourceId resource_id_; - gfx::ColorSpace color_space_; - SkBitmap sk_bitmap_; - - DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); - }; - class CC_EXPORT SynchronousFence : public viz::ResourceFence { public: explicit SynchronousFence(gpu::gles2::GLES2Interface* gl); @@ -319,16 +181,6 @@ DISALLOW_COPY_AND_ASSIGN(SynchronousFence); }; - // For tests only! This prevents detecting uninitialized reads. - // Use SetPixels or LockForWrite to allocate implicitly. - void AllocateForTesting(viz::ResourceId id); - - // For tests only! - void CreateForTesting(viz::ResourceId id); - - // Indicates if we can currently lock this resource for write. - bool CanLockForWrite(viz::ResourceId id); - // Indicates if this resource may be used for a hardware overlay plane. bool IsOverlayCandidate(viz::ResourceId id); @@ -353,7 +205,8 @@ static gpu::SyncToken GenerateSyncTokenHelper( gpu::raster::RasterInterface* ri); - GLenum GetImageTextureTarget(gfx::BufferUsage usage, + GLenum GetImageTextureTarget(const gpu::Capabilities& caps, + gfx::BufferUsage usage, viz::ResourceFormat format) const; // base::trace_event::MemoryDumpProvider implementation. @@ -368,17 +221,8 @@ viz::internal::Resource* InsertResource(viz::ResourceId id, viz::internal::Resource resource); - viz::internal::Resource* GetResource(viz::ResourceId id); - viz::internal::Resource* LockForWrite(viz::ResourceId id); - void UnlockForWrite(viz::internal::Resource* resource); - - void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap, - const viz::internal::Resource* resource); - - void CreateAndBindImage(viz::internal::Resource* resource); - // Binds the given GL resource to a texture target for sampling using the // specified filter for both minification and magnification. Returns the // texture target used. The resource must be locked for reading. @@ -386,8 +230,8 @@ GLenum unit, GLenum filter); - gfx::ColorSpace GetResourceColorSpaceForRaster( - const viz::internal::Resource* resource) const; + void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap, + const viz::internal::Resource* resource); enum DeleteStyle { NORMAL, @@ -396,7 +240,6 @@ void DeleteResourceInternal(ResourceMap::iterator it, DeleteStyle style); - void CreateMailbox(viz::internal::Resource* resource); void WaitSyncTokenInternal(viz::internal::Resource* resource); bool ReadLockFenceHasPassed(const viz::internal::Resource* resource) { @@ -439,8 +282,6 @@ viz::ContextProvider* compositor_context_provider_; viz::SharedBitmapManager* shared_bitmap_manager_; - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; - viz::ResourceId next_id_; int next_child_; bool lost_context_provider_; @@ -453,13 +294,8 @@ #endif private: - void CreateTexture(viz::internal::Resource* resource); - bool IsGLContextLost() const; - std::unique_ptr<TextureIdAllocator> texture_id_allocator_; - viz::BufferUsageAndFormatList texture_target_exception_list_; - // A process-unique ID used for disambiguating memory dumps from different // resource providers. int tracing_id_;
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc index abad205..5e8703b 100644 --- a/cc/resources/resource_provider_unittest.cc +++ b/cc/resources/resource_provider_unittest.cc
@@ -19,11 +19,11 @@ #include "base/logging.h" #include "base/memory/ref_counted.h" #include "cc/test/render_pass_test_utils.h" +#include "cc/test/resource_provider_test_utils.h" #include "cc/test/test_context_provider.h" #include "cc/test/test_shared_bitmap_manager.h" #include "cc/test/test_texture.h" #include "cc/test/test_web_graphics_context_3d.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/returned_resource.h" #include "components/viz/common/resources/shared_bitmap_manager.h" @@ -433,7 +433,7 @@ resource_provider_ = std::make_unique<DisplayResourceProvider>( context_provider_.get(), shared_bitmap_manager_.get(), - gpu_memory_buffer_manager_.get(), CreateResourceSettings()); + CreateResourceSettings()); MakeChildResourceProvider(); } @@ -601,33 +601,49 @@ size_t pixel_size = TextureSizeBytes(size, format); ASSERT_EQ(16U, pixel_size); - viz::ResourceId id; + viz::ResourceId id1; + viz::ResourceId id2; if (use_gpu()) { - id = resource_provider_->CreateGpuTextureResource( + id1 = child_resource_provider_->CreateGpuTextureResource( size, viz::ResourceTextureHint::kDefault, format, gfx::ColorSpace()); + id2 = child_resource_provider_->CreateGpuTextureResource( + size, viz::ResourceTextureHint::kDefault, format, gfx::ColorSpace()); + } else { - id = resource_provider_->CreateBitmapResource(size, gfx::ColorSpace()); + id1 = + child_resource_provider_->CreateBitmapResource(size, gfx::ColorSpace()); + id2 = + child_resource_provider_->CreateBitmapResource(size, gfx::ColorSpace()); } uint8_t image[16] = {0}; - resource_provider_->CopyToResource(id, image, size); - { - uint8_t result[16] = {0}; - uint8_t expected[16] = {0}; - GetResourcePixels(resource_provider_.get(), context(), id, size, format, - result); - EXPECT_EQ(0, memcmp(expected, result, pixel_size)); - } + child_resource_provider_->CopyToResource(id1, image, size); for (uint8_t i = 0; i < pixel_size; ++i) image[i] = i; - resource_provider_->CopyToResource(id, image, size); + child_resource_provider_->CopyToResource(id2, image, size); + + // Return the mapped resource id. + ResourceProvider::ResourceIdMap resource_map = + SendResourceAndGetChildToParentMap({id1, id2}, resource_provider_.get(), + child_resource_provider_.get()); + viz::ResourceId mapped_id1 = resource_map[id1]; + viz::ResourceId mapped_id2 = resource_map[id2]; + + { + uint8_t result[16] = {0}; + uint8_t expected[16] = {0}; + GetResourcePixels(resource_provider_.get(), context(), mapped_id1, size, + format, result); + EXPECT_EQ(0, memcmp(expected, result, pixel_size)); + } + { uint8_t result[16] = {0}; uint8_t expected[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; - GetResourcePixels(resource_provider_.get(), context(), id, size, format, - result); + GetResourcePixels(resource_provider_.get(), context(), mapped_id2, size, + format, result); EXPECT_EQ(0, memcmp(expected, result, pixel_size)); } } @@ -805,16 +821,16 @@ { // ScopedWriteLockGL will wait for the sync token, which is convenient since // |child_resource_provider_| doesn't expose that. - ResourceProvider::ScopedWriteLockGL lock(child_resource_provider_.get(), - id1); + LayerTreeResourceProvider::ScopedWriteLockGL lock( + child_resource_provider_.get(), id1); ASSERT_NE(0U, lock.GetTexture()); } // Ensure copying to resource doesn't fail. child_resource_provider_->CopyToResource(id2, data2, size); { // ScopedWriteLockGL will wait for the sync token. - ResourceProvider::ScopedWriteLockGL lock(child_resource_provider_.get(), - id2); + LayerTreeResourceProvider::ScopedWriteLockGL lock( + child_resource_provider_.get(), id2); ASSERT_NE(0U, lock.GetTexture()); } { @@ -1507,7 +1523,7 @@ EXPECT_FALSE(child_resource_provider_->InUseByConsumer(id2)); { - ResourceProvider::ScopedWriteLockSoftware lock( + LayerTreeResourceProvider::ScopedWriteLockSoftware lock( child_resource_provider_.get(), id1); const SkBitmap sk_bitmap = lock.sk_bitmap(); EXPECT_EQ(sk_bitmap.width(), size.width()); @@ -1515,7 +1531,7 @@ EXPECT_EQ(0, memcmp(data1, sk_bitmap.getPixels(), pixel_size)); } { - ResourceProvider::ScopedWriteLockSoftware lock( + LayerTreeResourceProvider::ScopedWriteLockSoftware lock( child_resource_provider_.get(), id2); const SkBitmap sk_bitmap = lock.sk_bitmap(); EXPECT_EQ(sk_bitmap.width(), size.width()); @@ -1882,7 +1898,7 @@ parent_context_provider->BindToCurrentThread(); auto parent_resource_provider(std::make_unique<DisplayResourceProvider>( - parent_context_provider.get(), shared_bitmap_manager.get(), nullptr, + parent_context_provider.get(), shared_bitmap_manager.get(), resource_settings)); gfx::Size size(1, 1); @@ -2327,51 +2343,70 @@ if (!use_gpu()) return; - auto context_owned(std::make_unique<TextureStateTrackingContext>()); + auto context_owned = std::make_unique<TextureStateTrackingContext>(); TextureStateTrackingContext* context = context_owned.get(); auto context_provider = TestContextProvider::Create(std::move(context_owned)); context_provider->BindToCurrentThread(); + viz::ResourceSettings resource_settings = CreateResourceSettings(); auto resource_provider(std::make_unique<DisplayResourceProvider>( - context_provider.get(), shared_bitmap_manager_.get(), - gpu_memory_buffer_manager_.get(), CreateResourceSettings())); + context_provider.get(), shared_bitmap_manager_.get(), resource_settings)); + + auto child_context_owned = std::make_unique<TextureStateTrackingContext>(); + TextureStateTrackingContext* child_context = child_context_owned.get(); + + auto child_context_provider = + TestContextProvider::Create(std::move(child_context_owned)); + child_context_provider->BindToCurrentThread(); + + auto child_resource_provider(std::make_unique<LayerTreeResourceProvider>( + child_context_provider.get(), shared_bitmap_manager_.get(), + gpu_memory_buffer_manager_.get(), kDelegatedSyncPointsRequired, + resource_settings)); gfx::Size size(1, 1); viz::ResourceFormat format = viz::RGBA_8888; int texture_id = 1; - viz::ResourceId id = resource_provider->CreateGpuTextureResource( + viz::ResourceId id = child_resource_provider->CreateGpuTextureResource( size, viz::ResourceTextureHint::kDefault, format, gfx::ColorSpace()); // Check that the texture gets created with the right sampler settings. - EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)) + EXPECT_CALL(*child_context, bindTexture(GL_TEXTURE_2D, texture_id)) .Times(2); // Once to create and once to allocate. - EXPECT_CALL(*context, + EXPECT_CALL(*child_context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); - EXPECT_CALL(*context, + EXPECT_CALL(*child_context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); - EXPECT_CALL( - *context, - texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); - EXPECT_CALL( - *context, - texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); + EXPECT_CALL(*child_context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, + GL_CLAMP_TO_EDGE)); + EXPECT_CALL(*child_context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, + GL_CLAMP_TO_EDGE)); - resource_provider->AllocateForTesting(id); - Mock::VerifyAndClearExpectations(context); + child_resource_provider->AllocateForTesting(id); + Mock::VerifyAndClearExpectations(child_context); + // Return the mapped resource id. + ResourceProvider::ResourceIdMap resource_map = + SendResourceAndGetChildToParentMap({id}, resource_provider.get(), + child_resource_provider.get()); + viz::ResourceId mapped_id = resource_map[id]; + resource_provider->WaitSyncToken(mapped_id); + int parent_texture_id = 3; // Creating a sampler with the default filter should not change any texture // parameters. { - EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)); + EXPECT_CALL(*context, createAndConsumeTextureCHROMIUM(_)) + .WillOnce(Return(parent_texture_id)); + EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, parent_texture_id)); DisplayResourceProvider::ScopedSamplerGL sampler( - resource_provider.get(), id, GL_TEXTURE_2D, GL_LINEAR); + resource_provider.get(), mapped_id, GL_TEXTURE_2D, GL_LINEAR); Mock::VerifyAndClearExpectations(context); } // Using a different filter should be reflected in the texture parameters. { - EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)); + EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, parent_texture_id)); EXPECT_CALL( *context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); @@ -2379,19 +2414,19 @@ *context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); DisplayResourceProvider::ScopedSamplerGL sampler( - resource_provider.get(), id, GL_TEXTURE_2D, GL_NEAREST); + resource_provider.get(), mapped_id, GL_TEXTURE_2D, GL_NEAREST); Mock::VerifyAndClearExpectations(context); } // Test resetting to the default filter. { - EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)); + EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, parent_texture_id)); EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); DisplayResourceProvider::ScopedSamplerGL sampler( - resource_provider.get(), id, GL_TEXTURE_2D, GL_LINEAR); + resource_provider.get(), mapped_id, GL_TEXTURE_2D, GL_LINEAR); Mock::VerifyAndClearExpectations(context); } } @@ -2538,8 +2573,7 @@ CreateAndFillSharedBitmap(shared_bitmap_manager_.get(), size, kBadBeef)); auto resource_provider(std::make_unique<DisplayResourceProvider>( - nullptr, shared_bitmap_manager_.get(), gpu_memory_buffer_manager_.get(), - CreateResourceSettings())); + nullptr, shared_bitmap_manager_.get(), CreateResourceSettings())); auto child_resource_provider(std::make_unique<LayerTreeResourceProvider>( nullptr, shared_bitmap_manager_.get(), gpu_memory_buffer_manager_.get(), @@ -2612,7 +2646,7 @@ auto resource_provider(std::make_unique<DisplayResourceProvider>( context_provider.get(), shared_bitmap_manager, - gpu_memory_buffer_manager, CreateResourceSettings())); + CreateResourceSettings())); auto child_context_owned(std::make_unique<TextureStateTrackingContext>()); TextureStateTrackingContext* child_context = child_context_owned.get(); @@ -2777,7 +2811,7 @@ auto resource_provider(std::make_unique<DisplayResourceProvider>( context_provider.get(), shared_bitmap_manager_.get(), - gpu_memory_buffer_manager_.get(), CreateResourceSettings())); + CreateResourceSettings())); auto child_context_owned(std::make_unique<TextureStateTrackingContext>()); TextureStateTrackingContext* child_context = child_context_owned.get(); @@ -2885,7 +2919,7 @@ auto resource_provider = std::make_unique<DisplayResourceProvider>( context_provider.get(), shared_bitmap_manager_.get(), - gpu_memory_buffer_manager_.get(), CreateResourceSettings()); + CreateResourceSettings()); gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, gpu::CommandBufferId::FromUnsafeValue(0x12), 0x34); @@ -2942,7 +2976,7 @@ auto resource_provider = std::make_unique<DisplayResourceProvider>( context_provider.get(), shared_bitmap_manager_.get(), - gpu_memory_buffer_manager_.get(), CreateResourceSettings()); + CreateResourceSettings()); gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, gpu::CommandBufferId::FromUnsafeValue(0x12), 0x34); @@ -2986,7 +3020,7 @@ auto resource_provider = std::make_unique<DisplayResourceProvider>( context_provider.get(), shared_bitmap_manager_.get(), - gpu_memory_buffer_manager_.get(), CreateResourceSettings()); + CreateResourceSettings()); gpu::SyncToken sync_token; const GLuint64 current_fence_sync = context->GetNextFenceSync(); @@ -3193,12 +3227,12 @@ auto context_provider = TestContextProvider::Create(std::move(context_owned)); context_provider->BindToCurrentThread(); - auto resource_provider(std::make_unique<LayerTreeResourceProvider>( + auto child_resource_provider(std::make_unique<LayerTreeResourceProvider>( context_provider.get(), shared_bitmap_manager_.get(), gpu_memory_buffer_manager_.get(), kDelegatedSyncPointsRequired, CreateResourceSettings())); - viz::ResourceId id = resource_provider->CreateGpuTextureResource( + viz::ResourceId id = child_resource_provider->CreateGpuTextureResource( gfx::Size(2, 2), viz::ResourceTextureHint::kDefault, viz::RGBA_8888, gfx::ColorSpace()); @@ -3208,10 +3242,10 @@ EXPECT_CALL(*context, texStorage2DEXT(GL_TEXTURE_2D, 1, GL_RGBA8_OES, 2, 2)) .Times(1); EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, _, _)).Times(AnyNumber()); - resource_provider->AllocateForTesting(id); + child_resource_provider->AllocateForTesting(id); EXPECT_CALL(*context, RetireTextureId(kTextureId)); - resource_provider->DeleteResource(id); + child_resource_provider->DeleteResource(id); } TEST_P(ResourceProviderTest, ScopedWriteLockGpuMemoryBuffer) { @@ -3411,8 +3445,8 @@ size, viz::ResourceTextureHint::kDefault, format, gfx::ColorSpace()); array.push_back(id); - ResourceProvider::ScopedWriteLockGL lock(child_resource_provider_.get(), - id); + LayerTreeResourceProvider::ScopedWriteLockGL lock( + child_resource_provider_.get(), id); gpu::SyncToken token; token.Set(gpu::CommandBufferNamespace::INVALID, gpu::CommandBufferId(), release_counts[i]); @@ -3458,14 +3492,16 @@ EXPECT_CALL(*context, texImage2D(GL_TEXTURE_2D, 0, GLInternalFormat(format), kWidth, kHeight, 0, GLDataFormat(format), GLDataType(format), nullptr)); - ResourceProvider::ScopedWriteLockGL lock(resource_provider.get(), id); + LayerTreeResourceProvider::ScopedWriteLockGL lock(resource_provider.get(), + id); EXPECT_EQ(lock.GetTexture(), kTextureId); Mock::VerifyAndClearExpectations(context); } // Subsequent uses will not allocate. { - ResourceProvider::ScopedWriteLockGL lock(resource_provider.get(), id); + LayerTreeResourceProvider::ScopedWriteLockGL lock(resource_provider.get(), + id); EXPECT_EQ(lock.GetTexture(), kTextureId); } @@ -3509,14 +3545,16 @@ EXPECT_CALL(*context, texStorage2DImageCHROMIUM(GL_TEXTURE_2D, GL_RGBA8_OES, GL_SCANOUT_CHROMIUM, kWidth, kHeight)); - ResourceProvider::ScopedWriteLockGL lock(resource_provider.get(), id); + LayerTreeResourceProvider::ScopedWriteLockGL lock(resource_provider.get(), + id); EXPECT_EQ(lock.GetTexture(), kTextureId); Mock::VerifyAndClearExpectations(context); } // Subsequent uses will not allocate. { - ResourceProvider::ScopedWriteLockGL lock(resource_provider.get(), id); + LayerTreeResourceProvider::ScopedWriteLockGL lock(resource_provider.get(), + id); EXPECT_EQ(lock.GetTexture(), kTextureId); } @@ -3557,7 +3595,8 @@ EXPECT_CALL(*context, NextTextureId()).WillOnce(Return(kTextureId)); EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kTextureId)); EXPECT_CALL(*context, texParameteri(_, _, _)).Times(AnyNumber()); - ResourceProvider::ScopedWriteLockRaster lock(resource_provider.get(), id); + LayerTreeResourceProvider::ScopedWriteLockRaster lock( + resource_provider.get(), id); Mock::VerifyAndClearExpectations(context); EXPECT_CALL(*context, produceTextureDirectCHROMIUM(kTextureId, _)); @@ -3581,7 +3620,8 @@ // Subsequent uses will not create mailbox or allocate. { - ResourceProvider::ScopedWriteLockRaster lock(resource_provider.get(), id); + LayerTreeResourceProvider::ScopedWriteLockRaster lock( + resource_provider.get(), id); lock.CreateMailbox(); Mock::VerifyAndClearExpectations(context); @@ -3642,7 +3682,8 @@ EXPECT_CALL(*context, NextTextureId()).WillOnce(Return(kTextureId)); EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kTextureId)); EXPECT_CALL(*context, texParameteri(_, _, _)).Times(AnyNumber()); - ResourceProvider::ScopedWriteLockRaster lock(resource_provider.get(), id); + LayerTreeResourceProvider::ScopedWriteLockRaster lock( + resource_provider.get(), id); Mock::VerifyAndClearExpectations(context); EXPECT_CALL(*context, produceTextureDirectCHROMIUM(kTextureId, _)); @@ -3666,7 +3707,8 @@ // Subsequent uses will not create mailbox or allocate. { - ResourceProvider::ScopedWriteLockRaster lock(resource_provider.get(), id); + LayerTreeResourceProvider::ScopedWriteLockRaster lock( + resource_provider.get(), id); lock.CreateMailbox(); Mock::VerifyAndClearExpectations(context);
diff --git a/cc/resources/scoped_resource.cc b/cc/resources/scoped_resource.cc index 1f6b9da..7453477 100644 --- a/cc/resources/scoped_resource.cc +++ b/cc/resources/scoped_resource.cc
@@ -4,9 +4,11 @@ #include "cc/resources/scoped_resource.h" +#include "cc/resources/layer_tree_resource_provider.h" + namespace cc { -ScopedResource::ScopedResource(ResourceProvider* resource_provider) +ScopedResource::ScopedResource(LayerTreeResourceProvider* resource_provider) : resource_provider_(resource_provider) { DCHECK(resource_provider_); }
diff --git a/cc/resources/scoped_resource.h b/cc/resources/scoped_resource.h index 68b8c10a..b6b3db72 100644 --- a/cc/resources/scoped_resource.h +++ b/cc/resources/scoped_resource.h
@@ -12,16 +12,19 @@ #include "base/memory/ptr_util.h" #include "cc/cc_export.h" #include "cc/resources/resource.h" +#include "components/viz/common/resources/resource_texture_hint.h" +#include "ui/gfx/buffer_types.h" #if DCHECK_IS_ON() #include "base/threading/platform_thread.h" #endif namespace cc { +class LayerTreeResourceProvider; class CC_EXPORT ScopedResource : public Resource { public: - explicit ScopedResource(ResourceProvider* provider); + explicit ScopedResource(LayerTreeResourceProvider* provider); virtual ~ScopedResource(); void AllocateSoftware(const gfx::Size& size, @@ -39,7 +42,7 @@ viz::ResourceTextureHint hint() const { return hint_; } private: - ResourceProvider* resource_provider_; + LayerTreeResourceProvider* resource_provider_; viz::ResourceTextureHint hint_ = viz::ResourceTextureHint::kDefault; #if DCHECK_IS_ON()
diff --git a/cc/resources/scoped_resource_unittest.cc b/cc/resources/scoped_resource_unittest.cc index 62fed59..f16f013 100644 --- a/cc/resources/scoped_resource_unittest.cc +++ b/cc/resources/scoped_resource_unittest.cc
@@ -6,9 +6,9 @@ #include <stddef.h> +#include "cc/resources/resource_util.h" #include "cc/test/fake_resource_provider.h" #include "cc/test/test_context_provider.h" -#include "cc/test/test_shared_bitmap_manager.h" #include "testing/gtest/include/gtest/gtest.h" namespace cc { @@ -20,11 +20,9 @@ ASSERT_EQ(context_provider->BindToCurrentThread(), gpu::ContextResult::kSuccess); - std::unique_ptr<viz::SharedBitmapManager> shared_bitmap_manager( - new TestSharedBitmapManager()); - std::unique_ptr<ResourceProvider> resource_provider = - FakeResourceProvider::Create(context_provider.get(), - shared_bitmap_manager.get()); + std::unique_ptr<LayerTreeResourceProvider> resource_provider = + FakeResourceProvider::CreateLayerTreeResourceProvider( + context_provider.get(), nullptr); auto texture = std::make_unique<ScopedResource>(resource_provider.get()); // New scoped textures do not hold a texture yet. @@ -42,11 +40,9 @@ ASSERT_EQ(context_provider->BindToCurrentThread(), gpu::ContextResult::kSuccess); - std::unique_ptr<viz::SharedBitmapManager> shared_bitmap_manager( - new TestSharedBitmapManager()); - std::unique_ptr<ResourceProvider> resource_provider = - FakeResourceProvider::Create(context_provider.get(), - shared_bitmap_manager.get()); + std::unique_ptr<LayerTreeResourceProvider> resource_provider = + FakeResourceProvider::CreateLayerTreeResourceProvider( + context_provider.get(), nullptr); auto texture = std::make_unique<ScopedResource>(resource_provider.get()); texture->AllocateGpuTexture(gfx::Size(30, 30), viz::ResourceTextureHint::kDefault, @@ -69,11 +65,9 @@ ASSERT_EQ(context_provider->BindToCurrentThread(), gpu::ContextResult::kSuccess); - std::unique_ptr<viz::SharedBitmapManager> shared_bitmap_manager( - new TestSharedBitmapManager()); - std::unique_ptr<ResourceProvider> resource_provider = - FakeResourceProvider::Create(context_provider.get(), - shared_bitmap_manager.get()); + std::unique_ptr<LayerTreeResourceProvider> resource_provider = + FakeResourceProvider::CreateLayerTreeResourceProvider( + context_provider.get(), nullptr); { auto texture = std::make_unique<ScopedResource>(resource_provider.get());
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc index 6301006..5c08671f 100644 --- a/cc/resources/video_resource_updater.cc +++ b/cc/resources/video_resource_updater.cc
@@ -261,7 +261,8 @@ gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL(); gl->GenMailboxCHROMIUM(mailbox.name); - ResourceProvider::ScopedWriteLockGL lock(resource_provider_, resource_id); + LayerTreeResourceProvider::ScopedWriteLockGL lock(resource_provider_, + resource_id); gl->ProduceTextureDirectCHROMIUM( lock.GetTexture(), mailbox.name); @@ -399,7 +400,7 @@ if (!video_renderer_) video_renderer_.reset(new media::PaintCanvasVideoRenderer); - ResourceProvider::ScopedWriteLockSoftware lock( + LayerTreeResourceProvider::ScopedWriteLockSoftware lock( resource_provider_, plane_resource.resource_id()); SkiaPaintCanvas canvas(lock.sk_bitmap()); // This is software path, so canvas and video_frame are always backed @@ -817,8 +818,8 @@ no_plane_index); resource->add_ref(); - ResourceProvider::ScopedWriteLockGL lock(resource_provider_, - resource->resource_id()); + LayerTreeResourceProvider::ScopedWriteLockGL lock(resource_provider_, + resource->resource_id()); DCHECK_EQ( resource_provider_->GetResourceTextureTarget(resource->resource_id()), (GLenum)GL_TEXTURE_2D);
diff --git a/cc/test/fake_picture_layer_tiling_client.cc b/cc/test/fake_picture_layer_tiling_client.cc index d556e43..bdc53ed 100644 --- a/cc/test/fake_picture_layer_tiling_client.cc +++ b/cc/test/fake_picture_layer_tiling_client.cc
@@ -22,7 +22,7 @@ has_valid_tile_priorities_(true) {} FakePictureLayerTilingClient::FakePictureLayerTilingClient( - ResourceProvider* resource_provider) + LayerTreeResourceProvider* resource_provider) : resource_pool_( ResourcePool::Create(resource_provider, true,
diff --git a/cc/test/fake_picture_layer_tiling_client.h b/cc/test/fake_picture_layer_tiling_client.h index 8e204d9..9373a7b 100644 --- a/cc/test/fake_picture_layer_tiling_client.h +++ b/cc/test/fake_picture_layer_tiling_client.h
@@ -13,11 +13,13 @@ #include "ui/gfx/geometry/rect.h" namespace cc { +class LayerTreeResourceProvider; class FakePictureLayerTilingClient : public PictureLayerTilingClient { public: FakePictureLayerTilingClient(); - explicit FakePictureLayerTilingClient(ResourceProvider* resource_provider); + explicit FakePictureLayerTilingClient( + LayerTreeResourceProvider* resource_provider); ~FakePictureLayerTilingClient() override; // PictureLayerTilingClient implementation.
diff --git a/cc/test/fake_resource_provider.h b/cc/test/fake_resource_provider.h index 8c8afd6..e0f9338 100644 --- a/cc/test/fake_resource_provider.h +++ b/cc/test/fake_resource_provider.h
@@ -11,7 +11,6 @@ #include "cc/resources/display_resource_provider.h" #include "cc/resources/layer_tree_resource_provider.h" #include "cc/resources/resource_provider.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "ui/gfx/buffer_types.h" namespace cc { @@ -25,9 +24,8 @@ viz::ResourceSettings resource_settings; resource_settings.texture_id_allocation_chunk_size = 1; resource_settings.high_bit_for_testing = high_bit_for_testing; - return base::WrapUnique( - new FakeResourceProvider(context_provider, shared_bitmap_manager, - nullptr, true, resource_settings)); + return base::WrapUnique(new FakeResourceProvider( + context_provider, shared_bitmap_manager, true, resource_settings)); } static std::unique_ptr<LayerTreeResourceProvider> @@ -46,40 +44,22 @@ static std::unique_ptr<DisplayResourceProvider> CreateDisplayResourceProvider( viz::ContextProvider* context_provider, - viz::SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager = nullptr) { + viz::SharedBitmapManager* shared_bitmap_manager) { viz::ResourceSettings resource_settings; resource_settings.texture_id_allocation_chunk_size = 1; return std::make_unique<DisplayResourceProvider>( - context_provider, shared_bitmap_manager, gpu_memory_buffer_manager, - resource_settings); - } - - static std::unique_ptr<FakeResourceProvider> Create( - viz::ContextProvider* context_provider, - viz::SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, - bool high_bit_for_testing = false) { - viz::ResourceSettings resource_settings; - resource_settings.texture_id_allocation_chunk_size = 1; - resource_settings.high_bit_for_testing = high_bit_for_testing; - return base::WrapUnique(new FakeResourceProvider( - context_provider, shared_bitmap_manager, gpu_memory_buffer_manager, - true, resource_settings)); + context_provider, shared_bitmap_manager, resource_settings); } private: FakeResourceProvider(viz::ContextProvider* context_provider, viz::SharedBitmapManager* shared_bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, bool delegated_sync_points_required, const viz::ResourceSettings resource_settings) : ResourceProvider(context_provider, shared_bitmap_manager, - gpu_memory_buffer_manager, delegated_sync_points_required, - resource_settings, - 1) {} + resource_settings) {} }; } // namespace cc
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 507adf0b..9fe35bae1 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc
@@ -33,7 +33,6 @@ #include "cc/trees/proxy_main.h" #include "cc/trees/single_thread_proxy.h" #include "components/ukm/test_ukm_recorder.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "components/viz/test/begin_frame_args_test.h" #include "components/viz/test/test_layer_tree_frame_sink.h" #include "testing/gmock/include/gmock/gmock.h"
diff --git a/cc/test/pixel_test.cc b/cc/test/pixel_test.cc index 8d3e23e4..0fd32cf 100644 --- a/cc/test/pixel_test.cc +++ b/cc/test/pixel_test.cc
@@ -173,7 +173,7 @@ std::make_unique<viz::TestGpuMemoryBufferManager>(); resource_provider_ = std::make_unique<DisplayResourceProvider>( output_surface_->context_provider(), shared_bitmap_manager_.get(), - gpu_memory_buffer_manager_.get(), settings_.resource_settings); + settings_.resource_settings); child_context_provider_ = base::MakeRefCounted<TestInProcessContextProvider>(nullptr); @@ -204,8 +204,7 @@ output_surface_->BindToClient(output_surface_client_.get()); shared_bitmap_manager_.reset(new TestSharedBitmapManager()); resource_provider_ = std::make_unique<DisplayResourceProvider>( - nullptr, shared_bitmap_manager_.get(), nullptr, - settings_.resource_settings); + nullptr, shared_bitmap_manager_.get(), settings_.resource_settings); child_resource_provider_ = std::make_unique<LayerTreeResourceProvider>( nullptr, shared_bitmap_manager_.get(), nullptr, true, settings_.resource_settings);
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc index 541c3ea..0208eed 100644 --- a/cc/test/test_web_graphics_context_3d.cc +++ b/cc/test/test_web_graphics_context_3d.cc
@@ -70,7 +70,6 @@ last_update_type_(NO_UPDATE), next_insert_fence_sync_(1), unpack_alignment_(4), - bound_buffer_(0), weak_ptr_factory_(this) { CreateNamespace(); set_have_extension_egl_image(true); // For stream textures. @@ -515,8 +514,8 @@ void TestWebGraphicsContext3D::bindBuffer(GLenum target, GLuint buffer) { - bound_buffer_ = buffer; - if (!bound_buffer_) + bound_buffer_[target] = buffer; + if (!buffer) return; unsigned context_id = buffer >> 16; unsigned buffer_id = buffer & 0xffff; @@ -527,10 +526,10 @@ std::unordered_map<unsigned, std::unique_ptr<Buffer>>& buffers = namespace_->buffers; - if (buffers.count(bound_buffer_) == 0) - buffers[bound_buffer_] = base::WrapUnique(new Buffer); + if (buffers.count(bound_buffer_[target]) == 0) + buffers[bound_buffer_[target]] = base::WrapUnique(new Buffer); - buffers[bound_buffer_]->target = target; + buffers[bound_buffer_[target]]->target = target; } void TestWebGraphicsContext3D::bufferData(GLenum target, @@ -540,9 +539,10 @@ base::AutoLock lock(namespace_->lock); std::unordered_map<unsigned, std::unique_ptr<Buffer>>& buffers = namespace_->buffers; - DCHECK_GT(buffers.count(bound_buffer_), 0u); - DCHECK_EQ(target, buffers[bound_buffer_]->target); - Buffer* buffer = buffers[bound_buffer_].get(); + DCHECK_GT(bound_buffer_.count(target), 0u); + DCHECK_GT(buffers.count(bound_buffer_[target]), 0u); + DCHECK_EQ(target, buffers[bound_buffer_[target]]->target); + Buffer* buffer = buffers[bound_buffer_[target]].get(); if (context_lost_) { buffer->pixels = nullptr; return; @@ -581,8 +581,9 @@ base::AutoLock lock(namespace_->lock); std::unordered_map<unsigned, std::unique_ptr<Buffer>>& buffers = namespace_->buffers; - DCHECK_GT(buffers.count(bound_buffer_), 0u); - DCHECK_EQ(target, buffers[bound_buffer_]->target); + DCHECK_GT(bound_buffer_.count(target), 0u); + DCHECK_GT(buffers.count(bound_buffer_[target]), 0u); + DCHECK_EQ(target, buffers[bound_buffer_[target]]->target); if (times_map_buffer_chromium_succeeds_ >= 0) { if (!times_map_buffer_chromium_succeeds_) { return nullptr; @@ -590,7 +591,7 @@ --times_map_buffer_chromium_succeeds_; } - return buffers[bound_buffer_]->pixels.get(); + return buffers[bound_buffer_[target]]->pixels.get(); } GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM( @@ -598,9 +599,10 @@ base::AutoLock lock(namespace_->lock); std::unordered_map<unsigned, std::unique_ptr<Buffer>>& buffers = namespace_->buffers; - DCHECK_GT(buffers.count(bound_buffer_), 0u); - DCHECK_EQ(target, buffers[bound_buffer_]->target); - buffers[bound_buffer_]->pixels = nullptr; + DCHECK_GT(bound_buffer_.count(target), 0u); + DCHECK_GT(buffers.count(bound_buffer_[target]), 0u); + DCHECK_EQ(target, buffers[bound_buffer_[target]]->target); + buffers[bound_buffer_[target]]->pixels = nullptr; return true; }
diff --git a/cc/test/test_web_graphics_context_3d.h b/cc/test/test_web_graphics_context_3d.h index 08fcc52..a0cc1a2 100644 --- a/cc/test/test_web_graphics_context_3d.h +++ b/cc/test/test_web_graphics_context_3d.h
@@ -15,6 +15,7 @@ #include "base/callback.h" #include "base/compiler_specific.h" +#include "base/containers/flat_map.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" @@ -499,7 +500,7 @@ gpu::SyncToken last_waited_sync_token_; int unpack_alignment_; - unsigned bound_buffer_; + base::flat_map<unsigned, unsigned> bound_buffer_; TextureTargets texture_targets_; scoped_refptr<Namespace> namespace_;
diff --git a/cc/test/transfer_cache_test_helper.cc b/cc/test/transfer_cache_test_helper.cc index 9fb7994f..1fe3e908 100644 --- a/cc/test/transfer_cache_test_helper.cc +++ b/cc/test/transfer_cache_test_helper.cc
@@ -13,6 +13,40 @@ : context_(context) {} TransferCacheTestHelper::~TransferCacheTestHelper() = default; +bool TransferCacheTestHelper::LockEntryDirect(TransferCacheEntryType type, + uint32_t id) { + return LockEntryInternal(type, id); +} + +void TransferCacheTestHelper::CreateEntryDirect( + const ClientTransferCacheEntry& client_entry) { + CreateEntryInternal(client_entry); +} + +void TransferCacheTestHelper::UnlockEntriesDirect( + const std::vector<std::pair<TransferCacheEntryType, uint32_t>>& entries) { + for (const auto& entry : entries) { + locked_entries_.erase(entry); + } + EnforceLimits(); +} + +void TransferCacheTestHelper::DeleteEntryDirect(TransferCacheEntryType type, + uint32_t id) { + auto key = std::make_pair(type, id); + locked_entries_.erase(key); + entries_.erase(key); +} + +void TransferCacheTestHelper::SetGrContext(GrContext* context) { + context_ = context; +} + +void TransferCacheTestHelper::SetCachedItemsLimit(size_t limit) { + cached_items_limit_ = limit; + EnforceLimits(); +} + ServiceTransferCacheEntry* TransferCacheTestHelper::GetEntryInternal( TransferCacheEntryType type, uint32_t id) { @@ -29,6 +63,7 @@ if (entries_.find(key) == entries_.end()) return false; locked_entries_.insert(key); + EnforceLimits(); return true; } @@ -54,12 +89,28 @@ // Put things into the cache. entries_[key] = std::move(service_entry); locked_entries_.insert(key); + EnforceLimits(); } void TransferCacheTestHelper::FlushEntriesInternal( const std::vector<EntryKey>& entries) { for (auto& entry : entries) locked_entries_.erase(entry); + EnforceLimits(); +} + +void TransferCacheTestHelper::EnforceLimits() { + for (auto it = entries_.begin(); it != entries_.end();) { + if (entries_.size() <= cached_items_limit_) + break; + + auto found = locked_entries_.find(it->first); + if (found == locked_entries_.end()) { + it = entries_.erase(it); + } else { + ++it; + } + } } } // namespace cc
diff --git a/cc/test/transfer_cache_test_helper.h b/cc/test/transfer_cache_test_helper.h index 150b356..44aee2b 100644 --- a/cc/test/transfer_cache_test_helper.h +++ b/cc/test/transfer_cache_test_helper.h
@@ -21,6 +21,16 @@ explicit TransferCacheTestHelper(GrContext* context = nullptr); ~TransferCacheTestHelper() override; + void SetGrContext(GrContext* context); + void SetCachedItemsLimit(size_t limit); + + // Direct Access API (simulates ContextSupport methods). + bool LockEntryDirect(TransferCacheEntryType type, uint32_t id); + void CreateEntryDirect(const ClientTransferCacheEntry& entry); + void UnlockEntriesDirect( + const std::vector<std::pair<TransferCacheEntryType, uint32_t>>& entries); + void DeleteEntryDirect(TransferCacheEntryType type, uint32_t id); + private: using EntryKey = std::pair<TransferCacheEntryType, uint32_t>; @@ -33,10 +43,14 @@ void CreateEntryInternal(const ClientTransferCacheEntry& entry) override; void FlushEntriesInternal(const std::vector<EntryKey>& entries) override; + // Helper functions. + void EnforceLimits(); + std::map<EntryKey, std::unique_ptr<ServiceTransferCacheEntry>> entries_; std::set<EntryKey> locked_entries_; GrContext* context_ = nullptr; + size_t cached_items_limit_ = std::numeric_limits<size_t>::max(); }; } // namespace cc
diff --git a/cc/tiles/gpu_image_decode_cache.cc b/cc/tiles/gpu_image_decode_cache.cc index b09f6e7..51b63ff 100644 --- a/cc/tiles/gpu_image_decode_cache.cc +++ b/cc/tiles/gpu_image_decode_cache.cc
@@ -19,6 +19,7 @@ #include "base/trace_event/memory_dump_manager.h" #include "cc/base/devtools_instrumentation.h" #include "cc/base/histograms.h" +#include "cc/paint/image_transfer_cache_entry.h" #include "cc/raster/tile_task.h" #include "cc/tiles/mipmap_util.h" #include "components/viz/common/gpu/raster_context_provider.h" @@ -462,20 +463,36 @@ } void GpuImageDecodeCache::UploadedImageData::SetImage(sk_sp<SkImage> image) { + DCHECK(mode_ == Mode::kNone); DCHECK(!image_); + DCHECK(!transfer_cache_id_); DCHECK(image); + + mode_ = Mode::kSkImage; image_ = std::move(image); if (image_->isTextureBacked()) gl_id_ = GlIdFromSkImage(image_.get()); OnSetLockedData(false /* out_of_raster */); } -void GpuImageDecodeCache::UploadedImageData::ResetImage() { - if (image_) +void GpuImageDecodeCache::UploadedImageData::SetTransferCacheId(uint32_t id) { + DCHECK(mode_ == Mode::kNone); + DCHECK(!image_); + DCHECK(!transfer_cache_id_); + + mode_ = Mode::kTransferCache; + transfer_cache_id_ = id; + OnSetLockedData(false /* out_of_raster */); +} + +void GpuImageDecodeCache::UploadedImageData::Reset() { + if (mode_ != Mode::kNone) ReportUsageStats(); + mode_ = Mode::kNone; image_ = nullptr; gl_id_ = 0; + transfer_cache_id_.reset(); OnResetData(); } @@ -507,13 +524,32 @@ DCHECK_EQ(false, decode.is_locked()); // This should always be cleaned up before deleting the image, as it needs to // be freed with the GL context lock held. - DCHECK(!upload.image()); + DCHECK(!HasUploadedData()); +} + +bool GpuImageDecodeCache::ImageData::IsGpuOrTransferCache() const { + return mode == DecodedDataMode::kGpu || + mode == DecodedDataMode::kTransferCache; +} + +bool GpuImageDecodeCache::ImageData::HasUploadedData() const { + switch (mode) { + case DecodedDataMode::kGpu: + return upload.image(); + case DecodedDataMode::kTransferCache: + return !!upload.transfer_cache_id(); + case DecodedDataMode::kCpu: + return false; + } + return false; } GpuImageDecodeCache::GpuImageDecodeCache(viz::RasterContextProvider* context, + bool use_transfer_cache, SkColorType color_type, size_t max_working_set_bytes) : color_type_(color_type), + use_transfer_cache_(use_transfer_cache), context_(context), persistent_cache_(PersistentCache::NO_AUTO_EVICT), max_working_set_bytes_(max_working_set_bytes) { @@ -565,7 +601,7 @@ const TracingInfo& tracing_info) { DCHECK_EQ(tracing_info.task_type, TaskType::kInRaster); return GetTaskForImageAndRefInternal(draw_image, tracing_info, - DecodeTaskType::PART_OF_UPLOAD_TASK); + DecodeTaskType::kPartOfUploadTask); } ImageDecodeCache::TaskResult @@ -573,7 +609,7 @@ const DrawImage& draw_image) { return GetTaskForImageAndRefInternal( draw_image, TracingInfo(0, TilePriority::NOW, TaskType::kOutOfRaster), - DecodeTaskType::STAND_ALONE_DECODE_TASK); + DecodeTaskType::kStandAloneDecodeTask); } ImageDecodeCache::TaskResult GpuImageDecodeCache::GetTaskForImageAndRefInternal( @@ -599,12 +635,12 @@ } else if (image_data->decode.decode_failure) { // We have already tried and failed to decode this image, so just return. return TaskResult(false); - } else if (task_type == DecodeTaskType::PART_OF_UPLOAD_TASK && + } else if (task_type == DecodeTaskType::kPartOfUploadTask && image_data->upload.task) { // We had an existing upload task, ref the image and return the task. RefImage(draw_image); return TaskResult(image_data->upload.task); - } else if (task_type == DecodeTaskType::STAND_ALONE_DECODE_TASK && + } else if (task_type == DecodeTaskType::kStandAloneDecodeTask && image_data->decode.stand_alone_task) { // We had an existing out of raster task, ref the image and return the task. RefImage(draw_image); @@ -628,13 +664,13 @@ // If we already have an image and it is locked (or lock-able), just return // that. - if (image_data->upload.image() && + if (image_data->HasUploadedData() && TryLockImage(HaveContextLock::kNo, draw_image, image_data)) { return TaskResult(true); } scoped_refptr<TileTask> task; - if (task_type == DecodeTaskType::PART_OF_UPLOAD_TASK) { + if (task_type == DecodeTaskType::kPartOfUploadTask) { // Ref image and create a upload and decode tasks. We will release this ref // in UploadTaskCompleted. RefImage(draw_image); @@ -696,17 +732,32 @@ // in DrawWithImageFinished. UnrefImageDecode(draw_image); - sk_sp<SkImage> image = image_data->upload.image(); - if (image) - image_data->upload.mark_used(); - DCHECK(image || image_data->decode.decode_failure); + if (image_data->mode == DecodedDataMode::kTransferCache) { + DCHECK(use_transfer_cache_); + auto id = image_data->upload.transfer_cache_id(); + if (id) + image_data->upload.mark_used(); + DCHECK(id || image_data->decode.decode_failure); - SkSize scale_factor = - CalculateScaleFactorForMipLevel(draw_image, image_data->mip_level); - DecodedDrawImage decoded_draw_image( - std::move(image), SkSize(), scale_factor, - CalculateDesiredFilterQuality(draw_image)); - return decoded_draw_image; + SkSize scale_factor = + CalculateScaleFactorForMipLevel(draw_image, image_data->mip_level); + DecodedDrawImage decoded_draw_image( + id, SkSize(), scale_factor, CalculateDesiredFilterQuality(draw_image)); + return decoded_draw_image; + } else { + DCHECK(!use_transfer_cache_); + sk_sp<SkImage> image = image_data->upload.image(); + if (image) + image_data->upload.mark_used(); + DCHECK(image || image_data->decode.decode_failure); + + SkSize scale_factor = + CalculateScaleFactorForMipLevel(draw_image, image_data->mip_level); + DecodedDrawImage decoded_draw_image( + std::move(image), SkSize(), scale_factor, + CalculateDesiredFilterQuality(draw_image)); + return decoded_draw_image; + } } void GpuImageDecodeCache::DrawWithImageFinished( @@ -776,7 +827,7 @@ entry.second->upload.ref_count != 0) { // Orphan the entry so it will be deleted once no longer in use. entry.second->is_orphaned = true; - } else if (entry.second->upload.image()) { + } else if (entry.second->HasUploadedData()) { DeleteImage(entry.second.get()); } } @@ -794,7 +845,7 @@ if (it->second->decode.ref_count != 0 || it->second->upload.ref_count != 0) { it->second->is_orphaned = true; - } else if (it->second->upload.image()) { + } else if (it->second->HasUploadedData()) { DeleteImage(it->second.get()); } persistent_cache_.Erase(it); @@ -845,8 +896,8 @@ // If we have an uploaded image (that is actually on the GPU, not just a // CPU wrapper), upload it here. - if (image_data->upload.image() && - image_data->mode == DecodedDataMode::GPU) { + if (image_data->HasUploadedData() && + image_data->mode == DecodedDataMode::kGpu) { size_t discardable_size = image_data->size; // If the discardable system has deleted this out from under us, log a // size of 0 to match software discardable. @@ -918,11 +969,11 @@ // Decode task is complete, remove our reference to it. ImageData* image_data = GetImageDataForDrawImage(draw_image); DCHECK(image_data); - if (task_type == DecodeTaskType::PART_OF_UPLOAD_TASK) { + if (task_type == DecodeTaskType::kPartOfUploadTask) { DCHECK(image_data->decode.task); image_data->decode.task = nullptr; } else { - DCHECK(task_type == DecodeTaskType::STAND_ALONE_DECODE_TASK); + DCHECK(task_type == DecodeTaskType::kStandAloneDecodeTask); DCHECK(image_data->decode.stand_alone_task); image_data->decode.stand_alone_task = nullptr; } @@ -962,7 +1013,7 @@ // This ref is kept alive while an upload task may need this decode. We // release this ref in UploadTaskCompleted. - if (task_type == DecodeTaskType::PART_OF_UPLOAD_TASK) + if (task_type == DecodeTaskType::kPartOfUploadTask) RefImageDecode(draw_image); ImageData* image_data = GetImageDataForDrawImage(draw_image); @@ -971,13 +1022,13 @@ // We should never be creating a decode task for an at raster image. DCHECK(!image_data->is_at_raster); // We should never be creating a decode for an already-uploaded image. - DCHECK(!image_data->upload.image()); + DCHECK(!image_data->HasUploadedData()); return nullptr; } // We didn't have an existing locked image, create a task to lock or decode. scoped_refptr<TileTask>& existing_task = - (task_type == DecodeTaskType::PART_OF_UPLOAD_TASK) + (task_type == DecodeTaskType::kPartOfUploadTask) ? image_data->decode.task : image_data->decode.stand_alone_task; if (!existing_task) { @@ -1068,7 +1119,7 @@ // Don't keep around completely empty images. This can happen if an image's // decode/upload tasks were both cancelled before completing. - if (!has_any_refs && !image_data->upload.image() && + if (!has_any_refs && !image_data->HasUploadedData() && !image_data->decode.data() && !image_data->is_orphaned) { auto found_persistent = persistent_cache_.Peek(draw_image.frame_key()); if (found_persistent != persistent_cache_.end()) @@ -1077,8 +1128,8 @@ // If we have no refs on an uploaded image, it should be unlocked. Do this // before any attempts to delete the image. - if (image_data->mode == DecodedDataMode::GPU && - image_data->upload.ref_count == 0 && image_data->upload.is_locked()) { + if (image_data->IsGpuOrTransferCache() && image_data->upload.ref_count == 0 && + image_data->upload.is_locked()) { UnlockImage(image_data); } @@ -1090,7 +1141,7 @@ // Don't keep CPU images if they are unused, these images can be recreated by // re-locking discardable (rather than requiring a full upload like GPU // images). - if (image_data->mode == DecodedDataMode::CPU && !has_any_refs) { + if (image_data->mode == DecodedDataMode::kCpu && !has_any_refs) { DeleteImage(image_data); } @@ -1122,12 +1173,10 @@ // We should unlock the decoded image memory for the image in two cases: // 1) The image is no longer being used (no decode or upload refs). - // 2) This is a GPU backed image that has already been uploaded (no decode - // refs, and we actually already have an image). - bool should_unlock_decode = - !has_any_refs || - (image_data->mode == DecodedDataMode::GPU && - !image_data->decode.ref_count && image_data->upload.image()); + // 2) This is a non-CPU image that has already been uploaded and we have + // no remaining decode refs. + bool should_unlock_decode = !has_any_refs || (image_data->HasUploadedData() && + !image_data->decode.ref_count); if (should_unlock_decode && image_data->decode.is_locked()) { DCHECK(image_data->decode.data()); @@ -1139,10 +1188,10 @@ #if DCHECK_IS_ON() // Sanity check the above logic. - if (image_data->upload.image()) { + if (image_data->HasUploadedData()) { DCHECK(image_data->is_at_raster || image_data->upload.budgeted || !image_data->upload.is_locked()); - if (image_data->mode == DecodedDataMode::CPU) + if (image_data->mode == DecodedDataMode::kCpu) DCHECK(image_data->decode.is_locked()); } else { DCHECK(!image_data->upload.budgeted || image_data->upload.ref_count > 0); @@ -1178,10 +1227,10 @@ // If an image without refs is budgeted, it must have an associated image // upload. - DCHECK(!it->second->upload.budgeted || it->second->upload.image()); + DCHECK(!it->second->upload.budgeted || it->second->HasUploadedData()); // Free the uploaded image if it exists. - if (it->second->upload.image()) + if (it->second->HasUploadedData()) DeleteImage(it->second.get()); it = persistent_cache_.Erase(it); @@ -1231,7 +1280,7 @@ return; } - if (image_data->upload.image() && + if (image_data->HasUploadedData() && TryLockImage(HaveContextLock::kNo, draw_image, image_data)) { // We already have an uploaded image, no reason to decode. return; @@ -1299,7 +1348,7 @@ return; } - if (image_data->upload.image() && + if (image_data->HasUploadedData() && TryLockImage(HaveContextLock::kYes, draw_image, image_data)) { // Someone has uploaded this image before us (at raster). return; @@ -1310,52 +1359,65 @@ DCHECK_GT(image_data->decode.ref_count, 0u); DCHECK_GT(image_data->upload.ref_count, 0u); - sk_sp<SkImage> uploaded_image = image_data->decode.image(); - if (image_data->mode == DecodedDataMode::GPU) { - base::AutoUnlock unlock(lock_); - uploaded_image = - uploaded_image->makeTextureImage(context_->GrContext(), nullptr); - } - image_data->decode.mark_used(); - - if (uploaded_image && SupportsColorSpaces() && - draw_image.target_color_space().IsValid()) { - TRACE_EVENT0("cc", "GpuImageDecodeCache::UploadImage - color conversion"); - sk_sp<SkImage> pre_converted_image = uploaded_image; - uploaded_image = uploaded_image->makeColorSpace( - draw_image.target_color_space().ToSkColorSpace(), - SkTransferFunctionBehavior::kIgnore); - - // If we created a new image while converting colorspace, we should destroy - // the previous image without caching it. - if (uploaded_image != pre_converted_image) - DeleteSkImageAndPreventCaching(context_, std::move(pre_converted_image)); - } - - // At-raster may have decoded this while we were unlocked. If so, ignore our - // result. - if (!image_data->upload.image()) { - // Take ownership of any GL texture backing for the SkImage. This allows us - // to use the image with the discardable system. - if (uploaded_image) { - uploaded_image = TakeOwnershipOfSkImageBacking(context_->GrContext(), - std::move(uploaded_image)); - } - - // TODO(crbug.com/740737): uploaded_image is sometimes null in certain - // context-lost situations. - if (!uploaded_image) + if (image_data->mode == DecodedDataMode::kTransferCache) { + DCHECK(use_transfer_cache_); + SkPixmap pixmap; + if (!image_data->decode.image()->peekPixels(&pixmap)) return; - image_data->upload.SetImage(std::move(uploaded_image)); + ClientImageTransferCacheEntry image_entry(&pixmap, nullptr); + context_->ContextSupport()->CreateTransferCacheEntry(image_entry); + image_data->upload.SetTransferCacheId(image_entry.Id()); + } else { + DCHECK(!use_transfer_cache_); + sk_sp<SkImage> uploaded_image = image_data->decode.image(); + if (image_data->mode == DecodedDataMode::kGpu) { + base::AutoUnlock unlock(lock_); + uploaded_image = + uploaded_image->makeTextureImage(context_->GrContext(), nullptr); + } + image_data->decode.mark_used(); - // If we have a new GPU-backed image, initialize it for use in the GPU - // discardable system. - if (image_data->mode == DecodedDataMode::GPU) { - // Notify the discardable system of this image so it will count against - // budgets. - context_->RasterInterface()->InitializeDiscardableTextureCHROMIUM( - image_data->upload.gl_id()); + if (uploaded_image && SupportsColorSpaces() && + draw_image.target_color_space().IsValid()) { + TRACE_EVENT0("cc", "GpuImageDecodeCache::UploadImage - color conversion"); + sk_sp<SkImage> pre_converted_image = uploaded_image; + uploaded_image = uploaded_image->makeColorSpace( + draw_image.target_color_space().ToSkColorSpace(), + SkTransferFunctionBehavior::kIgnore); + + // If we created a new image while converting colorspace, we should + // destroy the previous image without caching it. + if (uploaded_image != pre_converted_image) + DeleteSkImageAndPreventCaching(context_, + std::move(pre_converted_image)); + } + + // At-raster may have decoded this while we were unlocked. If so, ignore our + // result. + if (!image_data->upload.image()) { + // Take ownership of any GL texture backing for the SkImage. This allows + // us to use the image with the discardable system. + if (uploaded_image) { + uploaded_image = TakeOwnershipOfSkImageBacking( + context_->GrContext(), std::move(uploaded_image)); + } + + // TODO(crbug.com/740737): uploaded_image is sometimes null in certain + // context-lost situations. + if (!uploaded_image) + return; + + image_data->upload.SetImage(std::move(uploaded_image)); + + // If we have a new GPU-backed image, initialize it for use in the GPU + // discardable system. + if (image_data->mode == DecodedDataMode::kGpu) { + // Notify the discardable system of this image so it will count against + // budgets. + context_->RasterInterface()->InitializeDiscardableTextureCHROMIUM( + image_data->upload.gl_id()); + } } } } @@ -1370,12 +1432,14 @@ SkImageInfo image_info = CreateImageInfoForDrawImage(draw_image, mip_level); DecodedDataMode mode; - if (image_info.width() > max_texture_size_ || - image_info.height() > max_texture_size_) { + if (use_transfer_cache_) { + mode = DecodedDataMode::kTransferCache; + } else if (image_info.width() > max_texture_size_ || + image_info.height() > max_texture_size_) { // Image too large to upload. Try to use SW fallback. - mode = DecodedDataMode::CPU; + mode = DecodedDataMode::kCpu; } else { - mode = DecodedDataMode::GPU; + mode = DecodedDataMode::kGpu; } size_t data_size = image_info.computeMinByteSize(); @@ -1385,16 +1449,24 @@ } void GpuImageDecodeCache::DeleteImage(ImageData* image_data) { - if (image_data->mode == DecodedDataMode::GPU && image_data->upload.image()) { + if (image_data->HasUploadedData()) { DCHECK(!image_data->upload.is_locked()); - images_pending_deletion_.push_back(image_data->upload.image()); + if (image_data->mode == DecodedDataMode::kGpu) + images_pending_deletion_.push_back(image_data->upload.image()); + if (image_data->mode == DecodedDataMode::kTransferCache) + ids_pending_deletion_.push_back(*image_data->upload.transfer_cache_id()); } - image_data->upload.ResetImage(); + image_data->upload.Reset(); } void GpuImageDecodeCache::UnlockImage(ImageData* image_data) { - DCHECK_EQ(DecodedDataMode::GPU, image_data->mode); - images_pending_unlock_.push_back(image_data->upload.image().get()); + DCHECK(image_data->HasUploadedData()); + if (image_data->mode == DecodedDataMode::kGpu) { + images_pending_unlock_.push_back(image_data->upload.image().get()); + } else { + DCHECK(image_data->mode == DecodedDataMode::kTransferCache); + ids_pending_unlock_.push_back(*image_data->upload.transfer_cache_id()); + } image_data->upload.OnUnlock(); } @@ -1422,6 +1494,12 @@ } images_pending_unlock_.clear(); + for (auto id : ids_pending_unlock_) { + context_->ContextSupport()->UnlockTransferCacheEntries( + {std::make_pair(TransferCacheEntryType::kImage, id)}); + } + ids_pending_unlock_.clear(); + for (auto& image : images_pending_deletion_) { uint32_t texture_id = GlIdFromSkImage(image.get()); if (context_->RasterInterface()->LockDiscardableTextureCHROMIUM( @@ -1430,6 +1508,15 @@ } } images_pending_deletion_.clear(); + + for (auto id : ids_pending_deletion_) { + if (context_->ContextSupport()->ThreadsafeLockTransferCacheEntry( + TransferCacheEntryType::kImage, id)) { + context_->ContextSupport()->DeleteTransferCacheEntry( + TransferCacheEntryType::kImage, id); + } + } + ids_pending_deletion_.clear(); } SkImageInfo GpuImageDecodeCache::CreateImageInfoForDrawImage( @@ -1445,12 +1532,25 @@ bool GpuImageDecodeCache::TryLockImage(HaveContextLock have_context_lock, const DrawImage& draw_image, ImageData* data) { + DCHECK(data->HasUploadedData()); + if (data->upload.is_locked()) return true; - if (have_context_lock == HaveContextLock::kYes && - context_->RasterInterface()->LockDiscardableTextureCHROMIUM( - data->upload.gl_id())) { + if (data->mode == DecodedDataMode::kTransferCache) { + DCHECK(use_transfer_cache_); + DCHECK(data->upload.transfer_cache_id()); + if (context_->ContextSupport()->ThreadsafeLockTransferCacheEntry( + TransferCacheEntryType::kImage, + *data->upload.transfer_cache_id())) { + data->upload.OnLock(); + return true; + } + } else if (have_context_lock == HaveContextLock::kYes && + context_->RasterInterface()->LockDiscardableTextureCHROMIUM( + data->upload.gl_id())) { + DCHECK(!use_transfer_cache_); + DCHECK(data->mode == DecodedDataMode::kGpu); // If |have_context_lock|, we can immediately lock the image and send // the lock command to the GPU process. data->upload.OnLock(); @@ -1458,6 +1558,8 @@ } else if (context_->ContextSupport() ->ThreadSafeShallowLockDiscardableTexture( data->upload.gl_id())) { + DCHECK(!use_transfer_cache_); + DCHECK(data->mode == DecodedDataMode::kGpu); // If !|have_context_lock|, we use ThreadsafeShallowLockDiscardableTexture. // This takes a reference to the image, ensuring that it can't be deleted // by the service, but delays sending a lock command over the command
diff --git a/cc/tiles/gpu_image_decode_cache.h b/cc/tiles/gpu_image_decode_cache.h index 17c643e..1c742a4 100644 --- a/cc/tiles/gpu_image_decode_cache.h +++ b/cc/tiles/gpu_image_decode_cache.h
@@ -100,9 +100,10 @@ public base::trace_event::MemoryDumpProvider, public base::MemoryCoordinatorClient { public: - enum class DecodeTaskType { PART_OF_UPLOAD_TASK, STAND_ALONE_DECODE_TASK }; + enum class DecodeTaskType { kPartOfUploadTask, kStandAloneDecodeTask }; explicit GpuImageDecodeCache(viz::RasterContextProvider* context, + bool use_transfer_cache, SkColorType color_type, size_t max_working_set_bytes); ~GpuImageDecodeCache() override; @@ -158,7 +159,7 @@ bool IsInInUseCacheForTesting(const DrawImage& image) const; private: - enum class DecodedDataMode { GPU, CPU }; + enum class DecodedDataMode { kGpu, kCpu, kTransferCache }; // Stores stats tracked by both DecodedImageData and UploadedImageData. struct ImageDataBase { @@ -230,19 +231,47 @@ ~UploadedImageData(); void SetImage(sk_sp<SkImage> image); - void ResetImage(); - const sk_sp<SkImage>& image() const { return image_; } - GrGLuint gl_id() const { return gl_id_; } + void SetTransferCacheId(uint32_t id); + void Reset(); + + // If in image mode. + const sk_sp<SkImage>& image() const { + DCHECK(mode_ == Mode::kSkImage || mode_ == Mode::kNone); + return image_; + } + GrGLuint gl_id() const { + DCHECK(mode_ == Mode::kSkImage || mode_ == Mode::kNone); + return gl_id_; + } + + // If in transfer cache mode. + base::Optional<uint32_t> transfer_cache_id() const { + DCHECK(mode_ == Mode::kTransferCache || mode_ == Mode::kNone); + return transfer_cache_id_; + } // True if the image is counting against our working set limits. bool budgeted = false; private: + // Used for internal DCHECKs only. + enum class Mode { + kNone, + kSkImage, + kTransferCache, + }; + void ReportUsageStats() const; + Mode mode_ = Mode::kNone; + + // Used if |mode_| == kSkImage. // May be null if image not yet uploaded / prepared. sk_sp<SkImage> image_; GrGLuint gl_id_ = 0; + + // Used if |mode_| == kTransferCache. + base::Optional<uint32_t> transfer_cache_id_; }; struct ImageData : public base::RefCountedThreadSafe<ImageData> { @@ -252,6 +281,9 @@ SkFilterQuality quality, int mip_level); + bool IsGpuOrTransferCache() const; + bool HasUploadedData() const; + const DecodedDataMode mode; const size_t size; gfx::ColorSpace target_color_space; @@ -382,6 +414,7 @@ bool SupportsColorSpaces() const; const SkColorType color_type_; + const bool use_transfer_cache_ = false; viz::RasterContextProvider* context_; int max_texture_size_ = 0; @@ -414,6 +447,9 @@ std::vector<SkImage*> images_pending_unlock_; std::vector<sk_sp<SkImage>> images_pending_deletion_; + std::vector<uint32_t> ids_pending_unlock_; + std::vector<uint32_t> ids_pending_deletion_; + // Records the maximum number of items in the cache over the lifetime of the // cache. This is updated anytime we are requested to reduce cache usage. size_t lifetime_max_items_in_cache_ = 0u;
diff --git a/cc/tiles/gpu_image_decode_cache_unittest.cc b/cc/tiles/gpu_image_decode_cache_unittest.cc index 3a3993ab..26b3c8d 100644 --- a/cc/tiles/gpu_image_decode_cache_unittest.cc +++ b/cc/tiles/gpu_image_decode_cache_unittest.cc
@@ -7,6 +7,7 @@ #include <memory> #include "cc/paint/draw_image.h" +#include "cc/paint/image_transfer_cache_entry.h" #include "cc/paint/paint_image_builder.h" #include "cc/test/fake_paint_image_generator.h" #include "cc/test/skia_common.h" @@ -14,6 +15,7 @@ #include "cc/test/test_gles2_interface.h" #include "cc/test/test_tile_task_runner.h" #include "cc/test/test_web_graphics_context_3d.h" +#include "cc/test/transfer_cache_test_helper.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkImageGenerator.h" #include "third_party/skia/include/core/SkRefCnt.h" @@ -93,15 +95,17 @@ TestGLES2Interface* gl_ = nullptr; }; -class FakeDiscardableGLES2Interface : public TestGLES2Interface, - public TestContextSupport { +class FakeGPUImageDecodeTestGLES2Interface : public TestGLES2Interface, + public TestContextSupport { public: - explicit FakeDiscardableGLES2Interface( - FakeDiscardableManager* discardable_manager) + explicit FakeGPUImageDecodeTestGLES2Interface( + FakeDiscardableManager* discardable_manager, + TransferCacheTestHelper* transfer_cache_helper) : extension_string_("GL_EXT_texture_format_BGRA8888 GL_OES_rgb8_rgba8"), - discardable_manager_(discardable_manager) {} + discardable_manager_(discardable_manager), + transfer_cache_helper_(transfer_cache_helper) {} - ~FakeDiscardableGLES2Interface() override { + ~FakeGPUImageDecodeTestGLES2Interface() override { // All textures / framebuffers / renderbuffers should be cleaned up. if (test_context_) { EXPECT_EQ(0u, test_context_->NumTextures()); @@ -126,6 +130,24 @@ void CompleteLockDiscardableTexureOnContextThread( uint32_t texture_id) override {} + void CreateTransferCacheEntry( + const ClientTransferCacheEntry& entry) override { + transfer_cache_helper_->CreateEntryDirect(entry); + } + bool ThreadsafeLockTransferCacheEntry(TransferCacheEntryType entry_type, + uint32_t entry_id) override { + return transfer_cache_helper_->LockEntryDirect(entry_type, entry_id); + } + void UnlockTransferCacheEntries( + const std::vector<std::pair<TransferCacheEntryType, uint32_t>>& entries) + override { + transfer_cache_helper_->UnlockEntriesDirect(entries); + } + void DeleteTransferCacheEntry(TransferCacheEntryType entry_type, + uint32_t entry_id) override { + transfer_cache_helper_->DeleteEntryDirect(entry_type, entry_id); + } + // TestGLES2Interface: const GLubyte* GetString(GLenum name) override { switch (name) { @@ -165,21 +187,25 @@ private: const std::string extension_string_; FakeDiscardableManager* discardable_manager_; + TransferCacheTestHelper* transfer_cache_helper_; }; -class DiscardableTextureMockContextProvider : public TestContextProvider { +class GPUImageDecodeTestMockContextProvider : public TestContextProvider { public: - static scoped_refptr<DiscardableTextureMockContextProvider> Create( - FakeDiscardableManager* discardable_manager) { - return new DiscardableTextureMockContextProvider( - std::make_unique<FakeDiscardableGLES2Interface>(discardable_manager), - std::make_unique<FakeDiscardableGLES2Interface>(discardable_manager), + static scoped_refptr<GPUImageDecodeTestMockContextProvider> Create( + FakeDiscardableManager* discardable_manager, + TransferCacheTestHelper* transfer_cache_helper) { + return new GPUImageDecodeTestMockContextProvider( + std::make_unique<FakeGPUImageDecodeTestGLES2Interface>( + discardable_manager, transfer_cache_helper), + std::make_unique<FakeGPUImageDecodeTestGLES2Interface>( + discardable_manager, transfer_cache_helper), TestWebGraphicsContext3D::Create()); } private: - ~DiscardableTextureMockContextProvider() override = default; - DiscardableTextureMockContextProvider( + ~GPUImageDecodeTestMockContextProvider() override = default; + GPUImageDecodeTestMockContextProvider( std::unique_ptr<TestContextSupport> support, std::unique_ptr<TestGLES2Interface> gl, std::unique_ptr<TestWebGraphicsContext3D> context) @@ -195,30 +221,66 @@ size_t kGpuMemoryLimitBytes = 96 * 1024 * 1024; -class GpuImageDecodeCacheTest : public ::testing::TestWithParam<SkColorType> { +class GpuImageDecodeCacheTest + : public ::testing::TestWithParam< + std::pair<SkColorType, bool /* use_transfer_cache */>> { public: void SetUp() override { - context_provider_ = - DiscardableTextureMockContextProvider::Create(&discardable_manager_); + context_provider_ = GPUImageDecodeTestMockContextProvider::Create( + &discardable_manager_, &transfer_cache_helper_); discardable_manager_.SetGLES2Interface(context_provider_->TestContextGL()); context_provider_->BindToCurrentThread(); - } - std::unique_ptr<GpuImageDecodeCache> CreateCache() { - return base::WrapUnique(new GpuImageDecodeCache( - context_provider_.get(), GetParam(), kGpuMemoryLimitBytes)); + transfer_cache_helper_.SetGrContext(context_provider_->GrContext()); + use_transfer_cache_ = GetParam().second; + color_type_ = GetParam().first; } - DiscardableTextureMockContextProvider* context_provider() { + std::unique_ptr<GpuImageDecodeCache> CreateCache() { + return base::WrapUnique( + new GpuImageDecodeCache(context_provider_.get(), use_transfer_cache_, + color_type_, kGpuMemoryLimitBytes)); + } + + GPUImageDecodeTestMockContextProvider* context_provider() { return context_provider_.get(); } - void SetDiscardableTexturesLimit(size_t limit) { + void ExpectIfNotUsingTransferCache(bool value) { + if (!use_transfer_cache_) { + EXPECT_TRUE(value); + } + } + + void SetCachedTexturesLimit(size_t limit) { discardable_manager_.set_cached_textures_limit(limit); + transfer_cache_helper_.SetCachedItemsLimit(limit); + } + + // If this is an image-backed DecodedDrawImage, does nothing. Otherwise this + // retreives the image from the transfer cache and builds a new + // DecodedDrawImage. + DecodedDrawImage EnsureImageBacked(DecodedDrawImage&& draw_image) { + if (draw_image.transfer_cache_entry_id()) { + EXPECT_TRUE(use_transfer_cache_); + sk_sp<SkImage> image = transfer_cache_helper_ + .GetEntryAs<ServiceImageTransferCacheEntry>( + *draw_image.transfer_cache_entry_id()) + ->image(); + DecodedDrawImage new_draw_image( + std::move(image), draw_image.src_rect_offset(), + draw_image.scale_adjustment(), draw_image.filter_quality()); + return new_draw_image; + } + + return draw_image; } private: FakeDiscardableManager discardable_manager_; - scoped_refptr<DiscardableTextureMockContextProvider> context_provider_; + scoped_refptr<GPUImageDecodeTestMockContextProvider> context_provider_; + TransferCacheTestHelper transfer_cache_helper_; + bool use_transfer_cache_; + SkColorType color_type_; }; SkMatrix CreateMatrix(const SkSize& scale, bool is_decomposable) { @@ -744,7 +806,7 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_TRUE(decoded_draw_image.image()->isTextureBacked()); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); @@ -775,10 +837,11 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_FALSE(decoded_draw_image.image()->isTextureBacked()); - EXPECT_TRUE(cache->DiscardableIsLockedForTesting(draw_image)); + ExpectIfNotUsingTransferCache( + cache->DiscardableIsLockedForTesting(draw_image)); cache->DrawWithImageFinished(draw_image, decoded_draw_image); cache->UnrefImage(draw_image); @@ -807,7 +870,7 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_TRUE(decoded_draw_image.image()->isTextureBacked()); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); @@ -849,13 +912,13 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_TRUE(decoded_draw_image.image()->isTextureBacked()); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); DecodedDrawImage larger_decoded_draw_image = - cache->GetDecodedImageForDraw(larger_draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(larger_draw_image)); EXPECT_TRUE(larger_decoded_draw_image.image()); EXPECT_TRUE(larger_decoded_draw_image.image()->isTextureBacked()); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); @@ -901,13 +964,13 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_TRUE(decoded_draw_image.image()->isTextureBacked()); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); - DecodedDrawImage larger_decoded_draw_image = - cache->GetDecodedImageForDraw(higher_quality_draw_image); + DecodedDrawImage larger_decoded_draw_image = EnsureImageBacked( + cache->GetDecodedImageForDraw(higher_quality_draw_image)); EXPECT_TRUE(larger_decoded_draw_image.image()); EXPECT_TRUE(larger_decoded_draw_image.image()->isTextureBacked()); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); @@ -943,7 +1006,7 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_EQ(decoded_draw_image.image()->width(), 50); EXPECT_EQ(decoded_draw_image.image()->height(), 50); @@ -976,14 +1039,15 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); // The mip level scale should never go below 0 in any dimension. EXPECT_EQ(1, decoded_draw_image.image()->width()); EXPECT_EQ(24000, decoded_draw_image.image()->height()); EXPECT_EQ(decoded_draw_image.filter_quality(), kMedium_SkFilterQuality); EXPECT_FALSE(decoded_draw_image.image()->isTextureBacked()); - EXPECT_TRUE(cache->DiscardableIsLockedForTesting(draw_image)); + ExpectIfNotUsingTransferCache( + cache->DiscardableIsLockedForTesting(draw_image)); cache->DrawWithImageFinished(draw_image, decoded_draw_image); cache->UnrefImage(draw_image); @@ -1012,7 +1076,7 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_TRUE(decoded_draw_image.image()->isTextureBacked()); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); @@ -1048,13 +1112,13 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_TRUE(decoded_draw_image.image()->isTextureBacked()); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); DecodedDrawImage another_decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_EQ(decoded_draw_image.image()->uniqueID(), another_decoded_draw_image.image()->uniqueID()); @@ -1078,19 +1142,21 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(decoded_draw_image.image()); EXPECT_FALSE(decoded_draw_image.image()->isTextureBacked()); - EXPECT_TRUE(cache->DiscardableIsLockedForTesting(draw_image)); + ExpectIfNotUsingTransferCache( + cache->DiscardableIsLockedForTesting(draw_image)); cache->DrawWithImageFinished(draw_image, decoded_draw_image); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); DecodedDrawImage second_decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_TRUE(second_decoded_draw_image.image()); EXPECT_FALSE(second_decoded_draw_image.image()->isTextureBacked()); - EXPECT_TRUE(cache->DiscardableIsLockedForTesting(draw_image)); + ExpectIfNotUsingTransferCache( + cache->DiscardableIsLockedForTesting(draw_image)); cache->DrawWithImageFinished(draw_image, second_decoded_draw_image); EXPECT_FALSE(cache->DiscardableIsLockedForTesting(draw_image)); @@ -1116,7 +1182,7 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_FALSE(decoded_draw_image.image()); cache->DrawWithImageFinished(draw_image, decoded_draw_image); @@ -1142,7 +1208,7 @@ // DrawWithImageFinished. viz::ContextProvider::ScopedContextLock context_lock(context_provider()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); EXPECT_FALSE(decoded_draw_image.image()); cache->DrawWithImageFinished(draw_image, decoded_draw_image); @@ -1413,7 +1479,7 @@ CreateMatrix(SkSize::Make(0.6f, 0.6f), is_decomposable), PaintImage::kDefaultFrameIndex, DefaultColorSpace()); DecodedDrawImage decoded_draw_image = - cache->GetDecodedImageForDraw(draw_image_mips); + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image_mips)); cache->DrawWithImageFinished(draw_image_mips, decoded_draw_image); } @@ -1502,7 +1568,7 @@ } TEST_P(GpuImageDecodeCacheTest, ZeroCacheNormalWorkingSet) { - SetDiscardableTexturesLimit(0); + SetCachedTexturesLimit(0); auto cache = CreateCache(); bool is_decomposable = true; SkFilterQuality quality = kHigh_SkFilterQuality; @@ -1555,7 +1621,7 @@ TEST_P(GpuImageDecodeCacheTest, SmallCacheNormalWorkingSet) { // Cache will fit one image. - SetDiscardableTexturesLimit(1); + SetCachedTexturesLimit(1); auto cache = CreateCache(); bool is_decomposable = true; SkFilterQuality quality = kHigh_SkFilterQuality; @@ -1807,7 +1873,8 @@ quality, CreateMatrix(SkSize::Make(1.0f, 1.0f), is_decomposable), 1u, DefaultColorSpace()); - auto decoded_image = cache->GetDecodedImageForDraw(draw_image); + auto decoded_image = + EnsureImageBacked(cache->GetDecodedImageForDraw(draw_image)); ASSERT_TRUE(decoded_image.image()); ASSERT_EQ(generator->frames_decoded().size(), 1u); EXPECT_EQ(generator->frames_decoded().count(1u), 1u); @@ -1817,7 +1884,8 @@ // Scaled. DrawImage scaled_draw_image(draw_image, 0.5f, 2u, draw_image.target_color_space()); - decoded_image = cache->GetDecodedImageForDraw(scaled_draw_image); + decoded_image = + EnsureImageBacked(cache->GetDecodedImageForDraw(scaled_draw_image)); ASSERT_TRUE(decoded_image.image()); ASSERT_EQ(generator->frames_decoded().size(), 1u); EXPECT_EQ(generator->frames_decoded().count(2u), 1u); @@ -1829,7 +1897,8 @@ image, SkIRect::MakeWH(5, 5), quality, CreateMatrix(SkSize::Make(1.0f, 1.0f), is_decomposable), 3u, DefaultColorSpace()); - decoded_image = cache->GetDecodedImageForDraw(subset_draw_image); + decoded_image = + EnsureImageBacked(cache->GetDecodedImageForDraw(subset_draw_image)); ASSERT_TRUE(decoded_image.image()); ASSERT_EQ(generator->frames_decoded().size(), 1u); EXPECT_EQ(generator->frames_decoded().count(3u), 1u); @@ -1892,10 +1961,14 @@ EXPECT_EQ(0u, cache->GetInUseCacheEntriesForTesting()); } -INSTANTIATE_TEST_CASE_P(GpuImageDecodeCacheTests, - GpuImageDecodeCacheTest, - ::testing::Values(kN32_SkColorType, - kARGB_4444_SkColorType)); +INSTANTIATE_TEST_CASE_P( + GpuImageDecodeCacheTests, + GpuImageDecodeCacheTest, + ::testing::Values( + std::make_pair(kN32_SkColorType, false /* use_transfer_cache */), + std::make_pair(kARGB_4444_SkColorType, false /* use_transfer_cache */), + std::make_pair(kN32_SkColorType, true /* use_transfer_cache */), + std::make_pair(kARGB_4444_SkColorType, true /* use_transfer_cache */))); } // namespace } // namespace cc
diff --git a/cc/tiles/picture_layer_tiling_set_unittest.cc b/cc/tiles/picture_layer_tiling_set_unittest.cc index 167bcb9..75497e8 100644 --- a/cc/tiles/picture_layer_tiling_set_unittest.cc +++ b/cc/tiles/picture_layer_tiling_set_unittest.cc
@@ -250,7 +250,7 @@ ASSERT_EQ(context_provider->BindToCurrentThread(), gpu::ContextResult::kSuccess); auto shared_bitmap_manager = std::make_unique<TestSharedBitmapManager>(); - std::unique_ptr<ResourceProvider> resource_provider = + std::unique_ptr<LayerTreeResourceProvider> resource_provider = FakeResourceProvider::CreateLayerTreeResourceProvider( context_provider.get(), shared_bitmap_manager.get());
diff --git a/cc/tiles/tile.cc b/cc/tiles/tile.cc index 8e80840..f0d076e 100644 --- a/cc/tiles/tile.cc +++ b/cc/tiles/tile.cc
@@ -12,6 +12,7 @@ #include "base/trace_event/trace_event.h" #include "base/trace_event/trace_event_argument.h" #include "cc/base/math_util.h" +#include "cc/resources/resource_util.h" #include "cc/tiles/tile_manager.h" #include "components/viz/common/traced_value.h"
diff --git a/cc/tiles/tile_draw_info.h b/cc/tiles/tile_draw_info.h index 0cda1e2..a812c1c 100644 --- a/cc/tiles/tile_draw_info.h +++ b/cc/tiles/tile_draw_info.h
@@ -11,6 +11,7 @@ #include "cc/resources/resource_provider.h" #include "cc/resources/scoped_resource.h" #include "components/viz/common/resources/platform_color.h" +#include "components/viz/common/resources/resource_format_utils.h" namespace cc {
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc index 4969e4ab..5a1e7f4 100644 --- a/cc/tiles/tile_manager.cc +++ b/cc/tiles/tile_manager.cc
@@ -28,6 +28,7 @@ #include "cc/raster/playback_image_provider.h" #include "cc/raster/raster_buffer.h" #include "cc/raster/task_category.h" +#include "cc/resources/resource_util.h" #include "cc/tiles/frame_viewer_instrumentation.h" #include "cc/tiles/tile.h" #include "ui/gfx/geometry/axis_transform2d.h"
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index cfc87e5..633ac18 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc
@@ -18,6 +18,7 @@ #include "cc/raster/raster_source.h" #include "cc/raster/synchronous_task_graph_runner.h" #include "cc/resources/resource_pool.h" +#include "cc/resources/resource_util.h" #include "cc/test/fake_impl_task_runner_provider.h" #include "cc/test/fake_layer_tree_frame_sink.h" #include "cc/test/fake_layer_tree_frame_sink_client.h" @@ -1724,7 +1725,7 @@ EXPECT_EQ(TileDrawInfo::RESOURCE_MODE, tile->draw_info().mode()); EXPECT_TRUE(tile->draw_info().IsReadyToDraw()); - ResourceProvider::ScopedWriteLockSoftware lock( + LayerTreeResourceProvider::ScopedWriteLockSoftware lock( host_impl()->resource_provider(), tile->draw_info().resource_id()); const SkBitmap bitmap = lock.sk_bitmap(); for (int x = 0; x < size.width(); ++x) {
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 5d186491..ad17e57 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -2486,6 +2486,7 @@ if (use_gpu_rasterization_) { image_decode_cache_ = std::make_unique<GpuImageDecodeCache>( layer_tree_frame_sink_->worker_context_provider(), + settings_.enable_oop_rasterization, viz::ResourceFormatToClosestSkColorType( settings_.preferred_tile_format), settings_.decoded_image_working_set_budget_bytes); @@ -3615,6 +3616,12 @@ : scroll_state->delta_y(); if (!CanPropagate(scroll_node, delta_x, delta_y)) { + // We should add the first node with non-auto overscroll-behavior to + // the scroll chain regardlessly, as it's the only node we can latch to. + if (current_scroll_chain.empty() || + current_scroll_chain.front() != scroll_node) { + current_scroll_chain.push_front(scroll_node); + } scroll_state->set_is_scroll_chain_cut(true); break; }
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 7bf3a45..f7060bea 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -1645,6 +1645,31 @@ host_impl_->ScrollEnd(EndState().get()); EXPECT_VECTOR_EQ(gfx::Vector2dF(10, 20), scroll_layer->CurrentScrollOffset()); EXPECT_VECTOR_EQ(gfx::Vector2dF(0, 0), overflow->CurrentScrollOffset()); + + // Gesture scroll should latch to the first scroller that has non-auto + // overscroll-behavior. + overflow->test_properties()->overscroll_behavior = + OverscrollBehavior(OverscrollBehavior::kOverscrollBehaviorTypeContain, + OverscrollBehavior::kOverscrollBehaviorTypeContain); + host_impl_->active_tree()->BuildPropertyTreesForTesting(); + + DrawFrame(); + + EXPECT_EQ( + InputHandler::SCROLL_ON_IMPL_THREAD, + host_impl_ + ->ScrollBegin(BeginState(scroll_position).get(), InputHandler::WHEEL) + .thread); + EXPECT_VECTOR_EQ(gfx::Vector2dF(10, 20), scroll_layer->CurrentScrollOffset()); + EXPECT_VECTOR_EQ(gfx::Vector2dF(0, 0), overflow->CurrentScrollOffset()); + + host_impl_->ScrollBy(UpdateState(scroll_position, x_delta).get()); + host_impl_->ScrollBy(UpdateState(scroll_position, -x_delta).get()); + host_impl_->ScrollBy(UpdateState(scroll_position, y_delta).get()); + host_impl_->ScrollBy(UpdateState(scroll_position, -y_delta).get()); + host_impl_->ScrollEnd(EndState().get()); + EXPECT_VECTOR_EQ(gfx::Vector2dF(10, 20), scroll_layer->CurrentScrollOffset()); + EXPECT_VECTOR_EQ(gfx::Vector2dF(10, 10), overflow->CurrentScrollOffset()); } TEST_F(LayerTreeHostImplTest, ScrollWithUserUnscrollableLayers) { @@ -7942,7 +7967,7 @@ public: BlendStateCheckLayer(LayerTreeImpl* tree_impl, int id, - ResourceProvider* resource_provider) + LayerTreeResourceProvider* resource_provider) : LayerImpl(tree_impl, id), blend_(false), has_render_surface_(false),
diff --git a/chrome/VERSION b/chrome/VERSION index af62f9a..5442d48 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ MAJOR=65 MINOR=0 -BUILD=3312 +BUILD=3316 PATCH=0
diff --git a/chrome/android/java/res/drawable-hdpi-v21/popup_background_shadow.9.png b/chrome/android/java/res/drawable-hdpi/popup_background_shadow.9.png similarity index 100% rename from chrome/android/java/res/drawable-hdpi-v21/popup_background_shadow.9.png rename to chrome/android/java/res/drawable-hdpi/popup_background_shadow.9.png Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi-v21/popup_background_shadow.9.png b/chrome/android/java/res/drawable-mdpi/popup_background_shadow.9.png similarity index 100% rename from chrome/android/java/res/drawable-mdpi-v21/popup_background_shadow.9.png rename to chrome/android/java/res/drawable-mdpi/popup_background_shadow.9.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi-v21/popup_background_shadow.9.png b/chrome/android/java/res/drawable-xhdpi/popup_background_shadow.9.png similarity index 100% rename from chrome/android/java/res/drawable-xhdpi-v21/popup_background_shadow.9.png rename to chrome/android/java/res/drawable-xhdpi/popup_background_shadow.9.png Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi-v21/popup_background_shadow.9.png b/chrome/android/java/res/drawable-xxhdpi/popup_background_shadow.9.png similarity index 100% rename from chrome/android/java/res/drawable-xxhdpi-v21/popup_background_shadow.9.png rename to chrome/android/java/res/drawable-xxhdpi/popup_background_shadow.9.png Binary files differ
diff --git a/chrome/android/java/res/drawable/google_pay.xml b/chrome/android/java/res/drawable/google_pay.xml new file mode 100644 index 0000000..efc8348f --- /dev/null +++ b/chrome/android/java/res/drawable/google_pay.xml
@@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright 2017 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. --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="21" + android:viewportWidth="49" + android:viewportHeight="20" + android:width="49dp" + android:height="20dp"> + + <group + android:translateX="-601" + android:translateY="-154"> + <group + android:translateX="601" + android:translateY="154"> + <group + android:translateX="0.327869" + android:translateY="0.327869"> + <group + android:translateX="20.98361" + android:translateY="0.983607"> + <path + android:pathData="M1.9648296 1.8435685l0 4.863859 2.9995097 0c0.7145135 0 1.3053782 -0.2401356 1.772817 -0.720407C7.2168374 5.5078609 7.4572345 4.936427 7.4572345 4.2749421 7.4572345 3.6267982 7.2168374 3.0620347 6.7371563 2.5817633 6.2697175 2.0892629 5.6788528 1.8424568 4.9643393 1.8424568l-2.9995097 0 0 0.00111zm0 6.5759374l0 5.6420761 -1.7918484 0 0 -13.93009189 4.7522936 0c1.2076613 0 2.2326876 0.40244959 3.0773048 1.20623709 0.8570823 0.8037874 1.2854565 1.7832296 1.2854565 2.9372149 0 1.1806671 -0.4284855 2.1667798 -1.2854565 2.9572264C7.1712065 8.0237268 6.1450672 8.4183942 4.9252748 8.4183942l-2.9604452 0 0 0.00111z" + android:fillColor="#5f6368" /> + <path + android:pathData="M11.098782 11.143256c0 0.46693 0.198105 0.856039 0.594427 1.167326 0.396098 0.311287 0.860198 0.466931 1.392299 0.466931 0.753356 0 1.424464 -0.279158 2.01544 -0.836028 0.591087 -0.558093 0.885908 -1.212908 0.885908 -1.9644435 -0.558701 -0.4413605 -1.337765 -0.6614849 -2.337194 -0.6614849 -0.727757 0 -1.334315 0.1756548 -1.820674 0.5258527 -0.48647 0.3500867 -0.730206 0.7826647 -0.730206 1.3018467m2.318274 -6.9261354c1.32441 0 2.369469 0.3535331 3.136402 1.0605992 0.765709 0.7070661 1.148453 1.6765027 1.148453 2.9083098l0 5.8755414 -1.713831 0 0 -1.322969 -0.07802 0c-0.740111 1.089393 -1.727297 1.634256 -2.960334 1.634256 -1.051737 0 -1.93208 -0.311287 -2.638914 -0.933861 -0.7077242 -0.622574 -1.0616421 -1.400791 -1.0616421 -2.334652 0 -0.986113 0.3727267 -1.77 1.1195161 -2.3535519 0.746789 -0.5836631 1.74299 -0.8760505 2.989493 -0.8760505 1.063868 0 1.940872 0.1945544 2.628675 0.5836631l0 -0.40912c0 -0.622574 -0.247075 -1.1506501 -0.74 -1.5853402 -0.494261 -0.43469 -1.070769 -0.6514791 -1.732974 -0.6514791 -1.000541 0 -1.791737 0.4213491 -2.376035 1.2651592L9.5595735 6.0848425C10.4299 4.8396945 11.715356 4.2171206 13.417056 4.2171206" + android:fillColor="#5f6368" /> + <group + android:translateX="17.96962" + android:translateY="4.478368"> + <path + android:pathData="M4.8541062 6.8983529l2.765679 -6.84831352 1.9476613 0 -5.9797653 13.73553762 -1.8498331 0 2.2204452 -4.8060483 -3.93438715 -8.92948932 1.94766125 0 2.8435856 6.84831352z" + android:fillColor="#5f6368" /> + </group> + </group> + <path + android:pathData="M15.708178 8.1868587c0 -0.5636518 -0.04786 -1.1072923 -0.138006 -1.6275862l-7.5569258 0 0 3.0828528 4.3282598 0c-0.185862 1.0049007 -0.747902 1.8599397 -1.600421 2.4324857l0 2.002242 2.583155 0c1.512498 -1.394121 2.383938 -3.454174 2.383938 -5.8899943" + android:fillColor="#4285f4" /> + <path + android:pathData="M8.0132351 16.009045c2.1624609 0 3.9832459 -0.70929 5.3109939 -1.932203L10.741074 12.0746c-0.718965 0.483606 -1.6449392 0.765988 -2.7278389 0.765988 -2.0901188 0 -3.86416 -1.407462 -4.4985412 -3.304089l-2.66106178 0 0 2.062276c1.31884498 2.614811 4.02887648 4.41027 7.15960298 4.41027" + android:fillColor="#34a853" /> + <path + android:pathData="M3.5147051 9.5364767C3.3522145 9.0528702 3.2631785 8.5370232 3.2631785 8.0045001c0 -0.5325231 0.089036 -1.0483701 0.2515266 -1.5319766l0 -2.0622763 -2.66106185 0C0.30829809 5.4908577 0.000011129493 6.7115474 0.000011129493 8.0045001c0 1.2929527 0.308286960507 2.5137539 0.853632120507 3.5942529L3.5147051 9.5364767Z" + android:fillColor="#fabb05" /> + <path + android:pathData="M8.0132351 3.1684568c1.1808392 0 2.2392539 0.4057848 3.0739659 1.2006783l0 0.00111 2.287111 -2.284624C11.985351 0.7937818 10.174583 0 8.0132351 0 4.8825086 0 2.1724771 1.7954588 0.85363212 4.4102695L3.5146939 6.4725457C4.1490751 4.5759186 5.9231163 3.1684568 8.0132351 3.1684568" + android:fillColor="#e94235" /> + </group> + </group> + </group> +</vector>
diff --git a/chrome/android/java/res/layout/bottom_control_container.xml b/chrome/android/java/res/layout/bottom_control_container.xml index f437e0fa..e8fc68ae 100644 --- a/chrome/android/java/res/layout/bottom_control_container.xml +++ b/chrome/android/java/res/layout/bottom_control_container.xml
@@ -9,7 +9,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" > - <FrameLayout + <view + class="org.chromium.chrome.browser.widget.bottomsheet.BottomSheet$TouchRestrictingFrameLayout" android:id="@+id/bottom_sheet_content" android:layout_width="match_parent" android:layout_height="match_parent" @@ -37,7 +38,8 @@ android:scaleY="-1" android:contentDescription="@null" /> - <FrameLayout + <view + class="org.chromium.chrome.browser.widget.bottomsheet.BottomSheet$TouchRestrictingFrameLayout" android:id="@+id/toolbar_holder" android:layout_width="match_parent" android:layout_height="@dimen/bottom_control_container_height" @@ -48,7 +50,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" /> - </FrameLayout> + </view> <ImageView android:id="@+id/toolbar_handle"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 4801a7c..926b79b9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -780,16 +780,6 @@ UpdateMenuItemHelper.getInstance().onStart(); ChromeActivitySessionTracker.getInstance().onStartWithNative(); - if (!SysUtils.isLowEndDevice()) { - if (GSAState.getInstance(this).isGsaAvailable()) { - // GSA connection is not needed on low-end devices because Icing is disabled. - GSAAccountChangeListener.getInstance().connect(); - createContextReporterIfNeeded(); - } else { - ContextReporter.reportStatus(ContextReporter.STATUS_GSA_NOT_AVAILABLE); - } - } - // postDeferredStartupIfNeeded() is called in TabModelSelectorTabObsever#onLoadStopped(), // #onPageLoadFinished() and #onCrash(). If we are not actively loading a tab (e.g. // in Android N multi-instance, which is created by re-parenting an existing tab), @@ -917,6 +907,8 @@ mSyncStateChangedListener = null; } } + if (mContextReporter != null) mContextReporter.disable(); + super.onStopWithNative(); } @@ -1005,6 +997,20 @@ if (isActivityDestroyed()) return; ForcedSigninProcessor.checkCanSignIn(ChromeActivity.this); }); + + // GSA connection is not needed on low-end devices because Icing is disabled. + if (!SysUtils.isLowEndDevice()) { + if (isActivityDestroyed()) return; + DeferredStartupHandler.getInstance().addDeferredTask(() -> { + if (!GSAState.getInstance(this).isGsaAvailable()) { + ContextReporter.reportStatus(ContextReporter.STATUS_GSA_NOT_AVAILABLE); + return; + } + + GSAAccountChangeListener.getInstance().connect(); + createContextReporterIfNeeded(); + }); + } } /** @@ -1035,7 +1041,6 @@ mCompositorViewHolder.prepareForTabReparenting(); } super.onStart(); - if (mContextReporter != null) mContextReporter.enable(); if (mPartnerBrowserRefreshNeeded) { mPartnerBrowserRefreshNeeded = false; @@ -1068,7 +1073,6 @@ @Override public void onStop() { super.onStop(); - if (mContextReporter != null) mContextReporter.disable(); // We want to refresh partner browser provider every onStart(). mPartnerBrowserRefreshNeeded = true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java index 53eb1f5..8105a3a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
@@ -48,6 +48,7 @@ super.attachBaseContext(base); ContextUtils.initApplicationContext(this); BuildHooksAndroid.initCustomResources(this); + ApplicationStatus.initialize(this); Boolean isIsolatedProcess = PureJavaExceptionReporter.detectIsIsolatedProcess(); if (isIsolatedProcess != null && !isIsolatedProcess.booleanValue()) { PureJavaExceptionHandler.installHandler();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java index 1f40637..5e12b3dd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeFeatureList.java
@@ -147,6 +147,7 @@ } // Alphabetical: + public static final String ADJUST_WEBAPK_INSTALLATION_SPACE = "AdjustWebApkInstallationSpace"; public static final String ALLOW_READER_FOR_ACCESSIBILITY = "AllowReaderForAccessibility"; public static final String ANDROID_PAY_INTEGRATION_V1 = "AndroidPayIntegrationV1"; public static final String ANDROID_PAY_INTEGRATION_V2 = "AndroidPayIntegrationV2";
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java index 6fe41be..6c37fbbf 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java
@@ -48,7 +48,7 @@ if (tab != null) { SimpleConfirmInfoBarBuilder.create( - tab, InfoBarIdentifier.CHROME_WINDOW_ERROR, error, false); + tab, InfoBarIdentifier.WINDOW_ERROR_INFOBAR_DELEGATE_ANDROID, error, false); } else { super.showCallbackNonExistentError(error); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/DefaultBrowserInfo.java b/chrome/android/java/src/org/chromium/chrome/browser/DefaultBrowserInfo.java index f723a7b..acc71f7e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/DefaultBrowserInfo.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/DefaultBrowserInfo.java
@@ -99,8 +99,9 @@ ResolveInfo info = getResolveInfoForViewIntent(pm); // Caches whether Chrome is set as a default browser on the device. - boolean isDefault = (info != null && info.match != 0 - && context.getPackageName().equals(info.activityInfo.packageName)); + boolean isDefault = info != null && info.match != 0 + && TextUtils.equals( + context.getPackageName(), info.activityInfo.packageName); ChromePreferenceManager.getInstance().setCachedChromeDefaultBrowser( isDefault);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/JavascriptTabModalDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/JavascriptTabModalDialog.java deleted file mode 100644 index 234f9e0..0000000 --- a/chrome/android/java/src/org/chromium/chrome/browser/JavascriptTabModalDialog.java +++ /dev/null
@@ -1,186 +0,0 @@ -// Copyright 2017 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; - -import android.content.Context; -import android.content.DialogInterface; -import android.support.v7.app.AlertDialog; -import android.text.TextUtils; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.EditText; -import android.widget.TextView; - -import org.chromium.base.Log; -import org.chromium.base.VisibleForTesting; -import org.chromium.base.annotations.CalledByNative; -import org.chromium.chrome.R; -import org.chromium.ui.base.WindowAndroid; - -/** - * A dialog shown via JavaScript. This can be an alert dialog, a prompt dialog or a confirm dialog. - */ -public class JavascriptTabModalDialog implements DialogInterface.OnClickListener { - private static final String TAG = "JavaScriptDialog"; - - private final String mTitle; - private final String mMessage; - private final int mPositiveButtonTextId; - private final int mNegativeButtonTextId; - private long mNativeDialogPointer; - private AlertDialog mDialog; - private TextView mPromptTextView; - - private JavascriptTabModalDialog( - String title, String message, int positiveButtonTextId, int negativeButtonTextId) { - mTitle = title; - mMessage = message; - mPositiveButtonTextId = positiveButtonTextId; - mNegativeButtonTextId = negativeButtonTextId; - } - - @CalledByNative - private static JavascriptTabModalDialog createAlertDialog(String title, String message) { - return new JavascriptTabModalDialog(title, message, R.string.ok, 0); - } - - @CalledByNative - private static JavascriptTabModalDialog createConfirmDialog(String title, String message) { - return new JavascriptTabModalDialog(title, message, R.string.ok, R.string.cancel); - } - - @CalledByNative - private static JavascriptTabModalDialog createPromptDialog( - String title, String message, String defaultPromptText) { - return new JavascriptPromptDialog(title, message, defaultPromptText); - } - - @CalledByNative - private void showDialog(WindowAndroid window, long nativeDialogPointer) { - assert window != null; - Context context = window.getActivity().get(); - // If the activity has gone away, then just clean up the native pointer. - if (context == null) { - nativeCancel(nativeDialogPointer); - return; - } - - // Cache the native dialog pointer so that we can use it to return the response. - mNativeDialogPointer = nativeDialogPointer; - - LayoutInflater inflater = LayoutInflater.from(context); - ViewGroup layout = (ViewGroup) inflater.inflate(R.layout.js_modal_dialog, null); - prepare(layout); - - mPromptTextView = layout.findViewById(R.id.js_modal_dialog_prompt); - - AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.AlertDialogTheme) - .setView(layout) - .setTitle(mTitle) - .setOnCancelListener(dialog -> cancel()); - if (mPositiveButtonTextId != 0) builder.setPositiveButton(mPositiveButtonTextId, this); - if (mNegativeButtonTextId != 0) builder.setNegativeButton(mNegativeButtonTextId, this); - - mDialog = builder.create(); - mDialog.setCanceledOnTouchOutside(false); - mDialog.getDelegate().setHandleNativeActionModesEnabled(false); - mDialog.show(); - } - - @CalledByNative - private String getUserInput() { - return mPromptTextView.getText().toString(); - } - - @Override - public void onClick(DialogInterface dialog, int which) { - switch (which) { - case DialogInterface.BUTTON_POSITIVE: - accept(mPromptTextView.getText().toString()); - mDialog.dismiss(); - break; - case DialogInterface.BUTTON_NEGATIVE: - cancel(); - mDialog.dismiss(); - break; - default: - Log.e(TAG, "Unexpected button pressed in dialog: " + which); - } - } - - protected void prepare(final ViewGroup layout) { - // TabModal dialog do not have the option of suppressing dialogs. - layout.findViewById(R.id.suppress_js_modal_dialogs).setVisibility(View.GONE); - - // If the message is null or empty do not display the message text view. - // Hide parent scroll view instead of text view in order to prevent ui discrepancies. - if (TextUtils.isEmpty(mMessage)) { - layout.findViewById(R.id.js_modal_dialog_scroll_view).setVisibility(View.GONE); - } else { - ((TextView) layout.findViewById(R.id.js_modal_dialog_message)).setText(mMessage); - - layout.findViewById(R.id.js_modal_dialog_scroll_view) - .addOnLayoutChangeListener( - (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { - boolean isScrollable = v.getMeasuredHeight() - v.getPaddingTop() - - v.getPaddingBottom() - < ((ViewGroup) v).getChildAt(0).getMeasuredHeight(); - - v.setFocusable(isScrollable); - }); - } - } - - private void accept(String promptResult) { - if (mNativeDialogPointer != 0) { - nativeAccept(mNativeDialogPointer, promptResult); - } - } - - private void cancel() { - if (mNativeDialogPointer != 0) { - nativeCancel(mNativeDialogPointer); - } - } - - @CalledByNative - private void dismiss() { - mDialog.dismiss(); - mNativeDialogPointer = 0; - } - - /** - * Returns the AlertDialog associated with this JavascriptAppPromptDialog. - */ - @VisibleForTesting - public AlertDialog getDialogForTest() { - return mDialog; - } - - private static class JavascriptPromptDialog extends JavascriptTabModalDialog { - private final String mDefaultPromptText; - - JavascriptPromptDialog(String title, String message, String defaultPromptText) { - super(title, message, R.string.ok, R.string.cancel); - mDefaultPromptText = defaultPromptText; - } - - @Override - protected void prepare(ViewGroup layout) { - super.prepare(layout); - EditText prompt = layout.findViewById(R.id.js_modal_dialog_prompt); - prompt.setVisibility(View.VISIBLE); - - if (mDefaultPromptText.length() > 0) { - prompt.setText(mDefaultPromptText); - prompt.selectAll(); - } - } - } - - private native void nativeAccept(long nativeJavaScriptDialogAndroid, String prompt); - private native void nativeCancel(long nativeJavaScriptDialogAndroid); -}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java index 5922508..80da91e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browseractions/BrowserActionsContextMenuHelper.java
@@ -19,7 +19,6 @@ import android.support.annotation.IntDef; import android.support.customtabs.browseractions.BrowserActionItem; import android.support.customtabs.browseractions.BrowserActionsIntent; -import android.support.customtabs.browseractions.BrowserActionsIntent.BrowserActionsItemId; import android.support.v4.content.res.ResourcesCompat; import android.support.v7.content.res.AppCompatResources; import android.util.Pair; @@ -285,7 +284,7 @@ "BrowserActions.SelectedOption", itemId, NUM_ACTIONS); } - private void notifyBrowserActionSelected(@BrowserActionsItemId int menuId) { + private void notifyBrowserActionSelected(int menuId) { if (mOnBrowserActionSelectedCallback == null) return; Intent additionalData = new Intent(); additionalData.setData(Uri.parse(String.valueOf(menuId)));
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java index ba8c2a3..01f7bb77 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/CompositorViewHolder.java
@@ -47,6 +47,7 @@ import org.chromium.chrome.browser.tab.TabObserver; import org.chromium.chrome.browser.tabmodel.EmptyTabModelSelectorObserver; import org.chromium.chrome.browser.tabmodel.TabCreatorManager; +import org.chromium.chrome.browser.tabmodel.TabModel; import org.chromium.chrome.browser.tabmodel.TabModelSelector; import org.chromium.chrome.browser.tabmodel.TabModelSelectorObserver; import org.chromium.chrome.browser.util.ColorUtils; @@ -455,7 +456,15 @@ @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); - setSize(getActiveWebContents(), getActiveView(), w, h); + if (mTabModelSelector == null) return; + + for (TabModel tabModel : mTabModelSelector.getModels()) { + for (int i = 0; i < tabModel.getCount(); ++i) { + Tab tab = tabModel.getTabAt(i); + if (tab == null) continue; + setSize(tab.getWebContents(), tab.getContentView(), w, h); + } + } } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelMetrics.java index 2ebfc0e..9858416 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelMetrics.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelMetrics.java
@@ -120,21 +120,11 @@ if (mWasContextualCardsDataShown) { ContextualSearchUma.logContextualCardsResultsSeen(mWasSearchContentViewSeen); } - if (mRankerLogger != null) { - mRankerLogger.logOutcome( - ContextualSearchRankerLogger.Feature.OUTCOME_WAS_CARDS_DATA_SHOWN, - mWasContextualCardsDataShown); - } if (mWasQuickActionShown) { ContextualSearchUma.logQuickActionResultsSeen(mWasSearchContentViewSeen, mQuickActionCategory); ContextualSearchUma.logQuickActionClicked(mWasQuickActionClicked, mQuickActionCategory); - if (mRankerLogger != null) { - mRankerLogger.logOutcome( - ContextualSearchRankerLogger.Feature.OUTCOME_WAS_QUICK_ACTION_CLICKED, - mWasQuickActionClicked); - } } if (mResultsSeenExperiments != null) { @@ -142,10 +132,7 @@ mWasSearchContentViewSeen, mWasActivatedByTap); mResultsSeenExperiments.logPanelViewedDurations( panelViewDurationMs, mPanelOpenedBeyondPeekDurationMs); - if (mRankerLogger != null) { - mResultsSeenExperiments.logRankerTapSuppressionOutcome(mRankerLogger); - } - mResultsSeenExperiments = null; + if (!isChained) mResultsSeenExperiments = null; } mPanelOpenedBeyondPeekDurationMs = 0; @@ -153,24 +140,10 @@ boolean wasAnySuppressionHeuristicSatisfied = mWasAnyHeuristicSatisfiedOnPanelShow; ContextualSearchUma.logAnyTapSuppressionHeuristicSatisfied( mWasSearchContentViewSeen, wasAnySuppressionHeuristicSatisfied); - // Update The Ranker logger. - if (mRankerLogger != null) { - // Tell Ranker about the primary outcome. - mRankerLogger.logOutcome( - ContextualSearchRankerLogger.Feature.OUTCOME_WAS_PANEL_OPENED, - mWasSearchContentViewSeen); - ContextualSearchUma.logRankerInference(mWasSearchContentViewSeen, - mRankerLogger.getPredictionForTapSuppression()); - } ContextualSearchUma.logSelectionLengthResultsSeen( mWasSearchContentViewSeen, mSelectionLength); } - // Reset writing to Ranker so whatever interactions occurred are recorded as a - // complete record. - if (mRankerLogger != null) mRankerLogger.writeLogAndReset(); - mRankerLogger = null; - // Notifications to Feature Engagement. ContextualSearchIPH.doSearchFinishedNotifications(profile, mWasSearchContentViewSeen, mWasActivatedByTap, mWasContextualCardsDataShown); @@ -351,6 +324,34 @@ } /** + * Writes all the outcome features to the Ranker Logger and resets the logger. + * @param rankerLogger The {@link ContextualSearchRankerLogger} currently being used to measure + * or suppress the UI by Ranker. + */ + public void writeRankerLoggerOutcomesAndReset() { + if (mRankerLogger != null && mWasActivatedByTap) { + // Tell Ranker about the primary outcome. + mRankerLogger.logOutcome(ContextualSearchRankerLogger.Feature.OUTCOME_WAS_PANEL_OPENED, + mWasSearchContentViewSeen); + ContextualSearchUma.logRankerInference( + mWasSearchContentViewSeen, mRankerLogger.getPredictionForTapSuppression()); + mRankerLogger.logOutcome( + ContextualSearchRankerLogger.Feature.OUTCOME_WAS_CARDS_DATA_SHOWN, + mWasContextualCardsDataShown); + if (mWasQuickActionShown) { + mRankerLogger.logOutcome( + ContextualSearchRankerLogger.Feature.OUTCOME_WAS_QUICK_ACTION_CLICKED, + mWasQuickActionClicked); + } + if (mResultsSeenExperiments != null) { + mResultsSeenExperiments.logRankerTapSuppressionOutcome(mRankerLogger); + } + mRankerLogger.writeLogAndReset(); + mRankerLogger = null; + } + } + + /** * Determine whether a new contextual search is starting. * @param toState The contextual search state that will be transitioned to. * @param reason The reason for the search state transition.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHeuristics.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHeuristics.java index 057685b..ab4281d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHeuristics.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchHeuristics.java
@@ -12,6 +12,7 @@ */ public class ContextualSearchHeuristics { protected Set<ContextualSearchHeuristic> mHeuristics; + private QuickAnswersHeuristic mQuickAnswersHeuristic; /** * Manages a set of heuristics. @@ -96,4 +97,20 @@ heuristic.logRankerTapSuppressionOutcome(logger); } } + + /** + * Sets the {@link QuickAnswersHeuristic} so that it can be accessed externally by + * {@link #getQuickAnswersHeuristic}. + * @param quickAnswersHeuristic The active {@link QuickAnswersHeuristic}. + */ + public void setQuickAnswersHeuristic(QuickAnswersHeuristic quickAnswersHeuristic) { + mQuickAnswersHeuristic = quickAnswersHeuristic; + } + + /** + * @return The active {@link QuickAnswersHeuristic}. + */ + public QuickAnswersHeuristic getQuickAnswersHeuristic() { + return mQuickAnswersHeuristic; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java index f864760..6941ef2d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateController.java
@@ -77,6 +77,11 @@ * within the waiting period we'll advance. */ WAITING_FOR_POSSIBLE_TAP_ON_TAP_SELECTION, + /** The first state in the Tap-gesture processing pipeline where we know we're processing + * a Tap-gesture that won't be converted into a long-press (from tap on tap-selection). It + * may later be suppressed or ignored due to being on an invalid character. + */ + TAP_GESTURE_COMMIT, /** Gathers text surrounding the selection. */ GATHERING_SURROUNDINGS, /** Decides if the gesture should trigger the UX or be suppressed. */ @@ -221,14 +226,13 @@ * or known. Only needed when we enter the IDLE state. */ private void startWorkingOn(InternalState state, @Nullable StateChangeReason reason) { + // All transitional states should be listed here, but not start states. switch (state) { case IDLE: assert reason != null; mStateHandler.hideContextualSearchUi(reason); break; - case LONG_PRESS_RECOGNIZED: - break; case SHOWING_LONGPRESS_SEARCH: mStateHandler.showContextualSearchLongpressUi(); break; @@ -236,11 +240,12 @@ case WAITING_FOR_POSSIBLE_TAP_NEAR_PREVIOUS: mStateHandler.waitForPossibleTapNearPrevious(); break; - case TAP_RECOGNIZED: - break; case WAITING_FOR_POSSIBLE_TAP_ON_TAP_SELECTION: mStateHandler.waitForPossibleTapOnTapSelection(); break; + case TAP_GESTURE_COMMIT: + mStateHandler.tapGestureCommit(); + break; case GATHERING_SURROUNDINGS: mStateHandler.gatherSurroundingText(); break; @@ -304,10 +309,13 @@ if (mPreviousState != null && mPreviousState != InternalState.IDLE) { transitionTo(InternalState.WAITING_FOR_POSSIBLE_TAP_ON_TAP_SELECTION); } else { - transitionTo(InternalState.GATHERING_SURROUNDINGS); + transitionTo(InternalState.TAP_GESTURE_COMMIT); } break; case WAITING_FOR_POSSIBLE_TAP_ON_TAP_SELECTION: + transitionTo(InternalState.TAP_GESTURE_COMMIT); + break; + case TAP_GESTURE_COMMIT: transitionTo(InternalState.GATHERING_SURROUNDINGS); break; case GATHERING_SURROUNDINGS:
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java index 9e1f23b..3b721c3 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateHandler.java
@@ -30,6 +30,13 @@ void showContextualSearchLongpressUi(); /** + * The first state in the Tap-gesture processing pipeline where we know we're processing + * a Tap-gesture that won't be converted into something else. Starts the processing pipeline. + * @see ContextualSearchInternalStateController.InternalState#TAP_GESTURE_COMMIT + */ + void tapGestureCommit(); + + /** * Gathers text surrounding the current selection, which may have been created by either a Tap * or a Long-press gesture. * @see ContextualSearchInternalStateController.InternalState#GATHERING_SURROUNDINGS
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java index ee56d68a..6d17184 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java
@@ -179,7 +179,6 @@ private boolean mIsAccessibilityModeEnabled; /** Tap Experiments and other variable behavior. */ - private ContextualSearchHeuristics mHeuristics; private QuickAnswersHeuristic mQuickAnswersHeuristic; // Counter for how many times we've called SelectWordAroundCaret without an ACK returned. @@ -1398,16 +1397,9 @@ @Override public void handleMetricsForWouldSuppressTap(ContextualSearchHeuristics tapHeuristics) { - mHeuristics = tapHeuristics; - - // TODO(donnd): QuickAnswersHeuristic is getting added to TapSuppressionHeuristics and - // and getting considered in TapSuppressionHeuristics#shouldSuppressTap(). It should - // be a part of ContextualSearchHeuristics for logging purposes but not for suppression. - mQuickAnswersHeuristic = new QuickAnswersHeuristic(); - mHeuristics.add(mQuickAnswersHeuristic); - + mQuickAnswersHeuristic = tapHeuristics.getQuickAnswersHeuristic(); if (mSearchPanel != null) { - mSearchPanel.getPanelMetrics().setResultsSeenExperiments(mHeuristics); + mSearchPanel.getPanelMetrics().setResultsSeenExperiments(tapHeuristics); mSearchPanel.getPanelMetrics().setRankerLogger(mTapSuppressionRankerLogger); } } @@ -1502,15 +1494,15 @@ // Called when the IDLE state has been entered. if (mContext != null) mContext.destroy(); mContext = null; - // Make sure we write to ranker and reset at the end of every search, even if it - // was a suppressed tap or longpress. - // TODO(donnd): Find a better place to just make a single call to this (now two). - mTapSuppressionRankerLogger.writeLogAndReset(); if (mSearchPanel == null) return; + // Make sure we write to Ranker and reset at the end of every search, even if the + // panel was not showing because it was a suppressed tap. if (isSearchPanelShowing()) { + mSearchPanel.getPanelMetrics().writeRankerLoggerOutcomesAndReset(); mSearchPanel.closePanel(reason, false); } else { + mTapSuppressionRankerLogger.writeLogAndReset(); if (mSelectionController.getSelectionType() == SelectionType.TAP) { mSelectionController.clearSelection(); } @@ -1556,16 +1548,25 @@ } } + /** First step where we're committed to processing the current Tap gesture. */ + @Override + public void tapGestureCommit() { + mInternalStateController.notifyStartingWorkOn(InternalState.TAP_GESTURE_COMMIT); + // We may be processing a chained search (aka a retap -- a tap near a previous tap). + // If it's chained we need to log the outcomes and reset, because we won't be hiding + // the panel at the end of the previous search (we'll update it to the new Search). + if (isSearchPanelShowing()) { + mSearchPanel.getPanelMetrics().writeRankerLoggerOutcomesAndReset(); + } + // Set up the next batch of Ranker logging. + mTapSuppressionRankerLogger.setupLoggingForPage(getBaseWebContents()); + mInternalStateController.notifyFinishedWorkOn(InternalState.TAP_GESTURE_COMMIT); + } + /** Starts the process of deciding if we'll suppress the current Tap gesture or not. */ @Override public void decideSuppression() { mInternalStateController.notifyStartingWorkOn(InternalState.DECIDING_SUPPRESSION); - - // Ranker will handle the suppression, but our legacy implementation uses - // TapSuppressionHeuristics (run from the ContextualSearchSelectionController). - // Usage includes tap-far-from-previous suppression. - mTapSuppressionRankerLogger.setupLoggingForPage(getBaseWebContents()); - // TODO(donnd): Move handleShouldSuppressTap out of the Selection Controller. mSelectionController.handleShouldSuppressTap(mContext, mTapSuppressionRankerLogger); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchRankerLoggerImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchRankerLoggerImpl.java index b8a4ae94..7bd5be5 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchRankerLoggerImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchRankerLoggerImpl.java
@@ -81,6 +81,7 @@ // A for-testing copy of all the features to log setup so that it will survive a {@link #reset}. private Map<Feature, Object> mFeaturesLoggedForTesting; + private Map<Feature, Object> mOutcomesLoggedForTesting; /** * Constructs a Ranker Logger and associated native implementation to write Contextual Search @@ -180,7 +181,7 @@ for (Map.Entry<Feature, Object> entry : mFeaturesToLog.entrySet()) { logObject(entry.getKey(), entry.getValue()); } - mFeaturesLoggedForTesting = mFeaturesToLog; + mOutcomesLoggedForTesting = mFeaturesToLog; } nativeWriteLogAndReset(mNativePointer); } @@ -243,9 +244,9 @@ } /** - * Gets the current set of features to log or that have been logged. Should only be used for - * testing purposes! - * @return The current set of features to log or that have been logged, or {@code null}. + * Gets the current set of features that have been logged. Should only be used for testing + * purposes! + * @return The current set of features that have been logged, or {@code null}. */ @VisibleForTesting @Nullable @@ -253,6 +254,17 @@ return mFeaturesLoggedForTesting; } + /** + * Gets the current set of outcomes that have been logged. Should only be used for + * testing purposes! + * @return The current set of outcomes that have been logged, or {@code null}. + */ + @VisibleForTesting + @Nullable + Map<Feature, Object> getOutcomesLogged() { + return mOutcomesLoggedForTesting; + } + // ============================================================================================ // Native methods. // ============================================================================================
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java index abdb4970..76f2b8b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchSelectionController.java
@@ -61,7 +61,6 @@ private boolean mWasTapGestureDetected; // Reflects whether the last tap was valid and whether we still have a tap-based selection. private ContextualSearchTapState mLastTapState; - private boolean mIsWaitingForInvalidTapDetection; private boolean mShouldHandleSelectionModification; // Whether the selection was automatically expanded due to an adjustment (e.g. Resolve). private boolean mDidExpandSelection; @@ -499,14 +498,6 @@ // ============================================================================================ /** - * @return whether a tap gesture has been detected, for testing. - */ - @VisibleForTesting - boolean wasAnyTapGestureDetected() { - return mIsWaitingForInvalidTapDetection; - } - - /** * @return whether selection is empty, for testing. */ @VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java index 5bb768f..b9ee3c6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextualsearch/TapSuppressionHeuristics.java
@@ -40,6 +40,10 @@ mHeuristics.add(new BarOverlapTapSuppression(selectionController, y)); // Second Tap ML Override. mHeuristics.add(new SecondTapMlOverride(selectionController, previousTapState, x, y)); + // Quick Answer that appears in the Caption via the JS API. + QuickAnswersHeuristic quickAnswersHeuristic = new QuickAnswersHeuristic(); + setQuickAnswersHeuristic(quickAnswersHeuristic); + mHeuristics.add(quickAnswersHeuristic); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/AccountFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/AccountFirstRunFragment.java index 7b602d5a..2e634492 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/AccountFirstRunFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/AccountFirstRunFragment.java
@@ -20,7 +20,16 @@ /** * A {@link Fragment} meant to handle sync setup for the first run experience. */ -public class AccountFirstRunFragment extends FirstRunPage implements AccountSigninView.Delegate { +public class AccountFirstRunFragment + extends Fragment implements FirstRunFragment, AccountSigninView.Delegate { + /** FRE page that instantiates this fragment. */ + public static class Page implements FirstRunPage<AccountFirstRunFragment> { + @Override + public AccountFirstRunFragment instantiateFragment() { + return new AccountFirstRunFragment(); + } + } + // Per-page parameters: public static final String FORCE_SIGNIN_ACCOUNT_TO = "ForceSigninAccountTo"; public static final String PRESELECT_BUT_ALLOW_TO_CHANGE = "PreselectButAllowToChange"; @@ -49,7 +58,7 @@ public void onAccountSelectionCanceled() { SignInPromo.temporarilySuppressPromos(); getPageDelegate().refuseSignIn(); - advanceToNextPage(); + getPageDelegate().advanceToNextPage(); } @Override @@ -64,7 +73,7 @@ if (settingsClicked) { getPageDelegate().askToOpenSignInSettings(); } - advanceToNextPage(); + getPageDelegate().advanceToNextPage(); } @Override @@ -76,10 +85,11 @@ }; if (forceAccountTo == null) { - mView.initFromSelectionPage(isChildAccount, this, listener); + mView.initFromSelectionPage( + SigninAccessPoint.START_PAGE, isChildAccount, this, listener); } else { - mView.initFromConfirmationPage(isChildAccount, forceAccountTo, false, - AccountSigninView.UNDO_INVISIBLE, this, listener); + mView.initFromConfirmationPage(SigninAccessPoint.START_PAGE, isChildAccount, + forceAccountTo, false, AccountSigninView.UNDO_INVISIBLE, this, listener); } RecordUserAction.record("MobileFre.SignInShown"); @@ -87,8 +97,7 @@ SigninManager.logSigninStartAccessPoint(SigninAccessPoint.START_PAGE); } - // FirstRunPage: - + // FirstRunFragment: @Override public boolean interceptBackPressed() { Bundle freProperties = getPageDelegate().getProperties();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyFirstRunFragment.java index fa1f5c6..140612a6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyFirstRunFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DataReductionProxyFirstRunFragment.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.firstrun; +import android.app.Fragment; import android.os.Bundle; import android.support.v7.widget.SwitchCompat; import android.view.LayoutInflater; @@ -19,7 +20,14 @@ /** * The First Run Experience fragment that allows the user to opt in to Data Saver. */ -public class DataReductionProxyFirstRunFragment extends FirstRunPage { +public class DataReductionProxyFirstRunFragment extends Fragment implements FirstRunFragment { + /** FRE page that instantiates this fragment. */ + public static class Page implements FirstRunPage<DataReductionProxyFirstRunFragment> { + @Override + public DataReductionProxyFirstRunFragment instantiateFragment() { + return new DataReductionProxyFirstRunFragment(); + } + } @Override public View onCreateView( @@ -51,7 +59,7 @@ nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - advanceToNextPage(); + getPageDelegate().advanceToNextPage(); } });
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DefaultSearchEngineFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DefaultSearchEngineFirstRunFragment.java index 0a3030a8..423f42b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DefaultSearchEngineFirstRunFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/DefaultSearchEngineFirstRunFragment.java
@@ -21,7 +21,15 @@ import org.chromium.chrome.browser.widget.RadioButtonLayout; /** A {@link Fragment} that presents a set of search engines for the user to choose from. */ -public class DefaultSearchEngineFirstRunFragment extends FirstRunPage { +public class DefaultSearchEngineFirstRunFragment extends Fragment implements FirstRunFragment { + /** FRE page that instantiates this fragment. */ + public static class Page implements FirstRunPage<DefaultSearchEngineFirstRunFragment> { + @Override + public DefaultSearchEngineFirstRunFragment instantiateFragment() { + return new DefaultSearchEngineFirstRunFragment(); + } + } + @SearchEnginePromoType private int mSearchEnginePromoDialoType; private boolean mShownRecorded; @@ -48,7 +56,7 @@ Runnable dismissRunnable = new Runnable() { @Override public void run() { - advanceToNextPage(); + getPageDelegate().advanceToNextPage(); } }; new DefaultSearchEngineDialogHelper( @@ -67,7 +75,7 @@ ThreadUtils.postOnUiThread(new Runnable() { @Override public void run() { - advanceToNextPage(); + getPageDelegate().advanceToNextPage(); } }); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java index bc3ff23..d87c43dc 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
@@ -27,12 +27,10 @@ import org.chromium.chrome.browser.searchwidget.SearchWidgetProvider; import org.chromium.ui.base.LocalizationUtils; -import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; -import java.util.concurrent.Callable; /** * Handles the First Run Experience sequences shown to the user launching Chrome for the first time. @@ -95,7 +93,7 @@ private boolean mFlowIsKnown; private boolean mPostNativePageSequenceCreated; private boolean mNativeSideIsInitialized; - private Set<FirstRunPage> mPagesToNotifyOfNativeInit; + private Set<FirstRunFragment> mPagesToNotifyOfNativeInit; private boolean mDeferredCompleteFRE; private FirstRunViewPager mPager; @@ -110,9 +108,8 @@ */ private boolean mLaunchedFromChromeIcon; - private List<Callable<FirstRunPage>> mPages; - - private List<Integer> mFreProgressStates; + private final List<FirstRunPage> mPages = new ArrayList<>(); + private final List<Integer> mFreProgressStates = new ArrayList<>(); /** * The pager adapter, which provides the pages to the view pager widget. @@ -123,12 +120,9 @@ * Defines a sequence of pages to be shown (depending on parameters etc). */ private void createPageSequence() { - mPages = new ArrayList<Callable<FirstRunPage>>(); - mFreProgressStates = new ArrayList<Integer>(); - // An optional welcome page. if (mShowWelcomePage) { - mPages.add(pageOf(ToSAndUMAFirstRunFragment.class)); + mPages.add(new ToSAndUMAFirstRunFragment.Page()); mFreProgressStates.add(FRE_PROGRESS_WELCOME_SHOWN); } @@ -146,21 +140,21 @@ boolean notifyAdapter = false; // An optional Data Saver page. if (mFreProperties.getBoolean(SHOW_DATA_REDUCTION_PAGE)) { - mPages.add(pageOf(DataReductionProxyFirstRunFragment.class)); + mPages.add(new DataReductionProxyFirstRunFragment.Page()); mFreProgressStates.add(FRE_PROGRESS_DATA_SAVER_SHOWN); notifyAdapter = true; } // An optional page to select a default search engine. if (mFreProperties.getBoolean(SHOW_SEARCH_ENGINE_PAGE)) { - mPages.add(pageOf(DefaultSearchEngineFirstRunFragment.class)); + mPages.add(new DefaultSearchEngineFirstRunFragment.Page()); mFreProgressStates.add(FRE_PROGRESS_DEFAULT_SEARCH_ENGINE_SHOWN); notifyAdapter = true; } // An optional sign-in page. if (mFreProperties.getBoolean(SHOW_SIGNIN_PAGE)) { - mPages.add(pageOf(AccountFirstRunFragment.class)); + mPages.add(new AccountFirstRunFragment.Page()); mFreProgressStates.add(FRE_PROGRESS_SIGNIN_SHOWN); notifyAdapter = true; } @@ -270,7 +264,7 @@ // sequence - in that case this will be done when onFlowIsKnown() gets called. createPostNativePageSequence(); if (mPagesToNotifyOfNativeInit != null) { - for (FirstRunPage page : mPagesToNotifyOfNativeInit) { + for (FirstRunFragment page : mPagesToNotifyOfNativeInit) { page.onNativeInitialized(); } } @@ -283,16 +277,16 @@ @Override public void onAttachFragment(Fragment fragment) { - if (!(fragment instanceof FirstRunPage)) return; + if (!(fragment instanceof FirstRunFragment)) return; - FirstRunPage page = (FirstRunPage) fragment; + FirstRunFragment page = (FirstRunFragment) fragment; if (mNativeSideIsInitialized) { page.onNativeInitialized(); return; } if (mPagesToNotifyOfNativeInit == null) { - mPagesToNotifyOfNativeInit = new HashSet<FirstRunPage>(); + mPagesToNotifyOfNativeInit = new HashSet<>(); } mPagesToNotifyOfNativeInit.add(page); } @@ -323,8 +317,8 @@ } Object currentItem = mPagerAdapter.instantiateItem(mPager, mPager.getCurrentItem()); - if (currentItem instanceof FirstRunPage) { - FirstRunPage page = (FirstRunPage) currentItem; + if (currentItem instanceof FirstRunFragment) { + FirstRunFragment page = (FirstRunFragment) currentItem; if (page.interceptBackPressed()) return; } @@ -481,12 +475,10 @@ private void skipPagesIfNecessary() { if (mPagerAdapter == null) return; - int currentPageIndex = mPager.getCurrentItem(); - while (currentPageIndex < mPagerAdapter.getCount()) { - FirstRunPage currentPage = (FirstRunPage) mPagerAdapter.getItem(currentPageIndex); - if (!currentPage.shouldSkipPageOnCreate()) return; - if (!jumpToPage(currentPageIndex + 1)) return; - currentPageIndex = mPager.getCurrentItem(); + boolean shouldSkip = mPages.get(mPager.getCurrentItem()).shouldSkipPageOnCreate(); + while (shouldSkip) { + if (!jumpToPage(mPager.getCurrentItem() + 1)) return; + shouldSkip = mPages.get(mPager.getCurrentItem()).shouldSkipPageOnCreate(); } } @@ -498,21 +490,6 @@ } } - /** - * Creates a trivial page constructor for a given page type. - * @param clazz The .class of the page type. - * @return The simple constructor for a given page type (no parameters, no tuning). - */ - public static Callable<FirstRunPage> pageOf(final Class<? extends FirstRunPage> clazz) { - return new Callable<FirstRunPage>() { - @Override - public FirstRunPage call() throws Exception { - Constructor<? extends FirstRunPage> constructor = clazz.getDeclaredConstructor(); - return constructor.newInstance(); - } - }; - } - @Override public void showInfoPage(@StringRes int url) { CustomTabActivity.showInfoPage(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFragment.java new file mode 100644 index 0000000..54ed8501 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFragment.java
@@ -0,0 +1,37 @@ +// Copyright 2018 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.firstrun; + +import android.app.Activity; +import android.app.Fragment; + +/** + * This interface is implemented by FRE fragments. + */ +public interface FirstRunFragment { + /** + * Notifies this fragment that native has been initialized. + */ + default void onNativeInitialized() {} + + /** + * @return Whether the back button press was handled by this page. + */ + default boolean interceptBackPressed() { + return false; + } + + /** + * @see Fragment#getActivity(). + */ + Activity getActivity(); + + /** + * Convenience method to get {@link FirstRunPageDelegate}. + */ + default FirstRunPageDelegate getPageDelegate() { + return (FirstRunPageDelegate) getActivity(); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunPage.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunPage.java index ce17106..b749e725 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunPage.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunPage.java
@@ -7,39 +7,20 @@ import android.app.Fragment; /** - * A first run page shown in the First Run ViewPager. + * Represents first run page shown during the First Run. Actual page implementation is created + * lazily by {@link #instantiateFragment()}. + * @param <T> the type of the fragment that displays this FRE page. */ -public class FirstRunPage extends Fragment { +public interface FirstRunPage<T extends Fragment & FirstRunFragment> { /** * @return Whether this page should be skipped on the FRE creation. */ - public boolean shouldSkipPageOnCreate() { + default boolean shouldSkipPageOnCreate() { return false; } /** - * @return Whether the back button press was handled by this page. + * Creates fragment that implements this FRE page. */ - public boolean interceptBackPressed() { - return false; - } - - /** - * @return The interface to the host. - */ - protected FirstRunPageDelegate getPageDelegate() { - return (FirstRunPageDelegate) getActivity(); - } - - /** - * Advances to the next FRE page. - */ - protected void advanceToNextPage() { - getPageDelegate().advanceToNextPage(); - } - - /** - * Notifies this page that native has been initialized. - */ - protected void onNativeInitialized() {} + T instantiateFragment(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunPagerAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunPagerAdapter.java index 28f5cf5a..dd2eaca 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunPagerAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunPagerAdapter.java
@@ -9,18 +9,16 @@ import android.support.v13.app.FragmentStatePagerAdapter; import java.util.List; -import java.util.concurrent.Callable; /** * Adapter used to provide First Run pages to the FirstRunActivity ViewPager. */ class FirstRunPagerAdapter extends FragmentStatePagerAdapter { - private final List<Callable<FirstRunPage>> mPages; + private final List<FirstRunPage> mPages; private boolean mStopAtTheFirstPage; - public FirstRunPagerAdapter( - FragmentManager fragmentManager, List<Callable<FirstRunPage>> pages) { + public FirstRunPagerAdapter(FragmentManager fragmentManager, List<FirstRunPage> pages) { super(fragmentManager); assert pages != null; assert pages.size() > 0; @@ -41,13 +39,7 @@ @Override public Fragment getItem(int position) { assert position >= 0 && position < mPages.size(); - FirstRunPage result = null; - try { - result = mPages.get(position).call(); - } catch (Exception e) { - // We can always return null and it will be properly handled at the caller level. - } - return result; + return mPages.get(position).instantiateFragment(); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java index 68d06cd..358d1850 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/ToSAndUMAFirstRunFragment.java
@@ -4,6 +4,7 @@ package org.chromium.chrome.browser.firstrun; +import android.app.Fragment; import android.os.Bundle; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; @@ -26,7 +27,20 @@ * Privacy Notice, and to opt-in to the usage statistics and crash reports collection ("UMA", * User Metrics Analysis) as defined in the Chrome Privacy Notice. */ -public class ToSAndUMAFirstRunFragment extends FirstRunPage { +public class ToSAndUMAFirstRunFragment extends Fragment implements FirstRunFragment { + /** FRE page that instantiates this fragment. */ + public static class Page implements FirstRunPage<ToSAndUMAFirstRunFragment> { + @Override + public boolean shouldSkipPageOnCreate() { + return FirstRunStatus.shouldSkipWelcomePage(); + } + + @Override + public ToSAndUMAFirstRunFragment instantiateFragment() { + return new ToSAndUMAFirstRunFragment(); + } + } + private Button mAcceptButton; private CheckBox mSendReportCheckBox; private TextView mTosAndPrivacy; @@ -147,12 +161,7 @@ } @Override - public boolean shouldSkipPageOnCreate() { - return FirstRunStatus.shouldSkipWelcomePage(); - } - - @Override - protected void onNativeInitialized() { + public void onNativeInitialized() { assert !mNativeInitialized; mNativeInitialized = true; @@ -171,7 +180,7 @@ } private void setSpinnerVisible(boolean spinnerVisible) { - // When the progress spinner is visibile, we hide the other UI elements so that + // When the progress spinner is visible, we hide the other UI elements so that // the user can't interact with them. int otherElementsVisible = spinnerVisible ? View.INVISIBLE : View.VISIBLE; mTitle.setVisibility(otherElementsVisible);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/infobar/IPHInfoBarSupport.java b/chrome/android/java/src/org/chromium/chrome/browser/infobar/IPHInfoBarSupport.java index 94ee79c..c656c30 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/infobar/IPHInfoBarSupport.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/infobar/IPHInfoBarSupport.java
@@ -9,6 +9,7 @@ import android.view.View; import android.widget.PopupWindow.OnDismissListener; +import org.chromium.base.Log; import org.chromium.chrome.browser.infobar.InfoBarContainer.InfoBarContainerObserver; import org.chromium.chrome.browser.infobar.InfoBarContainerLayout.Item; import org.chromium.chrome.browser.widget.textbubble.TextBubble; @@ -22,6 +23,8 @@ */ class IPHInfoBarSupport implements OnDismissListener, InfoBarContainer.InfoBarAnimationListener, InfoBarContainerObserver { + private static final String TAG = "IPHInfoBar"; + /** Helper class to hold all relevant display parameters for an in-product help window. */ public static class TrackerParameters { public TrackerParameters( @@ -153,8 +156,12 @@ @Override public void onDismiss() { // Helper for crbug.com/786916 to catch why we are getting two dismiss calls in a row. - if (mCurrentState == null) throw new IllegalStateException(mLastDismissStack); + if (mCurrentState == null) { + Log.e(TAG, "Unexpected call to onDismiss. Last stack:", mLastDismissStack); + throw new IllegalStateException("Second call to onDismiss(), no current state found."); + } mLastDismissStack = new Exception(); + assert mCurrentState != null; mDelegate.onPopupDismissed(mCurrentState); mCurrentState = null;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java index 19b2fa73..ca41b58 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/AsyncInitializationActivity.java
@@ -110,14 +110,13 @@ // On N+, Chrome should always retain the tab strip layout on tablets. Normally in // multi-window, if Chrome is launched into a smaller screen Android will load the tab // switcher resources. Overriding the smallestScreenWidthDp in the Configuration ensures - // Android will load the tab strip resources. See crbug.com/588838. + // Android will load the tab strip resources. + // See crbug.com/588838, crbug.com/662338, crbug.com/780593. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - if (DeviceFormFactor.isTablet()) { - Configuration overrideConfiguration = new Configuration(); - overrideConfiguration.smallestScreenWidthDp = - DeviceFormFactor.getSmallestDeviceWidthDp(); - applyOverrideConfiguration(overrideConfiguration); - } + Configuration overrideConfiguration = new Configuration(); + overrideConfiguration.smallestScreenWidthDp = + DeviceFormFactor.getSmallestDeviceWidthDp(); + applyOverrideConfiguration(overrideConfiguration); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialog.java new file mode 100644 index 0000000..fb999040 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialog.java
@@ -0,0 +1,139 @@ +// Copyright 2017 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.jsdialog; + +import org.chromium.base.Log; +import org.chromium.base.annotations.CalledByNative; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.ChromeActivity; +import org.chromium.chrome.browser.modaldialog.ModalDialogManager; +import org.chromium.chrome.browser.modaldialog.ModalDialogView; +import org.chromium.ui.base.WindowAndroid; + +/** + * The controller to communicate with native JavaScriptDialogAndroid for a tab modal JavaScript + * dialog. This can be an alert dialog, a prompt dialog or a confirm dialog. + */ +public class JavascriptTabModalDialog implements ModalDialogView.Controller { + private static final String TAG = "JsTabModalDialog"; + + private final String mTitle; + private final String mMessage; + private final int mPositiveButtonTextId; + private final int mNegativeButtonTextId; + + private ModalDialogManager mModalDialogManager; + private String mDefaultPromptText; + private long mNativeDialogPointer; + private JavascriptModalDialogView mDialogView; + + /** + * Constructor for initializing contents to be shown on the dialog. + */ + private JavascriptTabModalDialog( + String title, String message, int positiveButtonTextId, int negativeButtonTextId) { + mTitle = title; + mMessage = message; + mPositiveButtonTextId = positiveButtonTextId; + mNegativeButtonTextId = negativeButtonTextId; + } + + /** + * Constructor for creating prompt dialog only. + */ + private JavascriptTabModalDialog(String title, String message, String defaultPromptText) { + this(title, message, R.string.ok, R.string.cancel); + mDefaultPromptText = defaultPromptText; + } + + @CalledByNative + private static JavascriptTabModalDialog createAlertDialog(String title, String message) { + return new JavascriptTabModalDialog(title, message, R.string.ok, 0); + } + + @CalledByNative + private static JavascriptTabModalDialog createConfirmDialog(String title, String message) { + return new JavascriptTabModalDialog(title, message, R.string.ok, R.string.cancel); + } + + @CalledByNative + private static JavascriptTabModalDialog createPromptDialog( + String title, String message, String defaultPromptText) { + return new JavascriptTabModalDialog(title, message, defaultPromptText); + } + + @CalledByNative + private void showDialog(WindowAndroid window, long nativeDialogPointer) { + assert window != null; + ChromeActivity activity = (ChromeActivity) window.getActivity().get(); + // If the activity has gone away, then just clean up the native pointer. + if (activity == null) { + nativeCancel(nativeDialogPointer); + return; + } + + // Cache the native dialog pointer so that we can use it to return the response. + mNativeDialogPointer = nativeDialogPointer; + + mModalDialogManager = activity.getModalDialogManager(); + mDialogView = JavascriptModalDialogView.create(this, mTitle, mMessage, mDefaultPromptText, + false, mPositiveButtonTextId, mNegativeButtonTextId); + mModalDialogManager.showDialog(mDialogView, ModalDialogManager.TAB_MODAL); + } + + @CalledByNative + private String getUserInput() { + return mDialogView.getPromptText(); + } + + @CalledByNative + private void dismiss() { + mModalDialogManager.dismissDialog(mDialogView); + mNativeDialogPointer = 0; + } + + @Override + public void onClick(@ModalDialogView.ButtonType int buttonType) { + switch (buttonType) { + case ModalDialogView.BUTTON_POSITIVE: + accept(mDialogView.getPromptText()); + mModalDialogManager.dismissDialog(mDialogView); + break; + case ModalDialogView.BUTTON_NEGATIVE: + cancel(); + mModalDialogManager.dismissDialog(mDialogView); + break; + default: + Log.e(TAG, "Unexpected button pressed in dialog: " + buttonType); + } + } + + @Override + public void onCancel() { + cancel(); + } + + /** + * Sends notification to native that the user accepts the dialog. + * @param promptResult The text edited by user. + */ + private void accept(String promptResult) { + if (mNativeDialogPointer != 0) { + nativeAccept(mNativeDialogPointer, promptResult); + } + } + + /** + * Sends notification to native that the user cancels the dialog. + */ + private void cancel() { + if (mNativeDialogPointer != 0) { + nativeCancel(mNativeDialogPointer); + } + } + + private native void nativeAccept(long nativeJavaScriptDialogAndroid, String prompt); + private native void nativeCancel(long nativeJavaScriptDialogAndroid); +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/BaseMediaRouteProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/BaseMediaRouteProvider.java index a7b78e8..c6392c6f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/BaseMediaRouteProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/BaseMediaRouteProvider.java
@@ -100,13 +100,6 @@ return; } - MediaRouteSelector routeSelector = source.buildRouteSelector(); - if (routeSelector == null) { - // If the application invalid, report no devices available. - onSinksReceived(sourceId, NO_SINKS); - return; - } - // No-op, if already monitoring the application for this source. String applicationId = source.getApplicationId(); DiscoveryCallback callback = mDiscoveryCallbacks.get(applicationId); @@ -115,6 +108,13 @@ return; } + MediaRouteSelector routeSelector = source.buildRouteSelector(); + if (routeSelector == null) { + // If the application invalid, report no devices available. + onSinksReceived(sourceId, NO_SINKS); + return; + } + List<MediaSink> knownSinks = new ArrayList<MediaSink>(); for (RouteInfo route : mAndroidMediaRouter.getRoutes()) { if (route.matchesSelector(routeSelector)) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java index 552ccfb3..92cc97df 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMediaRouteProvider.java
@@ -135,7 +135,8 @@ } CreateRouteRequest createRouteRequest = new CreateRouteRequest(source, sink, presentationId, - origin, tabId, isIncognito, nativeRequestId, this, mMessageHandler); + origin, tabId, isIncognito, nativeRequestId, this, + CreateRouteRequest.RequestedCastSessionType.CAST, mMessageHandler); ChromeCastSessionManager.get().requestSessionLaunch(createRouteRequest); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandler.java index ea436c2..c485f6c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandler.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandler.java
@@ -32,8 +32,6 @@ // Sequence number used when no sequence number is required or was initially passed. static final int INVALID_SEQUENCE_NUMBER = -1; - static final String MEDIA_NAMESPACE = "urn:x-cast:com.google.cast.media"; - static final String GAMES_NAMESPACE = "urn:x-cast:com.google.cast.games"; private static final String MEDIA_MESSAGE_TYPES[] = { "PLAY", @@ -232,7 +230,8 @@ messageType = sMediaOverloadedMessageTypes.get(messageType); jsonCastMessage.put("type", messageType); } - return sendJsonCastMessage(jsonCastMessage, MEDIA_NAMESPACE, clientId, sequenceNumber); + return sendJsonCastMessage( + jsonCastMessage, CastSessionUtil.MEDIA_NAMESPACE, clientId, sequenceNumber); } return true; @@ -343,7 +342,7 @@ } catch (JSONException e) { } - if (MEDIA_NAMESPACE.equals(namespace)) { + if (CastSessionUtil.MEDIA_NAMESPACE.equals(namespace)) { onMediaMessage(message, request); return; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSession.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSession.java index 860b5056..565b48e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSession.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSession.java
@@ -99,7 +99,7 @@ /** * Stops the application. The methods tells the Cast SDK to stop the application and on - * response, it will notify all the clients through the message ahndler. + * response, it will notify all the clients through the message handler. */ void stopApplication();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionImpl.java index e4eee91d..6d8673d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionImpl.java
@@ -25,7 +25,6 @@ import org.chromium.chrome.browser.media.ui.MediaNotificationManager; import org.chromium.chrome.browser.metrics.MediaNotificationUma; import org.chromium.chrome.browser.tab.Tab; -import org.chromium.content_public.common.MediaMetadata; import java.io.IOException; import java.util.ArrayList; @@ -96,7 +95,7 @@ mMessageChannel = new CastMessagingChannel(this); updateNamespaces(); - if (mNamespaces.contains(CastMessageHandler.MEDIA_NAMESPACE)) { + if (mNamespaces.contains(CastSessionUtil.MEDIA_NAMESPACE)) { mMediaPlayer = new RemoteMediaPlayer(); mMediaPlayer.setOnStatusUpdatedListener( new RemoteMediaPlayer.OnStatusUpdatedListener() { @@ -122,7 +121,8 @@ new RemoteMediaPlayer.OnMetadataUpdatedListener() { @Override public void onMetadataUpdated() { - setNotificationMetadata(mNotificationBuilder); + CastSessionUtil.setNotificationMetadata( + mNotificationBuilder, mCastDevice, mMediaPlayer); MediaNotificationManager.show(mNotificationBuilder.build()); } }); @@ -133,20 +133,23 @@ contentIntent.putExtra(MediaNotificationUma.INTENT_EXTRA_NAME, MediaNotificationUma.SOURCE_PRESENTATION); } - mNotificationBuilder = new MediaNotificationInfo.Builder() - .setPaused(false) - .setOrigin(origin) - // TODO(avayvod): the same session might have more than one tab id. Should we track - // the last foreground alive tab and update the notification with it? - .setTabId(tabId) - .setPrivate(isIncognito) - .setActions(MediaNotificationInfo.ACTION_STOP) - .setContentIntent(contentIntent) - .setNotificationSmallIcon(R.drawable.ic_notification_media_route) - .setDefaultNotificationLargeIcon(R.drawable.cast_playing_square) - .setId(R.id.presentation_notification) - .setListener(this); - setNotificationMetadata(mNotificationBuilder); + mNotificationBuilder = + new MediaNotificationInfo.Builder() + .setPaused(false) + .setOrigin(origin) + // TODO(avayvod): the same session might have more than one tab id. Should + // we track the last foreground alive tab and update the notification with + // it? + .setTabId(tabId) + .setPrivate(isIncognito) + .setActions(MediaNotificationInfo.ACTION_STOP) + .setContentIntent(contentIntent) + .setNotificationSmallIcon(R.drawable.ic_notification_media_route) + .setDefaultNotificationLargeIcon(R.drawable.cast_playing_square) + .setId(R.id.presentation_notification) + .setListener(this); + + CastSessionUtil.setNotificationMetadata(mNotificationBuilder, mCastDevice, mMediaPlayer); MediaNotificationManager.show(mNotificationBuilder.build()); } @@ -353,8 +356,7 @@ } // Media commands wait for the media status update as a result. - if (CastMessageHandler.MEDIA_NAMESPACE - .equals(namespace)) return; + if (CastSessionUtil.MEDIA_NAMESPACE.equals(namespace)) return; // App messages wait for the empty message with the sequence // number. @@ -445,8 +447,7 @@ @Override public void onMediaMessage(String message) { if (mMediaPlayer != null) { - mMediaPlayer.onMessageReceived( - mCastDevice, CastMessageHandler.MEDIA_NAMESPACE, message); + mMediaPlayer.onMessageReceived(mCastDevice, CastSessionUtil.MEDIA_NAMESPACE, message); } } @@ -480,32 +481,4 @@ if (mMediaPlayer != null && !isApiClientInvalid()) mMediaPlayer.requestStatus(mApiClient); } - - private void setNotificationMetadata(MediaNotificationInfo.Builder builder) { - MediaMetadata notificationMetadata = new MediaMetadata("", "", ""); - builder.setMetadata(notificationMetadata); - - if (mCastDevice != null) notificationMetadata.setTitle(mCastDevice.getFriendlyName()); - - if (mMediaPlayer == null) return; - - com.google.android.gms.cast.MediaInfo info = mMediaPlayer.getMediaInfo(); - if (info == null) return; - - com.google.android.gms.cast.MediaMetadata metadata = info.getMetadata(); - if (metadata == null) return; - - String title = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_TITLE); - if (title != null) notificationMetadata.setTitle(title); - - String artist = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ARTIST); - if (artist == null) { - artist = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ALBUM_ARTIST); - } - if (artist != null) notificationMetadata.setArtist(artist); - - String album = metadata.getString( - com.google.android.gms.cast.MediaMetadata.KEY_ALBUM_TITLE); - if (album != null) notificationMetadata.setAlbum(album); - } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionUtil.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionUtil.java new file mode 100644 index 0000000..cc24e95 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CastSessionUtil.java
@@ -0,0 +1,50 @@ +// Copyright 2018 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.media.router.cast; + +import com.google.android.gms.cast.CastDevice; +import com.google.android.gms.cast.RemoteMediaPlayer; + +import org.chromium.chrome.browser.media.ui.MediaNotificationInfo; +import org.chromium.content_public.common.MediaMetadata; + +/** + * Helper class that implements functions useful to all CastSession types. + */ +public class CastSessionUtil { + public static final String MEDIA_NAMESPACE = "urn:x-cast:com.google.cast.media"; + + /** + * Builds a MediaMetadata from the given CastDevice and MediaPlayer, and sets it on the builder + */ + public static void setNotificationMetadata(MediaNotificationInfo.Builder builder, + CastDevice castDevice, RemoteMediaPlayer mediaPlayer) { + MediaMetadata notificationMetadata = new MediaMetadata("", "", ""); + builder.setMetadata(notificationMetadata); + + if (castDevice != null) notificationMetadata.setTitle(castDevice.getFriendlyName()); + + if (mediaPlayer == null) return; + + com.google.android.gms.cast.MediaInfo info = mediaPlayer.getMediaInfo(); + if (info == null) return; + + com.google.android.gms.cast.MediaMetadata metadata = info.getMetadata(); + if (metadata == null) return; + + String title = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_TITLE); + if (title != null) notificationMetadata.setTitle(title); + + String artist = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ARTIST); + if (artist == null) { + artist = metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ALBUM_ARTIST); + } + if (artist != null) notificationMetadata.setArtist(artist); + + String album = + metadata.getString(com.google.android.gms.cast.MediaMetadata.KEY_ALBUM_TITLE); + if (album != null) notificationMetadata.setAlbum(album); + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java index 7b4fb9c7..e434693 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java
@@ -19,6 +19,7 @@ import org.chromium.base.Log; import org.chromium.chrome.browser.media.router.ChromeMediaRouter; import org.chromium.chrome.browser.media.router.MediaRoute; +import org.chromium.chrome.browser.media.router.cast.remoting.RemotingCastSession; import javax.annotation.Nullable; @@ -50,10 +51,16 @@ private final int mRequestId; private final CastMessageHandler mMessageHandler; private final ChromeCastSessionManager.CastSessionManagerListener mSessionListener; + private final RequestedCastSessionType mSessionType; private GoogleApiClient mApiClient; private int mState = STATE_IDLE; + // Used to identify whether the request should launch a CastSessionImpl or a RemotingCastSession + // (based off of wheter the route creation was requested by a RemotingMediaRouteProvider or a + // CastMediaRouteProvider). + public enum RequestedCastSessionType { CAST, REMOTE } + /** * Initializes the request. * @param source The {@link MediaSource} defining the application to launch on the Cast device. @@ -70,7 +77,7 @@ public CreateRouteRequest(MediaSource source, MediaSink sink, String presentationId, String origin, int tabId, boolean isIncognito, int requestId, ChromeCastSessionManager.CastSessionManagerListener listener, - @Nullable CastMessageHandler messageHandler) { + RequestedCastSessionType sessionType, @Nullable CastMessageHandler messageHandler) { assert source != null; assert sink != null; @@ -82,6 +89,7 @@ mIsIncognito = isIncognito; mRequestId = requestId; mSessionListener = listener; + mSessionType = sessionType; mMessageHandler = messageHandler; } @@ -226,9 +234,20 @@ private void reportSuccess(Cast.ApplicationConnectionResult result) { if (mState != STATE_LAUNCH_SUCCEEDED) throwInvalidState(); - CastSession session = new CastSessionImpl(mApiClient, result.getSessionId(), - result.getApplicationMetadata(), result.getApplicationStatus(), mSink.getDevice(), - mOrigin, mTabId, mIsIncognito, mSource, mMessageHandler); + CastSession session = null; + + switch (mSessionType) { + case CAST: + session = new CastSessionImpl(mApiClient, result.getSessionId(), + result.getApplicationMetadata(), result.getApplicationStatus(), + mSink.getDevice(), mOrigin, mTabId, mIsIncognito, mSource, mMessageHandler); + break; + case REMOTE: + session = new RemotingCastSession(mApiClient, result.getSessionId(), + result.getApplicationMetadata(), result.getApplicationStatus(), + mSink.getDevice(), mOrigin, mTabId, mIsIncognito, mSource); + break; + } ChromeCastSessionManager.get().onSessionStarted(session);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingCastSession.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingCastSession.java new file mode 100644 index 0000000..2d8d647 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingCastSession.java
@@ -0,0 +1,218 @@ +// Copyright 2018 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.media.router.cast.remoting; + +import com.google.android.gms.cast.ApplicationMetadata; +import com.google.android.gms.cast.Cast; +import com.google.android.gms.cast.CastDevice; +import com.google.android.gms.cast.MediaStatus; +import com.google.android.gms.cast.RemoteMediaPlayer; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.ResultCallback; +import com.google.android.gms.common.api.Status; + +import org.json.JSONException; +import org.json.JSONObject; + +import org.chromium.chrome.R; +import org.chromium.chrome.browser.media.router.cast.CastMessageHandler; +import org.chromium.chrome.browser.media.router.cast.CastSession; +import org.chromium.chrome.browser.media.router.cast.CastSessionInfo; +import org.chromium.chrome.browser.media.router.cast.CastSessionUtil; +import org.chromium.chrome.browser.media.router.cast.ChromeCastSessionManager; +import org.chromium.chrome.browser.media.router.cast.MediaSource; +import org.chromium.chrome.browser.media.ui.MediaNotificationInfo; +import org.chromium.chrome.browser.media.ui.MediaNotificationListener; +import org.chromium.chrome.browser.media.ui.MediaNotificationManager; + +import java.util.HashSet; +import java.util.Set; + +/** + * A wrapper around a RemoteMediaPlayer, used in remote playback. + */ +public class RemotingCastSession implements MediaNotificationListener, CastSession { + private final CastDevice mCastDevice; + private final MediaSource mSource; + + private GoogleApiClient mApiClient; + private String mSessionId; + private String mApplicationStatus; + private ApplicationMetadata mApplicationMetadata; + private MediaNotificationInfo.Builder mNotificationBuilder; + private RemoteMediaPlayer mMediaPlayer; + private boolean mStoppingApplication = false; + + public RemotingCastSession(GoogleApiClient apiClient, String sessionId, + ApplicationMetadata metadata, String applicationStatus, CastDevice castDevice, + String origin, int tabId, boolean isIncognito, MediaSource source) { + mCastDevice = castDevice; + mSource = source; + mApiClient = apiClient; + mApplicationMetadata = metadata; + mSessionId = sessionId; + + mMediaPlayer = new RemoteMediaPlayer(); + mMediaPlayer.setOnStatusUpdatedListener(new RemoteMediaPlayer.OnStatusUpdatedListener() { + @Override + public void onStatusUpdated() { + MediaStatus mediaStatus = mMediaPlayer.getMediaStatus(); + if (mediaStatus == null) return; + + int playerState = mediaStatus.getPlayerState(); + if (playerState == MediaStatus.PLAYER_STATE_PAUSED + || playerState == MediaStatus.PLAYER_STATE_PLAYING) { + mNotificationBuilder.setPaused(playerState != MediaStatus.PLAYER_STATE_PLAYING); + mNotificationBuilder.setActions(MediaNotificationInfo.ACTION_STOP + | MediaNotificationInfo.ACTION_PLAY_PAUSE); + } else { + mNotificationBuilder.setActions(MediaNotificationInfo.ACTION_STOP); + } + MediaNotificationManager.show(mNotificationBuilder.build()); + } + }); + mMediaPlayer.setOnMetadataUpdatedListener( + new RemoteMediaPlayer.OnMetadataUpdatedListener() { + @Override + public void onMetadataUpdated() { + CastSessionUtil.setNotificationMetadata( + mNotificationBuilder, mCastDevice, mMediaPlayer); + MediaNotificationManager.show(mNotificationBuilder.build()); + } + }); + + mNotificationBuilder = + new MediaNotificationInfo.Builder() + .setPaused(false) + .setOrigin(origin) + // TODO(avayvod): the same session might have more than one tab id. Should + // we track the last foreground alive tab and update the notification with + // it? + .setTabId(tabId) + .setPrivate(isIncognito) + .setActions(MediaNotificationInfo.ACTION_STOP) + .setNotificationSmallIcon(R.drawable.ic_notification_media_route) + .setDefaultNotificationLargeIcon(R.drawable.cast_playing_square) + .setId(R.id.presentation_notification) + .setListener(this); + CastSessionUtil.setNotificationMetadata(mNotificationBuilder, mCastDevice, mMediaPlayer); + MediaNotificationManager.show(mNotificationBuilder.build()); + } + + @Override + public boolean isApiClientInvalid() { + return mApiClient == null || !mApiClient.isConnected(); + } + + @Override + public String getSourceId() { + return mSource.getSourceId(); + } + + @Override + public String getSinkId() { + return mCastDevice.getDeviceId(); + } + + @Override + public String getSessionId() { + return mSessionId; + } + + @Override + public Set<String> getNamespaces() { + return new HashSet<String>(); + } + + @Override + public CastMessageHandler getMessageHandler() { + return null; + } + + @Override + public CastSessionInfo getSessionInfo() { + // Only used by the CastMessageHandler, which is unused in the RemotingCastSession case. + return null; + } + + @Override + public boolean sendStringCastMessage( + String message, String namespace, String clientId, int sequenceNumber) { + // String messages are not used in remoting scenarios. + return false; + } + + @Override + public HandleVolumeMessageResult handleVolumeMessage( + JSONObject volume, String clientId, int sequenceNumber) throws JSONException { + // RemoteMediaPlayer's setStreamVolume() should be used instead of volume messages. + return null; + } + + @Override + public void stopApplication() { + if (mStoppingApplication) return; + + if (isApiClientInvalid()) return; + + mStoppingApplication = true; + Cast.CastApi.stopApplication(mApiClient, mSessionId) + .setResultCallback(new ResultCallback<Status>() { + @Override + public void onResult(Status status) { + // TODO(https://crbug.com/535577): handle a failure to stop the application. + + mSessionId = null; + mApiClient = null; + + ChromeCastSessionManager.get().onSessionEnded(); + mStoppingApplication = false; + + MediaNotificationManager.clear(R.id.presentation_notification); + } + }); + } + + @Override + public void onClientConnected(String clientId) {} + + @Override + public void onMediaMessage(String message) { + if (mMediaPlayer != null) + mMediaPlayer.onMessageReceived(mCastDevice, CastSessionUtil.MEDIA_NAMESPACE, message); + } + + @Override + public void onVolumeChanged() {} + + @Override + public void updateSessionStatus() {} + + ///////////////////////////////////////////////////////////////////////////////////////////// + // MediaNotificationListener implementation. + + @Override + public void onPlay(int actionSource) { + if (mMediaPlayer == null || isApiClientInvalid()) return; + + mMediaPlayer.play(mApiClient); + } + + @Override + public void onPause(int actionSource) { + if (mMediaPlayer == null || isApiClientInvalid()) return; + + mMediaPlayer.pause(mApiClient); + } + + @Override + public void onStop(int actionSource) { + stopApplication(); + ChromeCastSessionManager.get().onSessionStopAction(); + } + + @Override + public void onMediaSessionAction(int action) {} +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaRouteProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaRouteProvider.java index 72ba1ced..d43bcca 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaRouteProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaRouteProvider.java
@@ -8,9 +8,12 @@ import org.chromium.base.VisibleForTesting; import org.chromium.chrome.browser.media.router.BaseMediaRouteProvider; import org.chromium.chrome.browser.media.router.ChromeMediaRouter; +import org.chromium.chrome.browser.media.router.MediaRoute; import org.chromium.chrome.browser.media.router.MediaRouteManager; import org.chromium.chrome.browser.media.router.MediaRouteProvider; import org.chromium.chrome.browser.media.router.cast.ChromeCastSessionManager; +import org.chromium.chrome.browser.media.router.cast.CreateRouteRequest; +import org.chromium.chrome.browser.media.router.cast.MediaSink; import org.chromium.chrome.browser.media.router.cast.MediaSource; /** @@ -54,10 +57,29 @@ super(androidMediaRouter, manager); } - // TODO(tguilbert): Implement the functions below. See https://crbug.com/790766. @Override - public void onSessionEnded() {} + public void onSessionEnded() { + if (mSession == null) return; + + for (String routeId : mRoutes.keySet()) mManager.onRouteClosed(routeId); + mRoutes.clear(); + + mSession = null; + + if (mAndroidMediaRouter != null) { + mAndroidMediaRouter.selectRoute(mAndroidMediaRouter.getDefaultRoute()); + } + } @Override - public void onSessionStarting(ChromeCastSessionManager.CastSessionLaunchRequest request) {} + public void onSessionStarting(ChromeCastSessionManager.CastSessionLaunchRequest launchRequest) { + CreateRouteRequest request = (CreateRouteRequest) launchRequest; + MediaSink sink = request.getSink(); + MediaSource source = request.getSource(); + + MediaRoute route = + new MediaRoute(sink.getId(), source.getSourceId(), request.getPresentationId()); + mRoutes.put(route.id, route); + mManager.onRouteCreated(route.id, route.sinkId, request.getNativeRequestId(), this, true); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java index 8844a52a..aba992c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java
@@ -15,6 +15,7 @@ import org.chromium.base.ContextUtils; import org.chromium.base.metrics.RecordHistogram; +import org.chromium.chrome.browser.ChromeFeatureList; import org.chromium.chrome.browser.preferences.website.SiteSettingsCategory; import org.chromium.chrome.browser.preferences.website.Website; import org.chromium.chrome.browser.preferences.website.WebsitePermissionsFetcher; @@ -81,6 +82,9 @@ // Obsolete: WEBAPK_OPEN_NO_LAUNCH_INTENT = 1; public static final int WEBAPK_OPEN_ACTIVITY_NOT_FOUND = 2; + private static final String ADJUST_WEBAPK_INSTALLATION_SPACE_PARAM = + "webapk_extra_installation_space_mb"; + /** * Records the time point when a request to update a WebAPK is sent to the WebAPK Server. * @param type representing when the update request is sent to the WebAPK server. @@ -329,7 +333,12 @@ } long minimumFreeBytes = getLowSpaceLimitBytes(partitionTotalBytes); - return partitionAvailableBytes - minimumFreeBytes; + long webApkExtraSpaceBytes = ChromeFeatureList.getFieldTrialParamByFeatureAsInt( + ChromeFeatureList.ADJUST_WEBAPK_INSTALLATION_SPACE, + ADJUST_WEBAPK_INSTALLATION_SPACE_PARAM, 0) + * 1024L * 1024L; + + return partitionAvailableBytes - minimumFreeBytes + webApkExtraSpaceBytes; } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/modaldialog/ModalDialogManager.java b/chrome/android/java/src/org/chromium/chrome/browser/modaldialog/ModalDialogManager.java index 865c2b5f..b25f2285 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/modaldialog/ModalDialogManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/modaldialog/ModalDialogManager.java
@@ -154,7 +154,7 @@ * @param dialog The dialog to be dismissed or removed from pending list. */ public void dismissDialog(ModalDialogView dialog) { - if (dialog != mCurrentPresenter.getModalDialog()) { + if (mCurrentPresenter == null || dialog != mCurrentPresenter.getModalDialog()) { for (int i = 0; i < mPendingDialogs.size(); ++i) { if (mPendingDialogs.get(i).first == dialog) { mPendingDialogs.remove(i); @@ -199,6 +199,11 @@ } @VisibleForTesting + public ModalDialogView getCurrentDialogForTest() { + return mCurrentPresenter == null ? null : mCurrentPresenter.getModalDialog(); + } + + @VisibleForTesting List getPendingDialogsForTest() { return mPendingDialogs; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java index 5d9132ba..c33e9abd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/NewTabPageAdapter.java
@@ -61,7 +61,7 @@ private final @Nullable SiteSection mSiteSection; private final SuggestionsCarousel mSuggestionsCarousel; private final SectionList mSections; - private final SignInPromo mSigninPromo; + private final @Nullable SignInPromo mSigninPromo; private final AllDismissedItem mAllDismissed; private final Footer mFooter; private final SpacingItem mBottomSpacer; @@ -96,7 +96,7 @@ mUiConfig = uiConfig; mRoot = new InnerNode(); mSections = new SectionList(mUiDelegate, offlinePageBridge); - mSigninPromo = new SignInPromo(mUiDelegate); + mSigninPromo = SignInPromo.maybeCreatePromo(mUiDelegate); mAllDismissed = new AllDismissedItem(); if (mAboveTheFoldView == null) { @@ -128,9 +128,12 @@ } if (FeatureUtilities.isChromeHomeEnabled()) { - mRoot.addChildren(mSigninPromo, mAllDismissed, mSections); + if (mSigninPromo != null) mRoot.addChild(mSigninPromo); + mRoot.addChildren(mAllDismissed, mSections); } else { - mRoot.addChildren(mSections, mSigninPromo, mAllDismissed); + mRoot.addChild(mSections); + if (mSigninPromo != null) mRoot.addChild(mSigninPromo); + mRoot.addChild(mAllDismissed); } mFooter = new Footer(); @@ -397,7 +400,7 @@ } private boolean hasAllBeenDismissed() { - if (mSigninPromo.isVisible()) return false; + if (mSigninPromo != null && mSigninPromo.isVisible()) return false; if (!FeatureUtilities.isChromeHomeEnabled()) return mSections.isEmpty();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SignInPromo.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SignInPromo.java index 49e503a..78102b61 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SignInPromo.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SignInPromo.java
@@ -53,12 +53,6 @@ static final long SUPPRESSION_PERIOD_MS = TimeUnit.DAYS.toMillis(1); /** - * Whether the promo had been previously dismissed, before creating an instance of the - * {@link SignInPromo}. - */ - private final boolean mWasDismissed; - - /** * Whether the promo has been dismissed by the user. */ private boolean mDismissed; @@ -74,33 +68,17 @@ */ private boolean mCanShowPersonalizedSuggestions; - /** - * Whether signin promo was temporary suppressed. - */ - private boolean mSuppressed; - private final @Nullable SigninObserver mSigninObserver; private final @Nullable SigninPromoController mSigninPromoController; private final @Nullable ProfileDataCache mProfileDataCache; - public SignInPromo(SuggestionsUiDelegate uiDelegate) { - mWasDismissed = ChromePreferenceManager.getInstance().getNewTabPageSigninPromoDismissed(); - - if (mWasDismissed) { - setVisibilityInternal(false); - mSigninObserver = null; - mProfileDataCache = null; - mSigninPromoController = null; - return; - } - + private SignInPromo(SuggestionsUiDelegate uiDelegate) { Context context = ContextUtils.getApplicationContext(); SuggestionsSource suggestionsSource = uiDelegate.getSuggestionsSource(); SigninManager signinManager = SigninManager.get(context); mCanSignIn = signinManager.isSignInAllowed() && !signinManager.isSignedInOnNative(); mCanShowPersonalizedSuggestions = suggestionsSource.areRemoteSuggestionsEnabled(); - mSuppressed = getSuppressionStatus(); updateVisibility(); @@ -122,7 +100,13 @@ System.currentTimeMillis()); } - private boolean getSuppressionStatus() { + public static SignInPromo maybeCreatePromo(SuggestionsUiDelegate uiDelegate) { + if (ChromePreferenceManager.getInstance().getNewTabPageSigninPromoDismissed()) return null; + if (getSuppressionStatus()) return null; + return new SignInPromo(uiDelegate); + } + + private static boolean getSuppressionStatus() { long suppressedFrom = ChromePreferenceManager.getInstance() .getNewTabPageSigninPromoSuppressionPeriodStart(); if (suppressedFrom == 0) return false; @@ -155,14 +139,12 @@ */ public NewTabPageViewHolder createViewHolder(SuggestionsRecyclerView parent, ContextMenuManager contextMenuManager, UiConfig config) { - assert !mWasDismissed; return new PersonalizedPromoViewHolder( parent, config, contextMenuManager, mProfileDataCache, mSigninPromoController); } @Override protected void onBindViewHolder(NewTabPageViewHolder holder) { - assert !mWasDismissed; ((PersonalizedPromoViewHolder) holder).onBindViewHolder(); } @@ -172,8 +154,7 @@ } private void updateVisibility() { - setVisibilityInternal( - !mDismissed && mCanSignIn && mCanShowPersonalizedSuggestions && !mSuppressed); + setVisibilityInternal(!mDismissed && mCanSignIn && mCanShowPersonalizedSuggestions); } @Override @@ -184,7 +165,6 @@ /** Hides the sign in promo and sets a preference to make sure it is not shown again. */ @Override public void dismiss(Callback<String> itemRemovedCallback) { - assert !mWasDismissed; mDismissed = true; updateVisibility(); @@ -207,8 +187,6 @@ private boolean mUnregistered; private SigninObserver(SigninManager signinManager, SuggestionsSource suggestionsSource) { - assert !mWasDismissed; - mSigninManager = signinManager; mSigninManager.addSignInAllowedObserver(this); mSigninManager.addSignInStateObserver(this); @@ -221,8 +199,6 @@ } private void unregister() { - assert !mWasDismissed; - if (mUnregistered) return; mUnregistered = true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java index 5b14e17..77c5091 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java
@@ -607,6 +607,18 @@ } /** + * Get the url to launch the offline page associated with the provided offline ID. Depending on + * whether it is trusted or not, either http/https or file URL will be returned in the callback. + * + * @param offlineId ID of the offline page. + * @param callback callback to pass back the url string if found. Will pass back + * <code>null</code> if not. + */ + public void getLaunchUrlByOfflineId(long offlineId, Callback<String> callback) { + nativeGetLaunchUrlByOfflineId(mNativeOfflinePageBridge, offlineId, callback); + } + + /** * Allows setting the offline bookmarks feature as enabled or disabled for testing. This is * required for tests that don't load the native binary otherwise UnsatisfiedLinkError sadness * will occur. @@ -738,4 +750,6 @@ long nativeOfflinePageBridge, WebContents webContents); private native void nativeCheckForNewOfflineContent( long nativeOfflinePageBridge, long freshnessTimeMillis, Callback<String> callback); + private native void nativeGetLaunchUrlByOfflineId( + long nativeOfflinePageBridge, long offlineId, Callback<String> callback); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java index 0464028..44ccfeb0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java
@@ -377,19 +377,32 @@ } /** - * A load url parameters to open offline version of the offline page (i.e. to ensure no - * automatic redirection based on the connection status). + * A load url parameters to open offline version of the offline page. If the offline page is + * trusted, the URL (http/https) of the offline page is to be opened. Otherwise, the file URL + * pointing to the archive file is to be opened. In both cases, a custom header is passed with + * the URL to ensure loading a specific version of offline page. * @param url The url of the offline page to open. * @param offlineId The ID of the offline page to open. - * @return The LoadUrlParams with a special header. + * @param callback The callback to pass back the LoadUrlParams for launching an URL. */ - public static LoadUrlParams getLoadUrlParamsForOpeningOfflineVersion( - String url, long offlineId) { - LoadUrlParams params = new LoadUrlParams(url); - Map<String, String> headers = new HashMap<String, String>(); - headers.put("X-Chrome-offline", "persist=1 reason=download id=" + Long.toString(offlineId)); - params.setExtraHeaders(headers); - return params; + public static void getLoadUrlParamsForOpeningOfflineVersion( + final String url, long offlineId, Callback<LoadUrlParams> callback) { + OfflinePageBridge offlinePageBridge = + getInstance().getOfflinePageBridge(Profile.getLastUsedProfile()); + if (offlinePageBridge == null) { + callback.onResult(null); + return; + } + + offlinePageBridge.getLaunchUrlByOfflineId(offlineId, (launchUrl) -> { + if (launchUrl == null) callback.onResult(null); + LoadUrlParams params = new LoadUrlParams(launchUrl); + Map<String, String> headers = new HashMap<String, String>(); + headers.put( + "X-Chrome-offline", "persist=1 reason=download id=" + Long.toString(offlineId)); + params.setExtraHeaders(headers); + callback.onResult(params); + }); } /** @@ -436,21 +449,6 @@ } /** - * Navigates the given tab to the saved local snapshot of the offline page identified by the URL - * and the offline ID. No automatic redirection is happening based on the connection status. - * @param url The URL of the offine page. - * @param offlineId The ID of the offline page. - * @param tab The tab to navigate to the page. - */ - public static void openInExistingTab(String url, long offlineId, Tab tab) { - LoadUrlParams params = - OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion(url, offlineId); - // Extra headers are not read in loadUrl, but verbatim headers are. - params.setVerbatimHeaders(params.getExtraHeadersString()); - tab.loadUrl(params); - } - - /** * Tracks tab creation and closure for the Recent Tabs feature. UI needs to stop showing * recent offline pages as soon as the tab is closed. The TabModel is used to get profile * information because Tab's profile is tied to the native WebContents, which may not exist at
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java index 92fdcef..90d6b144 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/downloads/OfflinePageDownloadBridge.java
@@ -18,7 +18,6 @@ import org.chromium.chrome.browser.tabmodel.TabModel.TabLaunchType; import org.chromium.chrome.browser.tabmodel.document.AsyncTabCreationParams; import org.chromium.chrome.browser.tabmodel.document.TabDelegate; -import org.chromium.content_public.browser.LoadUrlParams; /** * Serves as an interface between Download Home UI and offline page related items that are to be @@ -67,14 +66,15 @@ */ @CalledByNative private static void openItem(String url, long offlineId) { - LoadUrlParams params = - OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion(url, offlineId); - ComponentName componentName = getComponentName(); - AsyncTabCreationParams asyncParams = componentName == null - ? new AsyncTabCreationParams(params) - : new AsyncTabCreationParams(params, componentName); - final TabDelegate tabDelegate = new TabDelegate(false); - tabDelegate.createNewTab(asyncParams, TabLaunchType.FROM_CHROME_UI, Tab.INVALID_TAB_ID); + OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion(url, offlineId, (params) -> { + if (params == null) return; + ComponentName componentName = getComponentName(); + AsyncTabCreationParams asyncParams = componentName == null + ? new AsyncTabCreationParams(params) + : new AsyncTabCreationParams(params, componentName); + final TabDelegate tabDelegate = new TabDelegate(false); + tabDelegate.createNewTab(asyncParams, TabLaunchType.FROM_CHROME_UI, Tab.INVALID_TAB_ID); + }); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java index 0f55d7f..09303c9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java
@@ -264,27 +264,6 @@ } /** - * Listener for receiving the messages related with interacting with the omnibox during startup. - */ - public interface OmniboxLivenessListener { - /** - * Called after the first draw when the omnibox can receive touch events. - */ - void onOmniboxInteractive(); - - /** - * Called when the native libraries are loaded and listeners with native components - * have been initialized. - */ - void onOmniboxFullyFunctional(); - - /** - * Called when the omnibox is focused. - */ - void onOmniboxFocused(); - } - - /** * Class to handle input from a hardware keyboard when the focus is on the URL bar. In * particular, handle navigating the suggestions list from the keyboard. */ @@ -867,7 +846,6 @@ } mDeferredNativeRunnables.clear(); - mUrlBar.onNativeLibraryReady(); updateVisualsForState(); }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java index 6eada30..13c479a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/UrlBar.java
@@ -36,11 +36,9 @@ import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.Log; import org.chromium.base.SysUtils; -import org.chromium.base.VisibleForTesting; import org.chromium.chrome.R; import org.chromium.chrome.browser.WindowDelegate; import org.chromium.chrome.browser.metrics.StartupMetrics; -import org.chromium.chrome.browser.omnibox.LocationBarLayout.OmniboxLivenessListener; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.util.UrlUtilities; import org.chromium.content.browser.ContentViewCore; @@ -114,8 +112,6 @@ private Boolean mUseDarkColors; - private OmniboxLivenessListener mOmniboxLivenessListener; - private long mFirstFocusTimeMs; // Used as a hint to indicate the text may contain an ellipsize span. This will be true if an @@ -308,7 +304,6 @@ if (focused && mFirstFocusTimeMs == 0) { mFirstFocusTimeMs = SystemClock.elapsedRealtime(); - if (mOmniboxLivenessListener != null) mOmniboxLivenessListener.onOmniboxFocused(); } if (focused) { @@ -453,11 +448,6 @@ // touches etc. activate it. setFocusable(mAllowFocus); setFocusableInTouchMode(mAllowFocus); - - // The URL bar will now react correctly to a focus change event - if (mOmniboxLivenessListener != null) { - mOmniboxLivenessListener.onOmniboxInteractive(); - } } // Notify listeners if the URL's direction has changed. @@ -518,20 +508,6 @@ mUrlBarDelegate = delegate; } - /** - * Set {@link OmniboxLivenessListener} to be used for receiving interaction related messages - * during startup. - * @param listener The listener to use for sending the messages. - */ - @VisibleForTesting - public void setOmniboxLivenessListener(OmniboxLivenessListener listener) { - mOmniboxLivenessListener = listener; - } - - public void onNativeLibraryReady() { - if (mOmniboxLivenessListener != null) mOmniboxLivenessListener.onOmniboxFullyFunctional(); - } - @Override public boolean onTextContextMenuItem(int id) { if (id == android.R.id.paste) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java index 84d3c0b..8e50add 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java
@@ -72,7 +72,7 @@ * @param modifiedTotal The new modified total to use. */ public void setModifiedTotal(@Nullable String modifiedTotal) { - updateTertiarylabel(modifiedTotal); + updatePromoMessage(modifiedTotal); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java index 04c19c2..d8d9ab4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentOption.java
@@ -20,6 +20,7 @@ protected boolean mIsEditable; protected String mEditMessage; protected String mEditTitle; + protected String mPromoMessage; private String mId; private Drawable mIcon; private String[] mLabels = {null, null, null}; @@ -97,6 +98,15 @@ return mLabels[2]; } + /** + * The optional promo message of this option. For example, discount for a payment method, like + * "$45". + */ + @Nullable + public String getPromoMessage() { + return mPromoMessage; + } + /** See {@link #updateIdentifierAndLabels(String, String, String, String)}. */ protected void updateIdentifierAndLabels(String id, String label, @Nullable String sublabel) { updateIdentifierAndLabels(id, label, sublabel, null); @@ -155,6 +165,15 @@ mLabels[2] = tertiarylabel; } + /** + * Updates the promo message of this option. + * + * @param message The new message to use. + */ + protected void updatePromoMessage(String message) { + mPromoMessage = message; + } + /** @param icon The new icon to use. */ public void updateDrawableIcon(Drawable icon) { mIcon = icon;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java index 834d19b2..f20cb4a 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/PaymentRequestSection.java
@@ -1400,6 +1400,11 @@ builder.append(item.getTertiaryLabel()); } + if (!TextUtils.isEmpty(item.getPromoMessage())) { + if (builder.length() > 0) builder.append(labelSeparator); + builder.append(item.getPromoMessage()); + } + if (!item.isComplete() && !TextUtils.isEmpty(item.getEditMessage())) { if (builder.length() > 0) builder.append(labelSeparator); String editMessage = item.getEditMessage();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmapView.java b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmapView.java index e4911bd..814302c6 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmapView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/photo_picker/PickerBitmapView.java
@@ -110,6 +110,9 @@ @Override public void onClick() { + if (mBitmapDetails == null) + return; // Clicks are disabled until initialize() has been called. + if (isGalleryTile()) { mCategoryView.showGallery(); return;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/AddLanguageFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/AddLanguageFragment.java index b38a595b..385a9edd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/AddLanguageFragment.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/AddLanguageFragment.java
@@ -95,7 +95,7 @@ super.onCreate(savedInstanceState); getActivity().setTitle(R.string.prefs_add_language); setHasOptionsMenu(true); - // TODO(crbug/783049): Record impression. + LanguagesManager.recordImpression(LanguagesManager.PAGE_ADD_LANGUAGE); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListBaseAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListBaseAdapter.java index d48cc4f8..531137fb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListBaseAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListBaseAdapter.java
@@ -191,6 +191,7 @@ String languageCode = getItemByPosition(from).getCode(); Collections.swap(mLanguageList, from, to); PrefServiceBridge.getInstance().moveAcceptLanguage(languageCode, to - from); + LanguagesManager.recordAction(LanguagesManager.ACTION_LANGUAGE_LIST_REORDERED); notifyItemMoved(from, to); return true; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListPreference.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListPreference.java index bc9798d..ec171ec 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListPreference.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguageListPreference.java
@@ -27,7 +27,6 @@ * A preference that displays the current accept language list. */ public class LanguageListPreference extends Preference { - // TODO(crbug/783049): Make the item in the list drag-able. private static class LanguageListAdapter extends LanguageListBaseAdapter implements LanguagesManager.AcceptLanguageObserver { @@ -74,8 +73,13 @@ boolean state = (item.getEndIconId() == 0); PrefServiceBridge.getInstance().setLanguageBlockedState( info.getCode(), !state); + LanguagesManager.recordAction( + state ? LanguagesManager.ACTION_ENABLE_TRANSLATE_FOR_SINGLE_LANGUAGE + : LanguagesManager + .ACTION_DISABLE_TRANSLATE_FOR_SINGLE_LANGUAGE); } else if (item.getTextId() == R.string.remove) { LanguagesManager.getInstance().removeFromAcceptLanguages(info.getCode()); + LanguagesManager.recordAction(LanguagesManager.ACTION_LANGUAGE_REMOVED); } } }); @@ -112,7 +116,10 @@ TintedDrawable.constructTintedDrawable( getContext().getResources(), R.drawable.plus, R.color.pref_accent_color), null, null, null); - mAddLanguageButton.setOnClickListener(view -> mLauncher.launchAddLanguage()); + mAddLanguageButton.setOnClickListener(view -> { + mLauncher.launchAddLanguage(); + LanguagesManager.recordAction(LanguagesManager.ACTION_CLICK_ON_ADD_LANGUAGE); + }); mRecyclerView = (RecyclerView) mView.findViewById(R.id.language_list); LinearLayoutManager layoutMangager = new LinearLayoutManager(getContext());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesManager.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesManager.java index 494f430..1de69f1c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesManager.java
@@ -4,8 +4,13 @@ package org.chromium.chrome.browser.preferences.languages; +import android.support.annotation.IntDef; + +import org.chromium.base.metrics.RecordHistogram; import org.chromium.chrome.browser.preferences.PrefServiceBridge; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -14,7 +19,7 @@ /** * Manages languages details for languages settings. * - * The LanguagesManager is responsible for fetching languages details from native. + *The LanguagesManager is responsible for fetching languages details from native. */ class LanguagesManager { /** @@ -28,6 +33,35 @@ void onDataUpdated(); } + // Constants used to log UMA enum histogram, must stay in sync with + // LanguageSettingsActionType. Further actions can only be appended, existing + // entries must not be overwritten. + @Retention(RetentionPolicy.SOURCE) + @IntDef({ACTION_CLICK_ON_ADD_LANGUAGE, ACTION_LANGUAGE_ADDED, ACTION_LANGUAGE_REMOVED, + ACTION_DISABLE_TRANSLATE_GLOBALLY, ACTION_ENABLE_TRANSLATE_GLOBALLY, + ACTION_DISABLE_TRANSLATE_FOR_SINGLE_LANGUAGE, + ACTION_ENABLE_TRANSLATE_FOR_SINGLE_LANGUAGE, ACTION_LANGUAGE_LIST_REORDERED}) + private @interface LanguageSettingsActionType {} + static final int ACTION_CLICK_ON_ADD_LANGUAGE = 1; + static final int ACTION_LANGUAGE_ADDED = 2; + static final int ACTION_LANGUAGE_REMOVED = 3; + static final int ACTION_DISABLE_TRANSLATE_GLOBALLY = 4; + static final int ACTION_ENABLE_TRANSLATE_GLOBALLY = 5; + static final int ACTION_DISABLE_TRANSLATE_FOR_SINGLE_LANGUAGE = 6; + static final int ACTION_ENABLE_TRANSLATE_FOR_SINGLE_LANGUAGE = 7; + static final int ACTION_LANGUAGE_LIST_REORDERED = 8; + static final int ACTION_BOUNDARY = 9; + + // Constants used to log UMA enum histogram, must stay in sync with + // LanguageSettingsPageType. Further actions can only be appended, existing + // entries must not be overwritten. + @Retention(RetentionPolicy.SOURCE) + @IntDef({PAGE_MAIN, PAGE_ADD_LANGUAGE}) + private @interface LanguageSettingsPageType {} + static final int PAGE_MAIN = 0; + static final int PAGE_ADD_LANGUAGE = 1; + static final int PAGE_BOUNDARY = 2; + private static LanguagesManager sManager; private final PrefServiceBridge mPrefServiceBridge; @@ -120,4 +154,20 @@ public static void recycle() { sManager = null; } + + /** + * Record language settings page impression. + */ + public static void recordImpression(@LanguageSettingsPageType int pageType) { + RecordHistogram.recordEnumeratedHistogram( + "LanguageSettings.PageImpression", pageType, PAGE_BOUNDARY); + } + + /** + * Record actions taken on language settings page. + */ + public static void recordAction(@LanguageSettingsActionType int actionType) { + RecordHistogram.recordEnumeratedHistogram( + "LanguageSettings.Actions", actionType, ACTION_BOUNDARY); + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesPreferences.java index e614e98..accfea0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/languages/LanguagesPreferences.java
@@ -49,7 +49,11 @@ translateSwitch.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { - PrefServiceBridge.getInstance().setTranslateEnabled((boolean) newValue); + boolean enabled = (boolean) newValue; + PrefServiceBridge.getInstance().setTranslateEnabled(enabled); + LanguagesManager.recordAction(enabled + ? LanguagesManager.ACTION_ENABLE_TRANSLATE_GLOBALLY + : LanguagesManager.ACTION_DISABLE_TRANSLATE_GLOBALLY); return true; } }); @@ -59,6 +63,7 @@ return PrefServiceBridge.getInstance().isTranslateManaged(); } }); + LanguagesManager.recordImpression(LanguagesManager.PAGE_MAIN); } @Override @@ -73,6 +78,7 @@ if (requestCode == REQUEST_CODE_ADD_LANGUAGES && resultCode == getActivity().RESULT_OK) { String code = data.getStringExtra(AddLanguageFragment.INTENT_NEW_ACCEPT_LANGAUGE); LanguagesManager.getInstance().addToAcceptLanguages(code); + LanguagesManager.recordAction(LanguagesManager.ACTION_LANGUAGE_ADDED); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java index a0a93517..b43b4dd 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferences.java
@@ -64,7 +64,7 @@ private static final String PREF_KEY_SAVED_PASSWORDS_NO_TEXT = "saved_passwords_no_text"; // Name of the feature controlling the password export functionality. - private static final String EXPORT_PASSWORDS = "password-export"; + private static final String EXPORT_PASSWORDS = "PasswordExport"; private static final int ORDER_SWITCH = 0; private static final int ORDER_AUTO_SIGNIN_CHECKBOX = 1;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/provider/ChromeBrowserProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/provider/ChromeBrowserProvider.java index 09b9cf9..0103eae 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/provider/ChromeBrowserProvider.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/provider/ChromeBrowserProvider.java
@@ -5,7 +5,6 @@ package org.chromium.chrome.browser.provider; import android.annotation.SuppressLint; -import android.app.Application; import android.app.SearchManager; import android.content.ContentProvider; import android.content.ContentUris; @@ -27,7 +26,6 @@ import android.util.Log; import android.util.LongSparseArray; -import org.chromium.base.ApplicationStatus; import org.chromium.base.ContextUtils; import org.chromium.base.ThreadUtils; import org.chromium.base.VisibleForTesting; @@ -243,7 +241,6 @@ @Override public boolean onCreate() { - ApplicationStatus.initialize((Application) ContextUtils.getApplicationContext()); // Work around for broken Android versions that break the Android contract and initialize // ContentProviders on non-UI threads. crbug.com/705442 ThreadUtils.runOnUiThreadBlocking(new Runnable() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java index 7c2d8164..250062e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninActivity.java
@@ -164,7 +164,7 @@ mSigninFlowType = getIntent().getIntExtra(INTENT_SIGNIN_FLOW_TYPE, -1); switch (mSigninFlowType) { case SIGNIN_FLOW_DEFAULT: - view.initFromSelectionPage(false, this, this); + view.initFromSelectionPage(mAccessPoint, false, this, this); break; case SIGNIN_FLOW_CONFIRMATION_ONLY: { String accountName = getIntent().getStringExtra(INTENT_ACCOUNT_NAME); @@ -173,22 +173,17 @@ } boolean isDefaultAccount = getIntent().getBooleanExtra(INTENT_IS_DEFAULT_ACCOUNT, false); - view.initFromConfirmationPage(false, accountName, isDefaultAccount, + view.initFromConfirmationPage(mAccessPoint, false, accountName, isDefaultAccount, AccountSigninView.UNDO_ABORT, this, this); break; } case SIGNIN_FLOW_ADD_NEW_ACCOUNT: - view.initFromAddAccountPage(this, this); + view.initFromAddAccountPage(mAccessPoint, this, this); break; default: throw new IllegalArgumentException("Unknown signin flow type: " + mSigninFlowType); } - if (mAccessPoint == SigninAccessPoint.BOOKMARK_MANAGER - || mAccessPoint == SigninAccessPoint.RECENT_TABS) { - view.configureForRecentTabsOrBookmarksPage(); - } - setContentView(view); SigninManager.logSigninStartAccessPoint(mAccessPoint);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java index d70ee488..678c8a56 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/AccountSigninView.java
@@ -158,12 +158,14 @@ * Initializes the view from account selection page. After selecting the account, signin * confirmation page will be opened. * + * @param accessPoint The access point for starting signin flow. * @param isChildAccount Whether this view is for a child account. * @param delegate The UI object creation delegate. * @param listener The account selection event listener. */ - public void initFromSelectionPage( - boolean isChildAccount, Delegate delegate, Listener listener) { + public void initFromSelectionPage(@SigninAccessPoint int accessPoint, boolean isChildAccount, + Delegate delegate, Listener listener) { + initAccessPoint(accessPoint); mIsChildAccount = isChildAccount; mUndoBehavior = UNDO_BACK_TO_SELECTION; mDelegate = delegate; @@ -175,10 +177,13 @@ * Initializes the view from account selection page. After selecting the account, signin * confirmation page will be opened. * + * @param accessPoint The access point for starting signin flow. * @param delegate The UI object creation delegate. * @param listener The account selection event listener. */ - public void initFromAddAccountPage(Delegate delegate, Listener listener) { + public void initFromAddAccountPage( + @SigninAccessPoint int accessPoint, Delegate delegate, Listener listener) { + initAccessPoint(accessPoint); mIsChildAccount = false; // Children profiles can't add accounts. mUndoBehavior = UNDO_ABORT; mDelegate = delegate; @@ -193,6 +198,7 @@ * Initializes the view from signin confirmation page. The account name should be provided by * the caller. * + * @param accessPoint The access point for starting signin flow. * @param isChildAccount Whether this view is for a child account. * @param accountName An account that should be used for confirmation page and signin. * @param isDefaultAccount Whether {@param accountName} is a default account, used for metrics. @@ -200,9 +206,10 @@ * @param delegate The UI object creation delegate. * @param listener The account selection event listener. */ - public void initFromConfirmationPage(boolean isChildAccount, String accountName, - boolean isDefaultAccount, @UndoBehavior int undoBehavior, Delegate delegate, - Listener listener) { + public void initFromConfirmationPage(@SigninAccessPoint int accessPoint, boolean isChildAccount, + String accountName, boolean isDefaultAccount, @UndoBehavior int undoBehavior, + Delegate delegate, Listener listener) { + initAccessPoint(accessPoint); mIsChildAccount = isChildAccount; mUndoBehavior = undoBehavior; mDelegate = delegate; @@ -211,6 +218,13 @@ triggerUpdateAccounts(); } + private void initAccessPoint(@SigninAccessPoint int accessPoint) { + if (accessPoint == SigninAccessPoint.BOOKMARK_MANAGER + || accessPoint == SigninAccessPoint.RECENT_TABS) { + mCancelButtonTextId = R.string.cancel; + } + } + @Override protected void onFinishInflate() { super.onFinishInflate(); @@ -269,16 +283,6 @@ } /** - * Changes the visuals slightly for when this view appears in the recent tabs page instead of - * in first run. - * This is currently used when signing in from the Recent Tabs or Bookmarks pages. - */ - public void configureForRecentTabsOrBookmarksPage() { - mCancelButtonTextId = R.string.cancel; - setUpCancelButton(); - } - - /** * @return Whether the view is in signed in mode. */ public boolean isInConfirmationScreen() { @@ -544,14 +548,19 @@ // as this is needed for the previous account check. final long seedingStartTime = SystemClock.elapsedRealtime(); if (AccountTrackerService.get().checkAndSeedSystemAccounts()) { - showConfirmSigninPagePreviousAccountCheck(seedingStartTime); + recordAccountTrackerServiceSeedingTime(seedingStartTime); + showConfirmSigninPagePreviousAccountCheck(); } else { AccountTrackerService.get().addSystemAccountsSeededListener( new OnSystemAccountsSeededListener() { @Override public void onSystemAccountsSeedingComplete() { AccountTrackerService.get().removeSystemAccountsSeededListener(this); - showConfirmSigninPagePreviousAccountCheck(seedingStartTime); + recordAccountTrackerServiceSeedingTime(seedingStartTime); + // Don't show dialogs and confirmation page if activity was destroyed. + if (ViewCompat.isAttachedToWindow(AccountSigninView.this)) { + showConfirmSigninPagePreviousAccountCheck(); + } } @Override @@ -560,9 +569,7 @@ } } - private void showConfirmSigninPagePreviousAccountCheck(long seedingStartTime) { - RecordHistogram.recordTimesHistogram("Signin.AndroidAccountSigninViewSeedingTime", - SystemClock.elapsedRealtime() - seedingStartTime, TimeUnit.MILLISECONDS); + private void showConfirmSigninPagePreviousAccountCheck() { mConfirmSyncDataStateMachine = new ConfirmSyncDataStateMachine(getContext(), mDelegate.getFragmentManager(), ImportSyncType.PREVIOUS_DATA_FOUND, PrefServiceBridge.getInstance().getSyncLastAccountName(), mSelectedAccountName, @@ -583,6 +590,11 @@ }); } + private static void recordAccountTrackerServiceSeedingTime(long seedingStartTime) { + RecordHistogram.recordTimesHistogram("Signin.AndroidAccountSigninViewSeedingTime", + SystemClock.elapsedRealtime() - seedingStartTime, TimeUnit.MILLISECONDS); + } + private void setUpCancelButton() { setNegativeButtonVisible(true);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java index 1ff022e..7df7c21 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/suggestions/SuggestionsNavigationDelegateImpl.java
@@ -102,7 +102,7 @@ } @Override - public void openSnippet(int windowOpenDisposition, SnippetArticle article) { + public void openSnippet(final int windowOpenDisposition, final SnippetArticle article) { NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_SNIPPET); if (article.isAssetDownload()) { @@ -122,7 +122,6 @@ return; } - LoadUrlParams loadUrlParams; // We explicitly open an offline page only for offline page downloads. For all other // sections the URL is opened and it is up to Offline Pages whether to open its offline // page (e.g. when offline). @@ -131,14 +130,19 @@ assert windowOpenDisposition == WindowOpenDisposition.CURRENT_TAB || windowOpenDisposition == WindowOpenDisposition.NEW_WINDOW || windowOpenDisposition == WindowOpenDisposition.NEW_BACKGROUND_TAB; - loadUrlParams = OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion( - article.mUrl, article.getOfflinePageOfflineId()); - // Extra headers are not read in loadUrl, but verbatim headers are. - loadUrlParams.setVerbatimHeaders(loadUrlParams.getExtraHeadersString()); - } else { - loadUrlParams = new LoadUrlParams(article.mUrl, PageTransition.AUTO_BOOKMARK); + OfflinePageUtils.getLoadUrlParamsForOpeningOfflineVersion( + article.mUrl, article.getOfflinePageOfflineId(), (loadUrlParams) -> { + // Extra headers are not read in loadUrl, but verbatim headers are. + loadUrlParams.setVerbatimHeaders(loadUrlParams.getExtraHeadersString()); + openDownloadSuggestion(windowOpenDisposition, article, loadUrlParams); + }); + + return; } + LoadUrlParams loadUrlParams = + new LoadUrlParams(article.mUrl, PageTransition.AUTO_BOOKMARK); + // For article suggestions, we set the referrer. This is exploited // to filter out these history entries for NTP tiles. // TODO(mastiz): Extend this with support for other categories. @@ -151,6 +155,12 @@ if (loadingTab != null) SuggestionsMetrics.recordVisit(loadingTab, article); } + private void openDownloadSuggestion( + int windowOpenDisposition, SnippetArticle article, LoadUrlParams loadUrlParams) { + Tab loadingTab = openUrl(windowOpenDisposition, loadUrlParams); + if (loadingTab != null) SuggestionsMetrics.recordVisit(loadingTab, article); + } + @Override @Nullable public Tab openUrl(int windowOpenDisposition, LoadUrlParams loadUrlParams) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java index 09687d2b..f63749c9 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/InterceptNavigationDelegateImpl.java
@@ -98,6 +98,10 @@ return true; } + if (navigationParams.suggestedFilename != null) { + return false; + } + TabRedirectHandler tabRedirectHandler = null; if (navigationParams.isMainFrame) { tabRedirectHandler = mTab.getTabRedirectHandler();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java index 50aadb99..f1f0162 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkActivity.java
@@ -65,7 +65,7 @@ @Override protected void initializeUI(Bundle savedInstance) { super.initializeUI(savedInstance); - getActivityTab().setWebappManifestScope(mWebappInfo.scopeUri().toString()); + getActivityTab().setWebappManifestScope(getWebappInfo().scopeUri().toString()); } @Override @@ -120,7 +120,7 @@ protected void onDeferredStartupWithStorage(WebappDataStorage storage) { super.onDeferredStartupWithStorage(storage); - WebApkInfo info = (WebApkInfo) mWebappInfo; + WebApkInfo info = (WebApkInfo) getWebappInfo(); WebApkUma.recordShellApkVersion(info.shellApkVersion(), info.apkPackageName()); mUpdateManager = new WebApkUpdateManager(storage);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkDisclosureNotificationManager.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkDisclosureNotificationManager.java index 00e44f09..7c49d27 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkDisclosureNotificationManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkDisclosureNotificationManager.java
@@ -52,7 +52,7 @@ if (activityState == ActivityState.STARTED || activityState == ActivityState.RESUMED || activityState == ActivityState.PAUSED) { sVisibleNotifications.add(packageName); - WebApkDisclosureNotificationManager.showDisclosure(activity.mWebappInfo); + WebApkDisclosureNotificationManager.showDisclosure(activity.getWebappInfo()); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActionsNotificationManager.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActionsNotificationManager.java index af5882d7..59b932f0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActionsNotificationManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActionsNotificationManager.java
@@ -52,7 +52,7 @@ if (!isEnabled() || mWebappActivity.getActivityTab() == null) return; // All features provided by the notification are also available in the minimal-ui toolbar. - if (mWebappActivity.mWebappInfo.displayMode() == WebDisplayMode.MINIMAL_UI) { + if (mWebappActivity.getWebappInfo().displayMode() == WebDisplayMode.MINIMAL_UI) { return; } @@ -82,7 +82,7 @@ .createChromeNotificationBuilder( true /* prefer compat */, ChannelDefinitions.CHANNEL_ID_WEBAPP_ACTIONS) .setSmallIcon(R.drawable.ic_chrome) - .setContentTitle(mWebappActivity.mWebappInfo.shortName()) + .setContentTitle(mWebappActivity.getWebappInfo().shortName()) .setContentText(mWebappActivity.getString(R.string.webapp_tap_to_copy_url)) .setShowWhen(false) .setAutoCancel(false)
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java index 26bb763..a9088bb 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
@@ -104,7 +104,7 @@ private final WebappActionsNotificationManager mNotificationManager; private final WebappDirectoryManager mDirectoryManager; - protected WebappInfo mWebappInfo; + private WebappInfo mWebappInfo; private WebappSplashScreenController mSplashController; @@ -560,7 +560,7 @@ * @return Structure containing data about the webapp currently displayed. * The return value should not be cached. */ - WebappInfo getWebappInfo() { + public WebappInfo getWebappInfo() { return mWebappInfo; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappBrowserControlsDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappBrowserControlsDelegate.java index dc0ba02..0753652 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappBrowserControlsDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappBrowserControlsDelegate.java
@@ -67,11 +67,11 @@ */ static boolean shouldShowToolbarCloseButton(WebappActivity activity) { // Show if we're on the URL requiring browser controls, i.e. off-scope. - return shouldShowBrowserControlsForUrl(activity.scopePolicy(), activity.mWebappInfo, + return shouldShowBrowserControlsForUrl(activity.scopePolicy(), activity.getWebappInfo(), activity.getActivityTab().getUrl()) // Also keep shown if toolbar is not visible, so that during the in and off-scope // transitions we avoid button flickering when toolbar is appearing/disappearing. - || !shouldShowBrowserControls(activity.scopePolicy(), activity.mWebappInfo, + || !shouldShowBrowserControls(activity.scopePolicy(), activity.getWebappInfo(), activity.getActivityTab().getUrl(), activity.getActivityTab().getSecurityLevel(), activity.getBrowserSession() != null && activity.didVerificationFail());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInterceptNavigationDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInterceptNavigationDelegate.java index 168fc11e..a70cc02 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInterceptNavigationDelegate.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInterceptNavigationDelegate.java
@@ -90,9 +90,9 @@ navigationParams, mActivity.getWebappInfo(), mActivity.scopePolicy())) { CustomTabsIntent.Builder intentBuilder = new CustomTabsIntent.Builder(); intentBuilder.setShowTitle(true); - if (mActivity.mWebappInfo.hasValidThemeColor()) { + if (mActivity.getWebappInfo().hasValidThemeColor()) { // Need to cast as themeColor is a long to contain possible error results. - intentBuilder.setToolbarColor((int) mActivity.mWebappInfo.themeColor()); + intentBuilder.setToolbarColor((int) mActivity.getWebappInfo().themeColor()); } CustomTabsIntent customTabIntent = intentBuilder.build(); customTabIntent.intent.setPackage(mActivity.getPackageName()); @@ -101,7 +101,7 @@ customTabIntent.intent.putExtra(CustomTabIntentDataProvider.EXTRA_BROWSER_LAUNCH_SOURCE, mActivity.getActivityType()); customTabIntent.intent.putExtra( - Browser.EXTRA_APPLICATION_ID, mActivity.mWebappInfo.apkPackageName()); + Browser.EXTRA_APPLICATION_ID, mActivity.getWebappInfo().apkPackageName()); if (shouldCloseContentsOnOverrideUrlLoadingAndLaunchIntent()) { customTabIntent.intent.addFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK); @@ -128,7 +128,8 @@ static boolean shouldOpenInCustomTab( NavigationParams navigationParams, WebappInfo info, WebappScopePolicy scopePolicy) { return UrlUtilities.isValidForIntentFallbackNavigation(navigationParams.url) - && !navigationParams.isPost && !scopePolicy.isUrlInScope(info, navigationParams.url) + && !navigationParams.isPost && navigationParams.suggestedFilename == null + && !scopePolicy.isUrlInScope(info, navigationParams.url) && scopePolicy.openOffScopeNavsInCct(); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java index 26d8f40..40c0609f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java
@@ -192,7 +192,7 @@ continue; } WebappActivity webappActivity = (WebappActivity) activity; - if (!TextUtils.equals(webappActivity.mWebappInfo.id(), info.id())) { + if (!TextUtils.equals(webappActivity.getWebappInfo().id(), info.id())) { activity.finish(); } break;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java index 98850e8..f484d54 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheet.java
@@ -114,6 +114,46 @@ } /** + * A specialized FrameLayout that is capable of ignoring all user input based on the state of + * the bottom sheet. + */ + public static class TouchRestrictingFrameLayout extends FrameLayout { + /** A handle to the bottom sheet. */ + private BottomSheet mBottomSheet; + + public TouchRestrictingFrameLayout(Context context, AttributeSet atts) { + super(context, atts); + } + + /** + * @param sheet The bottom sheet. + */ + public void setBottomSheet(BottomSheet sheet) { + mBottomSheet = sheet; + } + + /** + * @return Whether touch is enabled. + */ + private boolean isTouchDisabled() { + return mBottomSheet == null || mBottomSheet.isRunningContentSwapAnimation() + || mBottomSheet.getSheetState() == BottomSheet.SHEET_STATE_SCROLLING; + } + + @Override + public boolean onInterceptTouchEvent(MotionEvent event) { + if (isTouchDisabled()) return false; + return super.onInterceptTouchEvent(event); + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + if (isTouchDisabled()) return false; + return super.onTouchEvent(event); + } + } + + /** * The base duration of the settling animation of the sheet. 218 ms is a spec for material * design (this is the minimum time a user is guaranteed to pay attention to something). */ @@ -216,7 +256,7 @@ private View mFindInPageView; /** A handle to the FrameLayout that holds the content of the bottom sheet. */ - private FrameLayout mBottomSheetContentContainer; + private TouchRestrictingFrameLayout mBottomSheetContentContainer; /** * The last ratio sent to observers of onTransitionPeekToHalf(). This is used to ensure the @@ -225,7 +265,7 @@ private float mLastPeekToHalfRatioSent; /** The FrameLayout used to hold the bottom sheet toolbar. */ - private FrameLayout mToolbarHolder; + private TouchRestrictingFrameLayout mToolbarHolder; /** * The default toolbar view. This is shown when the current bottom sheet content doesn't have @@ -683,7 +723,9 @@ getLayoutParams().height = ViewGroup.LayoutParams.MATCH_PARENT; - mBottomSheetContentContainer = (FrameLayout) findViewById(R.id.bottom_sheet_content); + mBottomSheetContentContainer = + (TouchRestrictingFrameLayout) findViewById(R.id.bottom_sheet_content); + mBottomSheetContentContainer.setBottomSheet(this); mBottomSheetContentContainer.setBackgroundColor( ApiCompatibilityUtils.getColor(getResources(), R.color.modern_primary_color)); @@ -789,7 +831,9 @@ } }); - mToolbarHolder = (FrameLayout) mControlContainer.findViewById(R.id.toolbar_holder); + mToolbarHolder = + (TouchRestrictingFrameLayout) mControlContainer.findViewById(R.id.toolbar_holder); + mToolbarHolder.setBottomSheet(this); mDefaultToolbarView = (BottomToolbarPhone) mControlContainer.findViewById(R.id.toolbar); mDefaultToolbarView.setActivity(mActivity); @@ -1468,6 +1512,13 @@ } /** + * @return Whether a content swap animation is in progress. + */ + public boolean isRunningContentSwapAnimation() { + return mContentSwapAnimatorSet != null && mContentSwapAnimatorSet.isRunning(); + } + + /** * @return The current sheet content, or null if there is no content. */ @VisibleForTesting
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java index 2643ffb0..4730657 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/widget/bottomsheet/BottomSheetContentController.java
@@ -103,8 +103,8 @@ private int mBottomNavHeight; private final Map<Integer, BottomSheetContent> mBottomSheetContents = new HashMap<>(); - private boolean mLabelsEnabled; + private boolean mDestroyed; private final BottomSheetObserver mBottomSheetObserver = new EmptyBottomSheetObserver() { @Override @@ -228,6 +228,7 @@ /** Called when the activity containing the bottom sheet is destroyed. */ public void destroy() { + mDestroyed = true; clearBottomSheetContents(true); if (mPlaceholderContent != null) { mPlaceholderContent.destroy(); @@ -239,6 +240,20 @@ } } + @Override + public void onFinishInflate() { + BrowserStartupController.get(LibraryProcessType.PROCESS_BROWSER) + .addStartupCompletedObserver(new BrowserStartupController.StartupCallback() { + @Override + public void onSuccess(boolean alreadyStarted) { + initBottomNavMenu(); + } + + @Override + public void onFailure() {} + }); + } + /** * Initializes the {@link BottomSheetContentController}. * @param bottomSheet The {@link BottomSheet} associated with this bottom nav. @@ -252,17 +267,6 @@ mActivity = activity; mTabModelSelector = tabModelSelector; - BrowserStartupController.get(LibraryProcessType.PROCESS_BROWSER) - .addStartupCompletedObserver(new BrowserStartupController.StartupCallback() { - @Override - public void onSuccess(boolean alreadyStarted) { - initBottomNavMenu(); - } - - @Override - public void onFailure() {} - }); - mTabModelSelectorObserver = new EmptyTabModelSelectorObserver() { @Override public void onTabModelSelected(TabModel newModel, TabModel oldModel) { @@ -347,6 +351,8 @@ * Needs to be called after the native library is loaded. */ private void initializeMenuView() { + if (mDestroyed) return; + mLabelsEnabled = ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME_BOTTOM_NAV_LABELS); if (mLabelsEnabled) {
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index 9d87fc7..32ea33d 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -45,7 +45,6 @@ "java/src/org/chromium/chrome/browser/IntentHelper.java", "java/src/org/chromium/chrome/browser/ItemChooserDialog.java", "java/src/org/chromium/chrome/browser/JavascriptAppModalDialog.java", - "java/src/org/chromium/chrome/browser/JavascriptTabModalDialog.java", "java/src/org/chromium/chrome/browser/KeyboardShortcuts.java", "java/src/org/chromium/chrome/browser/DelayedScreenLockIntentHandler.java", "java/src/org/chromium/chrome/browser/LaunchIntentDispatcher.java", @@ -440,6 +439,7 @@ "java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunFragment.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunPage.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunPageDelegate.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunPagerAdapter.java", @@ -561,6 +561,7 @@ "java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java", "java/src/org/chromium/chrome/browser/invalidation/UniqueIdInvalidationClientNameGenerator.java", "java/src/org/chromium/chrome/browser/jsdialog/JavascriptModalDialogView.java", + "java/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialog.java", "java/src/org/chromium/chrome/browser/locale/DefaultSearchEngineDialogHelper.java", "java/src/org/chromium/chrome/browser/locale/DefaultSearchEnginePromoDialog.java", "java/src/org/chromium/chrome/browser/locale/LocaleManager.java", @@ -603,12 +604,14 @@ "java/src/org/chromium/chrome/browser/media/router/cast/CastSession.java", "java/src/org/chromium/chrome/browser/media/router/cast/CastSessionImpl.java", "java/src/org/chromium/chrome/browser/media/router/cast/CastSessionInfo.java", + "java/src/org/chromium/chrome/browser/media/router/cast/CastSessionUtil.java", "java/src/org/chromium/chrome/browser/media/router/cast/ChromeCastSessionManager.java", "java/src/org/chromium/chrome/browser/media/router/cast/ClientRecord.java", "java/src/org/chromium/chrome/browser/media/router/cast/CreateRouteRequest.java", "java/src/org/chromium/chrome/browser/media/router/cast/DiscoveryCallback.java", "java/src/org/chromium/chrome/browser/media/router/cast/MediaSink.java", "java/src/org/chromium/chrome/browser/media/router/cast/MediaSource.java", + "java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingCastSession.java", "java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaRouteProvider.java", "java/src/org/chromium/chrome/browser/media/router/cast/remoting/RemotingMediaSource.java", "java/src/org/chromium/chrome/browser/media/ui/MediaButtonReceiver.java", @@ -1588,6 +1591,7 @@ "javatests/src/org/chromium/chrome/browser/invalidation/ChromeBrowserSyncAdapterTest.java", "javatests/src/org/chromium/chrome/browser/invalidation/DelayedInvalidationsControllerTest.java", "javatests/src/org/chromium/chrome/browser/invalidation/InvalidationServiceTest.java", + "javatests/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialogTest.java", "javatests/src/org/chromium/chrome/browser/locale/DefaultSearchEngineDialogHelperTest.java", "javatests/src/org/chromium/chrome/browser/locale/DefaultSearchEngineDialogHelperUtils.java", "javatests/src/org/chromium/chrome/browser/locale/DefaultSearchEnginePromoDialogTest.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/RestoreHistogramTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/RestoreHistogramTest.java index 2b5af698..edf6354 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/RestoreHistogramTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/RestoreHistogramTest.java
@@ -17,7 +17,6 @@ import org.chromium.base.library_loader.LibraryLoader; import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; -import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.MetricsUtils; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; @@ -59,7 +58,6 @@ @SmallTest public void testHistogramWriter() throws ProcessInitException { LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized(); - RecordHistogram.initialize(); MetricsUtils.HistogramDelta noRestoreDelta = new MetricsUtils.HistogramDelta( ChromeBackupAgent.HISTOGRAM_ANDROID_RESTORE_RESULT, ChromeBackupAgent.NO_RESTORE); MetricsUtils.HistogramDelta restoreCompletedDelta = @@ -101,7 +99,6 @@ @SmallTest public void testWritingHistogramAtStartup() throws InterruptedException, ProcessInitException { LibraryLoader.get(LibraryProcessType.PROCESS_BROWSER).ensureInitialized(); - RecordHistogram.initialize(); MetricsUtils.HistogramDelta noRestoreDelta = new MetricsUtils.HistogramDelta( ChromeBackupAgent.HISTOGRAM_ANDROID_RESTORE_RESULT, ChromeBackupAgent.NO_RESTORE);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java index 6bf109bd..f6799a0 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/TabsTest.java
@@ -426,6 +426,7 @@ @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) @Feature({"Android-TabSwitcher"}) @RetryOnFailure + @DisabledTest(message = "crbug.com/799728") public void testTabSwitcherCollapseSelection() throws Exception { mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext()); ChromeTabUtils.fullyLoadUrlInNewTab(InstrumentationRegistry.getInstrumentation(),
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java index d775c6c9..6f4851e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchFakeServer.java
@@ -624,6 +624,9 @@ QuickActionCategory.NONE)); registerFakeTapSearch(new FakeTapSearch("german", false, 200, "Deutsche", "Deutsche", "alternate-term", "", false, 0, 0, "de", "", "", "", QuickActionCategory.NONE)); + registerFakeTapSearch(new FakeTapSearch("intelligence", false, 200, "Intelligence", + "Intelligence", "alternate-term", "", false, 0, 0, "", "", "", "", + QuickActionCategory.NONE)); // Register a resolving search of "States" that expands to "United States". registerFakeSlowResolveSearch(new FakeSlowResolveSearch("states", false, 200, "States",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateControllerWrapper.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateControllerWrapper.java index fb26d2c9..9f1ab811 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateControllerWrapper.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateControllerWrapper.java
@@ -15,11 +15,11 @@ */ class ContextualSearchInternalStateControllerWrapper extends ContextualSearchInternalStateController { - static final List<InternalState> EXPECTED_TAP_RESOLVE_SEQUENCE = - CollectionUtil.newArrayList(InternalState.SELECTION_CLEARED_RECOGNIZED, - InternalState.TAP_RECOGNIZED, InternalState.GATHERING_SURROUNDINGS, - InternalState.DECIDING_SUPPRESSION, InternalState.START_SHOWING_TAP_UI, - InternalState.SHOW_FULL_TAP_UI, InternalState.RESOLVING); + static final List<InternalState> EXPECTED_TAP_RESOLVE_SEQUENCE = CollectionUtil.newArrayList( + InternalState.SELECTION_CLEARED_RECOGNIZED, InternalState.TAP_RECOGNIZED, + InternalState.TAP_GESTURE_COMMIT, InternalState.GATHERING_SURROUNDINGS, + InternalState.DECIDING_SUPPRESSION, InternalState.START_SHOWING_TAP_UI, + InternalState.SHOW_FULL_TAP_UI, InternalState.RESOLVING); static final List<InternalState> EXPECTED_LONGPRESS_SEQUENCE = CollectionUtil.newArrayList(InternalState.LONG_PRESS_RECOGNIZED, InternalState.GATHERING_SURROUNDINGS, InternalState.SHOWING_LONGPRESS_SEARCH);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java index 5a29dc58..d956dee 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
@@ -863,20 +863,6 @@ } /** - * Waits for the manager to finish processing a gesture. - * Tells the manager that a gesture has started, and then waits for it to complete. - */ - private void waitForGestureProcessing() { - CriteriaHelper.pollInstrumentationThread( - new Criteria("Gesture processing did not complete.") { - @Override - public boolean isSatisfied() { - return !mSelectionController.wasAnyTapGestureDetected(); - } - }, TEST_TIMEOUT, DEFAULT_POLLING_INTERVAL); - } - - /** * Shorthand for a common sequence: * 1) Waits for gesture processing, * 2) Waits for the panel to close, @@ -884,7 +870,6 @@ * @throws InterruptedException */ private void waitForGestureToClosePanelAndAssertNoSelection() throws InterruptedException { - waitForGestureProcessing(); waitForPanelToClose(); assertPanelClosedOrUndefined(); Assert.assertTrue(TextUtils.isEmpty(getSelectedText())); @@ -999,6 +984,8 @@ */ private void tapBasePageToClosePanel() throws InterruptedException { // TODO(pedrosimonetti): This is not reliable. Find a better approach. + // This taps on the panel in an area that will be selected if the "intelligence" node has + // been tap-selected, and that will cause it to be long-press selected. // We use the far right side (x == 0.9f) to prevent simulating a tap on top of an // existing long-press selection (the pins are a tap target). This might not work on RTL. // We are using y == 0.35f because otherwise it will fail for long press cases. @@ -1151,30 +1138,31 @@ assertWaitForSelectActionBarVisible(true); } - /** @return The value of the given logged feature, or {@code null} if not logged. */ - private Object loggedToRanker(ContextualSearchRankerLogger.Feature feature) { + /** Gets the Ranker Logger and asserts if we can't. **/ + private ContextualSearchRankerLoggerImpl getRankerLogger() { ContextualSearchRankerLoggerImpl rankerLogger = (ContextualSearchRankerLoggerImpl) mManager.getRankerLogger(); Assert.assertNotNull(rankerLogger); - return rankerLogger.getFeaturesLogged().get(feature); + return rankerLogger; } - /** Asserts that the given feature has been logged to Ranker. **/ - private void assertLoggedToRanker(ContextualSearchRankerLogger.Feature feature) { - Assert.assertNotNull(loggedToRanker(feature)); + /** @return The value of the given logged feature, or {@code null} if not logged. */ + private Object loggedToRanker(ContextualSearchRankerLogger.Feature feature) { + return getRankerLogger().getFeaturesLogged().get(feature); } /** Asserts that all the expected features have been logged to Ranker. **/ private void assertLoggedAllExpectedFeaturesToRanker() { for (ContextualSearchRankerLogger.Feature feature : EXPECTED_RANKER_FEATURES) { - assertLoggedToRanker(feature); + Assert.assertNotNull(loggedToRanker(feature)); } } /** Asserts that all the expected outcomes have been logged to Ranker. **/ private void assertLoggedAllExpectedOutcomesToRanker() { for (ContextualSearchRankerLogger.Feature feature : EXPECTED_RANKER_OUTCOMES) { - assertLoggedToRanker(feature); + Assert.assertNotNull("Expected this outcome to be logged: " + feature, + getRankerLogger().getOutcomesLogged().get(feature)); } } @@ -1253,19 +1241,17 @@ @SmallTest @Feature({"ContextualSearch"}) public void testTap() throws InterruptedException, TimeoutException { - clickWordNode("intelligence"); - - Assert.assertEquals("Intelligence", mFakeServer.getSearchTermRequested()); - fakeResponse(false, 200, "Intelligence", "display-text", "alternate-term", false); - assertContainsParameters("Intelligence", "alternate-term"); - waitForPanelToPeek(); + simulateTapSearch("intelligence"); assertLoadedLowPriorityUrl(); assertLoggedAllExpectedFeaturesToRanker(); Assert.assertEquals( true, loggedToRanker(ContextualSearchRankerLogger.Feature.IS_LONG_WORD)); // The panel must be closed for outcomes to be logged. - closePanel(); + // Close the panel by clicking far away in order to make sure the outcomes get logged by + // the hideContextualSearchUi call to writeRankerLoggerOutcomesAndReset. + clickWordNode("states-far"); + waitForPanelToClose(); assertLoggedAllExpectedOutcomesToRanker(); } @@ -1458,7 +1444,6 @@ waitForPanelToPeek(); assertLoadedNoUrl(); // No load after long-press until opening panel. clickNode("question-mark"); - waitForGestureProcessing(); waitForPanelToCloseAndSelectionEmpty(); Assert.assertTrue(TextUtils.isEmpty(getSelectedText())); assertLoadedNoUrl(); @@ -1491,7 +1476,6 @@ public void testTapGestureOnSpecialCharacterDoesntSelect() throws InterruptedException, TimeoutException { clickNode("question-mark"); - waitForGestureProcessing(); Assert.assertNull(getSelectedText()); assertPanelClosedOrUndefined(); assertLoadedNoUrl(); @@ -1560,13 +1544,12 @@ waitForPanelToClose(); Assert.assertNull(getSelectedText()); clickNode("states-far"); - waitForGestureProcessing(); waitForPanelToPeek(); Assert.assertEquals("States", getSelectedText()); } /** - * Tests that sequential Tap gestures nearby keep selecting. + * Tests a "retap" -- that sequential Tap gestures nearby keep selecting. */ @Test @SmallTest @@ -1575,6 +1558,7 @@ clickWordNode("states"); Assert.assertEquals("States", getSelectedText()); waitForPanelToPeek(); + assertLoggedAllExpectedFeaturesToRanker(); // Avoid issues with double-tap detection by ensuring sequential taps // aren't treated as such. Double-tapping can also select words much as // longpress, in turn showing the pins and preventing contextual tap @@ -1586,9 +1570,12 @@ // for the selection to change. clickNode("states-near"); waitForSelectionToBe("StatesNear"); + assertLoggedAllExpectedOutcomesToRanker(); + assertLoggedAllExpectedFeaturesToRanker(); Thread.sleep(ViewConfiguration.getDoubleTapTimeout()); clickNode("states"); waitForSelectionToBe("States"); + assertLoggedAllExpectedOutcomesToRanker(); } /** @@ -2372,7 +2359,7 @@ "intent://test/#Intent;scheme=test;package=com.chrome.test;end", "", false /* isPost */, true /* hasUserGesture */, PageTransition.LINK, false /* isRedirect */, true /* isExternalProtocol */, true /* isMainFrame */, - false /* hasUserGestureCarryover */); + null /* suggestedFilename */, false /* hasUserGestureCarryover */); InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { @@ -2397,12 +2384,12 @@ final NavigationParams initialNavigationParams = new NavigationParams("http://test.com", "", false /* isPost */, true /* hasUserGesture */, PageTransition.LINK, false /* isRedirect */, false /* isExternalProtocol */, true /* isMainFrame */, - false /* hasUserGestureCarryover */); + null /* suggestedFilename */, false /* hasUserGestureCarryover */); final NavigationParams redirectedNavigationParams = new NavigationParams( "intent://test/#Intent;scheme=test;package=com.chrome.test;end", "", false /* isPost */, false /* hasUserGesture */, PageTransition.LINK, true /* isRedirect */, true /* isExternalProtocol */, true /* isMainFrame */, - false /* hasUserGestureCarryover */); + null /* suggestedFilename */, false /* hasUserGestureCarryover */); InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override @@ -2431,7 +2418,7 @@ "intent://test/#Intent;scheme=test;package=com.chrome.test;end", "", false /* isPost */, false /* hasUserGesture */, PageTransition.LINK, false /* isRedirect */, true /* isExternalProtocol */, true /* isMainFrame */, - false /* hasUserGestureCarryover */); + null /* suggestedFilename */, false /* hasUserGestureCarryover */); InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java index caddec1..6d4b5e7 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/ClientManagerTest.java
@@ -20,7 +20,6 @@ import org.chromium.base.ContextUtils; import org.chromium.base.ThreadUtils; -import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.BaseJUnit4ClassRunner; import org.chromium.base.test.util.MetricsUtils; import org.chromium.base.test.util.RetryOnFailure; @@ -53,7 +52,6 @@ mActivityTestRule.loadNativeLibraryNoBrowserProcess(); RequestThrottler.purgeAllEntriesForTesting(context); mClientManager = new ClientManager(context); - RecordHistogram.initialize(); ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() {
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialogTest.java new file mode 100644 index 0000000..51947a3 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialogTest.java
@@ -0,0 +1,323 @@ +// Copyright 2018 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.jsdialog; + +import static android.support.test.espresso.Espresso.onView; +import static android.support.test.espresso.action.ViewActions.click; +import static android.support.test.espresso.action.ViewActions.replaceText; +import static android.support.test.espresso.assertion.ViewAssertions.matches; +import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; +import static android.support.test.espresso.matcher.ViewMatchers.isFocusable; +import static android.support.test.espresso.matcher.ViewMatchers.withId; +import static android.support.test.espresso.matcher.ViewMatchers.withText; + +import static org.hamcrest.Matchers.not; + +import android.support.test.espresso.Espresso; +import android.support.test.filters.MediumTest; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; + +import org.chromium.base.ThreadUtils; +import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.Feature; +import org.chromium.base.test.util.Restriction; +import org.chromium.base.test.util.UrlUtils; +import org.chromium.chrome.R; +import org.chromium.chrome.browser.ChromeSwitches; +import org.chromium.chrome.browser.ChromeTabbedActivity; +import org.chromium.chrome.browser.modaldialog.ModalDialogView; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.content.browser.test.util.Criteria; +import org.chromium.content.browser.test.util.CriteriaHelper; +import org.chromium.content.browser.test.util.TestCallbackHelperContainer.OnEvaluateJavaScriptResultHelper; +import org.chromium.content_public.browser.LoadUrlParams; +import org.chromium.ui.base.PageTransition; +import org.chromium.ui.test.util.UiRestriction; + +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +/** + * Test suite for displaying and functioning of JavaScript tab modal dialogs. Some of the tests + * are identical to ModalDialogTest.java and some are for tab-modal features. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@CommandLineFlags. +Add({"enable-features=TabModalJsDialog", ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE}) +public class JavascriptTabModalDialogTest { + @Rule + public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule(); + + private static final String TAG = "JsTabModalDialogTest"; + private static final String EMPTY_PAGE = UrlUtils.encodeHtmlDataUri( + "<html><title>Modal Dialog Test</title><p>Testcase.</p></title></html>"); + private static final String OTHER_PAGE = UrlUtils.encodeHtmlDataUri( + "<html><title>Modal Dialog Test</title><p>Testcase. Other tab.</p></title></html>"); + + private ChromeTabbedActivity mActivity; + + @Before + public void setUp() throws InterruptedException { + mActivityTestRule.startMainActivityWithURL(EMPTY_PAGE); + mActivity = mActivityTestRule.getActivity(); + } + + /** + * Verifies modal alert-dialog appearance and that JavaScript execution is + * able to continue after dismissal. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + public void testAlertModalDialog() + throws InterruptedException, TimeoutException, ExecutionException { + final OnEvaluateJavaScriptResultHelper scriptEvent = + executeJavaScriptAndWaitForDialog("alert('Hello Android!');"); + + JavascriptTabModalDialog jsDialog = getCurrentDialog(); + Assert.assertNotNull("No dialog showing.", jsDialog); + + onView(withText(R.string.ok)).perform(click()); + Assert.assertTrue("JavaScript execution should continue after closing prompt.", + scriptEvent.waitUntilHasValue()); + } + + /** + * Verifies that clicking on a button twice doesn't crash. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + public void testAlertModalDialogWithTwoClicks() + throws InterruptedException, TimeoutException, ExecutionException { + OnEvaluateJavaScriptResultHelper scriptEvent = + executeJavaScriptAndWaitForDialog("alert('Hello Android');"); + JavascriptTabModalDialog jsDialog = getCurrentDialog(); + Assert.assertNotNull("No dialog showing.", jsDialog); + + ThreadUtils.runOnUiThreadBlocking(() -> { + jsDialog.onClick(ModalDialogView.BUTTON_POSITIVE); + jsDialog.onClick(ModalDialogView.BUTTON_POSITIVE); + }); + + Assert.assertTrue("JavaScript execution should continue after closing prompt.", + scriptEvent.waitUntilHasValue()); + } + + /** + * Verifies that modal confirm-dialogs display, two buttons are visible and + * the return value of [Ok] equals true, [Cancel] equals false. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + public void testConfirmModalDialog() + throws InterruptedException, TimeoutException, ExecutionException { + OnEvaluateJavaScriptResultHelper scriptEvent = + executeJavaScriptAndWaitForDialog("confirm('Android');"); + + JavascriptTabModalDialog jsDialog = getCurrentDialog(); + Assert.assertNotNull("No dialog showing.", jsDialog); + + onView(withText(R.string.ok)).check(matches(isDisplayed())); + onView(withText(R.string.cancel)).check(matches(isDisplayed())); + + onView(withText(R.string.ok)).perform(click()); + Assert.assertTrue("JavaScript execution should continue after closing dialog.", + scriptEvent.waitUntilHasValue()); + + String resultString = scriptEvent.getJsonResultAndClear(); + Assert.assertEquals("Invalid return value.", "true", resultString); + + // Try again, pressing cancel this time. + scriptEvent = executeJavaScriptAndWaitForDialog("confirm('Android');"); + jsDialog = getCurrentDialog(); + Assert.assertNotNull("No dialog showing.", jsDialog); + + onView(withText(R.string.cancel)).perform(click()); + Assert.assertTrue("JavaScript execution should continue after closing dialog.", + scriptEvent.waitUntilHasValue()); + + resultString = scriptEvent.getJsonResultAndClear(); + Assert.assertEquals("Invalid return value.", "false", resultString); + } + + /** + * Verifies that modal prompt-dialogs display and the result is returned. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + public void testPromptModalDialog() + throws InterruptedException, TimeoutException, ExecutionException { + final String promptText = "Hello Android!"; + final OnEvaluateJavaScriptResultHelper scriptEvent = + executeJavaScriptAndWaitForDialog("prompt('Android', 'default');"); + + final JavascriptTabModalDialog jsDialog = getCurrentDialog(); + Assert.assertNotNull("No dialog showing.", jsDialog); + + // Set the text in the prompt field of the dialog. + onView(withId(R.id.js_modal_dialog_prompt)).perform(replaceText(promptText)); + + onView(withText(R.string.ok)).perform(click()); + Assert.assertTrue("JavaScript execution should continue after closing prompt.", + scriptEvent.waitUntilHasValue()); + + String resultString = scriptEvent.getJsonResultAndClear(); + Assert.assertEquals("Invalid return value.", '"' + promptText + '"', resultString); + } + + /** + * Verifies that message content in a dialog is only focusable if the message itself is long + * enough to require scrolling. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + public void testAlertModalDialogMessageFocus() + throws InterruptedException, TimeoutException, ExecutionException { + assertScrollViewFocusabilityInAlertDialog("alert('Short message!');", false); + + assertScrollViewFocusabilityInAlertDialog( + "alert(new Array(200).join('Long message!'));", true); + } + + private void assertScrollViewFocusabilityInAlertDialog( + final String jsAlertScript, final boolean expectedFocusability) + throws InterruptedException, TimeoutException, ExecutionException { + final OnEvaluateJavaScriptResultHelper scriptEvent = + executeJavaScriptAndWaitForDialog(jsAlertScript); + + final JavascriptTabModalDialog jsDialog = getCurrentDialog(); + Assert.assertNotNull("No dialog showing.", jsDialog); + + onView(withId(R.id.js_modal_dialog_scroll_view)) + .check(matches(expectedFocusability ? isFocusable() : not(isFocusable()))); + + onView(withText(R.string.ok)).perform(click()); + Assert.assertTrue("JavaScript execution should continue after closing prompt.", + scriptEvent.waitUntilHasValue()); + } + + /** + * Displays a dialog and closes the tab in the background before attempting + * to accept the dialog. Verifies that the dialog is dismissed when the tab + * is closed. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + public void testDialogDismissedAfterClosingTab() { + executeJavaScriptAndWaitForDialog("alert('Android')"); + + ThreadUtils.runOnUiThreadBlocking( + () -> { mActivity.getCurrentTabModel().closeTab(mActivity.getActivityTab()); }); + + // Closing the tab should have dismissed the dialog. + checkDialogShowing("The dialog should have been dismissed when its tab was closed.", false); + } + + /** + * Displays a dialog and goes to tab switcher in the before attempting to accept or cancel the + * dialog. Verifies that the dialog is dismissed. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) + public void testDialogDismissedAfterToggleOverview() { + executeJavaScriptAndWaitForDialog("alert('Android')"); + + onView(withId(R.id.tab_switcher_button)).perform(click()); + + // Entering tab switcher should have dismissed the dialog. + checkDialogShowing( + "The dialog should have been dismissed when switching to overview mode.", false); + } + + /** + * Displays a dialog and loads a new URL before attempting to accept or cancel the + * dialog. Verifies that the dialog is dismissed. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + public void testDialogDismissedAfterUrlUpdated() { + executeJavaScriptAndWaitForDialog("alert('Android')"); + + ThreadUtils.runOnUiThreadBlocking(() -> { + mActivity.getActivityTab().loadUrl(new LoadUrlParams(OTHER_PAGE, PageTransition.LINK)); + }); + + // Loading a different URL should have dismissed the dialog. + checkDialogShowing( + "The dialog should have been dismissed when a new url is loaded.", false); + } + + /** + * Displays a dialog and performs back press before attempting to accept or cancel the + * dialog. Verifies that the dialog is dismissed. + */ + @Test + @MediumTest + @Feature({"Browser", "Main"}) + public void testDialogDismissedAfterBackPressed() { + executeJavaScriptAndWaitForDialog("alert('Android')"); + + Espresso.pressBack(); + + // Performing back press should have dismissed the dialog. + checkDialogShowing("The dialog should have been dismissed after back press.", false); + } + + /** + * Asynchronously executes the given code for spawning a dialog and waits + * for the dialog to be visible. + */ + private OnEvaluateJavaScriptResultHelper executeJavaScriptAndWaitForDialog(String script) { + return executeJavaScriptAndWaitForDialog(new OnEvaluateJavaScriptResultHelper(), script); + } + + /** + * Given a JavaScript evaluation helper, asynchronously executes the given + * code for spawning a dialog and waits for the dialog to be visible. + */ + private OnEvaluateJavaScriptResultHelper executeJavaScriptAndWaitForDialog( + final OnEvaluateJavaScriptResultHelper helper, String script) { + helper.evaluateJavaScriptForTests( + mActivity.getCurrentContentViewCore().getWebContents(), script); + checkDialogShowing("Could not spawn or locate a modal dialog.", true); + return helper; + } + + /** + * Returns the current JavaScript modal dialog showing or null if no such dialog is currently + * showing. + */ + private JavascriptTabModalDialog getCurrentDialog() throws ExecutionException { + return (JavascriptTabModalDialog) ThreadUtils.runOnUiThreadBlocking( + () -> mActivity.getModalDialogManager().getCurrentDialogForTest().getController()); + } + + /** + * Check whether dialog is showing as expected. + */ + private void checkDialogShowing(final String errorMessage, final boolean shouldBeShown) { + CriteriaHelper.pollUiThread(new Criteria(errorMessage) { + @Override + public boolean isSatisfied() { + final boolean isShown = mActivity.getModalDialogManager().isShowing(); + return shouldBeShown == isShown; + } + }); + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/modaldialog/ModalDialogManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/modaldialog/ModalDialogManagerTest.java index b3745d4..2cf681d1 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/modaldialog/ModalDialogManagerTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/modaldialog/ModalDialogManagerTest.java
@@ -30,11 +30,13 @@ import org.chromium.base.ThreadUtils; import org.chromium.base.test.util.CommandLineFlags; +import org.chromium.base.test.util.Restriction; import org.chromium.chrome.R; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.ChromeTabbedActivity; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.ui.test.util.UiRestriction; /** * Tests for displaying and functioning of modal dialogs on tabs. @@ -250,6 +252,7 @@ @Test @SmallTest + @Restriction(UiRestriction.RESTRICTION_TYPE_PHONE) public void testDismiss_ToggleOverview() throws Exception { // Initially there are no dialogs in the pending list. Browser controls are not restricted. checkPendingSize(0);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferencesTest.java index 9615fd8..32eccfb 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferencesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/password/SavePasswordsPreferencesTest.java
@@ -278,7 +278,7 @@ @Test @SmallTest @Feature({"Preferences"}) - @EnableFeatures("password-export") + @EnableFeatures("PasswordExport") public void testExportMenuDisabled() throws Exception { // Ensure there are no saved passwords reported to settings. setPasswordSource(null); @@ -304,7 +304,7 @@ @Test @SmallTest @Feature({"Preferences"}) - @EnableFeatures("password-export") + @EnableFeatures("PasswordExport") public void testExportMenuEnabled() throws Exception { setPasswordSource(new SavedPasswordEntry("https://example.com", "test user", "password")); @@ -324,7 +324,7 @@ } /** - * Check that if "password-export" feature is not explicitly enabled, there is no menu item to + * Check that if "PasswordExport" feature is not explicitly enabled, there is no menu item to * export passwords. * TODO(crbug.com/788701): Add the @DisableFeatures annotation once exporting gets enabled by * default, and remove completely once the feature is gone. @@ -355,7 +355,7 @@ @Test @SmallTest @Feature({"Preferences"}) - @EnableFeatures("password-export") + @EnableFeatures("PasswordExport") @DisabledTest(message = "crbug.com/796939") public void testExportMenuItem() throws Exception { setPasswordSource(new SavedPasswordEntry("https://example.com", "test user", "password")); @@ -386,7 +386,7 @@ @Test @SmallTest @Feature({"Preferences"}) - @EnableFeatures("password-export") + @EnableFeatures("PasswordExport") @DisabledTest(message = "crbug.com/796939") public void testExportMenuItemNoLock() throws Exception { setPasswordSource(new SavedPasswordEntry("https://example.com", "test user", "password"));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java index a37900b..0242704 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java
@@ -442,14 +442,16 @@ "https://somewebapp.com" /* referrer */, true /* isPost */, true /* hasUserGesture */, PageTransition.FORM_SUBMIT, false /* isRedirect */, false /* isExternalProtocol */, - true /* isMainFrame */, true /* hasUserGestureCarryover */), + true /* isMainFrame */, null /* suggestedFilename */, + true /* hasUserGestureCarryover */), info, WebappScopePolicy.STRICT)); Assert.assertTrue(WebappInterceptNavigationDelegate.shouldOpenInCustomTab( NavigationParams.create("https://otherdomain.com", "https://somewebapp.com" /* referrer */, false /* isPost */, true /* hasUserGesture */, PageTransition.FORM_SUBMIT, false /* isRedirect */, false /* isExternalProtocol */, - true /* isMainFrame */, true /* hasUserGestureCarryover */), + true /* isMainFrame */, null /* suggestedFilename */, + true /* hasUserGestureCarryover */), info, WebappScopePolicy.STRICT)); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateTest.java index e91ab55..ea34e07 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchInternalStateTest.java
@@ -46,6 +46,11 @@ } @Override + public void tapGestureCommit() { + stubForWorkOnState(InternalState.TAP_GESTURE_COMMIT); + } + + @Override public void gatherSurroundingText() { stubForWorkOnState(InternalState.GATHERING_SURROUNDINGS); }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandlerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandlerTest.java index 416f285..661b1fe0 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandlerTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/media/router/cast/CastMessageHandlerTest.java
@@ -60,7 +60,7 @@ private static final String INVALID_CLIENT_ID = "xxxxxxxxxxxxxxxxx"; private static final String NAMESPACE1 = "namespace1"; private static final String NAMESPACE2 = "namespace2"; - private static final String MEDIA_NAMESPACE = CastMessageHandler.MEDIA_NAMESPACE; + private static final String MEDIA_NAMESPACE = CastSessionUtil.MEDIA_NAMESPACE; private static final int SEQUENCE_NUMBER1 = 1; private static final int SEQUENCE_NUMBER2 = 2; private static final int REQUEST_ID1 = 1; @@ -280,10 +280,10 @@ } else { expected.put("type", messageType); } - verify(mMessageHandler).sendJsonCastMessage( - argThat(new JSONObjectLike(expected)), - eq(CastMessageHandler.MEDIA_NAMESPACE), - eq(CLIENT_ID1), eq(SEQUENCE_NUMBER1)); + verify(mMessageHandler) + .sendJsonCastMessage(argThat(new JSONObjectLike(expected)), + eq(CastSessionUtil.MEDIA_NAMESPACE), eq(CLIENT_ID1), + eq(SEQUENCE_NUMBER1)); } }
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index fa63a4f0..ba47751 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc
@@ -15,7 +15,6 @@ #include "base/lazy_instance.h" #include "base/macros.h" #include "base/message_loop/message_loop.h" -#include "base/metrics/statistics_recorder.h" #include "base/path_service.h" #include "base/process/memory.h" #include "base/process/process_handle.h" @@ -638,10 +637,6 @@ if ((base::SysInfo::IsRunningOnChromeOS() && command_line.HasSwitch(chromeos::switches::kLoginUser)) || command_line.HasSwitch(switches::kDiagnosticsRecovery)) { - // The statistics subsystem needs get initialized soon enough for the - // statistics to be collected. It's safe to call this more than once. - base::StatisticsRecorder::Initialize(); - base::CommandLine interim_command_line(command_line.GetProgram()); const char* const kSwitchNames[] = {switches::kUserDataDir, }; interim_command_line.CopySwitchesFrom(
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd index 7e69045c..f7683d7c 100644 --- a/chrome/app/chromium_strings.grd +++ b/chrome/app/chromium_strings.grd
@@ -393,7 +393,7 @@ Uninstall </message> </if> - <message name="IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT" desc="More compact text to show in the default browser query infobar."> + <message name="IDS_DEFAULT_BROWSER_INFOBAR_TEXT" desc="Text to show in an infobar when Chromium is not the current default browser."> Chromium isn't your default browser. </message> <if expr="chromeos"> @@ -477,11 +477,6 @@ </message> </if> - <!-- Obsolete System info bar --> - <message name="IDS_SYSTEM_OBSOLETE_MESSAGE" desc="Message shown when your OS is no longer supported. This message is followed by a 'Learn more' link."> - Chromium has stopped updating and no longer supports this version of your operating system. - </message> - <!-- Google API keys info bar --> <message name="IDS_MISSING_GOOGLE_API_KEYS" desc="Message shown when Google API keys are missing. This message is followed by a 'Learn more' link."> Google API keys are missing. Some functionality of Chromium will be disabled. @@ -1122,20 +1117,6 @@ </message> </if> - <!-- Framebust / Blocked Redirection intervention message --> - <if expr="not is_android"> - <!-- Android strings are not product specific and declared in android_chrome_strings.grd. --> - <message name="IDS_REDIRECT_BLOCKED_MESSAGE" desc="The message stating that a redirect (noun) was blocked on this page. This will be followed on a separate line with the address the user was being redirected to."> - Chromium stopped this site from taking you to - </message> - <message name="IDS_REDIRECT_BLOCKED_TITLE" desc="The short message stating that a redirect (noun) was blocked on this page. Same as IDS_REDIRECT_BLOCKED_SHORT_MESSAGE but without the period."> - Redirect blocked - </message> - <message name="IDS_REDIRECT_BLOCKED_TOOLTIP" desc="Tooltip text that appears when the user hovers over the "Redirect blocked" icon in the address bar. It means that a redirect (noun) was blocked by Chrome on this page."> - Redirect blocked on this page. - </message> - </if> - <!-- OOM intervention message --> <if expr="is_android"> <message name="IDS_NEAR_OOM_INTERVENTION_MESSAGE" desc="The message stating that the browser intervened to stop the page using too much memory.">
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index a3e87df..1b36b60d 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -1189,6 +1189,9 @@ Show all </message> </if> + <message name="IDS_DOWNLOAD_STARTED" desc="Message announced to screenreader users when a download starts."> + Download started + </message> <!-- Download Error Messages--> <!-- *_STATUS_*: Short message in the download on the shelf.--> <!-- *_DESCRIPTION_*: Corresponding more descriptive message on the download page.--> @@ -3320,7 +3323,7 @@ Patch Service </message> - <!-- Theme preview info bar --> + <!-- Theme preview infobar --> <message name="IDS_THEME_INSTALL_INFOBAR_LABEL" desc="Text displayed on an infobar when a theme has been installed."> Installed theme "<ph name="THEME_NAME">$1<ex>Snowflake Theme</ex></ph>". </message> @@ -4956,7 +4959,7 @@ Click to enable <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> </message> - <!-- Session Crashed Info Bar/Bubble--> + <!-- Session Crashed Infobar/Bubble--> <message name="IDS_SESSION_CRASHED_BUBBLE_TITLE" desc="Title of the session crashed bubble view."> Restore pages? </message> @@ -4964,25 +4967,25 @@ usage statistics </message> - <!-- Unimplemented Flags Info Bar--> + <!-- Unimplemented Flags Infobar--> <message name="IDS_UNIMPLEMENTED_FLAGS_WARNING_MESSAGE" desc="Message shown when a command-line flag is used that is not implemented by this build. [Keep it short so it fits in the infobar.]"> <ph name="BAD_FLAG">$1<ex>--enable-heap-profiling</ex></ph> is not implemented in this build. </message> - <!-- Bad Flags Info Bar--> + <!-- Bad Flags Infobar--> <message name="IDS_BAD_FLAGS_WARNING_MESSAGE" desc="Message shown when an unsupported command-line flag is used. [Keep it short so it fits in the infobar.]"> You are using an unsupported command-line flag: <ph name="BAD_FLAG">$1<ex>--no-sandbox</ex></ph>. Stability and security will suffer. </message> - <!-- Pepper Broker Info bar --> + <!-- Pepper Broker Infobar --> <if expr="is_android"> <message name="IDS_PEPPER_BROKER_MESSAGE" desc="Mobile: Message shown when a pepper plugin wants to launch its broker. This message is followed by a 'Learn more' link."> - <ph name="PEPPER_PLUGIN_NAME">$1<ex>Shockwave Flash</ex></ph> on <ph name="PEPPER_PLUGIN_DOMAIN">$2<ex>example.com</ex></ph> wants to access your device. + <ph name="PEPPER_PLUGIN_NAME">$1<ex>Flash</ex></ph> on <ph name="PEPPER_PLUGIN_DOMAIN">$2<ex>example.com</ex></ph> wants to access your device. </message> </if> <if expr="not is_android"> <message name="IDS_PEPPER_BROKER_MESSAGE" desc="Message shown when a pepper plugin wants to launch its broker. This message is followed by a 'Learn more' link."> - <ph name="PEPPER_PLUGIN_NAME">$1<ex>Shockwave Flash</ex></ph> on <ph name="PEPPER_PLUGIN_DOMAIN">$2<ex>example.com</ex></ph> wants to access your computer. + <ph name="PEPPER_PLUGIN_NAME">$1<ex>Flash</ex></ph> on <ph name="PEPPER_PLUGIN_DOMAIN">$2<ex>example.com</ex></ph> wants to access your computer. </message> </if> <message name="IDS_PEPPER_BROKER_ALLOW_BUTTON" desc="Text for the allow button on the pepper broker launch prompt"> @@ -5029,7 +5032,7 @@ Manage unsandboxed plugin blocking... </message> - <!-- Blocked Displaying/Running Insecure Content info bar --> + <!-- Blocked Displaying/Running Insecure Content bubble --> <if expr="use_titlecase"> <message name="IDS_BLOCKED_DISPLAYING_INSECURE_CONTENT_TITLE" desc="Title of the bubble shown when a message has asked Chrome to display mixed content."> Insecure Content Blocked @@ -5311,10 +5314,8 @@ Respond to Accessibility Events </message> <if expr="is_android"> - <message name="IDS_ACCESSIBILITY_EVENTS_INFOBAR_QUESTION" desc="Question asked on the info bar whenever URL wants to listen to accessibility events, for example if the user has a screen reader or braille device enabled"> - <ph name="URL"> - $1<ex>maps.google.com</ex> - </ph> wants to respond to accessibility events. + <message name="IDS_ACCESSIBILITY_EVENTS_INFOBAR_TEXT" desc="Text requesting permission for a site to listen to accessibility events, for example if the user has a screen reader or braille device enabled"> + <ph name="URL">$1<ex>maps.google.com</ex></ph> wants to respond to accessibility events. </message> </if> @@ -5323,10 +5324,8 @@ See text and images you copy to the clipboard </message> <if expr="is_android"> - <message name="IDS_CLIPBOARD_INFOBAR_QUESTION" desc="Question asked on the info bar whenever URL wants to read data from the system clipboard"> - <ph name="URL"> - $1<ex>maps.google.com</ex> - </ph> wants to see text and images you copy to the clipboard. + <message name="IDS_CLIPBOARD_INFOBAR_TEXT" desc="Text requesting permission for a site to read data from the system clipboard"> + <ph name="URL">$1<ex>maps.google.com</ex></ph> wants to see text and images you copy to the clipboard. </message> </if> @@ -5824,13 +5823,13 @@ <!-- Automatic updates --> <if expr="is_macosx"> - <message name="IDS_PROMOTE_INFOBAR_TEXT" desc="The text to show in the automatic update setup info bar. Mac-only."> + <message name="IDS_PROMOTE_INFOBAR_TEXT" desc="The text to show in the automatic update setup infobar. Mac-only."> <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> may not be able to keep itself updated. </message> - <message name="IDS_PROMOTE_INFOBAR_PROMOTE_BUTTON" desc="The 'Set up automatic updates' button in the automatic update setup info bar. Mac-only."> + <message name="IDS_PROMOTE_INFOBAR_PROMOTE_BUTTON" desc="The 'Set up automatic updates' button in the automatic update setup infobar. Mac-only."> Set up automatic updates </message> - <message name="IDS_PROMOTE_INFOBAR_DONT_ASK_BUTTON" desc="The 'Don't ask again' button in the automatic update setup info bar. Mac-only."> + <message name="IDS_PROMOTE_INFOBAR_DONT_ASK_BUTTON" desc="The 'Don't ask again' button in the automatic update setup infobar. Mac-only."> Don't ask again </message> <message name="IDS_PROMOTE_AUTHENTICATION_PROMPT" desc="The prompt displayed in the authentication dialog when setting up automatic updates for all users. The system will add a sentence asking for an administrator's name and password. Mac-only."> @@ -6003,6 +6002,9 @@ <message name="IDS_PRINT_PREVIEW_FAILED" desc="Message to display when print preview fails."> Print preview failed. </message> + <message name="IDS_PRINT_PREVIEW_UNSUPPORTED_CLOUD_PRINTER" desc="Message to display when an unsupported cloud printer is selected."> + The selected Google Cloud Print device is no longer supported. Try setting up the printer in your computer's system settings. + </message> <message name="IDS_PRINT_PREVIEW_PRINT_BUTTON" desc="Print button."> Print </message> @@ -6212,6 +6214,9 @@ <message name="IDS_PRINT_PREVIEW_OFFLINE" desc="Shown when printer is currently offline."> Currently offline </message> + <message name="IDS_PRINT_PREVIEW_NO_LONGER_SUPPORTED" desc="Shown when printer is no longer supported."> + No longer supported. + </message> <message name="IDS_PRINT_PREVIEW_EXTENSION_DESTINATION_ICON_TOOLTIP" desc="Tooltip for the icon shown in print destination list next to print destination provided by an extension."> Documents you send to print via <ph name="APP_NAME">$1<ex>A Chrome app</ex></ph> can be read by <ph name="APP_NAME">$1<ex>A Chrome app</ex></ph>. </message> @@ -7917,25 +7922,25 @@ Continue </message> - <message name="IDS_PLUGIN_OUTDATED_PROMPT" desc="Info Bar message when an outdated plugin was disabled"> + <message name="IDS_PLUGIN_OUTDATED_PROMPT" desc="Infobar message when an outdated plugin was disabled"> <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> was blocked because it is out of date. </message> - <message name="IDS_PLUGIN_ENABLE_TEMPORARILY" desc="Info Bar button to run a blocked outdated plugin"> + <message name="IDS_PLUGIN_ENABLE_TEMPORARILY" desc="Infobar button to run a blocked outdated plugin"> Run this time </message> - <message name="IDS_PLUGIN_CRASHED_PROMPT" desc="Info Bar message to notify about a crashed plugin"> - <ph name="PLUGIN_NAME">$1<ex>Shockwave</ex> has crashed.</ph> + <message name="IDS_PLUGIN_CRASHED_PROMPT" desc="Infobar message to notify about a crashed plugin"> + <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> has crashed. </message> <if expr="is_win"> - <message name="IDS_PLUGIN_DISCONNECTED_PROMPT" desc="Info Bar message to notify that the channel connecting to a plugin has encountered an error."> - <ph name="PLUGIN_NAME">$1<ex>Shockwave</ex> has encountered an error.</ph> + <message name="IDS_PLUGIN_DISCONNECTED_PROMPT" desc="Infobar message to notify that the channel connecting to a plugin has encountered an error."> + <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph> has encountered an error. </message> </if> - <message name="IDS_RELOAD_PAGE_WITH_PLUGIN" desc="Info Bar button to reload the page where a plugin crashed or disconnected."> + <message name="IDS_RELOAD_PAGE_WITH_PLUGIN" desc="Infobar button to reload the page where a plugin crashed or disconnected."> Reload </message> - <message name="IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT" desc="Info Bar message to notify that we couldn't load a plugin"> - Could not load <ph name="PLUGIN_NAME">$1<ex>Shockwave</ex>.</ph> + <message name="IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT" desc="Infobar message to notify that we couldn't load a plugin"> + Could not load <ph name="PLUGIN_NAME">$1<ex>Flash</ex></ph>. </message> <!-- External Protocol Dialog --> @@ -8652,7 +8657,7 @@ </if> <!-- Web and message center notifications --> - <message name="IDS_NOTIFICATION_PERMISSIONS" desc="Text requesting permission for Web Notifications."> + <message name="IDS_NOTIFICATIONS_INFOBAR_TEXT" desc="Text requesting permission for Web Notifications."> <ph name="site">$1<ex>mail.google.com</ex></ph> wants to send you notifications. </message> <message name="IDS_NOTIFICATION_PERMISSIONS_FRAGMENT" desc="Permission sentence fragment to show following the prompt 'This site wants to:' in a permissions request"> @@ -9086,17 +9091,13 @@ <!-- Geolocation messages --> <if expr="not is_android"> - <message name="IDS_GEOLOCATION_INFOBAR_QUESTION" desc="Question asked on the info bar whenever URL wants to access the user's physical location"> - <ph name="URL"> - $1<ex>maps.google.com</ex> - </ph> wants to use your computer's location. + <message name="IDS_GEOLOCATION_INFOBAR_TEXT" desc="Text requesting permission for a site to access the user's physical location"> + <ph name="URL">$1<ex>maps.google.com</ex></ph> wants to use your computer's location. </message> </if> <if expr="is_android"> - <message name="IDS_GEOLOCATION_INFOBAR_QUESTION" desc="Mobile: Question asked on the info bar whenever URL wants to access the user's physical location"> - <ph name="URL"> - $1<ex>maps.google.com</ex> - </ph> wants to use your device's location. + <message name="IDS_GEOLOCATION_INFOBAR_TEXT" desc="Mobile: Text requesting permission for a site to access the user's physical location"> + <ph name="URL">$1<ex>maps.google.com</ex></ph> wants to use your device's location. </message> </if> <message name="IDS_GEOLOCATION_INFOBAR_PERMISSION_FRAGMENT" desc="Permission fragment used in the permission bubble, after 'This site wants to:' asking for permission to access the user's physical location."> @@ -9125,10 +9126,8 @@ </message> <!-- Web MIDI messages --> - <message name="IDS_MIDI_SYSEX_INFOBAR_QUESTION" desc="Question asked on the info bar whenever URL wants to access MIDI devices with system exclusive messages."> - <ph name="URL"> - $1<ex>www.google.com</ex> - </ph> wants to get full control of your MIDI devices. + <message name="IDS_MIDI_SYSEX_INFOBAR_TEXT" desc="Text requesting permission for a site to access MIDI devices with system exclusive messages."> + <ph name="URL">$1<ex>www.google.com</ex></ph> wants to get full control of your MIDI devices. </message> <message name="IDS_MIDI_SYSEX_PERMISSION_FRAGMENT" desc="Permission asked in the permission bubble when a URL wants to access MIDI devices with system exclusive messages, along with other permissions requests. Preceded by the prompt 'This site would like to:'"> Use your MIDI devices @@ -9217,7 +9216,7 @@ <message name="IDS_PROTECTED_MEDIA_IDENTIFIER_PERMISSION_FRAGMENT" desc="Permission fragment shown in the permissions bubble when a web page requests access to the computer's protected media identifier."> Know your unique device identifier </message> - <message name="IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION" desc="Question asked on the infobar whenever URL wants to access protected media identifier. It shows the origin of the URL."> + <message name="IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_TEXT" desc="Text requesting permission for a site to access protected media identifier. It shows the origin of the URL."> <ph name="URL">$1<ex>https://www.youtube.com</ex></ph> wants to uniquely identify your device to play protected content. </message> </if> @@ -9444,16 +9443,16 @@ </message> <!-- Media Capture messages --> - <message name="IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO" desc="Question asked on the info bar whenever a web page requests access to the computer's microphone and camera."> + <message name="IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO_INFOBAR_TEXT" desc="Text requesting permission for a site to access the computer's microphone and camera."> <ph name="HOST">$1<ex>html5rocks.com</ex></ph> wants to use your camera and microphone. </message> - <message name="IDS_MEDIA_CAPTURE_AUDIO_ONLY" desc="Question asked on the info bar whenever a web page requests access to the computer's microphone."> + <message name="IDS_MEDIA_CAPTURE_AUDIO_ONLY_INFOBAR_TEXT" desc="Text requesting permission for a site to access the computer's microphone."> <ph name="HOST">$1<ex>html5rocks.com</ex></ph> wants to use your microphone. </message> - <message name="IDS_MEDIA_CAPTURE_VIDEO_ONLY" desc="Question asked on the info bar whenever a web page requests access to the computer's camera."> + <message name="IDS_MEDIA_CAPTURE_VIDEO_ONLY_INFOBAR_TEXT" desc="Text requesting permission for a site to access the computer's camera."> <ph name="HOST">$1<ex>html5rocks.com</ex></ph> wants to use your camera. </message> - <message name="IDS_MEDIA_CAPTURE_SCREEN" desc="Question asked on the info bar whenever a web page requests access to the device's screen."> + <message name="IDS_MEDIA_CAPTURE_SCREEN_INFOBAR_TEXT" desc="Text requesting permission for a site to access the device's screen."> <ph name="HOST">$1<ex>html5rocks.com</ex></ph> wants to share your screen. </message> <message name="IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO_PERMISSION_FRAGMENT" desc="Permission fragment shown in the permissions bubble when a web page requests access to the computer's microphone and camera."> @@ -9474,27 +9473,19 @@ <!-- Quota messages --> <if expr="is_android"> - <message name="IDS_REQUEST_QUOTA_INFOBAR_QUESTION" desc="Mobile: For Android device. Question asked on the info bar whenever webapp requests new (larger) quota to persistently store data on the device (e.g. for persistent-type filesystem)."> - <ph name="URL"> - $1<ex>html5rocks.com</ex> - </ph> wants to permanently store data on your device. + <message name="IDS_REQUEST_QUOTA_INFOBAR_TEXT" desc="Mobile: For Android device. Text requesting permission for a site to use a new (larger) quota to persistently store data on the device (e.g. for persistent-type filesystem)."> + <ph name="URL">$1<ex>html5rocks.com</ex></ph> wants to permanently store data on your device. </message> - <message name="IDS_REQUEST_LARGE_QUOTA_INFOBAR_QUESTION" desc="Mobile: For Android device. Question asked on the info bar whenever webapp requests new (larger) quota to persistently store large data on the user's device (e.g. for persistent-type filesystem)."> - <ph name="URL"> - $1<ex>html5rocks.com</ex> - </ph> wants to permanently store large data on your device. + <message name="IDS_REQUEST_LARGE_QUOTA_INFOBAR_TEXT" desc="Mobile: For Android device. Text requesting permission for a site to use a new (larger) quota to persistently store large data on the user's device (e.g. for persistent-type filesystem)."> + <ph name="URL">$1<ex>html5rocks.com</ex></ph> wants to permanently store large data on your device. </message> </if> <if expr="not is_android"> - <message name="IDS_REQUEST_QUOTA_INFOBAR_QUESTION" desc="Question asked on the info bar whenever webapp requests new (larger) quota to persistently store data on the user's local computer (e.g. for persistent-type filesystem)."> - <ph name="URL"> - $1<ex>html5rocks.com</ex> - </ph> wants to permanently store data on your local computer. + <message name="IDS_REQUEST_QUOTA_INFOBAR_TEXT" desc="Text requesting permission for a site to use a new (larger) quota to persistently store data on the user's local computer (e.g. for persistent-type filesystem)."> + <ph name="URL">$1<ex>html5rocks.com</ex></ph> wants to permanently store data on your local computer. </message> - <message name="IDS_REQUEST_LARGE_QUOTA_INFOBAR_QUESTION" desc="Question asked on the info bar whenever webapp requests new (larger) quota to persistently store large data on the user's local computer (e.g. for persistent-type filesystem)."> - <ph name="URL"> - $1<ex>html5rocks.com</ex> - </ph> wants to permanently store large data on your local computer. + <message name="IDS_REQUEST_LARGE_QUOTA_INFOBAR_TEXT" desc="Text requesting permission for a site to use a new (larger) quota to persistently store large data on the user's local computer (e.g. for persistent-type filesystem)."> + <ph name="URL">$1<ex>html5rocks.com</ex></ph> wants to permanently store large data on your local computer. </message> </if> <message name="IDS_REQUEST_QUOTA_PERMISSION_FRAGMENT" desc="Permission fragment presented in the permission bubble when the webapp requests new larger quota to persistently store data on the device. Follows a 'This site would like to:' prompt."> @@ -9885,7 +9876,7 @@ Next </message> <message name="IDS_METRO_MISSING_PLUGIN_PROMPT" - desc="Info Bar message to let user do something about the missing plugin"> + desc="Infobar message to let user do something about the missing plugin"> <ph name="PLUGIN_NAME">$1<ex>Quicktime</ex></ph> is required to display some elements on this page. </message> <message name="IDS_METRO_NPAPI_PLUGIN_PROMPT" @@ -10881,6 +10872,23 @@ </message> </if> + <!-- Framebust / Blocked Redirection intervention message --> + <if expr="not is_android"> + <!-- Android strings are declared in android_chrome_strings.grd. --> + <message name="IDS_REDIRECT_BLOCKED_MESSAGE" desc="The message stating that a redirect (noun) was blocked on this page. This will be followed on a separate line with the address the user was being redirected to."> + Redirect blocked to site: + </message> + <message name="IDS_REDIRECT_BLOCKED_TITLE" desc="The short message stating that a redirect (noun) was blocked on this page. Same as IDS_REDIRECT_BLOCKED_SHORT_MESSAGE but without the period."> + Redirect blocked + </message> + <message name="IDS_REDIRECT_BLOCKED_TOOLTIP" desc="Tooltip text that appears when the user hovers over the "Redirect blocked" icon in the address bar. It means that a redirect (noun) was blocked by Chrome on this page."> + Redirect blocked on this page. + </message> + <message name="IDS_REDIRECT_BLOCKED_GOT_IT" desc="The text of the OK button for the blocked redirect dialog."> + Got it + </message> + </if> + <!-- Welcome page (chrome://welcome) strings --> <if expr="not chromeos"> <message name="IDS_WELCOME_SUBHEADER" desc="A message which will appear underneath the header on the Welcome UI."> @@ -10975,7 +10983,7 @@ Your downloads appear here </message> - <!-- Automation info bar --> + <!-- Automation infobar --> <message name="IDS_CONTROLLED_BY_AUTOMATION" desc="Message shown when the browser session is being controlled by an automated test."> Chrome is being controlled by automated test software. </message> @@ -11005,6 +11013,9 @@ <!-- VR browser --> <!-- TODO(https://crbug.com/731802): Only build these when the VR browser is supported. --> + <message name="IDS_VR_UPDATE_KEYBOARD_PROMPT" desc="Text shown when the keyboard is not installed or needs to be updated on the user's device"> + Install or update Daydream Keyboard to use Chrome in VR + </message> <message name="IDS_VR_SHELL_EXIT_PROMPT_DESCRIPTION" desc="Text on the exit prompt that shows up when the user tries to use a feature that is not supported in VR"> This feature is not supported in VR </message>
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd index 3d5e764..b8bcc80 100644 --- a/chrome/app/google_chrome_strings.grd +++ b/chrome/app/google_chrome_strings.grd
@@ -403,7 +403,7 @@ Uninstall </message> </if> - <message name="IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT" desc="More compact text to show in the default browser query infobar."> + <message name="IDS_DEFAULT_BROWSER_INFOBAR_TEXT" desc="Text to show in an infobar when Google Chrome is not the current default browser."> Google Chrome isn't your default browser. </message> <if expr="chromeos"> @@ -487,11 +487,6 @@ </message> </if> - <!-- Obsolete System info bar --> - <message name="IDS_SYSTEM_OBSOLETE_MESSAGE" desc="Message shown when your OS is no longer supported. This message is followed by a 'Learn more' link."> - Google Chrome has stopped updating and no longer supports this version of your operating system. - </message> - <!-- Google API keys info bar --> <message name="IDS_MISSING_GOOGLE_API_KEYS" desc="Message shown when Google API keys are missing. This message is followed by a 'Learn more' link."> Google API keys are missing. Some functionality of Google Chrome will be disabled. @@ -1139,20 +1134,6 @@ </message> </if> - <!-- Framebust / Blocked Redirection intervention message --> - <if expr="not is_android"> - <!-- Android strings are not product specific and declared in android_chrome_strings.grd. --> - <message name="IDS_REDIRECT_BLOCKED_MESSAGE" desc="The message stating that a redirect (noun) was blocked on this page. This will be followed on a separate line with the address the user was being redirected to."> - Chrome stopped this site from taking you to - </message> - <message name="IDS_REDIRECT_BLOCKED_TITLE" desc="The short message stating that a redirect (noun) was blocked on this page. Same as IDS_REDIRECT_BLOCKED_SHORT_MESSAGE but without the period."> - Redirect blocked - </message> - <message name="IDS_REDIRECT_BLOCKED_TOOLTIP" desc="Tooltip text that appears when the user hovers over the "Redirect blocked" icon in the address bar. It means that a redirect (noun) was blocked by Chrome on this page."> - Redirect blocked on this page. - </message> - </if> - <!-- OOM intervention message --> <if expr="is_android"> <message name="IDS_NEAR_OOM_INTERVENTION_MESSAGE" desc="The message stating that the browser intervened to stop the page using too much memory.">
diff --git a/chrome/app/md_extensions_strings.grdp b/chrome/app/md_extensions_strings.grdp index f1454042..5ef1076 100644 --- a/chrome/app/md_extensions_strings.grdp +++ b/chrome/app/md_extensions_strings.grdp
@@ -25,6 +25,9 @@ <message name="IDS_MD_EXTENSIONS_ERROR_CLEAR_ALL" desc="The label for the button that clears all the errors."> Clear all </message> + <message name="IDS_MD_EXTENSIONS_A11Y_CLEAR_ENTRY" desc="The accessibility label for the button that clears a single error entry."> + Clear entry + </message> <message name="IDS_MD_EXTENSIONS_ERROR_LAUNCH_DEVTOOLS" desc="The text for the button to view an extension error in the developer tools."> View in Developer Tools </message>
diff --git a/chrome/app/settings_strings.grdp b/chrome/app/settings_strings.grdp index 103189ed..7748728 100644 --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp
@@ -3838,5 +3838,11 @@ <message name="IDS_SETTINGS_RESET_CLEANUP_LOGS_PERMISSION_EXPLANATION" desc="Description for the 'Report details to Google' option. Subject, 'Details', is omitted. Although the plural subject would indicate usage of the plural verb, here, we use the plural form of the verb, 'includes', to avoid the impression that 'include' is an infinitive verb. 'Includes' is a present tense main verb. "> Includes information about harmful software, system settings, and processes on your computer. </message> + <message name="IDS_SETTINGS_RESET_CLEANUP_TITLE_CLEANUP_UNAVAILABLE" desc="Title of error message that could appear before the cleanup of harmful software because Chrome failed to contact the server. This message will only appear on Windows desktop/laptop computers."> + Cleanup is currently unavailable + </message> + <message name="IDS_SETTINGS_RESET_CLEANUP_EXPLANATION_CLEANUP_UNAVAILABLE" desc="Body of error message that could appear during the cleanup of harmful software. Imperative instruction to user. This message will only appear on Windows desktop/laptop computers."> + Please try again later + </message> </if> </grit-part>
diff --git a/chrome/app/vector_icons/blocked_redirect.icon b/chrome/app/vector_icons/blocked_redirect.icon index 2961e701..6b0e37f 100644 --- a/chrome/app/vector_icons/blocked_redirect.icon +++ b/chrome/app/vector_icons/blocked_redirect.icon
@@ -2,30 +2,31 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -MOVE_TO, 32, 12.02f, -LINE_TO, 16, 12, -R_CUBIC_TO, -2.2f, 0, -4, 1.8f, -4, 4, -R_V_LINE_TO, 6, -R_H_LINE_TO, 4, -R_V_LINE_TO, -6, -R_H_LINE_TO, 16, -R_V_LINE_TO, 16, -H_LINE_TO, 16, -R_V_LINE_TO, -6, -R_H_LINE_TO, -4, -R_V_LINE_TO, 6, -R_CUBIC_TO, 0, 2.2f, 1.8f, 4, 4, 4, -R_H_LINE_TO, 16, -R_CUBIC_TO, 2.2f, 0, 4, -1.8f, 4, -4, -V_LINE_TO, 16, -R_CUBIC_TO, 0, -2.2f, -1.8f, -3.98f, -4, -3.98f, +CANVAS_DIMENSIONS, 16, +MOVE_TO, 12, 2.01f, +LINE_TO, 4, 2, +CUBIC_TO, 2.9f, 2, 2, 2.9f, 2, 4, +LINE_TO, 2, 7, +LINE_TO, 4, 7, +LINE_TO, 4, 4, +LINE_TO, 12, 4, +LINE_TO, 12, 12, +LINE_TO, 4, 12, +LINE_TO, 4, 9, +LINE_TO, 2, 9, +LINE_TO, 2, 12, +CUBIC_TO, 2, 13.1f, 2.9f, 14, 4, 14, +LINE_TO, 12, 14, +CUBIC_TO, 13.1f, 14, 14, 13.1f, 14, 12, +LINE_TO, 14, 4, +CUBIC_TO, 14, 2.9f, 13.1f, 2.01f, 12, 2.01f, CLOSE, -MOVE_TO, 24, 24, -R_LINE_TO, -6, -6, -R_V_LINE_TO, 4, -R_H_LINE_TO, -6, -R_V_LINE_TO, 4, -R_H_LINE_TO, 6, -R_V_LINE_TO, 4, +MOVE_TO, 8, 8, +LINE_TO, 5, 5, +LINE_TO, 5, 7, +LINE_TO, 2, 7, +LINE_TO, 2, 9, +LINE_TO, 5, 9, +LINE_TO, 5, 11, CLOSE, END
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 2b7c879..2187393d 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -64,7 +64,7 @@ if (enable_vr) { buildflag_header("vr_build_features") { header = "vr_features.h" - flags = [ "REGISTER_VR_ASSETS_COMPONENT=$register_vr_assets_component" ] + flags = [ "USE_VR_ASSETS_COMPONENT=$use_vr_assets_component" ] } } @@ -1766,6 +1766,7 @@ "//media/cast:net", "//media/midi", "//media/mojo:features", + "//media/mojo/common", "//media/mojo/interfaces:mirror_service_remoting", "//media/mojo/interfaces:remoting", "//media/mojo/services", @@ -3815,6 +3816,8 @@ "plugins/plugins_field_trial.h", "plugins/plugins_resource_service.cc", "plugins/plugins_resource_service.h", + "plugins/reload_plugin_infobar_delegate.cc", + "plugins/reload_plugin_infobar_delegate.h", "renderer_host/pepper/chrome_browser_pepper_host_factory.cc", "renderer_host/pepper/chrome_browser_pepper_host_factory.h", "renderer_host/pepper/device_id_fetcher.cc", @@ -4166,7 +4169,6 @@ "../android/java/src/org/chromium/chrome/browser/DevToolsServer.java", "../android/java/src/org/chromium/chrome/browser/IntentHelper.java", "../android/java/src/org/chromium/chrome/browser/JavascriptAppModalDialog.java", - "../android/java/src/org/chromium/chrome/browser/JavascriptTabModalDialog.java", "../android/java/src/org/chromium/chrome/browser/NearOomMonitor.java", "../android/java/src/org/chromium/chrome/browser/PasswordUIView.java", "../android/java/src/org/chromium/chrome/browser/SSLClientCertificateRequest.java", @@ -4268,6 +4270,7 @@ "../android/java/src/org/chromium/chrome/browser/infobar/UpdatePasswordInfoBar.java", "../android/java/src/org/chromium/chrome/browser/instantapps/InstantAppsSettings.java", "../android/java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java", + "../android/java/src/org/chromium/chrome/browser/jsdialog/JavascriptTabModalDialog.java", "../android/java/src/org/chromium/chrome/browser/locale/LocaleManager.java", "../android/java/src/org/chromium/chrome/browser/locale/SpecialLocaleHandler.java", "../android/java/src/org/chromium/chrome/browser/media/cdm/MediaDrmCredentialManager.java",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 9e74e14..6ca1cd3 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -1475,11 +1475,6 @@ flag_descriptions::kAshEnableUnifiedDesktopName, flag_descriptions::kAshEnableUnifiedDesktopDescription, kOsCrOS, SINGLE_VALUE_TYPE(switches::kEnableUnifiedDesktop)}, - { - "disable-boot-animation", flag_descriptions::kBootAnimationName, - flag_descriptions::kBootAnimationDescription, kOsCrOSOwnerOnly, - SINGLE_DISABLE_VALUE_TYPE(chromeos::switches::kDisableBootAnimation), - }, {"disable-easy-unlock-bluetooth-low-energy-detection", flag_descriptions::kEasyUnlockBluetoothLowEnergyDiscoveryName, flag_descriptions::kEasyUnlockBluetoothLowEnergyDiscoveryDescription, @@ -1607,7 +1602,7 @@ flag_descriptions::kShowAutofillSignaturesName, flag_descriptions::kShowAutofillSignaturesDescription, kOsAll, SINGLE_VALUE_TYPE(autofill::switches::kShowAutofillSignatures)}, - {"affiliation-based-matching", + {"AffiliationBasedMatching", flag_descriptions::kAffiliationBasedMatchingName, flag_descriptions::kAffiliationBasedMatchingDescription, kOsAll, FEATURE_VALUE_TYPE(password_manager::features::kAffiliationBasedMatching)}, @@ -2619,7 +2614,7 @@ flag_descriptions::kProtectSyncCredentialOnReauthDescription, kOsAll, FEATURE_VALUE_TYPE( password_manager::features::kProtectSyncCredentialOnReauth)}, - {"password-export", flag_descriptions::kPasswordExportName, + {"PasswordExport", flag_descriptions::kPasswordExportName, flag_descriptions::kPasswordExportDescription, kOsAll, FEATURE_VALUE_TYPE(password_manager::features::kPasswordExport)}, {"PasswordImport", flag_descriptions::kPasswordImportName, @@ -2906,6 +2901,13 @@ flag_descriptions::kEnableAutofillCreditCardBankNameDisplayName, flag_descriptions::kEnableAutofillCreditCardBankNameDisplayDescription, kOsAll, FEATURE_VALUE_TYPE(autofill::kAutofillCreditCardBankNameDisplay)}, + {"enable-autofill-credit-card-dropdown-google-pay-branding", + flag_descriptions::kEnableAutofillCreditCardDropdownGooglePayBrandingName, + flag_descriptions:: + kEnableAutofillCreditCardDropdownGooglePayBrandingDescription, + kOsAll, + FEATURE_VALUE_TYPE( + autofill::features::kAutofillCreditCardDropdownGooglePayBranding)}, {"enable-autofill-credit-card-last-used-date-display", flag_descriptions::kEnableAutofillCreditCardLastUsedDateDisplayName, flag_descriptions::kEnableAutofillCreditCardLastUsedDateDisplayDescription, @@ -2935,6 +2937,12 @@ flag_descriptions::kEnableAutofillSendBillingCustomerNumberName, flag_descriptions::kEnableAutofillSendBillingCustomerNumberDescription, kOsAll, FEATURE_VALUE_TYPE(autofill::kAutofillSendBillingCustomerNumber)}, + {"enable-autofill-use-new-settings-name-in-dropdown", + flag_descriptions::kEnableAutofillUseNewSettingsNameInDropdownName, + flag_descriptions::kEnableAutofillUseNewSettingsNameInDropdownDescription, + kOsAll, + FEATURE_VALUE_TYPE( + autofill::features::kAutofillUseNewSettingsNameInDropdown)}, {"enable-macviews-credit-card-dialogs", flag_descriptions::kEnableAutofillToolkitViewsCreditCardDialogsMac, flag_descriptions:: @@ -3014,6 +3022,10 @@ flag_descriptions::kOmniboxEntitySuggestionsName, flag_descriptions::kOmniboxEntitySuggestionsDescription, kOsDesktop, FEATURE_VALUE_TYPE(omnibox::kOmniboxEntitySuggestions)}, + {"omnibox-rich-entity-suggestions", + flag_descriptions::kOmniboxRichEntitySuggestionsName, + flag_descriptions::kOmniboxRichEntitySuggestionsDescription, kOsDesktop, + FEATURE_VALUE_TYPE(omnibox::kOmniboxRichEntitySuggestions)}, {"omnibox-tail-suggestions", flag_descriptions::kOmniboxTailSuggestionsName, flag_descriptions::kOmniboxTailSuggestionsDescription, kOsDesktop, FEATURE_VALUE_TYPE(omnibox::kOmniboxTailSuggestions)}, @@ -3624,9 +3636,9 @@ SINGLE_VALUE_TYPE(switches::kLogNetLog)}, #if defined(OS_CHROMEOS) - {"enable-multi-mirroring", flag_descriptions::kEnableMultiMirroringName, - flag_descriptions::kEnableMultiMirroringDescription, kOsCrOS, - SINGLE_VALUE_TYPE(switches::kEnableMultiMirroring)}, + {"enable-multi-mirroring", flag_descriptions::kDisableMultiMirroringName, + flag_descriptions::kDisableMultiMirroringDescription, kOsCrOS, + SINGLE_VALUE_TYPE(switches::kDisableMultiMirroring)}, #endif // defined(OS_CHROMEOS) #if BUILDFLAG(ENABLE_AV1_DECODER)
diff --git a/chrome/browser/android/chrome_feature_list.cc b/chrome/browser/android/chrome_feature_list.cc index f0e88bb..58b8b70 100644 --- a/chrome/browser/android/chrome_feature_list.cc +++ b/chrome/browser/android/chrome_feature_list.cc
@@ -54,6 +54,7 @@ &features::kVrBrowsing, &features::kWebPayments, &features::kTabsInCbd, + &kAdjustWebApkInstallationSpace, &kAllowReaderForAccessibility, &kAndroidPayIntegrationV1, &kAndroidPayIntegrationV2, @@ -156,6 +157,9 @@ } // namespace // Alphabetical: +const base::Feature kAdjustWebApkInstallationSpace = { + "AdjustWebApkInstallationSpace", base::FEATURE_DISABLED_BY_DEFAULT}; + const base::Feature kAllowReaderForAccessibility = { "AllowReaderForAccessibility", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/chrome/browser/android/chrome_feature_list.h b/chrome/browser/android/chrome_feature_list.h index 20df61b..1dc8376 100644 --- a/chrome/browser/android/chrome_feature_list.h +++ b/chrome/browser/android/chrome_feature_list.h
@@ -13,6 +13,7 @@ namespace android { // Alphabetical: +extern const base::Feature kAdjustWebApkInstallationSpace; extern const base::Feature kAllowReaderForAccessibility; extern const base::Feature kAndroidPayIntegrationV1; extern const base::Feature kAndroidPayIntegrationV2;
diff --git a/chrome/browser/android/contextualsearch/contextual_search_ranker_logger_impl.cc b/chrome/browser/android/contextualsearch/contextual_search_ranker_logger_impl.cc index 976dec6..32908708 100644 --- a/chrome/browser/android/contextualsearch/contextual_search_ranker_logger_impl.cc +++ b/chrome/browser/android/contextualsearch/contextual_search_ranker_logger_impl.cc
@@ -95,7 +95,7 @@ if (IsQueryEnabledInternal()) { was_able_to_predict = predictor_->Predict(*ranker_example_, &prediction); // Log to UMA whether we were able to predict or not. - base::UmaHistogramBoolean("Search.ContextualSearchRankerWasAbleToPredict", + base::UmaHistogramBoolean("Search.ContextualSearch.Ranker.WasAbleToPredict", was_able_to_predict); // TODO(chrome-ranker-team): this should be logged internally by Ranker. LogFeature(kContextualSearchRankerDidPredict,
diff --git a/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc b/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc index 7eef5af..40ff7f0b 100644 --- a/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc +++ b/chrome/browser/android/download/chrome_duplicate_download_infobar_delegate.cc
@@ -72,7 +72,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier ChromeDuplicateDownloadInfoBarDelegate::GetIdentifier() const { - return CHROME_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE; + return DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_ANDROID; } bool ChromeDuplicateDownloadInfoBarDelegate::Accept() {
diff --git a/chrome/browser/android/download/dangerous_download_infobar_delegate.cc b/chrome/browser/android/download/dangerous_download_infobar_delegate.cc index fe42e8a..7d9863de 100644 --- a/chrome/browser/android/download/dangerous_download_infobar_delegate.cc +++ b/chrome/browser/android/download/dangerous_download_infobar_delegate.cc
@@ -44,7 +44,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier DangerousDownloadInfoBarDelegate::GetIdentifier() const { - return CONFIRM_DANGEROUS_DOWNLOAD; + return DANGEROUS_DOWNLOAD_INFOBAR_DELEGATE_ANDROID; } int DangerousDownloadInfoBarDelegate::GetIconId() const {
diff --git a/chrome/browser/android/hung_renderer_infobar_delegate.cc b/chrome/browser/android/hung_renderer_infobar_delegate.cc index 8addb3f..f1583dc 100644 --- a/chrome/browser/android/hung_renderer_infobar_delegate.cc +++ b/chrome/browser/android/hung_renderer_infobar_delegate.cc
@@ -40,7 +40,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier HungRendererInfoBarDelegate::GetIdentifier() const { - return HUNG_RENDERER_INFOBAR_DELEGATE; + return HUNG_RENDERER_INFOBAR_DELEGATE_ANDROID; } void HungRendererInfoBarDelegate::InfoBarDismissed() {
diff --git a/chrome/browser/android/preferences/OWNERS b/chrome/browser/android/preferences/OWNERS new file mode 100644 index 0000000..0ec567a --- /dev/null +++ b/chrome/browser/android/preferences/OWNERS
@@ -0,0 +1,3 @@ +twellington@chromium.org + +# COMPONENT: UI>Settings
diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc index 93463b33e..eaccdd7 100644 --- a/chrome/browser/android/preferences/pref_service_bridge.cc +++ b/chrome/browser/android/preferences/pref_service_bridge.cc
@@ -1219,9 +1219,7 @@ where = translate::TranslatePrefs::kUp; } - for (int i = 0; i < offset; ++i) { - translate_prefs->RearrangeLanguage(language_code, where, languages); - } + translate_prefs->RearrangeLanguage(language_code, where, offset, languages); } static jboolean JNI_PrefServiceBridge_IsBlockedLanguage(
diff --git a/chrome/browser/android/resource_id.h b/chrome/browser/android/resource_id.h index c1e4bd3..08cec7c 100644 --- a/chrome/browser/android/resource_id.h +++ b/chrome/browser/android/resource_id.h
@@ -83,6 +83,7 @@ LINK_RESOURCE_ID(IDR_AUTOFILL_CC_UNIONPAY, R.drawable.unionpay_card) LINK_RESOURCE_ID(IDR_AUTOFILL_CC_VISA, R.drawable.visa_card) LINK_RESOURCE_ID(IDR_AUTOFILL_CC_SCAN_NEW, R.drawable.ic_photo_camera_black) +LINK_RESOURCE_ID(IDR_AUTOFILL_GOOGLE_PAY, R.drawable.google_pay) LINK_RESOURCE_ID(IDR_AUTOFILL_HTTP_WARNING, R.drawable.ic_info_outline_grey) LINK_RESOURCE_ID(IDR_AUTOFILL_HTTPS_INVALID_WARNING, R.drawable.ic_warning_red)
diff --git a/chrome/browser/android/search_permissions/search_geolocation_disclosure_infobar_delegate.cc b/chrome/browser/android/search_permissions/search_geolocation_disclosure_infobar_delegate.cc index 2a0a4b2..056cc41d 100644 --- a/chrome/browser/android/search_permissions/search_geolocation_disclosure_infobar_delegate.cc +++ b/chrome/browser/android/search_permissions/search_geolocation_disclosure_infobar_delegate.cc
@@ -60,7 +60,7 @@ infobars::InfoBar* existing_infobar = infobar_service->infobar_at(i); if (existing_infobar->delegate()->GetIdentifier() == infobars::InfoBarDelegate:: - SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_DELEGATE) { + SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_DELEGATE_ANDROID) { return true; } } @@ -106,7 +106,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier SearchGeolocationDisclosureInfoBarDelegate::GetIdentifier() const { - return SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_DELEGATE; + return SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_DELEGATE_ANDROID; } int SearchGeolocationDisclosureInfoBarDelegate::GetIconId() const {
diff --git a/chrome/browser/android/vr_shell/gl_browser_interface.h b/chrome/browser/android/vr_shell/gl_browser_interface.h index 64a35c88..3b13538 100644 --- a/chrome/browser/android/vr_shell/gl_browser_interface.h +++ b/chrome/browser/android/vr_shell/gl_browser_interface.h
@@ -23,7 +23,9 @@ virtual ~GlBrowserInterface() = default; virtual void ContentSurfaceChanged(jobject surface) = 0; - virtual void GvrDelegateReady(gvr::ViewerType viewer_type) = 0; + virtual void GvrDelegateReady( + gvr::ViewerType viewer_type, + device::mojom::VRDisplayFrameTransportOptionsPtr) = 0; virtual void UpdateGamepadData(device::GvrGamepadData) = 0; virtual void ForceExitVr() = 0; virtual void OnContentPaused(bool enabled) = 0;
diff --git a/chrome/browser/android/vr_shell/vr_compositor.cc b/chrome/browser/android/vr_shell/vr_compositor.cc index 517d76f2..673efc0 100644 --- a/chrome/browser/android/vr_shell/vr_compositor.cc +++ b/chrome/browser/android/vr_shell/vr_compositor.cc
@@ -56,10 +56,6 @@ compositor_->SetWindowBounds(size); } -void VrCompositor::SetDeferCommits(bool defer_commits) { - compositor_->SetDeferCommits(defer_commits); -} - void VrCompositor::SurfaceChanged(jobject surface) { compositor_->SetSurface(surface); }
diff --git a/chrome/browser/android/vr_shell/vr_compositor.h b/chrome/browser/android/vr_shell/vr_compositor.h index eb4baf66..1f7f8a3 100644 --- a/chrome/browser/android/vr_shell/vr_compositor.h +++ b/chrome/browser/android/vr_shell/vr_compositor.h
@@ -36,7 +36,6 @@ void SurfaceDestroyed(); void SetWindowBounds(gfx::Size size); - void SetDeferCommits(bool defer_commits); void SurfaceChanged(jobject surface); void SetLayer(content::WebContents* web_contents);
diff --git a/chrome/browser/android/vr_shell/vr_gl_thread.cc b/chrome/browser/android/vr_shell/vr_gl_thread.cc index ef586f892..ac8660f 100644 --- a/chrome/browser/android/vr_shell/vr_gl_thread.cc +++ b/chrome/browser/android/vr_shell/vr_gl_thread.cc
@@ -10,8 +10,9 @@ #include "base/version.h" #include "chrome/browser/android/vr_shell/vr_shell.h" #include "chrome/browser/android/vr_shell/vr_shell_gl.h" -#include "chrome/browser/vr/assets.h" +#include "chrome/browser/vr/assets_loader.h" #include "chrome/browser/vr/browser_ui_interface.h" +#include "chrome/browser/vr/model/assets.h" #include "chrome/browser/vr/model/omnibox_suggestions.h" #include "chrome/browser/vr/model/toolbar_state.h" #include "chrome/browser/vr/ui.h" @@ -92,11 +93,13 @@ base::Bind(&VrShell::ContentSurfaceChanged, weak_vr_shell_, surface)); } -void VrGLThread::GvrDelegateReady(gvr::ViewerType viewer_type) { +void VrGLThread::GvrDelegateReady( + gvr::ViewerType viewer_type, + device::mojom::VRDisplayFrameTransportOptionsPtr transport_options) { DCHECK(OnGlThread()); main_thread_task_runner_->PostTask( - FROM_HERE, - base::Bind(&VrShell::GvrDelegateReady, weak_vr_shell_, viewer_type)); + FROM_HERE, base::BindOnce(&VrShell::GvrDelegateReady, weak_vr_shell_, + viewer_type, std::move(transport_options))); } void VrGLThread::UpdateGamepadData(device::GvrGamepadData pad) { @@ -208,7 +211,7 @@ } void VrGLThread::LoadAssets() { - vr::Assets::GetInstance()->Load( + vr::AssetsLoader::GetInstance()->Load( base::BindOnce(&VrGLThread::OnAssetsLoaded, base::Unretained(this))); } @@ -360,15 +363,9 @@ } void VrGLThread::OnAssetsLoaded(vr::AssetsLoadStatus status, - std::unique_ptr<SkBitmap> background_image, + std::unique_ptr<vr::Assets> assets, const base::Version& component_version) { - if (status == vr::AssetsLoadStatus::kSuccess) { - VLOG(1) << "Successfully loaded VR assets component"; - vr_shell_gl_->OnAssetsLoaded(std::move(background_image), - component_version); - } else { - VLOG(1) << "Failed to load VR assets component"; - } + vr_shell_gl_->OnAssetsLoaded(status, std::move(assets), component_version); main_thread_task_runner_->PostTask( FROM_HERE, base::BindOnce(&VrShell::OnAssetsLoaded, weak_vr_shell_, status, component_version));
diff --git a/chrome/browser/android/vr_shell/vr_gl_thread.h b/chrome/browser/android/vr_shell/vr_gl_thread.h index d42cd7d7..e40755a51 100644 --- a/chrome/browser/android/vr_shell/vr_gl_thread.h +++ b/chrome/browser/android/vr_shell/vr_gl_thread.h
@@ -49,7 +49,9 @@ // GlBrowserInterface implementation (GL calling to VrShell). void ContentSurfaceChanged(jobject surface) override; - void GvrDelegateReady(gvr::ViewerType viewer_type) override; + void GvrDelegateReady( + gvr::ViewerType viewer_type, + device::mojom::VRDisplayFrameTransportOptionsPtr) override; void UpdateGamepadData(device::GvrGamepadData) override; void ForceExitVr() override; void OnContentPaused(bool enabled) override; @@ -106,7 +108,7 @@ bool OnGlThread() const; void OnAssetsLoaded(vr::AssetsLoadStatus status, - std::unique_ptr<SkBitmap> background_image, + std::unique_ptr<vr::Assets> assets, const base::Version& component_version); // Created on GL thread.
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc index e86955f..70ec91e 100644 --- a/chrome/browser/android/vr_shell/vr_shell.cc +++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -29,10 +29,11 @@ #include "chrome/browser/android/vr_shell/vr_usage_monitor.h" #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/component_updater/vr_assets_component_installer.h" #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/vr/assets.h" +#include "chrome/browser/vr/assets_loader.h" #include "chrome/browser/vr/metrics_helper.h" #include "chrome/browser/vr/toolbar_helper.h" #include "chrome/browser/vr/vr_tab_helper.h" @@ -148,10 +149,6 @@ g_instance = this; j_vr_shell_.Reset(env, obj); - // Defer applying commits to the renderer until we know the desired - // content resolution and DPR. - compositor_->SetDeferCommits(true); - gl_thread_ = base::MakeUnique<VrGLThread>( weak_ptr_factory_.GetWeakPtr(), main_thread_task_runner_, gvr_api, ui_initial_state, reprojected_rendering_, HasDaydreamSupport(env)); @@ -166,9 +163,12 @@ UMA_HISTOGRAM_BOOLEAN("VRAutopresentedWebVR", !ui_initial_state.in_web_vr); } - vr::Assets::GetInstance()->SetOnComponentReadyCallback(base::BindRepeating( - &VrShell::OnAssetsComponentReady, weak_ptr_factory_.GetWeakPtr())); - vr::Assets::GetInstance()->GetMetricsHelper()->OnEnter(vr::Mode::kVr); + vr::AssetsLoader::GetInstance()->SetOnComponentReadyCallback( + base::BindRepeating(&VrShell::OnAssetsComponentReady, + weak_ptr_factory_.GetWeakPtr())); + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnEnter(vr::Mode::kVr); + + UpdateVrAssetsComponent(g_browser_process->component_updater()); } void VrShell::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) { @@ -279,8 +279,9 @@ } void VrShell::PostToGlThread(const base::Location& from_here, - const base::Closure& task) { - gl_thread_->message_loop()->task_runner()->PostTask(from_here, task); + base::OnceClosure task) { + gl_thread_->message_loop()->task_runner()->PostTask(from_here, + std::move(task)); } void VrShell::OnContentPaused(bool paused) { @@ -426,10 +427,11 @@ ui_->SetWebVrMode(enabled, show_toast); if (!webvr_mode_ && !web_vr_autopresentation_expected_) { - vr::Assets::GetInstance()->GetMetricsHelper()->OnEnter( + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnEnter( vr::Mode::kVrBrowsing); } else { - vr::Assets::GetInstance()->GetMetricsHelper()->OnEnter(vr::Mode::kWebVr); + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnEnter( + vr::Mode::kWebVr); } } @@ -492,13 +494,14 @@ void VrShell::ConnectPresentingService( device::mojom::VRSubmitFrameClientPtr submit_client, device::mojom::VRPresentationProviderRequest request, - device::mojom::VRDisplayInfoPtr display_info) { + device::mojom::VRDisplayInfoPtr display_info, + device::mojom::VRRequestPresentOptionsPtr present_options) { PostToGlThread( FROM_HERE, - base::Bind(&VrShellGl::ConnectPresentingService, - gl_thread_->GetVrShellGl(), - base::Passed(submit_client.PassInterface()), - base::Passed(&request), base::Passed(&display_info))); + base::BindOnce(&VrShellGl::ConnectPresentingService, + gl_thread_->GetVrShellGl(), submit_client.PassInterface(), + std::move(request), std::move(display_info), + std::move(present_options))); } base::android::ScopedJavaGlobalRef<jobject> VrShell::TakeContentSurface( @@ -544,10 +547,20 @@ compositor_->SurfaceChanged(content_surface_); } -void VrShell::GvrDelegateReady(gvr::ViewerType viewer_type) { +void VrShell::GvrDelegateReady( + gvr::ViewerType viewer_type, + device::mojom::VRDisplayFrameTransportOptionsPtr transport_options) { + frame_transport_options_ = std::move(transport_options); delegate_provider_->SetDelegate(this, viewer_type); } +device::mojom::VRDisplayFrameTransportOptionsPtr +VrShell::GetVRDisplayFrameTransportOptions() { + // Caller takes ownership. Must return a copy to support having this called + // multiple times during the lifetime of this instance. + return frame_transport_options_.Clone(); +} + void VrShell::OnPhysicalBackingSizeChanged( JNIEnv* env, const JavaParamRef<jobject>& obj, @@ -764,7 +777,6 @@ JNIEnv* env = base::android::AttachCurrentThread(); Java_VrShellImpl_setContentCssSize(env, j_vr_shell_, window_size.width(), window_size.height(), dpr); - compositor_->SetDeferCommits(false); } void VrShell::SetVoiceSearchActive(bool active) { @@ -956,7 +968,13 @@ void VrShell::OnAssetsLoaded(vr::AssetsLoadStatus status, const base::Version& component_version) { - vr::Assets::GetInstance()->GetMetricsHelper()->OnAssetsLoaded( + if (status == vr::AssetsLoadStatus::kSuccess) { + VLOG(1) << "Successfully loaded VR assets component"; + } else { + VLOG(1) << "Failed to load VR assets component"; + } + + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnAssetsLoaded( status, component_version); } @@ -994,7 +1012,7 @@ ui_initial_state.skips_redraw_when_not_dirty = base::FeatureList::IsEnabled(features::kVrBrowsingExperimentalRendering); ui_initial_state.assets_available = - vr::Assets::GetInstance()->ComponentReady(); + vr::AssetsLoader::GetInstance()->ComponentReady(); return reinterpret_cast<intptr_t>(new VrShell( env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android),
diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h index 7f03eb5..27e39249 100644 --- a/chrome/browser/android/vr_shell/vr_shell.h +++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -156,7 +156,11 @@ void ContentWasShown(); void ContentSurfaceChanged(jobject surface); - void GvrDelegateReady(gvr::ViewerType viewer_type); + void GvrDelegateReady(gvr::ViewerType viewer_type, + device::mojom::VRDisplayFrameTransportOptionsPtr); + + device::mojom::VRDisplayFrameTransportOptionsPtr + GetVRDisplayFrameTransportOptions(); void OnPhysicalBackingSizeChanged( JNIEnv* env, @@ -199,7 +203,8 @@ void ConnectPresentingService( device::mojom::VRSubmitFrameClientPtr submit_client, device::mojom::VRPresentationProviderRequest request, - device::mojom::VRDisplayInfoPtr display_info); + device::mojom::VRDisplayInfoPtr display_info, + device::mojom::VRRequestPresentOptionsPtr present_options); // device::GvrGamepadDataProvider implementation. void UpdateGamepadData(device::GvrGamepadData) override; @@ -220,8 +225,7 @@ private: ~VrShell() override; - void PostToGlThread(const base::Location& from_here, - const base::Closure& task); + void PostToGlThread(const base::Location& from_here, base::OnceClosure task); void SetUiState(); void ProcessTabArray(JNIEnv* env, jobjectArray tabs, bool incognito); @@ -291,6 +295,9 @@ nullptr; int64_t cardboard_gamepad_timer_ = 0; + // For GetVRDisplayFrameTransportOptions() + device::mojom::VRDisplayFrameTransportOptionsPtr frame_transport_options_; + // Content id int content_id_ = 0;
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.cc b/chrome/browser/android/vr_shell/vr_shell_delegate.cc index 5109319..e139608 100644 --- a/chrome/browser/android/vr_shell/vr_shell_delegate.cc +++ b/chrome/browser/android/vr_shell/vr_shell_delegate.cc
@@ -12,7 +12,7 @@ #include "chrome/browser/android/vr_shell/vr_shell.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/component_updater/vr_assets_component_installer.h" -#include "chrome/browser/vr/assets.h" +#include "chrome/browser/vr/assets_loader.h" #include "chrome/browser/vr/metrics_helper.h" #include "chrome/browser/vr/service/vr_device_manager.h" #include "chrome/browser/vr/service/vr_service_impl.h" @@ -61,8 +61,8 @@ device::VRDevice* device = GetDevice(); if (device) device->OnExitPresent(); - if (!present_callback_.is_null()) - base::ResetAndReturn(&present_callback_).Run(false); + if (!on_present_result_callback_.is_null()) + base::ResetAndReturn(&on_present_result_callback_).Run(false); } device::GvrDelegateProvider* VrShellDelegate::CreateVrShellDelegate() { @@ -91,8 +91,8 @@ device->SetMagicWindowEnabled(false); if (pending_successful_present_request_) { - CHECK(!present_callback_.is_null()); - base::ResetAndReturn(&present_callback_).Run(true); + CHECK(!on_present_result_callback_.is_null()); + base::ResetAndReturn(&on_present_result_callback_).Run(true); } JNIEnv* env = AttachCurrentThread(); std::unique_ptr<VrCoreInfo> vr_core_info = MakeVrCoreInfo(env); @@ -111,18 +111,20 @@ void VrShellDelegate::SetPresentResult(JNIEnv* env, const JavaParamRef<jobject>& obj, jboolean success) { - CHECK(!present_callback_.is_null()); - base::ResetAndReturn(&present_callback_).Run(static_cast<bool>(success)); + CHECK(!on_present_result_callback_.is_null()); + base::ResetAndReturn(&on_present_result_callback_) + .Run(static_cast<bool>(success)); } void VrShellDelegate::OnPresentResult( device::mojom::VRSubmitFrameClientPtr submit_client, device::mojom::VRPresentationProviderRequest request, device::mojom::VRDisplayInfoPtr display_info, - base::Callback<void(bool)> callback, + device::mojom::VRRequestPresentOptionsPtr present_options, + device::mojom::VRDisplayHost::RequestPresentCallback callback, bool success) { if (!success) { - std::move(callback).Run(false); + std::move(callback).Run(false, nullptr); return; } @@ -130,17 +132,18 @@ // We have to wait until the GL thread is ready since we have to pass it // the VRSubmitFrameClient. pending_successful_present_request_ = true; - present_callback_ = - base::Bind(&VrShellDelegate::OnPresentResult, base::Unretained(this), - base::Passed(&submit_client), base::Passed(&request), - base::Passed(&display_info), base::Passed(&callback)); + on_present_result_callback_ = base::BindOnce( + &VrShellDelegate::OnPresentResult, base::Unretained(this), + std::move(submit_client), std::move(request), std::move(display_info), + std::move(present_options), std::move(callback)); return; } vr_shell_->ConnectPresentingService( - std::move(submit_client), std::move(request), std::move(display_info)); + std::move(submit_client), std::move(request), std::move(display_info), + std::move(present_options)); - std::move(callback).Run(true); + std::move(callback).Run(true, vr_shell_->GetVRDisplayFrameTransportOptions()); pending_successful_present_request_ = false; } @@ -205,17 +208,18 @@ device::mojom::VRSubmitFrameClientPtr submit_client, device::mojom::VRPresentationProviderRequest request, device::mojom::VRDisplayInfoPtr display_info, - base::Callback<void(bool)> callback) { - if (!present_callback_.is_null()) { + device::mojom::VRRequestPresentOptionsPtr present_options, + device::mojom::VRDisplayHost::RequestPresentCallback callback) { + if (!on_present_result_callback_.is_null()) { // Can only handle one request at a time. This is also extremely unlikely to // happen in practice. - std::move(callback).Run(false); + std::move(callback).Run(false, nullptr); return; } - present_callback_ = - base::Bind(&VrShellDelegate::OnPresentResult, base::Unretained(this), - base::Passed(&submit_client), base::Passed(&request), - base::Passed(&display_info), base::Passed(&callback)); + on_present_result_callback_ = base::BindOnce( + &VrShellDelegate::OnPresentResult, base::Unretained(this), + std::move(submit_client), std::move(request), std::move(display_info), + std::move(present_options), std::move(callback)); // If/When VRShell is ready for use it will call SetPresentResult. JNIEnv* env = AttachCurrentThread(); @@ -297,7 +301,7 @@ static void JNI_VrShellDelegate_OnChromeStarted( JNIEnv* env, const JavaParamRef<jclass>& clazz) { - vr::Assets::GetInstance()->GetMetricsHelper()->OnChromeStarted(); + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnChromeStarted(); } } // namespace vr_shell
diff --git a/chrome/browser/android/vr_shell/vr_shell_delegate.h b/chrome/browser/android/vr_shell/vr_shell_delegate.h index a6501b1..91cdf4f 100644 --- a/chrome/browser/android/vr_shell/vr_shell_delegate.h +++ b/chrome/browser/android/vr_shell/vr_shell_delegate.h
@@ -68,26 +68,30 @@ // device::GvrDelegateProvider implementation. bool ShouldDisableGvrDevice() override; void SetDeviceId(unsigned int device_id) override; - void RequestWebVRPresent(device::mojom::VRSubmitFrameClientPtr submit_client, - device::mojom::VRPresentationProviderRequest request, - device::mojom::VRDisplayInfoPtr display_info, - base::Callback<void(bool)> callback) override; + void RequestWebVRPresent( + device::mojom::VRSubmitFrameClientPtr submit_client, + device::mojom::VRPresentationProviderRequest request, + device::mojom::VRDisplayInfoPtr display_info, + device::mojom::VRRequestPresentOptionsPtr present_options, + device::mojom::VRDisplayHost::RequestPresentCallback callback) override; void OnListeningForActivateChanged(bool listening) override; void OnActivateDisplayHandled(bool will_not_present); void SetListeningForActivate(bool listening); - void OnPresentResult(device::mojom::VRSubmitFrameClientPtr submit_client, - device::mojom::VRPresentationProviderRequest request, - device::mojom::VRDisplayInfoPtr display_info, - base::Callback<void(bool)> callback, - bool success); + void OnPresentResult( + device::mojom::VRSubmitFrameClientPtr submit_client, + device::mojom::VRPresentationProviderRequest request, + device::mojom::VRDisplayInfoPtr display_info, + device::mojom::VRRequestPresentOptionsPtr present_options, + device::mojom::VRDisplayHost::RequestPresentCallback callback, + bool success); std::unique_ptr<VrCoreInfo> MakeVrCoreInfo(JNIEnv* env); base::android::ScopedJavaGlobalRef<jobject> j_vr_shell_delegate_; unsigned int device_id_ = 0; VrShell* vr_shell_ = nullptr; - base::Callback<void(bool)> present_callback_; + base::OnceCallback<void(bool)> on_present_result_callback_; bool pending_successful_present_request_ = false; base::CancelableClosure clear_activate_task_;
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.cc b/chrome/browser/android/vr_shell/vr_shell_gl.cc index d9206b3..cae27d06 100644 --- a/chrome/browser/android/vr_shell/vr_shell_gl.cc +++ b/chrome/browser/android/vr_shell/vr_shell_gl.cc
@@ -24,8 +24,9 @@ #include "chrome/browser/android/vr_shell/vr_metrics_util.h" #include "chrome/browser/android/vr_shell/vr_shell.h" #include "chrome/browser/android/vr_shell/vr_usage_monitor.h" -#include "chrome/browser/vr/assets.h" +#include "chrome/browser/vr/assets_loader.h" #include "chrome/browser/vr/elements/ui_element.h" +#include "chrome/browser/vr/model/assets.h" #include "chrome/browser/vr/model/camera_model.h" #include "chrome/browser/vr/model/model.h" #include "chrome/browser/vr/pose_util.h" @@ -95,6 +96,19 @@ static constexpr int kWebVrInitialFrameTimeoutSeconds = 5; static constexpr int kWebVrSpinnerTimeoutSeconds = 2; +// Heuristic time limit to detect overstuffed GVR buffers for a +// >60fps capable web app. +static constexpr base::TimeDelta kWebVrSlowAcquireThreshold = + base::TimeDelta::FromMilliseconds(2); + +// If running too fast, allow dropping frames occasionally to let GVR catch up. +// Drop at most one frame in MaxDropRate. +static constexpr int kWebVrUnstuffMaxDropRate = 11; + +// If GVR submit isn't blocking, we don't know how long rendering actually took. +// Use a decay factor to assume it's a bit less than the current average. +static constexpr float kWebVrSlowSubmitDecayFactor = 0.95f; + static constexpr int kNumSamplesPerPixelBrowserUi = 2; static constexpr int kNumSamplesPerPixelWebVr = 1; @@ -245,6 +259,19 @@ content_surface_texture_->SetDefaultBufferSize( content_tex_physical_size_.width(), content_tex_physical_size_.height()); + webvr_vsync_align_ = base::FeatureList::IsEnabled(features::kWebVrVsyncAlign); + webvr_experimental_rendering_ = + base::FeatureList::IsEnabled(features::kWebVrExperimentalRendering); + + // TODO(https://crbug.com/760389): force this on for S8 via whitelist? + if (gl::GLFence::IsGpuFenceSupported() && webvr_experimental_rendering_) { + webvr_use_gpu_fence_ = true; + } + + // InitializeRenderer calls GvrDelegateReady which triggers actions such as + // responding to RequestPresent. All member assignments or other + // initialization actions which affect presentation setup, i.e. feature + // checks, must happen before this point. if (!reinitializing) InitializeRenderer(); @@ -368,7 +395,8 @@ void VrShellGl::ConnectPresentingService( device::mojom::VRSubmitFrameClientPtrInfo submit_client_info, device::mojom::VRPresentationProviderRequest request, - device::mojom::VRDisplayInfoPtr display_info) { + device::mojom::VRDisplayInfoPtr display_info, + device::mojom::VRRequestPresentOptionsPtr present_options) { ClosePresentationBindings(); submit_client_.Bind(std::move(submit_client_info)); binding_.Bind(std::move(request)); @@ -380,15 +408,23 @@ CreateOrResizeWebVRSurface(webvr_size); ScheduleOrCancelWebVrFrameTimeout(); + + // TODO(https://crbug.com/795049): Add a metric to track how much the + // permitted-but-not-recommended preserveDrawingBuffer=true mode is used by + // WebVR 1.1 sites. Having this option set will disable the planned + // direct-draw-to-shared-buffer optimization. + DVLOG(1) << "preserveDrawingBuffer=" + << present_options->preserve_drawing_buffer; } void VrShellGl::OnSwapContents(int new_content_id) { ui_->OnSwapContents(new_content_id); } -void VrShellGl::OnAssetsLoaded(std::unique_ptr<SkBitmap> background_image, +void VrShellGl::OnAssetsLoaded(vr::AssetsLoadStatus status, + std::unique_ptr<vr::Assets> assets, const base::Version& component_version) { - ui_->SetBackgroundImage(std::move(background_image)); + ui_->OnAssetsLoaded(status, std::move(assets), component_version); } void VrShellGl::OnContentFrameAvailable() { @@ -464,6 +500,28 @@ } } +device::mojom::VRDisplayFrameTransportOptionsPtr +VrShellGl::GetWebVrFrameTransportOptions() { + // All member assignments that affect render path selections must be complete + // before this function executes. See InitializeRenderer comment in + // InitializeGl. + + device::mojom::VRDisplayFrameTransportOptionsPtr transport_options = + device::mojom::VRDisplayFrameTransportOptions::New(); + transport_options->transport_method = + device::mojom::VRDisplayFrameTransportMethod::SUBMIT_AS_MAILBOX_HOLDER; + // Only set boolean options that we need. Default is false, and we should be + // able to safely ignore ones that our implementation doesn't care about. + transport_options->wait_for_transfer_notification = true; + if (webvr_use_gpu_fence_) { + transport_options->wait_for_gpu_fence = true; + } else { + transport_options->wait_for_render_notification = true; + } + + return transport_options; +} + void VrShellGl::InitializeRenderer() { gvr_api_->InitializeGl(); gfx::Transform head_pose; @@ -541,7 +599,8 @@ webvr_right_viewport_.get()); webvr_right_viewport_->SetSourceBufferIndex(kFramePrimaryBuffer); - browser_->GvrDelegateReady(gvr_api_->GetViewerType()); + browser_->GvrDelegateReady(gvr_api_->GetViewerType(), + GetWebVrFrameTransportOptions()); } void VrShellGl::UpdateController(const gfx::Transform& head_pose, @@ -824,11 +883,9 @@ gvr_api_.get(), &render_info_primary_.head_pose); } - gfx::Vector3dF forward_vector = - vr::GetForwardVector(render_info_primary_.head_pose); - // Update the render position of all UI elements (including desktop). - bool scene_changed = ui_->scene()->OnBeginFrame(current_time, forward_vector); + bool scene_changed = + ui_->scene()->OnBeginFrame(current_time, render_info_primary_.head_pose); // WebVR handles controller input in OnVsync. if (!ShouldDrawWebVr()) @@ -961,7 +1018,7 @@ acquired_frame_.Unbind(); } - if (ShouldDrawWebVr() && surfaceless_rendering_) { + if (ShouldDrawWebVr() && surfaceless_rendering_ && !webvr_use_gpu_fence_) { // Continue with submit once a GL fence signals that current drawing // operations have completed. std::unique_ptr<gl::GLFenceEGL> fence = gl::GLFenceEGL::Create(); @@ -1000,6 +1057,36 @@ DrawFrameSubmitNow(frame_index, head_pose); } +void VrShellGl::AddWebVrRenderTimeEstimate(int16_t frame_index, + base::TimeTicks submit_start, + base::TimeTicks submit_done) { + base::TimeDelta submit_elapsed = submit_done - submit_start; + + int16_t prev_idx = + (frame_index + kPoseRingBufferSize - 1) % kPoseRingBufferSize; + base::TimeTicks prev_js_submit = webvr_time_js_submit_[prev_idx]; + if (webvr_use_gpu_fence_ && !prev_js_submit.is_null()) { + // If we don't wait for rendering to complete, estimate render time for the + // *previous* frame based on GVR timing. + if (submit_elapsed > base::TimeDelta::FromMilliseconds(2)) { + // Submit was slow, assume this is the true render time. + base::TimeDelta prev_render_delta = submit_done - prev_js_submit; + webvr_render_time_.AddSample(prev_render_delta); + } else { + // Submit didn't block. True completion time could have been anywhere + // between the last GVR submit and now. Just decay the average down a + // bit. We could try to estimate based on the difference between + // submit_start and prev_js_submit, but that tends to be an + // underestimate. + base::TimeDelta prev_render_delta = + webvr_render_time_.GetAverageOrDefault( + vsync_helper_.DisplayVSyncInterval()) * + kWebVrSlowSubmitDecayFactor; + webvr_render_time_.AddSample(prev_render_delta); + } + } +} + void VrShellGl::DrawFrameSubmitNow(int16_t frame_index, const gfx::Transform& head_pose) { TRACE_EVENT1("gpu", "VrShellGl::DrawFrameSubmitNow", "frame", frame_index); @@ -1010,7 +1097,9 @@ TRACE_EVENT0("gpu", "VrShellGl::SubmitToGvr"); base::TimeTicks submit_start = base::TimeTicks::Now(); acquired_frame_.Submit(*buffer_viewport_list_, mat); - webvr_submit_time_.AddSample(base::TimeTicks::Now() - submit_start); + base::TimeTicks submit_done = base::TimeTicks::Now(); + webvr_submit_time_.AddSample(submit_done - submit_start); + AddWebVrRenderTimeEstimate(frame_index, submit_start, submit_done); CHECK(!acquired_frame_); } @@ -1026,17 +1115,30 @@ // off the transfer surface, but that appears to result in overstuffed // buffers. if (submit_client_) { - submit_client_->OnSubmitFrameRendered(); + if (webvr_use_gpu_fence_) { + // Make a GpuFence and pass it to the Renderer for sequencing frames. + std::unique_ptr<gl::GLFence> gl_fence = gl::GLFence::CreateForGpuFence(); + std::unique_ptr<gfx::GpuFence> gpu_fence = gl_fence->GetGpuFence(); + submit_client_->OnSubmitFrameGpuFence( + gfx::CloneHandleForIPC(gpu_fence->GetGpuFenceHandle())); + } else { + // Renderer is waiting for the previous frame to render, unblock it now. + submit_client_->OnSubmitFrameRendered(); + } } if (ShouldDrawWebVr()) { - base::TimeTicks now = base::TimeTicks::Now(); base::TimeTicks pose_time = webvr_time_pose_[frame_index % kPoseRingBufferSize]; base::TimeTicks js_submit_time = webvr_time_js_submit_[frame_index % kPoseRingBufferSize]; webvr_js_time_.AddSample(js_submit_time - pose_time); - webvr_render_time_.AddSample(now - js_submit_time); + if (!webvr_use_gpu_fence_) { + // Estimate render time from wallclock time, we waited for the pre-submit + // render fence to signal. + base::TimeTicks now = base::TimeTicks::Now(); + webvr_render_time_.AddSample(now - js_submit_time); + } } // After saving the timestamp, fps will be available via GetFPS(). @@ -1154,9 +1256,14 @@ vsync_helper_.RequestVSync( base::Bind(&VrShellGl::OnVSync, base::Unretained(this))); + // Process WebVR presenting VSync (VRDisplay rAF). if (!callback_.is_null()) { + // A callback was stored by GetVSync. Use it now for sending a VSync. SendVSync(frame_time, base::ResetAndReturn(&callback_)); } else { + // We don't have a callback yet. Mark that there's a pending VSync + // to indicate that the next GetVSync is allowed to call SendVSync + // immediately. pending_vsync_ = true; pending_time_ = frame_time; } @@ -1261,7 +1368,57 @@ return expected_frame_time; } +bool VrShellGl::ShouldSkipVSync() { + // Disable heuristic for traditional render path where we submit completed + // frames. + if (!webvr_use_gpu_fence_) + return false; + + int16_t prev_idx = + (frame_index_ + kPoseRingBufferSize - 1) % kPoseRingBufferSize; + base::TimeTicks prev_js_submit = webvr_time_js_submit_[prev_idx]; + if (prev_js_submit.is_null()) + return false; + + base::TimeDelta frame_interval = vsync_helper_.DisplayVSyncInterval(); + base::TimeDelta mean_render_time = + webvr_render_time_.GetAverageOrDefault(frame_interval); + base::TimeDelta prev_render_time_left = + mean_render_time - (base::TimeTicks::Now() - prev_js_submit); + base::TimeDelta mean_js_time = webvr_js_time_.GetAverage(); + base::TimeDelta mean_js_wait = webvr_js_wait_time_.GetAverage(); + base::TimeDelta mean_gvr_wait = webvr_submit_time_.GetAverage(); + // We don't want the next frame to arrive too early. Estimated + // time-to-new-frame is the net JavaScript time (not counting time spent + // waiting) plus the net render time (not counting time blocked in submit). + // Ideally we'd want the new frame to be ready one vsync interval after the + // current frame finishes rendering, but allow being a half vsync early. + if (mean_js_time - mean_js_wait + mean_render_time - mean_gvr_wait < + prev_render_time_left + frame_interval / 2) { + return true; + } + + if (webvr_unstuff_ratelimit_frames_ > 0) { + --webvr_unstuff_ratelimit_frames_; + } else if (webvr_acquire_time_.GetAverage() >= kWebVrSlowAcquireThreshold && + mean_render_time < frame_interval) { + webvr_unstuff_ratelimit_frames_ = kWebVrUnstuffMaxDropRate; + return true; + } + return false; +} + void VrShellGl::SendVSync(base::TimeTicks time, GetVSyncCallback callback) { + DVLOG(2) << __FUNCTION__; + // There must not be a stored callback at this point, callers should use + // ResetAndReturn to clear it before calling this method. + DCHECK(!callback_); + + if (ShouldSkipVSync()) { + callback_ = std::move(callback); + return; + } + uint8_t frame_index = frame_index_++; TRACE_EVENT1("input", "VrShellGl::SendVSync", "frame", frame_index);
diff --git a/chrome/browser/android/vr_shell/vr_shell_gl.h b/chrome/browser/android/vr_shell/vr_shell_gl.h index 441b0f0e..bcc7c50 100644 --- a/chrome/browser/android/vr_shell/vr_shell_gl.h +++ b/chrome/browser/android/vr_shell/vr_shell_gl.h
@@ -55,6 +55,7 @@ class FPSMeter; class SlidingTimeDeltaAverage; class Ui; +struct Assets; } // namespace vr namespace vr_shell { @@ -114,17 +115,21 @@ void ConnectPresentingService( device::mojom::VRSubmitFrameClientPtrInfo submit_client_info, device::mojom::VRPresentationProviderRequest request, - device::mojom::VRDisplayInfoPtr display_info); + device::mojom::VRDisplayInfoPtr display_info, + device::mojom::VRRequestPresentOptionsPtr present_options); void set_is_exiting(bool exiting) { is_exiting_ = exiting; } void OnSwapContents(int new_content_id); - void OnAssetsLoaded(std::unique_ptr<SkBitmap> background_image, + void OnAssetsLoaded(vr::AssetsLoadStatus status, + std::unique_ptr<vr::Assets> assets, const base::Version& component_version); private: void GvrInit(gvr_context* gvr_api); + device::mojom::VRDisplayFrameTransportOptionsPtr + GetWebVrFrameTransportOptions(); void InitializeRenderer(); // Returns true if successfully resized. bool ResizeForWebVR(int16_t frame_index); @@ -160,6 +165,9 @@ void OnWebVrFrameTimedOut(); base::TimeDelta GetPredictedFrameTime(); + void AddWebVrRenderTimeEstimate(int16_t frame_index, + base::TimeTicks submit_start, + base::TimeTicks submit_done); void OnVSync(base::TimeTicks frame_time); @@ -177,6 +185,7 @@ void ForceExitVr(); + bool ShouldSkipVSync(); void SendVSync(base::TimeTicks time, GetVSyncCallback callback); void ClosePresentationBindings(); @@ -184,8 +193,9 @@ // samplerExternalOES texture data for WebVR content image. int webvr_texture_id_ = 0; - // Set from feature flag. + // Set from feature flags. bool webvr_vsync_align_; + bool webvr_experimental_rendering_; scoped_refptr<gl::GLSurface> surface_; scoped_refptr<gl::GLContext> context_; @@ -212,6 +222,15 @@ gfx::Size render_size_default_; gfx::Size render_size_webvr_ui_; + // WebVR currently supports multiple render path choices, with runtime + // selection based on underlying support being available and feature flags. + // The webvr_use_* booleans choose among the implementations. Please don't + // check webvr_experimental_rendering_ or other feature flags in individual + // code paths directly to avoid inconsistent logic. + bool webvr_use_gpu_fence_ = false; + + int webvr_unstuff_ratelimit_frames_ = 0; + bool cardboard_ = false; gfx::Quaternion controller_quat_; @@ -236,9 +255,18 @@ scoped_refptr<base::SingleThreadTaskRunner> task_runner_; + // Attributes tracking WebVR rAF/VSync animation loop state. Blink schedules + // a callback using the GetVSync mojo call, and the callback is either passed + // to SendVSync immediately, or deferred until the next OnVSync call. + // + // pending_vsync_ is set to true in OnVSync if there is no current + // outstanding callback, and this means that a future GetVSync is permitted + // to execute SendVSync immediately. If it is false, GetVSync must store the + // pending callback in callback_ for later execution. base::TimeTicks pending_time_; bool pending_vsync_ = false; GetVSyncCallback callback_; + mojo::Binding<device::mojom::VRPresentationProvider> binding_; device::mojom::VRSubmitFrameClientPtr submit_client_;
diff --git a/chrome/browser/banners/app_banner_infobar_delegate_android.cc b/chrome/browser/banners/app_banner_infobar_delegate_android.cc index 3d62a4b..e9d49446 100644 --- a/chrome/browser/banners/app_banner_infobar_delegate_android.cc +++ b/chrome/browser/banners/app_banner_infobar_delegate_android.cc
@@ -284,7 +284,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier AppBannerInfoBarDelegateAndroid::GetIdentifier() const { - return APP_BANNER_INFOBAR_DELEGATE_ANDROID; + return APP_BANNER_INFOBAR_DELEGATE; } void AppBannerInfoBarDelegateAndroid::InfoBarDismissed() {
diff --git a/chrome/browser/banners/app_banner_infobar_delegate_desktop.cc b/chrome/browser/banners/app_banner_infobar_delegate_desktop.cc index 721dd1b..380528d1 100644 --- a/chrome/browser/banners/app_banner_infobar_delegate_desktop.cc +++ b/chrome/browser/banners/app_banner_infobar_delegate_desktop.cc
@@ -57,7 +57,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier AppBannerInfoBarDelegateDesktop::GetIdentifier() const { - return APP_BANNER_INFOBAR_DELEGATE_DESKTOP; + return APP_BANNER_INFOBAR_DELEGATE; } const gfx::VectorIcon& AppBannerInfoBarDelegateDesktop::GetVectorIcon() const {
diff --git a/chrome/browser/browser_process_platform_part_chromeos.cc b/chrome/browser/browser_process_platform_part_chromeos.cc index e5fafce..097bf2c 100644 --- a/chrome/browser/browser_process_platform_part_chromeos.cc +++ b/chrome/browser/browser_process_platform_part_chromeos.cc
@@ -25,6 +25,7 @@ #include "chrome/browser/chromeos/system/system_clock.h" #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" #include "chrome/browser/chromeos/system/timezone_util.h" +#include "chrome/browser/component_updater/cros_component_installer.h" #include "chrome/browser/ui/ash/ash_util.h" #include "chrome/common/chrome_features.h" #include "chrome/common/chrome_switches.h" @@ -100,6 +101,19 @@ session_manager_.reset(); } +void BrowserProcessPlatformPart::InitializeCrosComponentManager() { + DCHECK(!cros_component_manager_); + cros_component_manager_ = + std::make_unique<component_updater::CrOSComponentManager>(); + + // Register all installed components for regular update. + cros_component_manager_->RegisterInstalled(); +} + +void BrowserProcessPlatformPart::ShutdownCrosComponentManager() { + cros_component_manager_.reset(); +} + void BrowserProcessPlatformPart::RegisterKeepAlive() { DCHECK(!keep_alive_); keep_alive_.reset( @@ -193,29 +207,6 @@ system_clock_.reset(); } -void BrowserProcessPlatformPart::RegisterCompatibleCrosComponentPath( - const std::string& name, - const base::FilePath& path) { - compatible_cros_components_[name] = path; -} - -void BrowserProcessPlatformPart::UnregisterCompatibleCrosComponentPath( - const std::string& name) { - compatible_cros_components_.erase(name); -} - -bool BrowserProcessPlatformPart::IsCompatibleCrosComponent( - const std::string& name) const { - return compatible_cros_components_.count(name) > 0; -} - -base::FilePath BrowserProcessPlatformPart::GetCompatibleCrosComponentPath( - const std::string& name) const { - const auto it = compatible_cros_components_.find(name); - return it == compatible_cros_components_.end() ? base::FilePath() - : it->second; -} - ui::InputDeviceControllerClient* BrowserProcessPlatformPart::GetInputDeviceControllerClient() { if (!input_device_controller_client_) {
diff --git a/chrome/browser/browser_process_platform_part_chromeos.h b/chrome/browser/browser_process_platform_part_chromeos.h index a118650..dd767e72 100644 --- a/chrome/browser/browser_process_platform_part_chromeos.h +++ b/chrome/browser/browser_process_platform_part_chromeos.h
@@ -9,7 +9,6 @@ #include <string> #include "base/compiler_specific.h" -#include "base/containers/flat_map.h" #include "base/macros.h" #include "base/sequence_checker.h" #include "chrome/browser/browser_process_platform_part_base.h" @@ -40,6 +39,10 @@ class InputDeviceControllerClient; } +namespace component_updater { +class CrOSComponentManager; +} + class ScopedKeepAlive; class BrowserProcessPlatformPart : public BrowserProcessPlatformPartBase { @@ -59,6 +62,9 @@ void InitializeSessionManager(); void ShutdownSessionManager(); + void InitializeCrosComponentManager(); + void ShutdownCrosComponentManager(); + // Disable the offline interstitial easter egg if the device is enterprise // enrolled. void DisableDinoEasterEggIfEnrolled(); @@ -90,6 +96,10 @@ return device_disabling_manager_.get(); } + component_updater::CrOSComponentManager* cros_component_manager() { + return cros_component_manager_.get(); + } + chromeos::system::TimeZoneResolverManager* GetTimezoneResolverManager(); chromeos::TimeZoneResolver* GetTimezoneResolver(); @@ -104,21 +114,6 @@ chromeos::system::SystemClock* GetSystemClock(); void DestroySystemClock(); - // Saves the name and install path of a compatible component. - void RegisterCompatibleCrosComponentPath(const std::string& name, - const base::FilePath& path); - - // Removes the name and install path entry of a component. - void UnregisterCompatibleCrosComponentPath(const std::string& name); - - // Checks if the current installed component is compatible given a component - // |name|. If compatible, sets |path| to be its installed path. - bool IsCompatibleCrosComponent(const std::string& name) const; - - // Returns installed path of a compatible component given |name|. Returns an - // empty path if the component isn't compatible. - base::FilePath GetCompatibleCrosComponentPath(const std::string& name) const; - ui::InputDeviceControllerClient* GetInputDeviceControllerClient(); private: @@ -147,8 +142,8 @@ std::unique_ptr<ScopedKeepAlive> keep_alive_; - // Maps from a compatible component name to its installed path. - base::flat_map<std::string, base::FilePath> compatible_cros_components_; + std::unique_ptr<component_updater::CrOSComponentManager> + cros_component_manager_; #if defined(USE_OZONE) std::unique_ptr<ui::InputDeviceControllerClient>
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 64ef941..0edf5f0 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1912,8 +1912,9 @@ copy_switches = true; } if (mash_service_registry::IsMashServiceName(identity.name())) { - command_line->AppendSwitchASCII(switches::kMashServiceName, - identity.name()); + command_line->AppendSwitchASCII( + switches::kMashServiceName, + mash_service_registry::GetMashServiceLabel(identity.name())); } #endif // TODO(sky): move to a whitelist, but currently the set of flags is rather @@ -3474,9 +3475,7 @@ throttles.push_back(std::move(background_tab_navigation_throttle)); #endif -// TODO(764520): Remove the OS_CHROMEOS part of the condition once Gaia password -// reuse feature is enabled on Chrome OS. -#if defined(SAFE_BROWSING_DB_LOCAL) && !defined(OS_CHROMEOS) +#if defined(SAFE_BROWSING_DB_LOCAL) std::unique_ptr<content::NavigationThrottle> password_protection_navigation_throttle = safe_browsing::MaybeCreateNavigationThrottle(handle); @@ -3688,7 +3687,8 @@ std::vector<std::unique_ptr<content::URLLoaderThrottle>> ChromeContentBrowserClient::CreateURLLoaderThrottles( - const base::Callback<content::WebContents*()>& wc_getter) { + const base::Callback<content::WebContents*()>& wc_getter, + content::NavigationUIData* navigation_ui_data) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK(base::FeatureList::IsEnabled(features::kNetworkService));
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 5f1e3be..21d111e6 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -376,7 +376,8 @@ const base::CommandLine& command_line) override; std::vector<std::unique_ptr<content::URLLoaderThrottle>> CreateURLLoaderThrottles( - const base::Callback<content::WebContents*()>& wc_getter) override; + const base::Callback<content::WebContents*()>& wc_getter, + content::NavigationUIData* navigation_ui_data) override; void RegisterNonNetworkNavigationURLLoaderFactories( content::RenderFrameHost* frame_host, NonNetworkURLLoaderFactoryMap* factories) override;
diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc index d39989e4..7a307c5a 100644 --- a/chrome/browser/chrome_quota_permission_context.cc +++ b/chrome/browser/chrome_quota_permission_context.cc
@@ -101,8 +101,8 @@ // If the site requested larger quota than this threshold, show a different // message to the user. return l10n_util::GetStringFUTF16( - (is_large_quota_request_ ? IDS_REQUEST_LARGE_QUOTA_INFOBAR_QUESTION - : IDS_REQUEST_QUOTA_INFOBAR_QUESTION), + (is_large_quota_request_ ? IDS_REQUEST_LARGE_QUOTA_INFOBAR_TEXT + : IDS_REQUEST_QUOTA_INFOBAR_TEXT), url_formatter::FormatUrlForSecurityDisplay(origin_url_)); } #endif
diff --git a/chrome/browser/chrome_site_per_process_browsertest.cc b/chrome/browser/chrome_site_per_process_browsertest.cc index 8c6ea242..ee3358b 100644 --- a/chrome/browser/chrome_site_per_process_browsertest.cc +++ b/chrome/browser/chrome_site_per_process_browsertest.cc
@@ -685,6 +685,52 @@ EXPECT_TRUE(renderer_alive); } +// Ensure that when a window closes itself via window.close(), its process does +// not get destroyed if there's a pending cross-process navigation in the same +// process from another tab. See https://crbug.com/799399. +IN_PROC_BROWSER_TEST_F(ChromeSitePerProcessTest, + ClosePopupWithPendingNavigationInOpener) { + // Start on a.com and open a popup to b.com. + GURL opener_url(embedded_test_server()->GetURL("a.com", "/title1.html")); + ui_test_utils::NavigateToURL(browser(), opener_url); + content::WebContents* opener_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + + GURL popup_url(embedded_test_server()->GetURL("b.com", "/title1.html")); + content::WindowedNotificationObserver popup_observer( + chrome::NOTIFICATION_TAB_ADDED, + content::NotificationService::AllSources()); + EXPECT_TRUE(ExecuteScript(opener_contents, + "window.open('" + popup_url.spec() + "');")); + popup_observer.Wait(); + ASSERT_EQ(2, browser()->tab_strip_model()->count()); + content::WebContents* popup_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + ASSERT_NE(opener_contents, popup_contents); + EXPECT_TRUE(content::WaitForLoadStop(popup_contents)); + + // From the popup, start a navigation in the opener to b.com, but don't + // commit. + GURL b_url(embedded_test_server()->GetURL("b.com", "/title2.html")); + content::TestNavigationManager manager(opener_contents, b_url); + EXPECT_TRUE( + ExecuteScript(popup_contents, "opener.location='" + b_url.spec() + "';")); + + // Close the popup. This should *not* kill the b.com process, as it still + // has a pending navigation in the opener window. + content::RenderProcessHost* b_com_rph = + popup_contents->GetMainFrame()->GetProcess(); + content::WebContentsDestroyedWatcher destroyed_watcher(popup_contents); + EXPECT_TRUE(ExecuteScript(popup_contents, "window.close();")); + destroyed_watcher.Wait(); + EXPECT_TRUE(b_com_rph->HasConnection()); + + // Resume the pending navigation in the original tab and ensure it finishes + // loading successfully. + manager.WaitForNavigationFinished(); + EXPECT_EQ(b_url, opener_contents->GetMainFrame()->GetLastCommittedURL()); +} + #if BUILDFLAG(ENABLE_SPELLCHECK) // Class to sniff incoming spellcheck IPC / Mojo SpellCheckHost messages. class TestSpellCheckMessageFilter : public content::BrowserMessageFilter,
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn index 35910c5..abd1c42 100644 --- a/chrome/browser/chromeos/BUILD.gn +++ b/chrome/browser/chromeos/BUILD.gn
@@ -99,6 +99,7 @@ "//components/ownership", "//components/pairing", "//components/password_manager/core/browser", + "//components/password_manager/core/browser:hash_password_manager", "//components/policy:generated", "//components/policy/core/browser", "//components/pref_registry", @@ -146,7 +147,8 @@ "//extensions/browser", "//extensions/browser/kiosk", "//gpu", - "//gpu/ipc/host:host", + "//gpu/ipc/host", + "//gpu/ipc/service", "//mash/public/interfaces", "//media", "//media/mojo/interfaces", @@ -295,6 +297,8 @@ "app_mode/kiosk_session_plugin_handler_delegate.h", "app_mode/startup_app_launcher.cc", "app_mode/startup_app_launcher.h", + "app_mode/startup_app_launcher_update_checker.cc", + "app_mode/startup_app_launcher_update_checker.h", "arc/accessibility/arc_accessibility_helper_bridge.cc", "arc/accessibility/arc_accessibility_helper_bridge.h", "arc/accessibility/ax_tree_source_arc.cc", @@ -488,6 +492,8 @@ "customization/customization_document.h", "customization/customization_wallpaper_downloader.cc", "customization/customization_wallpaper_downloader.h", + "customization/customization_wallpaper_util.cc", + "customization/customization_wallpaper_util.h", "dbus/chrome_component_updater_service_provider_delegate.cc", "dbus/chrome_component_updater_service_provider_delegate.h", "dbus/chrome_console_service_provider_delegate.cc", @@ -504,8 +510,8 @@ "dbus/screen_lock_service_provider.h", "display/display_configuration_observer.cc", "display/display_configuration_observer.h", - "display/display_preferences.cc", - "display/display_preferences.h", + "display/display_prefs.cc", + "display/display_prefs.h", "display/output_protection_controller_ash.cc", "display/output_protection_controller_ash.h", "display/output_protection_controller_mus.cc", @@ -1416,6 +1422,10 @@ "printing/cups_printers_manager.h", "printing/external_printers.cc", "printing/external_printers.h", + "printing/external_printers_factory.cc", + "printing/external_printers_factory.h", + "printing/external_printers_pref_bridge.cc", + "printing/external_printers_pref_bridge.h", "printing/ppd_provider_factory.cc", "printing/ppd_provider_factory.h", "printing/printer_configurer.cc", @@ -1766,7 +1776,7 @@ "base/file_flusher_unittest.cc", "certificate_provider/certificate_provider_service_unittest.cc", "customization/customization_document_unittest.cc", - "display/display_preferences_unittest.cc", + "display/display_prefs_unittest.cc", "drive/download_handler_unittest.cc", "drive/drive_file_stream_reader_unittest.cc", "drive/drive_integration_service_unittest.cc",
diff --git a/chrome/browser/chromeos/DEPS b/chrome/browser/chromeos/DEPS index 140aa20f..02f87458 100644 --- a/chrome/browser/chromeos/DEPS +++ b/chrome/browser/chromeos/DEPS
@@ -11,6 +11,7 @@ "+components/constrained_window", "+components/drive/drive_pref_names.h", "+components/pairing", + "+components/password_manager/core/browser/hash_password_manager.h", "+components/onc", "+components/ownership", "+components/session_manager/core",
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc index 16e43c7..c8a3419 100644 --- a/chrome/browser/chromeos/app_mode/startup_app_launcher.cc +++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.cc
@@ -13,11 +13,11 @@ #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" #include "chrome/browser/chromeos/app_mode/kiosk_diagnosis_runner.h" +#include "chrome/browser/chromeos/app_mode/startup_app_launcher_update_checker.h" #include "chrome/browser/chromeos/net/delay_network_call.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/install_tracker.h" #include "chrome/browser/extensions/install_tracker_factory.h" -#include "chrome/browser/extensions/updater/extension_updater.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/extensions/app_launch_params.h" @@ -168,62 +168,43 @@ void StartupAppLauncher::MaybeCheckExtensionUpdate() { SYSLOG(INFO) << "MaybeCheckExtensionUpdate"; - extensions::ExtensionUpdater* updater = - extensions::ExtensionSystem::Get(profile_) - ->extension_service() - ->updater(); - if (!delegate_->IsNetworkReady() || !updater || - PrimaryAppHasPendingUpdate()) { + if (!delegate_->IsNetworkReady() || PrimaryAppHasPendingUpdate()) { MaybeLaunchApp(); return; } - extension_update_found_ = false; - registrar_.Add(this, extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, - content::NotificationService::AllSources()); - // Enforce an immediate version update check for all extensions before // launching the primary app. After the chromeos is updated, the shared // module(e.g. ARC runtime) may need to be updated to a newer version // compatible with the new chromeos. See crbug.com/555083. - extensions::ExtensionUpdater::CheckParams params; - params.install_immediately = true; - params.callback = - base::Bind(&StartupAppLauncher::OnExtensionUpdateCheckFinished, - weak_ptr_factory_.GetWeakPtr()); - updater->CheckNow(params); + update_checker_ = std::make_unique<StartupAppLauncherUpdateChecker>(profile_); + if (!update_checker_->Run( + base::BindOnce(&StartupAppLauncher::OnExtensionUpdateCheckFinished, + weak_ptr_factory_.GetWeakPtr()))) { + update_checker_.reset(); + MaybeLaunchApp(); + return; + } + + SYSLOG(INFO) << "Extension update check run."; } -void StartupAppLauncher::OnExtensionUpdateCheckFinished() { +void StartupAppLauncher::OnExtensionUpdateCheckFinished(bool update_found) { + update_checker_.reset(); + SYSLOG(INFO) << "OnExtensionUpdateCheckFinished"; - if (extension_update_found_) { + if (update_found) { // Reload the primary app to make sure any reference to the previous version // of the shared module, extension, etc will be cleaned up andthe new // version will be loaded. extensions::ExtensionSystem::Get(profile_) ->extension_service() ->ReloadExtension(app_id_); - extension_update_found_ = false; } - registrar_.Remove(this, extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, - content::NotificationService::AllSources()); MaybeLaunchApp(); } -void StartupAppLauncher::Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) { - DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, type); - using UpdateDetails = const std::pair<std::string, base::Version>; - const std::string& id = content::Details<UpdateDetails>(details)->first; - const base::Version& version = - content::Details<UpdateDetails>(details)->second; - SYSLOG(INFO) << "Found extension update id=" << id - << " version=" << version.GetString(); - extension_update_found_ = true; -} - void StartupAppLauncher::OnFinishCrxInstall(const std::string& extension_id, bool success) { SYSLOG(INFO) << "OnFinishCrxInstall, id=" << extension_id
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher.h b/chrome/browser/chromeos/app_mode/startup_app_launcher.h index a01f1d3..49774ce3 100644 --- a/chrome/browser/chromeos/app_mode/startup_app_launcher.h +++ b/chrome/browser/chromeos/app_mode/startup_app_launcher.h
@@ -14,8 +14,6 @@ #include "chrome/browser/chromeos/app_mode/kiosk_app_launch_error.h" #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" #include "chrome/browser/extensions/install_observer.h" -#include "content/public/browser/notification_observer.h" -#include "content/public/browser/notification_registrar.h" class Profile; @@ -26,6 +24,7 @@ namespace chromeos { class KioskAppManager; +class StartupAppLauncherUpdateChecker; // Launches the app at startup. The flow roughly looks like this: // First call Initialize(): @@ -35,8 +34,7 @@ // Report OnLauncherInitialized() or OnLaunchFailed() to observers: // - If all goes good, launches the app and finish the flow; class StartupAppLauncher : public extensions::InstallObserver, - public KioskAppManagerObserver, - public content::NotificationObserver { + public KioskAppManagerObserver { public: class Delegate { public: @@ -93,7 +91,7 @@ void MaybeLaunchApp(); void MaybeCheckExtensionUpdate(); - void OnExtensionUpdateCheckFinished(); + void OnExtensionUpdateCheckFinished(bool update_found); void OnKioskAppDataLoadStatusChanged(const std::string& app_id); @@ -124,11 +122,6 @@ void OnKioskExtensionLoadedInCache(const std::string& app_id) override; void OnKioskExtensionDownloadFailed(const std::string& app_id) override; - // content::NotificationObserver implementation. - void Observe(int type, - const content::NotificationSource& source, - const content::NotificationDetails& details) override; - Profile* const profile_; const std::string app_id_; const bool diagnostic_mode_; @@ -138,9 +131,10 @@ bool ready_to_launch_ = false; bool wait_for_crx_update_ = false; bool secondary_apps_installed_ = false; - bool extension_update_found_ = false; - content::NotificationRegistrar registrar_; + // Used to run extension update checks for primary app's imports and + // secondary extensions. + std::unique_ptr<StartupAppLauncherUpdateChecker> update_checker_; ScopedObserver<KioskAppManager, KioskAppManagerObserver> kiosk_app_manager_observer_;
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher_update_checker.cc b/chrome/browser/chromeos/app_mode/startup_app_launcher_update_checker.cc new file mode 100644 index 0000000..68eb771 --- /dev/null +++ b/chrome/browser/chromeos/app_mode/startup_app_launcher_update_checker.cc
@@ -0,0 +1,75 @@ +// Copyright 2017 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/chromeos/app_mode/startup_app_launcher_update_checker.h" + +#include "base/callback_helpers.h" +#include "base/syslog_logging.h" +#include "chrome/browser/chrome_notification_types.h" +#include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/extensions/updater/extension_updater.h" +#include "chrome/browser/profiles/profile.h" +#include "content/public/browser/notification_service.h" +#include "extensions/browser/extension_system.h" + +namespace chromeos { + +StartupAppLauncherUpdateChecker::StartupAppLauncherUpdateChecker( + Profile* profile) + : profile_(profile) {} + +StartupAppLauncherUpdateChecker::~StartupAppLauncherUpdateChecker() = default; + +bool StartupAppLauncherUpdateChecker::Run(UpdateCheckCallback callback) { + if (callback_) { + DLOG(WARNING) << "Running multiple update check is not supported."; + return false; + } + + extensions::ExtensionUpdater* updater = + extensions::ExtensionSystem::Get(profile_) + ->extension_service() + ->updater(); + if (!updater) + return false; + + callback_ = std::move(callback); + + update_found_ = false; + registrar_.Add(this, extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, + content::NotificationService::AllSources()); + + extensions::ExtensionUpdater::CheckParams params; + params.install_immediately = true; + params.callback = + base::Bind(&StartupAppLauncherUpdateChecker::OnExtensionUpdaterDone, + weak_ptr_factory_.GetWeakPtr()); + updater->CheckNow(params); + return true; +} + +void StartupAppLauncherUpdateChecker::Observe( + int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) { + DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, type); + + using UpdateDetails = const std::pair<std::string, base::Version>; + const std::string& id = content::Details<UpdateDetails>(details)->first; + const base::Version& version = + content::Details<UpdateDetails>(details)->second; + SYSLOG(INFO) << "Found extension update id=" << id + << " version=" << version.GetString(); + update_found_ = true; +} + +void StartupAppLauncherUpdateChecker::OnExtensionUpdaterDone() { + registrar_.Remove(this, extensions::NOTIFICATION_EXTENSION_UPDATE_FOUND, + content::NotificationService::AllSources()); + + // It is not safe to use |this| after the callback has been run. + base::ResetAndReturn(&callback_).Run(update_found_); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/app_mode/startup_app_launcher_update_checker.h b/chrome/browser/chromeos/app_mode/startup_app_launcher_update_checker.h new file mode 100644 index 0000000..e5ef99bb --- /dev/null +++ b/chrome/browser/chromeos/app_mode/startup_app_launcher_update_checker.h
@@ -0,0 +1,61 @@ +// Copyright 2017 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_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_UPDATE_CHECKER_H_ +#define CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_UPDATE_CHECKER_H_ + +#include "base/callback.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "content/public/browser/notification_observer.h" +#include "content/public/browser/notification_registrar.h" + +class Profile; + +namespace chromeos { + +// Used by StartupAppLauncher to check for available extension updates for +// extensions other than the primary kiosk app - in particular for the secondary +// extensions and imports defined by the primary app. +class StartupAppLauncherUpdateChecker : public content::NotificationObserver { + public: + explicit StartupAppLauncherUpdateChecker(Profile* profile); + ~StartupAppLauncherUpdateChecker() override; + + using UpdateCheckCallback = base::OnceCallback<void(bool updates_found)>; + // Runs the extension update check. + // |callback| is called when the update check completes, with a boolean value + // indicating whether an update for an extension was found. + // Returns whether the update check has successfully started - callback will + // eventually be run only if the return value is true. + // It is safe to delete |this| before the update check is done - in that case + // the callback will never run. + bool Run(UpdateCheckCallback callback); + + // content::NotificationObserver: + void Observe(int type, + const content::NotificationSource& source, + const content::NotificationDetails& details) override; + + private: + // Callback for extension updater check. + void OnExtensionUpdaterDone(); + + Profile* const profile_; + + // Whether an extensions with an available update has been detected. + bool update_found_ = false; + + UpdateCheckCallback callback_; + + content::NotificationRegistrar registrar_; + + base::WeakPtrFactory<StartupAppLauncherUpdateChecker> weak_ptr_factory_{this}; + + DISALLOW_COPY_AND_ASSIGN(StartupAppLauncherUpdateChecker); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_APP_MODE_STARTUP_APP_LAUNCHER_UPDATE_CHECKER_H_
diff --git a/chrome/browser/chromeos/background/ash_wallpaper_delegate.cc b/chrome/browser/chromeos/background/ash_wallpaper_delegate.cc index 4a12ae0..e8d503a8d 100644 --- a/chrome/browser/chromeos/background/ash_wallpaper_delegate.cc +++ b/chrome/browser/chromeos/background/ash_wallpaper_delegate.cc
@@ -13,7 +13,6 @@ #include "base/macros.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" -#include "chrome/browser/chromeos/login/startup_utils.h" #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" #include "chrome/browser/chromeos/login/wizard_controller.h" #include "chromeos/chromeos_switches.h" @@ -64,17 +63,6 @@ bool ShouldShowInitialAnimation() override { if (IsNormalWallpaperChange() || boot_animation_finished_) return false; - - // It is a first boot case now. If kDisableBootAnimation flag - // is passed, it only disables any transition after OOBE. - bool is_registered = StartupUtils::IsDeviceRegistered(); - const base::CommandLine* command_line = - base::CommandLine::ForCurrentProcess(); - bool disable_boot_animation = - command_line->HasSwitch(switches::kDisableBootAnimation); - if (is_registered && disable_boot_animation) - return false; - return true; }
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index 07e2d1e..89d126a 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc
@@ -907,11 +907,7 @@ message_center::MessageCenter::Get()->SetProductOSName( l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_OS_NAME)); - // Register all installed components for regular update. - base::PostTaskWithTraitsAndReplyWithResult( - FROM_HERE, {base::MayBlock()}, - base::BindOnce(component_updater::CrOSComponent::GetInstalledComponents), - base::BindOnce(component_updater::CrOSComponent::RegisterComponents)); + g_browser_process->platform_part()->InitializeCrosComponentManager(); } class GuestLanguageSetCallbackData { @@ -1268,6 +1264,8 @@ g_browser_process->platform_part()->ShutdownSessionManager(); // Ash needs to be closed before UserManager is destroyed. g_browser_process->platform_part()->DestroyChromeUserManager(); + + g_browser_process->platform_part()->ShutdownCrosComponentManager(); } void ChromeBrowserMainPartsChromeos::PostDestroyThreads() {
diff --git a/chrome/browser/chromeos/customization/customization_document.cc b/chrome/browser/chromeos/customization/customization_document.cc index ea1c8370..b28b1df 100644 --- a/chrome/browser/chromeos/customization/customization_document.cc +++ b/chrome/browser/chromeos/customization/customization_document.cc
@@ -28,6 +28,7 @@ #include "base/time/time.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/customization/customization_wallpaper_downloader.h" +#include "chrome/browser/chromeos/customization/customization_wallpaper_util.h" #include "chrome/browser/chromeos/extensions/default_app_order.h" #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" #include "chrome/browser/chromeos/login/wizard_controller.h" @@ -930,9 +931,8 @@ VLOG(1) << "Setting default wallpaper to '" << GetCustomizedWallpaperDownloadedFileName().value() << "' ('" << wallpaper_url.spec() << "')"; - WallpaperManager::Get()->SetCustomizedDefaultWallpaper( - wallpaper_url, - GetCustomizedWallpaperDownloadedFileName(), + customization_wallpaper_util::StartSettingCustomizedDefaultWallpaper( + wallpaper_url, GetCustomizedWallpaperDownloadedFileName(), GetCustomizedWallpaperCacheDir()); } wallpaper_downloader_.reset();
diff --git a/chrome/browser/chromeos/customization/customization_wallpaper_util.cc b/chrome/browser/chromeos/customization/customization_wallpaper_util.cc new file mode 100644 index 0000000..e9f1142 --- /dev/null +++ b/chrome/browser/chromeos/customization/customization_wallpaper_util.cc
@@ -0,0 +1,186 @@ +// Copyright 2017 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/chromeos/customization/customization_wallpaper_util.h" + +#include "ash/wallpaper/wallpaper_controller.h" +#include "base/bind.h" +#include "base/files/file_util.h" +#include "base/location.h" +#include "base/task_scheduler/post_task.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/chromeos/customization/customization_document.h" +#include "chrome/browser/chromeos/login/users/avatar/user_image_loader.h" +#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" +#include "chrome/common/pref_names.h" +#include "components/prefs/pref_service.h" +#include "components/user_manager/user_image/user_image.h" +#include "content/public/browser/browser_thread.h" +#include "url/gurl.h" + +namespace chromeos { + +namespace { + +// Returns true if both file paths exist. +bool CheckCustomizedWallpaperFilesExist( + const base::FilePath& resized_small_path, + const base::FilePath& resized_large_path) { + return base::PathExists(resized_small_path) && + base::PathExists(resized_large_path); +} + +// Resizes and saves the customized default wallpapers. +bool ResizeAndSaveCustomizedDefaultWallpaper( + std::unique_ptr<gfx::ImageSkia> image, + const base::FilePath& resized_small_path, + const base::FilePath& resized_large_path) { + bool success = true; + + success &= ash::WallpaperController::ResizeAndSaveWallpaper( + *image, resized_small_path, wallpaper::WALLPAPER_LAYOUT_STRETCH, + ash::WallpaperController::kSmallWallpaperMaxWidth, + ash::WallpaperController::kSmallWallpaperMaxHeight, + nullptr /*output_skia=*/); + + success &= ash::WallpaperController::ResizeAndSaveWallpaper( + *image, resized_large_path, wallpaper::WALLPAPER_LAYOUT_STRETCH, + ash::WallpaperController::kLargeWallpaperMaxWidth, + ash::WallpaperController::kLargeWallpaperMaxHeight, + nullptr /*output_skia=*/); + + return success; +} + +// Checks the result of |ResizeAndSaveCustomizedDefaultWallpaper| and sends +// the paths to apply the wallpapers. +void OnCustomizedDefaultWallpaperResizedAndSaved( + const GURL& wallpaper_url, + const base::FilePath& resized_small_path, + const base::FilePath& resized_large_path, + bool success) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + if (!success) { + LOG(WARNING) << "Failed to save resized customized default wallpaper"; + return; + } + + g_browser_process->local_state()->SetString( + prefs::kCustomizationDefaultWallpaperURL, wallpaper_url.spec()); + WallpaperManager::Get()->SetCustomizedDefaultWallpaperPaths( + resized_small_path, resized_large_path); + VLOG(1) << "Customized default wallpaper applied."; +} + +// Initiates resizing and saving the customized default wallpapers if decoding +// is successful. +void OnCustomizedDefaultWallpaperDecoded( + const GURL& wallpaper_url, + const base::FilePath& resized_small_path, + const base::FilePath& resized_large_path, + std::unique_ptr<user_manager::UserImage> wallpaper) { + // Empty image indicates decode failure. + if (wallpaper->image().isNull()) { + LOG(WARNING) << "Failed to decode customized wallpaper."; + return; + } + + wallpaper->image().EnsureRepsForSupportedScales(); + + scoped_refptr<base::SequencedTaskRunner> task_runner = + base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::USER_BLOCKING, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); + base::PostTaskAndReplyWithResult( + task_runner.get(), FROM_HERE, + base::Bind(&ResizeAndSaveCustomizedDefaultWallpaper, + base::Passed(wallpaper->image().DeepCopy()), + resized_small_path, resized_large_path), + base::Bind(&OnCustomizedDefaultWallpaperResizedAndSaved, wallpaper_url, + resized_small_path, resized_large_path)); +} + +// If |both_sizes_exist| is false or the url doesn't match the current value, +// initiates image decoding, otherwise directly sends the paths. +void SetCustomizedDefaultWallpaperAfterCheck( + const GURL& wallpaper_url, + const base::FilePath& file_path, + const base::FilePath& resized_small_path, + const base::FilePath& resized_large_path, + bool both_sizes_exist) { + const std::string current_url = g_browser_process->local_state()->GetString( + prefs::kCustomizationDefaultWallpaperURL); + if (both_sizes_exist && current_url == wallpaper_url.spec()) { + WallpaperManager::Get()->SetCustomizedDefaultWallpaperPaths( + resized_small_path, resized_small_path); + } else { + // Either resized images do not exist or cached version is incorrect. + // Need to start decoding again. + scoped_refptr<base::SequencedTaskRunner> task_runner = + base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::USER_BLOCKING, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); + user_image_loader::StartWithFilePath( + task_runner, file_path, ImageDecoder::ROBUST_JPEG_CODEC, + 0, // Do not crop. + base::Bind(&OnCustomizedDefaultWallpaperDecoded, wallpaper_url, + resized_small_path, resized_large_path)); + } +} + +} // namespace + +namespace customization_wallpaper_util { + +void StartSettingCustomizedDefaultWallpaper( + const GURL& wallpaper_url, + const base::FilePath& file_path, + const base::FilePath& resized_directory) { + // Should fail if this ever happens in tests. + DCHECK(wallpaper_url.is_valid()); + if (!wallpaper_url.is_valid()) { + if (!wallpaper_url.is_empty()) { + LOG(WARNING) << "Invalid Customized Wallpaper URL '" + << wallpaper_url.spec() << "'"; + } + return; + } + + std::string downloaded_file_name = file_path.BaseName().value(); + const base::FilePath resized_small_path = resized_directory.Append( + downloaded_file_name + ash::WallpaperController::kSmallWallpaperSuffix); + const base::FilePath resized_large_path = resized_directory.Append( + downloaded_file_name + ash::WallpaperController::kLargeWallpaperSuffix); + + scoped_refptr<base::SequencedTaskRunner> task_runner = + base::CreateSequencedTaskRunnerWithTraits( + {base::MayBlock(), base::TaskPriority::USER_BLOCKING, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); + base::PostTaskAndReplyWithResult( + task_runner.get(), FROM_HERE, + base::Bind(&CheckCustomizedWallpaperFilesExist, resized_small_path, + resized_large_path), + base::Bind(&SetCustomizedDefaultWallpaperAfterCheck, wallpaper_url, + file_path, resized_small_path, resized_large_path)); +} + +base::FilePath GetCustomizedDefaultWallpaperPath(const std::string& suffix) { + const base::FilePath default_downloaded_file_name = + ServicesCustomizationDocument::GetCustomizedWallpaperDownloadedFileName(); + const base::FilePath default_cache_dir = + ServicesCustomizationDocument::GetCustomizedWallpaperCacheDir(); + if (default_downloaded_file_name.empty() || default_cache_dir.empty()) + return base::FilePath(); + return default_cache_dir.Append( + default_downloaded_file_name.BaseName().value() + suffix); +} + +bool ShouldUseCustomizedDefaultWallpaper() { + PrefService* pref_service = g_browser_process->local_state(); + return !pref_service->FindPreference(prefs::kCustomizationDefaultWallpaperURL) + ->IsDefaultValue(); +} + +} // namespace customization_wallpaper_util +} // namespace chromeos
diff --git a/chrome/browser/chromeos/customization/customization_wallpaper_util.h b/chrome/browser/chromeos/customization/customization_wallpaper_util.h new file mode 100644 index 0000000..583b7b5 --- /dev/null +++ b/chrome/browser/chromeos/customization/customization_wallpaper_util.h
@@ -0,0 +1,36 @@ +// Copyright 2017 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_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_UTIL_H_ +#define CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_UTIL_H_ + +#include <memory> + +class GURL; + +namespace base { +class FilePath; +} + +namespace chromeos { +namespace customization_wallpaper_util { + +// First checks if the file paths exist for both large and small sizes, then +// calls |SetCustomizedDefaultWallpaperAfterCheck| with |both_sizes_exist|. +void StartSettingCustomizedDefaultWallpaper( + const GURL& wallpaper_url, + const base::FilePath& file_path, + const base::FilePath& resized_directory); + +// Gets the customized default wallpaper file paths for the |suffix|. +base::FilePath GetCustomizedDefaultWallpaperPath(const std::string& suffix); + +// Whether customized default wallpaper should be used wherever a default +// wallpaper is needed. +bool ShouldUseCustomizedDefaultWallpaper(); + +} // namespace customization_wallpaper_util +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_CUSTOMIZATION_CUSTOMIZATION_WALLPAPER_UTIL_H_
diff --git a/chrome/browser/chromeos/dbus/chrome_component_updater_service_provider_delegate.cc b/chrome/browser/chromeos/dbus/chrome_component_updater_service_provider_delegate.cc index ee6c8923..401519e9 100644 --- a/chrome/browser/chromeos/dbus/chrome_component_updater_service_provider_delegate.cc +++ b/chrome/browser/chromeos/dbus/chrome_component_updater_service_provider_delegate.cc
@@ -16,14 +16,15 @@ void ChromeComponentUpdaterServiceProviderDelegate::LoadComponent( const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback) { - component_updater::CrOSComponent::LoadComponent(name, - std::move(load_callback)); + base::OnceCallback<void(const base::FilePath&)> load_callback) { + g_browser_process->platform_part()->cros_component_manager()->Load( + name, std::move(load_callback)); } bool ChromeComponentUpdaterServiceProviderDelegate::UnloadComponent( const std::string& name) { - return component_updater::CrOSComponent::UnloadComponent(name); + return g_browser_process->platform_part()->cros_component_manager()->Unload( + name); } } // namespace chromeos
diff --git a/chrome/browser/chromeos/dbus/chrome_component_updater_service_provider_delegate.h b/chrome/browser/chromeos/dbus/chrome_component_updater_service_provider_delegate.h index f8a146a..0f80f62 100644 --- a/chrome/browser/chromeos/dbus/chrome_component_updater_service_provider_delegate.h +++ b/chrome/browser/chromeos/dbus/chrome_component_updater_service_provider_delegate.h
@@ -20,7 +20,7 @@ // ComponentUpdaterServiceProvider::Delegate: void LoadComponent( const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback) override; + base::OnceCallback<void(const base::FilePath&)> load_callback) override; bool UnloadComponent(const std::string& name) override; private:
diff --git a/chrome/browser/chromeos/display/display_configuration_observer.cc b/chrome/browser/chromeos/display/display_configuration_observer.cc index 9c7b80aa..3ad1920 100644 --- a/chrome/browser/chromeos/display/display_configuration_observer.cc +++ b/chrome/browser/chromeos/display/display_configuration_observer.cc
@@ -8,7 +8,7 @@ #include "ash/shell.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" #include "base/command_line.h" -#include "chrome/browser/chromeos/display/display_preferences.h" +#include "chrome/browser/chromeos/display/display_prefs.h" #include "chromeos/chromeos_switches.h" #include "ui/display/manager/display_layout_store.h" #include "ui/display/manager/display_manager.h" @@ -30,13 +30,13 @@ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(chromeos::switches::kFirstExecAfterBoot) && save_preference_) { - StoreDisplayPrefs(); + DisplayPrefs::Get()->StoreDisplayPrefs(); } } void DisplayConfigurationObserver::OnDisplayConfigurationChanged() { if (save_preference_) - StoreDisplayPrefs(); + DisplayPrefs::Get()->StoreDisplayPrefs(); } void DisplayConfigurationObserver::OnTabletModeStarted() {
diff --git a/chrome/browser/chromeos/display/display_preferences.h b/chrome/browser/chromeos/display/display_preferences.h deleted file mode 100644 index 4a9cd294..0000000 --- a/chrome/browser/chromeos/display/display_preferences.h +++ /dev/null
@@ -1,67 +0,0 @@ -// Copyright (c) 2012 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_CHROMEOS_DISPLAY_DISPLAY_PREFERENCES_H_ -#define CHROME_BROWSER_CHROMEOS_DISPLAY_DISPLAY_PREFERENCES_H_ - -#include <stdint.h> -#include <array> - -#include "third_party/cros_system_api/dbus/service_constants.h" -#include "ui/display/display_layout.h" - -class PrefRegistrySimple; - -namespace gfx { -class Point; -} - -namespace display { -struct TouchCalibrationData; -} - -namespace chromeos { - -// Registers the prefs associated with display settings and stored -// into Local State. -void RegisterDisplayLocalStatePrefs(PrefRegistrySimple* registry); - -// Stores the current displays prefereces (both primary display id and -// dispay layout). -void StoreDisplayPrefs(); - -// If there is an internal display, stores |rotation_lock| along with the -// current rotation of the internal display. Otherwise no data is stored. -void StoreDisplayRotationPrefs(bool rotation_lock); - -// Load display preferences from Local Store. |first_run_after_boot| is used -// determine if a certain preference should be applied at boot time or -// restart. -void LoadDisplayPreferences(bool first_run_after_boot); - -// Stores the display layout for given display pairs for tests. -void StoreDisplayLayoutPrefForTest(const display::DisplayIdList& list, - const display::DisplayLayout& layout); - -// Stores the given |power_state| for tests. -void StoreDisplayPowerStateForTest(DisplayPowerState power_state); - -// Loads the touch association preference and updates the touch device manager. -void LoadTouchAssociationPreferenceForTest(); - -// Stores touch calibration data for display identified by |display_id| in the -// deprecated legacy format. -void StoreLegacyTouchDataForTest(int64_t display_id, - const display::TouchCalibrationData& data); - -// Parses the marshalled string data stored in local preferences for calibration -// points and populates |point_pair_quad| using the unmarshalled data. -// See TouchCalibrationData in Managed display info. -bool ParseTouchCalibrationStringForTest( - const std::string& str, - std::array<std::pair<gfx::Point, gfx::Point>, 4>* point_pair_quad); - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_DISPLAY_DISPLAY_PREFERENCES_H_
diff --git a/chrome/browser/chromeos/display/display_preferences.cc b/chrome/browser/chromeos/display/display_prefs.cc similarity index 84% rename from chrome/browser/chromeos/display/display_preferences.cc rename to chrome/browser/chromeos/display/display_prefs.cc index 3fca1c5..1b70215 100644 --- a/chrome/browser/chromeos/display/display_preferences.cc +++ b/chrome/browser/chromeos/display/display_prefs.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/chromeos/display/display_preferences.h" +#include "chrome/browser/chromeos/display/display_prefs.h" #include <stddef.h> @@ -14,14 +14,12 @@ #include "base/strings/string_util.h" #include "base/sys_info.h" #include "base/values.h" -#include "chrome/browser/browser_process.h" #include "chrome/common/pref_names.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_manager.h" #include "third_party/cros_system_api/dbus/service_constants.h" -#include "ui/display/display.h" #include "ui/display/manager/display_layout_store.h" #include "ui/display/manager/display_manager.h" #include "ui/display/manager/display_manager_utilities.h" @@ -33,6 +31,7 @@ #include "url/url_util.h" namespace chromeos { + namespace { const char kInsetsTopKey[] = "insets_top"; @@ -165,20 +164,19 @@ bool UserCanSaveDisplayPreference() { user_manager::UserManager* user_manager = user_manager::UserManager::Get(); return user_manager->IsUserLoggedIn() && - (user_manager->IsLoggedInAsUserWithGaiaAccount() || - user_manager->IsLoggedInAsSupervisedUser() || - user_manager->IsLoggedInAsKioskApp()); + (user_manager->IsLoggedInAsUserWithGaiaAccount() || + user_manager->IsLoggedInAsSupervisedUser() || + user_manager->IsLoggedInAsKioskApp()); } -void LoadDisplayLayouts() { - PrefService* local_state = g_browser_process->local_state(); +void LoadDisplayLayouts(PrefService* local_state) { display::DisplayLayoutStore* layout_store = GetDisplayManager()->layout_store(); - const base::DictionaryValue* layouts = local_state->GetDictionary( - prefs::kSecondaryDisplays); - for (base::DictionaryValue::Iterator it(*layouts); - !it.IsAtEnd(); it.Advance()) { + const base::DictionaryValue* layouts = + local_state->GetDictionary(prefs::kSecondaryDisplays); + for (base::DictionaryValue::Iterator it(*layouts); !it.IsAtEnd(); + it.Advance()) { std::unique_ptr<display::DisplayLayout> layout(new display::DisplayLayout); if (!display::JsonToDisplayLayout(it.value(), layout.get())) { LOG(WARNING) << "Invalid preference value for " << it.key(); @@ -202,12 +200,11 @@ } } -void LoadDisplayProperties() { - PrefService* local_state = g_browser_process->local_state(); - const base::DictionaryValue* properties = local_state->GetDictionary( - prefs::kDisplayProperties); - for (base::DictionaryValue::Iterator it(*properties); - !it.IsAtEnd(); it.Advance()) { +void LoadDisplayProperties(PrefService* local_state) { + const base::DictionaryValue* properties = + local_state->GetDictionary(prefs::kDisplayProperties); + for (base::DictionaryValue::Iterator it(*properties); !it.IsAtEnd(); + it.Advance()) { const base::DictionaryValue* dict_value = nullptr; if (!it.value().GetAsDictionary(&dict_value) || dict_value == nullptr) continue; @@ -247,8 +244,7 @@ } } -void LoadDisplayRotationState() { - PrefService* local_state = g_browser_process->local_state(); +void LoadDisplayRotationState(PrefService* local_state) { const base::DictionaryValue* properties = local_state->GetDictionary(prefs::kDisplayRotationLock); @@ -264,8 +260,7 @@ rotation_lock, static_cast<display::Display::Rotation>(rotation)); } -void LoadDisplayTouchAssociations() { - PrefService* local_state = g_browser_process->local_state(); +void LoadDisplayTouchAssociations(PrefService* local_state) { const base::DictionaryValue* properties = local_state->GetDictionary(prefs::kDisplayTouchAssociations); @@ -306,7 +301,6 @@ // a couple of milestones when everything is stable. const display::TouchDeviceIdentifier& fallback_identifier = display::TouchDeviceIdentifier::GetFallbackTouchDeviceIdentifier(); - local_state = g_browser_process->local_state(); properties = local_state->GetDictionary(prefs::kDisplayProperties); for (base::DictionaryValue::Iterator it(*properties); !it.IsAtEnd(); it.Advance()) { @@ -340,8 +334,7 @@ // Loads mirror info for each external display, the info will later be used to // restore mirror mode. -void LoadExternalDisplayMirrorInfo() { - PrefService* local_state = g_browser_process->local_state(); +void LoadExternalDisplayMirrorInfo(PrefService* local_state) { const base::ListValue* pref_data = local_state->GetList(prefs::kExternalDisplayMirrorInfo); std::set<int64_t> external_display_mirror_info; @@ -360,12 +353,12 @@ external_display_mirror_info); } -void StoreDisplayLayoutPref(const display::DisplayIdList& list, +void StoreDisplayLayoutPref(PrefService* local_state, + const display::DisplayIdList& list, const display::DisplayLayout& display_layout) { DCHECK(display::DisplayLayout::Validate(list, display_layout)); std::string name = display::DisplayIdListToString(list); - PrefService* local_state = g_browser_process->local_state(); DictionaryPrefUpdate update(local_state, prefs::kSecondaryDisplays); base::DictionaryValue* pref_data = update.Get(); std::unique_ptr<base::Value> layout_value(new base::DictionaryValue()); @@ -378,7 +371,7 @@ pref_data->Set(name, std::move(layout_value)); } -void StoreCurrentDisplayLayoutPrefs() { +void StoreCurrentDisplayLayoutPrefs(PrefService* local_state) { display::DisplayManager* display_manager = GetDisplayManager(); if (!UserCanSaveDisplayPreference() || display_manager->num_connected_displays() < 2) { @@ -397,12 +390,11 @@ return; } - StoreDisplayLayoutPref(list, display_layout); + StoreDisplayLayoutPref(local_state, list, display_layout); } -void StoreCurrentDisplayProperties() { +void StoreCurrentDisplayProperties(PrefService* local_state) { display::DisplayManager* display_manager = GetDisplayManager(); - PrefService* local_state = g_browser_process->local_state(); DictionaryPrefUpdate update(local_state, prefs::kDisplayProperties); base::DictionaryValue* pref_data = update.Get(); @@ -464,7 +456,7 @@ DisplayPowerStateToStringMap; const DisplayPowerStateToStringMap* GetDisplayPowerStateToStringMap() { - // Don't save or retore ALL_OFF state. crbug.com/318456. + // Don't save or retore ALL_OFF state. http://crbug.com/318456. static const DisplayPowerStateToStringMap* map = display::CreateToStringMap( chromeos::DISPLAY_POWER_ALL_ON, "all_on", chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON, @@ -482,33 +474,47 @@ return false; } -void StoreDisplayPowerState(DisplayPowerState power_state) { +void StoreDisplayPowerState(PrefService* local_state, + DisplayPowerState power_state) { const DisplayPowerStateToStringMap* map = GetDisplayPowerStateToStringMap(); DisplayPowerStateToStringMap::const_iterator iter = map->find(power_state); if (iter != map->end()) { - PrefService* local_state = g_browser_process->local_state(); local_state->SetString(prefs::kDisplayPowerState, iter->second); } } -void StoreCurrentDisplayPowerState() { +void StoreCurrentDisplayPowerState(PrefService* local_state) { StoreDisplayPowerState( + local_state, ash::Shell::Get()->display_configurator()->requested_power_state()); } -void StoreCurrentDisplayRotationLockPrefs() { +void StoreDisplayRotationPrefs(PrefService* local_state, + display::Display::Rotation rotation, + bool rotation_lock) { + DictionaryPrefUpdate update(local_state, prefs::kDisplayRotationLock); + base::DictionaryValue* pref_data = update.Get(); + pref_data->SetBoolean("lock", rotation_lock); + pref_data->SetInteger("orientation", static_cast<int>(rotation)); +} + +void StoreCurrentDisplayRotationLockPrefs(PrefService* local_state) { + if (!display::Display::HasInternalDisplay()) + return; + display::Display::Rotation rotation = + GetDisplayManager() + ->GetDisplayInfo(display::Display::InternalDisplayId()) + .GetRotation(display::Display::ROTATION_SOURCE_ACCELEROMETER); bool rotation_lock = ash::Shell::Get() ->display_manager() ->registered_internal_display_rotation_lock(); - StoreDisplayRotationPrefs(rotation_lock); + StoreDisplayRotationPrefs(local_state, rotation, rotation_lock); } -void StoreDisplayTouchAssociations() { +void StoreDisplayTouchAssociations(PrefService* local_state) { display::TouchDeviceManager* touch_device_manager = GetDisplayManager()->touch_device_manager(); - PrefService* local_state = g_browser_process->local_state(); - DictionaryPrefUpdate update(local_state, prefs::kDisplayTouchAssociations); base::DictionaryValue* pref_data = update.Get(); const display::TouchDeviceManager::TouchAssociationMap& touch_associations = @@ -557,8 +563,7 @@ } // Stores mirror info for each external display. -void StoreExternalDisplayMirrorInfo() { - PrefService* local_state = g_browser_process->local_state(); +void StoreExternalDisplayMirrorInfo(PrefService* local_state) { ListPrefUpdate update(local_state, prefs::kExternalDisplayMirrorInfo); base::ListValue* pref_data = update.Get(); pref_data->Clear(); @@ -568,9 +573,12 @@ pref_data->GetList().emplace_back(base::Value(base::Int64ToString(id))); } +DisplayPrefs* g_display_prefs = nullptr; + } // namespace -void RegisterDisplayLocalStatePrefs(PrefRegistrySimple* registry) { +// static +void DisplayPrefs::RegisterLocalStatePrefs(PrefRegistrySimple* registry) { // Per-display preference. registry->RegisterDictionaryPref(prefs::kSecondaryDisplays); registry->RegisterDictionaryPref(prefs::kDisplayProperties); @@ -582,12 +590,25 @@ registry->RegisterListPref(prefs::kExternalDisplayMirrorInfo); } -void StoreDisplayPrefs() { +// static +DisplayPrefs* DisplayPrefs::Get() { + CHECK(g_display_prefs); + return g_display_prefs; +} + +DisplayPrefs::DisplayPrefs(PrefService* local_state) + : local_state_(local_state) { + g_display_prefs = this; +} + +DisplayPrefs::~DisplayPrefs() = default; + +void DisplayPrefs::StoreDisplayPrefs() { // Stores the power state regardless of the login status, because the power // state respects to the current status (close/open) of the lid which can be - // changed in any situation. See crbug.com/285360 - StoreCurrentDisplayPowerState(); - StoreCurrentDisplayRotationLockPrefs(); + // changed in any situation. See http://crbug.com/285360 + StoreCurrentDisplayPowerState(local_state_); + StoreCurrentDisplayRotationLockPrefs(local_state_); // Do not store prefs when the confirmation dialog is shown. if (!UserCanSaveDisplayPreference() || @@ -595,37 +616,21 @@ return; } - StoreCurrentDisplayLayoutPrefs(); - StoreCurrentDisplayProperties(); - StoreDisplayTouchAssociations(); - StoreExternalDisplayMirrorInfo(); + StoreCurrentDisplayLayoutPrefs(local_state_); + StoreCurrentDisplayProperties(local_state_); + StoreDisplayTouchAssociations(local_state_); + StoreExternalDisplayMirrorInfo(local_state_); } -void StoreDisplayRotationPrefs(bool rotation_lock) { - if (!display::Display::HasInternalDisplay()) - return; - - PrefService* local_state = g_browser_process->local_state(); - DictionaryPrefUpdate update(local_state, prefs::kDisplayRotationLock); - base::DictionaryValue* pref_data = update.Get(); - pref_data->SetBoolean("lock", rotation_lock); - display::Display::Rotation rotation = - GetDisplayManager() - ->GetDisplayInfo(display::Display::InternalDisplayId()) - .GetRotation(display::Display::ROTATION_SOURCE_ACCELEROMETER); - pref_data->SetInteger("orientation", static_cast<int>(rotation)); -} - -void LoadDisplayPreferences(bool first_run_after_boot) { - LoadDisplayLayouts(); - LoadDisplayProperties(); - LoadExternalDisplayMirrorInfo(); - LoadDisplayRotationState(); - LoadDisplayTouchAssociations(); +void DisplayPrefs::LoadDisplayPreferences(bool first_run_after_boot) { + LoadDisplayLayouts(local_state_); + LoadDisplayProperties(local_state_); + LoadExternalDisplayMirrorInfo(local_state_); + LoadDisplayRotationState(local_state_); + LoadDisplayTouchAssociations(local_state_); if (!first_run_after_boot) { - PrefService* local_state = g_browser_process->local_state(); // Restore DisplayPowerState: - std::string value = local_state->GetString(prefs::kDisplayPowerState); + std::string value = local_state_->GetString(prefs::kDisplayPowerState); chromeos::DisplayPowerState power_state; if (GetDisplayPowerStateFromString(value, &power_state)) { ash::Shell::Get()->display_configurator()->SetInitialDisplayPower( @@ -634,26 +639,31 @@ } } -// Stores the display layout for given display pairs. -void StoreDisplayLayoutPrefForTest(const display::DisplayIdList& list, - const display::DisplayLayout& layout) { - StoreDisplayLayoutPref(list, layout); +void DisplayPrefs::StoreDisplayRotationPrefsForTest( + display::Display::Rotation rotation, + bool rotation_lock) { + StoreDisplayRotationPrefs(local_state_, rotation, rotation_lock); } -// Stores the given |power_state|. -void StoreDisplayPowerStateForTest(DisplayPowerState power_state) { - StoreDisplayPowerState(power_state); +void DisplayPrefs::StoreDisplayLayoutPrefForTest( + const display::DisplayIdList& list, + const display::DisplayLayout& layout) { + StoreDisplayLayoutPref(local_state_, list, layout); } -void LoadTouchAssociationPreferenceForTest() { - LoadDisplayTouchAssociations(); +void DisplayPrefs::StoreDisplayPowerStateForTest( + DisplayPowerState power_state) { + StoreDisplayPowerState(local_state_, power_state); } -void StoreLegacyTouchDataForTest(int64_t display_id, - const display::TouchCalibrationData& data) { - PrefService* local_state = g_browser_process->local_state(); +void DisplayPrefs::LoadTouchAssociationPreferenceForTest() { + LoadDisplayTouchAssociations(local_state_); +} - DictionaryPrefUpdate update(local_state, prefs::kDisplayProperties); +void DisplayPrefs::StoreLegacyTouchDataForTest( + int64_t display_id, + const display::TouchCalibrationData& data) { + DictionaryPrefUpdate update(local_state_, prefs::kDisplayProperties); base::DictionaryValue* pref_data = update.Get(); std::unique_ptr<base::DictionaryValue> property_value = std::make_unique<base::DictionaryValue>(); @@ -661,7 +671,7 @@ pref_data->Set(base::Int64ToString(display_id), std::move(property_value)); } -bool ParseTouchCalibrationStringForTest( +bool DisplayPrefs::ParseTouchCalibrationStringForTest( const std::string& str, display::TouchCalibrationData::CalibrationPointPairQuad* point_pair_quad) { return ParseTouchCalibrationStringValue(str, point_pair_quad);
diff --git a/chrome/browser/chromeos/display/display_prefs.h b/chrome/browser/chromeos/display/display_prefs.h new file mode 100644 index 0000000..b9474802 --- /dev/null +++ b/chrome/browser/chromeos/display/display_prefs.h
@@ -0,0 +1,72 @@ +// Copyright (c) 2012 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_CHROMEOS_DISPLAY_DISPLAY_PREFS_H_ +#define CHROME_BROWSER_CHROMEOS_DISPLAY_DISPLAY_PREFS_H_ + +#include <stdint.h> +#include <array> + +#include "third_party/cros_system_api/dbus/service_constants.h" +#include "ui/display/display.h" +#include "ui/display/display_layout.h" + +class PrefRegistrySimple; +class PrefService; + +namespace gfx { +class Point; +} + +namespace display { +struct TouchCalibrationData; +} + +namespace chromeos { + +// Manages display preference settings. Settings are stored in the local state +// for the session. +class DisplayPrefs { + public: + // Registers the prefs associated with display settings. + static void RegisterLocalStatePrefs(PrefRegistrySimple* registry); + + // TODO(stevenjb): Move to ash::Shell::display_prefs(). + static DisplayPrefs* Get(); + + explicit DisplayPrefs(PrefService* local_state); + + ~DisplayPrefs(); + + // Stores all current displays preferences. + void StoreDisplayPrefs(); + + // Loads display preferences from |local_state_|. |first_run_after_boot| is + // used to determine whether power state preferences should be applied. + void LoadDisplayPreferences(bool first_run_after_boot); + + // Test helper methods. + + void StoreDisplayRotationPrefsForTest(display::Display::Rotation rotation, + bool rotation_lock); + void StoreDisplayLayoutPrefForTest(const display::DisplayIdList& list, + const display::DisplayLayout& layout); + void StoreDisplayPowerStateForTest(DisplayPowerState power_state); + void LoadTouchAssociationPreferenceForTest(); + void StoreLegacyTouchDataForTest(int64_t display_id, + const display::TouchCalibrationData& data); + // Parses the marshalled string data stored in local preferences for + // calibration points and populates |point_pair_quad| using the unmarshalled + // data. See TouchCalibrationData in Managed display info. + bool ParseTouchCalibrationStringForTest( + const std::string& str, + std::array<std::pair<gfx::Point, gfx::Point>, 4>* point_pair_quad); + + private: + PrefService* local_state_; +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_DISPLAY_DISPLAY_PREFS_H_
diff --git a/chrome/browser/chromeos/display/display_preferences_unittest.cc b/chrome/browser/chromeos/display/display_prefs_unittest.cc similarity index 92% rename from chrome/browser/chromeos/display/display_preferences_unittest.cc rename to chrome/browser/chromeos/display/display_prefs_unittest.cc index de88e74c..0eb2003 100644 --- a/chrome/browser/chromeos/display/display_preferences_unittest.cc +++ b/chrome/browser/chromeos/display/display_prefs_unittest.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/chromeos/display/display_preferences.h" +#include "chrome/browser/chromeos/display/display_prefs.h" #include <stdint.h> @@ -26,7 +26,6 @@ #include "chrome/browser/chromeos/display/display_configuration_observer.h" #include "chrome/browser/chromeos/login/users/mock_user_manager.h" #include "chrome/common/pref_names.h" -#include "chrome/test/base/testing_browser_process.h" #include "components/prefs/scoped_user_pref_update.h" #include "components/prefs/testing_pref_service.h" #include "components/user_manager/scoped_user_manager.h" @@ -46,6 +45,7 @@ using ash::ResolutionNotificationController; namespace chromeos { + namespace { const char kPrimaryIdKey[] = "primary-id"; const char kPositionKey[] = "position"; @@ -93,28 +93,28 @@ return true; } -class DisplayPreferencesTest : public ash::AshTestBase { +class DisplayPrefsTest : public ash::AshTestBase { protected: - DisplayPreferencesTest() + DisplayPrefsTest() : mock_user_manager_(new MockUserManager), user_manager_enabler_(base::WrapUnique(mock_user_manager_)) {} - ~DisplayPreferencesTest() override {} + ~DisplayPrefsTest() override {} void SetUp() override { EXPECT_CALL(*mock_user_manager_, IsUserLoggedIn()) .WillRepeatedly(testing::Return(false)); EXPECT_CALL(*mock_user_manager_, Shutdown()); ash::AshTestBase::SetUp(); - RegisterDisplayLocalStatePrefs(local_state_.registry()); - TestingBrowserProcess::GetGlobal()->SetLocalState(&local_state_); + DisplayPrefs::RegisterLocalStatePrefs(local_state_.registry()); + display_prefs_ = std::make_unique<DisplayPrefs>(&local_state_); observer_ = std::make_unique<DisplayConfigurationObserver>(); observer_->OnDisplaysInitialized(); } void TearDown() override { observer_.reset(); - TestingBrowserProcess::GetGlobal()->SetLocalState(nullptr); + display_prefs_.reset(); ash::AshTestBase::TearDown(); } @@ -204,12 +204,11 @@ pref_data->Set(name, std::move(insets_value)); } - void StoreDisplayRotationPrefsForTest(bool rotation_lock, - display::Display::Rotation rotation) { - DictionaryPrefUpdate update(local_state(), prefs::kDisplayRotationLock); - base::DictionaryValue* pref_data = update.Get(); - pref_data->SetBoolean("lock", rotation_lock); - pref_data->SetInteger("orientation", static_cast<int>(rotation)); + display::Display::Rotation GetRotation() { + return ash::Shell::Get() + ->display_manager() + ->GetDisplayInfo(display::Display::InternalDisplayId()) + .GetRotation(display::Display::ROTATION_SOURCE_ACCELEROMETER); } void StoreExternalDisplayMirrorInfo( @@ -232,19 +231,21 @@ } PrefService* local_state() { return &local_state_; } + DisplayPrefs* display_prefs() { return display_prefs_.get(); } private: MockUserManager* mock_user_manager_; // Not owned. user_manager::ScopedUserManager user_manager_enabler_; TestingPrefServiceSimple local_state_; + std::unique_ptr<DisplayPrefs> display_prefs_; std::unique_ptr<ash::WindowTreeHostManager::Observer> observer_; - DISALLOW_COPY_AND_ASSIGN(DisplayPreferencesTest); + DISALLOW_COPY_AND_ASSIGN(DisplayPrefsTest); }; } // namespace -TEST_F(DisplayPreferencesTest, ListedLayoutOverrides) { +TEST_F(DisplayPrefsTest, ListedLayoutOverrides) { UpdateDisplay("100x100,200x200"); display::DisplayIdList list = display_manager()->GetCurrentDisplayIdList(); @@ -255,12 +256,12 @@ StoreDisplayLayoutPrefForList(list, display::DisplayPlacement::TOP, 20); StoreDisplayLayoutPrefForList(dummy_list, display::DisplayPlacement::LEFT, 30); - StoreDisplayPowerStateForTest( + display_prefs()->StoreDisplayPowerStateForTest( chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON); ash::Shell* shell = ash::Shell::Get(); - LoadDisplayPreferences(true); + display_prefs()->LoadDisplayPreferences(true); // DisplayPowerState should be ignored at boot. EXPECT_EQ(chromeos::DISPLAY_POWER_ALL_ON, shell->display_configurator()->requested_power_state()); @@ -281,7 +282,7 @@ GetRegisteredDisplayPlacementStr(dummy_list)); } -TEST_F(DisplayPreferencesTest, BasicStores) { +TEST_F(DisplayPrefsTest, BasicStores) { ash::WindowTreeHostManager* window_tree_host_manager = ash::Shell::Get()->window_tree_host_manager(); int64_t id1 = display::Screen::GetScreen()->GetPrimaryDisplay().id(); @@ -312,7 +313,7 @@ dummy_layout_builder.Build()); display::DisplayIdList list = display::test::CreateDisplayIdList2(id1, dummy_id); - StoreDisplayLayoutPrefForTest(list, *dummy_layout); + display_prefs()->StoreDisplayLayoutPrefForTest(list, *dummy_layout); // Can't switch to a display that does not exist. window_tree_host_manager->SetPrimaryDisplayId(dummy_id); @@ -406,7 +407,7 @@ EXPECT_FALSE(CompareTouchAssociations(expected_touch_associations_map, tdm->touch_associations())); - LoadTouchAssociationPreferenceForTest(); + display_prefs()->LoadTouchAssociationPreferenceForTest(); display::TouchDeviceManager::TouchAssociationMap actual_touch_associations_map = tdm->touch_associations(); @@ -456,8 +457,8 @@ EXPECT_TRUE(properties->GetDictionary(base::Int64ToString(id2), &property)); EXPECT_TRUE(property->GetInteger("width", &width)); EXPECT_TRUE(property->GetInteger("height", &height)); - EXPECT_TRUE(property->GetInteger( - "device-scale-factor", &device_scale_factor)); + EXPECT_TRUE( + property->GetInteger("device-scale-factor", &device_scale_factor)); EXPECT_EQ(300, width); EXPECT_EQ(200, height); EXPECT_EQ(1250, device_scale_factor); @@ -572,7 +573,7 @@ EXPECT_EQ(400, height); } -TEST_F(DisplayPreferencesTest, PreventStore) { +TEST_F(DisplayPrefsTest, PreventStore) { ResolutionNotificationController::SuppressTimerForTest(); LoggedInAsUser(); UpdateDisplay("400x300#500x400|400x300|300x200"); @@ -618,7 +619,7 @@ EXPECT_EQ(200, height); } -TEST_F(DisplayPreferencesTest, StoreForSwappedDisplay) { +TEST_F(DisplayPrefsTest, StoreForSwappedDisplay) { UpdateDisplay("100x100,200x200"); int64_t id1 = display::Screen::GetScreen()->GetPrimaryDisplay().id(); int64_t id2 = display_manager()->GetSecondaryDisplay().id(); @@ -686,7 +687,7 @@ } } -TEST_F(DisplayPreferencesTest, DontStoreInGuestMode) { +TEST_F(DisplayPrefsTest, DontStoreInGuestMode) { ash::WindowTreeHostManager* window_tree_host_manager = ash::Shell::Get()->window_tree_host_manager(); @@ -711,10 +712,12 @@ display::Display::ROTATION_SOURCE_USER); // Does not store the preferences locally. - EXPECT_FALSE(local_state()->FindPreference( - prefs::kSecondaryDisplays)->HasUserSetting()); - EXPECT_FALSE(local_state()->FindPreference( - prefs::kDisplayProperties)->HasUserSetting()); + EXPECT_FALSE(local_state() + ->FindPreference(prefs::kSecondaryDisplays) + ->HasUserSetting()); + EXPECT_FALSE(local_state() + ->FindPreference(prefs::kDisplayProperties) + ->HasUserSetting()); // Settings are still notified to the system. display::Screen* screen = display::Screen::GetScreen(); @@ -737,48 +740,48 @@ EXPECT_EQ(1.0f, info_primary.configured_ui_scale()); } -TEST_F(DisplayPreferencesTest, StorePowerStateNoLogin) { +TEST_F(DisplayPrefsTest, StorePowerStateNoLogin) { EXPECT_FALSE(local_state()->HasPrefPath(prefs::kDisplayPowerState)); // Stores display prefs without login, which still stores the power state. - StoreDisplayPrefs(); + display_prefs()->StoreDisplayPrefs(); EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayPowerState)); } -TEST_F(DisplayPreferencesTest, StorePowerStateGuest) { +TEST_F(DisplayPrefsTest, StorePowerStateGuest) { EXPECT_FALSE(local_state()->HasPrefPath(prefs::kDisplayPowerState)); LoggedInAsGuest(); - StoreDisplayPrefs(); + display_prefs()->StoreDisplayPrefs(); EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayPowerState)); } -TEST_F(DisplayPreferencesTest, StorePowerStateNormalUser) { +TEST_F(DisplayPrefsTest, StorePowerStateNormalUser) { EXPECT_FALSE(local_state()->HasPrefPath(prefs::kDisplayPowerState)); LoggedInAsUser(); - StoreDisplayPrefs(); + display_prefs()->StoreDisplayPrefs(); EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayPowerState)); } -TEST_F(DisplayPreferencesTest, DisplayPowerStateAfterRestart) { - StoreDisplayPowerStateForTest( +TEST_F(DisplayPrefsTest, DisplayPowerStateAfterRestart) { + display_prefs()->StoreDisplayPowerStateForTest( chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON); - LoadDisplayPreferences(false); + display_prefs()->LoadDisplayPreferences(false); EXPECT_EQ(chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON, ash::Shell::Get()->display_configurator()->requested_power_state()); } -TEST_F(DisplayPreferencesTest, DontSaveAndRestoreAllOff) { +TEST_F(DisplayPrefsTest, DontSaveAndRestoreAllOff) { ash::Shell* shell = ash::Shell::Get(); - StoreDisplayPowerStateForTest( + display_prefs()->StoreDisplayPowerStateForTest( chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON); - LoadDisplayPreferences(false); + display_prefs()->LoadDisplayPreferences(false); // DisplayPowerState should be ignored at boot. EXPECT_EQ(chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON, shell->display_configurator()->requested_power_state()); - StoreDisplayPowerStateForTest( + display_prefs()->StoreDisplayPowerStateForTest( chromeos::DISPLAY_POWER_ALL_OFF); EXPECT_EQ(chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON, shell->display_configurator()->requested_power_state()); @@ -787,14 +790,14 @@ // Don't try to load local_state()->SetString(prefs::kDisplayPowerState, "all_off"); - LoadDisplayPreferences(false); + display_prefs()->LoadDisplayPreferences(false); EXPECT_EQ(chromeos::DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON, shell->display_configurator()->requested_power_state()); } // Tests that display configuration changes caused by TabletModeController // are not saved. -TEST_F(DisplayPreferencesTest, DontSaveTabletModeControllerRotations) { +TEST_F(DisplayPrefsTest, DontSaveTabletModeControllerRotations) { ash::Shell* shell = ash::Shell::Get(); display::Display::SetInternalDisplayId( display::Screen::GetScreen()->GetPrimaryDisplay().id()); @@ -812,7 +815,7 @@ scoped_refptr<chromeos::AccelerometerUpdate> update( new chromeos::AccelerometerUpdate()); update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, 0.0f, 0.0f, - kMeanGravity); + kMeanGravity); update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 0.0f, -kMeanGravity, 0.0f); ash::TabletModeController* controller = ash::Shell::Get()->tablet_mode_controller(); @@ -821,7 +824,7 @@ // Trigger 90 degree rotation update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, -kMeanGravity, - 0.0f, 0.0f); + 0.0f, 0.0f); update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, -kMeanGravity, 0.0f, 0.0f); controller->OnAccelerometerUpdated(update); shell->screen_orientation_controller()->OnAccelerometerUpdated(update); @@ -838,7 +841,7 @@ // Trigger a save, the acceleration rotation should not be saved as the user // rotation. - StoreDisplayPrefs(); + display_prefs()->StoreDisplayPrefs(); properties = local_state()->GetDictionary(prefs::kDisplayProperties); property = nullptr; EXPECT_TRUE(properties->GetDictionary( @@ -849,13 +852,14 @@ } // Tests that the rotation state is saved without a user being logged in. -TEST_F(DisplayPreferencesTest, StoreRotationStateNoLogin) { +TEST_F(DisplayPrefsTest, StoreRotationStateNoLogin) { display::Display::SetInternalDisplayId( display::Screen::GetScreen()->GetPrimaryDisplay().id()); EXPECT_FALSE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); bool current_rotation_lock = IsRotationLocked(); - StoreDisplayRotationPrefs(current_rotation_lock); + display_prefs()->StoreDisplayRotationPrefsForTest(GetRotation(), + current_rotation_lock); EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); const base::DictionaryValue* properties = @@ -872,14 +876,15 @@ } // Tests that the rotation state is saved when a guest is logged in. -TEST_F(DisplayPreferencesTest, StoreRotationStateGuest) { +TEST_F(DisplayPrefsTest, StoreRotationStateGuest) { display::Display::SetInternalDisplayId( display::Screen::GetScreen()->GetPrimaryDisplay().id()); EXPECT_FALSE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); LoggedInAsGuest(); bool current_rotation_lock = IsRotationLocked(); - StoreDisplayRotationPrefs(current_rotation_lock); + display_prefs()->StoreDisplayRotationPrefsForTest(GetRotation(), + current_rotation_lock); EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); const base::DictionaryValue* properties = @@ -896,14 +901,15 @@ } // Tests that the rotation state is saved when a normal user is logged in. -TEST_F(DisplayPreferencesTest, StoreRotationStateNormalUser) { +TEST_F(DisplayPrefsTest, StoreRotationStateNormalUser) { display::Display::SetInternalDisplayId( display::Screen::GetScreen()->GetPrimaryDisplay().id()); EXPECT_FALSE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); LoggedInAsGuest(); bool current_rotation_lock = IsRotationLocked(); - StoreDisplayRotationPrefs(current_rotation_lock); + display_prefs()->StoreDisplayRotationPrefsForTest(GetRotation(), + current_rotation_lock); EXPECT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); const base::DictionaryValue* properties = @@ -921,7 +927,7 @@ // Tests that rotation state is loaded without a user being logged in, and that // entering tablet mode applies the state. -TEST_F(DisplayPreferencesTest, LoadRotationNoLogin) { +TEST_F(DisplayPrefsTest, LoadRotationNoLogin) { display::Display::SetInternalDisplayId( display::Screen::GetScreen()->GetPrimaryDisplay().id()); ASSERT_FALSE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); @@ -932,11 +938,13 @@ GetCurrentInternalDisplayRotation(); ASSERT_EQ(display::Display::ROTATE_0, initial_rotation); - StoreDisplayRotationPrefs(initial_rotation_lock); + display_prefs()->StoreDisplayRotationPrefsForTest(GetRotation(), + initial_rotation_lock); ASSERT_TRUE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); - StoreDisplayRotationPrefsForTest(true, display::Display::ROTATE_90); - LoadDisplayPreferences(false); + display_prefs()->StoreDisplayRotationPrefsForTest(display::Display::ROTATE_90, + true); + display_prefs()->LoadDisplayPreferences(false); bool display_rotation_lock = display_manager()->registered_internal_display_rotation_lock(); @@ -957,7 +965,7 @@ scoped_refptr<chromeos::AccelerometerUpdate> update( new chromeos::AccelerometerUpdate()); update->Set(chromeos::ACCELEROMETER_SOURCE_ATTACHED_KEYBOARD, 0.0f, 0.0f, - kMeanGravity); + kMeanGravity); update->Set(chromeos::ACCELEROMETER_SOURCE_SCREEN, 0.0f, -kMeanGravity, 0.0f); ash::TabletModeController* tablet_mode_controller = ash::Shell::Get()->tablet_mode_controller(); @@ -971,7 +979,7 @@ } // Tests that rotation lock being set causes the rotation state to be saved. -TEST_F(DisplayPreferencesTest, RotationLockTriggersStore) { +TEST_F(DisplayPrefsTest, RotationLockTriggersStore) { display::Display::SetInternalDisplayId( display::Screen::GetScreen()->GetPrimaryDisplay().id()); ASSERT_FALSE(local_state()->HasPrefPath(prefs::kDisplayRotationLock)); @@ -986,7 +994,7 @@ EXPECT_TRUE(properties->GetBoolean("lock", &rotation_lock)); } -TEST_F(DisplayPreferencesTest, SaveUnifiedMode) { +TEST_F(DisplayPrefsTest, SaveUnifiedMode) { LoggedInAsUser(); display_manager()->SetUnifiedDesktopEnabled(true); @@ -1042,7 +1050,7 @@ EXPECT_FALSE(stored_layout.default_unified); } -TEST_F(DisplayPreferencesTest, RestoreUnifiedMode) { +TEST_F(DisplayPrefsTest, RestoreUnifiedMode) { const int64_t first_display_id = 210000001; const int64_t second_display_id = 220000002; display::ManagedDisplayInfo first_display_info = @@ -1063,7 +1071,7 @@ StoreDisplayPropertyForList( list, "primary-id", base::MakeUnique<base::Value>(base::Int64ToString(first_display_id))); - LoadDisplayPreferences(false); + display_prefs()->LoadDisplayPreferences(false); // Should not restore to unified unless unified desktop is enabled. display_info_list.emplace_back(second_display_info); @@ -1073,7 +1081,7 @@ // Restored to unified. display_manager()->SetUnifiedDesktopEnabled(true); StoreDisplayBoolPropertyForList(list, "default_unified", true); - LoadDisplayPreferences(false); + display_prefs()->LoadDisplayPreferences(false); display_manager()->OnNativeDisplaysChanged(display_info_list); EXPECT_TRUE(display_manager()->IsInUnifiedMode()); @@ -1088,7 +1096,7 @@ display::GetDisplayIdWithoutOutputIndex(second_display_id)); StoreExternalDisplayMirrorInfo(external_display_mirror_info); StoreDisplayBoolPropertyForList(list, "default_unified", true); - LoadDisplayPreferences(false); + display_prefs()->LoadDisplayPreferences(false); display_info_list.emplace_back(second_display_info); display_manager()->OnNativeDisplaysChanged(display_info_list); EXPECT_TRUE(display_manager()->IsInMirrorMode()); @@ -1105,14 +1113,14 @@ external_display_mirror_info.clear(); StoreExternalDisplayMirrorInfo(external_display_mirror_info); StoreDisplayBoolPropertyForList(list, "default_unified", false); - LoadDisplayPreferences(false); + display_prefs()->LoadDisplayPreferences(false); display_info_list.emplace_back(second_display_info); display_manager()->OnNativeDisplaysChanged(display_info_list); EXPECT_FALSE(display_manager()->IsInMirrorMode()); EXPECT_FALSE(display_manager()->IsInUnifiedMode()); } -TEST_F(DisplayPreferencesTest, SaveThreeDisplays) { +TEST_F(DisplayPrefsTest, SaveThreeDisplays) { LoggedInAsUser(); UpdateDisplay("200x200,200x200,300x300"); @@ -1133,7 +1141,7 @@ display::DisplayIdListToString(list), &new_value)); } -TEST_F(DisplayPreferencesTest, RestoreThreeDisplays) { +TEST_F(DisplayPrefsTest, RestoreThreeDisplays) { LoggedInAsUser(); int64_t id1 = display::Screen::GetScreen()->GetPrimaryDisplay().id(); display::DisplayIdList list = @@ -1144,8 +1152,8 @@ 0); builder.AddDisplayPlacement(list[2], list[1], display::DisplayPlacement::BOTTOM, 100); - StoreDisplayLayoutPrefForTest(list, *builder.Build()); - LoadDisplayPreferences(false); + display_prefs()->StoreDisplayLayoutPrefForTest(list, *builder.Build()); + display_prefs()->LoadDisplayPreferences(false); UpdateDisplay("200x200,200x200,300x300"); display::DisplayIdList new_list = @@ -1163,7 +1171,7 @@ display_manager()->GetDisplayForId(list[2]).bounds()); } -TEST_F(DisplayPreferencesTest, LegacyTouchCalibrationDataSupport) { +TEST_F(DisplayPrefsTest, LegacyTouchCalibrationDataSupport) { UpdateDisplay("800x600,1200x800"); LoggedInAsUser(); int64_t id = display::Screen::GetScreen()->GetPrimaryDisplay().id(); @@ -1175,13 +1183,13 @@ gfx::Size touch_size(200, 150); display::TouchCalibrationData data(point_pair_quad, touch_size); - StoreLegacyTouchDataForTest(id, data); + display_prefs()->StoreLegacyTouchDataForTest(id, data); display::TouchDeviceManager* tdm = display_manager()->touch_device_manager(); display::test::TouchDeviceManagerTestApi tdm_test_api(tdm); tdm_test_api.ResetTouchDeviceManager(); - LoadTouchAssociationPreferenceForTest(); + display_prefs()->LoadTouchAssociationPreferenceForTest(); const display::TouchDeviceManager::TouchAssociationMap& association_map = tdm->touch_associations(); @@ -1210,7 +1218,7 @@ tdm_test_api.ResetTouchDeviceManager(); EXPECT_TRUE(tdm->touch_associations().empty()); - LoadTouchAssociationPreferenceForTest(); + display_prefs()->LoadTouchAssociationPreferenceForTest(); EXPECT_TRUE(tdm->touch_associations().count(fallback_identifier)); EXPECT_TRUE(tdm->touch_associations().at(fallback_identifier).count(id)); @@ -1223,22 +1231,7 @@ data_2); } -class MultiMirroringDisplayPreferencesTest : public DisplayPreferencesTest { - public: - MultiMirroringDisplayPreferencesTest() = default; - ~MultiMirroringDisplayPreferencesTest() override = default; - - void SetUp() override { - base::CommandLine::ForCurrentProcess()->AppendSwitch( - ::switches::kEnableMultiMirroring); - DisplayPreferencesTest::SetUp(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(MultiMirroringDisplayPreferencesTest); -}; - -TEST_F(MultiMirroringDisplayPreferencesTest, ExternalDisplayMirrorInfo) { +TEST_F(DisplayPrefsTest, ExternalDisplayMirrorInfo) { LoggedInAsUser(); const int64_t internal_display_id = @@ -1265,7 +1258,7 @@ std::set<int64_t> external_display_mirror_info; external_display_mirror_info.emplace(first_display_masked_id); StoreExternalDisplayMirrorInfo(external_display_mirror_info); - LoadDisplayPreferences(true); + display_prefs()->LoadDisplayPreferences(true); const base::ListValue* pref_external_display_mirror_info = local_state()->GetList(prefs::kExternalDisplayMirrorInfo); EXPECT_EQ(1U, pref_external_display_mirror_info->GetSize()); @@ -1305,7 +1298,7 @@ external_display_mirror_info.clear(); external_display_mirror_info.emplace(second_display_masked_id); StoreExternalDisplayMirrorInfo(external_display_mirror_info); - LoadDisplayPreferences(false); + display_prefs()->LoadDisplayPreferences(false); pref_external_display_mirror_info = local_state()->GetList(prefs::kExternalDisplayMirrorInfo); EXPECT_EQ(1U, pref_external_display_mirror_info->GetSize());
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc index 7c4d29e..3cd333c 100644 --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -575,24 +575,12 @@ set_custom_wallpaper_layout::Params::Create(*args_)); EXTENSION_FUNCTION_VALIDATE(params); - chromeos::WallpaperManager* wallpaper_manager = - chromeos::WallpaperManager::Get(); - wallpaper::WallpaperInfo info; - wallpaper_manager->GetLoggedInUserWallpaperInfo(&info); - if (info.type != wallpaper::CUSTOMIZED) { - SetError("Only custom wallpaper can change layout."); - return false; - } - info.layout = wallpaper_api_util::GetLayoutEnum( + wallpaper::WallpaperLayout new_layout = wallpaper_api_util::GetLayoutEnum( wallpaper_base::ToString(params->layout)); - wallpaper_api_util::RecordCustomWallpaperLayout(info.layout); - - const AccountId& account_id = - user_manager::UserManager::Get()->GetActiveUser()->GetAccountId(); - bool is_persistent = !user_manager::UserManager::Get() - ->IsCurrentUserNonCryptohomeDataEphemeral(); - wallpaper_manager->SetUserWallpaperInfo(account_id, info, is_persistent); - wallpaper_manager->UpdateWallpaper(false /* clear_cache */); + wallpaper_api_util::RecordCustomWallpaperLayout(new_layout); + WallpaperControllerClient::Get()->UpdateCustomWallpaperLayout( + user_manager::UserManager::Get()->GetActiveUser()->GetAccountId(), + new_layout); SendResponse(true); return true;
diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc index 17943d12..b24971c 100644 --- a/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc +++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest_base.cc
@@ -75,7 +75,7 @@ } // Maps the given string to EntryType. Returns true on success. -bool MapStringToEntryType(const base::StringPiece& value, EntryType* output) { +bool MapStringToEntryType(base::StringPiece value, EntryType* output) { if (value == "file") *output = FILE; else if (value == "directory") @@ -86,8 +86,7 @@ } // Maps the given string to SharedOption. Returns true on success. -bool MapStringToSharedOption(const base::StringPiece& value, - SharedOption* output) { +bool MapStringToSharedOption(base::StringPiece value, SharedOption* output) { if (value == "shared") *output = SHARED; else if (value == "none") @@ -98,8 +97,7 @@ } // Maps the given string to TargetVolume. Returns true on success. -bool MapStringToTargetVolume(const base::StringPiece& value, - TargetVolume* output) { +bool MapStringToTargetVolume(base::StringPiece value, TargetVolume* output) { if (value == "drive") *output = DRIVE_VOLUME; else if (value == "local") @@ -112,7 +110,7 @@ } // Maps the given string to base::Time. Returns true on success. -bool MapStringToTime(const base::StringPiece& value, base::Time* time) { +bool MapStringToTime(base::StringPiece value, base::Time* time) { return base::Time::FromString(value.as_string().c_str(), time); }
diff --git a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc index fbb3934..9a4153e 100644 --- a/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc +++ b/chrome/browser/chromeos/login/auth/cryptohome_authenticator_unittest.cc
@@ -406,7 +406,7 @@ TEST_F(CryptohomeAuthenticatorTest, ResolvePossiblePwChangeToFailedMount) { // Set up state as though a cryptohome mount attempt has occurred // and been rejected. - state_->PresetCryptohomeStatus(false, cryptohome::MOUNT_ERROR_KEY_FAILURE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_KEY_FAILURE); // When there is no online attempt and online results, POSSIBLE_PW_CHANGE EXPECT_EQ(CryptohomeAuthenticator::FAILED_MOUNT, @@ -417,7 +417,7 @@ // Set up state as though a cryptohome mount attempt has occurred // and been rejected because of unmatched key; additionally, // an online auth attempt has completed successfully. - state_->PresetCryptohomeStatus(false, cryptohome::MOUNT_ERROR_KEY_FAILURE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_KEY_FAILURE); state_->PresetOnlineLoginStatus(AuthFailure::AuthFailureNone()); EXPECT_EQ(CryptohomeAuthenticator::NEED_OLD_PW, @@ -430,7 +430,7 @@ // This is a high level test to verify the proper transitioning in this mode // only. It is not testing that we properly verify that the user is an owner // or that we really are in "safe-mode". - state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_NONE); SetOwnerState(true, false); EXPECT_EQ(CryptohomeAuthenticator::OWNER_REQUIRED, @@ -442,7 +442,7 @@ // and succeeded but we are in safe mode and the current user is not owner. // This test will check that the "safe-mode" policy is not set and will let // the mount finish successfully. - state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_NONE); SetOwnerState(false, false); EXPECT_EQ(CryptohomeAuthenticator::OFFLINE_LOGIN, SetAndResolveState(auth_.get(), state_.release())); @@ -465,7 +465,7 @@ // Set up state as though a cryptohome mount attempt has occurred // and succeeded but we are in safe mode and the current user is not owner. - state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_NONE); SetOwnerState(false, false); ScopedCrosSettingsTestHelper settings_helper(false); settings_helper.ReplaceProvider(kPolicyMissingMitigationMode); @@ -484,7 +484,7 @@ content::RunAllTasksUntilIdle(); state_.reset(new TestAttemptState(user_context_, false)); - state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_NONE); // The owner key util should not have found the owner key, so login should // not be allowed. @@ -515,7 +515,7 @@ // Set up state as though a cryptohome mount attempt has occurred // and succeeded but we are in safe mode and the current user is not owner. - state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_NONE); SetOwnerState(false, false); ScopedCrosSettingsTestHelper settings_helper(false); settings_helper.ReplaceProvider(kPolicyMissingMitigationMode); @@ -534,7 +534,7 @@ content::RunAllTasksUntilIdle(); state_.reset(new TestAttemptState(user_context_, false)); - state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_NONE); // The owner key util should find the owner key, so login should succeed. EXPECT_EQ(CryptohomeAuthenticator::OFFLINE_LOGIN, @@ -552,7 +552,7 @@ // Set up state as though a cryptohome mount attempt has occurred // and failed. - state_->PresetCryptohomeStatus(false, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_FATAL); SetAttemptState(auth_.get(), state_.release()); RunResolve(auth_.get()); @@ -577,7 +577,7 @@ // Set up mock async method caller to respond as though a tmpfs mount // attempt has occurred and failed. - mock_caller_->SetUp(false, cryptohome::MOUNT_ERROR_NONE); + mock_caller_->SetUp(false, cryptohome::MOUNT_ERROR_FATAL); EXPECT_CALL(*mock_caller_, AsyncMountGuest(_)).Times(1).RetiresOnSaturation(); auth_->LoginOffTheRecord(); @@ -618,7 +618,7 @@ ExpectLoginFailure(AuthFailure(AuthFailure::DATA_REMOVAL_FAILED)); // Set up mock async method caller to fail a cryptohome remove attempt. - mock_caller_->SetUp(false, cryptohome::MOUNT_ERROR_NONE); + mock_caller_->SetUp(false, cryptohome::MOUNT_ERROR_FATAL); EXPECT_CALL( *mock_caller_, AsyncRemove(cryptohome::Identification(user_context_.GetAccountId()), _)) @@ -635,7 +635,7 @@ FailOnLoginSuccess(); ExpectPasswordChange(); - state_->PresetCryptohomeStatus(false, cryptohome::MOUNT_ERROR_KEY_FAILURE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_KEY_FAILURE); state_->PresetOnlineLoginStatus(AuthFailure::AuthFailureNone()); SetAttemptState(auth_.get(), state_.release()); @@ -694,8 +694,7 @@ TEST_F(CryptohomeAuthenticatorTest, ResolveNoMountToFailedMount) { // Set up state as though a cryptohome mount attempt has occurred // and been rejected because the user doesn't exist. - state_->PresetCryptohomeStatus(false, - cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST); // When there is no online attempt and online results, NO_MOUNT will be // resolved to FAILED_MOUNT. @@ -707,8 +706,7 @@ // Set up state as though a cryptohome mount attempt has occurred // and been rejected because the user doesn't exist; additionally, // an online auth attempt has completed successfully. - state_->PresetCryptohomeStatus(false, - cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST); state_->PresetOnlineLoginStatus(AuthFailure::AuthFailureNone()); EXPECT_EQ(CryptohomeAuthenticator::CREATE_NEW, @@ -731,8 +729,7 @@ // Set up state as though a cryptohome mount attempt has occurred // and been rejected because the user doesn't exist; additionally, // an online auth attempt has completed successfully. - state_->PresetCryptohomeStatus(false, - cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST); state_->PresetOnlineLoginStatus(AuthFailure::AuthFailureNone()); SetAttemptState(auth_.get(), state_.release()); @@ -745,7 +742,7 @@ // Set up state as though a cryptohome mount attempt has occurred and // succeeded. - state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_NONE); SetAttemptState(auth_.get(), state_.release()); RunResolve(auth_.get()); @@ -757,7 +754,7 @@ // Set up state as though a cryptohome mount attempt has occurred and // succeeded. - state_->PresetCryptohomeStatus(true, cryptohome::MOUNT_ERROR_NONE); + state_->PresetCryptohomeStatus(cryptohome::MOUNT_ERROR_NONE); state_->PresetOnlineLoginStatus(AuthFailure::AuthFailureNone()); SetAttemptState(auth_.get(), state_.release());
diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index 00dc9678..309d7b6f 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc
@@ -86,6 +86,7 @@ ::switches::kDisableAcceleratedJpegDecoding, ::switches::kDisableAcceleratedMjpegDecode, ::switches::kDisableAcceleratedVideoDecode, + ::switches::kDisableAcceleratedVideoEncode, ::switches::kDisableBlinkFeatures, ::switches::kDisableCastStreamingHWEncoding, ::switches::kDisableDistanceFieldText, @@ -167,7 +168,6 @@ ::switches::kDisableWebRtcHWDecoding, ::switches::kDisableWebRtcHWEncoding, #endif - ::switches::kDisableVaapiAcceleratedVideoEncode, ::switches::kOzonePlatform, ash::switches::kAshEnableTabletMode, ash::switches::kAshForceEnableStylusTools,
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc index 26b8c1d..24fedb8 100644 --- a/chrome/browser/chromeos/login/existing_user_controller.cc +++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -435,6 +435,7 @@ // just after the UI is closed but before the new credentials were stored // in the profile. Therefore we have to give it some time to make sure it // has been updated before we copy it. + // TODO(pmarko): Find a better way to do this, see https://crbug.com/796512. VLOG(1) << "Authentication was entered manually, possibly for proxyauth."; scoped_refptr<net::URLRequestContextGetter> browser_process_context_getter = g_browser_process->system_request_context(); @@ -600,14 +601,24 @@ user_context.GetKey()->GetSecret()); } + // If plain text password is available, computes its salt, hash, and length, + // and saves them in |user_context|. They will be saved to prefs when user + // profile is ready. + UserContext new_user_context = user_context; + if (user_context.GetKey()->GetKeyType() == Key::KEY_TYPE_PASSWORD_PLAIN) { + base::string16 password( + base::UTF8ToUTF16(new_user_context.GetKey()->GetSecret())); + new_user_context.SetSyncPasswordData(password_manager::SyncPasswordData( + password, auth_mode == LoginPerformer::AUTH_MODE_EXTENSION)); + } + if (user_manager::UserManager::Get()->IsSupervisedAccountId( user_context.GetAccountId())) { - login_performer_->LoginAsSupervisedUser(user_context); + login_performer_->LoginAsSupervisedUser(new_user_context); } else { // If a regular user log in to a device which supports ARC, we should make // sure that the user's cryptohome is encrypted in ext4 dircrypto to run the // latest Android runtime. - UserContext new_user_context = user_context; new_user_context.SetIsForcingDircrypto( ShouldForceDircrypto(new_user_context.GetAccountId())); login_performer_->PerformLogin(new_user_context, auth_mode);
diff --git a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc index 83d3662a..2c9a7e7 100644 --- a/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/existing_user_controller_browsertest.cc
@@ -32,6 +32,7 @@ #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/notifications/notification_ui_manager.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/chromeos/login/supervised_user_creation_screen_handler.h" #include "chrome/grit/generated_resources.h" #include "chrome/test/base/testing_browser_process.h" @@ -43,6 +44,7 @@ #include "chromeos/login/auth/user_context.h" #include "chromeos/settings/cros_settings_names.h" #include "chromeos/settings/cros_settings_provider.h" +#include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/core/common/cloud/cloud_policy_core.h" #include "components/policy/core/common/cloud/cloud_policy_store.h" @@ -839,4 +841,67 @@ existing_user_controller()->CompleteLogin(user_context); } +class ExistingUserControllerSavePasswordHashTest + : public ExistingUserControllerTest { + public: + ExistingUserControllerSavePasswordHashTest() = default; + + void SetUpSessionManager() override { + InstallOwnerKey(); + RefreshDevicePolicy(); + } +}; + +// Tests that successful GAIA online login saves SyncPasswordData to user +// profile prefs. +IN_PROC_BROWSER_TEST_F(ExistingUserControllerSavePasswordHashTest, + GaiaOnlineLoginSavesPasswordHashToPrefs) { + UserContext user_context(gaia_account_id_); + user_context.SetKey(Key(kPassword)); + user_context.SetUserIDHash(gaia_account_id_.GetUserEmail()); + content::WindowedNotificationObserver profile_prepared_observer( + chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, + content::NotificationService::AllSources()); + existing_user_controller()->CompleteLogin(user_context); + + profile_prepared_observer.Wait(); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&ClearNotifications)); + content::RunAllPendingInMessageLoop(); + + // Verify password hash and salt are saved to prefs. + Profile* profile = + content::Details<Profile>(profile_prepared_observer.details()).ptr(); + EXPECT_TRUE(profile->GetPrefs()->HasPrefPath( + password_manager::prefs::kSyncPasswordHash)); + EXPECT_TRUE(profile->GetPrefs()->HasPrefPath( + password_manager::prefs::kSyncPasswordLengthAndHashSalt)); +} + +// Tests that successful offline login saves SyncPasswordData to user profile +// prefs. +IN_PROC_BROWSER_TEST_F(ExistingUserControllerSavePasswordHashTest, + OfflineLoginSavesPasswordHashToPrefs) { + UserContext user_context(gaia_account_id_); + user_context.SetKey(Key(kPassword)); + user_context.SetUserIDHash(gaia_account_id_.GetUserEmail()); + content::WindowedNotificationObserver profile_prepared_observer( + chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, + content::NotificationService::AllSources()); + existing_user_controller()->Login(user_context, SigninSpecifics()); + + profile_prepared_observer.Wait(); + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&ClearNotifications)); + content::RunAllPendingInMessageLoop(); + + // Verify password hash and salt are saved to prefs. + Profile* profile = + content::Details<Profile>(profile_prepared_observer.details()).ptr(); + EXPECT_TRUE(profile->GetPrefs()->HasPrefPath( + password_manager::prefs::kSyncPasswordHash)); + EXPECT_TRUE(profile->GetPrefs()->HasPrefPath( + password_manager::prefs::kSyncPasswordLengthAndHashSalt)); +} + } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/kiosk_browsertest.cc b/chrome/browser/chromeos/login/kiosk_browsertest.cc index c7075856..13b9191 100644 --- a/chrome/browser/chromeos/login/kiosk_browsertest.cc +++ b/chrome/browser/chromeos/login/kiosk_browsertest.cc
@@ -2336,12 +2336,6 @@ public: KioskHiddenWebUITest() : wallpaper_loaded_(false) {} - // KioskTest overrides: - void SetUpCommandLine(base::CommandLine* command_line) override { - KioskTest::SetUpCommandLine(command_line); - command_line->AppendSwitch(switches::kDisableBootAnimation); - } - void SetUpOnMainThread() override { LoginDisplayHostWebUI::DisableRestrictiveProxyCheckForTest();
diff --git a/chrome/browser/chromeos/login/lock/views_screen_locker.cc b/chrome/browser/chromeos/login/lock/views_screen_locker.cc index 48dc008..01d9b788 100644 --- a/chrome/browser/chromeos/login/lock/views_screen_locker.cc +++ b/chrome/browser/chromeos/login/lock/views_screen_locker.cc
@@ -234,6 +234,10 @@ return true; } +void ViewsScreenLocker::HandleLoginAsGuest() { + NOTREACHED(); +} + void ViewsScreenLocker::SuspendDone(const base::TimeDelta& sleep_duration) { for (user_manager::User* user : user_manager::UserManager::Get()->GetUnlockUsers()) {
diff --git a/chrome/browser/chromeos/login/lock/views_screen_locker.h b/chrome/browser/chromeos/login/lock/views_screen_locker.h index f50d36d..d9542d00 100644 --- a/chrome/browser/chromeos/login/lock/views_screen_locker.h +++ b/chrome/browser/chromeos/login/lock/views_screen_locker.h
@@ -59,6 +59,7 @@ void HandleOnFocusPod(const AccountId& account_id) override; void HandleOnNoPodFocused() override; bool HandleFocusLockScreenApps(bool reverse) override; + void HandleLoginAsGuest() override; // PowerManagerClient::Observer: void SuspendDone(const base::TimeDelta& sleep_duration) override;
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc index add3bf2..2d9b07b 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.cc +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -71,6 +71,7 @@ #include "chrome/browser/google/google_brand_chromeos.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/net/nss_context.h" +#include "chrome/browser/password_manager/password_store_factory.h" #include "chrome/browser/prefs/session_startup_pref.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" @@ -99,6 +100,8 @@ #include "chromeos/settings/cros_settings_names.h" #include "components/component_updater/component_updater_service.h" #include "components/flags_ui/pref_service_flags_storage.h" +#include "components/password_manager/core/browser/password_manager_metrics_util.h" +#include "components/password_manager/core/browser/password_store.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/prefs/pref_member.h" #include "components/prefs/pref_registry_simple.h" @@ -272,6 +275,9 @@ flags_ui::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, flags_ui::kAddSentinels); + + UserSessionManager::MaybeAppendPolicySwitches(&user_flags); + return user_flags; } @@ -287,9 +293,20 @@ if (user_manager::UserManager::Get()->IsLoggedInAsSupervisedUser()) return false; - if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( - user_flags, *base::CommandLine::ForCurrentProcess(), - out_command_line_difference)) { + // TODO: Remove this special handling for site isolation and isolate origins. + auto* current_command_line = base::CommandLine::ForCurrentProcess(); + if (current_command_line->HasSwitch(::switches::kSitePerProcess) != + user_flags.HasSwitch(::switches::kSitePerProcess)) { + out_command_line_difference->insert(::switches::kSitePerProcess); + } + if (current_command_line->GetSwitchValueASCII(::switches::kIsolateOrigins) != + user_flags.GetSwitchValueASCII(::switches::kIsolateOrigins)) { + out_command_line_difference->insert(::switches::kIsolateOrigins); + } + + if (out_command_line_difference->empty() && + about_flags::AreSwitchesIdenticalToCurrentCommandLine( + user_flags, *current_command_line, out_command_line_difference)) { return false; } @@ -389,6 +406,22 @@ registry->RegisterBooleanPref(prefs::kCanShowOobeGoodiesPage, true); } +// static +void UserSessionManager::MaybeAppendPolicySwitches( + base::CommandLine* user_flags) { + // Inject site isolation and isolate origins command line switch from + // user policy. + auto* local_state = g_browser_process->local_state(); + if (local_state->GetBoolean(prefs::kSitePerProcess)) { + user_flags->AppendSwitch(::switches::kSitePerProcess); + } + if (local_state->HasPrefPath(prefs::kIsolateOrigins)) { + user_flags->AppendSwitchASCII( + ::switches::kIsolateOrigins, + local_state->GetString(prefs::kIsolateOrigins)); + } +} + UserSessionManager::UserSessionManager() : delegate_(nullptr), authenticator_(nullptr), @@ -1303,6 +1336,25 @@ } UpdateEasyUnlockKeys(user_context_); + + // Save sync password hash and salt to profile prefs if they are available. + // These will be used to detect Gaia password reuses. + password_manager::metrics_util::IsSyncPasswordHashSaved hash_password_state( + password_manager::metrics_util::IsSyncPasswordHashSaved::NOT_SAVED); + if (user_context_.GetSyncPasswordData().has_value()) { + scoped_refptr<password_manager::PasswordStore> password_store = + PasswordStoreFactory::GetForProfile(profile, + ServiceAccessType::EXPLICIT_ACCESS); + if (password_store) { + password_store->SaveSyncPasswordHash( + user_context_.GetSyncPasswordData().value()); + hash_password_state = + password_manager::metrics_util::IsSyncPasswordHashSaved::SAVED; + } + } + password_manager::metrics_util::LogIsSyncPasswordHashSaved( + hash_password_state); + user_context_.ClearSecrets(); if (TokenHandlesEnabled()) { CreateTokenUtilIfMissing();
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.h b/chrome/browser/chromeos/login/session/user_session_manager.h index 93c02c3..53aa021 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.h +++ b/chrome/browser/chromeos/login/session/user_session_manager.h
@@ -37,6 +37,10 @@ class Profile; class TokenHandleFetcher; +namespace base { +class CommandLine; +} + namespace net { class URLRequestContextGetter; } @@ -115,6 +119,10 @@ // Registers session related preferences. static void RegisterPrefs(PrefRegistrySimple* registry); + // Appends additional command switches to the given command line if + // SitePerProcess/IsolateOrigins policy is present. + static void MaybeAppendPolicySwitches(base::CommandLine* user_flags); + // Invoked after the tmpfs is successfully mounted. // Asks session_manager to restart Chrome in Guest session mode. // |start_url| is an optional URL to be opened in Guest session browser.
diff --git a/chrome/browser/chromeos/login/signin_partition_manager.cc b/chrome/browser/chromeos/login/signin_partition_manager.cc index 17652f4..a1e0f85 100644 --- a/chrome/browser/chromeos/login/signin_partition_manager.cc +++ b/chrome/browser/chromeos/login/signin_partition_manager.cc
@@ -6,17 +6,26 @@ #include "base/guid.h" #include "base/strings/stringprintf.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/incognito_helpers.h" #include "chromeos/chromeos_switches.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "content/public/browser/browser_context.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_constants.h" #include "extensions/browser/guest_view/web_view/web_view_guest.h" #include "net/base/escape.h" +#include "net/http/http_auth_cache.h" +#include "net/http/http_network_session.h" +#include "net/http/http_transaction_factory.h" +#include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "url/gurl.h" +using content::BrowserThread; + namespace chromeos { namespace login { @@ -46,18 +55,50 @@ base::Time::Max(), std::move(partition_data_cleared)); } +net::URLRequestContextGetter* GetSystemURLRequestContextGetter() { + return g_browser_process->system_request_context(); +} + +// Transfers HttpAuthCache content from |main_url_request_context_getter| into +// |signin_url_request_context_getter|. +void PrepareSigninURLRequestContextOnIOThread( + net::URLRequestContextGetter* main_url_request_context_getter, + net::URLRequestContextGetter* signin_url_request_context_getter) { + // Transfer proxy auth data from the main URLRequestContext. + net::HttpAuthCache* main_http_auth_cache = + main_url_request_context_getter->GetURLRequestContext() + ->http_transaction_factory() + ->GetSession() + ->http_auth_cache(); + net::HttpAuthCache* signin_http_auth_cache = + signin_url_request_context_getter->GetURLRequestContext() + ->http_transaction_factory() + ->GetSession() + ->http_auth_cache(); + signin_http_auth_cache->UpdateAllFrom(*main_http_auth_cache); +} + +void InvokeStartSigninSessionDoneCallback( + SigninPartitionManager::StartSigninSessionDoneCallback callback, + const std::string& partition_name) { + std::move(callback).Run(partition_name); +} + } // namespace SigninPartitionManager::SigninPartitionManager( content::BrowserContext* browser_context) : browser_context_(browser_context), clear_storage_partition_task_( - base::BindRepeating(&ClearStoragePartition)) {} + base::BindRepeating(&ClearStoragePartition)), + get_system_url_request_context_getter_task_( + base::BindRepeating(&GetSystemURLRequestContextGetter)) {} SigninPartitionManager::~SigninPartitionManager() {} void SigninPartitionManager::StartSigninSession( - const content::WebContents* embedder_web_contents) { + const content::WebContents* embedder_web_contents, + StartSigninSessionDoneCallback signin_session_started) { // If we already were in a sign-in session, close it first. // This clears stale data from the last-used StorageParittion. CloseCurrentSigninSession(base::BindOnce(&base::DoNothing)); @@ -74,6 +115,19 @@ current_storage_partition_ = content::BrowserContext::GetStoragePartitionForSite(browser_context_, guest_site, true); + + base::OnceClosure invoke_callback = base::BindOnce( + &InvokeStartSigninSessionDoneCallback, std::move(signin_session_started), + current_storage_partition_name_); + + BrowserThread::PostTaskAndReply( + BrowserThread::IO, FROM_HERE, + base::BindOnce( + &PrepareSigninURLRequestContextOnIOThread, + base::RetainedRef(get_system_url_request_context_getter_task_.Run()), + base::RetainedRef( + current_storage_partition_->GetURLRequestContext())), + std::move(invoke_callback)); } void SigninPartitionManager::CloseCurrentSigninSession( @@ -97,6 +151,13 @@ clear_storage_partition_task_ = clear_storage_partition_task; } +void SigninPartitionManager::SetGetSystemURLRequestContextGetterTaskForTesting( + GetSystemURLRequestContextGetterTask + get_system_url_request_context_getter_task) { + get_system_url_request_context_getter_task_ = + get_system_url_request_context_getter_task; +} + const std::string& SigninPartitionManager::GetCurrentStoragePartitionName() const { DCHECK(IsInSigninSession());
diff --git a/chrome/browser/chromeos/login/signin_partition_manager.h b/chrome/browser/chromeos/login/signin_partition_manager.h index 66e790e..1a5478e 100644 --- a/chrome/browser/chromeos/login/signin_partition_manager.h +++ b/chrome/browser/chromeos/login/signin_partition_manager.h
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/macros.h" +#include "base/memory/ref_counted.h" #include "base/memory/singleton.h" #include "components/keyed_service/content/browser_context_keyed_service_factory.h" #include "components/keyed_service/core/keyed_service.h" @@ -19,6 +20,10 @@ class WebContents; } // namespace content +namespace net { +class URLRequestContextGetter; +} + namespace chromeos { namespace login { @@ -30,6 +35,12 @@ base::RepeatingCallback<void(content::StoragePartition* storage_partition, base::OnceClosure data_cleared)>; + using GetSystemURLRequestContextGetterTask = + base::RepeatingCallback<net::URLRequestContextGetter*()>; + + using StartSigninSessionDoneCallback = + base::OnceCallback<void(const std::string& partition_name)>; + explicit SigninPartitionManager(content::BrowserContext* browser_context); ~SigninPartitionManager() override; @@ -38,7 +49,11 @@ // closed (and cleared). // |embedder_web_contents| is the WebContents instance embedding the webview // which will display the sign-in pages. - void StartSigninSession(const content::WebContents* embedder_web_contents); + // |signin_session_started| will be invoked with the partition name of the + // started signin session on completition. + void StartSigninSession( + const content::WebContents* embedder_web_contents, + StartSigninSessionDoneCallback signin_session_started); // Closes the current StoragePartition. All cached data in the // StoragePartition is cleared. |partition_data_cleared| will be called when @@ -66,6 +81,9 @@ void SetClearStoragePartitionTaskForTesting( ClearStoragePartitionTask clear_storage_partition_task); + void SetGetSystemURLRequestContextGetterTaskForTesting( + GetSystemURLRequestContextGetterTask + get_system_url_request_context_getter_task); class Factory : public BrowserContextKeyedServiceFactory { public: @@ -93,6 +111,8 @@ content::BrowserContext* const browser_context_; ClearStoragePartitionTask clear_storage_partition_task_; + GetSystemURLRequestContextGetterTask + get_system_url_request_context_getter_task_; // GuestView StoragePartitions use the host of the embedder site's URL as the // domain of their StoragePartition.
diff --git a/chrome/browser/chromeos/login/signin_partition_manager_unittest.cc b/chrome/browser/chromeos/login/signin_partition_manager_unittest.cc index b5b6721..be492f2 100644 --- a/chrome/browser/chromeos/login/signin_partition_manager_unittest.cc +++ b/chrome/browser/chromeos/login/signin_partition_manager_unittest.cc
@@ -12,13 +12,16 @@ #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_profile.h" #include "content/public/browser/browser_context.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/site_instance.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" +#include "content/public/test/test_browser_thread_bundle.h" #include "content/public/test/web_contents_tester.h" #include "net/cookies/cookie_store.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" +#include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -27,6 +30,39 @@ namespace { constexpr char kEmbedderUrl[] = "http://www.whatever.com/"; + +void StorePartitionNameAndQuitLoop(base::RunLoop* loop, + std::string* out_partition_name, + const std::string& partition_name) { + *out_partition_name = partition_name; + loop->Quit(); +} + +void AddEntryToHttpAuthCache( + net::URLRequestContextGetter* url_request_context_getter) { + net::HttpAuthCache* http_auth_cache = + url_request_context_getter->GetURLRequestContext() + ->http_transaction_factory() + ->GetSession() + ->http_auth_cache(); + http_auth_cache->Add(GURL("http://whatever.com/"), "", + net::HttpAuth::AUTH_SCHEME_BASIC, "", + net::AuthCredentials(), ""); +} + +void IsEntryInHttpAuthCache( + net::URLRequestContextGetter* url_request_context_getter, + bool* out_entry_found) { + net::HttpAuthCache* http_auth_cache = + url_request_context_getter->GetURLRequestContext() + ->http_transaction_factory() + ->GetSession() + ->http_auth_cache(); + *out_entry_found = + http_auth_cache->Lookup(GURL("http://whatever.com/"), "", + net::HttpAuth::AUTH_SCHEME_BASIC) != nullptr; +} + } // namespace class SigninPartitionManagerTest : public ChromeRenderViewHostTestHarness { @@ -37,6 +73,10 @@ void SetUp() override { ChromeRenderViewHostTestHarness::SetUp(); + system_request_context_getter_ = new net::TestURLRequestContextGetter( + content::BrowserThread::GetTaskRunnerForThread( + content::BrowserThread::IO)); + signin_browser_context_ = base::MakeUnique<TestingProfile>(); signin_ui_web_contents_ = base::WrapUnique<content::WebContents>( @@ -51,6 +91,10 @@ GetSigninPartitionManager()->SetClearStoragePartitionTaskForTesting( base::Bind(&SigninPartitionManagerTest::ClearStoragePartitionTask, base::Unretained(this))); + GetSigninPartitionManager() + ->SetGetSystemURLRequestContextGetterTaskForTesting(base::BindRepeating( + &SigninPartitionManagerTest::GetSystemURLRequestContextGetter, + base::Unretained(this))); } void TearDown() override { @@ -89,12 +133,29 @@ pending_clear_tasks_.clear(); } + std::string RunStartSigninSesssion(content::WebContents* webcontents) { + std::string partition_name; + base::RunLoop loop; + GetSigninPartitionManager()->StartSigninSession( + webcontents, + base::BindOnce(&StorePartitionNameAndQuitLoop, &loop, &partition_name)); + loop.Run(); + return partition_name; + } + + net::URLRequestContextGetter* GetSystemURLRequestContextGetter() { + return system_request_context_getter_.get(); + } + private: void ClearStoragePartitionTask(content::StoragePartition* partition, base::OnceClosure clear_done_closure) { pending_clear_tasks_.push_back({partition, std::move(clear_done_closure)}); } + scoped_refptr<net::TestURLRequestContextGetter> + system_request_context_getter_; + std::unique_ptr<TestingProfile> signin_browser_context_; // Web contents of the sign-in UI, embedder of the signin-frame webview. @@ -108,20 +169,22 @@ TEST_F(SigninPartitionManagerTest, TestSubsequentAttempts) { // First sign-in attempt - GetSigninPartitionManager()->StartSigninSession(signin_ui_web_contents()); std::string signin_partition_name_1 = - GetSigninPartitionManager()->GetCurrentStoragePartitionName(); + RunStartSigninSesssion(signin_ui_web_contents()); auto* signin_partition_1 = GetSigninPartitionManager()->GetCurrentStoragePartition(); EXPECT_FALSE(signin_partition_name_1.empty()); + EXPECT_EQ(signin_partition_name_1, + GetSigninPartitionManager()->GetCurrentStoragePartitionName()); // Second sign-in attempt - GetSigninPartitionManager()->StartSigninSession(signin_ui_web_contents()); std::string signin_partition_name_2 = - GetSigninPartitionManager()->GetCurrentStoragePartitionName(); + RunStartSigninSesssion(signin_ui_web_contents()); auto* signin_partition_2 = GetSigninPartitionManager()->GetCurrentStoragePartition(); EXPECT_FALSE(signin_partition_name_2.empty()); + EXPECT_EQ(signin_partition_name_2, + GetSigninPartitionManager()->GetCurrentStoragePartitionName()); // Make sure that the StoragePartition has not been re-used. EXPECT_NE(signin_partition_name_1, signin_partition_name_2); @@ -148,5 +211,32 @@ EXPECT_TRUE(closure_called); } +TEST_F(SigninPartitionManagerTest, HttpAuthCacheTransferred) { + base::RunLoop loop_prepare; + content::BrowserThread::PostTaskAndReply( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(AddEntryToHttpAuthCache, + base::RetainedRef(GetSystemURLRequestContextGetter())), + loop_prepare.QuitClosure()); + loop_prepare.Run(); + + RunStartSigninSesssion(signin_ui_web_contents()); + net::URLRequestContextGetter* signin_url_request_context_getter = + GetSigninPartitionManager() + ->GetCurrentStoragePartition() + ->GetURLRequestContext(); + + bool entry_found = false; + base::RunLoop loop_check; + content::BrowserThread::PostTaskAndReply( + content::BrowserThread::IO, FROM_HERE, + base::BindOnce(IsEntryInHttpAuthCache, + base::RetainedRef(signin_url_request_context_getter), + &entry_found), + loop_check.QuitClosure()); + loop_check.Run(); + EXPECT_TRUE(entry_found); +} + } // namespace login } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_authenticator.cc b/chrome/browser/chromeos/login/supervised/supervised_user_authenticator.cc index 57826054..caea39da 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_authenticator.cc +++ b/chrome/browser/chromeos/login/supervised/supervised_user_authenticator.cc
@@ -33,7 +33,7 @@ bool success, cryptohome::MountError return_code) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - attempt->RecordCryptohomeStatus(success, return_code); + attempt->RecordCryptohomeStatus(return_code); resolver->Resolve(); } @@ -236,7 +236,7 @@ AuthState state; - if (current_state_->cryptohome_outcome()) + if (current_state_->cryptohome_code() == cryptohome::MOUNT_ERROR_NONE) state = ResolveCryptohomeSuccessState(); else state = ResolveCryptohomeFailureState(); @@ -281,18 +281,15 @@ password(password), add_key(add_key_attempt), cryptohome_complete_(false), - cryptohome_outcome_(false), hash_obtained_(false), cryptohome_code_(cryptohome::MOUNT_ERROR_NONE) {} SupervisedUserAuthenticator::AuthAttempt::~AuthAttempt() {} void SupervisedUserAuthenticator::AuthAttempt::RecordCryptohomeStatus( - bool cryptohome_outcome, cryptohome::MountError cryptohome_code) { DCHECK_CURRENTLY_ON(BrowserThread::UI); cryptohome_complete_ = true; - cryptohome_outcome_ = cryptohome_outcome; cryptohome_code_ = cryptohome_code; } @@ -308,11 +305,6 @@ return cryptohome_complete_; } -bool SupervisedUserAuthenticator::AuthAttempt::cryptohome_outcome() { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - return cryptohome_outcome_; -} - cryptohome::MountError SupervisedUserAuthenticator::AuthAttempt::cryptohome_code() { DCHECK_CURRENTLY_ON(BrowserThread::UI);
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_authenticator.h b/chrome/browser/chromeos/login/supervised/supervised_user_authenticator.h index 9ec12be..998a465 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_authenticator.h +++ b/chrome/browser/chromeos/login/supervised/supervised_user_authenticator.h
@@ -38,11 +38,10 @@ bool add_key_attempt); ~AuthAttempt(); - // Copy |cryptohome_code| and |cryptohome_outcome| into this object, - // so we can have a copy we're sure to own, and can make available - // on the IO thread. Must be called from the IO thread. - void RecordCryptohomeStatus(bool cryptohome_outcome, - cryptohome::MountError cryptohome_code); + // Copy |cryptohome_code| into this object, so we can have a copy we're sure + // to own, and can make available on the IO thread. + // Must be called from the IO thread. + void RecordCryptohomeStatus(cryptohome::MountError cryptohome_code); // Copy |hash| into this object so we can have a copy we're sure to own // and can make available on the IO thread. @@ -50,7 +49,6 @@ void RecordHash(const std::string& hash); bool cryptohome_complete(); - bool cryptohome_outcome(); bool hash_obtained(); std::string hash(); cryptohome::MountError cryptohome_code(); @@ -61,7 +59,6 @@ private: bool cryptohome_complete_; - bool cryptohome_outcome_; bool hash_obtained_; std::string hash_;
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc b/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc index 5bbb7cc3..9caf95e 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc +++ b/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
@@ -137,7 +137,7 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest, PRE_CreateAndRemoveSupervisedUser) { - SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); + SigninAsSupervisedUser(0, kTestSupervisedUserDisplayName); } IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest, @@ -181,7 +181,7 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserOwnerCreationTest, PRE_CreateAndRemoveSupervisedUser) { - SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); + SigninAsSupervisedUser(0, kTestSupervisedUserDisplayName); } IN_PROC_BROWSER_TEST_F(SupervisedUserOwnerCreationTest, @@ -199,18 +199,14 @@ StartFlowLoginAsManager(); FillNewUserData(kTestSupervisedUserDisplayName); - base::RunLoop mount_wait_loop, add_key_wait_loop; - mock_homedir_methods_->set_mount_callback(mount_wait_loop.QuitClosure()); + base::RunLoop add_key_wait_loop; mock_homedir_methods_->set_add_key_callback(add_key_wait_loop.QuitClosure()); - EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _)).Times(1); JSEval("$('supervised-user-creation-next-button').click()"); - mount_wait_loop.Run(); add_key_wait_loop.Run(); testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); - mock_homedir_methods_->set_mount_callback(base::Closure()); mock_homedir_methods_->set_add_key_callback(base::Closure()); EXPECT_TRUE(registration_utility_stub_->register_was_called()); @@ -251,7 +247,7 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest, PRE_CheckNoNotificationTray) { - SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); + SigninAsSupervisedUser(0, kTestSupervisedUserDisplayName); // After sign-in, the tray should be visible. EXPECT_TRUE(GetWebNotificationTrayVisibility());
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_password_browsertest.cc b/chrome/browser/chromeos/login/supervised/supervised_user_password_browsertest.cc index 680845b..a2a3fc5 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_password_browsertest.cc +++ b/chrome/browser/chromeos/login/supervised/supervised_user_password_browsertest.cc
@@ -82,7 +82,7 @@ // schedules password migration. IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, PRE_PasswordChangeFromUserTest) { - SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); + SigninAsSupervisedUser(0, kTestSupervisedUserDisplayName); const user_manager::User* user = user_manager::UserManager::Get()->GetUsers().at(0); @@ -106,9 +106,8 @@ // Supervised user signs in for second time, and actual password migration takes // place. IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, PasswordChangeFromUserTest) { - EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); EXPECT_CALL(*mock_homedir_methods_, UpdateKeyEx(_, _, _, _)).Times(1); - SigninAsSupervisedUser(false, 0, kTestSupervisedUserDisplayName); + SigninAsSupervisedUser(0, kTestSupervisedUserDisplayName); testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); } @@ -170,9 +169,8 @@ // After that supervised user signs in, and no password change happens. IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, PasswordChangeFromManagerTest) { - EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); EXPECT_CALL(*mock_homedir_methods_, UpdateKeyEx(_, _, _, _)).Times(0); - SigninAsSupervisedUser(false, 1, kTestSupervisedUserDisplayName); + SigninAsSupervisedUser(1, kTestSupervisedUserDisplayName); testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); } @@ -193,7 +191,7 @@ // schedules password migration. IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, PRE_PRE_PasswordChangeUserAndManagerTest) { - SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName); + SigninAsSupervisedUser(0, kTestSupervisedUserDisplayName); const user_manager::User* user = user_manager::UserManager::Get()->GetUsers().at(0); @@ -260,9 +258,8 @@ // should be attempted. IN_PROC_BROWSER_TEST_F(SupervisedUserPasswordTest, PasswordChangeUserAndManagerTest) { - EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); EXPECT_CALL(*mock_homedir_methods_, UpdateKeyEx(_, _, _, _)).Times(0); - SigninAsSupervisedUser(false, 1, kTestSupervisedUserDisplayName); + SigninAsSupervisedUser(1, kTestSupervisedUserDisplayName); testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); }
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_test_base.cc b/chrome/browser/chromeos/login/supervised/supervised_user_test_base.cc index 50bd0c6..adb1870 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_test_base.cc +++ b/chrome/browser/chromeos/login/supervised/supervised_user_test_base.cc
@@ -39,6 +39,8 @@ #include "chrome/browser/supervised_user/supervised_user_constants.h" #include "chromeos/cryptohome/mock_async_method_caller.h" #include "chromeos/cryptohome/mock_homedir_methods.h" +#include "chromeos/dbus/dbus_thread_manager.h" +#include "chromeos/dbus/fake_cryptohome_client.h" #include "chromeos/login/auth/key.h" #include "chromeos/login/auth/user_context.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" @@ -238,6 +240,9 @@ void SupervisedUserTestBase::SetUpInProcessBrowserTestFixture() { LoginManagerTest::SetUpInProcessBrowserTestFixture(); + + chromeos::DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( + std::make_unique<FakeCryptohomeClient>()); mock_async_method_caller_ = new cryptohome::MockAsyncMethodCaller; mock_async_method_caller_->SetUp(true, cryptohome::MOUNT_ERROR_NONE); cryptohome::AsyncMethodCaller::InitializeForTesting( @@ -387,18 +392,14 @@ void SupervisedUserTestBase::StartUserCreation( const std::string& button_id, const std::string& expected_display_name) { - base::RunLoop mount_wait_loop, add_key_wait_loop; - mock_homedir_methods_->set_mount_callback(mount_wait_loop.QuitClosure()); + base::RunLoop add_key_wait_loop; mock_homedir_methods_->set_add_key_callback(add_key_wait_loop.QuitClosure()); - EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _)).Times(1); JSEval(std::string("$('").append(button_id).append("').click()")); - mount_wait_loop.Run(); add_key_wait_loop.Run(); ::testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); - mock_homedir_methods_->set_mount_callback(base::Closure()); mock_homedir_methods_->set_add_key_callback(base::Closure()); EXPECT_TRUE(registration_utility_stub_->register_was_called()); @@ -418,12 +419,8 @@ } void SupervisedUserTestBase::SigninAsSupervisedUser( - bool check_homedir_calls, int user_index, const std::string& expected_display_name) { - if (check_homedir_calls) - EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); - // Log in as supervised user, make sure that everything works. ASSERT_EQ(3UL, user_manager::UserManager::Get()->GetUsers().size()); @@ -438,8 +435,6 @@ ->CheckForFirstRun(user->GetAccountId().GetUserEmail()); LoginUser(user->GetAccountId()); - if (check_homedir_calls) - ::testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); shared_settings_adapter_.reset( new SupervisedUsersSharedSettingsSyncTestAdapter(profile));
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_test_base.h b/chrome/browser/chromeos/login/supervised/supervised_user_test_base.h index 9c7bec9..4118acc 100644 --- a/chrome/browser/chromeos/login/supervised/supervised_user_test_base.h +++ b/chrome/browser/chromeos/login/supervised/supervised_user_test_base.h
@@ -95,8 +95,7 @@ void FillNewUserData(const std::string& display_name); void StartUserCreation(const std::string& button_id, const std::string& expected_display_name); - void SigninAsSupervisedUser(bool check_homedir_calls, - int user_index, + void SigninAsSupervisedUser(int user_index, const std::string& expected_display_name); void SigninAsManager(int user_index); void RemoveSupervisedUser(size_t original_user_count,
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_views.cc b/chrome/browser/chromeos/login/ui/login_display_host_views.cc index 8a6882b..4e1daad8 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_views.cc +++ b/chrome/browser/chromeos/login/ui/login_display_host_views.cc
@@ -10,6 +10,7 @@ #include "chrome/browser/chromeos/login/ui/login_display_views.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chromeos/login/auth/user_context.h" +#include "components/user_manager/user_names.h" namespace chromeos { @@ -160,6 +161,12 @@ return false; } +void LoginDisplayHostViews::HandleLoginAsGuest() { + existing_user_controller_->Login(UserContext(user_manager::USER_TYPE_GUEST, + user_manager::GuestAccountId()), + chromeos::SigninSpecifics()); +} + void LoginDisplayHostViews::OnAuthFailure(const AuthFailure& error) { if (on_authenticated_) std::move(on_authenticated_).Run(false);
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_views.h b/chrome/browser/chromeos/login/ui/login_display_host_views.h index 45d1110..f8cbf247 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_views.h +++ b/chrome/browser/chromeos/login/ui/login_display_host_views.h
@@ -56,6 +56,7 @@ void HandleOnFocusPod(const AccountId& account_id) override; void HandleOnNoPodFocused() override; bool HandleFocusLockScreenApps(bool reverse) override; + void HandleLoginAsGuest() override; // AuthStatusConsumer: void OnAuthFailure(const AuthFailure& error) override;
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_webui.cc b/chrome/browser/chromeos/login/ui/login_display_host_webui.cc index f792fc3bb..ed92cfa 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_webui.cc +++ b/chrome/browser/chromeos/login/ui/login_display_host_webui.cc
@@ -416,7 +416,7 @@ LoginDisplayHostWebUI::LoginDisplayHostWebUI(const gfx::Rect& wallpaper_bounds) : wallpaper_bounds_(wallpaper_bounds), - startup_sound_played_(StartupUtils::IsOobeCompleted()), + oobe_startup_sound_played_(StartupUtils::IsOobeCompleted()), animation_weak_ptr_factory_(this) { if (ash_util::IsRunningInMash()) { // Animation, and initializing hidden, are not currently supported for Mash. @@ -452,22 +452,12 @@ new ScopedKeepAlive(KeepAliveOrigin::LOGIN_DISPLAY_HOST_WEBUI, KeepAliveRestartOption::DISABLED)); - bool is_registered = StartupUtils::IsDeviceRegistered(); bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); // Mash always runs login screen with zero delay if (ash_util::IsRunningInMash()) zero_delay_enabled = true; - bool disable_boot_animation = - base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableBootAnimation); - waiting_for_wallpaper_load_ = - !zero_delay_enabled && (!is_registered || !disable_boot_animation); - - // For slower hardware we have boot animation disabled so - // we'll be initializing WebUI hidden, waiting for user pods to load and then - // show WebUI at once. - waiting_for_user_pods_ = !zero_delay_enabled && !waiting_for_wallpaper_load_; + waiting_for_wallpaper_load_ = !zero_delay_enabled; // Initializing hidden is not supported in Mash if (!ash_util::IsRunningInMash()) { @@ -500,8 +490,7 @@ // When we wait for WebUI to be initialized we wait for one of // these notifications. - if ((waiting_for_user_pods_ || waiting_for_wallpaper_load_) && - initialize_webui_hidden_) { + if (waiting_for_wallpaper_load_ && initialize_webui_hidden_) { registrar_.Add(this, chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE, content::NotificationService::AllSources()); registrar_.Add(this, chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN, @@ -510,7 +499,6 @@ VLOG(1) << "Login WebUI >> " << "zero_delay: " << zero_delay_enabled << " wait_for_wp_load_: " << waiting_for_wallpaper_load_ - << " wait_for_pods_: " << waiting_for_user_pods_ << " init_webui_hidden_: " << initialize_webui_hidden_; media::SoundsManager* manager = media::SoundsManager::Get(); @@ -628,7 +616,7 @@ void LoginDisplayHostWebUI::StartWizard(OobeScreen first_screen) { DisableKeyboardOverscroll(); - TryToPlayStartupSound(); + TryToPlayOobeStartupSound(); // Keep parameters to restore if renderer crashes. restore_path_ = RESTORE_WIZARD; @@ -840,10 +828,7 @@ if (chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE == type || chrome::NOTIFICATION_LOGIN_NETWORK_ERROR_SHOWN == type) { VLOG(1) << "Login WebUI >> WEBUI_VISIBLE"; - if (waiting_for_user_pods_ && initialize_webui_hidden_) { - waiting_for_user_pods_ = false; - ShowWebUI(); - } else if (waiting_for_wallpaper_load_ && initialize_webui_hidden_) { + if (waiting_for_wallpaper_load_ && initialize_webui_hidden_) { // Reduce time till login UI is shown - show it as soon as possible. waiting_for_wallpaper_load_ = false; ShowWebUI(); @@ -928,7 +913,7 @@ // LoginDisplayHostWebUI, chromeos::CrasAudioHandler::AudioObserver: void LoginDisplayHostWebUI::OnActiveOutputNodeChanged() { - TryToPlayStartupSound(); + TryToPlayOobeStartupSound(); } //////////////////////////////////////////////////////////////////////////////// @@ -1145,8 +1130,7 @@ // If WebUI is initialized in hidden state, show it only if we're no // longer waiting for wallpaper animation/user images loading. Otherwise, // always show it. - if (!initialize_webui_hidden_ || - (!waiting_for_wallpaper_load_ && !waiting_for_user_pods_)) { + if (!initialize_webui_hidden_ || !waiting_for_wallpaper_load_) { VLOG(1) << "Login WebUI >> show login wnd on create"; login_window_->Show(); } else { @@ -1188,16 +1172,16 @@ GetOobeUI()->ShowOobeUI(visible); } -void LoginDisplayHostWebUI::TryToPlayStartupSound() { +void LoginDisplayHostWebUI::TryToPlayOobeStartupSound() { if (is_voice_interaction_oobe_) return; - if (startup_sound_played_ || login_prompt_visible_time_.is_null() || + if (oobe_startup_sound_played_ || login_prompt_visible_time_.is_null() || !CrasAudioHandler::Get()->GetPrimaryActiveOutputNode()) { return; } - startup_sound_played_ = true; + oobe_startup_sound_played_ = true; // Don't try play startup sound if login prompt is already visible // for a long time or can't be played. @@ -1214,7 +1198,7 @@ if (!login_prompt_visible_time_.is_null()) return; login_prompt_visible_time_ = base::TimeTicks::Now(); - TryToPlayStartupSound(); + TryToPlayOobeStartupSound(); } // static
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_webui.h b/chrome/browser/chromeos/login/ui/login_display_host_webui.h index 57838d1b..9cef7681 100644 --- a/chrome/browser/chromeos/login/ui/login_display_host_webui.h +++ b/chrome/browser/chromeos/login/ui/login_display_host_webui.h
@@ -178,7 +178,7 @@ // Tries to play startup sound. If sound can't be played right now, // for instance, because cras server is not initialized, playback // will be delayed. - void TryToPlayStartupSound(); + void TryToPlayOobeStartupSound(); // Called when login-prompt-visible signal is caught. void OnLoginPromptVisible(); @@ -246,10 +246,6 @@ // wallpaper load animation to finish. bool waiting_for_wallpaper_load_; - // True if WebUI is initialized in hidden state and we're waiting for user - // pods to load. - bool waiting_for_user_pods_; - // How many times renderer has crashed. int crash_count_ = 0; @@ -279,7 +275,7 @@ // True when request to play startup sound was sent to // SoundsManager. // After OOBE is completed, this is always initialized with true. - bool startup_sound_played_ = false; + bool oobe_startup_sound_played_ = false; // Keeps a copy of the old Drag'n'Drop client, so that it would be disabled // during a login session and restored afterwards.
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc index 6cbf63ad..96ec3e3 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
@@ -12,7 +12,6 @@ #include "ash/public/cpp/window_properties.h" #include "ash/public/interfaces/constants.mojom.h" #include "ash/shell.h" -#include "ash/wallpaper/wallpaper_decoder.h" #include "ash/wallpaper/wallpaper_window_state_manager.h" #include "base/bind.h" #include "base/bind_helpers.h" @@ -31,6 +30,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/customization/customization_document.h" +#include "chrome/browser/chromeos/customization/customization_wallpaper_util.h" #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" #include "chrome/browser/chromeos/login/startup_utils.h" #include "chrome/browser/chromeos/login/users/avatar/user_image_loader.h" @@ -85,29 +85,6 @@ WALLPAPERS_APPS_NUM = 2, }; -// These global default values are used to set customized default -// wallpaper path in WallpaperManager::InitializeWallpaper(). -base::FilePath GetCustomizedWallpaperDefaultRescaledFileName( - const std::string& suffix) { - const base::FilePath default_downloaded_file_name = - ServicesCustomizationDocument::GetCustomizedWallpaperDownloadedFileName(); - const base::FilePath default_cache_dir = - ServicesCustomizationDocument::GetCustomizedWallpaperCacheDir(); - if (default_downloaded_file_name.empty() || default_cache_dir.empty()) - return base::FilePath(); - return default_cache_dir.Append( - default_downloaded_file_name.BaseName().value() + suffix); -} - -// Whether WallpaperController should start with customized default -// wallpaper in WallpaperManager::InitializeWallpaper() or not. -bool ShouldUseCustomizedDefaultWallpaper() { - PrefService* pref_service = g_browser_process->local_state(); - - return !pref_service->FindPreference( - prefs::kCustomizationDefaultWallpaperURL)->IsDefaultValue(); -} - // Returns index of the first public session user found in |users| // or -1 otherwise. int FindPublicSession(const user_manager::UserList& users) { @@ -170,93 +147,6 @@ const char kWallpaperSequenceTokenName[] = "wallpaper-sequence"; -// CustomizedWallpaperRescaledFiles: -const base::FilePath& -WallpaperManager::CustomizedWallpaperRescaledFiles::path_downloaded() const { - return path_downloaded_; -} - -const base::FilePath& -WallpaperManager::CustomizedWallpaperRescaledFiles::path_rescaled_small() - const { - return path_rescaled_small_; -} - -const base::FilePath& -WallpaperManager::CustomizedWallpaperRescaledFiles::path_rescaled_large() - const { - return path_rescaled_large_; -} - -bool WallpaperManager::CustomizedWallpaperRescaledFiles::downloaded_exists() - const { - return downloaded_exists_; -} - -bool WallpaperManager::CustomizedWallpaperRescaledFiles::rescaled_small_exists() - const { - return rescaled_small_exists_; -} - -bool WallpaperManager::CustomizedWallpaperRescaledFiles::rescaled_large_exists() - const { - return rescaled_large_exists_; -} - -WallpaperManager::CustomizedWallpaperRescaledFiles:: - CustomizedWallpaperRescaledFiles(const base::FilePath& path_downloaded, - const base::FilePath& path_rescaled_small, - const base::FilePath& path_rescaled_large) - : path_downloaded_(path_downloaded), - path_rescaled_small_(path_rescaled_small), - path_rescaled_large_(path_rescaled_large), - downloaded_exists_(false), - rescaled_small_exists_(false), - rescaled_large_exists_(false) {} - -base::Closure -WallpaperManager::CustomizedWallpaperRescaledFiles::CreateCheckerClosure() { - return base::Bind(&WallpaperManager::CustomizedWallpaperRescaledFiles:: - CheckCustomizedWallpaperFilesExist, - base::Unretained(this)); -} - -void WallpaperManager::CustomizedWallpaperRescaledFiles:: - CheckCustomizedWallpaperFilesExist() { - downloaded_exists_ = base::PathExists(path_downloaded_); - rescaled_small_exists_ = base::PathExists(path_rescaled_small_); - rescaled_large_exists_ = base::PathExists(path_rescaled_large_); -} - -bool WallpaperManager::CustomizedWallpaperRescaledFiles::AllSizesExist() const { - return rescaled_small_exists_ && rescaled_large_exists_; -} - -// TestApi: -WallpaperManager::TestApi::TestApi(WallpaperManager* wallpaper_manager) - : wallpaper_manager_(wallpaper_manager) {} - -WallpaperManager::TestApi::~TestApi() {} - -bool WallpaperManager::TestApi::GetWallpaperFromCache( - const AccountId& account_id, - gfx::ImageSkia* image) { - return wallpaper_manager_->GetWallpaperFromCache(account_id, image); -} - -bool WallpaperManager::TestApi::GetPathFromCache(const AccountId& account_id, - base::FilePath* path) { - return wallpaper_manager_->GetPathFromCache(account_id, path); -} - -void WallpaperManager::TestApi::SetWallpaperCache(const AccountId& account_id, - const base::FilePath& path, - const gfx::ImageSkia& image) { - DCHECK(!image.isNull()); - (*wallpaper_manager_->GetWallpaperCacheMap())[account_id] = - ash::CustomWallpaperElement(path, image); -} - // WallpaperManager, public: --------------------------------------------------- WallpaperManager::~WallpaperManager() { @@ -283,41 +173,6 @@ wallpaper_manager = nullptr; } -void WallpaperManager::SetCustomizedDefaultWallpaper( - const GURL& wallpaper_url, - const base::FilePath& file_path, - const base::FilePath& resized_directory) { - // Should fail if this ever happens in tests. - DCHECK(wallpaper_url.is_valid()); - if (!wallpaper_url.is_valid()) { - if (!wallpaper_url.is_empty()) { - LOG(WARNING) << "Invalid Customized Wallpaper URL '" - << wallpaper_url.spec() << "'"; - } - return; - } - std::string downloaded_file_name = file_path.BaseName().value(); - std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files( - new CustomizedWallpaperRescaledFiles( - file_path, - resized_directory.Append( - downloaded_file_name + - ash::WallpaperController::kSmallWallpaperSuffix), - resized_directory.Append( - downloaded_file_name + - ash::WallpaperController::kLargeWallpaperSuffix))); - - base::Closure check_file_exists = rescaled_files->CreateCheckerClosure(); - base::Closure on_checked_closure = - base::Bind(&WallpaperManager::SetCustomizedDefaultWallpaperAfterCheck, - weak_factory_.GetWeakPtr(), wallpaper_url, file_path, - base::Passed(std::move(rescaled_files))); - if (!task_runner_->PostTaskAndReply(FROM_HERE, check_file_exists, - on_checked_closure)) { - LOG(WARNING) << "Failed to start check CheckCustomizedWallpaperFilesExist."; - } -} - void WallpaperManager::ShowUserWallpaper(const AccountId& account_id) { DCHECK_CURRENTLY_ON(BrowserThread::UI); // Some unit tests come here without a UserManager or without a pref system. @@ -356,32 +211,16 @@ WallpaperControllerClient::Get()->ShowSigninWallpaper(); } -void WallpaperManager::SetUserWallpaperInfo(const AccountId& account_id, - const WallpaperInfo& info, - bool is_persistent) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) { - // Some unit tests come here without a Shell instance. - // TODO(crbug.com/776464): This is intended not to work under mash. Make it - // work again after WallpaperManager is removed. - return; - } - ash::Shell::Get()->wallpaper_controller()->SetUserWallpaperInfo( - account_id, info, is_persistent); -} - void WallpaperManager::InitializeWallpaper() { DCHECK_CURRENTLY_ON(BrowserThread::UI); // Apply device customization. - if (ShouldUseCustomizedDefaultWallpaper()) { - SetCustomizedDefaultWallpaperImpl( - GetCustomizedWallpaperDefaultRescaledFileName( + if (customization_wallpaper_util::ShouldUseCustomizedDefaultWallpaper()) { + SetCustomizedDefaultWallpaperPaths( + customization_wallpaper_util::GetCustomizedDefaultWallpaperPath( ash::WallpaperController::kSmallWallpaperSuffix), - std::unique_ptr<gfx::ImageSkia>(), - GetCustomizedWallpaperDefaultRescaledFileName( - ash::WallpaperController::kLargeWallpaperSuffix), - std::unique_ptr<gfx::ImageSkia>()); + customization_wallpaper_util::GetCustomizedDefaultWallpaperPath( + ash::WallpaperController::kLargeWallpaperSuffix)); } base::CommandLine* command_line = GetCommandLine(); @@ -413,23 +252,6 @@ ShowUserWallpaper(user_manager->GetActiveUser()->GetAccountId()); } -void WallpaperManager::UpdateWallpaper(bool clear_cache) { - for (auto& observer : observers_) - observer.OnUpdateWallpaperForTesting(); - if (clear_cache) - GetWallpaperCacheMap()->clear(); - - // For GAIA login flow, |current_user_| may not be set before user login. If - // UpdateWallpaper is called at GAIA login screen, no wallpaper will be set. - // It could result a black screen on external monitors. - // See http://crbug.com/265689 for detail. - AccountId current_user_account_id = GetCurrentUserAccountId(); - if (current_user_account_id.empty()) - ShowSigninWallpaper(); - else - ShowUserWallpaper(current_user_account_id); -} - bool WallpaperManager::GetLoggedInUserWallpaperInfo(WallpaperInfo* info) { DCHECK(thread_checker_.CalledOnValidThread()); @@ -446,6 +268,15 @@ user_manager::UserManager::Get()->GetActiveUser()->GetAccountId(), info); } +void WallpaperManager::SetCustomizedDefaultWallpaperPaths( + const base::FilePath& default_small_wallpaper_file, + const base::FilePath& default_large_wallpaper_file) { + if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) + return; + ash::Shell::Get()->wallpaper_controller()->SetCustomizedDefaultWallpaperPaths( + default_small_wallpaper_file, default_large_wallpaper_file); +} + void WallpaperManager::AddObservers() { show_user_name_on_signin_subscription_ = CrosSettings::Get()->AddSettingsObserver( @@ -473,18 +304,11 @@ if (!data) return; - if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) { - user_image_loader::StartWithData( - task_runner_, std::move(data), ImageDecoder::ROBUST_JPEG_CODEC, - 0, // Do not crop. - base::Bind(&WallpaperManager::SetPolicyControlledWallpaper, - weak_factory_.GetWeakPtr(), account_id)); - } else { - ash::WallpaperController::DecodeWallpaperIfApplicable( - base::Bind(&WallpaperManager::SetPolicyControlledWallpaper, - weak_factory_.GetWeakPtr(), account_id), - std::move(data), true /* data_is_ready */); - } + user_image_loader::StartWithData( + task_runner_, std::move(data), ImageDecoder::ROBUST_JPEG_CODEC, + 0, // Do not crop. + base::Bind(&WallpaperManager::SetPolicyControlledWallpaper, + weak_factory_.GetWeakPtr(), account_id)); } bool WallpaperManager::IsPolicyControlled(const AccountId& account_id) const { @@ -523,14 +347,6 @@ } } -void WallpaperManager::AddObserver(WallpaperManager::Observer* observer) { - observers_.AddObserver(observer); -} - -void WallpaperManager::RemoveObserver(WallpaperManager::Observer* observer) { - observers_.RemoveObserver(observer); -} - void WallpaperManager::OpenWallpaperPicker() { if (wallpaper_manager_util::ShouldUseAndroidWallpapersApp( ProfileHelper::Get()->GetProfileByUser( @@ -582,72 +398,18 @@ base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); } -void WallpaperManager::ResizeCustomizedDefaultWallpaper( - std::unique_ptr<gfx::ImageSkia> image, - const CustomizedWallpaperRescaledFiles* rescaled_files, - bool* success, - gfx::ImageSkia* small_wallpaper_image, - gfx::ImageSkia* large_wallpaper_image) { - *success = true; - - *success &= ash::WallpaperController::ResizeAndSaveWallpaper( - *image, rescaled_files->path_rescaled_small(), - wallpaper::WALLPAPER_LAYOUT_STRETCH, - ash::WallpaperController::kSmallWallpaperMaxWidth, - ash::WallpaperController::kSmallWallpaperMaxHeight, - small_wallpaper_image); - - *success &= ash::WallpaperController::ResizeAndSaveWallpaper( - *image, rescaled_files->path_rescaled_large(), - wallpaper::WALLPAPER_LAYOUT_STRETCH, - ash::WallpaperController::kLargeWallpaperMaxWidth, - ash::WallpaperController::kLargeWallpaperMaxHeight, - large_wallpaper_image); -} - -void WallpaperManager::InitializeUserWallpaperInfo( - const AccountId& account_id) { +void WallpaperManager::SetUserWallpaperInfo(const AccountId& account_id, + const WallpaperInfo& info, + bool is_persistent) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) { // Some unit tests come here without a Shell instance. // TODO(crbug.com/776464): This is intended not to work under mash. Make it // work again after WallpaperManager is removed. return; } - bool is_persistent = - !user_manager::UserManager::Get()->IsUserNonCryptohomeDataEphemeral( - account_id); - ash::Shell::Get()->wallpaper_controller()->InitializeUserWallpaperInfo( - account_id, is_persistent); -} - -bool WallpaperManager::GetWallpaperFromCache(const AccountId& account_id, - gfx::ImageSkia* image) { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) { - // Some unit tests come here without a Shell instance. - // TODO(crbug.com/776464): This is intended not to work under mash. Make it - // work again after WallpaperManager is removed. - return false; - } - return ash::Shell::Get()->wallpaper_controller()->GetWallpaperFromCache( - account_id, image); -} - -bool WallpaperManager::GetPathFromCache(const AccountId& account_id, - base::FilePath* path) { - DCHECK(thread_checker_.CalledOnValidThread()); - if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) { - // Some unit tests come here without a Shell instance. - // TODO(crbug.com/776464): This is intended not to work under mash. Make it - // work again after WallpaperManager is removed. - return false; - } - return ash::Shell::Get()->wallpaper_controller()->GetPathFromCache(account_id, - path); -} - -int WallpaperManager::loaded_wallpapers_for_test() const { - return loaded_wallpapers_for_test_; + ash::Shell::Get()->wallpaper_controller()->SetUserWallpaperInfo( + account_id, info, is_persistent); } base::CommandLine* WallpaperManager::GetCommandLine() { @@ -661,8 +423,6 @@ if (user_manager::UserManager::Get()->IsUserLoggedIn()) return; - bool disable_boot_animation = - GetCommandLine()->HasSwitch(switches::kDisableBootAnimation); bool show_users = true; bool result = CrosSettings::Get()->GetBoolean( kAccountsPrefShowUserNamesOnSignIn, &show_users); @@ -678,13 +438,9 @@ return; } - if (!disable_boot_animation) { - int index = public_session_user_index != -1 ? public_session_user_index : 0; - // Normal boot, load user wallpaper. - // If normal boot animation is disabled wallpaper would be set - // asynchronously once user pods are loaded. - ShowUserWallpaper(users[index]->GetAccountId()); - } + // Normal boot, load user wallpaper. + int index = public_session_user_index != -1 ? public_session_user_index : 0; + ShowUserWallpaper(users[index]->GetAccountId()); } bool WallpaperManager::GetUserWallpaperInfo(const AccountId& account_id, @@ -750,108 +506,6 @@ account_id, user->GetType(), show_wallpaper); } -void WallpaperManager::NotifyAnimationFinished() { - for (auto& observer : observers_) - observer.OnWallpaperAnimationFinished(GetCurrentUserAccountId()); -} - -void WallpaperManager::SetCustomizedDefaultWallpaperAfterCheck( - const GURL& wallpaper_url, - const base::FilePath& file_path, - std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files) { - PrefService* pref_service = g_browser_process->local_state(); - - std::string current_url = - pref_service->GetString(prefs::kCustomizationDefaultWallpaperURL); - if (current_url != wallpaper_url.spec() || !rescaled_files->AllSizesExist()) { - DCHECK(rescaled_files->downloaded_exists()); - - // Either resized images do not exist or cached version is incorrect. - // Need to start decoding again. - if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) { - user_image_loader::StartWithFilePath( - task_runner_, file_path, ImageDecoder::ROBUST_JPEG_CODEC, - 0, // Do not crop. - base::Bind(&WallpaperManager::OnCustomizedDefaultWallpaperDecoded, - weak_factory_.GetWeakPtr(), wallpaper_url, - base::Passed(std::move(rescaled_files)))); - } else { - ash::Shell::Get()->wallpaper_controller()->ReadAndDecodeWallpaper( - base::Bind(&WallpaperManager::OnCustomizedDefaultWallpaperDecoded, - weak_factory_.GetWeakPtr(), wallpaper_url, - base::Passed(std::move(rescaled_files))), - task_runner_, file_path); - } - } else { - SetCustomizedDefaultWallpaperImpl(rescaled_files->path_rescaled_small(), - std::unique_ptr<gfx::ImageSkia>(), - rescaled_files->path_rescaled_large(), - std::unique_ptr<gfx::ImageSkia>()); - } -} - -void WallpaperManager::OnCustomizedDefaultWallpaperDecoded( - const GURL& wallpaper_url, - std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files, - std::unique_ptr<user_manager::UserImage> wallpaper) { - DCHECK(thread_checker_.CalledOnValidThread()); - - // If decoded wallpaper is empty, we have probably failed to decode the file. - if (wallpaper->image().isNull()) { - LOG(WARNING) << "Failed to decode customized wallpaper."; - return; - } - - wallpaper->image().EnsureRepsForSupportedScales(); - // TODO(crbug.com/593251): DeepCopy() may be unnecessary as this function - // owns |wallpaper| as scoped_ptr whereas it used to be a const reference. - std::unique_ptr<gfx::ImageSkia> deep_copy(wallpaper->image().DeepCopy()); - - std::unique_ptr<bool> success(new bool(false)); - std::unique_ptr<gfx::ImageSkia> small_wallpaper_image(new gfx::ImageSkia); - std::unique_ptr<gfx::ImageSkia> large_wallpaper_image(new gfx::ImageSkia); - - base::Closure resize_closure = base::Bind( - &WallpaperManager::ResizeCustomizedDefaultWallpaper, - base::Passed(&deep_copy), base::Unretained(rescaled_files.get()), - base::Unretained(success.get()), - base::Unretained(small_wallpaper_image.get()), - base::Unretained(large_wallpaper_image.get())); - base::Closure on_resized_closure = base::Bind( - &WallpaperManager::OnCustomizedDefaultWallpaperResized, - weak_factory_.GetWeakPtr(), wallpaper_url, - base::Passed(std::move(rescaled_files)), base::Passed(std::move(success)), - base::Passed(std::move(small_wallpaper_image)), - base::Passed(std::move(large_wallpaper_image))); - - if (!task_runner_->PostTaskAndReply(FROM_HERE, resize_closure, - on_resized_closure)) { - LOG(WARNING) << "Failed to start Customized Wallpaper resize."; - } -} - -void WallpaperManager::OnCustomizedDefaultWallpaperResized( - const GURL& wallpaper_url, - std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files, - std::unique_ptr<bool> success, - std::unique_ptr<gfx::ImageSkia> small_wallpaper_image, - std::unique_ptr<gfx::ImageSkia> large_wallpaper_image) { - DCHECK_CURRENTLY_ON(BrowserThread::UI); - DCHECK(rescaled_files); - DCHECK(success.get()); - if (!*success) { - LOG(WARNING) << "Failed to save resized customized default wallpaper"; - return; - } - PrefService* pref_service = g_browser_process->local_state(); - pref_service->SetString(prefs::kCustomizationDefaultWallpaperURL, - wallpaper_url.spec()); - SetCustomizedDefaultWallpaperImpl( - rescaled_files->path_rescaled_small(), std::move(small_wallpaper_image), - rescaled_files->path_rescaled_large(), std::move(large_wallpaper_image)); - VLOG(1) << "Customized default wallpaper applied."; -} - void WallpaperManager::RecordWallpaperAppType() { user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser(); Profile* profile = ProfileHelper::Get()->GetProfileByUser(user); @@ -900,18 +554,6 @@ ->IsUserLoggedIn() /* update wallpaper */); } -void WallpaperManager::SetCustomizedDefaultWallpaperImpl( - const base::FilePath& default_small_wallpaper_file, - std::unique_ptr<gfx::ImageSkia> small_wallpaper_image, - const base::FilePath& default_large_wallpaper_file, - std::unique_ptr<gfx::ImageSkia> large_wallpaper_image) { - if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) - return; - ash::Shell::Get()->wallpaper_controller()->SetCustomizedDefaultWallpaperImpl( - default_small_wallpaper_file, std::move(small_wallpaper_image), - default_large_wallpaper_file, std::move(large_wallpaper_image)); -} - wallpaper::WallpaperInfo* WallpaperManager::GetCachedWallpaperInfo() { if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) return &dummy_current_user_wallpaper_info_; @@ -920,16 +562,4 @@ ->GetCurrentUserWallpaperInfo(); } -ash::CustomWallpaperMap* WallpaperManager::GetWallpaperCacheMap() { - if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) - return &dummy_wallpaper_cache_map_; - return ash::Shell::Get()->wallpaper_controller()->GetWallpaperCacheMap(); -} - -AccountId WallpaperManager::GetCurrentUserAccountId() { - if (!ash::Shell::HasInstance() || ash_util::IsRunningInMash()) - return EmptyAccountId(); - return ash::Shell::Get()->wallpaper_controller()->GetCurrentUserAccountId(); -} - } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h index 790a134..f1da2c7 100644 --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h
@@ -39,10 +39,6 @@ class SequencedTaskRunner; } // namespace base -namespace gfx { -class ImageSkia; -} // namespace gfx - namespace user_manager { class UserImage; } // namespace user_manager @@ -59,72 +55,6 @@ class WallpaperManager : public wm::ActivationChangeObserver, public aura::WindowObserver { public: - class CustomizedWallpaperRescaledFiles { - public: - CustomizedWallpaperRescaledFiles(const base::FilePath& path_downloaded, - const base::FilePath& path_rescaled_small, - const base::FilePath& path_rescaled_large); - bool AllSizesExist() const; - - // Closure will hold unretained pointer to this object. So caller must - // make sure that the closure will be destoyed before this object. - // Closure must be called on BlockingPool. - base::Closure CreateCheckerClosure(); - - const base::FilePath& path_downloaded() const; - const base::FilePath& path_rescaled_small() const; - const base::FilePath& path_rescaled_large() const; - - bool downloaded_exists() const; - bool rescaled_small_exists() const; - bool rescaled_large_exists() const; - - private: - // Must be called on BlockingPool. - void CheckCustomizedWallpaperFilesExist(); - - const base::FilePath path_downloaded_; - const base::FilePath path_rescaled_small_; - const base::FilePath path_rescaled_large_; - - bool downloaded_exists_; - bool rescaled_small_exists_; - bool rescaled_large_exists_; - - DISALLOW_COPY_AND_ASSIGN(CustomizedWallpaperRescaledFiles); - }; - - class TestApi { - public: - explicit TestApi(WallpaperManager* wallpaper_manager); - virtual ~TestApi(); - - bool GetWallpaperFromCache(const AccountId& account_id, - gfx::ImageSkia* image); - - bool GetPathFromCache(const AccountId& account_id, base::FilePath* path); - - void SetWallpaperCache(const AccountId& account_id, - const base::FilePath& path, - const gfx::ImageSkia& image); - - private: - WallpaperManager* wallpaper_manager_; // not owned - - DISALLOW_COPY_AND_ASSIGN(TestApi); - }; - - class Observer { - public: - virtual ~Observer() {} - // Notified when the wallpaper animation finishes. - virtual void OnWallpaperAnimationFinished(const AccountId& account_id) {} - // Notified when the wallpaper is updated. - virtual void OnUpdateWallpaperForTesting() {} - // Notified when the wallpaper pending list is empty. - virtual void OnPendingListEmptyForTesting() {} - }; - ~WallpaperManager() override; // Expects there is no instance of WallpaperManager and create one. @@ -137,17 +67,6 @@ // WallpaperManager to remove any observers it has registered. static void Shutdown(); - // Sets a customized default wallpaper to be used wherever a default wallpaper - // is needed. Note: it doesn't change the default wallpaper for guest and - // child accounts. - // |wallpaper_url|: The url corresponding to this wallpaper. - // |file_path|: The path of the wallpaper file. - // |resized_directory|: The directory where resized versions are stored. Must - // be writable. - void SetCustomizedDefaultWallpaper(const GURL& wallpaper_url, - const base::FilePath& file_path, - const base::FilePath& resized_directory); - // Shows |account_id|'s wallpaper, which is determined in the following order: // 1) Use device policy wallpaper if it exists AND we are at the login screen. // 2) Use user policy wallpaper if it exists. @@ -160,23 +79,20 @@ // device policy wallpaper or the default wallpaper. void ShowSigninWallpaper(); - // A wrapper of |WallpaperController::SetUserWallpaperInfo|. - void SetUserWallpaperInfo(const AccountId& account_id, - const wallpaper::WallpaperInfo& info, - bool is_persistent); - // Initializes wallpaper. If logged in, loads user's wallpaper. If not logged // in, uses a solid color wallpaper. If logged in as a stub user, uses an // empty wallpaper. void InitializeWallpaper(); - // Updates current wallpaper. It may switch the size of wallpaper based on the - // current display's resolution. - void UpdateWallpaper(bool clear_cache); - // Gets wallpaper information of logged in user. bool GetLoggedInUserWallpaperInfo(wallpaper::WallpaperInfo* info); + // TODO(crbug.com/776464): Convert it to mojo call. + // A wrapper of |WallpaperController::SetCustomizedDefaultWallpaperPaths|. + void SetCustomizedDefaultWallpaperPaths( + const base::FilePath& default_small_wallpaper_file, + const base::FilePath& default_large_wallpaper_file); + // Adds |this| as an observer to various settings. void AddObservers(); @@ -200,12 +116,6 @@ // Called when the wallpaper policy has been cleared for |account_id|. void OnPolicyCleared(const std::string& policy, const AccountId& account_id); - // Adds given observer to the list. - void AddObserver(Observer* observer); - - // Removes given observer from the list. - void RemoveObserver(Observer* observer); - // Opens the wallpaper picker window. void OpenWallpaperPicker(); @@ -218,32 +128,14 @@ void OnWindowDestroying(aura::Window* window) override; private: - friend class WallpaperManagerBrowserTest; - friend class WallpaperManagerBrowserTestDefaultWallpaper; friend class WallpaperManagerPolicyTest; WallpaperManager(); - // Resize and save customized default wallpaper. - static void ResizeCustomizedDefaultWallpaper( - std::unique_ptr<gfx::ImageSkia> image, - const CustomizedWallpaperRescaledFiles* rescaled_files, - bool* success, - gfx::ImageSkia* small_wallpaper_image, - gfx::ImageSkia* large_wallpaper_image); - - // A wrapper of |WallpaperController::InitializeUserWallpaperInfo|. - void InitializeUserWallpaperInfo(const AccountId& account_id); - - // A wrapper of |WallpaperController::GetWallpaperFromCache|. - bool GetWallpaperFromCache(const AccountId& account_id, - gfx::ImageSkia* image); - - // A wrapper of |WallpaperController::GetPathFromCache|. - bool GetPathFromCache(const AccountId& account_id, base::FilePath* path); - - // The number of wallpapers have loaded. For test only. - int loaded_wallpapers_for_test() const; + // A wrapper of |WallpaperController::SetUserWallpaperInfo|. + void SetUserWallpaperInfo(const AccountId& account_id, + const wallpaper::WallpaperInfo& info, + bool is_persistent); // Gets the CommandLine representing the current process's command line. base::CommandLine* GetCommandLine(); @@ -266,30 +158,6 @@ void SetDefaultWallpaperImpl(const AccountId& account_id, bool show_wallpaper); - // Notify all registered observers. - void NotifyAnimationFinished(); - - // This is called after we check that supplied default wallpaper files exist. - void SetCustomizedDefaultWallpaperAfterCheck( - const GURL& wallpaper_url, - const base::FilePath& file_path, - std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files); - - // Starts rescaling of customized wallpaper. - void OnCustomizedDefaultWallpaperDecoded( - const GURL& wallpaper_url, - std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files, - std::unique_ptr<user_manager::UserImage> user_image); - - // Check the result of ResizeCustomizedDefaultWallpaper and finally - // apply Customized Default Wallpaper. - void OnCustomizedDefaultWallpaperResized( - const GURL& wallpaper_url, - std::unique_ptr<CustomizedWallpaperRescaledFiles> rescaled_files, - std::unique_ptr<bool> success, - std::unique_ptr<gfx::ImageSkia> small_wallpaper_image, - std::unique_ptr<gfx::ImageSkia> large_wallpaper_image); - // Record the Wallpaper App that the user is using right now on Chrome OS. void RecordWallpaperAppType(); @@ -302,29 +170,13 @@ const AccountId& account_id, std::unique_ptr<user_manager::UserImage> user_image); - // A wrapper of |WallpaperController::SetCustomizedDefaultWallpaperImpl|. - void SetCustomizedDefaultWallpaperImpl( - const base::FilePath& customized_default_wallpaper_file_small, - std::unique_ptr<gfx::ImageSkia> small_wallpaper_image, - const base::FilePath& customized_default_wallpaper_file_large, - std::unique_ptr<gfx::ImageSkia> large_wallpaper_image); - // Returns the cached logged-in user wallpaper info, or a dummy value under // mash. wallpaper::WallpaperInfo* GetCachedWallpaperInfo(); - // Returns the wallpaper cache map, or a dummy value under mash. - ash::CustomWallpaperMap* GetWallpaperCacheMap(); - - // Returns the account id of |current_user_|, or an empty value under mash. - AccountId GetCurrentUserAccountId(); - std::unique_ptr<CrosSettings::ObserverSubscription> show_user_name_on_signin_subscription_; - // The number of loaded wallpapers. - int loaded_wallpapers_for_test_ = 0; - base::ThreadChecker thread_checker_; // Wallpaper sequenced task runner. @@ -336,13 +188,8 @@ // A placeholder for |current_user_wallpaper_info_| under mash. wallpaper::WallpaperInfo dummy_current_user_wallpaper_info_; - // A placeholder for |wallpaper_cache_map_| under mash. - ash::CustomWallpaperMap dummy_wallpaper_cache_map_; - bool should_cache_wallpaper_ = false; - base::ObserverList<Observer> observers_; - bool retry_download_if_failed_ = true; ScopedObserver<wm::ActivationClient, wm::ActivationChangeObserver>
diff --git a/chrome/browser/chromeos/login/webview_login_browsertest.cc b/chrome/browser/chromeos/login/webview_login_browsertest.cc index 48bce5d..97931335 100644 --- a/chrome/browser/chromeos/login/webview_login_browsertest.cc +++ b/chrome/browser/chromeos/login/webview_login_browsertest.cc
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/run_loop.h" +#include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" @@ -17,8 +18,12 @@ #include "chrome/browser/chromeos/login/test/oobe_base_test.h" #include "chrome/browser/chromeos/login/test/oobe_screen_waiter.h" #include "chrome/browser/chromeos/login/ui/login_display_webui.h" +#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" +#include "chrome/browser/chromeos/policy/device_policy_builder.h" #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" +#include "chrome/browser/policy/test/local_policy_test_server.h" +#include "chrome/browser/ui/login/login_handler.h" #include "chrome/browser/ui/webui/signin/signin_utils.h" #include "chromeos/chromeos_switches.h" #include "chromeos/dbus/dbus_thread_manager.h" @@ -27,9 +32,15 @@ #include "components/guest_view/browser/guest_view_manager.h" #include "components/onc/onc_constants.h" #include "components/onc/onc_pref_names.h" +#include "components/policy/core/common/cloud/device_management_service.h" +#include "components/policy/core/common/policy_service.h" +#include "components/policy/core/common/policy_switches.h" +#include "components/policy/policy_constants.h" #include "components/policy/proto/chrome_device_policy.pb.h" #include "components/prefs/pref_change_registrar.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" +#include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_utils.h" @@ -98,6 +109,12 @@ return cookies; } +void PolicyChangedCallback(base::RepeatingClosure callback, + const base::Value* old_value, + const base::Value* new_value) { + callback.Run(); +} + // Spins the loop until a notification is received from |prefs| that the value // of |pref_name| has changed. If the notification is received before Wait() // has been called, Wait() returns immediately and no loop is spun. @@ -397,6 +414,9 @@ device_policy_test_helper_.InstallOwnerKey(); device_policy_test_helper_.MarkAsEnterpriseOwned(); + fake_session_manager_client_->set_device_policy( + device_policy_test_helper_.device_policy()->GetBlob()); + WebviewLoginTest::SetUpInProcessBrowserTestFixture(); } @@ -721,4 +741,191 @@ EXPECT_EQ("got no client cert", https_reply_content); } +class WebviewProxyAuthLoginTest : public WebviewLoginTest { + public: + WebviewProxyAuthLoginTest() + : auth_proxy_server_(std::make_unique<net::SpawnedTestServer>( + net::SpawnedTestServer::TYPE_BASIC_AUTH_PROXY, + base::FilePath())) {} + + protected: + void SetUp() override { + // Start proxy server + auth_proxy_server_->set_redirect_connect_to_localhost(true); + ASSERT_TRUE(auth_proxy_server_->Start()); + + // Prepare device policy which will be used for two purposes: + // - given to |fake_session_manager_client_|, so the device appears to have + // registered for policy. + // - the payload is given to |policy_test_server_|, so we can download fresh + // policy. + device_policy_test_helper_.device_policy() + ->policy_data() + .set_public_key_version(1); + device_policy_test_helper_.device_policy()->Build(); + + // Start policy server. Use the DMToken and DeviceId from PolicyBuilder. + // These also used in |device_policy_test_helper_| and was passed to + // |fake_session_manager_client_| above, so the device will request policy + // with these identifiers. + policy_test_server_.RegisterClient(policy::PolicyBuilder::kFakeToken, + policy::PolicyBuilder::kFakeDeviceId); + UpdateServedPolicyFromDevicePolicyTestHelper(); + ASSERT_TRUE(policy_test_server_.Start()); + + WebviewLoginTest::SetUp(); + } + + void SetUpCommandLine(base::CommandLine* command_line) override { + command_line->AppendSwitchASCII( + ::switches::kProxyServer, + auth_proxy_server_->host_port_pair().ToString()); + command_line->AppendSwitchASCII(policy::switches::kDeviceManagementUrl, + policy_test_server_.GetServiceURL().spec()); + WebviewLoginTest::SetUpCommandLine(command_line); + } + + void SetUpInProcessBrowserTestFixture() override { + WebviewLoginTest::SetUpInProcessBrowserTestFixture(); + + // Use a fake SessionManagerClient to be able to pretend that the device has + // been enrolled and registered for policy (and has a device DMToken). + auto fake_session_manager_client = + std::make_unique<FakeSessionManagerClient>(); + fake_session_manager_client_ = fake_session_manager_client.get(); + DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( + std::move(fake_session_manager_client)); + device_policy_test_helper_.InstallOwnerKey(); + device_policy_test_helper_.MarkAsEnterpriseOwned(); + + fake_session_manager_client_->set_device_policy( + device_policy_builder()->GetBlob()); + + // Set some fake state keys to make sure they are not empty. + std::vector<std::string> state_keys; + state_keys.push_back("1"); + fake_session_manager_client_->set_server_backed_state_keys(state_keys); + } + + void SetUpOnMainThread() override { + // Setup the observer reacting on NOTIFICATION_AUTH_NEEDED before the test + // runs because there is no action we actively trigger to request proxy + // authentication. Instead, the sign-in screen automatically shows the gaia + // webview, which will request the gaia URL, which leads to a login prompt. + auth_needed_wait_loop_ = std::make_unique<base::RunLoop>(); + auth_needed_observer_ = + std::make_unique<content::WindowedNotificationObserver>( + chrome::NOTIFICATION_AUTH_NEEDED, + base::BindRepeating(&WebviewProxyAuthLoginTest::OnAuthRequested, + base::Unretained(this))); + + WebviewLoginTest::SetUpOnMainThread(); + } + + void TearDownOnMainThread() override { + WebviewLoginTest::TearDownOnMainThread(); + + auth_needed_observer_.reset(); + auth_needed_wait_loop_.reset(); + } + + bool OnAuthRequested(const content::NotificationSource& source, + const content::NotificationDetails& details) { + // Only care for notifications originating from the frame which is + // displaying gaia. + content::WebContents* main_web_contents = GetLoginUI()->GetWebContents(); + content::WebContents* gaia_frame_web_contents = + signin::GetAuthFrameWebContents(main_web_contents, gaia_frame_parent_); + LoginHandler* login_handler = + content::Details<LoginNotificationDetails>(details)->handler(); + if (login_handler->GetWebContentsForLogin() != gaia_frame_web_contents) + return false; + + gaia_frame_login_handler_ = login_handler; + auth_needed_wait_loop_->Quit(); + return true; + } + + // Waits until proxy authentication has been requested by the frame displaying + // gaia. Returns the LoginHandler handling this authentication request. + LoginHandler* WaitForAuthRequested() { + auth_needed_wait_loop_->Run(); + return gaia_frame_login_handler_; + } + + void UpdateServedPolicyFromDevicePolicyTestHelper() { + policy_test_server_.UpdatePolicy( + policy::dm_protocol::kChromeDevicePolicyType, + std::string() /* entity_id */, + device_policy_builder()->payload().SerializeAsString()); + } + + policy::DevicePolicyBuilder* device_policy_builder() { + return device_policy_test_helper_.device_policy(); + } + + content::WindowedNotificationObserver* auth_needed_observer() { + return auth_needed_observer_.get(); + } + + private: + std::unique_ptr<content::WindowedNotificationObserver> auth_needed_observer_; + std::unique_ptr<base::RunLoop> auth_needed_wait_loop_; + // Unowned pointer - set to the LoginHandler of the frame displaying gaia. + LoginHandler* gaia_frame_login_handler_ = nullptr; + + // A proxy server which requires authentication using the 'Basic' + // authentication method. + std::unique_ptr<net::SpawnedTestServer> auth_proxy_server_; + policy::LocalPolicyTestServer policy_test_server_; + policy::DevicePolicyCrosTestHelper device_policy_test_helper_; + + // FakeDBusThreadManager uses FakeSessionManagerClient. + std::unique_ptr<chromeos::DBusThreadManagerSetter> dbus_setter_; + // Unowned pointer - owned by DBusThreadManager. + chromeos::FakeSessionManagerClient* fake_session_manager_client_; + + DISALLOW_COPY_AND_ASSIGN(WebviewProxyAuthLoginTest); +}; + +IN_PROC_BROWSER_TEST_F(WebviewProxyAuthLoginTest, ProxyAuthTransfer) { + WaitForSigninScreen(); + + LoginHandler* login_handler = WaitForAuthRequested(); + + // Before entering auth data, make |policy_test_server_| serve a policy that + // we can use to detect if policies have been fetched. + em::ChromeDeviceSettingsProto& device_policy = + device_policy_builder()->payload(); + device_policy.mutable_device_login_screen_auto_select_certificate_for_urls() + ->add_login_screen_auto_select_certificate_rules("test_pattern"); + UpdateServedPolicyFromDevicePolicyTestHelper(); + + policy::PolicyChangeRegistrar policy_change_registrar( + g_browser_process->platform_part() + ->browser_policy_connector_chromeos() + ->GetPolicyService(), + policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, + std::string() /* component_id */)); + + // Now enter auth data + login_handler->SetAuth(base::ASCIIToUTF16("foo"), base::ASCIIToUTF16("bar")); + WaitForGaiaPageLoad(); + + base::RunLoop run_loop; + policy_change_registrar.Observe( + policy::key::kDeviceLoginScreenAutoSelectCertificateForUrls, + base::BindRepeating(&PolicyChangedCallback, run_loop.QuitClosure())); + run_loop.Run(); + + // Press the back button at a sign-in screen without pre-existing users to + // start a new sign-in attempt. + // This will re-load gaia, rotating the StoragePartition. The new + // StoragePartition must also have the proxy auth details. + JS().Evaluate("$('signin-back-button').fire('tap')"); + WaitForGaiaPageReload(); + // Expect that we got back to the identifier page, as there are no known users + // so the sign-in screen will not display user pods. + ExpectIdentifierPage(); +} } // namespace chromeos
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 5e6d18c7..4ca962e 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -370,6 +370,11 @@ if (!IsMachineHWIDCorrect() && !StartupUtils::IsDeviceRegistered() && first_screen_ == OobeScreen::SCREEN_UNKNOWN) ShowWrongHWIDScreen(); + + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + chromeos::switches::kOobeSkipToLogin)) { + SkipToLoginForTesting(LoginScreenContext()); + } } ErrorScreen* WizardController::GetErrorScreen() {
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc index a788d09..f48d9ac 100644 --- a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc +++ b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc
@@ -89,7 +89,6 @@ base::WrapUnique(user_manager)); DBusThreadManager::Initialize(); - base::StatisticsRecorder::Initialize(); SetupNetworkHandler(); ASSERT_TRUE(test_profile_manager_.SetUp());
diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc index bcddaa2..81e8b7e 100644 --- a/chrome/browser/chromeos/options/vpn_config_view.cc +++ b/chrome/browser/chromeos/options/vpn_config_view.cc
@@ -497,7 +497,7 @@ void VPNConfigView::Init() { const views::LayoutProvider* provider = views::LayoutProvider::Get(); SetBorder(views::CreateEmptyBorder( - provider->GetDialogInsetsForContentType(views::CONTROL, views::CONTROL))); + provider->GetDialogInsetsForContentType(views::CONTROL, views::TEXT))); const NetworkState* vpn = NULL; if (!service_path_.empty()) {
diff --git a/chrome/browser/chromeos/policy/pre_signin_policy_fetcher.cc b/chrome/browser/chromeos/policy/pre_signin_policy_fetcher.cc index 664452b..4680b4b 100644 --- a/chrome/browser/chromeos/policy/pre_signin_policy_fetcher.cc +++ b/chrome/browser/chromeos/policy/pre_signin_policy_fetcher.cc
@@ -18,8 +18,10 @@ #include "base/task_scheduler/task_traits.h" #include "base/time/time.h" #include "chromeos/chromeos_paths.h" +#include "chromeos/cryptohome/cryptohome_util.h" #include "chromeos/cryptohome/homedir_methods.h" #include "chromeos/dbus/cryptohome_client.h" +#include "chromeos/dbus/dbus_thread_manager.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" #include "components/policy/proto/device_management_backend.pb.h" #include "google_apis/gaia/gaia_auth_util.h" @@ -71,7 +73,7 @@ key->set_secret(auth_key_.secret); cryptohome::MountRequest mount; mount.set_hidden_mount(true); - cryptohome::HomedirMethods::GetInstance()->MountEx( + chromeos::DBusThreadManager::Get()->GetCryptohomeClient()->MountEx( cryptohome::Identification(account_id_), auth, mount, base::Bind(&PreSigninPolicyFetcher::OnMountTemporaryUserHome, weak_ptr_factory_.GetWeakPtr())); @@ -88,10 +90,8 @@ } void PreSigninPolicyFetcher::OnMountTemporaryUserHome( - bool success, - cryptohome::MountError return_code, - const std::string& mount_hash) { - if (!success || return_code != cryptohome::MOUNT_ERROR_NONE) { + base::Optional<cryptohome::BaseReply> reply) { + if (BaseReplyToMountError(reply) != cryptohome::MOUNT_ERROR_NONE) { LOG(ERROR) << "Temporary user home mount failed."; NotifyCallback(PolicyFetchResult::ERROR, nullptr); return;
diff --git a/chrome/browser/chromeos/policy/pre_signin_policy_fetcher.h b/chrome/browser/chromeos/policy/pre_signin_policy_fetcher.h index 8014003..5c1239d 100644 --- a/chrome/browser/chromeos/policy/pre_signin_policy_fetcher.h +++ b/chrome/browser/chromeos/policy/pre_signin_policy_fetcher.h
@@ -15,6 +15,7 @@ #include "base/timer/timer.h" #include "chrome/browser/chromeos/policy/cached_policy_key_loader_chromeos.h" #include "chromeos/cryptohome/cryptohome_parameters.h" +#include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/session_manager_client.h" #include "components/policy/core/common/cloud/cloud_policy_client.h" #include "components/policy/core/common/cloud/cloud_policy_validator.h" @@ -89,9 +90,7 @@ using RetrievePolicyResponseType = chromeos::SessionManagerClient::RetrievePolicyResponseType; - void OnMountTemporaryUserHome(bool success, - cryptohome::MountError return_code, - const std::string& mount_hash); + void OnMountTemporaryUserHome(base::Optional<cryptohome::BaseReply> reply); void OnCachedPolicyRetrieved( RetrievePolicyResponseType retrieve_policy_response,
diff --git a/chrome/browser/chromeos/policy/pre_signin_policy_fetcher_unittest.cc b/chrome/browser/chromeos/policy/pre_signin_policy_fetcher_unittest.cc index fb24299..112f598 100644 --- a/chrome/browser/chromeos/policy/pre_signin_policy_fetcher_unittest.cc +++ b/chrome/browser/chromeos/policy/pre_signin_policy_fetcher_unittest.cc
@@ -18,9 +18,8 @@ #include "base/test/scoped_task_environment.h" #include "chromeos/chromeos_paths.h" #include "chromeos/cryptohome/cryptohome_parameters.h" -#include "chromeos/cryptohome/homedir_methods.h" -#include "chromeos/cryptohome/mock_homedir_methods.h" #include "chromeos/dbus/cryptohome_client.h" +#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_cryptohome_client.h" #include "chromeos/dbus/fake_session_manager_client.h" #include "components/policy/core/common/cloud/cloud_policy_constants.h" @@ -52,16 +51,13 @@ PreSigninPolicyFetcherTestBase() = default; void SetUp() override { - // Setup mock HomedirMethods - this is used by PreSigninPolicyFetcher to - // perform the temporary cryptohome mount. - // Ownership of mock_homedir_methods_ is passsed to - // HomedirMethods::InitializeForTesting. - mock_homedir_methods_ = new cryptohome::MockHomedirMethods; - cryptohome::HomedirMethods::InitializeForTesting(mock_homedir_methods_); // Unmount calls will succeed (currently, PreSigninPolicyFetcher only logs // if they fail, so there is no point in testing that). - cryptohome_client_.set_unmount_result(true); + cryptohome_client_ = new chromeos::FakeCryptohomeClient(); + chromeos::DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( + base::WrapUnique<chromeos::CryptohomeClient>(cryptohome_client_)); + cryptohome_client_->set_unmount_result(true); // Create a temporary directory where the user policy keys will live (these // are shared between session_manager and chrome through files) and set it @@ -73,7 +69,7 @@ auto cloud_policy_client = base::MakeUnique<MockCloudPolicyClient>(); cloud_policy_client_ = cloud_policy_client.get(); pre_signin_policy_fetcher_ = base::MakeUnique<PreSigninPolicyFetcher>( - &cryptohome_client_, &session_manager_client_, + cryptohome_client_, &session_manager_client_, std::move(cloud_policy_client), IsActiveDirectoryManaged(), GetAccountId(), cryptohome_key_); cached_policy_.payload().mutable_homepagelocation()->set_value( @@ -86,9 +82,8 @@ } void TearDown() override { + chromeos::DBusThreadManager::Shutdown(); base::RunLoop().RunUntilIdle(); - cryptohome::HomedirMethods::Shutdown(); - mock_homedir_methods_ = nullptr; } // Returns true for Active Directory test, false otherwise. @@ -122,29 +117,6 @@ .AppendASCII("policy.pub"); } - // Expect that the hidden cryptohome mount will be attempted, and return - // the passed |mount_error|. - void ExpectTemporaryCryptohomeMount(cryptohome::MountError mount_error) { - EXPECT_CALL(*mock_homedir_methods_, - MountEx(GetCryptohomeIdentification(), _, _, _)) - .WillOnce(WithArgs<2, 3>(Invoke( - [mount_error](const cryptohome::MountRequest& mount_request, - cryptohome::HomedirMethods::MountCallback callback) { - EXPECT_TRUE(mount_request.hidden_mount()); - // Expect regular user home (not public mount). Note that ARC - // Kiosk apps will not run through PreSigninPolicyFetcher. - EXPECT_FALSE(mount_request.public_mount()); - callback.Run(true /* success */, mount_error, - std::string() /* mount_hash */); - }))); - } - - // Expect that the temporary cryptohome mount will be attempted, and return - // success. - void ExpectTemporaryCryptohomeMount() { - ExpectTemporaryCryptohomeMount(cryptohome::MOUNT_ERROR_NONE); - } - // Sets up expectations on |cloud_policy_client_|, expecting a fresh policy // fetch call sequence. void ExpectFreshPolicyFetchOnClient(const std::string& dm_token, @@ -194,8 +166,7 @@ base::test::ScopedTaskEnvironment scoped_task_environment_ = { base::test::ScopedTaskEnvironment::MainThreadType::UI}; - cryptohome::MockHomedirMethods* mock_homedir_methods_ = nullptr; - chromeos::FakeCryptohomeClient cryptohome_client_; + chromeos::FakeCryptohomeClient* cryptohome_client_ = nullptr; chromeos::FakeSessionManagerClient session_manager_client_; UserPolicyBuilder cached_policy_; UserPolicyBuilder fresh_policy_; @@ -235,7 +206,6 @@ // user). The cached policy fetch succeeds with NO_POLICY. // PreSigninPolicyFetcher does not attempt to fetch fresh policy. TEST_F(PreSigninPolicyFetcherTest, NoPolicy) { - ExpectTemporaryCryptohomeMount(); // session_manager's RetrievePolicy* methods signal that there is no policy by // passing an empty string as policy blob. session_manager_client_.set_user_policy_without_session( @@ -250,13 +220,18 @@ EXPECT_EQ(PreSigninPolicyFetcher::PolicyFetchResult::NO_POLICY, obtained_policy_fetch_result_); EXPECT_FALSE(obtained_policy_payload_); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } // Test that PreSigninPolicyFetcher signals an error when the temporary // cryptohome mount fails. TEST_F(PreSigninPolicyFetcherTest, CryptohomeTemporaryMountError) { - ExpectTemporaryCryptohomeMount( - cryptohome::MountError::MOUNT_ERROR_KEY_FAILURE); + cryptohome_client_->set_cryptohome_error( + cryptohome::CryptohomeErrorCode:: + CRYPTOHOME_ERROR_AUTHORIZATION_KEY_DENIED); ExecuteFetchPolicy(); @@ -264,6 +239,10 @@ EXPECT_EQ(PreSigninPolicyFetcher::PolicyFetchResult::ERROR, obtained_policy_fetch_result_); EXPECT_FALSE(obtained_policy_payload_); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } // Break the signature of cached policy. We expect that the cached policy @@ -275,7 +254,6 @@ StoreUserPolicyKey(cached_policy_.GetPublicSigningKeyAsString()); - ExpectTemporaryCryptohomeMount(); session_manager_client_.set_user_policy_without_session( GetCryptohomeIdentification(), cached_policy_.GetBlob()); @@ -288,6 +266,10 @@ EXPECT_EQ(PreSigninPolicyFetcher::PolicyFetchResult::ERROR, obtained_policy_fetch_result_); EXPECT_FALSE(obtained_policy_payload_); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } // Don't call StoreUserPolicyKey - chrome won't find a cached policy key. We @@ -295,7 +277,6 @@ // PolicyFetchResult::ERROR as response. PreSigninPolicyFetcher will not // attempt to fetch fresh policy in this case. TEST_F(PreSigninPolicyFetcherTest, NoCachedPolicyKeyAccessible) { - ExpectTemporaryCryptohomeMount(); session_manager_client_.set_user_policy_without_session( GetCryptohomeIdentification(), cached_policy_.GetBlob()); @@ -308,6 +289,10 @@ EXPECT_EQ(PreSigninPolicyFetcher::PolicyFetchResult::ERROR, obtained_policy_fetch_result_); EXPECT_FALSE(obtained_policy_payload_); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } // Cached policy is available and validates. However, fresh policy fetch fails @@ -316,8 +301,6 @@ // callback. TEST_F(PreSigninPolicyFetcherTest, FreshPolicyFetchFails) { StoreUserPolicyKey(cached_policy_.GetPublicSigningKeyAsString()); - - ExpectTemporaryCryptohomeMount(); session_manager_client_.set_user_policy_without_session( GetCryptohomeIdentification(), cached_policy_.GetBlob()); @@ -337,6 +320,10 @@ EXPECT_TRUE(obtained_policy_payload_); EXPECT_EQ(kCachedHomepage, obtained_policy_payload_->homepagelocation().value()); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } // Cached policy is available and validates. However, fresh policy fetch fails @@ -345,7 +332,6 @@ TEST_F(PreSigninPolicyFetcherTest, FreshPolicyFetchTimeout) { StoreUserPolicyKey(cached_policy_.GetPublicSigningKeyAsString()); - ExpectTemporaryCryptohomeMount(); session_manager_client_.set_user_policy_without_session( GetCryptohomeIdentification(), cached_policy_.GetBlob()); @@ -357,7 +343,6 @@ // Fresh policy fetch times out. EXPECT_TRUE(pre_signin_policy_fetcher_->ForceTimeoutForTesting()); - // Expect that we still get PolicyFetchResult::SUCCESS with the cached policy. EXPECT_TRUE(policy_retrieved_called_); EXPECT_EQ(PreSigninPolicyFetcher::PolicyFetchResult::SUCCESS, @@ -365,6 +350,10 @@ EXPECT_TRUE(obtained_policy_payload_); EXPECT_EQ(kCachedHomepage, obtained_policy_payload_->homepagelocation().value()); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } // Cached policy is available and validates. Fresh policy fetch is also @@ -374,7 +363,6 @@ TEST_F(PreSigninPolicyFetcherTest, FreshPolicyFetchFailsToValidate) { StoreUserPolicyKey(cached_policy_.GetPublicSigningKeyAsString()); - ExpectTemporaryCryptohomeMount(); session_manager_client_.set_user_policy_without_session( GetCryptohomeIdentification(), cached_policy_.GetBlob()); @@ -400,6 +388,10 @@ EXPECT_TRUE(obtained_policy_payload_); EXPECT_EQ(kCachedHomepage, obtained_policy_payload_->homepagelocation().value()); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } // Cached policy is available and validates. Fresh policy fetch is also @@ -409,7 +401,6 @@ TEST_F(PreSigninPolicyFetcherTest, FreshPolicyFetchSuccess) { StoreUserPolicyKey(cached_policy_.GetPublicSigningKeyAsString()); - ExpectTemporaryCryptohomeMount(); session_manager_client_.set_user_policy_without_session( GetCryptohomeIdentification(), cached_policy_.GetBlob()); @@ -433,6 +424,10 @@ EXPECT_TRUE(obtained_policy_payload_); EXPECT_EQ(kFreshHomepage, obtained_policy_payload_->homepagelocation().value()); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } // Tests for PreSigninPolicyFetcher with an Active Directory account. @@ -450,7 +445,6 @@ // For Active Directory, we only have unsigned cached policy. There is no policy // key and no fresh policy fetch is attempted currently. TEST_F(PreSigninPolicyFetcherTestAD, UnsignedCachedPolicyForActiveDirectory) { - ExpectTemporaryCryptohomeMount(); session_manager_client_.set_user_policy_without_session( GetCryptohomeIdentification(), cached_policy_.GetBlob()); @@ -465,6 +459,10 @@ EXPECT_TRUE(obtained_policy_payload_); EXPECT_EQ(kCachedHomepage, obtained_policy_payload_->homepagelocation().value()); + EXPECT_TRUE(cryptohome_client_->hidden_mount()); + // Expect regular user home (not public mount). Note that ARC + // Kiosk apps will not run through PreSigninPolicyFetcher. + EXPECT_FALSE(cryptohome_client_->public_mount()); } } // namespace
diff --git a/chrome/browser/chromeos/printing/external_printers.cc b/chrome/browser/chromeos/printing/external_printers.cc index 1e1b325..7311b79 100644 --- a/chrome/browser/chromeos/printing/external_printers.cc +++ b/chrome/browser/chromeos/printing/external_printers.cc
@@ -5,229 +5,367 @@ #include "chrome/browser/chromeos/printing/external_printers.h" #include <set> -#include <utility> +#include "base/feature_list.h" #include "base/json/json_reader.h" #include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/sequence_checker.h" +#include "base/sequenced_task_runner.h" #include "base/stl_util.h" +#include "base/task_runner_util.h" +#include "base/task_scheduler/post_task.h" +#include "base/threading/thread_restrictions.h" #include "base/values.h" +#include "chrome/common/chrome_features.h" #include "chromeos/printing/printer_translator.h" namespace chromeos { + namespace { constexpr int kMaxRecords = 20000; -class ExternalPrintersImpl : public ExternalPrinters { +using PrinterCache = std::vector<std::unique_ptr<Printer>>; +using PrinterView = std::map<const std::string, const Printer>; + +// Parses |data|, a JSON blob, into a vector of Printers. If |data| cannot be +// parsed, returns nullptr. This is run off the UI thread as it could be very +// slow. +std::unique_ptr<PrinterCache> ParsePrinters(std::unique_ptr<std::string> data) { + int error_code = 0; + int error_line = 0; + + // This could be really slow. + base::AssertBlockingAllowed(); + std::unique_ptr<base::Value> json_blob = base::JSONReader::ReadAndReturnError( + *data, base::JSONParserOptions::JSON_PARSE_RFC, &error_code, + nullptr /* error_msg_out */, &error_line); + // It's not valid JSON. Give up. + if (!json_blob || !json_blob->is_list()) { + LOG(WARNING) << "Failed to parse printers policy (" << error_code + << ") on line " << error_line; + return nullptr; + } + + const base::Value::ListStorage& printer_list = json_blob->GetList(); + if (printer_list.size() > kMaxRecords) { + LOG(WARNING) << "Too many records in printers policy: " + << printer_list.size(); + return nullptr; + } + + auto parsed_printers = std::make_unique<PrinterCache>(); + parsed_printers->reserve(printer_list.size()); + for (const base::Value& val : printer_list) { + // TODO(skau): Convert to the new Value APIs. + const base::DictionaryValue* printer_dict; + if (!val.GetAsDictionary(&printer_dict)) { + LOG(WARNING) << "Entry in printers policy skipped. Not a dictionary."; + continue; + } + + auto printer = RecommendedPrinterToPrinter(*printer_dict); + if (!printer) { + LOG(WARNING) << "Failed to parse printer configuration. Skipped."; + continue; + } + parsed_printers->push_back(std::move(printer)); + } + + return parsed_printers; +} + +// Computes the effective printer list using the access mode and +// blacklist/whitelist. Methods are required to be sequenced. This object is +// the owner of all the policy data. +class Restrictions { public: - ExternalPrintersImpl() = default; - ~ExternalPrintersImpl() override = default; + Restrictions() : printers_cache_(nullptr) { + DETACH_FROM_SEQUENCE(sequence_checker_); + } + ~Restrictions() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } - // Resets the printer state fields. - void ClearData() override { + // Sets the printer cache using the policy blob |data|. If the policy can be + // computed, returns the computed list. Otherwise, nullptr. + std::unique_ptr<PrinterView> SetData(std::unique_ptr<std::string> data) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - bool notify = !printers_.empty(); - policy_retrieved_ = false; - printers_ready_ = false; - - // Swap with empty vectors to release the allocated memory. - std::vector<Printer> empty; - printers_.swap(empty); - std::vector<std::unique_ptr<Printer>> empty_ptrs; - all_printers_.swap(empty_ptrs); - - if (notify) { - Notify(); - } + base::AssertBlockingAllowed(); + printers_cache_ = ParsePrinters(std::move(data)); + return ComputePrinters(); } - void SetData(std::unique_ptr<std::string> data) override { + // Clear the printer cache. Computed lists will be invalid until we receive + // new data. + void ClearData() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - - int error_code; - int error_line; - std::unique_ptr<base::Value> json_blob = - base::JSONReader::ReadAndReturnError( - *data, base::JSONParserOptions::JSON_PARSE_RFC, &error_code, - nullptr /* error_msg_out */, &error_line); - // It's not valid JSON. Invalidate config. - if (!json_blob || !json_blob->is_list()) { - LOG(WARNING) << "Failed to parse external policy (" << error_code - << ") on line " << error_line; - ClearData(); - return; - } - - const base::Value::ListStorage& printer_list = json_blob->GetList(); - if (printer_list.size() > kMaxRecords) { - LOG(ERROR) << "Too many records: " << printer_list.size(); - ClearData(); - return; - } - - for (const base::Value& val : printer_list) { - // TODO(skau): Convert to the new Value APIs. - const base::DictionaryValue* printer_dict; - if (!val.GetAsDictionary(&printer_dict)) { - LOG(WARNING) << "Entry is not a dictionary."; - continue; - } - - auto printer = RecommendedPrinterToPrinter(*printer_dict); - if (!printer) { - LOG(WARNING) << "Failed to parse printer configuration."; - continue; - } - all_printers_.push_back(std::move(printer)); - } - - policy_retrieved_ = true; - RecomputePrinters(); + printers_cache_.reset(); } - void AddObserver(Observer* observer) override { - observers_.AddObserver(observer); - } - - void RemoveObserver(Observer* observer) override { - observers_.RemoveObserver(observer); - } - - void SetAccessMode(AccessMode mode) override { + // Sets the access mode to |mode|. If the policy can be computed, returns the + // computed list. Otherwise, nullptr. + std::unique_ptr<PrinterView> UpdateAccessMode( + ExternalPrinters::AccessMode mode) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); mode_ = mode; - RecomputePrinters(); + return ComputePrinters(); } - void SetBlacklist(const std::vector<std::string>& blacklist) override { + // Sets the blacklist to |blacklist|. If the policy can be computed, returns + // the computed list. Otherwise, nullptr. + std::unique_ptr<PrinterView> UpdateBlacklist( + const std::vector<std::string>& blacklist) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - blacklist_.clear(); - blacklist_.insert(blacklist.begin(), blacklist.end()); has_blacklist_ = true; - RecomputePrinters(); + blacklist_ = std::set<std::string>(blacklist.begin(), blacklist.end()); + return ComputePrinters(); } - void SetWhitelist(const std::vector<std::string>& whitelist) override { + // Sets the whitelist to |whitelist|. If the policy can be computed, returns + // the computed list. Otherwise, nullptr. + std::unique_ptr<PrinterView> UpdateWhitelist( + const std::vector<std::string>& whitelist) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - whitelist_.clear(); - whitelist_.insert(whitelist.begin(), whitelist.end()); has_whitelist_ = true; - RecomputePrinters(); - } - - // Returns true if the printer configuration has been downloaded and parsed. - bool IsPolicySet() const override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return printers_ready_; - } - - // Returns all the printers available from the policy. - const std::vector<Printer>& GetPrinters() const override { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return printers_; + whitelist_ = std::set<std::string>(whitelist.begin(), whitelist.end()); + return ComputePrinters(); } private: - // Returns true if all required attributes have been set to compute the list - // of printers. + // Returns true if we have enough data to compute the effective printer list. bool IsReady() const { - if (!policy_retrieved_) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!printers_cache_) { return false; } switch (mode_) { - case AccessMode::ALL_ACCESS: + case ExternalPrinters::AccessMode::ALL_ACCESS: return true; - case AccessMode::BLACKLIST_ONLY: + case ExternalPrinters::AccessMode::BLACKLIST_ONLY: return has_blacklist_; - case AccessMode::WHITELIST_ONLY: + case ExternalPrinters::AccessMode::WHITELIST_ONLY: return has_whitelist_; - case AccessMode::UNSET: + case ExternalPrinters::AccessMode::UNSET: return false; } NOTREACHED(); return false; } - void RecomputePrinters() { - // Assume we're not ready. - printers_ready_ = false; + // Returns the effective printer list based on |mode_| from the entries in + // |printers_cache_|. + std::unique_ptr<PrinterView> ComputePrinters() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!IsReady()) { - return; + return nullptr; } - // Drop all printers, we're recomputing. - printers_.clear(); + auto view = std::make_unique<PrinterView>(); switch (mode_) { - case UNSET: + case ExternalPrinters::UNSET: NOTREACHED(); break; - case WHITELIST_ONLY: - for (const auto& printer : all_printers_) { + case ExternalPrinters::WHITELIST_ONLY: + for (const auto& printer : *printers_cache_) { if (base::ContainsKey(whitelist_, printer->id())) { - printers_.push_back(*printer); + view->insert({printer->id(), *printer}); } } break; - case BLACKLIST_ONLY: - for (const auto& printer : all_printers_) { + case ExternalPrinters::BLACKLIST_ONLY: + for (const auto& printer : *printers_cache_) { if (!base::ContainsKey(blacklist_, printer->id())) { - printers_.push_back(*printer); + view->insert({printer->id(), *printer}); } } break; - case ALL_ACCESS: - for (const auto& printer : all_printers_) { - printers_.push_back(*printer); + case ExternalPrinters::ALL_ACCESS: + for (const auto& printer : *printers_cache_) { + view->insert({printer->id(), *printer}); } break; } - // Everything has been computed. Results are ready. - printers_ready_ = true; - - // We assume something changed. Notify now. - Notify(); + return view; } - void Notify() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - for (auto& observer : observers_) { - observer.OnPrintersChanged(); - } - } + // Cache of the parsed printer configuration file. + std::unique_ptr<PrinterCache> printers_cache_; - // True if all necessary information has been set to compute the set of - // printers. - bool printers_ready_ = false; - // Only true after the external policy has been downloaded. - bool policy_retrieved_ = false; - - AccessMode mode_ = UNSET; + // The type of restriction which is enforced. + ExternalPrinters::AccessMode mode_ = ExternalPrinters::UNSET; + // The list of ids which should not appear in the final list. bool has_blacklist_ = false; std::set<std::string> blacklist_; + // The list of the only ids which should appear in the final list. bool has_whitelist_ = false; std::set<std::string> whitelist_; - // Cache of the parsed printer configuration file. - std::vector<std::unique_ptr<Printer>> all_printers_; + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(Restrictions); +}; + +class ExternalPrintersImpl : public ExternalPrinters { + public: + ExternalPrintersImpl() + : restrictions_(std::make_unique<Restrictions>()), + restrictions_runner_(base::CreateSequencedTaskRunnerWithTraits( + {base::TaskPriority::BACKGROUND, base::MayBlock(), + base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})), + weak_ptr_factory_(this) {} + ~ExternalPrintersImpl() override { + bool success = + restrictions_runner_->DeleteSoon(FROM_HERE, std::move(restrictions_)); + if (!success) { + LOG(WARNING) << "Unable to schedule deletion of policy object."; + } + } + + void AddObserver(Observer* observer) override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + observers_.AddObserver(observer); + } + + void RemoveObserver(Observer* observer) override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + observers_.RemoveObserver(observer); + } + + // Resets the printer state fields. + void ClearData() override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!base::FeatureList::IsEnabled(features::kBulkPrinters)) { + return; + } + + // Update restrictions then clear our local cache on return so we don't get + // out of sequence. + restrictions_runner_->PostTaskAndReply( + FROM_HERE, + base::BindOnce(&Restrictions::ClearData, + base::Unretained(restrictions_.get())), + base::BindOnce(&ExternalPrintersImpl::OnComputationComplete, + weak_ptr_factory_.GetWeakPtr(), nullptr)); + } + + void SetData(std::unique_ptr<std::string> data) override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + if (!base::FeatureList::IsEnabled(features::kBulkPrinters)) { + return; + } + + if (!data) { + LOG(WARNING) << "Received null data"; + return; + } + + // Forward data to Restrictions for computation. + base::PostTaskAndReplyWithResult( + restrictions_runner_.get(), FROM_HERE, + base::BindOnce(&Restrictions::SetData, + base::Unretained(restrictions_.get()), std::move(data)), + base::BindOnce(&ExternalPrintersImpl::OnComputationComplete, + weak_ptr_factory_.GetWeakPtr())); + } + + void SetAccessMode(AccessMode mode) override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + base::PostTaskAndReplyWithResult( + restrictions_runner_.get(), FROM_HERE, + base::BindOnce(&Restrictions::UpdateAccessMode, + base::Unretained(restrictions_.get()), mode), + base::BindOnce(&ExternalPrintersImpl::OnComputationComplete, + weak_ptr_factory_.GetWeakPtr())); + } + + void SetBlacklist(const std::vector<std::string>& blacklist) override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + base::PostTaskAndReplyWithResult( + restrictions_runner_.get(), FROM_HERE, + base::BindOnce(&Restrictions::UpdateBlacklist, + base::Unretained(restrictions_.get()), blacklist), + base::BindOnce(&ExternalPrintersImpl::OnComputationComplete, + weak_ptr_factory_.GetWeakPtr())); + } + + void SetWhitelist(const std::vector<std::string>& whitelist) override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + base::PostTaskAndReplyWithResult( + restrictions_runner_.get(), FROM_HERE, + base::BindOnce(&Restrictions::UpdateWhitelist, + base::Unretained(restrictions_.get()), whitelist), + base::BindOnce(&ExternalPrintersImpl::OnComputationComplete, + weak_ptr_factory_.GetWeakPtr())); + } + + bool IsPolicySet() const override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + return received_data_; + } + + const std::map<const std::string, const Printer>& GetPrinters() + const override { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + return printers_; + } + + private: + // Called on computation completion. |view| is the computed printers which a + // user should be able to see. If |view| is nullptr, it's taken to mean that + // the list is now invalid and will be cleared. + void OnComputationComplete(std::unique_ptr<PrinterView> view) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + bool valid; + if (!view) { + // Printers are dropped if parsing failed. We can no longer determine + // what the domain owner wanted. + printers_.clear(); + valid = false; + } else { + printers_.swap(*view); + valid = true; + } + + // Maybe notify that the computed list has changed. + // Do not notify for invalid->invalid transitions + if (!valid && !received_data_) { + return; + } + + received_data_ = valid; + for (auto& observer : observers_) { + // We rely on the assumption that this is sequenced with the rest of our + // code to guarantee that printers_ remains valid. + observer.OnPrintersChanged(received_data_, printers_); + } + } + + // Holds the blacklist and whitelist. Computes the effective printer list. + std::unique_ptr<Restrictions> restrictions_; + // Off UI sequence for computing the printer view. + scoped_refptr<base::SequencedTaskRunner> restrictions_runner_; + + // True if printers_ is based on a current policy. + bool received_data_ = false; // The computed set of printers. - std::vector<Printer> printers_; + PrinterView printers_; base::ObserverList<ExternalPrinters::Observer> observers_; SEQUENCE_CHECKER(sequence_checker_); + base::WeakPtrFactory<ExternalPrintersImpl> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(ExternalPrintersImpl); }; + } // namespace // static std::unique_ptr<ExternalPrinters> ExternalPrinters::Create() { - return base::MakeUnique<ExternalPrintersImpl>(); + return std::make_unique<ExternalPrintersImpl>(); } } // namespace chromeos
diff --git a/chrome/browser/chromeos/printing/external_printers.h b/chrome/browser/chromeos/printing/external_printers.h index e7a6033..a180fbd 100644 --- a/chrome/browser/chromeos/printing/external_printers.h +++ b/chrome/browser/chromeos/printing/external_printers.h
@@ -5,30 +5,30 @@ #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_EXTERNAL_PRINTERS_H_ #define CHROME_BROWSER_CHROMEOS_PRINTING_EXTERNAL_PRINTERS_H_ +#include <map> #include <memory> #include <string> #include <utility> #include <vector> -#include "base/macros.h" -#include "chrome/browser/chromeos/policy/cloud_external_data_policy_observer.h" +#include "chromeos/chromeos_export.h" #include "chromeos/printing/printer_configuration.h" namespace chromeos { // Manages download and parsing of the external policy printer configuration and // enforces restrictions. -class ExternalPrinters { +class CHROMEOS_EXPORT ExternalPrinters { public: // Choose the policy for printer access. enum AccessMode { - UNSET, + UNSET = -1, // Printers in the blacklist are disallowed. Others are allowed. - BLACKLIST_ONLY, + BLACKLIST_ONLY = 0, // Only printers in the whitelist are allowed. - WHITELIST_ONLY, + WHITELIST_ONLY = 1, // All printers in the policy are allowed. - ALL_ACCESS + ALL_ACCESS = 2 }; // Observer is notified when the computed set of printers change. It is @@ -36,8 +36,12 @@ // observing. class Observer { public: - // Called when the computed set of printers changes. - virtual void OnPrintersChanged() = 0; + // Called when the printers have changed and should be queried. |valid| is + // true if |printers| is based on a valid policy. |printers| are the + // printers that should be available to the user. + virtual void OnPrintersChanged( + bool valid, + const std::map<const std::string, const Printer>& printers) = 0; }; // Creates a handler for the external printer policies. @@ -45,24 +49,35 @@ virtual ~ExternalPrinters() = default; + virtual void AddObserver(Observer* observer) = 0; + virtual void RemoveObserver(Observer* observer) = 0; + // Parses |data| which is the contents of the bulk printes file and extracts // printer information. The file format is assumed to be JSON. virtual void SetData(std::unique_ptr<std::string> data) = 0; // Removes all printer data and invalidates the configuration. virtual void ClearData() = 0; - virtual void AddObserver(Observer* observer) = 0; - virtual void RemoveObserver(Observer* observer) = 0; - + // Set the access mode which chooses the type of filtering that is performed. virtual void SetAccessMode(AccessMode mode) = 0; + // Set the |blacklist| which excludes printers with the given id if access + // mode is BLACKLIST_ONLY. virtual void SetBlacklist(const std::vector<std::string>& blacklist) = 0; + // Set the |whitelist| which is the complete list of printers that are show to + // the user. This is in effect if access mode is WHITELIST_ONLY. virtual void SetWhitelist(const std::vector<std::string>& whitelist) = 0; - // Returns true if the printer configuration has been downloaded and parsed. + // Returns true if the printer map has been computed from a valid policy. + // Returns false otherwise. This is computed asynchronously. Observe + // OnPrintersChanged() to be notified when it is updated. This may never + // become true if a user does not have the appropriate printer policies. virtual bool IsPolicySet() const = 0; - // Returns all the printers available from the policy. - virtual const std::vector<Printer>& GetPrinters() const = 0; + // Returns a refernce to a map of the computed set of printers. The map is + // empty if either the policy was empty or we are yet to receive the full + // policy. Use IsPolicySet() to differentiate betweeen the two. + virtual const std::map<const std::string, const Printer>& GetPrinters() + const = 0; }; } // namespace chromeos
diff --git a/chrome/browser/chromeos/printing/external_printers_factory.cc b/chrome/browser/chromeos/printing/external_printers_factory.cc new file mode 100644 index 0000000..f4daea0 --- /dev/null +++ b/chrome/browser/chromeos/printing/external_printers_factory.cc
@@ -0,0 +1,64 @@ +// Copyright 2017 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/chromeos/printing/external_printers_factory.h" + +#include <memory> + +#include "base/lazy_instance.h" +#include "chrome/browser/chromeos/printing/external_printers.h" +#include "chrome/browser/chromeos/profiles/profile_helper.h" +#include "chrome/browser/profiles/profile.h" +#include "components/user_manager/user.h" + +namespace chromeos { + +namespace { + +base::LazyInstance<ExternalPrintersFactory>::DestructorAtExit + g_printers_factory = LAZY_INSTANCE_INITIALIZER; + +} // namespace + +// static +ExternalPrintersFactory* ExternalPrintersFactory::Get() { + return g_printers_factory.Pointer(); +} + +ExternalPrinters* ExternalPrintersFactory::GetForAccountId( + const AccountId& account_id) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + auto found = printers_by_user_.find(account_id); + if (found != printers_by_user_.end()) { + return found->second.get(); + } + + printers_by_user_[account_id] = ExternalPrinters::Create(); + return printers_by_user_[account_id].get(); +} + +ExternalPrinters* ExternalPrintersFactory::GetForProfile(Profile* profile) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + const user_manager::User* user = + ProfileHelper::Get()->GetUserByProfile(profile); + if (!user) + return nullptr; + + return GetForAccountId(user->GetAccountId()); +} + +void ExternalPrintersFactory::RemoveForUserId(const AccountId& account_id) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + printers_by_user_.erase(account_id); +} + +void ExternalPrintersFactory::Shutdown() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + printers_by_user_.clear(); +} + +ExternalPrintersFactory::ExternalPrintersFactory() = default; +ExternalPrintersFactory::~ExternalPrintersFactory() = default; + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/printing/external_printers_factory.h b/chrome/browser/chromeos/printing/external_printers_factory.h new file mode 100644 index 0000000..b546bd4 --- /dev/null +++ b/chrome/browser/chromeos/printing/external_printers_factory.h
@@ -0,0 +1,58 @@ +// Copyright 2017 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_CHROMEOS_PRINTING_EXTERNAL_PRINTERS_FACTORY_H_ +#define CHROME_BROWSER_CHROMEOS_PRINTING_EXTERNAL_PRINTERS_FACTORY_H_ + +#include <map> +#include <memory> + +#include "base/lazy_instance.h" +#include "base/macros.h" +#include "base/sequence_checker.h" +#include "chrome/browser/chromeos/printing/external_printers.h" +#include "components/signin/core/account_id/account_id.h" + +class Profile; + +namespace chromeos { + +// Dispenses ExternalPrinters objects based on account id. Access to this +// object should be sequenced. +class ExternalPrintersFactory { + public: + static ExternalPrintersFactory* Get(); + + // Returns a pointer to the ExternalPrinters registered for |account_id|. If + // an ExternalPrinters does not exist, one will be created for |account_id|. + // The returned object remains valid until RemoveForUserId or Shutdown is + // called. + ExternalPrinters* GetForAccountId(const AccountId& account_id); + + // Returns a pointer to the ExternalPrinters registered for |profile| which + // could be null if |profile| does not map to a valid AccountId. The returned + // object remains valid until RemoveForUserId or Shutdown is called. + ExternalPrinters* GetForProfile(Profile* profile); + + // Deletes the ExternalPrinters registered for |account_id|. + void RemoveForUserId(const AccountId& account_id); + + // Tear down all ExternalPrinters. + void Shutdown(); + + private: + friend struct base::LazyInstanceTraitsBase<ExternalPrintersFactory>; + + ExternalPrintersFactory(); + ~ExternalPrintersFactory(); + + std::map<AccountId, std::unique_ptr<ExternalPrinters>> printers_by_user_; + SEQUENCE_CHECKER(sequence_checker_); + + DISALLOW_COPY_AND_ASSIGN(ExternalPrintersFactory); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_PRINTING_EXTERNAL_PRINTERS_FACTORY_H_
diff --git a/chrome/browser/chromeos/printing/external_printers_pref_bridge.cc b/chrome/browser/chromeos/printing/external_printers_pref_bridge.cc new file mode 100644 index 0000000..ebc6fe8a --- /dev/null +++ b/chrome/browser/chromeos/printing/external_printers_pref_bridge.cc
@@ -0,0 +1,108 @@ +// 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. + +#include "chrome/browser/chromeos/printing/external_printers_pref_bridge.h" + +#include <string> +#include <vector> + +#include "base/values.h" +#include "chrome/browser/chromeos/printing/external_printers.h" +#include "chrome/browser/chromeos/printing/external_printers_factory.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/common/pref_names.h" +#include "components/policy/policy_constants.h" +#include "components/pref_registry/pref_registry_syncable.h" +#include "components/prefs/pref_service.h" + +namespace chromeos { + +namespace { + +// Extracts the list of strings named |policy_name| from |prefs| and returns it. +std::vector<std::string> FromPrefs(const PrefService* prefs, + const std::string& policy_name) { + std::vector<std::string> string_list; + const base::ListValue* list = prefs->GetList(policy_name); + for (const base::Value& value : *list) { + if (value.is_string()) { + string_list.push_back(value.GetString()); + } + } + + return string_list; +} + +} // namespace + +// static +void ExternalPrintersPrefBridge::RegisterProfilePrefs( + user_prefs::PrefRegistrySyncable* registry, + const ExternalPrinterPolicies& policies) { + // Default value for access mode is blacklist. + registry->RegisterIntegerPref(policies.access_mode, + ExternalPrinters::BLACKLIST_ONLY); + registry->RegisterListPref(policies.blacklist); + registry->RegisterListPref(policies.whitelist); +} + +ExternalPrintersPrefBridge::ExternalPrintersPrefBridge( + const ExternalPrinterPolicies& policies, + Profile* profile) + : profile_(profile), policies_(policies) { + pref_change_registrar_.Init(profile_->GetPrefs()); + + pref_change_registrar_.Add( + policies_.access_mode, + base::BindRepeating(&ExternalPrintersPrefBridge::AccessModeUpdated, + base::Unretained(this))); + pref_change_registrar_.Add( + policies_.blacklist, + base::BindRepeating(&ExternalPrintersPrefBridge::BlacklistUpdated, + base::Unretained(this))); + pref_change_registrar_.Add( + policies_.whitelist, + base::BindRepeating(&ExternalPrintersPrefBridge::WhitelistUpdated, + base::Unretained(this))); + Initialize(); +} + +void ExternalPrintersPrefBridge::Initialize() { + BlacklistUpdated(); + WhitelistUpdated(); + AccessModeUpdated(); +} + +void ExternalPrintersPrefBridge::AccessModeUpdated() { + const PrefService* prefs = profile_->GetPrefs(); + ExternalPrinters::AccessMode mode = ExternalPrinters::UNSET; + int mode_val = prefs->GetInteger(policies_.access_mode); + if (mode_val >= ExternalPrinters::BLACKLIST_ONLY && + mode_val <= ExternalPrinters::ALL_ACCESS) { + mode = static_cast<ExternalPrinters::AccessMode>(mode_val); + } else { + LOG(ERROR) << "Unrecognized access mode"; + return; + } + + auto* printers = ExternalPrintersFactory::Get()->GetForProfile(profile_); + if (printers) + printers->SetAccessMode(mode); +} + +void ExternalPrintersPrefBridge::BlacklistUpdated() { + auto* printers = ExternalPrintersFactory::Get()->GetForProfile(profile_); + if (printers) + printers->SetBlacklist( + FromPrefs(profile_->GetPrefs(), policies_.blacklist)); +} + +void ExternalPrintersPrefBridge::WhitelistUpdated() { + auto* printers = ExternalPrintersFactory::Get()->GetForProfile(profile_); + if (printers) + printers->SetWhitelist( + FromPrefs(profile_->GetPrefs(), policies_.whitelist)); +} + +} // namespace chromeos
diff --git a/chrome/browser/chromeos/printing/external_printers_pref_bridge.h b/chrome/browser/chromeos/printing/external_printers_pref_bridge.h new file mode 100644 index 0000000..656c2a9 --- /dev/null +++ b/chrome/browser/chromeos/printing/external_printers_pref_bridge.h
@@ -0,0 +1,61 @@ +// Copyright 2017 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_CHROMEOS_PRINTING_EXTERNAL_PRINTERS_PREF_BRIDGE_H_ +#define CHROME_BROWSER_CHROMEOS_PRINTING_EXTERNAL_PRINTERS_PREF_BRIDGE_H_ + +#include <string> + +#include "base/macros.h" +#include "components/prefs/pref_change_registrar.h" + +class Profile; + +namespace user_prefs { +class PrefRegistrySyncable; +} + +namespace chromeos { + +class ExternalPrinters; + +// A collection of preference names representing the external printer fields. +struct ExternalPrinterPolicies { + std::string access_mode; + std::string blacklist; + std::string whitelist; +}; + +// Observe preference changes and propogate changes to ExternalPrinters. +class ExternalPrintersPrefBridge { + public: + static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry, + const ExternalPrinterPolicies& policies); + + ExternalPrintersPrefBridge(const ExternalPrinterPolicies& policies, + Profile* profile); + + private: + // Retrieve initial values for preferences. + void Initialize(); + + // Handle update for the access mode policy. + void AccessModeUpdated(); + + // Handle updates for the blacklist policy. + void BlacklistUpdated(); + + // Handle updates for the whitelist policy. + void WhitelistUpdated(); + + Profile* profile_; + const ExternalPrinterPolicies policies_; + PrefChangeRegistrar pref_change_registrar_; + + DISALLOW_COPY_AND_ASSIGN(ExternalPrintersPrefBridge); +}; + +} // namespace chromeos + +#endif // CHROME_BROWSER_CHROMEOS_PRINTING_EXTERNAL_PRINTERS_PREF_BRIDGE_H_
diff --git a/chrome/browser/chromeos/printing/external_printers_unittest.cc b/chrome/browser/chromeos/printing/external_printers_unittest.cc index 9ce3f10..0eb5e88 100644 --- a/chrome/browser/chromeos/printing/external_printers_unittest.cc +++ b/chrome/browser/chromeos/printing/external_printers_unittest.cc
@@ -8,9 +8,11 @@ #include <vector> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" +#include "base/test/scoped_feature_list.h" #include "base/test/scoped_task_environment.h" +#include "chrome/common/chrome_features.h" +#include "chromeos/printing/printer_configuration.h" #include "testing/gtest/include/gtest/gtest.h" namespace chromeos { @@ -58,17 +60,57 @@ } ])json"; +// A different bulk printer configuration file. +constexpr char kMoreContentsJson[] = R"json( +[ + { + "id": "ThirdPrime", + "display_name": "Printy McPrinter", + "description": "Laser on the test shelf", + "manufacturer": "CrosInc.", + "model": "MS610de", + "uri": "ipp://192.168.1.5", + "ppd_resource": { + "effective_model": "MS610de" + } + } +])json"; + +// Observer that counts the number of times it has been called. +class TestObserver : public ExternalPrinters::Observer { + public: + void OnPrintersChanged( + bool valid, + const std::map<const std::string, const Printer>& /* printers */) + override { + last_valid = valid; + called++; + } + + // Counts the number of times the observer is invoked. + int called = 0; + // Holds the most recent value of valid. + bool last_valid = false; +}; + class ExternalPrintersTest : public testing::Test { public: ExternalPrintersTest() : scoped_task_environment_() { + scoped_feature_list_.InitAndEnableFeature( + base::Feature(features::kBulkPrinters)); external_printers_ = ExternalPrinters::Create(); } + ~ExternalPrintersTest() override { + // Delete the printer before the task environment. + external_printers_.reset(); + } protected: std::unique_ptr<ExternalPrinters> external_printers_; + base::test::ScopedTaskEnvironment scoped_task_environment_; private: - base::test::ScopedTaskEnvironment scoped_task_environment_; + base::test::ScopedFeatureList scoped_feature_list_; }; // Verify that we're initiall unset and empty. @@ -77,61 +119,83 @@ EXPECT_TRUE(external_printers_->GetPrinters().empty()); } +// Verify that the object can be destroyed while parsing is in progress. +TEST_F(ExternalPrintersTest, DestructionIsSafe) { + { + std::unique_ptr<ExternalPrinters> printers = ExternalPrinters::Create(); + printers->SetAccessMode(ExternalPrinters::BLACKLIST_ONLY); + printers->SetBlacklist({"Third"}); + printers->SetData(std::make_unique<std::string>(kBulkPolicyContentsJson)); + // Data is valid. Computation is proceeding. + } + // printers is out of scope. Destructor has run. Pump the message queue to + // see if anything strange happens. + scoped_task_environment_.RunUntilIdle(); +} + // Verifies that all IsPolicySet returns false until all necessary data is set. TEST_F(ExternalPrintersTest, PolicyUnsetWithMissingData) { - auto data = base::MakeUnique<std::string>(kBulkPolicyContentsJson); + auto data = std::make_unique<std::string>(kBulkPolicyContentsJson); external_printers_->ClearData(); external_printers_->SetData(std::move(data)); // Waiting for AccessMode. + scoped_task_environment_.RunUntilIdle(); EXPECT_FALSE(external_printers_->IsPolicySet()); external_printers_->SetAccessMode(ExternalPrinters::AccessMode::ALL_ACCESS); + scoped_task_environment_.RunUntilIdle(); EXPECT_TRUE(external_printers_->IsPolicySet()); external_printers_->SetAccessMode( ExternalPrinters::AccessMode::WHITELIST_ONLY); + scoped_task_environment_.RunUntilIdle(); EXPECT_FALSE(external_printers_->IsPolicySet()); // Waiting for Whitelist. std::vector<std::string> whitelist = {"First", "Third"}; external_printers_->SetWhitelist(whitelist); + scoped_task_environment_.RunUntilIdle(); EXPECT_TRUE(external_printers_->IsPolicySet()); // Everything is set. external_printers_->SetAccessMode( ExternalPrinters::AccessMode::BLACKLIST_ONLY); + scoped_task_environment_.RunUntilIdle(); EXPECT_FALSE(external_printers_->IsPolicySet()); // Blacklist needed now. std::vector<std::string> blacklist = {"Second"}; external_printers_->SetBlacklist(blacklist); + scoped_task_environment_.RunUntilIdle(); EXPECT_TRUE( external_printers_->IsPolicySet()); // Blacklist was set. Ready again. } // Verify printer list after all attributes have been set. TEST_F(ExternalPrintersTest, AllPoliciesResultInPrinters) { - auto data = base::MakeUnique<std::string>(kBulkPolicyContentsJson); + auto data = std::make_unique<std::string>(kBulkPolicyContentsJson); external_printers_->SetAccessMode(ExternalPrinters::AccessMode::ALL_ACCESS); - external_printers_->ClearData(); external_printers_->SetData(std::move(data)); + scoped_task_environment_.RunUntilIdle(); + const auto& printers = external_printers_->GetPrinters(); EXPECT_TRUE(external_printers_->IsPolicySet()); - const std::vector<Printer>& printers = external_printers_->GetPrinters(); EXPECT_EQ(kNumPrinters, printers.size()); - EXPECT_EQ("First", printers[0].id()); - EXPECT_EQ("Second", printers[1].id()); - EXPECT_EQ("Third", printers[2].id()); + EXPECT_EQ("LexaPrint", printers.at("First").display_name()); + EXPECT_EQ("Color Laser", printers.at("Second").display_name()); + EXPECT_EQ("YaLP", printers.at("Third").display_name()); } // The external policy was cleared, results should be invalidated. TEST_F(ExternalPrintersTest, PolicyClearedNowUnset) { - auto data = base::MakeUnique<std::string>(kBulkPolicyContentsJson); + auto data = std::make_unique<std::string>(kBulkPolicyContentsJson); external_printers_->SetAccessMode(ExternalPrinters::AccessMode::ALL_ACCESS); external_printers_->ClearData(); external_printers_->SetData(std::move(data)); + scoped_task_environment_.RunUntilIdle(); ASSERT_TRUE(external_printers_->IsPolicySet()); external_printers_->ClearData(); + scoped_task_environment_.RunUntilIdle(); EXPECT_FALSE(external_printers_->IsPolicySet()); EXPECT_TRUE(external_printers_->GetPrinters().empty()); } @@ -140,33 +204,116 @@ // blacklist policy should not be available. Printers not in the blackslist // should be available. TEST_F(ExternalPrintersTest, BlacklistPolicySet) { - auto data = base::MakeUnique<std::string>(kBulkPolicyContentsJson); + auto data = std::make_unique<std::string>(kBulkPolicyContentsJson); external_printers_->ClearData(); external_printers_->SetData(std::move(data)); external_printers_->SetAccessMode(ExternalPrinters::BLACKLIST_ONLY); + scoped_task_environment_.RunUntilIdle(); EXPECT_FALSE(external_printers_->IsPolicySet()); external_printers_->SetBlacklist({"Second", "Third"}); + scoped_task_environment_.RunUntilIdle(); EXPECT_TRUE(external_printers_->IsPolicySet()); - auto printers = external_printers_->GetPrinters(); - ASSERT_EQ(1U, printers.size()); - EXPECT_EQ(printers[0].id(), "First"); + scoped_task_environment_.RunUntilIdle(); + const auto& printers = external_printers_->GetPrinters(); + EXPECT_EQ(1U, printers.size()); + EXPECT_EQ("LexaPrint", printers.at("First").display_name()); } // Verify that the whitelist policy is correctly applied. Only printers // available in the whitelist are available. TEST_F(ExternalPrintersTest, WhitelistPolicySet) { - auto data = base::MakeUnique<std::string>(kBulkPolicyContentsJson); + auto data = std::make_unique<std::string>(kBulkPolicyContentsJson); external_printers_->ClearData(); external_printers_->SetData(std::move(data)); external_printers_->SetAccessMode(ExternalPrinters::WHITELIST_ONLY); + scoped_task_environment_.RunUntilIdle(); EXPECT_FALSE(external_printers_->IsPolicySet()); external_printers_->SetWhitelist({"First"}); - EXPECT_TRUE(external_printers_->IsPolicySet()); - auto printers = external_printers_->GetPrinters(); + scoped_task_environment_.RunUntilIdle(); + EXPECT_TRUE(external_printers_->IsPolicySet()); + const auto& printers = external_printers_->GetPrinters(); + EXPECT_EQ(1U, printers.size()); + EXPECT_EQ("LexaPrint", printers.at("First").display_name()); +} + +// Verify that switching from whitelist to blacklist behaves correctly. +TEST_F(ExternalPrintersTest, BlacklistToWhitelistSwap) { + auto data = std::make_unique<std::string>(kBulkPolicyContentsJson); + external_printers_->ClearData(); + external_printers_->SetData(std::move(data)); + external_printers_->SetAccessMode(ExternalPrinters::BLACKLIST_ONLY); + external_printers_->SetWhitelist({"First"}); + external_printers_->SetBlacklist({"First"}); + + // This should result in 2 printers. But we're switching the mode anyway. + + external_printers_->SetAccessMode(ExternalPrinters::WHITELIST_ONLY); + scoped_task_environment_.RunUntilIdle(); + EXPECT_TRUE(external_printers_->IsPolicySet()); + const auto& printers = external_printers_->GetPrinters(); + EXPECT_EQ(1U, printers.size()); + EXPECT_EQ("LexaPrint", printers.at("First").display_name()); +} + +// Verify that updated configurations are handled properly. +TEST_F(ExternalPrintersTest, MultipleUpdates) { + auto data = std::make_unique<std::string>(kBulkPolicyContentsJson); + external_printers_->ClearData(); + external_printers_->SetData(std::move(data)); + external_printers_->SetAccessMode(ExternalPrinters::ALL_ACCESS); + // There will be 3 printers here. But we don't want to wait for compuation to + // complete to verify the final value gets used. + + auto new_data = std::make_unique<std::string>(kMoreContentsJson); + external_printers_->SetData(std::move(new_data)); + scoped_task_environment_.RunUntilIdle(); + const auto& printers = external_printers_->GetPrinters(); ASSERT_EQ(1U, printers.size()); - EXPECT_EQ(printers[0].id(), "First"); + EXPECT_EQ("ThirdPrime", printers.at("ThirdPrime").id()); +} + +// Verifies that the observer is called at the expected times. +TEST_F(ExternalPrintersTest, ObserverTest) { + TestObserver obs; + external_printers_->AddObserver(&obs); + + external_printers_->SetAccessMode(ExternalPrinters::ALL_ACCESS); + external_printers_->SetWhitelist(std::vector<std::string>()); + external_printers_->SetBlacklist(std::vector<std::string>()); + external_printers_->ClearData(); + scoped_task_environment_.RunUntilIdle(); + EXPECT_EQ(0, obs.called); + + external_printers_->SetData( + std::make_unique<std::string>(kBulkPolicyContentsJson)); + + scoped_task_environment_.RunUntilIdle(); + EXPECT_TRUE(external_printers_->IsPolicySet()); + EXPECT_EQ(1, obs.called); + EXPECT_TRUE(obs.last_valid); // ready now + // Printer list is correct after notification. + EXPECT_EQ(kNumPrinters, external_printers_->GetPrinters().size()); + + external_printers_->SetAccessMode(ExternalPrinters::WHITELIST_ONLY); + scoped_task_environment_.RunUntilIdle(); + EXPECT_EQ(2, obs.called); // effective list changed. Notified. + EXPECT_TRUE(obs.last_valid); + + external_printers_->SetAccessMode(ExternalPrinters::BLACKLIST_ONLY); + scoped_task_environment_.RunUntilIdle(); + EXPECT_EQ(3, obs.called); // effective list changed. Notified. + EXPECT_TRUE(obs.last_valid); + + external_printers_->ClearData(); + scoped_task_environment_.RunUntilIdle(); + EXPECT_EQ(4, obs.called); // Called for transition to invalid policy. + EXPECT_FALSE(obs.last_valid); + EXPECT_TRUE(external_printers_->GetPrinters().empty()); + + // cleanup + external_printers_->RemoveObserver(&obs); } } // namespace
diff --git a/chrome/browser/chromeos/printing/ppd_provider_factory.cc b/chrome/browser/chromeos/printing/ppd_provider_factory.cc index e146369b..545ba41 100644 --- a/chrome/browser/chromeos/printing/ppd_provider_factory.cc +++ b/chrome/browser/chromeos/printing/ppd_provider_factory.cc
@@ -11,6 +11,7 @@ #include "chrome/browser/profiles/profile.h" #include "chromeos/printing/ppd_cache.h" #include "chromeos/printing/ppd_provider.h" +#include "components/version_info/version_info.h" #include "google_apis/google_api_keys.h" #include "net/url_request/url_request_context_getter.h" @@ -22,7 +23,8 @@ return PpdProvider::Create(g_browser_process->GetApplicationLocale(), g_browser_process->system_request_context(), - PpdCache::Create(ppd_cache_path)); + PpdCache::Create(ppd_cache_path), + base::Version(version_info::GetVersionNumber())); } } // namespace chromeos
diff --git a/chrome/browser/chromeos/printing/printer_configurer.cc b/chrome/browser/chromeos/printing/printer_configurer.cc index 2e183b4..4aa3685 100644 --- a/chrome/browser/chromeos/printing/printer_configurer.cc +++ b/chrome/browser/chromeos/printing/printer_configurer.cc
@@ -187,7 +187,7 @@ void OnComponentLoad(const Printer& printer, const std::string& ppd_contents, PrinterSetupCallback cb, - const std::string& result) { + const base::FilePath& result) { // Result is the component mount point, or empty // if the component couldn't be loaded if (result.empty()) { @@ -214,7 +214,7 @@ if (components_requested.size() == 1) { // Only allow one filter request in ppd file. auto& component_name = *components_requested.begin(); - component_updater::CrOSComponent::LoadComponent( + g_browser_process->platform_part()->cros_component_manager()->Load( component_name, base::BindOnce(&PrinterConfigurerImpl::OnComponentLoad, weak_factory_.GetWeakPtr(), printer, ppd_contents,
diff --git a/chrome/browser/chromeos/smb_client/smb_file_system.cc b/chrome/browser/chromeos/smb_client/smb_file_system.cc index d8eee5b..57214971 100644 --- a/chrome/browser/chromeos/smb_client/smb_file_system.cc +++ b/chrome/browser/chromeos/smb_client/smb_file_system.cc
@@ -208,7 +208,7 @@ int file_handle, const storage::AsyncFileUtil::StatusCallback& callback) { GetSmbProviderClient()->CloseFile( - file_handle, + GetMountId(), file_handle, base::BindOnce(&SmbFileSystem::HandleRequestCloseFileCallback, weak_ptr_factory_.GetWeakPtr(), callback)); return AbortCallback();
diff --git a/chrome/browser/chromeos/smb_client/smb_service.cc b/chrome/browser/chromeos/smb_client/smb_service.cc index d9bbce16..7451a38a 100644 --- a/chrome/browser/chromeos/smb_client/smb_service.cc +++ b/chrome/browser/chromeos/smb_client/smb_service.cc
@@ -4,12 +4,14 @@ #include "chrome/browser/chromeos/smb_client/smb_service.h" +#include "base/feature_list.h" #include "base/files/file_path.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h" #include "chrome/browser/chromeos/smb_client/smb_file_system.h" #include "chrome/browser/chromeos/smb_client/smb_provider.h" #include "chrome/browser/chromeos/smb_client/smb_service_factory.h" +#include "chrome/common/chrome_features.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/smb_provider_client.h" @@ -21,7 +23,8 @@ SmbService::SmbService(Profile* profile) : profile_(profile), weak_ptr_factory_(this) { - GetProviderService()->RegisterProvider(std::make_unique<SmbProvider>()); + if (base::FeatureList::IsEnabled(features::kNativeSmb)) + GetProviderService()->RegisterProvider(std::make_unique<SmbProvider>()); } SmbService::~SmbService() {}
diff --git a/chrome/browser/component_updater/crl_set_component_installer.cc b/chrome/browser/component_updater/crl_set_component_installer.cc index 9b6468d5..9c331de 100644 --- a/chrome/browser/component_updater/crl_set_component_installer.cc +++ b/chrome/browser/component_updater/crl_set_component_installer.cc
@@ -24,9 +24,9 @@ namespace { -// kPublicKeySHA256 is the SHA256 hash of the SubjectPublicKeyInfo of the key -// that's used to sign generated CRL sets. -static const uint8_t kPublicKeySHA256[32] = { +// kCrlSetPublicKeySHA256 is the SHA256 hash of the SubjectPublicKeyInfo of the +// key that's used to sign generated CRL sets. +static const uint8_t kCrlSetPublicKeySHA256[32] = { 0x75, 0xda, 0xf8, 0xcb, 0x77, 0x68, 0x40, 0x33, 0x65, 0x4c, 0x97, 0xe5, 0xc5, 0x1b, 0xcd, 0x81, 0x7b, 0x1e, 0xeb, 0x11, 0x2c, 0xe1, 0xa4, 0x33, 0x8c, 0xf5, 0x72, 0x5e, 0xed, 0xb8, 0x43, 0x97, @@ -110,7 +110,8 @@ } void CRLSetPolicy::GetHash(std::vector<uint8_t>* hash) const { - hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); + hash->assign(std::begin(kCrlSetPublicKeySHA256), + std::end(kCrlSetPublicKeySHA256)); } std::string CRLSetPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/cros_component_installer.cc b/chrome/browser/component_updater/cros_component_installer.cc index af82d18..be587f24c 100644 --- a/chrome/browser/component_updater/cros_component_installer.cc +++ b/chrome/browser/component_updater/cros_component_installer.cc
@@ -10,7 +10,6 @@ #include "base/optional.h" #include "base/path_service.h" #include "base/task_scheduler/post_task.h" -#include "chrome/browser/browser_process.h" #include "chrome/browser/component_updater/component_installer_errors.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/image_loader_client.h" @@ -48,20 +47,29 @@ #define COMPONENTS_ROOT_PATH "cros-components" -using content::BrowserThread; - namespace component_updater { namespace { // TODO(xiaochu): add metrics for component usage (crbug.com/793052). -static void LogCustomUninstall(base::Optional<bool> result) {} -static std::string GenerateId(const std::string& sha2hashstr) { +void LogCustomUninstall(base::Optional<bool> result) {} + +std::string GenerateId(const std::string& sha2hashstr) { // kIdSize is the count of a pair of hex in the sha2hash array. // In string representation of sha2hash, size is doubled since each hex is // represented by a single char. return crx_file::id_util::GenerateIdFromHex( sha2hashstr.substr(0, crx_file::id_util::kIdSize * 2)); } + +void CleanUpOldInstalls(const std::string& name) { + // Clean up components installed at old path. + base::FilePath path; + if (!PathService::Get(DIR_COMPONENT_USER, &path)) + return; + path = path.Append(name); + if (base::PathExists(path)) + base::DeleteFile(path, true); +} } // namespace using ConfigMap = std::map<std::string, std::map<std::string, std::string>>; @@ -93,29 +101,20 @@ return true; } -void CleanupOldInstalls(const std::string& name) { - // Clean up components installed at old path. - base::FilePath path; - if (!PathService::Get(DIR_COMPONENT_USER, &path)) - return; - path = path.Append(name); - if (base::PathExists(path)) - base::DeleteFile(path, true); -} - update_client::CrxInstaller::Result CrOSComponentInstallerPolicy::OnCustomInstall( const base::DictionaryValue& manifest, const base::FilePath& install_dir) { // TODO(xiaochu): remove this at M66 (crbug.com/792203). - CleanupOldInstalls(name); + CleanUpOldInstalls(name); return update_client::CrxInstaller::Result(update_client::InstallError::NONE); } void CrOSComponentInstallerPolicy::OnCustomUninstall() { - g_browser_process->platform_part()->UnregisterCompatibleCrosComponentPath( - name); + g_browser_process->platform_part() + ->cros_component_manager() + ->UnregisterCompatiblePath(name); chromeos::DBusThreadManager::Get()->GetImageLoaderClient()->UnmountComponent( name, base::BindOnce(&LogCustomUninstall)); @@ -128,8 +127,9 @@ std::string min_env_version; if (manifest && manifest->GetString("min_env_version", &min_env_version)) { if (IsCompatible(env_version, min_env_version)) { - g_browser_process->platform_part()->RegisterCompatibleCrosComponentPath( - GetName(), path); + g_browser_process->platform_part() + ->cros_component_manager() + ->RegisterCompatiblePath(GetName(), path); } } } @@ -175,97 +175,24 @@ env_version >= min_env_version; } -// It returns load result passing the following as parameters in -// load_callback: call_status - dbus call status, result - component mount -// point. -static void LoadResult( - base::OnceCallback<void(const std::string&)> load_callback, - base::Optional<std::string> result) { - PostTask(FROM_HERE, base::BindOnce(std::move(load_callback), - result.value_or(std::string()))); -} +CrOSComponentManager::CrOSComponentManager() {} -// Internal function to load a component. -static void LoadComponentInternal( +CrOSComponentManager::~CrOSComponentManager() {} + +void CrOSComponentManager::Load( const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback) { - DCHECK(g_browser_process->platform_part()->IsCompatibleCrosComponent(name)); - const base::FilePath path = - g_browser_process->platform_part()->GetCompatibleCrosComponentPath(name); - // path is empty if no compatible component is available to load. - if (!path.empty()) { - chromeos::DBusThreadManager::Get() - ->GetImageLoaderClient() - ->LoadComponentAtPath( - name, path, base::BindOnce(&LoadResult, std::move(load_callback))); - } else { - base::PostTask(FROM_HERE, - base::BindOnce(std::move(load_callback), std::string())); - } -} - -// It calls LoadComponentInternal to load the installed component. -static void InstallResult( - const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback, - update_client::Error error) { - LoadComponentInternal(name, std::move(load_callback)); -} - -// It calls OnDemandUpdate to install the component right after being -// registered. -void CrOSComponent::RegisterResult(ComponentUpdateService* cus, - const std::string& id, - update_client::Callback install_callback) { - cus->GetOnDemandUpdater().OnDemandUpdate(id, std::move(install_callback)); -} - -// Register a component with a dedicated ComponentUpdateService instance. -static void RegisterComponent(ComponentUpdateService* cus, - const ComponentConfig& config, - base::OnceClosure register_callback) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - auto installer = base::MakeRefCounted<ComponentInstaller>( - std::make_unique<CrOSComponentInstallerPolicy>(config)); - installer->Register(cus, std::move(register_callback)); -} - -// Install a component with a dedicated ComponentUpdateService instance. -void CrOSComponent::InstallComponent( - ComponentUpdateService* cus, - const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback) { - const ConfigMap components = CONFIG_MAP_CONTENT; - const auto it = components.find(name); - if (it == components.end()) { - base::PostTask(FROM_HERE, - base::BindOnce(std::move(load_callback), std::string())); - return; - } - ComponentConfig config(it->first, it->second.find("env_version")->second, - it->second.find("sha2hashstr")->second); - RegisterComponent( - cus, config, - base::BindOnce( - RegisterResult, cus, - GenerateId(it->second.find("sha2hashstr")->second), - base::BindOnce(InstallResult, name, std::move(load_callback)))); -} - -void CrOSComponent::LoadComponent( - const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback) { - if (!g_browser_process->platform_part()->IsCompatibleCrosComponent(name)) { + base::OnceCallback<void(const base::FilePath&)> load_callback) { + if (!IsCompatible(name)) { // A compatible component is not installed, start installation process. auto* const cus = g_browser_process->component_updater(); - InstallComponent(cus, name, std::move(load_callback)); + Install(cus, name, std::move(load_callback)); } else { // A compatible component is intalled, load it directly. - LoadComponentInternal(name, std::move(load_callback)); + LoadInternal(name, std::move(load_callback)); } } -bool CrOSComponent::UnloadComponent(const std::string& name) { +bool CrOSComponentManager::Unload(const std::string& name) { const ConfigMap components = CONFIG_MAP_CONTENT; const auto it = components.find(name); if (it == components.end()) { @@ -278,7 +205,105 @@ return updater->UnregisterComponent(id); } -std::vector<ComponentConfig> CrOSComponent::GetInstalledComponents() { +void CrOSComponentManager::RegisterInstalled() { + base::PostTaskWithTraitsAndReplyWithResult( + FROM_HERE, {base::MayBlock()}, + base::BindOnce(&component_updater::CrOSComponentManager::GetInstalled, + base::Unretained(this)), + base::BindOnce(&component_updater::CrOSComponentManager::RegisterN, + base::Unretained(this))); +} + +void CrOSComponentManager::RegisterCompatiblePath(const std::string& name, + const base::FilePath& path) { + compatible_components_[name] = path; +} + +void CrOSComponentManager::UnregisterCompatiblePath(const std::string& name) { + compatible_components_.erase(name); +} + +bool CrOSComponentManager::IsCompatible(const std::string& name) const { + return compatible_components_.count(name) > 0; +} + +base::FilePath CrOSComponentManager::GetCompatiblePath( + const std::string& name) const { + const auto it = compatible_components_.find(name); + return it == compatible_components_.end() ? base::FilePath() : it->second; +} + +void CrOSComponentManager::Register(ComponentUpdateService* cus, + const ComponentConfig& config, + base::OnceClosure register_callback) { + auto installer = base::MakeRefCounted<ComponentInstaller>( + std::make_unique<CrOSComponentInstallerPolicy>(config)); + installer->Register(cus, std::move(register_callback)); +} + +void CrOSComponentManager::Install( + ComponentUpdateService* cus, + const std::string& name, + base::OnceCallback<void(const base::FilePath&)> load_callback) { + const ConfigMap components = CONFIG_MAP_CONTENT; + const auto it = components.find(name); + if (it == components.end()) { + base::PostTask(FROM_HERE, + base::BindOnce(std::move(load_callback), base::FilePath())); + return; + } + ComponentConfig config(it->first, it->second.find("env_version")->second, + it->second.find("sha2hashstr")->second); + Register(cus, config, + base::BindOnce(&CrOSComponentManager::StartInstall, + base::Unretained(this), cus, + GenerateId(it->second.find("sha2hashstr")->second), + base::BindOnce(&CrOSComponentManager::FinishInstall, + base::Unretained(this), name, + std::move(load_callback)))); +} + +void CrOSComponentManager::StartInstall( + ComponentUpdateService* cus, + const std::string& id, + update_client::Callback install_callback) { + cus->GetOnDemandUpdater().OnDemandUpdate(id, std::move(install_callback)); +} + +void CrOSComponentManager::FinishInstall( + const std::string& name, + base::OnceCallback<void(const base::FilePath&)> load_callback, + update_client::Error error) { + LoadInternal(name, std::move(load_callback)); +} + +void CrOSComponentManager::LoadInternal( + const std::string& name, + base::OnceCallback<void(const base::FilePath&)> load_callback) { + DCHECK(IsCompatible(name)); + const base::FilePath path = GetCompatiblePath(name); + // path is empty if no compatible component is available to load. + if (!path.empty()) { + chromeos::DBusThreadManager::Get() + ->GetImageLoaderClient() + ->LoadComponentAtPath( + name, path, + base::BindOnce(&CrOSComponentManager::FinishLoad, + base::Unretained(this), std::move(load_callback))); + } else { + base::PostTask(FROM_HERE, + base::BindOnce(std::move(load_callback), base::FilePath())); + } +} + +void CrOSComponentManager::FinishLoad( + base::OnceCallback<void(const base::FilePath&)> load_callback, + base::Optional<base::FilePath> result) { + PostTask(FROM_HERE, base::BindOnce(std::move(load_callback), + result.value_or(base::FilePath()))); +} + +std::vector<ComponentConfig> CrOSComponentManager::GetInstalled() { std::vector<ComponentConfig> configs; base::FilePath root; if (!PathService::Get(DIR_COMPONENT_USER, &root)) @@ -299,13 +324,13 @@ return configs; } -void CrOSComponent::RegisterComponents( +void CrOSComponentManager::RegisterN( const std::vector<ComponentConfig>& configs) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); component_updater::ComponentUpdateService* updater = g_browser_process->component_updater(); for (const auto& config : configs) { - RegisterComponent(updater, config, base::OnceClosure()); + Register(updater, config, base::OnceClosure()); } }
diff --git a/chrome/browser/component_updater/cros_component_installer.h b/chrome/browser/component_updater/cros_component_installer.h index 14ddfcd..d76c7f4 100644 --- a/chrome/browser/component_updater/cros_component_installer.h +++ b/chrome/browser/component_updater/cros_component_installer.h
@@ -10,26 +10,13 @@ #include <string> #include <vector> +#include "chrome/browser/browser_process.h" #include "chromeos/dbus/dbus_method_call_status.h" #include "components/component_updater/component_installer.h" #include "components/component_updater/component_updater_service.h" #include "components/update_client/update_client.h" #include "crypto/sha2.h" -// Developer API usage: -// ... -// void LoadCallback(const std::string& mount_point){ -// if (mount_point.empty()) { -// // component is not loaded. -// return; -// } -// ... -// } -// ... -// component_updater::CrOSComponent::LoadComponent( -// name, -// base::BindOnce(&LoadCallback)); -// namespace component_updater { struct ComponentConfig { @@ -49,10 +36,9 @@ private: FRIEND_TEST_ALL_PREFIXES(CrOSComponentInstallerTest, IsCompatibleOrNot); + FRIEND_TEST_ALL_PREFIXES(CrOSComponentInstallerTest, CompatibilityOK); FRIEND_TEST_ALL_PREFIXES(CrOSComponentInstallerTest, - ComponentReadyCorrectManifest); - FRIEND_TEST_ALL_PREFIXES(CrOSComponentInstallerTest, - ComponentReadyWrongManifest); + CompatibilityMissingManifest); // The following methods override ComponentInstallerPolicy. bool SupportsGroupPolicyEnabledComponentUpdates() const override; bool RequiresNetworkEncryption() const override; @@ -81,32 +67,83 @@ }; // This class contains functions used to register and install a component. -class CrOSComponent { +class CrOSComponentManager { public: - // Installs a component and keeps it up-to-date. - static void LoadComponent( - const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback); + CrOSComponentManager(); + ~CrOSComponentManager(); + // Installs a component and keeps it up-to-date. |load_callback| returns the + // mount point path. + void Load(const std::string& name, + base::OnceCallback<void(const base::FilePath&)> load_callback); // Stops updating and removes a component. // Returns true if the component was successfully unloaded // or false if it couldn't be unloaded or already wasn't loaded. - static bool UnloadComponent(const std::string& name); + bool Unload(const std::string& name); - // Returns all installed components. - static std::vector<ComponentConfig> GetInstalledComponents(); + // Register all installed components. + void RegisterInstalled(); - // Registers component |configs| to be updated. - static void RegisterComponents(const std::vector<ComponentConfig>& configs); + // Saves the name and install path of a compatible component. + void RegisterCompatiblePath(const std::string& name, + const base::FilePath& path); + + // Removes the name and install path entry of a component. + void UnregisterCompatiblePath(const std::string& name); + + // Checks if the current installed component is compatible given a component + // |name|. If compatible, sets |path| to be its installed path. + bool IsCompatible(const std::string& name) const; + + // Returns installed path of a compatible component given |name|. Returns an + // empty path if the component isn't compatible. + base::FilePath GetCompatiblePath(const std::string& name) const; private: - static void RegisterResult(ComponentUpdateService* cus, - const std::string& id, - update_client::Callback install_callback); - static void InstallComponent( - ComponentUpdateService* cus, + FRIEND_TEST_ALL_PREFIXES(CrOSComponentInstallerTest, RegisterComponent); + + // Registers a component with a dedicated ComponentUpdateService instance. + void Register(ComponentUpdateService* cus, + const ComponentConfig& config, + base::OnceClosure register_callback); + + // Installs a component with a dedicated ComponentUpdateService instance. + void Install(ComponentUpdateService* cus, + const std::string& name, + base::OnceCallback<void(const base::FilePath&)> load_callback); + + // Calls OnDemandUpdate to install the component right after being registered. + // |id| is the component id generated from its sha2 hash. + void StartInstall(ComponentUpdateService* cus, + const std::string& id, + update_client::Callback install_callback); + + // Calls LoadInternal to load the installed component. + void FinishInstall( const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback); + base::OnceCallback<void(const base::FilePath&)> load_callback, + update_client::Error error); + + // Internal function to load a component. + void LoadInternal( + const std::string& name, + base::OnceCallback<void(const base::FilePath&)> load_callback); + + // Calls load_callback and pass in the parameter |result| (component mount + // point). + void FinishLoad(base::OnceCallback<void(const base::FilePath&)> load_callback, + base::Optional<base::FilePath> result); + + // Returns all installed components. + std::vector<ComponentConfig> GetInstalled(); + + // Registers component |configs| to be updated. + void RegisterN(const std::vector<ComponentConfig>& configs); + + // Maps from a compatible component name to its installed path. + base::flat_map<std::string, base::FilePath> compatible_components_; + + DISALLOW_COPY_AND_ASSIGN(CrOSComponentManager); }; } // namespace component_updater
diff --git a/chrome/browser/component_updater/cros_component_installer_unittest.cc b/chrome/browser/component_updater/cros_component_installer_unittest.cc index 7f8f8d5..f8def0ac 100644 --- a/chrome/browser/component_updater/cros_component_installer_unittest.cc +++ b/chrome/browser/component_updater/cros_component_installer_unittest.cc
@@ -54,24 +54,22 @@ const std::string& min_env_version_str)); }; -void load_callback(const std::string& result) {} - TEST_F(CrOSComponentInstallerTest, BPPPCompatibleCrOSComponent) { + component_updater::CrOSComponentManager cros_component_manager; const std::string kComponent = "a"; - BrowserProcessPlatformPart bppp; - EXPECT_FALSE(bppp.IsCompatibleCrosComponent(kComponent)); - EXPECT_EQ(bppp.GetCompatibleCrosComponentPath(kComponent).value(), + EXPECT_FALSE(cros_component_manager.IsCompatible(kComponent)); + EXPECT_EQ(cros_component_manager.GetCompatiblePath(kComponent).value(), std::string()); const base::FilePath kPath("/component/path/v0"); - bppp.RegisterCompatibleCrosComponentPath(kComponent, kPath); - EXPECT_TRUE(bppp.IsCompatibleCrosComponent(kComponent)); - EXPECT_EQ(bppp.GetCompatibleCrosComponentPath(kComponent), kPath); - bppp.UnregisterCompatibleCrosComponentPath(kComponent); - EXPECT_FALSE(bppp.IsCompatibleCrosComponent(kComponent)); + cros_component_manager.RegisterCompatiblePath(kComponent, kPath); + EXPECT_TRUE(cros_component_manager.IsCompatible(kComponent)); + EXPECT_EQ(cros_component_manager.GetCompatiblePath(kComponent), kPath); + cros_component_manager.UnregisterCompatiblePath(kComponent); + EXPECT_FALSE(cros_component_manager.IsCompatible(kComponent)); } -TEST_F(CrOSComponentInstallerTest, ComponentReadyCorrectManifest) { +TEST_F(CrOSComponentInstallerTest, CompatibilityOK) { ComponentConfig config("a", "2.1", ""); MockCrOSComponentInstallerPolicy policy(config); EXPECT_CALL(policy, IsCompatible(testing::_, testing::_)).Times(1); @@ -81,10 +79,9 @@ base::MakeUnique<base::DictionaryValue>(); manifest->SetString("min_env_version", "2.1"); policy.ComponentReady(version, path, std::move(manifest)); - RunUntilIdle(); } -TEST_F(CrOSComponentInstallerTest, ComponentReadyWrongManifest) { +TEST_F(CrOSComponentInstallerTest, CompatibilityMissingManifest) { ComponentConfig config("a", "2.1", ""); MockCrOSComponentInstallerPolicy policy(config); EXPECT_CALL(policy, IsCompatible(testing::_, testing::_)).Times(0); @@ -93,7 +90,6 @@ std::unique_ptr<base::DictionaryValue> manifest = base::MakeUnique<base::DictionaryValue>(); policy.ComponentReady(version, path, std::move(manifest)); - RunUntilIdle(); } TEST_F(CrOSComponentInstallerTest, IsCompatibleOrNot) { @@ -108,4 +104,16 @@ EXPECT_TRUE(policy.IsCompatible("1.1.1", "1.1")); } +TEST_F(CrOSComponentInstallerTest, RegisterComponent) { + std::unique_ptr<CrOSMockComponentUpdateService> cus( + new CrOSMockComponentUpdateService()); + ComponentConfig config( + "star-cups-driver", "1.1", + "6d24de30f671da5aee6d463d9e446cafe9ddac672800a9defe86877dcde6c466"); + EXPECT_CALL(*cus, RegisterComponent(testing::_)).Times(1); + component_updater::CrOSComponentManager cros_component_manager; + cros_component_manager.Register(cus.get(), config, base::OnceClosure()); + RunUntilIdle(); +} + } // namespace component_updater
diff --git a/chrome/browser/component_updater/downloadable_strings_component_installer.cc b/chrome/browser/component_updater/downloadable_strings_component_installer.cc index ea7a298..6acee87 100644 --- a/chrome/browser/component_updater/downloadable_strings_component_installer.cc +++ b/chrome/browser/component_updater/downloadable_strings_component_installer.cc
@@ -101,7 +101,7 @@ FILE_PATH_LITERAL("dummy-locale.pak"); // The SHA256 of the SubjectPublicKeyInfo used to sign the extension. -const uint8_t kPublicKeySHA256[32] = { +const uint8_t kDownloadableStringsPublicKeySHA256[32] = { 0x5e, 0xea, 0xe8, 0x4b, 0xba, 0xe2, 0x2b, 0x8f, 0xeb, 0x60, 0x24, 0x01, 0x09, 0x49, 0x92, 0xdf, 0x7b, 0xe9, 0x41, 0x50, 0xba, 0x97, 0x39, 0x7e, 0x72, 0xdd, 0x7b, 0xc0, 0xd3, 0xb7, 0x04, 0xe6, @@ -410,8 +410,9 @@ void DownloadableStringsComponentInstallerPolicy::GetHash( std::vector<uint8_t>* hash) const { - hash->assign(kPublicKeySHA256, - kPublicKeySHA256 + arraysize(kPublicKeySHA256)); + hash->assign(kDownloadableStringsPublicKeySHA256, + kDownloadableStringsPublicKeySHA256 + + arraysize(kDownloadableStringsPublicKeySHA256)); } std::string DownloadableStringsComponentInstallerPolicy::GetName() const { @@ -448,7 +449,8 @@ void DownloadableStringsComponentInstallerPolicy::TriggerComponentUpdate( OnDemandUpdater* updater) { const std::string crx_id = crx_file::id_util::GenerateIdFromHash( - kPublicKeySHA256, sizeof(kPublicKeySHA256)); + kDownloadableStringsPublicKeySHA256, + sizeof(kDownloadableStringsPublicKeySHA256)); DCHECK_EQ(crx_id, "fookoiellkocclipolgaceabajejjcnp"); VLOG(1) << "Triggering component update"; updater->OnDemandUpdate(crx_id, base::Bind(&OnUpdateResult));
diff --git a/chrome/browser/component_updater/file_type_policies_component_installer.cc b/chrome/browser/component_updater/file_type_policies_component_installer.cc index 832b283..fa86348 100644 --- a/chrome/browser/component_updater/file_type_policies_component_installer.cc +++ b/chrome/browser/component_updater/file_type_policies_component_installer.cc
@@ -30,7 +30,7 @@ // The SHA256 of the SubjectPublicKeyInfo used to sign the extension. // The extension id is: khaoiebndkojlmppeemjhbpbandiljpe -const uint8_t kPublicKeySHA256[32] = { +const uint8_t kFileTypePoliciesPublicKeySHA256[32] = { 0xa7, 0x0e, 0x84, 0x1d, 0x3a, 0xe9, 0xbc, 0xff, 0x44, 0xc9, 0x71, 0xf1, 0x0d, 0x38, 0xb9, 0xf4, 0x65, 0x92, 0x31, 0x01, 0x47, 0x3f, 0x1b, 0x7c, 0x11, 0xb0, 0x85, 0x0f, 0xa3, 0xfd, 0xe1, 0xe5}; @@ -110,8 +110,9 @@ void FileTypePoliciesComponentInstallerPolicy::GetHash( std::vector<uint8_t>* hash) const { - hash->assign(kPublicKeySHA256, - kPublicKeySHA256 + arraysize(kPublicKeySHA256)); + hash->assign(kFileTypePoliciesPublicKeySHA256, + kFileTypePoliciesPublicKeySHA256 + + arraysize(kFileTypePoliciesPublicKeySHA256)); } std::string FileTypePoliciesComponentInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/mei_preload_component_installer.cc b/chrome/browser/component_updater/mei_preload_component_installer.cc index f710643..dca505f 100644 --- a/chrome/browser/component_updater/mei_preload_component_installer.cc +++ b/chrome/browser/component_updater/mei_preload_component_installer.cc
@@ -30,7 +30,7 @@ FILE_PATH_LITERAL("preloaded_data.pb"); // The extension id is: aemomkdncapdnfajjbbcbdebjljbpmpj -constexpr uint8_t kPublicKeySHA256[32] = { +constexpr uint8_t kMeiPreloadPublicKeySHA256[32] = { 0x04, 0xce, 0xca, 0x3d, 0x20, 0xf3, 0xd5, 0x09, 0x91, 0x12, 0x13, 0x41, 0x9b, 0x91, 0xfc, 0xf9, 0x19, 0xc4, 0x94, 0x6a, 0xb9, 0x9a, 0xe1, 0xaf, 0x3b, 0x9a, 0x95, 0x85, 0x5b, 0x9e, 0x99, 0xed}; @@ -112,8 +112,9 @@ void MediaEngagementPreloadComponentInstallerPolicy::GetHash( std::vector<uint8_t>* hash) const { - hash->assign(kPublicKeySHA256, - kPublicKeySHA256 + arraysize(kPublicKeySHA256)); + hash->assign( + kMeiPreloadPublicKeySHA256, + kMeiPreloadPublicKeySHA256 + arraysize(kMeiPreloadPublicKeySHA256)); } std::string MediaEngagementPreloadComponentInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/optimization_hints_component_installer.cc b/chrome/browser/component_updater/optimization_hints_component_installer.cc index e19203f5..9a871e3b 100644 --- a/chrome/browser/component_updater/optimization_hints_component_installer.cc +++ b/chrome/browser/component_updater/optimization_hints_component_installer.cc
@@ -26,7 +26,7 @@ namespace { // The extension id is: lmelglejhemejginpboagddgdfbepgmp -const uint8_t kPublicKeySHA256[32] = { +const uint8_t kOptimizationHintsPublicKeySHA256[32] = { 0xbc, 0x4b, 0x6b, 0x49, 0x74, 0xc4, 0x96, 0x8d, 0xf1, 0xe0, 0x63, 0x36, 0x35, 0x14, 0xf6, 0xcf, 0x86, 0x92, 0xe6, 0x06, 0x03, 0x76, 0x70, 0xaf, 0x8b, 0xd4, 0x47, 0x2c, 0x42, 0x59, 0x38, 0xef}; @@ -113,7 +113,8 @@ if (!hash) { return; } - hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); + hash->assign(std::begin(kOptimizationHintsPublicKeySHA256), + std::end(kOptimizationHintsPublicKeySHA256)); } std::string OptimizationHintsComponentInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/pnacl_component_installer.cc b/chrome/browser/component_updater/pnacl_component_installer.cc index 7af2799..d7697b94 100644 --- a/chrome/browser/component_updater/pnacl_component_installer.cc +++ b/chrome/browser/component_updater/pnacl_component_installer.cc
@@ -54,7 +54,7 @@ // Name of the Pnacl component specified in the manifest. const char kPnaclManifestName[] = "PNaCl Translator"; -constexpr uint8_t kPublicKeySHA256[32] = { +constexpr uint8_t kPnaclPublicKeySHA256[32] = { // This corresponds to AppID: hnimpnehoodheedghdeeijklkeaacbdc 0x7d, 0x8c, 0xfd, 0x47, 0xee, 0x37, 0x44, 0x36, 0x73, 0x44, 0x89, 0xab, 0xa4, 0x00, 0x21, 0x32, 0x4a, 0x06, 0x06, 0xf1, 0x51, 0x3c, @@ -236,7 +236,8 @@ return base::FilePath(FILE_PATH_LITERAL("pnacl")); } void PnaclComponentInstallerPolicy::GetHash(std::vector<uint8_t>* hash) const { - hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); + hash->assign(std::begin(kPnaclPublicKeySHA256), + std::end(kPnaclPublicKeySHA256)); } std::string PnaclComponentInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/recovery_improved_component_installer.cc b/chrome/browser/component_updater/recovery_improved_component_installer.cc index e519b67..bbf9d450 100644 --- a/chrome/browser/component_updater/recovery_improved_component_installer.cc +++ b/chrome/browser/component_updater/recovery_improved_component_installer.cc
@@ -18,7 +18,7 @@ // The SHA256 of the SubjectPublicKeyInfo used to sign the component CRX. // The component id is: ihnlcenocehgdaegdmhbidjhnhdchfmm -constexpr uint8_t kPublicKeySHA256[32] = { +constexpr uint8_t kRecoveryImprovedPublicKeySHA256[32] = { 0x87, 0xdb, 0x24, 0xde, 0x24, 0x76, 0x30, 0x46, 0x3c, 0x71, 0x83, 0x97, 0xd7, 0x32, 0x75, 0xcc, 0xd5, 0x7f, 0xec, 0x09, 0x60, 0x6d, 0x20, 0xc3, 0x81, 0xd7, 0xce, 0x7b, 0x10, 0x15, 0x44, 0xd1}; @@ -67,7 +67,8 @@ void RecoveryImprovedInstallerPolicy::GetHash( std::vector<uint8_t>* hash) const { - hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); + hash->assign(std::begin(kRecoveryImprovedPublicKeySHA256), + std::end(kRecoveryImprovedPublicKeySHA256)); } std::string RecoveryImprovedInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/ssl_error_assistant_component_installer.cc b/chrome/browser/component_updater/ssl_error_assistant_component_installer.cc index b9099d8..b02edfd1 100644 --- a/chrome/browser/component_updater/ssl_error_assistant_component_installer.cc +++ b/chrome/browser/component_updater/ssl_error_assistant_component_installer.cc
@@ -24,7 +24,7 @@ // The SHA256 of the SubjectPublicKeyInfo used to sign the extension. // The extension id is: giekcmmlnklenlaomppkphknjmnnpneh -const uint8_t kPublicKeySHA256[32] = { +const uint8_t kSslErrorAssistantPublicKeySHA256[32] = { 0x68, 0x4a, 0x2c, 0xcb, 0xda, 0xb4, 0xdb, 0x0e, 0xcf, 0xfa, 0xf7, 0xad, 0x9c, 0xdd, 0xfd, 0x47, 0x97, 0xe4, 0x73, 0x24, 0x67, 0x93, 0x9c, 0xb1, 0x14, 0xcd, 0x3f, 0x54, 0x66, 0x25, 0x99, 0x3f}; @@ -107,8 +107,9 @@ void SSLErrorAssistantComponentInstallerPolicy::GetHash( std::vector<uint8_t>* hash) const { - hash->assign(kPublicKeySHA256, - kPublicKeySHA256 + arraysize(kPublicKeySHA256)); + hash->assign(kSslErrorAssistantPublicKeySHA256, + kSslErrorAssistantPublicKeySHA256 + + arraysize(kSslErrorAssistantPublicKeySHA256)); } std::string SSLErrorAssistantComponentInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/sth_set_component_installer.cc b/chrome/browser/component_updater/sth_set_component_installer.cc index 06e2cae..1bc9312 100644 --- a/chrome/browser/component_updater/sth_set_component_installer.cc +++ b/chrome/browser/component_updater/sth_set_component_installer.cc
@@ -44,7 +44,7 @@ // The SHA256 of the SubjectPublicKeyInfo used to sign the extension. // The extension id is: ojjgnpkioondelmggbekfhllhdaimnho -const uint8_t kPublicKeySHA256[32] = { +const uint8_t kSthSetPublicKeySHA256[32] = { 0xe9, 0x96, 0xdf, 0xa8, 0xee, 0xd3, 0x4b, 0xc6, 0x61, 0x4a, 0x57, 0xbb, 0x73, 0x08, 0xcd, 0x7e, 0x51, 0x9b, 0xcc, 0x69, 0x08, 0x41, 0xe1, 0x96, 0x9f, 0x7c, 0xb1, 0x73, 0xef, 0x16, 0x80, 0x0a}; @@ -99,7 +99,8 @@ } void STHSetComponentInstallerPolicy::GetHash(std::vector<uint8_t>* hash) const { - hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); + hash->assign(std::begin(kSthSetPublicKeySHA256), + std::end(kSthSetPublicKeySHA256)); } std::string STHSetComponentInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/subresource_filter_component_installer.cc b/chrome/browser/component_updater/subresource_filter_component_installer.cc index 5011068..8c01b0c 100644 --- a/chrome/browser/component_updater/subresource_filter_component_installer.cc +++ b/chrome/browser/component_updater/subresource_filter_component_installer.cc
@@ -23,7 +23,7 @@ namespace component_updater { // The extension id is: gcmjkmgdlgnkkcocmoeiminaijmmjnii -const uint8_t kPublicKeySHA256[32] = { +const uint8_t kSubresourceFilterPublicKeySHA256[32] = { 0x62, 0xc9, 0xac, 0x63, 0xb6, 0xda, 0xa2, 0xe2, 0xce, 0x48, 0xc8, 0xd0, 0x89, 0xcc, 0x9d, 0x88, 0x02, 0x7c, 0x3e, 0x71, 0xcf, 0x5d, 0x6b, 0xb5, 0xdf, 0x21, 0x65, 0x82, 0x08, 0x97, 0x6a, 0x26}; @@ -106,7 +106,8 @@ void SubresourceFilterComponentInstallerPolicy::GetHash( std::vector<uint8_t>* hash) const { - hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); + hash->assign(std::begin(kSubresourceFilterPublicKeySHA256), + std::end(kSubresourceFilterPublicKeySHA256)); } std::string SubresourceFilterComponentInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/third_party_module_list_component_installer_win.cc b/chrome/browser/component_updater/third_party_module_list_component_installer_win.cc index 6c678d0..083e648 100644 --- a/chrome/browser/component_updater/third_party_module_list_component_installer_win.cc +++ b/chrome/browser/component_updater/third_party_module_list_component_installer_win.cc
@@ -36,7 +36,7 @@ // The SHA256 of the SubjectPublicKeyInfo used to sign the component. // The component id is: EHGIDPNDBLLACPJALKIIMKBADGJFNNMC -const uint8_t kPublicKeySHA256[32] = { +const uint8_t kThirdPartyModuleListPublicKeySHA256[32] = { 0x47, 0x68, 0x3f, 0xd3, 0x1b, 0xb0, 0x2f, 0x90, 0xba, 0x88, 0xca, 0x10, 0x36, 0x95, 0xdd, 0xc2, 0x29, 0xd1, 0x4f, 0x38, 0xf2, 0x9d, 0x6c, 0x9c, 0x68, 0x6c, 0xa2, 0xa4, 0xa2, 0x8e, 0xa5, 0x5c}; @@ -102,7 +102,8 @@ void ThirdPartyModuleListComponentInstallerPolicy::GetHash( std::vector<uint8_t>* hash) const { - hash->assign(std::begin(kPublicKeySHA256), std::end(kPublicKeySHA256)); + hash->assign(std::begin(kThirdPartyModuleListPublicKeySHA256), + std::end(kThirdPartyModuleListPublicKeySHA256)); } std::string ThirdPartyModuleListComponentInstallerPolicy::GetName() const {
diff --git a/chrome/browser/component_updater/vr_assets_component_installer.cc b/chrome/browser/component_updater/vr_assets_component_installer.cc index 5df4b3ac..a0f458f 100644 --- a/chrome/browser/component_updater/vr_assets_component_installer.cc +++ b/chrome/browser/component_updater/vr_assets_component_installer.cc
@@ -17,11 +17,13 @@ #include "base/path_service.h" #include "base/task_scheduler/post_task.h" #include "base/version.h" -#include "chrome/browser/vr/assets.h" +#include "chrome/browser/vr/assets_loader.h" #include "chrome/browser/vr/metrics_helper.h" #include "chrome/browser/vr_features.h" #include "chrome/common/safe_browsing/file_type_policies.h" #include "components/component_updater/component_updater_paths.h" +#include "components/component_updater/component_updater_service.h" +#include "components/crx_file/id_util.h" using component_updater::ComponentUpdateService; @@ -29,7 +31,7 @@ // The SHA256 of the SubjectPublicKeyInfo used to sign the extension. // The extension id is: cjfkbpdpjpdldhclahpfgnlhpodlpnba -const uint8_t kPublicKeySHA256[32] = { +const uint8_t kVrAssetsPublicKeySHA256[32] = { 0x29, 0x5a, 0x1f, 0x3f, 0x9f, 0x3b, 0x37, 0x2b, 0x07, 0xf5, 0x6d, 0xb7, 0xfe, 0x3b, 0xfd, 0x10, 0xb6, 0x80, 0xf3, 0x66, 0x0d, 0xc3, 0xe2, 0x07, 0x25, 0x8d, 0x37, 0x85, 0x39, 0x51, 0x58, 0xcf}; @@ -42,6 +44,20 @@ namespace component_updater { +// static +void VrAssetsComponentInstallerTraits::UpdateComponent( + ComponentUpdateService* cus) { +#if BUILDFLAG(USE_VR_ASSETS_COMPONENT) + const std::string crx_id = crx_file::id_util::GenerateIdFromHash( + kVrAssetsPublicKeySHA256, sizeof(kVrAssetsPublicKeySHA256)); + // Make sure the component is registered. + DCHECK(std::find(cus->GetComponentIDs().begin(), cus->GetComponentIDs().end(), + crx_id) != cus->GetComponentIDs().end()); + cus->GetOnDemandUpdater().OnDemandUpdate( + crx_id, base::BindOnce([](update_client::Error error) { return; })); +#endif // BUILDFLAG(USE_VR_ASSETS_COMPONENT) +} + bool VrAssetsComponentInstallerTraits:: SupportsGroupPolicyEnabledComponentUpdates() const { return false; @@ -66,7 +82,7 @@ const base::FilePath& install_dir) const { auto* version_value = manifest.FindKey("version"); if (!version_value || !version_value->is_string()) { - vr::Assets::GetInstance()->GetMetricsHelper()->OnComponentUpdated( + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnComponentUpdated( vr::AssetsComponentUpdateStatus::kInvalid, base::nullopt); return false; } @@ -75,7 +91,7 @@ base::Version version(version_string); if (!version.IsValid() || version.components().size() != 2 || !base::PathExists(install_dir)) { - vr::Assets::GetInstance()->GetMetricsHelper()->OnComponentUpdated( + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnComponentUpdated( vr::AssetsComponentUpdateStatus::kInvalid, base::nullopt); return false; } @@ -83,7 +99,7 @@ if (version.components()[0] > vr::kCompatibleMajorVrAssetsComponentVersion) { // Component needs to be downgraded. Differential downgrades are not // supported. Just delete this component version. - vr::Assets::GetInstance()->GetMetricsHelper()->OnComponentUpdated( + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnComponentUpdated( vr::AssetsComponentUpdateStatus::kIncompatible, version); return false; } @@ -98,12 +114,12 @@ if (version.components()[0] != vr::kCompatibleMajorVrAssetsComponentVersion) { // Don't propagate component readiness and wait until differential update // delivers compatible component version. - vr::Assets::GetInstance()->GetMetricsHelper()->OnComponentUpdated( + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnComponentUpdated( vr::AssetsComponentUpdateStatus::kIncompatible, version); return; } - vr::Assets::GetInstance()->OnComponentReady(version, install_dir, - std::move(manifest)); + vr::AssetsLoader::GetInstance()->OnComponentReady(version, install_dir, + std::move(manifest)); } base::FilePath VrAssetsComponentInstallerTraits::GetRelativeInstallDir() const { @@ -112,8 +128,8 @@ void VrAssetsComponentInstallerTraits::GetHash( std::vector<uint8_t>* hash) const { - hash->assign(kPublicKeySHA256, - kPublicKeySHA256 + arraysize(kPublicKeySHA256)); + hash->assign(kVrAssetsPublicKeySHA256, + kVrAssetsPublicKeySHA256 + arraysize(kVrAssetsPublicKeySHA256)); } std::string VrAssetsComponentInstallerTraits::GetName() const { @@ -132,14 +148,18 @@ } void RegisterVrAssetsComponent(ComponentUpdateService* cus) { -#if BUILDFLAG(REGISTER_VR_ASSETS_COMPONENT) +#if BUILDFLAG(USE_VR_ASSETS_COMPONENT) std::unique_ptr<ComponentInstallerPolicy> policy( new VrAssetsComponentInstallerTraits()); auto installer = base::MakeRefCounted<ComponentInstaller>(std::move(policy)); installer->Register(cus, base::Closure()); - vr::Assets::GetInstance()->GetMetricsHelper()->OnRegisteredComponent(); + vr::AssetsLoader::GetInstance()->GetMetricsHelper()->OnRegisteredComponent(); VLOG(1) << "Registered VR assets component"; -#endif // BUILDFLAG(REGISTER_VR_ASSETS_COMPONENT) +#endif // BUILDFLAG(USE_VR_ASSETS_COMPONENT) +} + +void UpdateVrAssetsComponent(ComponentUpdateService* cus) { + VrAssetsComponentInstallerTraits::UpdateComponent(cus); } } // namespace component_updater
diff --git a/chrome/browser/component_updater/vr_assets_component_installer.h b/chrome/browser/component_updater/vr_assets_component_installer.h index 165248e..e2c9406 100644 --- a/chrome/browser/component_updater/vr_assets_component_installer.h +++ b/chrome/browser/component_updater/vr_assets_component_installer.h
@@ -30,6 +30,8 @@ ~VrAssetsComponentInstallerTraits() override {} private: + static void UpdateComponent(ComponentUpdateService* cus); + // ComponentInstallerPolicy: bool SupportsGroupPolicyEnabledComponentUpdates() const override; bool RequiresNetworkEncryption() const override; @@ -48,13 +50,19 @@ update_client::InstallerAttributes GetInstallerAttributes() const override; std::vector<std::string> GetMimeTypes() const override; + friend void UpdateVrAssetsComponent(ComponentUpdateService* cus); + DISALLOW_COPY_AND_ASSIGN(VrAssetsComponentInstallerTraits); }; -// Call once during to make the component update service aware of -// the VR Assets component. +// Call once to make the component update service aware of the VR Assets +// component. void RegisterVrAssetsComponent(ComponentUpdateService* cus); +// Update VR assets component immediately. The component must be registered +// before calling this function. +void UpdateVrAssetsComponent(ComponentUpdateService* cus); + } // namespace component_updater #endif // CHROME_BROWSER_COMPONENT_UPDATER_VR_ASSETS_COMPONENT_INSTALLER_H_
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc index 1175679..6d60fde 100644 --- a/chrome/browser/devtools/devtools_ui_bindings.cc +++ b/chrome/browser/devtools/devtools_ui_bindings.cc
@@ -174,7 +174,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier DevToolsConfirmInfoBarDelegate::GetIdentifier() const { - return DEV_TOOLS_CONFIRM_INFOBAR_DELEGATE; + return DEV_TOOLS_INFOBAR_DELEGATE; } base::string16 DevToolsConfirmInfoBarDelegate::GetMessageText() const { @@ -432,7 +432,7 @@ base::StringPrintf("%s=%s", it.GetKey().c_str(), value.c_str())); } } - if (url.has_ref()) + if (url.has_ref() && url.ref_piece().find('\'') == base::StringPiece::npos) fragment = '#' + url.ref(); } std::string query =
diff --git a/chrome/browser/devtools/devtools_ui_bindings_unittest.cc b/chrome/browser/devtools/devtools_ui_bindings_unittest.cc index 486d99a..52c50075 100644 --- a/chrome/browser/devtools/devtools_ui_bindings_unittest.cc +++ b/chrome/browser/devtools/devtools_ui_bindings_unittest.cc
@@ -47,6 +47,8 @@ "serve_file//#hash"}, {"chrome-devtools://devtools/?ws=1%26evil%3dtrue", "chrome-devtools://devtools/?ws=1%26evil%3dtrue"}, + {"chrome-devtools://devtools/?ws=encoded-ok'", + "chrome-devtools://devtools/?ws=encoded-ok%27"}, {"chrome-devtools://devtools/?remoteBase=" "https://chrome-devtools-frontend.appspot.com/some/path/" "@123719741873/more/path.html", @@ -89,6 +91,12 @@ "https%3A%2F%2Fchrome-devtools-frontend.appspot.com%2Fserve_rev" "%2F%4012345%2Fdevtools.html%3Fws%3Danyvalue%26experiments%3Dtrue" "&debugFrontend=true"}, + {"chrome-devtools://devtools/?remoteFrontendUrl=" + "https://chrome-devtools-frontend.appspot.com/serve_rev/" + "@12345/inspector.html%23%27", + "chrome-devtools://devtools/?remoteFrontendUrl=" + "https%3A%2F%2Fchrome-devtools-frontend.appspot.com%2Fserve_rev" + "%2F%4012345%2Finspector.html"}, }; for (const auto& pair : tests) {
diff --git a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc index c56f949..38a9fdb 100644 --- a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc +++ b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc
@@ -976,9 +976,8 @@ private: void OnInfoBarAdded(infobars::InfoBar* infobar) override { if (infobar->delegate()->GetIdentifier() == - infobars::InfoBarDelegate::CHROME_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE) { + infobars::InfoBarDelegate::DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_ANDROID) ++infobar_count_; - } infobar->delegate()->InfoBarDismissed(); infobar->RemoveSelf(); }
diff --git a/chrome/browser/engagement/site_engagement_helper.cc b/chrome/browser/engagement/site_engagement_helper.cc index 9417ac0..ce4d1c846 100644 --- a/chrome/browser/engagement/site_engagement_helper.cc +++ b/chrome/browser/engagement/site_engagement_helper.cc
@@ -172,6 +172,19 @@ Pause(); } +void SiteEngagementService::Helper::MediaTracker::DidFinishNavigation( + content::NavigationHandle* handle) { + // Ignore subframe navigation to avoid clearing main frame active media + // players when they navigate. + if (!handle->HasCommitted() || !handle->IsInMainFrame() || + handle->IsSameDocument()) { + return; + } + + // Media stops playing on navigation, so clear our state. + active_media_players_.clear(); +} + void SiteEngagementService::Helper::MediaTracker::MediaStartedPlaying( const MediaPlayerInfo& media_info, const MediaPlayerId& id) {
diff --git a/chrome/browser/engagement/site_engagement_helper.h b/chrome/browser/engagement/site_engagement_helper.h index 486a5a6b9..328392e92 100644 --- a/chrome/browser/engagement/site_engagement_helper.h +++ b/chrome/browser/engagement/site_engagement_helper.h
@@ -143,6 +143,7 @@ void TrackingStarted() override; // content::WebContentsObserver overrides. + void DidFinishNavigation(content::NavigationHandle* handle) override; void MediaStartedPlaying(const MediaPlayerInfo& media_info, const MediaPlayerId& id) override; void MediaStoppedPlaying(
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index cd4959ea..3cbc2130 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn
@@ -127,6 +127,8 @@ "api/debugger/debugger_api.h", "api/debugger/debugger_api_constants.cc", "api/debugger/debugger_api_constants.h", + "api/debugger/extension_dev_tools_infobar.cc", + "api/debugger/extension_dev_tools_infobar.h", "api/declarative_content/chrome_content_rules_registry.cc", "api/declarative_content/chrome_content_rules_registry.h", "api/declarative_content/content_action.cc",
diff --git a/chrome/browser/extensions/api/debugger/debugger_api.cc b/chrome/browser/extensions/api/debugger/debugger_api.cc index 5b5ee80..8d08b868 100644 --- a/chrome/browser/extensions/api/debugger/debugger_api.cc +++ b/chrome/browser/extensions/api/debugger/debugger_api.cc
@@ -13,7 +13,6 @@ #include <set> #include <utility> -#include "base/callback_helpers.h" #include "base/command_line.h" #include "base/json/json_reader.h" #include "base/json/json_writer.h" @@ -23,12 +22,11 @@ #include "base/scoped_observer.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/devtools/chrome_devtools_manager_delegate.h" -#include "chrome/browser/devtools/global_confirm_info_bar.h" #include "chrome/browser/extensions/api/debugger/debugger_api_constants.h" +#include "chrome/browser/extensions/api/debugger/extension_dev_tools_infobar.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_tab_util.h" #include "chrome/browser/infobars/infobar_service.h" @@ -36,8 +34,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" #include "chrome/common/chrome_switches.h" -#include "chrome/grit/generated_resources.h" -#include "components/infobars/core/confirm_infobar_delegate.h" #include "components/infobars/core/infobar.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/devtools_agent_host.h" @@ -58,7 +54,6 @@ #include "extensions/common/manifest_constants.h" #include "extensions/common/permissions/permissions_data.h" #include "extensions/common/switches.h" -#include "ui/base/l10n/l10n_util.h" using content::DevToolsAgentHost; using content::RenderProcessHost; @@ -89,155 +84,6 @@ dst->target_id.reset(new std::string(*src.target_id)); } - -// ExtensionDevToolsInfoBarDelegate ------------------------------------------- - -class ExtensionDevToolsInfoBarDelegate : public ConfirmInfoBarDelegate { - public: - ExtensionDevToolsInfoBarDelegate(const base::Closure& dismissed_callback, - const std::string& client_name); - ~ExtensionDevToolsInfoBarDelegate() override; - - // ConfirmInfoBarDelegate: - Type GetInfoBarType() const override; - infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; - bool ShouldExpire(const NavigationDetails& details) const override; - void InfoBarDismissed() override; - base::string16 GetMessageText() const override; - int GetButtons() const override; - bool Cancel() override; - - private: - const base::string16 client_name_; - base::Closure dismissed_callback_; - - DISALLOW_COPY_AND_ASSIGN(ExtensionDevToolsInfoBarDelegate); -}; - -ExtensionDevToolsInfoBarDelegate::ExtensionDevToolsInfoBarDelegate( - const base::Closure& dismissed_callback, - const std::string& client_name) - : ConfirmInfoBarDelegate(), - client_name_(base::UTF8ToUTF16(client_name)), - dismissed_callback_(dismissed_callback) {} - -ExtensionDevToolsInfoBarDelegate::~ExtensionDevToolsInfoBarDelegate() { -} - -infobars::InfoBarDelegate::Type -ExtensionDevToolsInfoBarDelegate::GetInfoBarType() const { - return WARNING_TYPE; -} - -infobars::InfoBarDelegate::InfoBarIdentifier -ExtensionDevToolsInfoBarDelegate::GetIdentifier() const { - return EXTENSION_DEV_TOOLS_INFOBAR_DELEGATE; -} - -bool ExtensionDevToolsInfoBarDelegate::ShouldExpire( - const NavigationDetails& details) const { - return false; -} - -void ExtensionDevToolsInfoBarDelegate::InfoBarDismissed() { - DCHECK(!dismissed_callback_.is_null()); - // Use ResetAndReturn() since running the callback may delete |this|. - base::ResetAndReturn(&dismissed_callback_).Run(); -} - -base::string16 ExtensionDevToolsInfoBarDelegate::GetMessageText() const { - return l10n_util::GetStringFUTF16(IDS_DEV_TOOLS_INFOBAR_LABEL, client_name_); -} - -int ExtensionDevToolsInfoBarDelegate::GetButtons() const { - return BUTTON_CANCEL; -} - -bool ExtensionDevToolsInfoBarDelegate::Cancel() { - InfoBarDismissed(); - // InfoBarDismissed() will have closed us already. - return false; -} - -// ExtensionDevToolsInfoBar --------------------------------------------------- - -class ExtensionDevToolsInfoBar; -using ExtensionInfoBars = - std::map<std::string, ExtensionDevToolsInfoBar*>; -base::LazyInstance<ExtensionInfoBars>::Leaky g_extension_info_bars = - LAZY_INSTANCE_INITIALIZER; - -class ExtensionDevToolsInfoBar { - public: - static ExtensionDevToolsInfoBar* Create( - const std::string& extension_id, - const std::string& extension_name, - ExtensionDevToolsClientHost* client_host, - const base::Closure& dismissed_callback); - void Remove(ExtensionDevToolsClientHost* client_host); - - private: - ExtensionDevToolsInfoBar(const std::string& extension_id, - const std::string& extension_name); - ~ExtensionDevToolsInfoBar(); - void InfoBarDismissed(); - - std::string extension_id_; - std::map<ExtensionDevToolsClientHost*, base::Closure> callbacks_; - base::WeakPtr<GlobalConfirmInfoBar> infobar_; -}; - -// static -ExtensionDevToolsInfoBar* ExtensionDevToolsInfoBar::Create( - const std::string& extension_id, - const std::string& extension_name, - ExtensionDevToolsClientHost* client_host, - const base::Closure& dismissed_callback) { - ExtensionInfoBars::iterator it = - g_extension_info_bars.Get().find(extension_id); - ExtensionDevToolsInfoBar* infobar = nullptr; - if (it != g_extension_info_bars.Get().end()) - infobar = it->second; - else - infobar = new ExtensionDevToolsInfoBar(extension_id, extension_name); - infobar->callbacks_[client_host] = dismissed_callback; - return infobar; -} - -ExtensionDevToolsInfoBar::ExtensionDevToolsInfoBar( - const std::string& extension_id, - const std::string& extension_name) - : extension_id_(extension_id) { - g_extension_info_bars.Get()[extension_id] = this; - - // This class closes the |infobar_|, so it's safe to pass Unretained(this). - std::unique_ptr<ExtensionDevToolsInfoBarDelegate> delegate( - new ExtensionDevToolsInfoBarDelegate( - base::Bind(&ExtensionDevToolsInfoBar::InfoBarDismissed, - base::Unretained(this)), - extension_name)); - infobar_ = GlobalConfirmInfoBar::Show(std::move(delegate)); -} - -ExtensionDevToolsInfoBar::~ExtensionDevToolsInfoBar() { - g_extension_info_bars.Get().erase(extension_id_); - if (infobar_) - infobar_->Close(); -} - -void ExtensionDevToolsInfoBar::Remove( - ExtensionDevToolsClientHost* client_host) { - callbacks_.erase(client_host); - if (callbacks_.empty()) - delete this; -} - -void ExtensionDevToolsInfoBar::InfoBarDismissed() { - std::map<ExtensionDevToolsClientHost*, base::Closure> copy = callbacks_; - for (const auto& pair : copy) - pair.second.Run(); -} - } // namespace // ExtensionDevToolsClientHost ------------------------------------------------ @@ -306,8 +152,6 @@ DISALLOW_COPY_AND_ASSIGN(ExtensionDevToolsClientHost); }; -// ExtensionDevToolsClientHost ------------------------------------------------ - ExtensionDevToolsClientHost::ExtensionDevToolsClientHost( Profile* profile, DevToolsAgentHost* agent_host,
diff --git a/chrome/browser/extensions/api/debugger/extension_dev_tools_infobar.cc b/chrome/browser/extensions/api/debugger/extension_dev_tools_infobar.cc new file mode 100644 index 0000000..6b187e3 --- /dev/null +++ b/chrome/browser/extensions/api/debugger/extension_dev_tools_infobar.cc
@@ -0,0 +1,144 @@ +// Copyright 2018 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/extensions/api/debugger/extension_dev_tools_infobar.h" + +#include <memory> + +#include "base/callback_helpers.h" +#include "base/lazy_instance.h" +#include "base/strings/utf_string_conversions.h" +#include "chrome/browser/devtools/global_confirm_info_bar.h" +#include "chrome/grit/generated_resources.h" +#include "components/infobars/core/confirm_infobar_delegate.h" +#include "ui/base/l10n/l10n_util.h" + +namespace extensions { + +namespace { + +// The InfoBarDelegate that ExtensionDevToolsInfoBar shows. +class ExtensionDevToolsInfoBarDelegate : public ConfirmInfoBarDelegate { + public: + ExtensionDevToolsInfoBarDelegate(const base::Closure& dismissed_callback, + const std::string& client_name); + ~ExtensionDevToolsInfoBarDelegate() override; + + // ConfirmInfoBarDelegate: + Type GetInfoBarType() const override; + infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; + bool ShouldExpire(const NavigationDetails& details) const override; + void InfoBarDismissed() override; + base::string16 GetMessageText() const override; + int GetButtons() const override; + bool Cancel() override; + + private: + const base::string16 client_name_; + base::Closure dismissed_callback_; + + DISALLOW_COPY_AND_ASSIGN(ExtensionDevToolsInfoBarDelegate); +}; + +ExtensionDevToolsInfoBarDelegate::ExtensionDevToolsInfoBarDelegate( + const base::Closure& dismissed_callback, + const std::string& client_name) + : ConfirmInfoBarDelegate(), + client_name_(base::UTF8ToUTF16(client_name)), + dismissed_callback_(dismissed_callback) {} + +ExtensionDevToolsInfoBarDelegate::~ExtensionDevToolsInfoBarDelegate() {} + +infobars::InfoBarDelegate::Type +ExtensionDevToolsInfoBarDelegate::GetInfoBarType() const { + return WARNING_TYPE; +} + +infobars::InfoBarDelegate::InfoBarIdentifier +ExtensionDevToolsInfoBarDelegate::GetIdentifier() const { + return EXTENSION_DEV_TOOLS_INFOBAR_DELEGATE; +} + +bool ExtensionDevToolsInfoBarDelegate::ShouldExpire( + const NavigationDetails& details) const { + return false; +} + +void ExtensionDevToolsInfoBarDelegate::InfoBarDismissed() { + DCHECK(!dismissed_callback_.is_null()); + // Use ResetAndReturn() since running the callback may delete |this|. + base::ResetAndReturn(&dismissed_callback_).Run(); +} + +base::string16 ExtensionDevToolsInfoBarDelegate::GetMessageText() const { + return l10n_util::GetStringFUTF16(IDS_DEV_TOOLS_INFOBAR_LABEL, client_name_); +} + +int ExtensionDevToolsInfoBarDelegate::GetButtons() const { + return BUTTON_CANCEL; +} + +bool ExtensionDevToolsInfoBarDelegate::Cancel() { + InfoBarDismissed(); + // InfoBarDismissed() will have closed us already. + return false; +} + +using ExtensionInfoBars = std::map<std::string, ExtensionDevToolsInfoBar*>; +base::LazyInstance<ExtensionInfoBars>::Leaky g_extension_info_bars = + LAZY_INSTANCE_INITIALIZER; + +} // namespace + +// static +ExtensionDevToolsInfoBar* ExtensionDevToolsInfoBar::Create( + const std::string& extension_id, + const std::string& extension_name, + ExtensionDevToolsClientHost* client_host, + const base::Closure& dismissed_callback) { + ExtensionInfoBars::iterator it = + g_extension_info_bars.Get().find(extension_id); + ExtensionDevToolsInfoBar* infobar = nullptr; + if (it != g_extension_info_bars.Get().end()) + infobar = it->second; + else + infobar = new ExtensionDevToolsInfoBar(extension_id, extension_name); + infobar->callbacks_[client_host] = dismissed_callback; + return infobar; +} + +ExtensionDevToolsInfoBar::ExtensionDevToolsInfoBar( + const std::string& extension_id, + const std::string& extension_name) + : extension_id_(extension_id) { + g_extension_info_bars.Get()[extension_id] = this; + + // This class closes the |infobar_|, so it's safe to pass Unretained(this). + auto delegate = std::make_unique<ExtensionDevToolsInfoBarDelegate>( + base::Bind(&ExtensionDevToolsInfoBar::InfoBarDismissed, + base::Unretained(this)), + extension_name); + infobar_ = GlobalConfirmInfoBar::Show(std::move(delegate)); +} + +ExtensionDevToolsInfoBar::~ExtensionDevToolsInfoBar() { + g_extension_info_bars.Get().erase(extension_id_); + if (infobar_) + infobar_->Close(); +} + +void ExtensionDevToolsInfoBar::Remove( + ExtensionDevToolsClientHost* client_host) { + callbacks_.erase(client_host); + if (callbacks_.empty()) + delete this; +} + +void ExtensionDevToolsInfoBar::InfoBarDismissed() { + std::map<ExtensionDevToolsClientHost*, base::Closure> copy = callbacks_; + for (const auto& pair : copy) + pair.second.Run(); +} + +} // namespace extensions
diff --git a/chrome/browser/extensions/api/debugger/extension_dev_tools_infobar.h b/chrome/browser/extensions/api/debugger/extension_dev_tools_infobar.h new file mode 100644 index 0000000..63ec9a3 --- /dev/null +++ b/chrome/browser/extensions/api/debugger/extension_dev_tools_infobar.h
@@ -0,0 +1,43 @@ +// Copyright 2018 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_EXTENSIONS_API_DEBUGGER_EXTENSION_DEV_TOOLS_INFOBAR_H_ +#define CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_EXTENSION_DEV_TOOLS_INFOBAR_H_ + +#include <map> +#include <string> + +#include "base/callback_forward.h" +#include "base/memory/weak_ptr.h" + +class GlobalConfirmInfoBar; + +namespace extensions { +class ExtensionDevToolsClientHost; + +// An infobar used to globally warn users that an extension is debugging the +// browser (which has security consequences). +class ExtensionDevToolsInfoBar { + public: + static ExtensionDevToolsInfoBar* Create( + const std::string& extension_id, + const std::string& extension_name, + ExtensionDevToolsClientHost* client_host, + const base::Closure& dismissed_callback); + void Remove(ExtensionDevToolsClientHost* client_host); + + private: + ExtensionDevToolsInfoBar(const std::string& extension_id, + const std::string& extension_name); + ~ExtensionDevToolsInfoBar(); + void InfoBarDismissed(); + + std::string extension_id_; + std::map<ExtensionDevToolsClientHost*, base::Closure> callbacks_; + base::WeakPtr<GlobalConfirmInfoBar> infobar_; +}; + +} // namespace extensions + +#endif // CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_EXTENSION_DEV_TOOLS_INFOBAR_H_
diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc index 01046b0c..84f32d4 100644 --- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc +++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api.cc
@@ -354,7 +354,9 @@ NOTREACHED(); } - translate_prefs->RearrangeLanguage(language_code, where, + // On Desktop we can only move languages by one position. + const int offset = 1; + translate_prefs->RearrangeLanguage(language_code, where, offset, supported_language_codes); return RespondNow(NoArguments());
diff --git a/chrome/browser/extensions/api/media_perception_private/media_perception_api_delegate_chromeos.cc b/chrome/browser/extensions/api/media_perception_private/media_perception_api_delegate_chromeos.cc index dc857e6f..29fdfad 100644 --- a/chrome/browser/extensions/api/media_perception_private/media_perception_api_delegate_chromeos.cc +++ b/chrome/browser/extensions/api/media_perception_private/media_perception_api_delegate_chromeos.cc
@@ -40,7 +40,7 @@ void MediaPerceptionAPIDelegateChromeOS::LoadCrOSComponent( const media_perception::ComponentType& type, LoadCrOSComponentCallback load_callback) { - component_updater::CrOSComponent::LoadComponent( + g_browser_process->platform_part()->cros_component_manager()->Load( GetComponentNameForComponentType(type), std::move(load_callback)); }
diff --git a/chrome/browser/extensions/api/messaging/incognito_connectability.cc b/chrome/browser/extensions/api/messaging/incognito_connectability.cc index 4fa51a66..e0347ed4 100644 --- a/chrome/browser/extensions/api/messaging/incognito_connectability.cc +++ b/chrome/browser/extensions/api/messaging/incognito_connectability.cc
@@ -18,7 +18,6 @@ #include "ui/base/l10n/l10n_util.h" using infobars::InfoBar; -using infobars::InfoBarManager; namespace extensions { @@ -35,7 +34,7 @@ // Creates a confirmation infobar and delegate and adds the infobar to // |infobar_service|. - static InfoBar* Create(InfoBarManager* infobar_manager, + static InfoBar* Create(InfoBarService* infobar_service, const base::string16& message, const InfoBarCallback& callback); @@ -63,10 +62,10 @@ // static InfoBar* IncognitoConnectabilityInfoBarDelegate::Create( - InfoBarManager* infobar_manager, + InfoBarService* infobar_service, const base::string16& message, const IncognitoConnectabilityInfoBarDelegate::InfoBarCallback& callback) { - return infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar( + return infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( std::unique_ptr<ConfirmInfoBarDelegate>( new IncognitoConnectabilityInfoBarDelegate(message, callback)))); } @@ -177,9 +176,9 @@ PendingOrigin& pending_origin = pending_origins_[make_pair(extension->id(), origin)]; - InfoBarManager* infobar_manager = + InfoBarService* infobar_service = InfoBarService::FromWebContents(web_contents); - TabContext& tab_context = pending_origin[infobar_manager]; + TabContext& tab_context = pending_origin[infobar_service]; tab_context.callbacks.push_back(callback); if (tab_context.infobar) { // This tab is already displaying an infobar for this extension and origin. @@ -197,19 +196,20 @@ ? IDS_EXTENSION_PROMPT_APP_CONNECT_FROM_INCOGNITO : IDS_EXTENSION_PROMPT_EXTENSION_CONNECT_FROM_INCOGNITO; tab_context.infobar = IncognitoConnectabilityInfoBarDelegate::Create( - infobar_manager, l10n_util::GetStringFUTF16( - template_id, base::UTF8ToUTF16(origin.spec()), - base::UTF8ToUTF16(extension->name())), + infobar_service, + l10n_util::GetStringFUTF16(template_id, + base::UTF8ToUTF16(origin.spec()), + base::UTF8ToUTF16(extension->name())), base::Bind(&IncognitoConnectability::OnInteractiveResponse, weak_factory_.GetWeakPtr(), extension->id(), origin, - infobar_manager)); + infobar_service)); break; } // Testing code can override to always allow or deny. case ScopedAlertTracker::ALWAYS_ALLOW: case ScopedAlertTracker::ALWAYS_DENY: - OnInteractiveResponse(extension->id(), origin, infobar_manager, + OnInteractiveResponse(extension->id(), origin, infobar_service, g_alert_mode); break; } @@ -227,7 +227,7 @@ void IncognitoConnectability::OnInteractiveResponse( const std::string& extension_id, const GURL& origin, - InfoBarManager* infobar_manager, + InfoBarService* infobar_service, ScopedAlertTracker::Mode response) { switch (response) { case ScopedAlertTracker::ALWAYS_ALLOW: @@ -245,29 +245,29 @@ DCHECK(base::ContainsKey(pending_origins_, make_pair(extension_id, origin))); PendingOrigin& pending_origin = pending_origins_[make_pair(extension_id, origin)]; - DCHECK(base::ContainsKey(pending_origin, infobar_manager)); + DCHECK(base::ContainsKey(pending_origin, infobar_service)); std::vector<base::Callback<void(bool)>> callbacks; if (response == ScopedAlertTracker::INTERACTIVE) { // No definitive answer for this extension and origin. Execute only the // callbacks associated with this tab. - TabContext& tab_context = pending_origin[infobar_manager]; + TabContext& tab_context = pending_origin[infobar_service]; callbacks.swap(tab_context.callbacks); - pending_origin.erase(infobar_manager); + pending_origin.erase(infobar_service); } else { // We have a definitive answer for this extension and origin. Close all // other infobars and answer all the callbacks. for (const auto& map_entry : pending_origin) { - InfoBarManager* other_infobar_manager = map_entry.first; + InfoBarService* other_infobar_service = map_entry.first; const TabContext& other_tab_context = map_entry.second; - if (other_infobar_manager != infobar_manager) { + if (other_infobar_service != infobar_service) { // Disarm the delegate so that it doesn't think the infobar has been // dismissed. IncognitoConnectabilityInfoBarDelegate* delegate = static_cast<IncognitoConnectabilityInfoBarDelegate*>( other_tab_context.infobar->delegate()); delegate->set_answered(); - other_infobar_manager->RemoveInfoBar(other_tab_context.infobar); + other_infobar_service->RemoveInfoBar(other_tab_context.infobar); } callbacks.insert(callbacks.end(), other_tab_context.callbacks.begin(), other_tab_context.callbacks.end());
diff --git a/chrome/browser/extensions/api/messaging/incognito_connectability.h b/chrome/browser/extensions/api/messaging/incognito_connectability.h index 9686db2..2984f8730 100644 --- a/chrome/browser/extensions/api/messaging/incognito_connectability.h +++ b/chrome/browser/extensions/api/messaging/incognito_connectability.h
@@ -11,6 +11,8 @@ #include "extensions/browser/browser_context_keyed_api_factory.h" #include "url/gurl.h" +class InfoBarService; + namespace content { class BrowserContext; class WebContents; @@ -18,7 +20,6 @@ namespace infobars { class InfoBar; -class InfoBarManager; } namespace extensions { @@ -73,7 +74,7 @@ TabContext(const TabContext& other); ~TabContext(); - // The infobar being shown in a given tab. The InfoBarManager maintains + // The infobar being shown in a given tab. The InfoBarService maintains // ownership of this object. This struct must always be destroyed before the // infobar it tracks. infobars::InfoBar* infobar; @@ -88,7 +89,7 @@ typedef std::map<std::string, std::set<GURL> > ExtensionToOriginsMap; typedef std::pair<std::string, GURL> ExtensionOriginPair; - typedef std::map<infobars::InfoBarManager*, TabContext> PendingOrigin; + typedef std::map<InfoBarService*, TabContext> PendingOrigin; typedef std::map<ExtensionOriginPair, PendingOrigin> PendingOriginMap; // Called with the user's selection from the infobar. @@ -96,7 +97,7 @@ // without selecting allow or deny. void OnInteractiveResponse(const std::string& extension_id, const GURL& origin, - infobars::InfoBarManager* infobar_manager, + InfoBarService* infobar_service, ScopedAlertTracker::Mode response); // Returns true if the (|extension|, |origin|) pair appears in the map.
diff --git a/chrome/browser/extensions/display_info_provider_chromeos.cc b/chrome/browser/extensions/display_info_provider_chromeos.cc index f27f956..3cd0a43 100644 --- a/chrome/browser/extensions/display_info_provider_chromeos.cc +++ b/chrome/browser/extensions/display_info_provider_chromeos.cc
@@ -15,7 +15,7 @@ #include "ash/touch/ash_touch_transform_controller.h" #include "base/strings/string_number_conversions.h" #include "base/strings/stringprintf.h" -#include "chrome/browser/chromeos/display/display_preferences.h" +#include "chrome/browser/chromeos/display/display_prefs.h" #include "chrome/browser/ui/ash/ash_util.h" #include "chrome/browser/ui/ash/tablet_mode_client.h" #include "extensions/common/api/system_display.h" @@ -415,8 +415,9 @@ if (!ash::Shell::Get() ->resolution_notification_controller() ->PrepareNotificationAndSetDisplayMode( - id, current_mode, new_mode, - base::Bind(&chromeos::StoreDisplayPrefs))) { + id, current_mode, new_mode, base::BindRepeating([]() { + chromeos::DisplayPrefs::Get()->StoreDisplayPrefs(); + }))) { *error = "Unable to set the display mode."; return false; }
diff --git a/chrome/browser/extensions/extension_navigation_throttle_unittest.cc b/chrome/browser/extensions/extension_navigation_throttle_unittest.cc index 6b56caf..3431bff8 100644 --- a/chrome/browser/extensions/extension_navigation_throttle_unittest.cc +++ b/chrome/browser/extensions/extension_navigation_throttle_unittest.cc
@@ -76,10 +76,7 @@ content::NavigationHandle::CreateNavigationHandleForTesting( extension_url, host); EXPECT_EQ(expected_will_start_result, - handle->CallWillStartRequestForTesting( - /*is_post=*/false, content::Referrer(), - /*has_user_gesture=*/false, ui::PAGE_TRANSITION_LINK, - /*is_external_protocol=*/false)) + handle->CallWillStartRequestForTesting()) << extension_url; // Reset the handle for a second subtest: server redirect to @@ -96,10 +93,7 @@ ? NavigationThrottle::PROCEED : NavigationThrottle::CANCEL; EXPECT_EQ(NavigationThrottle::PROCEED, - handle->CallWillStartRequestForTesting( - /*is_post=*/false, content::Referrer(), - /*has_user_gesture=*/false, ui::PAGE_TRANSITION_LINK, - /*is_external_protocol=*/false)) + handle->CallWillStartRequestForTesting()) << http_url; EXPECT_EQ(expected_will_redirect_result, handle->CallWillRedirectRequestForTesting(
diff --git a/chrome/browser/extensions/zipfile_installer_unittest.cc b/chrome/browser/extensions/zipfile_installer_unittest.cc index 2aeaf58..b02f0736 100644 --- a/chrome/browser/extensions/zipfile_installer_unittest.cc +++ b/chrome/browser/extensions/zipfile_installer_unittest.cc
@@ -14,6 +14,7 @@ #include "base/values.h" #include "build/build_config.h" #include "chrome/browser/extensions/extension_service.h" +#include "chrome/browser/extensions/load_error_reporter.h" #include "chrome/browser/extensions/test_extension_system.h" #include "chrome/browser/extensions/zipfile_installer.h" #include "chrome/common/chrome_paths.h" @@ -37,23 +38,47 @@ namespace { struct MockExtensionRegistryObserver : public ExtensionRegistryObserver { - void WaitForInstall() { - scoped_refptr<content::MessageLoopRunner> runner = - new content::MessageLoopRunner; - quit_closure_ = runner->QuitClosure(); - runner->Run(); + void WaitForInstall(bool expect_error) { + extensions::LoadErrorReporter* error_reporter = + extensions::LoadErrorReporter::GetInstance(); + error_reporter->ClearErrors(); + while (true) { + base::RunLoop run_loop; + // We do not get a notification if installation fails. Make sure to wake + // up and check for errors to get an error better than the test + // timing-out. + // TODO(jcivelli): make LoadErrorReporter::Observer report installation + // failures for packaged extensions so we don't have to poll. + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, run_loop.QuitClosure(), + base::TimeDelta::FromMilliseconds(100)); + quit_closure = run_loop.QuitClosure(); + run_loop.Run(); + const std::vector<base::string16>* errors = error_reporter->GetErrors(); + if (!errors->empty()) { + if (!expect_error) { + FAIL() << "Error(s) happened when unzipping extension: " + << (*errors)[0]; + } + break; + } + if (!last_extension_installed.empty()) { + // Extension install succeeded. + EXPECT_FALSE(expect_error); + break; + } + } } - void OnExtensionWillBeInstalled(content::BrowserContext* browser_context, - const Extension* extension, - bool is_update, - const std::string& old_name) override { + void OnExtensionInstalled(content::BrowserContext* browser_context, + const Extension* extension, + bool is_update) override { last_extension_installed = extension->id(); - quit_closure_.Run(); + quit_closure.Run(); } std::string last_extension_installed; - base::Closure quit_closure_; + base::Closure quit_closure; }; } // namespace @@ -64,6 +89,8 @@ : browser_threads_(content::TestBrowserThreadBundle::IO_MAINLOOP) {} void SetUp() override { + extensions::LoadErrorReporter::Init(/*enable_noisy_errors=*/false); + in_process_utility_thread_helper_.reset( new content::InProcessUtilityThreadHelper); @@ -87,7 +114,7 @@ base::RunLoop().RunUntilIdle(); } - void RunInstaller(const std::string& zip_name) { + void RunInstaller(const std::string& zip_name, bool expect_error) { base::FilePath original_path; ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &original_path)); original_path = original_path.AppendASCII("extensions") @@ -100,7 +127,7 @@ base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(&ZipFileInstaller::LoadFromZipFile, zipfile_installer_, original_path)); - observer_.WaitForInstall(); + observer_.WaitForInstall(expect_error); } protected: @@ -123,11 +150,16 @@ }; TEST_F(ZipFileInstallerTest, GoodZip) { - RunInstaller("good.zip"); + RunInstaller("good.zip", /*expect_error=*/false); +} + +TEST_F(ZipFileInstallerTest, BadZip) { + // Manifestless archive. + RunInstaller("bad.zip", /*expect_error=*/true); } TEST_F(ZipFileInstallerTest, ZipWithPublicKey) { - RunInstaller("public_key.zip"); + RunInstaller("public_key.zip", /*expect_error=*/false); const char kIdForPublicKey[] = "ikppjpenhoddphklkpdfdfdabbakkpal"; EXPECT_EQ(observer_.last_extension_installed, kIdForPublicKey); }
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index ec6c375..03206c3 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -264,6 +264,12 @@ const char kEnableAutofillCreditCardBankNameDisplayDescription[] = "If enabled, displays the issuer bank name of a credit card in autofill."; +const char kEnableAutofillCreditCardDropdownGooglePayBrandingName[] = + "Show the Google Pay logo in the Autofill credit card dropdown"; +const char kEnableAutofillCreditCardDropdownGooglePayBrandingDescription[] = + "If enabled, shows the Google Pay logo in the Autofill credit card " + "dropdown."; + const char kEnableAutofillCreditCardLastUsedDateDisplayName[] = "Display the last used date of a credit card in autofill."; const char kEnableAutofillCreditCardLastUsedDateDisplayDescription[] = @@ -302,6 +308,12 @@ const char kEnableAutofillToolkitViewsCreditCardDialogsMacDescription[] = "Enable more modern credit card dialogs on Mac, based on toolkit-views."; +const char kEnableAutofillUseNewSettingsNameInDropdownName[] = + "Show a new Autofill settings string in the Autofill dropdown"; +const char kEnableAutofillUseNewSettingsNameInDropdownDescription[] = + "If enabled, shows a new Autofill settings string in the Autofill " + "dropdown."; + const char kEnableBreakingNewsPushName[] = "Breaking News Push"; const char kEnableBreakingNewsPushDescription[] = "Listen for breaking news content suggestions (e.g. for New Tab Page) " @@ -424,10 +436,10 @@ "Generate V8 code cache in Cache Storage while installing Service Worker " "for PWAs."; -const char kEnableMultiMirroringName[] = +const char kDisableMultiMirroringName[] = "Display mirroring across multiple displays."; -const char kEnableMultiMirroringDescription[] = - "Enable Display mirroring across multiple displays."; +const char kDisableMultiMirroringDescription[] = + "Disable Display mirroring across multiple displays."; const char kEnableNavigationTracingName[] = "Enable navigation tracing"; const char kEnableNavigationTracingDescription[] = @@ -2202,6 +2214,12 @@ "Enable receiving entity suggestions - disambiguation descriptions - for " "Omnibox suggestions."; +const char kOmniboxRichEntitySuggestionsName[] = + "Omnibox rich entity suggestions"; +const char kOmniboxRichEntitySuggestionsDescription[] = + "Display entity suggestions using images and an enhanced layout; showing " + "more context and descriptive text about the entity"; + const char kOmniboxTabSwitchSuggestionsName[] = "Omnibox tab switch suggestions"; const char kOmniboxTabSwitchSuggestionsDescription[] = @@ -2422,10 +2440,6 @@ "Enable unified desktop mode which allows a window to span multiple " "displays."; -const char kBootAnimationName[] = "Boot animation"; -const char kBootAnimationDescription[] = - "Wallpaper boot animation (except for OOBE case)."; - const char kBulkPrintersName[] = "Bulk Printers Policy"; const char kBulkPrintersDescription[] = "Enables the new bulk printers policy";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index ccbe29f8..fa49d7e 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -194,6 +194,10 @@ extern const char kEnableAutofillCreditCardBankNameDisplayName[]; extern const char kEnableAutofillCreditCardBankNameDisplayDescription[]; +extern const char kEnableAutofillCreditCardDropdownGooglePayBrandingName[]; +extern const char + kEnableAutofillCreditCardDropdownGooglePayBrandingDescription[]; + extern const char kEnableAutofillCreditCardLastUsedDateDisplayName[]; extern const char kEnableAutofillCreditCardLastUsedDateDisplayDescription[]; @@ -213,6 +217,9 @@ extern const char kEnableAutofillToolkitViewsCreditCardDialogsMac[]; extern const char kEnableAutofillToolkitViewsCreditCardDialogsMacDescription[]; +extern const char kEnableAutofillUseNewSettingsNameInDropdownName[]; +extern const char kEnableAutofillUseNewSettingsNameInDropdownDescription[]; + extern const char kEnableBreakingNewsPushName[]; extern const char kEnableBreakingNewsPushDescription[]; @@ -283,8 +290,8 @@ extern const char kEnablePolicyToolName[]; extern const char kEnablePolicyToolDescription[]; -extern const char kEnableMultiMirroringName[]; -extern const char kEnableMultiMirroringDescription[]; +extern const char kDisableMultiMirroringName[]; +extern const char kDisableMultiMirroringDescription[]; extern const char kEnableNavigationTracingName[]; extern const char kEnableNavigationTracingDescription[]; @@ -1348,6 +1355,9 @@ extern const char kOmniboxEntitySuggestionsName[]; extern const char kOmniboxEntitySuggestionsDescription[]; +extern const char kOmniboxRichEntitySuggestionsName[]; +extern const char kOmniboxRichEntitySuggestionsDescription[]; + extern const char kOmniboxTabSwitchSuggestionsName[]; extern const char kOmniboxTabSwitchSuggestionsDescription[]; @@ -1499,9 +1509,6 @@ extern const char kAshEnableUnifiedDesktopName[]; extern const char kAshEnableUnifiedDesktopDescription[]; -extern const char kBootAnimationName[]; -extern const char kBootAnimationDescription[]; - extern const char kBulkPrintersName[]; extern const char kBulkPrintersDescription[];
diff --git a/chrome/browser/infobars/infobars_browsertest.cc b/chrome/browser/infobars/infobars_browsertest.cc index ef3787b9..b1d2d68 100644 --- a/chrome/browser/infobars/infobars_browsertest.cc +++ b/chrome/browser/infobars/infobars_browsertest.cc
@@ -5,33 +5,62 @@ #include <utility> #include "base/command_line.h" +#include "base/containers/flat_map.h" +#include "base/strings/utf_string_conversions.h" #include "build/build_config.h" +#include "chrome/browser/banners/app_banner_infobar_delegate_desktop.h" #include "chrome/browser/chrome_notification_types.h" +#include "chrome/browser/extensions/api/debugger/extension_dev_tools_infobar.h" #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_install_prompt.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/infobars/infobar_service.h" +#include "chrome/browser/plugins/plugin_observer.h" +#include "chrome/browser/plugins/reload_plugin_infobar_delegate.h" +#include "chrome/browser/previews/previews_infobar_delegate.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service_factory.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/chrome_select_file_policy.h" +#include "chrome/browser/ui/collected_cookies_infobar_delegate.h" +#include "chrome/browser/ui/omnibox/alternate_nav_infobar_delegate.h" +#include "chrome/browser/ui/page_info/page_info_infobar_delegate.h" +#include "chrome/browser/ui/startup/automation_infobar_delegate.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/test/test_browser_ui.h" #include "chrome/common/chrome_switches.h" +#include "chrome/grit/generated_resources.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "components/infobars/core/infobar.h" +#include "components/nacl/common/features.h" #include "content/public/browser/notification_service.h" #include "extensions/browser/extension_dialog_auto_confirm.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_system.h" #include "extensions/browser/test_extension_registry_observer.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#include "ui/base/l10n/l10n_util.h" #if !defined(OS_CHROMEOS) #include "chrome/browser/ui/startup/default_browser_infobar_delegate.h" #endif +#if defined(OS_MACOSX) +#include "chrome/browser/ui/startup/session_crashed_infobar_delegate.h" +#endif + +#if !defined(USE_AURA) +#include "chrome/browser/translate/chrome_translate_client.h" +#include "components/translate/core/browser/translate_infobar_delegate.h" +#include "components/translate/core/browser/translate_manager.h" +#endif + +#if BUILDFLAG(ENABLE_NACL) +#include "chrome/browser/nacl_host/nacl_infobar_delegate.h" +#endif + class InfoBarsTest : public InProcessBrowserTest { public: InfoBarsTest() {} @@ -145,6 +174,9 @@ void WaitForUserDismissal() override; private: + // Returns the active tab. + content::WebContents* GetWebContents(); + // Returns the InfoBarService associated with the active tab. InfoBarService* GetInfoBarService(); @@ -153,6 +185,7 @@ void UpdateInfoBars(); infobars::InfoBarManager::InfoBars infobars_; + infobars::InfoBarDelegate::InfoBarIdentifier desired_infobar_; DISALLOW_COPY_AND_ASSIGN(InfoBarUiTest); }; @@ -162,14 +195,111 @@ } void InfoBarUiTest::ShowUi(const std::string& name) { - // TODO(pkasting): Add other infobars, and check in VerifyUi() that the - // correct one was shown. -#if defined(OS_CHROMEOS) - ADD_FAILURE() << "This infobar is not supported on this OS."; + using IBD = infobars::InfoBarDelegate; + const base::flat_map<std::string, IBD::InfoBarIdentifier> kIdentifiers = { + {"app_banner", IBD::APP_BANNER_INFOBAR_DELEGATE}, + {"extension_dev_tools", IBD::EXTENSION_DEV_TOOLS_INFOBAR_DELEGATE}, + {"nacl", IBD::NACL_INFOBAR_DELEGATE}, + {"reload_plugin", IBD::RELOAD_PLUGIN_INFOBAR_DELEGATE}, + {"plugin_observer", IBD::PLUGIN_OBSERVER_INFOBAR_DELEGATE}, + {"file_access_disabled", IBD::FILE_ACCESS_DISABLED_INFOBAR_DELEGATE}, + {"collected_cookies", IBD::COLLECTED_COOKIES_INFOBAR_DELEGATE}, + {"alternate_nav", IBD::ALTERNATE_NAV_INFOBAR_DELEGATE}, + {"default_browser", IBD::DEFAULT_BROWSER_INFOBAR_DELEGATE}, + {"session_crashed", IBD::SESSION_CRASHED_INFOBAR_DELEGATE_MAC_IOS}, + {"page_info", IBD::PAGE_INFO_INFOBAR_DELEGATE}, + {"translate", IBD::TRANSLATE_INFOBAR_DELEGATE_NON_AURA}, + {"data_reduction_proxy_preview", + IBD::DATA_REDUCTION_PROXY_PREVIEW_INFOBAR_DELEGATE}, + {"automation", IBD::AUTOMATION_INFOBAR_DELEGATE}, + }; + auto id = kIdentifiers.find(name); + desired_infobar_ = (id == kIdentifiers.end()) ? IBD::INVALID : id->second; + + switch (desired_infobar_) { + case IBD::APP_BANNER_INFOBAR_DELEGATE: + banners::AppBannerInfoBarDelegateDesktop::Create( + GetWebContents(), nullptr, nullptr, content::Manifest()); + break; + case IBD::EXTENSION_DEV_TOOLS_INFOBAR_DELEGATE: + extensions::ExtensionDevToolsInfoBar::Create("id", "name", nullptr, + base::Closure()); + break; + case IBD::NACL_INFOBAR_DELEGATE: +#if BUILDFLAG(ENABLE_NACL) + NaClInfoBarDelegate::Create(GetInfoBarService()); #else - chrome::DefaultBrowserInfoBarDelegate::Create(GetInfoBarService(), - browser()->profile()); + ADD_FAILURE() << "This infobar is not supported when NaCl is disabled."; #endif + break; + case IBD::RELOAD_PLUGIN_INFOBAR_DELEGATE: + ReloadPluginInfoBarDelegate::Create( + GetInfoBarService(), nullptr, + l10n_util::GetStringFUTF16(IDS_PLUGIN_CRASHED_PROMPT, + base::ASCIIToUTF16("Test Plugin"))); + break; + case IBD::PLUGIN_OBSERVER_INFOBAR_DELEGATE: + PluginObserver::CreatePluginObserverInfoBar( + GetInfoBarService(), base::ASCIIToUTF16("Test Plugin")); + break; + case IBD::FILE_ACCESS_DISABLED_INFOBAR_DELEGATE: + ChromeSelectFilePolicy(GetWebContents()).SelectFileDenied(); + break; + case IBD::COLLECTED_COOKIES_INFOBAR_DELEGATE: + CollectedCookiesInfoBarDelegate::Create(GetInfoBarService()); + break; + case IBD::ALTERNATE_NAV_INFOBAR_DELEGATE: { + AutocompleteMatch match; + match.destination_url = GURL("http://intranetsite/"); + AlternateNavInfoBarDelegate::Create(GetWebContents(), base::string16(), + match, GURL("http://example.com/")); + break; + } + case IBD::DEFAULT_BROWSER_INFOBAR_DELEGATE: +#if defined(OS_CHROMEOS) + ADD_FAILURE() << "This infobar is not supported on this OS."; +#else + chrome::DefaultBrowserInfoBarDelegate::Create(GetInfoBarService(), + browser()->profile()); +#endif + break; + case IBD::SESSION_CRASHED_INFOBAR_DELEGATE_MAC_IOS: +#if defined(OS_MACOSX) + SessionCrashedInfoBarDelegate::Create(browser()); +#else + ADD_FAILURE() << "This infobar is not supported on this OS."; +#endif + break; + case IBD::PAGE_INFO_INFOBAR_DELEGATE: + PageInfoInfoBarDelegate::Create(GetInfoBarService()); + break; + case IBD::TRANSLATE_INFOBAR_DELEGATE_NON_AURA: { +#if defined(USE_AURA) + ADD_FAILURE() << "This infobar is not supported on this toolkit."; +#else + ChromeTranslateClient::CreateForWebContents(GetWebContents()); + ChromeTranslateClient* translate_client = + ChromeTranslateClient::FromWebContents(GetWebContents()); + translate::TranslateInfoBarDelegate::Create( + false, translate_client->GetTranslateManager()->GetWeakPtr(), + GetInfoBarService(), false, + translate::TRANSLATE_STEP_BEFORE_TRANSLATE, "ja", "en", + translate::TranslateErrors::NONE, false); +#endif + break; + } + case IBD::DATA_REDUCTION_PROXY_PREVIEW_INFOBAR_DELEGATE: + PreviewsInfoBarDelegate::Create( + GetWebContents(), previews::PreviewsType::LOFI, base::Time(), true, + false, PreviewsInfoBarDelegate::OnDismissPreviewsInfobarCallback(), + nullptr); + break; + case IBD::AUTOMATION_INFOBAR_DELEGATE: + AutomationInfoBarDelegate::Create(); + break; + default: + break; + } } bool InfoBarUiTest::VerifyUi() { @@ -178,8 +308,7 @@ auto added = base::STLSetDifference<infobars::InfoBarManager::InfoBars>( infobars_, old_infobars); return (added.size() == 1) && - (added[0]->delegate()->GetIdentifier() == - infobars::InfoBarDelegate::DEFAULT_BROWSER_INFOBAR_DELEGATE); + (added[0]->delegate()->GetIdentifier() == desired_infobar_); } void InfoBarUiTest::WaitForUserDismissal() { @@ -187,9 +316,12 @@ observer.WaitForRemoval(); } +content::WebContents* InfoBarUiTest::GetWebContents() { + return browser()->tab_strip_model()->GetActiveWebContents(); +} + InfoBarService* InfoBarUiTest::GetInfoBarService() { - return InfoBarService::FromWebContents( - browser()->tab_strip_model()->GetActiveWebContents()); + return InfoBarService::FromWebContents(GetWebContents()); } void InfoBarUiTest::UpdateInfoBars() { @@ -197,8 +329,66 @@ std::sort(infobars_.begin(), infobars_.end()); } +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_app_banner) { + ShowAndVerifyUi(); +} + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_extension_dev_tools) { + ShowAndVerifyUi(); +} + +#if BUILDFLAG(ENABLE_NACL) +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_nacl) { + ShowAndVerifyUi(); +} +#endif + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_reload_plugin) { + ShowAndVerifyUi(); +} + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_plugin_observer) { + ShowAndVerifyUi(); +} + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_file_access_disabled) { + ShowAndVerifyUi(); +} + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_collected_cookies) { + ShowAndVerifyUi(); +} + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_alternate_nav) { + ShowAndVerifyUi(); +} + #if !defined(OS_CHROMEOS) IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_default_browser) { ShowAndVerifyUi(); } #endif + +#if defined(OS_MACOSX) +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_session_crashed) { + ShowAndVerifyUi(); +} +#endif + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_page_info) { + ShowAndVerifyUi(); +} + +#if !defined(USE_AURA) +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_translate) { + ShowAndVerifyUi(); +} +#endif + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_data_reduction_proxy_preview) { + ShowAndVerifyUi(); +} + +IN_PROC_BROWSER_TEST_F(InfoBarUiTest, InvokeUi_automation) { + ShowAndVerifyUi(); +}
diff --git a/chrome/browser/loader/chrome_navigation_data.cc b/chrome/browser/loader/chrome_navigation_data.cc index 333cd349..af6ef04 100644 --- a/chrome/browser/loader/chrome_navigation_data.cc +++ b/chrome/browser/loader/chrome_navigation_data.cc
@@ -5,15 +5,8 @@ #include "chrome/browser/loader/chrome_navigation_data.h" #include "base/memory/ptr_util.h" -#include "base/values.h" #include "net/url_request/url_request.h" -namespace { -const char* kDataReductionProxyDataKey = "data_reduction_proxy_data"; -const char* kPreviewsUserDataKey = "preview_user_data"; -const char* kPreviewsStateKey = "preview_state"; -} // namespace - const void* const kChromeNavigationDataUserDataKey = &kChromeNavigationDataUserDataKey; @@ -22,44 +15,6 @@ ChromeNavigationData::~ChromeNavigationData() {} -base::Value ChromeNavigationData::ToValue() { - base::Value value(base::Value::Type::DICTIONARY); - if (data_reduction_proxy_data_) { - value.SetKey(kDataReductionProxyDataKey, - data_reduction_proxy_data_->ToValue()); - } - - if (previews_user_data_) { - value.SetKey(kPreviewsUserDataKey, previews_user_data_->ToValue()); - } - - value.SetKey(kPreviewsStateKey, base::Value(previews_state_)); - - return value; -} - -ChromeNavigationData::ChromeNavigationData(const base::Value& value) - : ChromeNavigationData() { - if (value.is_none()) - return; - - const base::Value* data_reduction_proxy_data = - value.FindKey(kDataReductionProxyDataKey); - if (data_reduction_proxy_data) { - data_reduction_proxy_data_ = - std::make_unique<data_reduction_proxy::DataReductionProxyData>( - *data_reduction_proxy_data); - } - - const base::Value* previews_user_data = value.FindKey(kPreviewsUserDataKey); - if (previews_user_data) { - previews_user_data_ = - std::make_unique<previews::PreviewsUserData>(*previews_user_data); - } - - previews_state_ = value.FindKey(kPreviewsStateKey)->GetInt(); -} - ChromeNavigationData* ChromeNavigationData::GetDataAndCreateIfNecessary( net::URLRequest* request) { if (!request) @@ -73,3 +28,15 @@ base::WrapUnique(data)); return data; } + +std::unique_ptr<content::NavigationData> ChromeNavigationData::Clone() const { + std::unique_ptr<ChromeNavigationData> copy(new ChromeNavigationData()); + if (data_reduction_proxy_data_) { + copy->SetDataReductionProxyData(data_reduction_proxy_data_->DeepCopy()); + } + if (previews_user_data_) { + copy->set_previews_user_data(previews_user_data_->DeepCopy()); + } + copy->previews_state_ = previews_state_; + return std::move(copy); +}
diff --git a/chrome/browser/loader/chrome_navigation_data.h b/chrome/browser/loader/chrome_navigation_data.h index 8189e386..29fe6b6e 100644 --- a/chrome/browser/loader/chrome_navigation_data.h +++ b/chrome/browser/loader/chrome_navigation_data.h
@@ -11,35 +11,24 @@ #include "base/supports_user_data.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h" #include "components/previews/core/previews_user_data.h" +#include "content/public/browser/navigation_data.h" #include "content/public/common/previews_state.h" -namespace base { -class Value; -} - namespace net { class URLRequest; } -class ChromeNavigationData : public base::SupportsUserData::Data { +class ChromeNavigationData : public content::NavigationData, + public base::SupportsUserData::Data { public: ChromeNavigationData(); ~ChromeNavigationData() override; - // Convert from/to a base::Value. - base::Value ToValue(); - - // Every time a ChromeNavigationData is constructed from a base::Value, a new - // instance of it and all of its children is built. If ChromeNavigationData - // becomes large or if many observers begin to use it, we should consider only - // deserializing the relevant part of ChromeNavigationData, not the whole - // object each time. - // Serialization is needed to transmit this object using Mojo. Another - // approach to consider would be to serialize the object before each mojo - // function call and immediatly reconstruct the object after that. Currently, - // ChromeNavigationData is serialized when it enters the content/ layer and - // reconstructed when it goes out. - explicit ChromeNavigationData(const base::Value& value); + // Creates a new ChromeNavigationData that is a deep copy of the original. Any + // changes to the original after the clone is created will not be reflected in + // the clone. + // |data_reduction_proxy_data_| is deep copied. + std::unique_ptr<content::NavigationData> Clone() const override; // Takes ownership of |data_reduction_proxy_data|. void SetDataReductionProxyData(
diff --git a/chrome/browser/loader/chrome_navigation_data_unittest.cc b/chrome/browser/loader/chrome_navigation_data_unittest.cc index 0afc3643..75f2147 100644 --- a/chrome/browser/loader/chrome_navigation_data_unittest.cc +++ b/chrome/browser/loader/chrome_navigation_data_unittest.cc
@@ -9,6 +9,7 @@ #include "base/memory/ptr_util.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h" #include "components/previews/core/previews_user_data.h" +#include "content/public/browser/navigation_data.h" #include "testing/gtest/include/gtest/gtest.h" class ChromeNavigationDataTest : public testing::Test { @@ -32,39 +33,24 @@ EXPECT_TRUE(data.previews_user_data()); } -TEST_F(ChromeNavigationDataTest, Serialization) { - // data_reduction_proxy - { - ChromeNavigationData chrome_navigation_data; - ChromeNavigationData clone_a(chrome_navigation_data.ToValue()); - chrome_navigation_data.SetDataReductionProxyData( - std::make_unique<data_reduction_proxy::DataReductionProxyData>()); - ChromeNavigationData clone_b(chrome_navigation_data.ToValue()); +TEST_F(ChromeNavigationDataTest, Clone) { + ChromeNavigationData data; + EXPECT_FALSE(data.GetDataReductionProxyData()); + data.SetDataReductionProxyData( + std::make_unique<data_reduction_proxy::DataReductionProxyData>()); + EXPECT_FALSE(data.previews_user_data()); + data.set_previews_user_data(std::make_unique<previews::PreviewsUserData>(1u)); - EXPECT_FALSE(clone_a.GetDataReductionProxyData()); - EXPECT_TRUE(clone_b.GetDataReductionProxyData()); - } - - // preview_user_data - { - ChromeNavigationData chrome_navigation_data; - ChromeNavigationData clone_a(chrome_navigation_data.ToValue()); - chrome_navigation_data.set_previews_user_data( - std::make_unique<previews::PreviewsUserData>(1u)); - ChromeNavigationData clone_b(chrome_navigation_data.ToValue()); - - EXPECT_FALSE(clone_a.previews_user_data()); - EXPECT_TRUE(clone_b.previews_user_data()); - } - - // preview_state - { - ChromeNavigationData chrome_navigation_data; - ChromeNavigationData clone_a(chrome_navigation_data.ToValue()); - chrome_navigation_data.set_previews_state(content::PREVIEWS_OFF); - ChromeNavigationData clone_b(chrome_navigation_data.ToValue()); - - EXPECT_EQ(content::PREVIEWS_UNSPECIFIED, clone_a.previews_state()); - EXPECT_EQ(content::PREVIEWS_OFF, clone_b.previews_state()); - } + std::unique_ptr<content::NavigationData> clone_data = data.Clone(); + ChromeNavigationData* clone_chrome_data = + static_cast<ChromeNavigationData*>(clone_data.get()); + EXPECT_NE(&data, clone_data.get()); + EXPECT_NE(&data, clone_chrome_data); + EXPECT_NE(data.GetDataReductionProxyData(), + clone_chrome_data->GetDataReductionProxyData()); + EXPECT_NE(data.previews_user_data(), clone_chrome_data->previews_user_data()); + EXPECT_TRUE(data.GetDataReductionProxyData()); + EXPECT_TRUE(data.previews_user_data()); + EXPECT_TRUE(clone_chrome_data->GetDataReductionProxyData()); + EXPECT_TRUE(clone_chrome_data->previews_user_data()); }
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc index 3a940542..3d6fbcf 100644 --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc
@@ -16,7 +16,6 @@ #include "base/metrics/field_trial.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" -#include "base/values.h" #include "build/build_config.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" @@ -65,6 +64,7 @@ #include "components/previews/core/previews_user_data.h" #include "components/variations/net/variations_http_headers.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/notification_service.h" #include "content/public/browser/plugin_service.h" #include "content/public/browser/plugin_service_filter.h" @@ -791,10 +791,11 @@ // Update the PreviewsState for main frame response if needed. if (info->GetResourceType() == content::RESOURCE_TYPE_MAIN_FRAME && request->url().SchemeIsHTTPOrHTTPS()) { - content::PreviewsState committed_state = - DetermineCommittedPreviews(request, response->head.previews_state); + content::PreviewsState committed_state = DetermineCommittedPreviews( + request, + static_cast<content::PreviewsState>(response->head.previews_state)); // Update previews state in response to renderer. - response->head.previews_state = committed_state; + response->head.previews_state = static_cast<int>(committed_state); // Update previews state in nav data to UI. ChromeNavigationData* data = ChromeNavigationData::GetDataAndCreateIfNecessary(request); @@ -951,33 +952,29 @@ g_external_protocol_handler_delegate = delegate; } -base::Value ChromeResourceDispatcherHostDelegate::GetNavigationData( - net::URLRequest* request) { - if (!request) - return base::Value(); - - ChromeNavigationData* chrome_navigation_data = +content::NavigationData* +ChromeResourceDispatcherHostDelegate::GetNavigationData( + net::URLRequest* request) const { + ChromeNavigationData* data = ChromeNavigationData::GetDataAndCreateIfNecessary(request); + if (!request) + return data; data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data = data_reduction_proxy::DataReductionProxyData::GetData(*request); // DeepCopy the DataReductionProxyData from the URLRequest to prevent the // URLRequest and DataReductionProxyData from both having ownership of the - // same object. This copy will be shortlived as it will be deleted at the end - // of this function in ChromeNavigationData's destructor. - if (data_reduction_proxy_data) { - chrome_navigation_data->SetDataReductionProxyData( - data_reduction_proxy_data->DeepCopy()); - } + // same object. This copy will be shortlived as it will be deep copied again + // when content makes a clone of NavigationData for the UI thread. + if (data_reduction_proxy_data) + data->SetDataReductionProxyData(data_reduction_proxy_data->DeepCopy()); previews::PreviewsUserData* previews_user_data = previews::PreviewsUserData::GetData(*request); - if (previews_user_data) { - chrome_navigation_data->set_previews_user_data( - previews_user_data->DeepCopy()); - } + if (previews_user_data) + data->set_previews_user_data(previews_user_data->DeepCopy()); - return chrome_navigation_data->ToValue(); + return data; } std::unique_ptr<net::ClientCertStore>
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h index 7127fa2ce..ea44ecd8 100644 --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h
@@ -20,6 +20,10 @@ class DownloadRequestLimiter; +namespace content { +class NavigationData; +} + namespace extensions { class UserScriptListener; } @@ -84,7 +88,8 @@ net::URLRequest* url_request, content::ResourceContext* resource_context, content::PreviewsState previews_to_allow) override; - base::Value GetNavigationData(net::URLRequest* request) override; + content::NavigationData* GetNavigationData( + net::URLRequest* request) const override; std::unique_ptr<net::ClientCertStore> CreateClientCertStore( content::ResourceContext* resource_context) override;
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate_browsertest.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate_browsertest.cc index c6de38ad..03be7dc 100644 --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate_browsertest.cc +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate_browsertest.cc
@@ -22,7 +22,6 @@ #include "base/stl_util.h" #include "base/strings/string_util.h" #include "base/test/scoped_command_line.h" -#include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/download/download_browsertest.h" #include "chrome/browser/loader/chrome_navigation_data.h" @@ -46,6 +45,7 @@ #include "components/signin/core/browser/signin_pref_names.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/resource_dispatcher_host.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" @@ -125,7 +125,8 @@ request_headers_.MergeFrom(request->extra_request_headers()); } - base::Value GetNavigationData(net::URLRequest* request) override { + content::NavigationData* GetNavigationData( + net::URLRequest* request) const override { if (request && should_add_data_reduction_proxy_data_) { data_reduction_proxy::DataReductionProxyData* data = data_reduction_proxy::DataReductionProxyData:: @@ -173,8 +174,8 @@ DISALLOW_COPY_AND_ASSIGN(TestDispatcherHostDelegate); }; -// Helper class to track DidFinishNavigation and verify that the navigation_data -// is added to NavigationHandle and pause/resume execution of the test. +// Helper class to track DidFinishNavigation and verify that NavigationData is +// added to NavigationHandle and pause/resume execution of the test. class DidFinishNavigationObserver : public content::WebContentsObserver { public: DidFinishNavigationObserver(content::WebContents* web_contents, @@ -185,14 +186,14 @@ void DidFinishNavigation( content::NavigationHandle* navigation_handle) override { - const base::Value& navigation_data = navigation_handle->GetNavigationData(); - ChromeNavigationData chrome_navigation_data(navigation_data); + ChromeNavigationData* data = static_cast<ChromeNavigationData*>( + navigation_handle->GetNavigationData()); if (add_data_reduction_proxy_data_) { - EXPECT_TRUE(chrome_navigation_data.GetDataReductionProxyData()); - EXPECT_TRUE(chrome_navigation_data.GetDataReductionProxyData() - ->used_data_reduction_proxy()); + EXPECT_TRUE(data->GetDataReductionProxyData()); + EXPECT_TRUE( + data->GetDataReductionProxyData()->used_data_reduction_proxy()); } else { - EXPECT_FALSE(chrome_navigation_data.GetDataReductionProxyData()); + EXPECT_FALSE(data->GetDataReductionProxyData()); } }
diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate_unittest.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate_unittest.cc index 963889d..11887380 100644 --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate_unittest.cc +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate_unittest.cc
@@ -6,12 +6,12 @@ #include <memory> -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/loader/chrome_resource_dispatcher_host_delegate.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h" +#include "content/public/browser/navigation_data.h" #include "content/public/test/test_browser_thread_bundle.h" #include "net/base/request_priority.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" @@ -55,18 +55,20 @@ data_reduction_proxy::DataReductionProxyData::GetDataAndCreateIfNecessary( fake_request.get()); data_reduction_proxy_data->set_used_data_reduction_proxy(true); - - // Take it back from the ResourceDispatcherHostDelegate. std::unique_ptr<ChromeResourceDispatcherHostDelegate> delegate = std::make_unique<ChromeResourceDispatcherHostDelegate>(); - base::Value navigation_data = delegate->GetNavigationData(fake_request.get()); - EXPECT_FALSE(navigation_data.is_none()); - ChromeNavigationData chrome_navigation_data(navigation_data); - - // Make sure DataReductionProxyData was copied. + ChromeNavigationData* chrome_navigation_data = + static_cast<ChromeNavigationData*>( + delegate->GetNavigationData(fake_request.get())); data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data_copy = - chrome_navigation_data.GetDataReductionProxyData(); + chrome_navigation_data->GetDataReductionProxyData(); + // The DataReductionProxyData should be a copy of the one on URLRequest + EXPECT_NE(data_reduction_proxy_data_copy, data_reduction_proxy_data); + // Make sure DataReductionProxyData was copied. EXPECT_TRUE(data_reduction_proxy_data_copy->used_data_reduction_proxy()); + EXPECT_EQ( + chrome_navigation_data, + ChromeNavigationData::GetDataAndCreateIfNecessary(fake_request.get())); } TEST_F(ChromeResourceDispatcherHostDelegateTest, @@ -78,10 +80,10 @@ nullptr, TRAFFIC_ANNOTATION_FOR_TESTS)); std::unique_ptr<ChromeResourceDispatcherHostDelegate> delegate = std::make_unique<ChromeResourceDispatcherHostDelegate>(); - base::Value navigation_data = delegate->GetNavigationData(fake_request.get()); - EXPECT_FALSE(navigation_data.is_none()); - ChromeNavigationData chrome_navigation_data(navigation_data); - EXPECT_FALSE(chrome_navigation_data.GetDataReductionProxyData()); + ChromeNavigationData* chrome_navigation_data = + static_cast<ChromeNavigationData*>( + delegate->GetNavigationData(fake_request.get())); + EXPECT_FALSE(chrome_navigation_data->GetDataReductionProxyData()); } TEST_F(ChromeResourceDispatcherHostDelegateTest,
diff --git a/chrome/browser/mac/exception_processor_unittest.mm b/chrome/browser/mac/exception_processor_unittest.mm index 78f570b..a0aa908 100644 --- a/chrome/browser/mac/exception_processor_unittest.mm +++ b/chrome/browser/mac/exception_processor_unittest.mm
@@ -47,10 +47,6 @@ } TEST(ExceptionProcessorTest, RecordException) { - // Start up a histogram recorder. - // TODO(rtenneti): Leaks StatisticsRecorder and will update suppressions. - base::StatisticsRecorder::Initialize(); - StatisticsRecorder::Histograms histograms; StatisticsRecorder::GetSnapshot("OSX.NSException", &histograms); EXPECT_EQ(0U, histograms.size());
diff --git a/chrome/browser/mash_service_registry.cc b/chrome/browser/mash_service_registry.cc index 858aee8d..b31379db 100644 --- a/chrome/browser/mash_service_registry.cc +++ b/chrome/browser/mash_service_registry.cc
@@ -57,6 +57,17 @@ return false; } +std::string GetMashServiceLabel(const std::string& service_name) { + for (const Service& service : kServices) { + if (service_name == service.name) { + // Use the process group name when available because that makes it more + // obvious that multiple services are running in the same process. + return service.process_group ? service.process_group : service.name; + } + } + return std::string(); +} + bool ShouldTerminateOnServiceQuit(const std::string& name) { // Some services going down are treated as catastrophic failures, usually // because both the browser and the service cache data about each other's
diff --git a/chrome/browser/mash_service_registry.h b/chrome/browser/mash_service_registry.h index a4848c25..45220236 100644 --- a/chrome/browser/mash_service_registry.h +++ b/chrome/browser/mash_service_registry.h
@@ -21,6 +21,11 @@ // Returns true if |name| identifies a mash related service. bool IsMashServiceName(const std::string& name); +// If |service_name| identifies a mash related service returns an arbitrary +// label that identifies the service or group of related services. Otherwise +// returns the empty string. +std::string GetMashServiceLabel(const std::string& service_name); + // Returns true if the browser should exit when service |name| quits. bool ShouldTerminateOnServiceQuit(const std::string& name);
diff --git a/chrome/browser/media/cast_remoting_sender.cc b/chrome/browser/media/cast_remoting_sender.cc index 170a097..b2327b4 100644 --- a/chrome/browser/media/cast_remoting_sender.cc +++ b/chrome/browser/media/cast_remoting_sender.cc
@@ -20,6 +20,7 @@ #include "content/public/browser/browser_thread.h" #include "media/base/bind_to_current_loop.h" #include "media/cast/constants.h" +#include "media/mojo/common/mojo_data_pipe_read_write.h" using content::BrowserThread; @@ -92,7 +93,7 @@ latest_acked_frame_id_(media::cast::FrameId::first() - 1), duplicate_ack_counter_(0), input_queue_discards_remaining_(0), - pipe_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::MANUAL), + is_reading_(false), flow_restart_pending_(true), weak_factory_(this) { // Confirm this constructor is running on the IO BrowserThread. @@ -165,12 +166,8 @@ DCHECK(sender->error_callback_.is_null()); sender->error_callback_ = error_callback; - sender->pipe_ = std::move(pipe); - sender->pipe_watcher_.Watch(sender->pipe_.get(), - MOJO_HANDLE_SIGNAL_NEW_DATA_READABLE, - base::Bind(&CastRemotingSender::ProcessInputQueue, - base::Unretained(sender))); - sender->pipe_watcher_.ArmOrNotify(); + sender->data_pipe_reader_ = + base::MakeUnique<media::MojoDataPipeReader>(std::move(pipe)); sender->binding_.Bind(std::move(request)); sender->binding_.set_connection_error_handler(sender->error_callback_); } @@ -325,111 +322,96 @@ // One or more frames were canceled. This may allow pending input operations // to complete. - ProcessInputQueue(MOJO_RESULT_OK); + ProcessNextInputTask(); } } -void CastRemotingSender::ConsumeDataChunk(uint32_t offset, uint32_t size, - uint32_t total_payload_size) { +void CastRemotingSender::SendFrame(uint32_t frame_size) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - input_queue_.push( - base::Bind(&CastRemotingSender::TryConsumeDataChunk, - base::Unretained(this), offset, size, total_payload_size)); - ProcessInputQueue(MOJO_RESULT_OK); + const bool need_to_start_processing = input_queue_.empty(); + input_queue_.push(base::BindRepeating(&CastRemotingSender::ReadFrame, + base::Unretained(this), frame_size)); + input_queue_.push(base::BindRepeating(&CastRemotingSender::TrySendFrame, + base::Unretained(this))); + if (need_to_start_processing) + ProcessNextInputTask(); } -void CastRemotingSender::SendFrame() { +void CastRemotingSender::ProcessNextInputTask() { DCHECK_CURRENTLY_ON(BrowserThread::IO); - input_queue_.push( - base::Bind(&CastRemotingSender::TrySendFrame, base::Unretained(this))); - ProcessInputQueue(MOJO_RESULT_OK); + if (input_queue_.empty() || is_reading_) + return; + + input_queue_.front().Run(); } -void CastRemotingSender::ProcessInputQueue(MojoResult result) { +void CastRemotingSender::OnInputTaskComplete() { DCHECK_CURRENTLY_ON(BrowserThread::IO); - while (!input_queue_.empty()) { - if (!input_queue_.front().Run(input_queue_discards_remaining_ > 0)) - break; // Operation must be retried later. Stop processing queue. - input_queue_.pop(); - if (input_queue_discards_remaining_ > 0) - --input_queue_discards_remaining_; + DCHECK(!input_queue_.empty()); + input_queue_.pop(); + if (input_queue_discards_remaining_ > 0) + --input_queue_discards_remaining_; + + // Always force a post task to prevent the stack from growing too deep. + base::ThreadTaskRunnerHandle::Get()->PostTask( + FROM_HERE, base::BindOnce(&CastRemotingSender::ProcessNextInputTask, + base::Unretained(this))); +} + +void CastRemotingSender::ReadFrame(uint32_t size) { + DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(!is_reading_); + if (!data_pipe_reader_->IsPipeValid()) { + VLOG(1) << SENDER_SSRC << "Data pipe handle no longer valid."; + OnPipeError(); + return; + } + + is_reading_ = true; + if (input_queue_discards_remaining_ > 0) { + data_pipe_reader_->Read(nullptr, size, + base::BindOnce(&CastRemotingSender::OnFrameRead, + base::Unretained(this))); + } else { + next_frame_data_.resize(size); + data_pipe_reader_->Read( + reinterpret_cast<uint8_t*>(base::string_as_array(&next_frame_data_)), + size, + base::BindOnce(&CastRemotingSender::OnFrameRead, + base::Unretained(this))); } } -bool CastRemotingSender::TryConsumeDataChunk(uint32_t offset, uint32_t size, - uint32_t total_payload_size, - bool discard_data) { +void CastRemotingSender::OnFrameRead(bool success) { DCHECK_CURRENTLY_ON(BrowserThread::IO); + DCHECK(is_reading_); + is_reading_ = false; + if (!success) { + OnPipeError(); + return; + } + OnInputTaskComplete(); +} - do { - if (!pipe_.is_valid()) { - VLOG(1) << SENDER_SSRC << "Data pipe handle no longer valid."; - break; - } - - if (offset + size > total_payload_size) { - LOG(ERROR) - << SENDER_SSRC << "BUG: offset + size > total_payload_size (" - << offset << " + " << size << " > " << total_payload_size << ')'; - break; - } - - // If the data is to be discarded, do a data pipe read with the DISCARD flag - // set. - if (discard_data) { - const MojoResult result = pipe_->ReadData( - nullptr, &size, - MOJO_READ_DATA_FLAG_DISCARD | MOJO_READ_DATA_FLAG_ALL_OR_NONE); - if (result == MOJO_RESULT_OK) - return true; // Successfully discarded data. - if (result == MOJO_RESULT_OUT_OF_RANGE) { - pipe_watcher_.ArmOrNotify(); - return false; // Retry later. - } - LOG(ERROR) << SENDER_SSRC - << "Unexpected result when discarding from data pipe (" - << result << ')'; - break; - } - - // If |total_payload_size| has changed, resize the data string. If it has - // not changed, the following statement will be a no-op. - next_frame_data_.resize(total_payload_size); - - const MojoResult result = - pipe_->ReadData(base::string_as_array(&next_frame_data_) + offset, - &size, MOJO_READ_DATA_FLAG_ALL_OR_NONE); - if (result == MOJO_RESULT_OK) - return true; // Successfully consumed data. - if (result == MOJO_RESULT_OUT_OF_RANGE) { - pipe_watcher_.ArmOrNotify(); - return false; // Retry later. - } - LOG(ERROR) - << SENDER_SSRC << "Read from data pipe failed (" << result << ')'; - } while (false); - - // If this point is reached, there was a fatal error. Shut things down and run - // the error callback. - pipe_watcher_.Cancel(); - pipe_.reset(); +void CastRemotingSender::OnPipeError() { + data_pipe_reader_.reset(); binding_.Close(); error_callback_.Run(); - return true; } -bool CastRemotingSender::TrySendFrame(bool discard_data) { +void CastRemotingSender::TrySendFrame() { DCHECK_CURRENTLY_ON(BrowserThread::IO); - - // If the frame's data is to be discarded, just return immediately. - if (discard_data) - return true; + DCHECK(!is_reading_); + if (input_queue_discards_remaining_ > 0) { + OnInputTaskComplete(); + return; + } // If there would be too many frames in-flight, do not proceed. if (NumberOfFramesInFlight() >= media::cast::kMaxUnackedFrames) { VLOG(1) << SENDER_SSRC << "Cannot send frame now because too many frames are in flight."; - return false; + return; } VLOG(2) << SENDER_SSRC @@ -506,14 +488,12 @@ if (is_first_frame_to_be_sent) ScheduleNextRtcpReport(); - return true; + OnInputTaskComplete(); } void CastRemotingSender::CancelInFlightData() { DCHECK_CURRENTLY_ON(BrowserThread::IO); - base::STLClearObject(&next_frame_data_); - // TODO(miu): The following code is something we want to do as an // optimization. However, as-is, it's not quite correct. We can only cancel // frames where no packets have actually hit the network yet. Said another
diff --git a/chrome/browser/media/cast_remoting_sender.h b/chrome/browser/media/cast_remoting_sender.h index c6f49dd..4e2ae1a 100644 --- a/chrome/browser/media/cast_remoting_sender.h +++ b/chrome/browser/media/cast_remoting_sender.h
@@ -14,7 +14,10 @@ #include "media/cast/net/rtcp/rtcp_defines.h" #include "media/mojo/interfaces/remoting.mojom.h" #include "mojo/public/cpp/bindings/binding.h" -#include "mojo/public/cpp/system/simple_watcher.h" + +namespace media { +class MojoDataPipeReader; +} // namespace media namespace cast { @@ -70,28 +73,30 @@ class RemotingRtcpClient; - // media::mojom::RemotingDataStreamSender implementation. ConsumeDataChunk() - // and SendFrame() will push callbacks onto the back of the input queue, and - // these may or may not be processed at a later time. It depends on whether - // the data pipe has data available or the CastTransport can accept more - // frames. CancelInFlightData() is processed immediately, and will cause all - // pending operations to discard data when they are processed later. - void ConsumeDataChunk(uint32_t offset, uint32_t size, - uint32_t total_payload_size) final; - void SendFrame() final; + // media::mojom::RemotingDataStreamSender implementation. SendFrame() will + // push callbacks onto the back of the input queue, and these may or may not + // be processed at a later time. It depends on whether the data pipe has data + // available or the CastTransport can accept more frames. CancelInFlightData() + // is processed immediately, and will cause all pending operations to discard + // data when they are processed later. + void SendFrame(uint32_t frame_size) final; void CancelInFlightData() final; - // Attempt to run each pending input operation, popping the head of the input - // queue as each operation succeeds. |result| is the result code provided by - // the |pipe_watcher_|. - void ProcessInputQueue(MojoResult result); + // Attempt to run next pending input task, popping the head of the input queue + // as each task succeeds. + void ProcessNextInputTask(); - // These are called via callbacks run from the input queue. They return false - // to indicate a retry attempt should be made later, either after the data - // pipe has more data or the CastTransport can accept another frame. - bool TryConsumeDataChunk(uint32_t offset, uint32_t size, - uint32_t total_payload_size, bool discard_data); - bool TrySendFrame(bool discard_data); + // These are called via callbacks run from the input queue. + // Consumes a frame of |size| from the associated Mojo data pipe. + void ReadFrame(uint32_t size); + // Sends out the frame to the receiver over network. + void TrySendFrame(); + + // Called when a frame is completely read/discarded from the data pipe. + void OnFrameRead(bool success); + + // Called when an input task completes. + void OnInputTaskComplete(); // These are called to deliver RTCP feedback from the receiver. void OnReceivedCastMessage(const media::cast::RtcpCastMessage& cast_feedback); @@ -127,6 +132,8 @@ void ScheduleNextRtcpReport(); void SendRtcpReport(); + void OnPipeError(); + // Unique identifier for the RTP stream and this CastRemotingSender. const int32_t rtp_stream_id_; @@ -150,8 +157,7 @@ // Callback that is run to notify when a fatal error occurs. base::Closure error_callback_; - // Mojo data pipe from which to consume data. - mojo::ScopedDataPipeConsumerHandle pipe_; + std::unique_ptr<media::MojoDataPipeReader> data_pipe_reader_; // Mojo binding for this instance. Implementation at the other end of the // message pipe uses the RemotingDataStreamSender interface to control when @@ -183,8 +189,8 @@ // The most recently measured round trip time. base::TimeDelta current_round_trip_time_; - // The next frame's payload data. Populated by one or more calls to - // ConsumeDataChunk(). + // The next frame's payload data. Populated by call to OnFrameRead() when + // reading succeeded. std::string next_frame_data_; // Ring buffer to keep track of recent frame RTP timestamps. This should @@ -195,12 +201,11 @@ // Queue of pending input operations. |input_queue_discards_remaining_| // indicates the number of operations where data should be discarded (due to // CancelInFlightData()). - base::queue<base::Callback<bool(bool)>> input_queue_; + base::queue<base::RepeatingClosure> input_queue_; size_t input_queue_discards_remaining_; - // Watches |pipe_| for more data to become available, and then calls - // ProcessInputQueue(). - mojo::SimpleWatcher pipe_watcher_; + // Indicates whether the |data_pipe_reader_| is processing a reading request. + bool is_reading_; // Set to true if the first frame has not yet been sent, or if a // CancelInFlightData() operation just completed. This causes TrySendFrame()
diff --git a/chrome/browser/media/cast_remoting_sender_unittest.cc b/chrome/browser/media/cast_remoting_sender_unittest.cc index acd9b59..2aa445a4 100644 --- a/chrome/browser/media/cast_remoting_sender_unittest.cc +++ b/chrome/browser/media/cast_remoting_sender_unittest.cc
@@ -178,14 +178,7 @@ MOJO_RESULT_OK; } - void PostMojoCallTask_ConsumeDataChunk(size_t offset, size_t size, - size_t total_payload_size) { - sender_->ConsumeDataChunk(offset, size, total_payload_size); - } - - void PostMojoCallTask_SendFrame() { - sender_->SendFrame(); - } + void PostMojoCallTask_SendFrame(uint32_t size) { sender_->SendFrame(size); } void PostMojoCallTask_CancelInFlightData() { sender_->CancelInFlightData(); } @@ -283,19 +276,17 @@ TEST_F(CastRemotingSenderTest, SendsFramesViaMojoInterface) { // One 256-byte chunk pushed through the data pipe to make one frame. ASSERT_TRUE(ProduceDataChunk(0, 256)); - PostMojoCallTask_ConsumeDataChunk(0, 256, 256); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(256); RunPendingTasks(); EXPECT_TRUE(ExpectOneFrameWasSent(256)); AckOldestInFlightFrames(1); EXPECT_EQ(media::cast::FrameId::first(), latest_acked_frame_id()); // Four 256-byte chunks pushed through the data pipe to make one frame. + PostMojoCallTask_SendFrame(1024); for (int i = 0; i < 4; ++i) { ASSERT_TRUE(ProduceDataChunk(i * 256, 256)); - PostMojoCallTask_ConsumeDataChunk(i * 256, 256, 1024); } - PostMojoCallTask_SendFrame(); RunPendingTasks(); EXPECT_TRUE(ExpectOneFrameWasSent(1024)); AckOldestInFlightFrames(1); @@ -303,15 +294,14 @@ // 10 differently-sized chunks pushed through the data pipe to make one frame // that is larger than the data pipe's total capacity. + PostMojoCallTask_SendFrame(6665); size_t offset = 0; for (int i = 0; i < 10; ++i) { const size_t chunk_size = 500 + i * 37; ASSERT_TRUE(ProduceDataChunk(offset, chunk_size)); - PostMojoCallTask_ConsumeDataChunk(offset, chunk_size, 6665); RunPendingTasks(); offset += chunk_size; } - PostMojoCallTask_SendFrame(); RunPendingTasks(); EXPECT_TRUE(ExpectOneFrameWasSent(6665)); AckOldestInFlightFrames(1); @@ -322,8 +312,7 @@ // Send 4 frames. for (int i = 0; i < 4; ++i) { ASSERT_TRUE(ProduceDataChunk(0, 16)); - PostMojoCallTask_ConsumeDataChunk(0, 16, 16); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(16); } RunPendingTasks(); EXPECT_EQ(4, NumberOfFramesInFlight()); @@ -348,8 +337,7 @@ // Send first frame and don't Ack it. Expect the first frame to be // kickstarted. ASSERT_TRUE(ProduceDataChunk(0, 16)); - PostMojoCallTask_ConsumeDataChunk(0, 16, 16); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(16); EXPECT_EQ(media::cast::FrameId::first(), WaitForKickstart()); EXPECT_EQ(1, NumberOfFramesInFlight()); @@ -357,8 +345,7 @@ // kickstarted. for (int i = 0; i < 3; ++i) { ASSERT_TRUE(ProduceDataChunk(0, 16)); - PostMojoCallTask_ConsumeDataChunk(0, 16, 16); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(16); } EXPECT_EQ(media::cast::FrameId::first() + 3, WaitForKickstart()); EXPECT_EQ(4, NumberOfFramesInFlight()); @@ -374,14 +361,21 @@ } TEST_F(CastRemotingSenderTest, CancelsUnsentFrame) { + PostMojoCallTask_SendFrame(16); + PostMojoCallTask_SendFrame(32); + PostMojoCallTask_CancelInFlightData(); EXPECT_EQ(0u, GetSizeOfNextFrameData()); ASSERT_TRUE(ProduceDataChunk(0, 16)); - PostMojoCallTask_ConsumeDataChunk(0, 16, 16); RunPendingTasks(); + // The first frame's data should have been read from the data pipe. EXPECT_EQ(16u, GetSizeOfNextFrameData()); - PostMojoCallTask_CancelInFlightData(); + EXPECT_EQ(0, NumberOfFramesInFlight()); + ASSERT_TRUE(ProduceDataChunk(0, 32)); RunPendingTasks(); - EXPECT_EQ(0u, GetSizeOfNextFrameData()); + // The |next_frame_data_| was not updated because the second frame data was + // discarded from the data pipe. + EXPECT_EQ(16u, GetSizeOfNextFrameData()); + EXPECT_EQ(0, NumberOfFramesInFlight()); // Since no frames were sent, none should have been passed to the // CastTransport, and none should have been canceled. @@ -399,8 +393,7 @@ // Send 10 frames. for (int i = 0; i < 10; ++i) { ASSERT_TRUE(ProduceDataChunk(0, 16)); - PostMojoCallTask_ConsumeDataChunk(0, 16, 16); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(16); } RunPendingTasks(); EXPECT_FALSE(IsFlowRestartPending()); @@ -424,8 +417,7 @@ // Send one more frame and ack it. ASSERT_TRUE(ProduceDataChunk(0, 16)); - PostMojoCallTask_ConsumeDataChunk(0, 16, 16); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(16); RunPendingTasks(); EXPECT_FALSE(IsFlowRestartPending()); EXPECT_EQ(1, NumberOfFramesInFlight()); @@ -448,12 +440,10 @@ } TEST_F(CastRemotingSenderTest, WaitsForDataBeforeConsumingFromDataPipe) { - // Queue up and issue Mojo calls to consume data chunks and send three - // frames. Since no data has been pushed into the pipe yet no frames should be - // sent. + // Queue up and issue Mojo calls to consume three frames. Since no data has + // been pushed into the pipe yet no frames should be sent. for (int i = 0; i < 3; ++i) { - PostMojoCallTask_ConsumeDataChunk(0, 4, 4); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(4); } RunPendingTasks(); EXPECT_TRUE(IsFlowRestartPending()); @@ -480,8 +470,7 @@ // frames. Since no data has been pushed into the pipe yet no frames should be // sent. for (int i = 0; i < 3; ++i) { - PostMojoCallTask_ConsumeDataChunk(0, 4, 4); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(4); } RunPendingTasks(); EXPECT_EQ(0, NumberOfFramesInFlight()); @@ -506,8 +495,7 @@ // Now issue calls to send another frame and then push the data for it into // the data pipe. Expect to see the frame gets sent since it was provided // after the CancelInFlightData(). - PostMojoCallTask_ConsumeDataChunk(0, 4, 4); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(4); RunPendingTasks(); EXPECT_EQ(0, NumberOfFramesInFlight()); ASSERT_TRUE(ProduceDataChunk(0, 4)); @@ -518,12 +506,11 @@ TEST_F(CastRemotingSenderTest, StopsConsumingWhileTooManyFramesAreInFlight) { EXPECT_TRUE(IsFlowRestartPending()); - // Send out a the maximum possible number of unacked frames, but don't ack any + // Send out the maximum possible number of unacked frames, but don't ack any // yet. for (int i = 0; i < media::cast::kMaxUnackedFrames; ++i) { ASSERT_TRUE(ProduceDataChunk(0, 4)); - PostMojoCallTask_ConsumeDataChunk(0, 4, 4); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(4); } RunPendingTasks(); EXPECT_FALSE(IsFlowRestartPending()); @@ -536,8 +523,7 @@ // queuing input operations instead of sending the the frame to the // CastTransport. ASSERT_TRUE(ProduceDataChunk(0, 4)); - PostMojoCallTask_ConsumeDataChunk(0, 4, 4); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(4); RunPendingTasks(); EXPECT_EQ(media::cast::kMaxUnackedFrames, NumberOfFramesInFlight()); // Note: The unsent frame resides in CastRemotingSender's single-frame data @@ -555,8 +541,7 @@ // Attempting to send another frame will once again cause CastRemotingSender // to queue input operations. ASSERT_TRUE(ProduceDataChunk(0, 4)); - PostMojoCallTask_ConsumeDataChunk(0, 4, 4); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(4); RunPendingTasks(); EXPECT_EQ(media::cast::kMaxUnackedFrames, NumberOfFramesInFlight()); // Note: Once again, CastRemotingSender's single-frame data buffer contains an @@ -570,8 +555,7 @@ int num_frames_in_data_pipe = 0; while (ProduceDataChunk(0, 768)) { ++num_frames_in_data_pipe; - PostMojoCallTask_ConsumeDataChunk(0, 768, 768); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(768); RunPendingTasks(); EXPECT_EQ(media::cast::kMaxUnackedFrames, NumberOfFramesInFlight()); // Note: CastRemotingSender's single-frame data buffer should still contain @@ -585,6 +569,7 @@ int remaining_frames_in_data_pipe = num_frames_in_data_pipe; while (remaining_frames_in_data_pipe > 0) { AckOldestInFlightFrames(1); + RunPendingTasks(); --remaining_frames_in_data_pipe; EXPECT_EQ(media::cast::kMaxUnackedFrames, NumberOfFramesInFlight()); EXPECT_EQ(768u, GetSizeOfNextFrameData()); @@ -603,8 +588,7 @@ EXPECT_EQ(1, NumberOfFramesInFlight()); // ..and one more frame can be sent immediately. ASSERT_TRUE(ProduceDataChunk(0, 4)); - PostMojoCallTask_ConsumeDataChunk(0, 4, 4); - PostMojoCallTask_SendFrame(); + PostMojoCallTask_SendFrame(4); RunPendingTasks(); EXPECT_EQ(2, NumberOfFramesInFlight()); // ...and ack these last two frames.
diff --git a/chrome/browser/media/encrypted_media_browsertest.cc b/chrome/browser/media/encrypted_media_browsertest.cc index 687bf90..02fd2274 100644 --- a/chrome/browser/media/encrypted_media_browsertest.cc +++ b/chrome/browser/media/encrypted_media_browsertest.cc
@@ -52,8 +52,8 @@ // - media/test/data/eme_player_js/player_utils.js // - AddExternalClearKey() in chrome_key_systems.cc // - CreateCdmInstance() in clear_key_cdm.cc -const char kExternalClearKeyRenewalKeySystem[] = - "org.chromium.externalclearkey.renewal"; +const char kExternalClearKeyMessageTypeTestKeySystem[] = + "org.chromium.externalclearkey.messagetypetest"; const char kExternalClearKeyFileIOTestKeySystem[] = "org.chromium.externalclearkey.fileiotest"; const char kExternalClearKeyInitializeFailKeySystem[] = @@ -399,6 +399,8 @@ public: // We use special |key_system| names to do non-playback related tests, // e.g. kExternalClearKeyFileIOTestKeySystem is used to test file IO. + // TODO(xhwang): Deduplicate EncryptedMediaTestExperimentalCdmInterface and + // ECKEncryptedMediaTest. void TestNonPlaybackCases(const std::string& key_system, const std::string& expected_title) { // Since we do not test playback, arbitrarily choose a test file and source @@ -409,6 +411,15 @@ expected_title); } + void TestPlaybackCase(const std::string& key_system, + const std::string& session_to_load, + const std::string& expected_title) { + RunEncryptedMediaTest(kDefaultEmePlayer, "bear-320x240-v_enc-v.webm", + kWebMVP8VideoOnly, key_system, SrcType::MSE, + session_to_load, false, PlayCount::ONCE, + expected_title); + } + protected: void SetUpCommandLine(base::CommandLine* command_line) override { EncryptedMediaTestBase::SetUpCommandLine(command_line); @@ -810,22 +821,23 @@ #if defined(OS_LINUX) && defined(ADDRESS_SANITIZER) // Flaky with ASan enabled: crbug.com/798563. -#define MAYBE_Renewal DISABLED_Renewal +#define MAYBE_MessageTypeTest DISABLED_MessageTypeTest #else -#define MAYBE_Renewal Renewal +#define MAYBE_MessageTypeTest MessageTypeTest #endif -IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, MAYBE_Renewal) { - TestPlaybackCase(kExternalClearKeyRenewalKeySystem, kNoSessionToLoad, +IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, MAYBE_MessageTypeTest) { + TestPlaybackCase(kExternalClearKeyMessageTypeTestKeySystem, kNoSessionToLoad, media::kEnded); - // Check renewal message received. - bool receivedRenewalMessage = false; - EXPECT_TRUE(content::ExecuteScriptAndExtractBool( + // Check whether all 2 expected message types are received ('license-request' + // and 'license-renewal'). + int num_received_message_types = 0; + EXPECT_TRUE(content::ExecuteScriptAndExtractInt( browser()->tab_strip_model()->GetActiveWebContents(), "window.domAutomationController.send(" - "document.querySelector('video').receivedRenewalMessage);", - &receivedRenewalMessage)); - EXPECT_TRUE(receivedRenewalMessage); + "document.querySelector('video').receivedMessageTypes.size);", + &num_received_message_types)); + EXPECT_EQ(2, num_received_message_types); } IN_PROC_BROWSER_TEST_P(ECKEncryptedMediaTest, LoadLoadableSession) { @@ -884,4 +896,20 @@ kUnitTestSuccess); } +IN_PROC_BROWSER_TEST_F(EncryptedMediaTestExperimentalCdmInterface, + MessageTypeTest) { + TestPlaybackCase(kExternalClearKeyMessageTypeTestKeySystem, kNoSessionToLoad, + media::kEnded); + + // Check whether all 3 expected message types are received ('license-request', + // 'license-renewal' and 'individualization-request'). + int num_received_message_types = 0; + EXPECT_TRUE(content::ExecuteScriptAndExtractInt( + browser()->tab_strip_model()->GetActiveWebContents(), + "window.domAutomationController.send(" + "document.querySelector('video').receivedMessageTypes.size);", + &num_received_message_types)); + EXPECT_EQ(3, num_received_message_types); +} + #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
diff --git a/chrome/browser/media/media_engagement_score.cc b/chrome/browser/media/media_engagement_score.cc index a038108..50b89446 100644 --- a/chrome/browser/media/media_engagement_score.cc +++ b/chrome/browser/media/media_engagement_score.cc
@@ -32,9 +32,9 @@ namespace { -const int kScoreMinVisitsParamDefault = 5; -const double kHighScoreLowerThresholdParamDefault = 0.5; -const double kHighScoreUpperThresholdParamDefault = 0.7; +const int kScoreMinVisitsParamDefault = 4; +const double kHighScoreLowerThresholdParamDefault = 0.2; +const double kHighScoreUpperThresholdParamDefault = 0.3; std::unique_ptr<base::DictionaryValue> GetScoreDictForSettings( const HostContentSettingsMap* settings,
diff --git a/chrome/browser/media/media_engagement_score_unittest.cc b/chrome/browser/media/media_engagement_score_unittest.cc index 5faa38f..42c16c2 100644 --- a/chrome/browser/media/media_engagement_score_unittest.cc +++ b/chrome/browser/media/media_engagement_score_unittest.cc
@@ -260,9 +260,9 @@ HostContentSettingsMap* settings_map = HostContentSettingsMapFactory::GetForProfile(profile()); int example_num_visits = 10; - int example_media_playbacks = 6; - int example_audible_playbacks = 2; - int example_significant_playbacks = 4; + int example_media_playbacks = 2; + int example_audible_playbacks = 1; + int example_significant_playbacks = 2; int example_visits_with_media_tags = 10; // Store some example data in content settings. @@ -358,14 +358,14 @@ TEST_F(MediaEngagementScoreTest, HighScoreLegacy) { std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); dict->SetInteger(MediaEngagementScore::kVisitsKey, 10); - dict->SetInteger(MediaEngagementScore::kMediaPlaybacksKey, 7); - TestScoreInitializesAndUpdates(std::move(dict), 10, 7, base::Time(), true, 0, + dict->SetInteger(MediaEngagementScore::kMediaPlaybacksKey, 3); + TestScoreInitializesAndUpdates(std::move(dict), 10, 3, base::Time(), true, 0, 0, 0); std::unique_ptr<base::DictionaryValue> dict2(new base::DictionaryValue()); dict2->SetInteger(MediaEngagementScore::kVisitsKey, 10); - dict2->SetInteger(MediaEngagementScore::kMediaPlaybacksKey, 4); - TestScoreInitializesAndUpdates(std::move(dict2), 10, 4, base::Time(), false, + dict2->SetInteger(MediaEngagementScore::kMediaPlaybacksKey, 2); + TestScoreInitializesAndUpdates(std::move(dict2), 10, 2, base::Time(), false, 0, 0, 0); } @@ -374,12 +374,12 @@ TEST_F(MediaEngagementScoreTest, HighScoreUpdated) { std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); dict->SetInteger(MediaEngagementScore::kVisitsKey, 10); - dict->SetInteger(MediaEngagementScore::kMediaPlaybacksKey, 4); + dict->SetInteger(MediaEngagementScore::kMediaPlaybacksKey, 1); dict->SetDouble(MediaEngagementScore::kLastMediaPlaybackTimeKey, test_clock.Now().ToInternalValue()); dict->SetBoolean(MediaEngagementScore::kHasHighScoreKey, true); - TestScoreInitializesAndUpdates(std::move(dict), 10, 4, test_clock.Now(), + TestScoreInitializesAndUpdates(std::move(dict), 10, 1, test_clock.Now(), false, 0, 0, 0); } @@ -388,30 +388,30 @@ EXPECT_FALSE(score_->high_score()); // Test that a total score of 0.1 is not high. - SetScore(10, 1); + SetScore(20, 2); EXPECT_FALSE(score_->high_score()); - // Test that a total score of 0.6 is not high but above zero. - SetScore(10, 6); + // Test that a total score of 0.25 is not high but above zero. + SetScore(20, 5); EXPECT_FALSE(score_->high_score()); - // Test that a total score of 0.8 is high. - SetScore(10, 8); + // Test that a total score of 0.3 is high. + SetScore(20, 6); EXPECT_TRUE(score_->high_score()); - // Test that a total score of 0.5 is high because of the lower boundary. - SetScore(10, 5); + // Test that a total score of 0.25 is high because of the lower boundary. + SetScore(20, 5); EXPECT_TRUE(score_->high_score()); // Test that a total score of 0.1 is not high. - SetScore(10, 1); + SetScore(20, 2); EXPECT_FALSE(score_->high_score()); } TEST_F(MediaEngagementScoreTest, OverrideFieldTrial) { - EXPECT_EQ(5, MediaEngagementScore::GetScoreMinVisits()); - EXPECT_EQ(0.5, MediaEngagementScore::GetHighScoreLowerThreshold()); - EXPECT_EQ(0.7, MediaEngagementScore::GetHighScoreUpperThreshold()); + EXPECT_EQ(4, MediaEngagementScore::GetScoreMinVisits()); + EXPECT_EQ(0.2, MediaEngagementScore::GetHighScoreLowerThreshold()); + EXPECT_EQ(0.3, MediaEngagementScore::GetHighScoreUpperThreshold()); SetScore(10, 8); EXPECT_EQ(0.8, score_->actual_score());
diff --git a/chrome/browser/media/media_engagement_service_unittest.cc b/chrome/browser/media/media_engagement_service_unittest.cc index 323b5a2f..9d7e6dde 100644 --- a/chrome/browser/media/media_engagement_service_unittest.cc +++ b/chrome/browser/media/media_engagement_service_unittest.cc
@@ -312,7 +312,7 @@ // and we will ensure it has the same score. origin2 will have a score // that is zero and will remain zero. origin3 will have a score // and will be cleared. origin4 will have a normal score. - SetScores(origin1, MediaEngagementScore::GetScoreMinVisits() + 3, 2); + SetScores(origin1, MediaEngagementScore::GetScoreMinVisits() + 2, 4); SetScores(origin2, 2, 1); SetScores(origin3, 2, 1); SetScores(origin4, MediaEngagementScore::GetScoreMinVisits(), 2); @@ -336,14 +336,14 @@ history->AddPage(origin3a, yesterday_afternoon, history::SOURCE_BROWSED); // Check that the scores are valid at the beginning. - ExpectScores(origin1, 0.25, MediaEngagementScore::GetScoreMinVisits() + 3, 2, - TimeNotSet()); + ExpectScores(origin1, 2.0 / 3.0, + MediaEngagementScore::GetScoreMinVisits() + 2, 4, TimeNotSet()); EXPECT_TRUE(GetActualScore(origin1)); ExpectScores(origin2, 0.0, 2, 1, TimeNotSet()); EXPECT_FALSE(GetActualScore(origin2)); ExpectScores(origin3, 0.0, 2, 1, TimeNotSet()); EXPECT_FALSE(GetActualScore(origin3)); - ExpectScores(origin4, 0.4, MediaEngagementScore::GetScoreMinVisits(), 2, + ExpectScores(origin4, 0.5, MediaEngagementScore::GetScoreMinVisits(), 2, TimeNotSet()); EXPECT_TRUE(GetActualScore(origin4)); @@ -362,14 +362,13 @@ // should have a score that is zero but it's visits and playbacks should // have decreased. origin3 should have had a decrease in the number of // visits. origin4 should have the old score. - ExpectScores(origin1, 1.0 / 6.0, - MediaEngagementScore::GetScoreMinVisits() + 1, 1, + ExpectScores(origin1, 0.5, MediaEngagementScore::GetScoreMinVisits(), 2, TimeNotSet()); EXPECT_TRUE(GetActualScore(origin1)); ExpectScores(origin2, 0.0, 1, 0, TimeNotSet()); EXPECT_FALSE(GetActualScore(origin2)); ExpectScores(origin3, 0.0, 1, 0, TimeNotSet()); - ExpectScores(origin4, 0.4, MediaEngagementScore::GetScoreMinVisits(), 2, + ExpectScores(origin4, 0.5, MediaEngagementScore::GetScoreMinVisits(), 2, TimeNotSet()); histogram_tester.ExpectTotalCount( @@ -377,7 +376,7 @@ histogram_tester.ExpectBucketCount( MediaEngagementService::kHistogramURLsDeletedScoreReductionName, 0, 2); histogram_tester.ExpectBucketCount( - MediaEngagementService::kHistogramURLsDeletedScoreReductionName, 8, 1); + MediaEngagementService::kHistogramURLsDeletedScoreReductionName, 17, 1); } { @@ -397,17 +396,17 @@ waiter.Wait(); // origin1's score should have changed but the rest should remain the same. - ExpectScores(origin1, 0.0, MediaEngagementScore::GetScoreMinVisits(), 0, + ExpectScores(origin1, 0.0, MediaEngagementScore::GetScoreMinVisits() - 1, 1, TimeNotSet()); ExpectScores(origin2, 0.0, 1, 0, TimeNotSet()); ExpectScores(origin3, 0.0, 1, 0, TimeNotSet()); - ExpectScores(origin4, 0.4, MediaEngagementScore::GetScoreMinVisits(), 2, + ExpectScores(origin4, 0.5, MediaEngagementScore::GetScoreMinVisits(), 2, TimeNotSet()); histogram_tester.ExpectTotalCount( MediaEngagementService::kHistogramURLsDeletedScoreReductionName, 1); histogram_tester.ExpectBucketCount( - MediaEngagementService::kHistogramURLsDeletedScoreReductionName, 17, 1); + MediaEngagementService::kHistogramURLsDeletedScoreReductionName, 50, 1); } { @@ -429,11 +428,11 @@ // origin3's score should be removed but the rest should remain the same. std::map<GURL, double> scores = GetScoreMapForTesting(); EXPECT_TRUE(scores.find(origin3) == scores.end()); - ExpectScores(origin1, 0.0, MediaEngagementScore::GetScoreMinVisits(), 0, + ExpectScores(origin1, 0.0, MediaEngagementScore::GetScoreMinVisits() - 1, 1, TimeNotSet()); ExpectScores(origin2, 0.0, 1, 0, TimeNotSet()); ExpectScores(origin3, 0.0, 0, 0, TimeNotSet()); - ExpectScores(origin4, 0.4, MediaEngagementScore::GetScoreMinVisits(), 2, + ExpectScores(origin4, 0.5, MediaEngagementScore::GetScoreMinVisits(), 2, TimeNotSet()); histogram_tester.ExpectTotalCount( @@ -525,7 +524,7 @@ GURL url3("https://www.example.com"); SetScores(url1, 6, 5); - SetScores(url2, 6, 3); + SetScores(url2, 6, 1); EXPECT_TRUE(HasHighEngagement(url1)); EXPECT_FALSE(HasHighEngagement(url2));
diff --git a/chrome/browser/media/router/BUILD.gn b/chrome/browser/media/router/BUILD.gn index b675b014b..1781510 100644 --- a/chrome/browser/media/router/BUILD.gn +++ b/chrome/browser/media/router/BUILD.gn
@@ -89,6 +89,9 @@ "providers/extension/extension_media_route_provider_proxy.h", "providers/wired_display/wired_display_media_route_provider.cc", "providers/wired_display/wired_display_media_route_provider.h", + "providers/wired_display/wired_display_presentation_receiver.h", + "providers/wired_display/wired_display_presentation_receiver_factory.cc", + "providers/wired_display/wired_display_presentation_receiver_factory.h", ] } }
diff --git a/chrome/browser/media/router/discovery/BUILD.gn b/chrome/browser/media/router/discovery/BUILD.gn index 8c9d161..688689c5 100644 --- a/chrome/browser/media/router/discovery/BUILD.gn +++ b/chrome/browser/media/router/discovery/BUILD.gn
@@ -23,6 +23,10 @@ "dial/device_description_fetcher.h", "dial/device_description_service.cc", "dial/device_description_service.h", + "dial/dial_app_discovery_service.cc", + "dial/dial_app_discovery_service.h", + "dial/dial_app_info_fetcher.cc", + "dial/dial_app_info_fetcher.h", "dial/dial_device_data.cc", "dial/dial_device_data.h", "dial/dial_media_sink_service.cc",
diff --git a/chrome/browser/media/router/discovery/dial/device_description_fetcher.cc b/chrome/browser/media/router/discovery/dial/device_description_fetcher.cc index 5494b7cf..5f4e506 100644 --- a/chrome/browser/media/router/discovery/dial/device_description_fetcher.cc +++ b/chrome/browser/media/router/discovery/dial/device_description_fetcher.cc
@@ -139,6 +139,12 @@ return; } + // Remove trailing slash if there is any. + if (app_url.ExtractFileName().empty()) { + DVLOG(2) << "App url has trailing slash: " << app_url_header; + app_url = GURL(app_url_header.substr(0, app_url_header.length() - 1)); + } + if (source->GetReceivedResponseContentLength() > kMaxDescriptionSizeBytes) { ReportError("Response too large"); return;
diff --git a/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc b/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc index ba31a04..c868571 100644 --- a/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/device_description_fetcher_unittest.cc
@@ -90,6 +90,19 @@ test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); } +TEST_F(DeviceDescriptionFetcherTest, FetchSuccessfulAppUrlWithTrailingSlash) { + ExpectSuccess(GURL("http://127.0.0.1/apps"), "<xml>description</xml>"); + net::TestURLFetcher* test_fetcher = StartRequest(); + + test_fetcher->set_response_code(net::HTTP_OK); + scoped_refptr<net::HttpResponseHeaders> headers = + new net::HttpResponseHeaders(""); + headers->AddHeader("Application-URL: http://127.0.0.1/apps/"); + test_fetcher->set_response_headers(headers); + test_fetcher->SetResponseString("<xml>description</xml>"); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + TEST_F(DeviceDescriptionFetcherTest, FetchFailsOnMissingDescription) { ExpectError("HTTP 404:"); net::TestURLFetcher* test_fetcher = StartRequest();
diff --git a/chrome/browser/media/router/discovery/dial/dial_app_discovery_service.cc b/chrome/browser/media/router/discovery/dial/dial_app_discovery_service.cc new file mode 100644 index 0000000..7d4ff0553 --- /dev/null +++ b/chrome/browser/media/router/discovery/dial/dial_app_discovery_service.cc
@@ -0,0 +1,135 @@ +// Copyright 2018 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/media/router/discovery/dial/dial_app_discovery_service.h" + +#include "base/memory/ptr_util.h" +#include "base/stl_util.h" +#include "base/strings/string_util.h" +#include "base/time/default_clock.h" +#include "chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.h" +#include "chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.h" +#include "net/http/http_status_code.h" +#include "url/gurl.h" + +namespace { + +media_router::SinkAppStatus GetAppStatusFromAppInfo( + const media_router::ParsedDialAppInfo& app_info) { + if (app_info.state == media_router::DialAppState::kRunning || + app_info.state == media_router::DialAppState::kStopped) { + return media_router::SinkAppStatus::kAvailable; + } + + return media_router::SinkAppStatus::kUnavailable; +} + +std::string GetRequestId(const std::string& sink_id, + const std::string& app_name) { + return sink_id + ':' + app_name; +} + +GURL GetAppUrl(const media_router::MediaSinkInternal& sink, + const std::string& app_name) { + // The DIAL spec (Section 5.4) implies that the app URL must not have a + // trailing slash. + GURL partial_app_url = sink.dial_data().app_url; + return GURL(partial_app_url.spec() + "/" + app_name); +} + +} // namespace + +namespace media_router { + +DialAppDiscoveryService::DialAppDiscoveryService( + service_manager::Connector* connector, + const DialAppInfoParseCompletedCallback& parse_completed_cb) + : parse_completed_cb_(parse_completed_cb), + parser_(std::make_unique<SafeDialAppInfoParser>(connector)) {} + +DialAppDiscoveryService::~DialAppDiscoveryService() = default; + +// Always query the device to get current app status. +void DialAppDiscoveryService::FetchDialAppInfo( + const MediaSinkInternal& sink, + const std::string& app_name, + net::URLRequestContextGetter* request_context) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + std::string sink_id = sink.sink().id(); + std::string request_id = GetRequestId(sink_id, app_name); + GURL app_url = GetAppUrl(sink, app_name); + DVLOG(2) << "Fetch DIAL app info from: " << app_url.spec(); + + std::unique_ptr<DialAppInfoFetcher> fetcher = + std::make_unique<DialAppInfoFetcher>( + app_url, request_context, + base::BindOnce(&DialAppDiscoveryService::OnDialAppInfoFetchComplete, + base::Unretained(this), sink_id, app_name), + base::BindOnce(&DialAppDiscoveryService::OnDialAppInfoFetchError, + base::Unretained(this), sink_id, app_name)); + fetcher->Start(); + pending_fetcher_map_.emplace(request_id, std::move(fetcher)); +} + +void DialAppDiscoveryService::SetParserForTest( + std::unique_ptr<SafeDialAppInfoParser> parser) { + parser_ = std::move(parser); +} + +void DialAppDiscoveryService::OnDialAppInfoParsed( + const std::string& sink_id, + const std::string& app_name, + std::unique_ptr<ParsedDialAppInfo> parsed_app_info, + SafeDialAppInfoParser::ParsingResult parsing_result) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + std::string request_id = GetRequestId(sink_id, app_name); + pending_fetcher_map_.erase(request_id); + + if (!parsed_app_info) { + DVLOG(2) << "Failed to parse app info XML in utility process, error: " + << parsing_result; + parse_completed_cb_.Run(sink_id, app_name, SinkAppStatus::kUnavailable); + return; + } + + SinkAppStatus app_status = GetAppStatusFromAppInfo(*parsed_app_info); + DVLOG(2) << "Get parsed DIAL app info from utility process, [sink_id]: " + << sink_id << " [name]: " << app_name << " [status]: " << app_status; + parse_completed_cb_.Run(sink_id, app_name, app_status); +} + +void DialAppDiscoveryService::OnDialAppInfoFetchComplete( + const std::string& sink_id, + const std::string& app_name, + const std::string& app_info_xml) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + parser_->Parse(app_info_xml, + base::BindOnce(&DialAppDiscoveryService::OnDialAppInfoParsed, + base::Unretained(this), sink_id, app_name)); +} + +void DialAppDiscoveryService::OnDialAppInfoFetchError( + const std::string& sink_id, + const std::string& app_name, + int response_code, + const std::string& error_message) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + DVLOG(2) << "Fail to fetch app info XML for: " << sink_id + << " due to error: " << error_message + << " response code: " << response_code; + + if (response_code == net::HTTP_NOT_FOUND || + response_code >= net::HTTP_INTERNAL_SERVER_ERROR || + response_code == net::HTTP_OK) { + parse_completed_cb_.Run(sink_id, app_name, SinkAppStatus::kUnavailable); + } + + std::string request_id = GetRequestId(sink_id, app_name); + pending_fetcher_map_.erase(request_id); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/discovery/dial/dial_app_discovery_service.h b/chrome/browser/media/router/discovery/dial/dial_app_discovery_service.h new file mode 100644 index 0000000..fd047003 --- /dev/null +++ b/chrome/browser/media/router/discovery/dial/dial_app_discovery_service.h
@@ -0,0 +1,134 @@ +// Copyright 2018 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_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_APP_DISCOVERY_SERVICE_H_ +#define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_APP_DISCOVERY_SERVICE_H_ + +#include <memory> +#include <set> +#include <string> + +#include "base/callback.h" +#include "base/containers/flat_map.h" +#include "base/gtest_prod_util.h" +#include "base/sequence_checker.h" +#include "chrome/browser/media/router/discovery/dial/parsed_dial_app_info.h" +#include "chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.h" +#include "chrome/common/media_router/discovery/media_sink_internal.h" +#include "url/gurl.h" + +namespace net { +class URLRequestContextGetter; +} + +namespace service_manager { +class Connector; +} + +namespace media_router { + +class DialAppInfoFetcher; +class SafeDialAppInfoParser; + +// Represents DIAL app status on receiver device. +enum SinkAppStatus { kAvailable, kUnavailable, kUnknown }; + +// This class provides an API to fetch DIAL app info XML from an app URL and +// parse the XML into a DialAppInfo object. Actual parsing happens in a +// separate utility process via SafeDialAppInfoParser instead of in this class. +// During shutdown, this class aborts all pending requests and no callbacks get +// invoked. +// This class may be created on any thread. All methods, unless otherwise noted, +// must be invoked on the SequencedTaskRunner given by +// |DialMediaSinkServiceImpl::task_runner()|. +class DialAppDiscoveryService { + public: + // Called if parsing app info XML in utility process finishes. + // |sink_id|: MediaSink ID of the receiver that responded to the GET request. + // |app_name|: DIAL app name whose status is being checked on |sink_id|. + // |app_status|: app status indicating if |app_name| is available on MediaSink + // with ID |sink_id|. + using DialAppInfoParseCompletedCallback = + base::RepeatingCallback<void(const std::string& sink_id, + const std::string& app_name, + SinkAppStatus app_status)>; + + DialAppDiscoveryService( + service_manager::Connector* connector, + const DialAppInfoParseCompletedCallback& parse_completed_cb); + + virtual ~DialAppDiscoveryService(); + + // Queries |app_name|'s availability on |sink| by issuing a HTTP GET request. + // No-op if there is already a pending request. + // App URL is used to issue HTTP GET request. E.g. + // http://127.0.0.1/apps/YouTube. "http://127.0.0.1/apps/" is the base part + // which comes from |sink|; "YouTube" suffix is the app name part which comes + // from |app_name|. + // |request_context|: Used by the background URLFetchers. + virtual void FetchDialAppInfo(const MediaSinkInternal& sink, + const std::string& app_name, + net::URLRequestContextGetter* request_context); + + private: + friend class DialAppDiscoveryServiceTest; + FRIEND_TEST_ALL_PREFIXES(DialAppDiscoveryServiceTest, + TestFechDialAppInfoFromCache); + FRIEND_TEST_ALL_PREFIXES(DialAppDiscoveryServiceTest, + TestFechDialAppInfoFromCacheExpiredEntry); + FRIEND_TEST_ALL_PREFIXES(DialAppDiscoveryServiceTest, + TestSafeParserProperlyCreated); + FRIEND_TEST_ALL_PREFIXES(DialAppDiscoveryServiceTest, + TestGetAvailabilityFromAppInfoAvailable); + FRIEND_TEST_ALL_PREFIXES(DialAppDiscoveryServiceTest, + TestGetAvailabilityFromAppInfoUnavailable); + + // Used by unit test. + void SetParserForTest(std::unique_ptr<SafeDialAppInfoParser> parser); + + // Invoked when HTTP GET request finishes. + // |sink_id|: MediaSink ID of the receiver that responded to the GET request. + // |app_name|: app name passed in when initiating the HTTP GET request. + // |app_info_xml|: Response XML from HTTP request. + void OnDialAppInfoFetchComplete(const std::string& sink_id, + const std::string& app_name, + const std::string& app_info_xml); + + // Invoked when HTTP GET request fails. + // |sink_id|: MediaSink ID of the receiver that responded to the GET request. + // |app_name|: app name passed in when initiating the HTTP GET request. + // |response_code|: The HTTP response code received. + // |error_message|: Error message from HTTP request. + void OnDialAppInfoFetchError(const std::string& sink_id, + const std::string& app_name, + int response_code, + const std::string& error_message); + + // Invoked when SafeDialAppInfoParser finishes parsing app info XML. + // |sink_id|: MediaSink ID of the receiver that responded to the GET request. + // |app_name|: app name passed in when initiating the HTTP GET request. + // |app_info|: Parsed app info from utility process, or nullptr if parsing + // failed. + // |parsing_result|: Result of DIAL app info XML parsing. + void OnDialAppInfoParsed(const std::string& sink_id, + const std::string& app_name, + std::unique_ptr<ParsedDialAppInfo> app_info, + SafeDialAppInfoParser::ParsingResult parsing_result); + + // Map of pending app info fetchers, keyed by request id. + base::flat_map<std::string, std::unique_ptr<DialAppInfoFetcher>> + pending_fetcher_map_; + + // See comments for DialAppInfoParseCompletedCallback. + DialAppInfoParseCompletedCallback parse_completed_cb_; + + // Safe DIAL parser. Does the parsing in a utility process. + std::unique_ptr<SafeDialAppInfoParser> parser_; + + SEQUENCE_CHECKER(sequence_checker_); +}; + +} // namespace media_router + +#endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_APP_DISCOVERY_SERVICE_H_
diff --git a/chrome/browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc b/chrome/browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc new file mode 100644 index 0000000..f617b9198 --- /dev/null +++ b/chrome/browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc
@@ -0,0 +1,185 @@ +// Copyright 2018 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/media/router/discovery/dial/dial_app_discovery_service.h" + +#include "base/strings/stringprintf.h" +#include "base/test/mock_callback.h" +#include "chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.h" +#include "chrome/browser/media/router/discovery/dial/parsed_dial_device_description.h" +#include "chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.h" +#include "chrome/browser/media/router/test/test_helper.h" +#include "chrome/test/base/testing_profile.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "net/url_request/test_url_fetcher_factory.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +using ::testing::_; +using ::testing::Invoke; +using ::testing::Return; +using ::testing::SaveArg; + +namespace media_router { + +namespace { + +constexpr char kYouTubeName[] = "YouTube"; +constexpr char kNetflixName[] = "Netflix"; + +std::unique_ptr<ParsedDialAppInfo> CreateParsedDialAppInfo( + const std::string& name, + DialAppState app_state) { + auto app_info = std::make_unique<ParsedDialAppInfo>(); + app_info->name = name; + app_info->state = app_state; + return app_info; +} + +} // namespace + +class TestSafeDialAppInfoParser : public SafeDialAppInfoParser { + public: + TestSafeDialAppInfoParser() : SafeDialAppInfoParser(nullptr) {} + ~TestSafeDialAppInfoParser() override {} + + MOCK_METHOD1(ParseInternal, void(const std::string& xml_text)); + + void Parse(const std::string& xml_text, ParseCallback callback) override { + parse_callback_ = std::move(callback); + ParseInternal(xml_text); + } + + void InvokeParseCallback(std::unique_ptr<ParsedDialAppInfo> app_info, + ParsingResult parsing_result) { + if (!parse_callback_) + return; + std::move(parse_callback_).Run(std::move(app_info), parsing_result); + } + + private: + ParseCallback parse_callback_; +}; + +class DialAppDiscoveryServiceTest : public ::testing::Test { + public: + DialAppDiscoveryServiceTest() + : test_parser_(new TestSafeDialAppInfoParser()), + dial_app_discovery_service_(nullptr, mock_completed_cb_.Get()) { + dial_app_discovery_service_.SetParserForTest( + std::unique_ptr<TestSafeDialAppInfoParser>(test_parser_)); + } + + void TearDown() override { + dial_app_discovery_service_.pending_fetcher_map_.clear(); + } + + protected: + base::MockCallback<DialAppDiscoveryService::DialAppInfoParseCompletedCallback> + mock_completed_cb_; + + TestSafeDialAppInfoParser* test_parser_; + DialAppDiscoveryService dial_app_discovery_service_; + const content::TestBrowserThreadBundle thread_bundle_; + TestingProfile profile_; + const net::TestURLFetcherFactory factory_; +}; + +TEST_F(DialAppDiscoveryServiceTest, TestFetchDialAppInfoFetchURL) { + MediaSinkInternal dial_sink = CreateDialSink(1); + EXPECT_CALL(mock_completed_cb_, Run(dial_sink.sink().id(), kYouTubeName, + SinkAppStatus::kAvailable)); + dial_app_discovery_service_.FetchDialAppInfo(dial_sink, kYouTubeName, + profile_.GetRequestContext()); + + EXPECT_CALL(*test_parser_, ParseInternal(_)) + .WillOnce(Invoke([&](const std::string& xml_text) { + test_parser_->InvokeParseCallback( + CreateParsedDialAppInfo(kYouTubeName, DialAppState::kRunning), + SafeDialAppInfoParser::ParsingResult::kSuccess); + })); + net::TestURLFetcher* test_fetcher = + factory_.GetFetcherByID(DialAppInfoFetcher::kURLFetcherIDForTest); + GURL expected_url("http://192.168.0.101/apps/YouTube"); + EXPECT_EQ(expected_url, test_fetcher->GetOriginalURL()); + test_fetcher->set_response_code(net::HTTP_OK); + test_fetcher->SetResponseString("<xml>appInfo</xml>"); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + +TEST_F(DialAppDiscoveryServiceTest, + TestFetchDialAppInfoFetchURLTransientError) { + MediaSinkInternal dial_sink = CreateDialSink(1); + EXPECT_CALL(mock_completed_cb_, Run(_, _, _)).Times(0); + dial_app_discovery_service_.FetchDialAppInfo(dial_sink, kYouTubeName, + profile_.GetRequestContext()); + + net::TestURLFetcher* test_fetcher = + factory_.GetFetcherByID(DialAppInfoFetcher::kURLFetcherIDForTest); + test_fetcher->set_response_code(net::HTTP_TEMPORARY_REDIRECT); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + +TEST_F(DialAppDiscoveryServiceTest, TestFetchDialAppInfoFetchURLError) { + MediaSinkInternal dial_sink = CreateDialSink(1); + EXPECT_CALL(mock_completed_cb_, Run(dial_sink.sink().id(), kYouTubeName, + SinkAppStatus::kUnavailable)); + dial_app_discovery_service_.FetchDialAppInfo(dial_sink, kYouTubeName, + profile_.GetRequestContext()); + + net::TestURLFetcher* test_fetcher = + factory_.GetFetcherByID(DialAppInfoFetcher::kURLFetcherIDForTest); + test_fetcher->set_response_code(net::HTTP_NOT_FOUND); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); + + EXPECT_CALL(mock_completed_cb_, Run(_, _, SinkAppStatus::kUnavailable)) + .Times(0); + dial_app_discovery_service_.FetchDialAppInfo(dial_sink, kYouTubeName, + profile_.GetRequestContext()); +} + +TEST_F(DialAppDiscoveryServiceTest, TestFetchDialAppInfoParseError) { + MediaSinkInternal dial_sink = CreateDialSink(1); + EXPECT_CALL(mock_completed_cb_, Run(dial_sink.sink().id(), kYouTubeName, + SinkAppStatus::kUnavailable)); + dial_app_discovery_service_.FetchDialAppInfo(dial_sink, kYouTubeName, + profile_.GetRequestContext()); + + EXPECT_CALL(*test_parser_, ParseInternal(_)) + .WillOnce(Invoke([&](const std::string& xml_text) { + test_parser_->InvokeParseCallback( + nullptr, SafeDialAppInfoParser::ParsingResult::kMissingName); + })); + net::TestURLFetcher* test_fetcher = + factory_.GetFetcherByID(DialAppInfoFetcher::kURLFetcherIDForTest); + test_fetcher->set_response_code(net::HTTP_OK); + test_fetcher->SetResponseString("<xml>appInfo</xml>"); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + +TEST_F(DialAppDiscoveryServiceTest, TestGetAvailabilityFromAppInfoAvailable) { + MediaSinkInternal dial_sink = CreateDialSink(1); + auto parsed_app_info = + CreateParsedDialAppInfo(kNetflixName, DialAppState::kRunning); + + EXPECT_CALL(mock_completed_cb_, Run(dial_sink.sink().id(), kNetflixName, + SinkAppStatus::kAvailable)); + dial_app_discovery_service_.OnDialAppInfoParsed( + dial_sink.sink().id(), kNetflixName, std::move(parsed_app_info), + SafeDialAppInfoParser::ParsingResult::kSuccess); +} + +TEST_F(DialAppDiscoveryServiceTest, TestGetAvailabilityFromAppInfoUnavailable) { + MediaSinkInternal dial_sink = CreateDialSink(1); + auto parsed_app_info = + CreateParsedDialAppInfo(kNetflixName, DialAppState::kUnknown); + + EXPECT_CALL(mock_completed_cb_, Run(dial_sink.sink().id(), kNetflixName, + SinkAppStatus::kUnavailable)); + dial_app_discovery_service_.OnDialAppInfoParsed( + dial_sink.sink().id(), kNetflixName, std::move(parsed_app_info), + SafeDialAppInfoParser::ParsingResult::kSuccess); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.cc b/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.cc new file mode 100644 index 0000000..0b991b88 --- /dev/null +++ b/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.cc
@@ -0,0 +1,136 @@ +// Copyright (c) 2018 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/media/router/discovery/dial/dial_app_info_fetcher.h" + +#include "chrome/browser/profiles/profile.h" +#include "net/base/load_flags.h" +#include "net/http/http_response_headers.h" +#include "net/http/http_status_code.h" +#include "net/http/http_util.h" +#include "net/traffic_annotation/network_traffic_annotation.h" +#include "net/url_request/url_fetcher.h" +#include "net/url_request/url_request_context_getter.h" + +using content::BrowserThread; + +constexpr int kMaxRetries = 3; +// DIAL devices are unlikely to expose uPnP functions other than DIAL, so 256kb +// should be more than sufficient. +constexpr int kMaxAppInfoSizeBytes = 262144; + +namespace media_router { + +DialAppInfoFetcher::DialAppInfoFetcher( + const GURL& app_url, + net::URLRequestContextGetter* request_context, + base::OnceCallback<void(const std::string&)> success_cb, + base::OnceCallback<void(int, const std::string&)> error_cb) + : app_url_(app_url), + request_context_(request_context), + success_cb_(std::move(success_cb)), + error_cb_(std::move(error_cb)) { + DCHECK(request_context_); + DCHECK(app_url_.is_valid()); +} + +DialAppInfoFetcher::~DialAppInfoFetcher() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); +} + +void DialAppInfoFetcher::Start() { + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + DCHECK(!fetcher_); + + net::NetworkTrafficAnnotationTag traffic_annotation = + net::DefineNetworkTrafficAnnotation("dial_get_app_info", R"( + semantics { + sender: "DIAL" + description: + "Chromium sends a request to a device (such as a smart TV) " + "discovered via the DIAL (Discovery and Launch) protocol to obtain " + "its app info data. Chromium then uses the app info data to" + "determine the capabilities of the device to be used as a target" + "for casting media content." + trigger: + "A new or updated device has been discovered via DIAL in the local " + "network." + data: "An HTTP GET request." + destination: OTHER + destination_other: + "A device in the local network." + } + policy { + cookies_allowed: NO + setting: + "This feature cannot be disabled by settings." + chrome_policy { + EnableMediaRouter { + policy_options {mode: MANDATORY} + EnableMediaRouter: false + } + } + })"); + // DIAL returns app info via GET request. + fetcher_ = + net::URLFetcher::Create(kURLFetcherIDForTest, app_url_, + net::URLFetcher::GET, this, traffic_annotation); + + // net::LOAD_BYPASS_PROXY: Proxies almost certainly hurt more cases than they + // help. + // net::LOAD_DISABLE_CACHE: The request should not touch the cache. + // net::LOAD_DO_NOT_{SAVE,SEND}_COOKIES: The request should not touch cookies. + // net::LOAD_DO_NOT_SEND_AUTH_DATA: The request should not send auth data. + fetcher_->SetLoadFlags(net::LOAD_BYPASS_PROXY | net::LOAD_DISABLE_CACHE | + net::LOAD_DO_NOT_SAVE_COOKIES | + net::LOAD_DO_NOT_SEND_COOKIES | + net::LOAD_DO_NOT_SEND_AUTH_DATA); + + // Section 5.4 of the DIAL spec prohibits redirects. + fetcher_->SetStopOnRedirect(true); + + // Allow the fetcher to retry on 5XX responses and ERR_NETWORK_CHANGED. + fetcher_->SetMaxRetriesOn5xx(kMaxRetries); + fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries); + + fetcher_->SetRequestContext(request_context_.get()); + fetcher_->Start(); +} + +void DialAppInfoFetcher::ReportError(int response_code, + const std::string& message) { + std::move(error_cb_).Run(response_code, message); +} + +void DialAppInfoFetcher::OnURLFetchComplete(const net::URLFetcher* source) { + DCHECK_EQ(fetcher_.get(), source); + + int response_code = source->GetResponseCode(); + if (response_code != net::HTTP_OK) { + ReportError(response_code, + base::StringPrintf("HTTP %d: Unable to fetch DIAL app info", + response_code)); + return; + } + + if (source->GetReceivedResponseContentLength() > kMaxAppInfoSizeBytes) { + ReportError(response_code, "Response too large"); + return; + } + + std::string app_info_xml; + if (!source->GetResponseAsString(&app_info_xml) || app_info_xml.empty()) { + ReportError(response_code, "Missing or empty response"); + return; + } + + if (!base::IsStringUTF8(app_info_xml)) { + ReportError(response_code, "Invalid response encoding"); + return; + } + + std::move(success_cb_).Run(std::string(app_info_xml)); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.h b/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.h new file mode 100644 index 0000000..2c4b050 --- /dev/null +++ b/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.h
@@ -0,0 +1,73 @@ +// Copyright (c) 2018 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_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_APP_INFO_FETCHER_H_ +#define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_APP_INFO_FETCHER_H_ + +#include <memory> +#include <string> + +#include "base/callback.h" +#include "base/threading/thread_checker.h" +#include "content/public/browser/browser_thread.h" +#include "net/url_request/url_fetcher_delegate.h" +#include "url/gurl.h" + +namespace net { +class URLFetcher; +class URLRequestContextGetter; +} // namespace net + +namespace media_router { + +// Used to make a single HTTP GET request with |app_url| to fetch an app info +// from a DIAL device. If successful, |success_cb| is invoked with the result; +// otherwise, |error_cb| is invoked with an error reason. +// This class is not thread safe and should be invoked . +class DialAppInfoFetcher : public net::URLFetcherDelegate { + public: + // Used to identify the net::URLFetcher instance for tests. + static constexpr int kURLFetcherIDForTest = 1; + + // |request_context| is unowned; the caller must ensure that this object does + // not outlive it. + DialAppInfoFetcher( + const GURL& app_url, + net::URLRequestContextGetter* request_context, + base::OnceCallback<void(const std::string&)> success_cb, + base::OnceCallback<void(int, const std::string&)> error_cb); + + ~DialAppInfoFetcher() override; + + const GURL& app_url() { return app_url_; } + + virtual void Start(); + + protected: + // Runs |error_cb_| with |message| and clears it. + void ReportError(int response_code, const std::string& message); + + private: + // net::URLFetcherDelegate implementation. + void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnURLFetchDownloadProgress(const net::URLFetcher* source, + int64_t current, + int64_t total, + int64_t current_network_bytes) override {} + void OnURLFetchUploadProgress(const net::URLFetcher* source, + int64_t current, + int64_t total) override {} + + const GURL app_url_; + const scoped_refptr<net::URLRequestContextGetter> request_context_; + base::OnceCallback<void(const std::string&)> success_cb_; + base::OnceCallback<void(int, const std::string&)> error_cb_; + std::unique_ptr<net::URLFetcher> fetcher_; + + THREAD_CHECKER(thread_checker_); +}; + +} // namespace media_router + +#endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_APP_INFO_FETCHER_H_
diff --git a/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher_unittest.cc b/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher_unittest.cc new file mode 100644 index 0000000..0993d49 --- /dev/null +++ b/chrome/browser/media/router/discovery/dial/dial_app_info_fetcher_unittest.cc
@@ -0,0 +1,118 @@ +// Copyright (c) 2018 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 <memory> +#include <string> + +#include "base/callback.h" +#include "base/macros.h" +#include "base/memory/ptr_util.h" +#include "chrome/browser/media/router/discovery/dial/dial_app_info_fetcher.h" +#include "chrome/test/base/testing_profile.h" +#include "content/public/test/test_browser_thread_bundle.h" +#include "net/http/http_response_headers.h" +#include "net/http/http_status_code.h" +#include "net/url_request/test_url_fetcher_factory.h" +#include "net/url_request/url_fetcher.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" + +namespace media_router { + +class DialAppInfoFetcherTest : public testing::Test { + public: + DialAppInfoFetcherTest() : url_("http://127.0.0.1/app/Youtube") {} + + void TearDown() override { + EXPECT_FALSE(error_cb_); + EXPECT_FALSE(success_cb_); + } + + void ExpectSuccess(const std::string& expected_app_info) { + success_cb_ = base::BindOnce(&DialAppInfoFetcherTest::OnSuccess, + base::Unretained(this), expected_app_info); + } + + void ExpectError(const std::string& expected_message) { + error_cb_ = base::BindOnce(&DialAppInfoFetcherTest::OnError, + base::Unretained(this), expected_message); + } + + net::TestURLFetcher* StartRequest() { + fetcher_ = base::MakeUnique<DialAppInfoFetcher>( + url_, profile_.GetRequestContext(), std::move(success_cb_), + std::move(error_cb_)); + fetcher_->Start(); + return factory_.GetFetcherByID(DialAppInfoFetcher::kURLFetcherIDForTest); + } + + protected: + const content::TestBrowserThreadBundle thread_bundle_; + TestingProfile profile_; + const net::TestURLFetcherFactory factory_; + const GURL url_; + base::OnceCallback<void(const std::string&)> success_cb_; + base::OnceCallback<void(int, const std::string&)> error_cb_; + std::unique_ptr<DialAppInfoFetcher> fetcher_; + + private: + void OnSuccess(const std::string& expected_app_info, + const std::string& app_info) { + EXPECT_EQ(expected_app_info, app_info); + } + + void OnError(const std::string& expected_message, + int response_code, + const std::string& message) { + EXPECT_TRUE(message.find(expected_message) == 0); + } + + DISALLOW_COPY_AND_ASSIGN(DialAppInfoFetcherTest); +}; + +TEST_F(DialAppInfoFetcherTest, FetchSuccessful) { + ExpectSuccess("<xml>appInfo</xml>"); + net::TestURLFetcher* test_fetcher = StartRequest(); + + test_fetcher->set_response_code(net::HTTP_OK); + test_fetcher->SetResponseString("<xml>appInfo</xml>"); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + +TEST_F(DialAppInfoFetcherTest, FetchFailsOnMissingAppInfo) { + ExpectError("HTTP 404:"); + net::TestURLFetcher* test_fetcher = StartRequest(); + + test_fetcher->set_response_code(net::HTTP_NOT_FOUND); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + +TEST_F(DialAppInfoFetcherTest, FetchFailsOnEmptyAppInfo) { + ExpectError("Missing or empty response"); + net::TestURLFetcher* test_fetcher = StartRequest(); + + test_fetcher->set_response_code(net::HTTP_OK); + test_fetcher->SetResponseString(""); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + +TEST_F(DialAppInfoFetcherTest, FetchFailsOnBadAppInfo) { + ExpectError("Invalid response encoding"); + net::TestURLFetcher* test_fetcher = StartRequest(); + + test_fetcher->set_response_code(net::HTTP_OK); + test_fetcher->SetResponseString("\xfc\x9c\xbf\x80\xbf\x80"); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + +TEST_F(DialAppInfoFetcherTest, FetchFailsOnResponseTooLarge) { + ExpectError("Response too large"); + net::TestURLFetcher* test_fetcher = StartRequest(); + + test_fetcher->set_response_code(net::HTTP_OK); + test_fetcher->SetResponseString(std::string(262145, 'd')); + test_fetcher->delegate()->OnURLFetchComplete(test_fetcher); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.cc b/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.cc index 6b4b187..729dbf9 100644 --- a/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.cc +++ b/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.cc
@@ -28,17 +28,17 @@ } // Parses |child_element| content, and sets corresponding fields of -// |out_app_info|. Returns ParsingError::kNone if parsing succeeds. -SafeDialAppInfoParser::ParsingError ProcessChildElement( +// |out_app_info|. Returns ParsingResult::kSuccess if parsing succeeds. +SafeDialAppInfoParser::ParsingResult ProcessChildElement( const base::Value& child_element, ParsedDialAppInfo* out_app_info) { std::string tag_name; if (!data_decoder::GetXmlElementTagName(child_element, &tag_name)) - return SafeDialAppInfoParser::ParsingError::kInvalidXML; + return SafeDialAppInfoParser::ParsingResult::kInvalidXML; if (tag_name == "name") { if (!data_decoder::GetXmlElementText(child_element, &out_app_info->name)) - return SafeDialAppInfoParser::ParsingError::kFailToReadName; + return SafeDialAppInfoParser::ParsingResult::kFailToReadName; } else if (tag_name == "options") { out_app_info->allow_stop = data_decoder::GetXmlElementAttribute( child_element, "allowStop") != "false"; @@ -48,7 +48,7 @@ } else if (tag_name == "state") { std::string state; if (!data_decoder::GetXmlElementText(child_element, &state)) - return SafeDialAppInfoParser::ParsingError::kFailToReadState; + return SafeDialAppInfoParser::ParsingResult::kFailToReadState; out_app_info->state = ParseDialAppState(state); } else { std::string extra_data; @@ -60,20 +60,20 @@ } } - return SafeDialAppInfoParser::ParsingError::kNone; + return SafeDialAppInfoParser::ParsingResult::kSuccess; } -// Returns ParsingError::kNone if mandatory fields (name, state) are valid. +// Returns ParsingResult::kSuccess if mandatory fields (name, state) are valid. // |app_info|: app info object to be validated. -SafeDialAppInfoParser::ParsingError ValidateParsedAppInfo( +SafeDialAppInfoParser::ParsingResult ValidateParsedAppInfo( const ParsedDialAppInfo& app_info) { if (app_info.name.empty()) - return SafeDialAppInfoParser::ParsingError::kMissingName; + return SafeDialAppInfoParser::ParsingResult::kMissingName; if (app_info.state == DialAppState::kUnknown) - return SafeDialAppInfoParser::ParsingError::kInvalidState; + return SafeDialAppInfoParser::ParsingResult::kInvalidState; - return SafeDialAppInfoParser::ParsingError::kNone; + return SafeDialAppInfoParser::ParsingResult::kSuccess; } } // namespace @@ -110,7 +110,7 @@ } if (!value || !value->is_dict()) { - std::move(callback).Run(nullptr, ParsingError::kInvalidXML); + std::move(callback).Run(nullptr, ParsingResult::kInvalidXML); return; } @@ -120,7 +120,7 @@ const base::Value* service_element = data_decoder::FindXmlElementPath(*value, {"service"}, &unique_service); if (!service_element || !unique_service) { - std::move(callback).Run(nullptr, ParsingError::kInvalidXML); + std::move(callback).Run(nullptr, ParsingResult::kInvalidXML); return; } @@ -134,27 +134,27 @@ const base::Value* child_elements = data_decoder::GetXmlElementChildren(*service_element); if (!child_elements || !child_elements->is_list()) { - std::move(callback).Run(nullptr, ParsingError::kInvalidXML); + std::move(callback).Run(nullptr, ParsingResult::kInvalidXML); return; } - ParsingError parsing_error = ParsingError::kNone; + ParsingResult parsing_result = ParsingResult::kSuccess; for (const auto& child_element : child_elements->GetList()) { - parsing_error = ProcessChildElement(child_element, app_info.get()); - if (parsing_error != ParsingError::kNone) { - std::move(callback).Run(nullptr, parsing_error); + parsing_result = ProcessChildElement(child_element, app_info.get()); + if (parsing_result != ParsingResult::kSuccess) { + std::move(callback).Run(nullptr, parsing_result); return; } } // Validate mandatory fields (name, state). - parsing_error = ValidateParsedAppInfo(*app_info); - if (parsing_error != ParsingError::kNone) { - std::move(callback).Run(nullptr, parsing_error); + parsing_result = ValidateParsedAppInfo(*app_info); + if (parsing_result != ParsingResult::kSuccess) { + std::move(callback).Run(nullptr, parsing_result); return; } - std::move(callback).Run(std::move(app_info), ParsingError::kNone); + std::move(callback).Run(std::move(app_info), ParsingResult::kSuccess); } } // namespace media_router
diff --git a/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.h b/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.h index dc90eea..7bb4771 100644 --- a/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.h +++ b/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser.h
@@ -28,8 +28,8 @@ // Section 6.1.2 Server response. class SafeDialAppInfoParser { public: - enum class ParsingError { - kNone = 0, + enum ParsingResult { + kSuccess = 0, kInvalidXML = 1, kFailToReadName = 2, kFailToReadState = 3, @@ -39,14 +39,14 @@ // |connector| should be a valid connector to the ServiceManager. explicit SafeDialAppInfoParser(service_manager::Connector* connector); - ~SafeDialAppInfoParser(); + virtual ~SafeDialAppInfoParser(); // Callback function invoked when done parsing DIAL app info XML. // |app_info|: app info object. Empty if parsing failed. // |parsing_error|: error encountered while parsing the DIAL app info XML. using ParseCallback = base::OnceCallback<void(std::unique_ptr<ParsedDialAppInfo> app_info, - ParsingError parsing_error)>; + ParsingResult parsing_result)>; // Parses the DIAL app info in |xml_text| in a utility process. // If the parsing succeeds, invokes callback with a valid @@ -57,7 +57,7 @@ // utility process is still cleaned up automatically if unused after some // time, even if this object is still alive. // Note also that the callback is not called if the object is deleted. - void Parse(const std::string& xml_text, ParseCallback callback); + virtual void Parse(const std::string& xml_text, ParseCallback callback); private: void OnXmlParsingDone(ParseCallback callback,
diff --git a/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser_unittest.cc b/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser_unittest.cc index 702bc28..3fbadcf 100644 --- a/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser_unittest.cc +++ b/chrome/browser/media/router/discovery/dial/safe_dial_app_info_parser_unittest.cc
@@ -103,21 +103,21 @@ std::unique_ptr<ParsedDialAppInfo> Parse( const std::string& xml, - SafeDialAppInfoParser::ParsingError expected_error) { + SafeDialAppInfoParser::ParsingResult expected_result) { base::RunLoop run_loop; SafeDialAppInfoParser parser(connector_.get()); parser.Parse(xml, base::BindOnce(&SafeDialAppInfoParserTest::OnParsingCompleted, - base::Unretained(this), expected_error)); + base::Unretained(this), expected_result)); base::RunLoop().RunUntilIdle(); return std::move(app_info_); } - void OnParsingCompleted(SafeDialAppInfoParser::ParsingError expected_error, + void OnParsingCompleted(SafeDialAppInfoParser::ParsingResult expected_result, std::unique_ptr<ParsedDialAppInfo> app_info, - SafeDialAppInfoParser::ParsingError error) { + SafeDialAppInfoParser::ParsingResult result) { app_info_ = std::move(app_info); - EXPECT_EQ(expected_error, error); + EXPECT_EQ(expected_result, result); } private: @@ -130,14 +130,14 @@ TEST_F(SafeDialAppInfoParserTest, TestInvalidXmlNoService) { std::unique_ptr<ParsedDialAppInfo> app_info = - Parse("", SafeDialAppInfoParser::ParsingError::kInvalidXML); + Parse("", SafeDialAppInfoParser::ParsingResult::kInvalidXML); EXPECT_FALSE(app_info); } TEST_F(SafeDialAppInfoParserTest, TestValidXml) { std::string xml_text(kValidAppInfoXml); std::unique_ptr<ParsedDialAppInfo> app_info = - Parse(xml_text, SafeDialAppInfoParser::ParsingError::kNone); + Parse(xml_text, SafeDialAppInfoParser::ParsingResult::kSuccess); EXPECT_EQ("YouTube", app_info->name); EXPECT_EQ(DialAppState::kRunning, app_info->state); @@ -149,7 +149,7 @@ TEST_F(SafeDialAppInfoParserTest, TestValidXmlExtraData) { std::string xml_text(kValidAppInfoXmlExtraData); std::unique_ptr<ParsedDialAppInfo> app_info = - Parse(xml_text, SafeDialAppInfoParser::ParsingError::kNone); + Parse(xml_text, SafeDialAppInfoParser::ParsingResult::kSuccess); EXPECT_EQ("YouTube", app_info->name); EXPECT_EQ(DialAppState::kRunning, app_info->state); @@ -161,28 +161,28 @@ TEST_F(SafeDialAppInfoParserTest, TestInvalidXmlNoState) { std::string xml_text(kInvalidXmlNoState); std::unique_ptr<ParsedDialAppInfo> app_info = - Parse(xml_text, SafeDialAppInfoParser::ParsingError::kFailToReadState); + Parse(xml_text, SafeDialAppInfoParser::ParsingResult::kFailToReadState); EXPECT_FALSE(app_info); } TEST_F(SafeDialAppInfoParserTest, TestInvalidXmlInvalidState) { std::string xml_text(kInvalidXmlInvalidState); std::unique_ptr<ParsedDialAppInfo> app_info = - Parse(xml_text, SafeDialAppInfoParser::ParsingError::kInvalidState); + Parse(xml_text, SafeDialAppInfoParser::ParsingResult::kInvalidState); EXPECT_FALSE(app_info); } TEST_F(SafeDialAppInfoParserTest, TestInvalidXmlNoName) { std::string xml_text(kInvalidXmlNoName); std::unique_ptr<ParsedDialAppInfo> app_info = - Parse(xml_text, SafeDialAppInfoParser::ParsingError::kMissingName); + Parse(xml_text, SafeDialAppInfoParser::ParsingResult::kMissingName); EXPECT_FALSE(app_info); } TEST_F(SafeDialAppInfoParserTest, TestInvalidXmlMultipleServices) { std::string xml_text(kInvalidXmlMultipleServices); std::unique_ptr<ParsedDialAppInfo> app_info = - Parse(xml_text, SafeDialAppInfoParser::ParsingError::kInvalidXML); + Parse(xml_text, SafeDialAppInfoParser::ParsingResult::kInvalidXML); EXPECT_FALSE(app_info); }
diff --git a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc index 1ffbffb..c3d4b91 100644 --- a/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc +++ b/chrome/browser/media/router/discovery/mdns/cast_media_sink_service_impl_unittest.cc
@@ -30,43 +30,24 @@ using ::testing::SaveArg; using ::testing::WithArgs; +namespace media_router { + namespace { -net::IPEndPoint CreateIPEndPoint(int num) { - net::IPAddress ip_address; - CHECK(ip_address.AssignFromIPLiteral( - base::StringPrintf("192.168.0.10%d", num))); - return net::IPEndPoint(ip_address, 8009 + num); -} - -media_router::MediaSinkInternal CreateCastSink(int num) { +MediaSinkInternal CreateCastSink(int num) { std::string friendly_name = base::StringPrintf("friendly name %d", num); std::string unique_id = base::StringPrintf("id %d", num); net::IPEndPoint ip_endpoint = CreateIPEndPoint(num); - media_router::MediaSink sink(unique_id, friendly_name, - media_router::SinkIconType::CAST); - media_router::CastSinkExtraData extra_data; + MediaSink sink(unique_id, friendly_name, SinkIconType::CAST); + CastSinkExtraData extra_data; extra_data.ip_endpoint = ip_endpoint; extra_data.port = ip_endpoint.port(); extra_data.model_name = base::StringPrintf("model name %d", num); extra_data.cast_channel_id = num; extra_data.capabilities = cast_channel::CastDeviceCapability::AUDIO_OUT | cast_channel::CastDeviceCapability::VIDEO_OUT; - return media_router::MediaSinkInternal(sink, extra_data); -} - -media_router::MediaSinkInternal CreateDialSink(int num) { - std::string friendly_name = base::StringPrintf("friendly name %d", num); - std::string unique_id = base::StringPrintf("id %d", num); - net::IPEndPoint ip_endpoint = CreateIPEndPoint(num); - - media_router::MediaSink sink(unique_id, friendly_name, - media_router::SinkIconType::GENERIC); - media_router::DialSinkExtraData extra_data; - extra_data.ip_address = ip_endpoint.address(); - extra_data.model_name = base::StringPrintf("model name %d", num); - return media_router::MediaSinkInternal(sink, extra_data); + return MediaSinkInternal(sink, extra_data); } MATCHER_P(RetryParamEq, expected, "") { @@ -88,8 +69,6 @@ } // namespace -namespace media_router { - class CastMediaSinkServiceImplTest : public ::testing::Test { public: CastMediaSinkServiceImplTest()
diff --git a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc index bd51923..2b3e3b8 100644 --- a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc +++ b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.cc
@@ -4,11 +4,15 @@ #include "chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.h" +#include <algorithm> #include <string> #include <utility> #include <vector> #include "base/i18n/number_formatting.h" +#include "build/build_config.h" +#include "chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver.h" +#include "chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/media_router/media_source_helper.h" #include "chrome/common/media_router/route_request_result.h" @@ -23,6 +27,11 @@ namespace { +std::string GetSinkIdForDisplay(const Display& display) { + return WiredDisplayMediaRouteProvider::kSinkPrefix + + std::to_string(display.id()); +} + bool IsPresentationSource(const std::string& media_source) { const GURL source_url(media_source); return source_url.is_valid() && source_url.SchemeIsHTTPOrHTTPS() && @@ -32,8 +41,7 @@ MediaSinkInternal CreateSinkForDisplay(const Display& display, int display_index) { - const std::string sink_id = WiredDisplayMediaRouteProvider::kSinkPrefix + - std::to_string(display.id()); + const std::string sink_id = GetSinkIdForDisplay(display); const std::string sink_name = l10n_util::GetStringFUTF8(IDS_MEDIA_ROUTER_WIRED_DISPLAY_SINK_NAME, base::FormatNumber(display_index)); @@ -66,7 +74,8 @@ mojom::MediaRouterPtr media_router, Profile* profile) : binding_(this, std::move(request)), - media_router_(std::move(media_router)) { + media_router_(std::move(media_router)), + profile_(profile) { display::Screen::GetScreen()->AddObserver(this); ReportSinkAvailability(GetSinks()); } @@ -84,16 +93,34 @@ base::TimeDelta timeout, bool incognito, CreateRouteCallback callback) { - DCHECK(!base::ContainsKey(routes_, presentation_id)); +#if defined(OS_MACOSX) + // TODO(https://crbug.com/777654): Support presenting to macOS as well. + std::move(callback).Run(base::nullopt, std::string("Not implemented"), + RouteRequestResult::UNKNOWN_ERROR); + return; +#endif + DCHECK(!base::ContainsKey(presentations_, presentation_id)); + base::Optional<Display> display = GetDisplayBySinkId(sink_id); + if (!display) { + std::move(callback).Run(base::nullopt, std::string("Display not found"), + RouteRequestResult::SINK_NOT_FOUND); + return; + } + + // If there already is a presentation on |display|, terminate it. + TerminatePresentationsOnDisplay(*display); // Use |presentation_id| as the route ID. This MRP creates only one route per // presentation ID. MediaRoute route(presentation_id, MediaSource(media_source), sink_id, "", true, true); route.set_local_presentation(true); + route.set_incognito(profile_->IsOffTheRecord()); + Presentation presentation = + CreatePresentation(presentation_id, *display, route); - // TODO(crbug.com/777654): Create a presentation receiver window. + presentation.receiver->Start(presentation_id, GURL(media_source)); + presentations_.emplace(presentation_id, std::move(presentation)); std::move(callback).Run(route, base::nullopt, RouteRequestResult::OK); - routes_.emplace(presentation_id, std::move(route)); NotifyRouteObservers(); } @@ -129,9 +156,16 @@ void WiredDisplayMediaRouteProvider::TerminateRoute( const std::string& route_id, TerminateRouteCallback callback) { - routes_.erase(route_id); - // TODO(crbug.com/777654): Destroy the presentation receiver window. - NotifyRouteObservers(); + auto it = presentations_.find(route_id); + if (it == presentations_.end()) { + std::move(callback).Run(std::string("Presentation not found"), + RouteRequestResult::ROUTE_NOT_FOUND); + return; + } + + // The presentation will be removed from |presentations_| in the termination + // callback of its receiver. + it->second.receiver->Terminate(); std::move(callback).Run(base::nullopt, RouteRequestResult::OK); } @@ -169,8 +203,8 @@ const std::string& media_source) { route_queries_.insert(media_source); std::vector<MediaRoute> route_list; - for (const auto& route : routes_) - route_list.push_back(route.second); + for (const auto& presentation : presentations_) + route_list.push_back(presentation.second.route); media_router_->OnRoutesUpdated(kProviderId, route_list, media_source, {}); } @@ -254,10 +288,20 @@ return display::Screen::GetScreen()->GetPrimaryDisplay(); } +WiredDisplayMediaRouteProvider::Presentation::Presentation( + const MediaRoute& route, + std::unique_ptr<WiredDisplayPresentationReceiver> receiver) + : route(route), receiver(std::move(receiver)) {} + +WiredDisplayMediaRouteProvider::Presentation::Presentation( + Presentation&& other) = default; + +WiredDisplayMediaRouteProvider::Presentation::~Presentation() = default; + void WiredDisplayMediaRouteProvider::NotifyRouteObservers() const { std::vector<MediaRoute> route_list; - for (const auto& route : routes_) - route_list.push_back(route.second); + for (const auto& presentation : presentations_) + route_list.push_back(presentation.second.route); for (const auto& route_query : route_queries_) media_router_->OnRoutesUpdated(kProviderId, route_list, route_query, {}); } @@ -300,4 +344,69 @@ media_router_->OnSinkAvailabilityUpdated(kProviderId, sink_availability); } +void WiredDisplayMediaRouteProvider::RemovePresentationById( + const std::string& presentation_id) { + presentations_.erase(presentation_id); + NotifyRouteObservers(); +} + +void WiredDisplayMediaRouteProvider::UpdateRouteDescription( + const std::string& presentation_id, + const std::string& title) { + auto it = presentations_.find(presentation_id); + if (it == presentations_.end()) + return; + + MediaRoute& route = it->second.route; + if (title == route.description()) + return; + + route.set_description(title); + NotifyRouteObservers(); +} + +WiredDisplayMediaRouteProvider::Presentation +WiredDisplayMediaRouteProvider::CreatePresentation( + const std::string& presentation_id, + const Display& display, + const MediaRoute& route) { + std::unique_ptr<WiredDisplayPresentationReceiver> receiver = + WiredDisplayPresentationReceiverFactory::Create( + profile_, display.bounds(), + base::BindOnce( + &WiredDisplayMediaRouteProvider::RemovePresentationById, + base::Unretained(this), presentation_id), + base::BindRepeating( + &WiredDisplayMediaRouteProvider::UpdateRouteDescription, + base::Unretained(this), presentation_id)); + return Presentation(route, std::move(receiver)); +} + +void WiredDisplayMediaRouteProvider::TerminatePresentationsOnDisplay( + const display::Display& display) { + std::vector<WiredDisplayPresentationReceiver*> presentations_to_terminate; + // We cannot call Terminate() on the receiver while iterating over + // |presentations_| because that might invoke a callback to delete the + // presentation from |presentations_|. + for (const auto& presentation : presentations_) { + if (presentation.second.route.media_sink_id() == + GetSinkIdForDisplay(display)) { + presentations_to_terminate.push_back(presentation.second.receiver.get()); + } + } + for (auto* presentation_to_terminate : presentations_to_terminate) + presentation_to_terminate->Terminate(); +} + +base::Optional<Display> WiredDisplayMediaRouteProvider::GetDisplayBySinkId( + const std::string& sink_id) const { + std::vector<Display> displays = GetAllDisplays(); + auto it = std::find_if(displays.begin(), displays.end(), + [&sink_id](const Display& d) { + return GetSinkIdForDisplay(d) == sink_id; + }); + return it == displays.end() ? base::nullopt + : base::make_optional<Display>(std::move(*it)); +} + } // namespace media_router
diff --git a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.h b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.h index 903be19..1ac1211a 100644 --- a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.h +++ b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.h
@@ -5,18 +5,28 @@ #ifndef CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_WIRED_DISPLAY_WIRED_DISPLAY_MEDIA_ROUTE_PROVIDER_H_ #define CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_WIRED_DISPLAY_WIRED_DISPLAY_MEDIA_ROUTE_PROVIDER_H_ +#include <map> +#include <memory> +#include <string> +#include <utility> +#include <vector> + +#include "base/callback.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "chrome/browser/media/router/discovery/media_sink_discovery_metrics.h" #include "chrome/common/media_router/media_route_provider_helper.h" #include "chrome/common/media_router/mojo/media_router.mojom.h" #include "mojo/public/cpp/bindings/binding.h" +#include "ui/display/display.h" #include "ui/display/display_observer.h" class Profile; namespace media_router { +class WiredDisplayPresentationReceiver; + // A MediaRouteProvider class that provides wired displays as media sinks. // A display can be used as a sink if it is secondary and does not mirror a // primary display. @@ -100,6 +110,20 @@ virtual display::Display GetPrimaryDisplay() const; private: + struct Presentation { + public: + Presentation(const MediaRoute& route, + std::unique_ptr<WiredDisplayPresentationReceiver> receiver); + Presentation(Presentation&& other); + ~Presentation(); + + MediaRoute route; + std::unique_ptr<WiredDisplayPresentationReceiver> receiver; + + private: + DISALLOW_COPY_AND_ASSIGN(Presentation); + }; + // Sends the current list of routes to each query in |route_queries_|. void NotifyRouteObservers() const; @@ -109,6 +133,26 @@ // Notifies |media_router_| of the current sink availability. void ReportSinkAvailability(const std::vector<MediaSinkInternal>& sinks); + // Removes the presentation from |presentations_| and notifies route + // observers. + void RemovePresentationById(const std::string& presentation_id); + + // Updates the description for the route associated with |presentation_id|, + // and notifies route observers if the description changed. + void UpdateRouteDescription(const std::string& presentation_id, + const std::string& title); + + Presentation CreatePresentation(const std::string& presentation_id, + const display::Display& display, + const MediaRoute& media_route); + + // Terminates all presentation receivers on |display|. + void TerminatePresentationsOnDisplay(const display::Display& display); + + // Returns a display associated with |sink_id|, or a nullopt if not found. + base::Optional<display::Display> GetDisplayBySinkId( + const std::string& sink_id) const; + // Returns a list of available sinks. A display can be a sink if it is // secondary and does not mirror a primary display. std::vector<MediaSinkInternal> GetSinks() const; @@ -122,8 +166,12 @@ // Mojo pointer to the Media Router. mojom::MediaRouterPtr media_router_; - // Active routes managed by this provider. - base::flat_map<MediaRoute::Id, MediaRoute> routes_; + // Presentation profiles are created based on this original profile. This + // profile is not owned by |this|. + Profile* profile_; + + // Map from presentation IDs to active presentations managed by this provider. + std::map<std::string, Presentation> presentations_; // A set of MediaSource IDs associated with queries for MediaRoute updates. base::flat_set<std::string> route_queries_; @@ -133,6 +181,8 @@ // Used for recording UMA metrics for the number of sinks available. WiredDisplayDeviceCountMetrics device_count_metrics_; + + DISALLOW_COPY_AND_ASSIGN(WiredDisplayMediaRouteProvider); }; } // namespace media_router
diff --git a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider_unittest.cc b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider_unittest.cc index c5308c2..75be9c0 100644 --- a/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider_unittest.cc +++ b/chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider_unittest.cc
@@ -5,6 +5,9 @@ #include "chrome/browser/media/router/providers/wired_display/wired_display_media_route_provider.h" #include "base/run_loop.h" +#include "build/build_config.h" +#include "chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver.h" +#include "chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver_factory.h" #include "chrome/browser/media/router/test/mock_mojo_media_router.h" #include "chrome/common/media_router/mojo/media_router.mojom.h" #include "chrome/test/base/testing_profile.h" @@ -41,6 +44,66 @@ std::to_string(display.id()); } +class MockPresentationReceiver : public WiredDisplayPresentationReceiver { + public: + MOCK_METHOD2(Start, + void(const std::string& presentation_id, const GURL& start_url)); + void Terminate() override { TerminateInternal(); } + MOCK_METHOD0(TerminateInternal, void()); + + void SetTerminationCallback(base::OnceClosure termination_callback) { + termination_callback_ = std::move(termination_callback); + } + + void SetTitleChangeCallback( + base::RepeatingCallback<void(const std::string&)> title_change_callback) { + title_change_callback_ = std::move(title_change_callback); + } + + void RunTerminationCallback() { std::move(termination_callback_).Run(); } + + void RunTitleChangeCallback(const std::string& new_title) { + title_change_callback_.Run(new_title); + } + + private: + base::OnceClosure termination_callback_; + base::RepeatingCallback<void(const std::string&)> title_change_callback_; +}; + +class MockReceiverCreator { + public: + MockReceiverCreator() + : unique_receiver_(std::make_unique<MockPresentationReceiver>()), + receiver_(unique_receiver_.get()) {} + ~MockReceiverCreator() = default; + + // This should be called only once in the lifetime of this object. + std::unique_ptr<WiredDisplayPresentationReceiver> CreateReceiver( + Profile* profile, + const gfx::Rect& bounds, + base::OnceClosure termination_callback, + base::RepeatingCallback<void(const std::string&)> title_change_callback) { + CHECK(unique_receiver_); + unique_receiver_->SetTerminationCallback(std::move(termination_callback)); + unique_receiver_->SetTitleChangeCallback(std::move(title_change_callback)); + return std::move(unique_receiver_); + } + + MockPresentationReceiver* receiver() { return receiver_; } + + private: + // Initialized in the ctor instead of CreateReceiver() so that the receiver() + // getter is valid even before CreateReceiver() is called. + // When CreateReceiver() is called, the ownership of |unique_receiver_| gets + // transferred to the caller. + std::unique_ptr<MockPresentationReceiver> unique_receiver_; + + // Retains a reference to |unique_receiver_| even after |this| loses its + // ownership. + MockPresentationReceiver* const receiver_; +}; + const char kPresentationSource[] = "https://www.example.com/presentation"; const char kNonPresentationSource[] = "not://a.valid.presentation/source"; const MediaRouteProviderId kProviderId = MediaRouteProviderId::WIRED_DISPLAY; @@ -105,6 +168,9 @@ mojo::MakeRequest(&provider_pointer_), std::move(router_pointer), &profile_); provider_->set_primary_display(primary_display_); + WiredDisplayPresentationReceiverFactory::SetCreateReceiverCallbackForTest( + base::BindRepeating(&MockReceiverCreator::CreateReceiver, + base::Unretained(&receiver_creator_))); } void TearDown() override { @@ -129,6 +195,8 @@ Display primary_display_; Display mirror_display_; // Has the same bounds as |primary_display_|. + MockReceiverCreator receiver_creator_; + private: content::TestBrowserThreadBundle test_thread_bundle_; TestingProfile profile_; @@ -198,10 +266,13 @@ base::RunLoop().RunUntilIdle(); } +#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_WIN) +// TODO(https://crbug.com/777654): Support presenting to macOS as well. TEST_F(WiredDisplayMediaRouteProviderTest, CreateAndTerminateRoute) { const std::string presentation_id = "presentationId"; MockCallback callback; + provider_->set_all_displays({sink_display1_, primary_display_}); provider_pointer_->StartObservingMediaRoutes(kPresentationSource); base::RunLoop().RunUntilIdle(); @@ -220,6 +291,8 @@ EXPECT_EQ(routes.size(), 1u); EXPECT_EQ(routes[0].media_route_id(), presentation_id); }))); + EXPECT_CALL(*receiver_creator_.receiver(), + Start(presentation_id, GURL(kPresentationSource))); provider_pointer_->CreateRoute( kPresentationSource, GetSinkId(sink_display1_), presentation_id, url::Origin::Create(GURL(kPresentationSource)), 0, @@ -227,15 +300,31 @@ base::BindOnce(&MockCallback::CreateRoute, base::Unretained(&callback))); base::RunLoop().RunUntilIdle(); + const std::string new_description = "New Page Description"; + EXPECT_CALL(router_, OnRoutesUpdated(kProviderId, _, kPresentationSource, _)) + .WillOnce(WithArg<1>( + Invoke([&new_description](const std::vector<MediaRoute>& routes) { + EXPECT_EQ(routes.size(), 1u); + EXPECT_EQ(routes[0].description(), new_description); + }))); + receiver_creator_.receiver()->RunTitleChangeCallback(new_description); + base::RunLoop().RunUntilIdle(); + // Terminate the route. EXPECT_CALL(callback, TerminateRoute(base::Optional<std::string>(), RouteRequestResult::OK)); - EXPECT_CALL(router_, OnRoutesUpdated(kProviderId, IsEmpty(), - kPresentationSource, IsEmpty())); + EXPECT_CALL(*receiver_creator_.receiver(), TerminateInternal()); provider_pointer_->TerminateRoute( presentation_id, base::BindOnce(&MockCallback::TerminateRoute, base::Unretained(&callback))); base::RunLoop().RunUntilIdle(); + + // The presentation should not be removed until the receiver's termination + // callback is called. + EXPECT_CALL(router_, OnRoutesUpdated(kProviderId, IsEmpty(), + kPresentationSource, IsEmpty())); + receiver_creator_.receiver()->RunTerminationCallback(); } +#endif // defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_WIN) } // namespace media_router
diff --git a/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver.h b/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver.h new file mode 100644 index 0000000..4bf5745 --- /dev/null +++ b/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver.h
@@ -0,0 +1,37 @@ +// Copyright 2018 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_MEDIA_ROUTER_PROVIDERS_WIRED_DISPLAY_WIRED_DISPLAY_PRESENTATION_RECEIVER_H_ +#define CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_WIRED_DISPLAY_WIRED_DISPLAY_PRESENTATION_RECEIVER_H_ + +#include <string> + +#include "base/callback.h" +#include "base/macros.h" + +class GURL; + +namespace media_router { + +// An interface for receivers used by WiredDisplayMediaRouteProvider for +// launching presentations on wired displays. +class WiredDisplayPresentationReceiver { + public: + WiredDisplayPresentationReceiver() = default; + virtual ~WiredDisplayPresentationReceiver() = default; + + // Starts a presentation with the given ID and URL. + virtual void Start(const std::string& presentation_id, + const GURL& start_url) = 0; + + // Terminates the presentation. + virtual void Terminate() = 0; + + private: + DISALLOW_COPY_AND_ASSIGN(WiredDisplayPresentationReceiver); +}; + +} // namespace media_router + +#endif // CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_WIRED_DISPLAY_WIRED_DISPLAY_PRESENTATION_RECEIVER_H_
diff --git a/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver_factory.cc b/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver_factory.cc new file mode 100644 index 0000000..92240399 --- /dev/null +++ b/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver_factory.cc
@@ -0,0 +1,64 @@ +// Copyright 2018 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/media/router/providers/wired_display/wired_display_presentation_receiver_factory.h" + +#include <utility> + +#include "build/build_config.h" + +#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_WIN) +#include "chrome/browser/ui/media_router/presentation_receiver_window_controller.h" +#endif + +namespace media_router { + +namespace { + +base::LazyInstance<WiredDisplayPresentationReceiverFactory>::Leaky factory = + LAZY_INSTANCE_INITIALIZER; + +} // namespace + +// static +std::unique_ptr<WiredDisplayPresentationReceiver> +WiredDisplayPresentationReceiverFactory::Create( + Profile* profile, + const gfx::Rect& bounds, + base::OnceClosure termination_callback, + base::RepeatingCallback<void(const std::string&)> title_change_callback) { +#if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_WIN) + if (GetInstance()->create_receiver_for_testing_) { + return GetInstance()->create_receiver_for_testing_.Run( + profile, bounds, std::move(termination_callback), + std::move(title_change_callback)); + } + return PresentationReceiverWindowController::CreateFromOriginalProfile( + profile, bounds, std::move(termination_callback), + std::move(title_change_callback)); +#else + // TODO(https://crbug.com/777654): Support presenting to macOS as well. + return nullptr; +#endif +} + +// static +void WiredDisplayPresentationReceiverFactory::SetCreateReceiverCallbackForTest( + WiredDisplayPresentationReceiverFactory::CreateReceiverCallback callback) { + GetInstance()->create_receiver_for_testing_ = std::move(callback); +} + +WiredDisplayPresentationReceiverFactory:: + WiredDisplayPresentationReceiverFactory() = default; + +WiredDisplayPresentationReceiverFactory:: + ~WiredDisplayPresentationReceiverFactory() = default; + +// static +WiredDisplayPresentationReceiverFactory* +WiredDisplayPresentationReceiverFactory::GetInstance() { + return &factory.Get(); +} + +} // namespace media_router
diff --git a/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver_factory.h b/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver_factory.h new file mode 100644 index 0000000..b3fb69f --- /dev/null +++ b/chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver_factory.h
@@ -0,0 +1,61 @@ +// Copyright 2018 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_MEDIA_ROUTER_PROVIDERS_WIRED_DISPLAY_WIRED_DISPLAY_PRESENTATION_RECEIVER_FACTORY_H_ +#define CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_WIRED_DISPLAY_WIRED_DISPLAY_PRESENTATION_RECEIVER_FACTORY_H_ + +#include <memory> +#include <string> + +#include "base/callback.h" +#include "base/lazy_instance.h" +#include "chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver.h" + +class Profile; + +namespace gfx { +class Rect; +} // namespace gfx + +namespace media_router { + +// A factory for creating a platform-specific WiredDisplayPresentationReceiver. +class WiredDisplayPresentationReceiverFactory { + public: + using CreateReceiverCallback = + base::RepeatingCallback<std::unique_ptr<WiredDisplayPresentationReceiver>( + Profile* profile, + const gfx::Rect& bounds, + base::OnceClosure termination_callback, + base::RepeatingCallback<void(const std::string&)> + title_change_callback)>; + + static std::unique_ptr<WiredDisplayPresentationReceiver> Create( + Profile* profile, + const gfx::Rect& bounds, + base::OnceClosure termination_callback, + base::RepeatingCallback<void(const std::string&)> title_change_callback); + + // Sets the callback used to instantiate a presentation receiver. Used only in + // tests. + static void SetCreateReceiverCallbackForTest(CreateReceiverCallback callback); + + private: + friend struct base::LazyInstanceTraitsBase< + WiredDisplayPresentationReceiverFactory>; + + WiredDisplayPresentationReceiverFactory(); + virtual ~WiredDisplayPresentationReceiverFactory(); + + static WiredDisplayPresentationReceiverFactory* GetInstance(); + + // Used in tests. When this is set, it is used for creating a receiver. + CreateReceiverCallback create_receiver_for_testing_; + + DISALLOW_COPY_AND_ASSIGN(WiredDisplayPresentationReceiverFactory); +}; + +} // namespace media_router + +#endif // CHROME_BROWSER_MEDIA_ROUTER_PROVIDERS_WIRED_DISPLAY_WIRED_DISPLAY_PRESENTATION_RECEIVER_FACTORY_H_
diff --git a/chrome/browser/media/router/test/test_helper.cc b/chrome/browser/media/router/test/test_helper.cc index 0a25cce..ea890da 100644 --- a/chrome/browser/media/router/test/test_helper.cc +++ b/chrome/browser/media/router/test/test_helper.cc
@@ -6,7 +6,9 @@ #include "base/base64.h" #include "base/json/string_escape.h" +#include "base/strings/stringprintf.h" #include "chrome/common/media_router/media_source.h" +#include "url/gurl.h" namespace media_router { @@ -59,4 +61,26 @@ MockCastMediaSinkService::~MockCastMediaSinkService() = default; #endif // !defined(OS_ANDROID) +net::IPEndPoint CreateIPEndPoint(int num) { + net::IPAddress ip_address; + CHECK(ip_address.AssignFromIPLiteral( + base::StringPrintf("192.168.0.10%d", num))); + return net::IPEndPoint(ip_address, 8009 + num); +} + +MediaSinkInternal CreateDialSink(int num) { + std::string friendly_name = base::StringPrintf("friendly name %d", num); + std::string unique_id = base::StringPrintf("id %d", num); + net::IPEndPoint ip_endpoint = CreateIPEndPoint(num); + + media_router::MediaSink sink(unique_id, friendly_name, + media_router::SinkIconType::GENERIC); + media_router::DialSinkExtraData extra_data; + extra_data.ip_address = ip_endpoint.address(); + extra_data.model_name = base::StringPrintf("model name %d", num); + extra_data.app_url = + GURL(base::StringPrintf("http://192.168.0.10%d/apps", num)); + return media_router::MediaSinkInternal(sink, extra_data); +} + } // namespace media_router
diff --git a/chrome/browser/media/router/test/test_helper.h b/chrome/browser/media/router/test/test_helper.h index 8ef5ef1..46b8d62 100644 --- a/chrome/browser/media/router/test/test_helper.h +++ b/chrome/browser/media/router/test/test_helper.h
@@ -19,8 +19,10 @@ #include "chrome/browser/media/router/issues_observer.h" #include "chrome/browser/media/router/media_routes_observer.h" #include "chrome/browser/media/router/media_sinks_observer.h" +#include "chrome/common/media_router/discovery/media_sink_internal.h" #include "content/public/browser/presentation_service_delegate.h" #include "content/public/common/presentation_connection_message.h" +#include "net/base/ip_endpoint.h" #include "testing/gmock/include/gmock/gmock.h" namespace media_router { @@ -133,6 +135,24 @@ }; #endif // !defined(OS_ANDROID) +// Helper function to create an IP endpoint object. +// If |num| is 1, returns 192.168.0.101:8009; +// If |num| is 2, returns 192.168.0.102:8009. +net::IPEndPoint CreateIPEndPoint(int num); + +// Helper function to create a DIAL media sink object. +// If |num| is 1, returns a media sink object with following data: +// { +// id: "id 1", +// name: "friendly name 1", +// extra_data { +// model_name: "model name 1" +// ip_address: 192.168.1.101, +// app_url: "http://192.168.0.101/apps" +// } +// } +MediaSinkInternal CreateDialSink(int num); + } // namespace media_router #endif // CHROME_BROWSER_MEDIA_ROUTER_TEST_TEST_HELPER_H_
diff --git a/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.cc b/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.cc index 2d9e4ae..85b0a0b 100644 --- a/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.cc +++ b/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.cc
@@ -54,7 +54,7 @@ base::string16 ScreenCaptureInfoBarDelegateAndroid::GetMessageText() const { return l10n_util::GetStringFUTF16( - IDS_MEDIA_CAPTURE_SCREEN, + IDS_MEDIA_CAPTURE_SCREEN_INFOBAR_TEXT, url_formatter::FormatUrlForSecurityDisplay(request_.security_origin)); }
diff --git a/chrome/browser/metrics/ukm_browsertest.cc b/chrome/browser/metrics/ukm_browsertest.cc index 117d4a83..40408f7 100644 --- a/chrome/browser/metrics/ukm_browsertest.cc +++ b/chrome/browser/metrics/ukm_browsertest.cc
@@ -18,6 +18,7 @@ #include "components/sync/driver/sync_service.h" #include "components/sync/test/fake_server/fake_server_network_resources.h" #include "components/ukm/ukm_service.h" +#include "components/ukm/ukm_source.h" #include "content/public/browser/browsing_data_remover.h" #include "content/public/common/content_switches.h" #include "content/public/test/browsing_data_remover_test_util.h" @@ -44,7 +45,7 @@ content::BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB, &observer); observer.BlockUntilCompletion(); // Make sure HistoryServiceObservers have a chance to be notified. - content::RunAllPendingInMessageLoop(); + content::RunAllTasksUntilIdle(); } } // namespace @@ -90,14 +91,14 @@ auto* service = ukm_service(); return service ? service->client_id_ : 0; } - bool has_source_data() const { + bool HasDummySource(ukm::SourceId source_id) const { auto* service = ukm_service(); - return service ? !service->sources().empty() : false; + return service ? !!service->sources().count(source_id) : false; } - void RecordDummySource() { + void RecordDummySource(ukm::SourceId source_id) { auto* service = ukm_service(); if (service) - service->UpdateSourceURL(1, GURL("http://example.com")); + service->UpdateSourceURL(source_id, GURL("http://example.com")); } protected: @@ -452,11 +453,14 @@ EXPECT_TRUE(ukm_enabled()); uint64_t original_client_id = client_id(); - RecordDummySource(); - EXPECT_TRUE(has_source_data()); + const ukm::SourceId kDummySourceId = 0x54321; + RecordDummySource(kDummySourceId); + EXPECT_TRUE(HasDummySource(kDummySourceId)); ClearBrowsingData(profile); - EXPECT_FALSE(has_source_data()); + // Other sources may already have been recorded since the data was cleared, + // but the dummy source should be gone. + EXPECT_FALSE(HasDummySource(kDummySourceId)); // Client ID should NOT be reset. EXPECT_EQ(original_client_id, client_id()); EXPECT_TRUE(ukm_enabled());
diff --git a/chrome/browser/mod_pagespeed/mod_pagespeed_metrics_unittest.cc b/chrome/browser/mod_pagespeed/mod_pagespeed_metrics_unittest.cc index b373b22..e01f919 100644 --- a/chrome/browser/mod_pagespeed/mod_pagespeed_metrics_unittest.cc +++ b/chrome/browser/mod_pagespeed/mod_pagespeed_metrics_unittest.cc
@@ -21,7 +21,6 @@ // Ensure that we count PageSpeed headers correctly. TEST(ModPagespeedMetricsTest, CountPageSpeedHeadersTest) { - base::StatisticsRecorder::Initialize(); GURL url("http://google.com"); std::string temp("HTTP/1.1 200 OK\n\n"); std::replace(temp.begin(), temp.end(), '\n', '\0');
diff --git a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc index 992f330..c0cb95f68 100644 --- a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc +++ b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc
@@ -13,6 +13,7 @@ #include "base/strings/string_split.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/component_updater/pnacl_component_installer.h" +#include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/nacl_host/nacl_infobar_delegate.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" @@ -63,7 +64,7 @@ int render_view_id) { content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, - base::BindOnce(&NaClInfoBarDelegate::Create, render_process_id, + base::BindOnce(&CreateInfoBarOnUiThread, render_process_id, render_view_id)); } @@ -190,6 +191,23 @@ #endif } +// static +void NaClBrowserDelegateImpl::CreateInfoBarOnUiThread(int render_process_id, + int render_view_id) { + content::RenderViewHost* rvh = + content::RenderViewHost::FromID(render_process_id, render_view_id); + if (!rvh) + return; + content::WebContents* web_contents = + content::WebContents::FromRenderViewHost(rvh); + if (!web_contents) + return; + InfoBarService* infobar_service = + InfoBarService::FromWebContents(web_contents); + if (infobar_service) + NaClInfoBarDelegate::Create(infobar_service); +} + #if BUILDFLAG(ENABLE_EXTENSIONS) scoped_refptr<extensions::InfoMap> NaClBrowserDelegateImpl::GetExtensionInfoMap( const base::FilePath& profile_directory) {
diff --git a/chrome/browser/nacl_host/nacl_browser_delegate_impl.h b/chrome/browser/nacl_host/nacl_browser_delegate_impl.h index 08ec6b4..b3d2727c 100644 --- a/chrome/browser/nacl_host/nacl_browser_delegate_impl.h +++ b/chrome/browser/nacl_host/nacl_browser_delegate_impl.h
@@ -49,6 +49,11 @@ const GURL& manifest_url) override; private: + // Creates a NaCl infobar and delegate for the given render process and view + // IDs. Should be called on the UI thread. + static void CreateInfoBarOnUiThread(int render_process_id, + int render_view_id); + #if BUILDFLAG(ENABLE_EXTENSIONS) scoped_refptr<extensions::InfoMap> GetExtensionInfoMap( const base::FilePath& profile_directory);
diff --git a/chrome/browser/nacl_host/nacl_infobar_delegate.cc b/chrome/browser/nacl_host/nacl_infobar_delegate.cc index ca99b26..69da54d 100644 --- a/chrome/browser/nacl_host/nacl_infobar_delegate.cc +++ b/chrome/browser/nacl_host/nacl_infobar_delegate.cc
@@ -8,28 +8,14 @@ #include "chrome/grit/generated_resources.h" #include "components/infobars/core/infobar.h" #include "components/strings/grit/components_strings.h" -#include "content/public/browser/render_view_host.h" -#include "content/public/browser/web_contents.h" #include "ui/base/l10n/l10n_util.h" #include "url/gurl.h" // static -void NaClInfoBarDelegate::Create(int render_process_id, int render_view_id) { - content::RenderViewHost* rvh = - content::RenderViewHost::FromID(render_process_id, render_view_id); - if (!rvh) - return; - content::WebContents* web_contents = - content::WebContents::FromRenderViewHost(rvh); - if (!web_contents) - return; - InfoBarService* infobar_service = - InfoBarService::FromWebContents(web_contents); - if (infobar_service) { - infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( - std::unique_ptr<ConfirmInfoBarDelegate>(new NaClInfoBarDelegate()))); - } +void NaClInfoBarDelegate::Create(InfoBarService* infobar_service) { + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( + std::unique_ptr<ConfirmInfoBarDelegate>(new NaClInfoBarDelegate()))); } NaClInfoBarDelegate::NaClInfoBarDelegate() : ConfirmInfoBarDelegate() {
diff --git a/chrome/browser/nacl_host/nacl_infobar_delegate.h b/chrome/browser/nacl_host/nacl_infobar_delegate.h index 7545fd7..e47e2b4 100644 --- a/chrome/browser/nacl_host/nacl_infobar_delegate.h +++ b/chrome/browser/nacl_host/nacl_infobar_delegate.h
@@ -5,14 +5,15 @@ #ifndef CHROME_BROWSER_NACL_HOST_NACL_INFOBAR_DELEGATE_H_ #define CHROME_BROWSER_NACL_HOST_NACL_INFOBAR_DELEGATE_H_ -#include "base/macros.h" #include "components/infobars/core/confirm_infobar_delegate.h" +class InfoBarService; + class NaClInfoBarDelegate : public ConfirmInfoBarDelegate { public: - // Creates a NaCl infobar and delegate and adds the infobar to the infobar - // service corresponding to the given render process and view IDs. - static void Create(int render_process_id, int render_view_id); + // Creates a NaCl infobar and delegate and adds the infobar to + // |infobar_service|. + static void Create(InfoBarService* infobar_service); private: NaClInfoBarDelegate();
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc index e0e3705..99852fd 100644 --- a/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc +++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_settings_android.cc
@@ -216,7 +216,9 @@ if (!lengths.empty()) { DCHECK_EQ(lengths.size(), data_reduction_proxy::kNumDaysInHistory); - env->SetLongArrayRegion(result, 0, lengths.size(), &lengths[0]); + std::vector<jlong> lengths_jlong(lengths.begin(), lengths.end()); + env->SetLongArrayRegion(result, 0, lengths_jlong.size(), + lengths_jlong.data()); return ScopedJavaLocalRef<jlongArray>(env, result); }
diff --git a/chrome/browser/notifications/notification_display_service_impl.h b/chrome/browser/notifications/notification_display_service_impl.h index e862023e..8a8fc6c 100644 --- a/chrome/browser/notifications/notification_display_service_impl.h +++ b/chrome/browser/notifications/notification_display_service_impl.h
@@ -39,13 +39,14 @@ // notification. Consumers include, service workers, pages, extensions... // // TODO(peter): Remove this in favor of multiple targetted methods. - void ProcessNotificationOperation(NotificationCommon::Operation operation, - NotificationHandler::Type notification_type, - const GURL& origin, - const std::string& notification_id, - const base::Optional<int>& action_index, - const base::Optional<base::string16>& reply, - const base::Optional<bool>& by_user); + virtual void ProcessNotificationOperation( + NotificationCommon::Operation operation, + NotificationHandler::Type notification_type, + const GURL& origin, + const std::string& notification_id, + const base::Optional<int>& action_index, + const base::Optional<base::string16>& reply, + const base::Optional<bool>& by_user); // Registers an implementation object to handle notification operations // for |notification_type|.
diff --git a/chrome/browser/notifications/notification_display_service_tester.cc b/chrome/browser/notifications/notification_display_service_tester.cc index 0288988..81b3b444 100644 --- a/chrome/browser/notifications/notification_display_service_tester.cc +++ b/chrome/browser/notifications/notification_display_service_tester.cc
@@ -143,3 +143,9 @@ bool by_user) { display_service_->RemoveAllNotifications(type, by_user); } + +void NotificationDisplayServiceTester::SetProcessNotificationOperationDelegate( + const StubNotificationDisplayService::ProcessNotificationOperationCallback& + delegate) { + display_service_->SetProcessNotificationOperationDelegate(delegate); +}
diff --git a/chrome/browser/notifications/notification_display_service_tester.h b/chrome/browser/notifications/notification_display_service_tester.h index a2039d0..fe20e7e3 100644 --- a/chrome/browser/notifications/notification_display_service_tester.h +++ b/chrome/browser/notifications/notification_display_service_tester.h
@@ -12,9 +12,9 @@ #include "base/optional.h" #include "base/strings/string16.h" #include "chrome/browser/notifications/notification_common.h" +#include "chrome/browser/notifications/stub_notification_display_service.h" class Profile; -class StubNotificationDisplayService; namespace message_center { class Notification; @@ -73,6 +73,11 @@ // Removes all notifications of the given |type|. void RemoveAllNotifications(NotificationHandler::Type type, bool by_user); + // Sets a |delegate| to notify when ProcessNotificationOperation is called. + void SetProcessNotificationOperationDelegate( + const StubNotificationDisplayService:: + ProcessNotificationOperationCallback& delegate); + private: Profile* profile_; StubNotificationDisplayService* display_service_;
diff --git a/chrome/browser/notifications/notification_platform_bridge_linux.cc b/chrome/browser/notifications/notification_platform_bridge_linux.cc index a6cf652..e879670 100644 --- a/chrome/browser/notifications/notification_platform_bridge_linux.cc +++ b/chrome/browser/notifications/notification_platform_bridge_linux.cc
@@ -88,6 +88,13 @@ // The maximum amount of characters for displaying the full origin path. const size_t kMaxAllowedOriginLength = 28; +// Notification urgency levels, as specified in the FDO notification spec. +enum FdoUrgency { + URGENCY_LOW = 0, + URGENCY_NORMAL = 1, + URGENCY_CRITICAL = 2, +}; + // The values in this enumeration correspond to those of the // Linux.NotificationPlatformBridge.InitializationStatus histogram, so // the ordering should not be changed. New error codes should be @@ -126,22 +133,17 @@ } int NotificationPriorityToFdoUrgency(int priority) { - enum FdoUrgency { - LOW = 0, - NORMAL = 1, - CRITICAL = 2, - }; switch (priority) { case message_center::MIN_PRIORITY: case message_center::LOW_PRIORITY: - return LOW; + return URGENCY_LOW; case message_center::HIGH_PRIORITY: case message_center::MAX_PRIORITY: - return CRITICAL; + return URGENCY_CRITICAL; default: NOTREACHED(); case message_center::DEFAULT_PRIORITY: - return NORMAL; + return URGENCY_NORMAL; } } @@ -627,8 +629,11 @@ dbus::MessageWriter urgency_writer(nullptr); hints_writer.OpenDictEntry(&urgency_writer); urgency_writer.AppendString("urgency"); - urgency_writer.AppendVariantOfUint32( - NotificationPriorityToFdoUrgency(notification->priority())); + uint32_t urgency = + notification->never_timeout() + ? URGENCY_CRITICAL + : NotificationPriorityToFdoUrgency(notification->priority()); + urgency_writer.AppendVariantOfUint32(urgency); hints_writer.CloseContainer(&urgency_writer); if (notification->silent()) {
diff --git a/chrome/browser/notifications/notification_platform_bridge_win.cc b/chrome/browser/notifications/notification_platform_bridge_win.cc index 65e90c8..8e2440f4 100644 --- a/chrome/browser/notifications/notification_platform_bridge_win.cc +++ b/chrome/browser/notifications/notification_platform_bridge_win.cc
@@ -4,7 +4,9 @@ #include "chrome/browser/notifications/notification_platform_bridge_win.h" +#include <NotificationActivationCallback.h> #include <activation.h> +#include <wrl.h> #include <wrl/client.h> #include <wrl/event.h> #include <wrl/wrappers/corewrappers.h> @@ -16,10 +18,13 @@ #include "base/logging.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" +#include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/task_scheduler/post_task.h" #include "base/win/core_winrt_util.h" #include "base/win/scoped_hstring.h" +#include "base/win/scoped_winrt_initializer.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/notifications/notification_common.h" #include "chrome/browser/notifications/notification_display_service_impl.h" @@ -92,6 +97,7 @@ const std::string& notification_id, const std::string& profile_id, bool incognito, + const base::Optional<int>& action_index, const base::Optional<bool>& by_user) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); if (!g_browser_process) @@ -100,8 +106,8 @@ g_browser_process->profile_manager()->LoadProfile( profile_id, incognito, base::Bind(&ProfileLoadedCallback, operation, notification_type, origin, - notification_id, base::nullopt /*action_index*/, - base::nullopt /*reply*/, by_user)); + notification_id, action_index, base::nullopt /*reply*/, + by_user)); } } // namespace @@ -315,6 +321,60 @@ std::move(callback).Run(com_functions_initialized_); } + void HandleEvent(winui::Notifications::IToastNotification* notification, + NotificationCommon::Operation operation, + const base::Optional<int>& action_index, + const base::Optional<bool>& by_user) { + NotificationHandler::Type notification_type; + std::string notification_id; + std::string profile_id; + bool incognito; + GURL origin_url; + + std::string toast_id = GetNotificationId(notification); + if (!NotificationPlatformBridgeWin::DecodeTemplateId( + toast_id, ¬ification_type, ¬ification_id, &profile_id, + &incognito, &origin_url)) { + LOG(ERROR) << "Failed to decode template ID for operation " << operation; + return; + } + + content::BrowserThread::PostTask( + content::BrowserThread::UI, FROM_HERE, + base::BindOnce(&ForwardNotificationOperationOnUiThread, operation, + notification_type, origin_url, notification_id, + profile_id, incognito, action_index, by_user)); + } + + base::Optional<int> ParseActionIndex( + winui::Notifications::IToastActivatedEventArgs* args) { + HSTRING arguments; + HRESULT hr = args->get_Arguments(&arguments); + if (FAILED(hr)) + return base::nullopt; + + ScopedHString arguments_scoped(arguments); + std::string arguments_str = arguments_scoped.GetAsUTF8(); + std::vector<std::string> parts = base::SplitString( + arguments_str, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY); + if (parts.size() < 2 || base::CompareCaseInsensitiveASCII( + parts[0], kNotificationButtonIndex) != 0) + return base::nullopt; + int index; + if (!base::StringToInt(parts[1], &index)) + return base::nullopt; + return index; + } + + void ForwardHandleEventForTesting( + NotificationCommon::Operation operation, + winui::Notifications::IToastNotification* notification, + winui::Notifications::IToastActivatedEventArgs* args, + const base::Optional<bool>& by_user) { + base::Optional<int> action_index = ParseActionIndex(args); + HandleEvent(notification, operation, action_index, by_user); + } + private: friend class base::RefCountedThreadSafe<NotificationPlatformBridgeWinImpl>; @@ -398,34 +458,17 @@ return value.GetAsUTF8(); } - void HandleEvent(winui::Notifications::IToastNotification* notification, - NotificationCommon::Operation operation, - const base::Optional<bool>& user_cancelled) { - NotificationHandler::Type notification_type; - std::string notification_id; - std::string profile_id; - bool incognito; - GURL origin_url; - - std::string toast_id = GetNotificationId(notification); - if (!NotificationPlatformBridgeWin::DecodeTemplateId( - toast_id, ¬ification_type, ¬ification_id, &profile_id, - &incognito, &origin_url)) { - LOG(ERROR) << "Failed to decode template ID for operation " << operation; - return; - } - - content::BrowserThread::PostTask( - content::BrowserThread::UI, FROM_HERE, - base::Bind(&ForwardNotificationOperationOnUiThread, operation, - notification_type, origin_url, notification_id, profile_id, - incognito, user_cancelled)); - } - HRESULT OnActivated(winui::Notifications::IToastNotification* notification, - IInspectable* /* inspectable */) { - HandleEvent(notification, NotificationCommon::CLICK, - /*user_cancelled=*/base::nullopt); + IInspectable* inspectable) { + base::Optional<int> action_index; + + winui::Notifications::IToastActivatedEventArgs* args = nullptr; + HRESULT hr = inspectable->QueryInterface(&args); + if (SUCCEEDED(hr)) + action_index = ParseActionIndex(args); + + HandleEvent(notification, NotificationCommon::CLICK, action_index, + /*by_user=*/base::nullopt); return S_OK; } @@ -434,12 +477,13 @@ winui::Notifications::IToastDismissedEventArgs* arguments) { winui::Notifications::ToastDismissalReason reason; HRESULT hr = arguments->get_Reason(&reason); - bool user_cancelled = false; + bool by_user = false; if (SUCCEEDED(hr) && reason == winui::Notifications::ToastDismissalReason_UserCanceled) { - user_cancelled = true; + by_user = true; } - HandleEvent(notification, NotificationCommon::CLOSE, user_cancelled); + HandleEvent(notification, NotificationCommon::CLOSE, + /*action_index=*/base::nullopt, by_user); return S_OK; } @@ -540,6 +584,17 @@ impl_, base::Passed(&callback))); } +void NotificationPlatformBridgeWin::ForwardHandleEventForTesting( + NotificationCommon::Operation operation, + winui::Notifications::IToastNotification* notification, + winui::Notifications::IToastActivatedEventArgs* args, + const base::Optional<bool>& by_user) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + PostTaskToTaskRunnerThread(base::BindOnce( + &NotificationPlatformBridgeWinImpl::ForwardHandleEventForTesting, impl_, + operation, notification, args, by_user)); +} + // static bool NotificationPlatformBridgeWin::DecodeTemplateId( const std::string& encoded,
diff --git a/chrome/browser/notifications/notification_platform_bridge_win.h b/chrome/browser/notifications/notification_platform_bridge_win.h index f0aacc8..27ef6da 100644 --- a/chrome/browser/notifications/notification_platform_bridge_win.h +++ b/chrome/browser/notifications/notification_platform_bridge_win.h
@@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/optional.h" #include "base/sequenced_task_runner.h" #include "chrome/browser/notifications/notification_platform_bridge.h" @@ -41,6 +42,15 @@ friend class NotificationPlatformBridgeWinImpl; friend class NotificationPlatformBridgeWinTest; FRIEND_TEST_ALL_PREFIXES(NotificationPlatformBridgeWinTest, EncodeDecode); + FRIEND_TEST_ALL_PREFIXES(NotificationPlatformBridgeWinUITest, HandleEvent); + + // Simulates a click/dismiss event. Only for use in testing. + // Note: Ownership of |notification| and |args| is retained by the caller. + void ForwardHandleEventForTesting( + NotificationCommon::Operation operation, + ABI::Windows::UI::Notifications::IToastNotification* notification, + ABI::Windows::UI::Notifications::IToastActivatedEventArgs* args, + const base::Optional<bool>& by_user); // Takes an |encoded| string as input and decodes it, returning the values in // the out parameters. Returns true if successful, but false otherwise.
diff --git a/chrome/browser/notifications/notification_platform_bridge_win_interactive_uitest.cc b/chrome/browser/notifications/notification_platform_bridge_win_interactive_uitest.cc new file mode 100644 index 0000000..6e083a8 --- /dev/null +++ b/chrome/browser/notifications/notification_platform_bridge_win_interactive_uitest.cc
@@ -0,0 +1,262 @@ +// Copyright 2017 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 <string> + +#include <windows.data.xml.dom.h> +#include <wrl/client.h> + +#include "base/run_loop.h" +#include "base/win/scoped_hstring.h" +#include "base/win/windows_version.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/notifications/notification_display_service_tester.h" +#include "chrome/browser/notifications/notification_platform_bridge_win.h" +#include "chrome/browser/ui/browser.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" + +namespace mswr = Microsoft::WRL; +namespace winui = ABI::Windows::UI; +namespace winxml = ABI::Windows::Data::Xml; + +class NotificationPlatformBridgeWinUITest : public InProcessBrowserTest { + public: + NotificationPlatformBridgeWinUITest() = default; + ~NotificationPlatformBridgeWinUITest() override = default; + + void SetUpOnMainThread() override { + display_service_tester_ = + std::make_unique<NotificationDisplayServiceTester>( + browser()->profile()); + } + + void TearDownOnMainThread() override { display_service_tester_.reset(); } + + void HandleOperation(const base::RepeatingClosure& quit_task, + NotificationCommon::Operation operation, + NotificationHandler::Type notification_type, + const GURL& origin, + const std::string& notification_id, + const base::Optional<int>& action_index, + const base::Optional<base::string16>& reply, + const base::Optional<bool>& by_user) { + last_operation_ = operation; + last_notification_type_ = notification_type; + last_origin_ = origin; + last_notification_id_ = notification_id; + last_action_index_ = action_index; + last_reply_ = reply; + last_by_user_ = by_user; + quit_task.Run(); + } + + protected: + bool ValidateNotificationValues(NotificationCommon::Operation operation, + NotificationHandler::Type notification_type, + const GURL& origin, + const std::string& notification_id, + const base::Optional<int>& action_index, + const base::Optional<base::string16>& reply, + const base::Optional<bool>& by_user) { + return operation == last_operation_ && + notification_type == last_notification_type_ && + origin == last_origin_ && notification_id == last_notification_id_ && + action_index == last_action_index_ && reply == last_reply_ && + by_user == last_by_user_; + } + + std::unique_ptr<NotificationDisplayServiceTester> display_service_tester_; + + NotificationCommon::Operation last_operation_; + NotificationHandler::Type last_notification_type_; + GURL last_origin_; + std::string last_notification_id_; + base::Optional<int> last_action_index_; + base::Optional<base::string16> last_reply_; + base::Optional<bool> last_by_user_; + + bool delegate_called_ = false; +}; + +class MockIToastNotification : public winui::Notifications::IToastNotification { + public: + explicit MockIToastNotification(const base::string16& xml) : xml_(xml) {} + ~MockIToastNotification() = default; + + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, + void** ppvObject) override { + return E_NOTIMPL; + } + ULONG STDMETHODCALLTYPE AddRef() override { return 1; } + ULONG STDMETHODCALLTYPE Release() override { return 0; } + HRESULT STDMETHODCALLTYPE GetIids(ULONG* iidCount, IID** iids) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE GetRuntimeClassName(HSTRING* className) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE GetTrustLevel(TrustLevel* trustLevel) override { + return E_NOTIMPL; + } + + HRESULT STDMETHODCALLTYPE + get_Content(winxml::Dom::IXmlDocument** value) override { + mswr::ComPtr<ABI::Windows::Data::Xml::Dom::IXmlDocumentIO> xml_document_io; + base::win::ScopedHString id = base::win::ScopedHString::Create( + RuntimeClass_Windows_Data_Xml_Dom_XmlDocument); + HRESULT hr = Windows::Foundation::ActivateInstance( + id.get(), xml_document_io.GetAddressOf()); + if (FAILED(hr)) { + LOG(ERROR) << "Unable to instantiate XMLDocumentIO " << hr; + return hr; + } + + base::win::ScopedHString xml = base::win::ScopedHString::Create(xml_); + hr = xml_document_io->LoadXml(xml.get()); + if (FAILED(hr)) { + LOG(ERROR) << "Unable to load XML " << hr; + return hr; + } + + Microsoft::WRL::ComPtr<ABI::Windows::Data::Xml::Dom::IXmlDocument> + xml_document; + hr = xml_document_io.CopyTo(xml_document.GetAddressOf()); + if (FAILED(hr)) { + LOG(ERROR) << "Unable to copy to XMLDoc " << hr; + return hr; + } + + *value = xml_document.Detach(); + return S_OK; + } + + HRESULT STDMETHODCALLTYPE put_ExpirationTime( + __FIReference_1_Windows__CFoundation__CDateTime* value) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE get_ExpirationTime( + __FIReference_1_Windows__CFoundation__CDateTime** value) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE add_Dismissed( + __FITypedEventHandler_2_Windows__CUI__CNotifications__CToastNotification_Windows__CUI__CNotifications__CToastDismissedEventArgs* + handler, + EventRegistrationToken* cookie) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE + remove_Dismissed(EventRegistrationToken cookie) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE add_Activated( + __FITypedEventHandler_2_Windows__CUI__CNotifications__CToastNotification_IInspectable* + handler, + EventRegistrationToken* cookie) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE + remove_Activated(EventRegistrationToken cookie) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE add_Failed( + __FITypedEventHandler_2_Windows__CUI__CNotifications__CToastNotification_Windows__CUI__CNotifications__CToastFailedEventArgs* + handler, + EventRegistrationToken* token) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE + remove_Failed(EventRegistrationToken token) override { + return E_NOTIMPL; + } + + private: + base::string16 xml_; + + DISALLOW_COPY_AND_ASSIGN(MockIToastNotification); +}; + +class MockIToastActivatedEventArgs + : public winui::Notifications::IToastActivatedEventArgs { + public: + explicit MockIToastActivatedEventArgs(const base::string16& args) + : arguments_(args) {} + virtual ~MockIToastActivatedEventArgs() = default; + + // TODO(finnur): Would also like to remove these 6 functions... + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, + void** ppvObject) override { + return E_NOTIMPL; + } + ULONG STDMETHODCALLTYPE AddRef() override { return 1; } + ULONG STDMETHODCALLTYPE Release() override { return 0; } + HRESULT STDMETHODCALLTYPE GetIids(ULONG* iidCount, IID** iids) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE GetRuntimeClassName(HSTRING* className) override { + return E_NOTIMPL; + } + HRESULT STDMETHODCALLTYPE GetTrustLevel(TrustLevel* trustLevel) override { + return E_NOTIMPL; + } + + HRESULT STDMETHODCALLTYPE get_Arguments(HSTRING* value) override { + base::win::ScopedHString arguments = + base::win::ScopedHString::Create(arguments_); + *value = arguments.get(); + return S_OK; + } + + private: + base::string16 arguments_; + + DISALLOW_COPY_AND_ASSIGN(MockIToastActivatedEventArgs); +}; + +IN_PROC_BROWSER_TEST_F(NotificationPlatformBridgeWinUITest, HandleEvent) { + // This test exercises a feature that is not enabled in older versions of + // Windows. + if (base::win::GetVersion() < base::win::VERSION_WIN8) + return; + + const wchar_t kXmlDoc[] = + LR"(<toast launch="0|Default|0|https://example.com/|notification_id"> + <visual> + <binding template="ToastGeneric"> + <text>My Title</text> + <text placement="attribution">example.com</text> + </binding> + </visual> + <actions> + <action content="Click" arguments="args" activationType="foreground"/> + </actions> +</toast> +)"; + + MockIToastNotification toast(kXmlDoc); + MockIToastActivatedEventArgs args(L"buttonIndex=1"); + + base::RunLoop run_loop; + display_service_tester_->SetProcessNotificationOperationDelegate( + base::BindRepeating(&NotificationPlatformBridgeWinUITest::HandleOperation, + base::Unretained(this), run_loop.QuitClosure())); + + // Simulate clicks on the toast. + NotificationPlatformBridgeWin* bridge = + reinterpret_cast<NotificationPlatformBridgeWin*>( + g_browser_process->notification_platform_bridge()); + bridge->ForwardHandleEventForTesting(NotificationCommon::CLICK, &toast, &args, + base::nullopt); + run_loop.Run(); + + // Validate the click values. + base::Optional<int> action_index = 1; + EXPECT_EQ(NotificationCommon::CLICK, last_operation_); + EXPECT_EQ(NotificationHandler::Type::WEB_PERSISTENT, last_notification_type_); + EXPECT_EQ(GURL("https://example.com/"), last_origin_); + EXPECT_EQ("notification_id", last_notification_id_); + EXPECT_EQ(action_index, last_action_index_); + EXPECT_EQ(base::nullopt, last_reply_); + EXPECT_EQ(base::nullopt, last_by_user_); +}
diff --git a/chrome/browser/notifications/notification_template_builder.cc b/chrome/browser/notifications/notification_template_builder.cc index 005192d87..51974828 100644 --- a/chrome/browser/notifications/notification_template_builder.cc +++ b/chrome/browser/notifications/notification_template_builder.cc
@@ -35,7 +35,6 @@ const char kAudioElement[] = "audio"; const char kBindingElement[] = "binding"; const char kBindingElementTemplateAttribute[] = "template"; -const char kButtonIndex[] = "buttonIndex="; const char kContent[] = "content"; const char kContextMenu[] = "contextMenu"; const char kForeground[] = "foreground"; @@ -73,6 +72,7 @@ } // namespace +const char kNotificationButtonIndex[] = "buttonIndex"; const char kNotificationToastElement[] = "toast"; const char kNotificationLaunchAttribute[] = "launch"; @@ -344,7 +344,8 @@ xml_writer_->StartElement(kActionElement); xml_writer_->AddAttribute(kActivationType, kForeground); xml_writer_->AddAttribute(kContent, base::UTF16ToUTF8(button.title)); - std::string param = std::string(kButtonIndex) + base::IntToString(index); + std::string param = + std::string(kNotificationButtonIndex) + "=" + base::IntToString(index); xml_writer_->AddAttribute(kArguments, param); if (!button.icon.IsEmpty()) {
diff --git a/chrome/browser/notifications/notification_template_builder.h b/chrome/browser/notifications/notification_template_builder.h index 9eaba454..81267c13 100644 --- a/chrome/browser/notifications/notification_template_builder.h +++ b/chrome/browser/notifications/notification_template_builder.h
@@ -34,6 +34,9 @@ // The Notification Launch attribute name in the toast XML. extern const char kNotificationLaunchAttribute[]; +// The Notification button-index attribute. +extern const char kNotificationButtonIndex[]; + // Builds XML-based notification templates for displaying a given notification // in the Windows Action Center. //
diff --git a/chrome/browser/notifications/stub_notification_display_service.cc b/chrome/browser/notifications/stub_notification_display_service.cc index 599fc95..184a0c6 100644 --- a/chrome/browser/notifications/stub_notification_display_service.cc +++ b/chrome/browser/notifications/stub_notification_display_service.cc
@@ -175,6 +175,11 @@ } } +void StubNotificationDisplayService::SetProcessNotificationOperationDelegate( + const ProcessNotificationOperationCallback& delegate) { + process_notification_operation_delegate_ = delegate; +} + void StubNotificationDisplayService::Display( NotificationHandler::Type notification_type, const message_center::Notification& notification, @@ -215,6 +220,26 @@ callback.Run(std::move(notifications), true /* supports_synchronization */); } +void StubNotificationDisplayService::ProcessNotificationOperation( + NotificationCommon::Operation operation, + NotificationHandler::Type notification_type, + const GURL& origin, + const std::string& notification_id, + const base::Optional<int>& action_index, + const base::Optional<base::string16>& reply, + const base::Optional<bool>& by_user) { + if (process_notification_operation_delegate_) { + process_notification_operation_delegate_.Run(operation, notification_type, + origin, notification_id, + action_index, reply, by_user); + return; + } + + NotificationDisplayServiceImpl::ProcessNotificationOperation( + operation, notification_type, origin, notification_id, action_index, + reply, by_user); +} + StubNotificationDisplayService::NotificationData::NotificationData( NotificationHandler::Type type, const message_center::Notification& notification,
diff --git a/chrome/browser/notifications/stub_notification_display_service.h b/chrome/browser/notifications/stub_notification_display_service.h index 718b3e4f..32b7841 100644 --- a/chrome/browser/notifications/stub_notification_display_service.h +++ b/chrome/browser/notifications/stub_notification_display_service.h
@@ -32,6 +32,16 @@ static std::unique_ptr<KeyedService> FactoryForTests( content::BrowserContext* browser_context); + typedef base::RepeatingCallback<void( + NotificationCommon::Operation operation, + NotificationHandler::Type notification_type, + const GURL& origin, + const std::string& notification_id, + const base::Optional<int>& action_index, + const base::Optional<base::string16>& reply, + const base::Optional<bool>& by_user)> + ProcessNotificationOperationCallback; + explicit StubNotificationDisplayService(Profile* profile); ~StubNotificationDisplayService() override; @@ -75,6 +85,9 @@ void RemoveAllNotifications(NotificationHandler::Type notification_type, bool by_user); + void SetProcessNotificationOperationDelegate( + const ProcessNotificationOperationCallback& delegate); + // NotificationDisplayService implementation: void Display(NotificationHandler::Type notification_type, const message_center::Notification& notification, @@ -82,6 +95,14 @@ void Close(NotificationHandler::Type notification_type, const std::string& notification_id) override; void GetDisplayed(const DisplayedNotificationsCallback& callback) override; + void ProcessNotificationOperation( + NotificationCommon::Operation operation, + NotificationHandler::Type notification_type, + const GURL& origin, + const std::string& notification_id, + const base::Optional<int>& action_index, + const base::Optional<base::string16>& reply, + const base::Optional<bool>& by_user) override; private: // Data to store for a notification that's being shown through this service. @@ -109,6 +130,8 @@ std::vector<NotificationData> notifications_; Profile* profile_; + ProcessNotificationOperationCallback process_notification_operation_delegate_; + DISALLOW_COPY_AND_ASSIGN(StubNotificationDisplayService); };
diff --git a/chrome/browser/offline_pages/android/downloads/offline_page_infobar_delegate.cc b/chrome/browser/offline_pages/android/downloads/offline_page_infobar_delegate.cc index 235b3d2..a464f0f 100644 --- a/chrome/browser/offline_pages/android/downloads/offline_page_infobar_delegate.cc +++ b/chrome/browser/offline_pages/android/downloads/offline_page_infobar_delegate.cc
@@ -58,7 +58,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier OfflinePageInfoBarDelegate::GetIdentifier() const { - return OFFLINE_PAGE_INFOBAR_DELEGATE; + return OFFLINE_PAGE_INFOBAR_DELEGATE_ANDROID; } bool OfflinePageInfoBarDelegate::EqualsDelegate(
diff --git a/chrome/browser/offline_pages/android/offline_page_bridge.cc b/chrome/browser/offline_pages/android/offline_page_bridge.cc index 0ad7a32a..2ed92e5 100644 --- a/chrome/browser/offline_pages/android/offline_page_bridge.cc +++ b/chrome/browser/offline_pages/android/offline_page_bridge.cc
@@ -18,6 +18,7 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/strings/string16.h" +#include "base/task_scheduler/post_task.h" #include "base/time/time.h" #include "chrome/browser/android/tab_android.h" #include "chrome/browser/offline_pages/offline_page_mhtml_archiver.h" @@ -28,6 +29,7 @@ #include "chrome/browser/offline_pages/request_coordinator_factory.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_android.h" +#include "components/offline_pages/core/archive_validator.h" #include "components/offline_pages/core/background/request_coordinator.h" #include "components/offline_pages/core/background/request_queue_results.h" #include "components/offline_pages/core/background/save_page_request.h" @@ -129,6 +131,16 @@ base::android::RunCallbackAndroid(j_callback_obj, static_cast<int>(result)); } +void SelectPageCallback(const ScopedJavaGlobalRef<jobject>& j_callback_obj, + const std::vector<OfflinePageItem>& result) { + JNIEnv* env = base::android::AttachCurrentThread(); + ScopedJavaLocalRef<jobject> j_result; + + if (!result.empty()) + j_result = JNI_SavePageRequest_ToJavaOfflinePageItem(env, result.front()); + base::android::RunCallbackAndroid(j_callback_obj, j_result); +} + void SingleOfflinePageItemCallback( const ScopedJavaGlobalRef<jobject>& j_callback_obj, const OfflinePageItem* result) { @@ -153,6 +165,29 @@ base::android::RunCallbackAndroid(j_callback_obj, j_result); } +void GetLaunchUrlByOfflineIdCallback( + const ScopedJavaGlobalRef<jobject>& j_callback_obj, + const std::string& result) { + JNIEnv* env = base::android::AttachCurrentThread(); + base::android::RunCallbackAndroid(j_callback_obj, + ConvertUTF8ToJavaString(env, result)); +} + +void ValidateFileCallback(const ScopedJavaGlobalRef<jobject>& j_callback_obj, + const GURL& url, + const base::FilePath& file_path, + bool is_trusted) { + // If trusted, the launch url will be the http/https url of the offline + // page. Otherwise, the launch url will be the file URL pointing to the + // archive file of the offline page. + GURL launch_url; + if (is_trusted) + launch_url = url; + else + launch_url = net::FilePathToFileURL(file_path); + GetLaunchUrlByOfflineIdCallback(j_callback_obj, launch_url.spec()); +} + ScopedJavaLocalRef<jobjectArray> JNI_SavePageRequest_CreateJavaSavePageRequests( JNIEnv* env, std::vector<std::unique_ptr<SavePageRequest>> requests) { @@ -304,7 +339,8 @@ content::BrowserContext* browser_context, OfflinePageModel* offline_page_model) : browser_context_(browser_context), - offline_page_model_(offline_page_model) { + offline_page_model_(offline_page_model), + weak_ptr_factory_(this) { ScopedJavaLocalRef<jobject> j_offline_page_bridge = Java_OfflinePageBridge_create(env, reinterpret_cast<jlong>(this)); java_ref_.Reset(j_offline_page_bridge); @@ -490,10 +526,10 @@ ScopedJavaGlobalRef<jobject> j_callback_ref; j_callback_ref.Reset(env, j_callback_obj); - OfflinePageUtils::SelectPageForURL( + OfflinePageUtils::SelectPagesForURL( browser_context_, GURL(ConvertJavaStringToUTF8(env, j_online_url)), URLSearchMode::SEARCH_BY_ALL_URLS, tab_id, - base::Bind(&SingleOfflinePageItemCallback, j_callback_ref)); + base::Bind(&SelectPageCallback, j_callback_ref)); } void OfflinePageBridge::SavePage(JNIEnv* env, @@ -747,6 +783,39 @@ &CheckForNewOfflineContentCallback, pages_created_after, j_callback_ref)); } +void OfflinePageBridge::GetLaunchUrlByOfflineId( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jlong j_offline_id, + const base::android::JavaParamRef<jobject>& j_callback_obj) { + ScopedJavaGlobalRef<jobject> j_callback_ref(j_callback_obj); + + offline_page_model_->GetPageByOfflineId( + j_offline_id, base::Bind(&OfflinePageBridge::GetPageByOfflineIdDone, + weak_ptr_factory_.GetWeakPtr(), j_callback_ref)); +} + +void OfflinePageBridge::GetPageByOfflineIdDone( + const ScopedJavaGlobalRef<jobject>& j_callback_obj, + const OfflinePageItem* offline_page) { + if (!offline_page) { + GetLaunchUrlByOfflineIdCallback(j_callback_obj, std::string()); + return; + } + + if (offline_page_model_->IsArchiveInInternalDir(offline_page->file_path)) { + GetLaunchUrlByOfflineIdCallback(j_callback_obj, offline_page->url.spec()); + return; + } + + base::PostTaskWithTraitsAndReplyWithResult( + FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, + base::Bind(&ArchiveValidator::ValidateFile, offline_page->file_path, + offline_page->file_size, offline_page->digest), + base::Bind(&ValidateFileCallback, j_callback_obj, offline_page->url, + offline_page->file_path)); +} + void OfflinePageBridge::NotifyIfDoneLoading() const { JNIEnv* env = base::android::AttachCurrentThread(); Java_OfflinePageBridge_offlinePageModelLoaded(env, java_ref_);
diff --git a/chrome/browser/offline_pages/android/offline_page_bridge.h b/chrome/browser/offline_pages/android/offline_page_bridge.h index c623da3..42c84e4 100644 --- a/chrome/browser/offline_pages/android/offline_page_bridge.h +++ b/chrome/browser/offline_pages/android/offline_page_bridge.h
@@ -11,6 +11,7 @@ #include "base/android/jni_weak_ref.h" #include "base/android/scoped_java_ref.h" #include "base/macros.h" +#include "base/memory/weak_ptr.h" #include "base/supports_user_data.h" #include "components/offline_pages/core/offline_page_item.h" #include "components/offline_pages/core/offline_page_model.h" @@ -180,7 +181,17 @@ const jlong j_timestamp_millis, const base::android::JavaParamRef<jobject>& j_callback_obj); + void GetLaunchUrlByOfflineId( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj, + jlong j_offline_id, + const base::android::JavaParamRef<jobject>& j_callback_obj); + private: + void GetPageByOfflineIdDone( + const base::android::ScopedJavaGlobalRef<jobject>& j_callback_obj, + const OfflinePageItem* offline_page); + void NotifyIfDoneLoading() const; base::android::ScopedJavaLocalRef<jobject> CreateClientId( @@ -193,6 +204,8 @@ // Not owned. OfflinePageModel* offline_page_model_; + base::WeakPtrFactory<OfflinePageBridge> weak_ptr_factory_; + DISALLOW_COPY_AND_ASSIGN(OfflinePageBridge); };
diff --git a/chrome/browser/offline_pages/background_loader_offliner.cc b/chrome/browser/offline_pages/background_loader_offliner.cc index f3a8d1f..da12df4 100644 --- a/chrome/browser/offline_pages/background_loader_offliner.cc +++ b/chrome/browser/offline_pages/background_loader_offliner.cc
@@ -13,7 +13,6 @@ #include "base/sys_info.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/offline_pages/offline_page_mhtml_archiver.h" #include "chrome/browser/offline_pages/offliner_helper.h" @@ -64,35 +63,30 @@ error_code); } -bool IsPreviewsEnabled(const base::Value& value_navigation_data) { - if (value_navigation_data.is_none()) - return false; - - ChromeNavigationData chrome_navigation_data(value_navigation_data); - - data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data = - chrome_navigation_data.GetDataReductionProxyData(); - if (data_reduction_proxy_data && - data_reduction_proxy_data->lite_page_received()) { - return true; - } - - content::PreviewsState previews_state = - chrome_navigation_data.previews_state(); - if (previews_state != content::PreviewsTypes::PREVIEWS_OFF && - previews_state != content::PreviewsTypes::PREVIEWS_NO_TRANSFORM) { - return true; - } - - return false; -} - void RecordOffliningPreviewsUMA(const ClientId& client_id, - const base::Value& navigation_data) { + ChromeNavigationData* navigation_data) { + content::PreviewsState previews_state = content::PreviewsTypes::PREVIEWS_OFF; + if (navigation_data) + previews_state = navigation_data->previews_state(); + + int is_previews_enabled = 0; + bool lite_page_received = false; + data_reduction_proxy::DataReductionProxyData* data_reduction_proxy_data = + nullptr; + if (navigation_data) + data_reduction_proxy_data = navigation_data->GetDataReductionProxyData(); + if (data_reduction_proxy_data) + lite_page_received = data_reduction_proxy_data->lite_page_received(); + + if ((previews_state != content::PreviewsTypes::PREVIEWS_OFF && + previews_state != content::PreviewsTypes::PREVIEWS_NO_TRANSFORM) || + lite_page_received) + is_previews_enabled = 1; + base::UmaHistogramBoolean( AddHistogramSuffix(client_id, "OfflinePages.Background.OffliningPreviewStatus"), - IsPreviewsEnabled(navigation_data)); + is_previews_enabled); } void HandleLoadTerminationCancel( @@ -373,8 +367,10 @@ // ResourceDispatcherHostDelegate::GetNavigationData during commit. // Because ChromeResourceDispatcherHostDelegate always returns a // ChromeNavigationData, it is safe to static_cast here. - RecordOffliningPreviewsUMA(pending_request_->client_id(), - navigation_handle->GetNavigationData()); + ChromeNavigationData* navigation_data = static_cast<ChromeNavigationData*>( + navigation_handle->GetNavigationData()); + + RecordOffliningPreviewsUMA(pending_request_->client_id(), navigation_data); } void BackgroundLoaderOffliner::SetSnapshotControllerForTest(
diff --git a/chrome/browser/offline_pages/background_loader_offliner_unittest.cc b/chrome/browser/offline_pages/background_loader_offliner_unittest.cc index 3ec75147..7a30320b 100644 --- a/chrome/browser/offline_pages/background_loader_offliner_unittest.cc +++ b/chrome/browser/offline_pages/background_loader_offliner_unittest.cc
@@ -10,7 +10,6 @@ #include "base/test/scoped_feature_list.h" #include "base/test/scoped_mock_time_message_loop_task_runner.h" #include "base/threading/thread_task_runner_handle.h" -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/net/prediction_options.h" #include "chrome/browser/offline_pages/offliner_helper.h" @@ -608,11 +607,14 @@ kHttpUrl, offliner()->web_contents()->GetMainFrame(), true, net::Error::OK)); // Set up ChromeNavigationData on the handle. - ChromeNavigationData chrome_navigation_data; - chrome_navigation_data.set_previews_state( + std::unique_ptr<ChromeNavigationData> chrome_navigation_data( + new ChromeNavigationData()); + chrome_navigation_data->set_previews_state( content::PreviewsTypes::PREVIEWS_NO_TRANSFORM); + std::unique_ptr<content::NavigationData> navigation_data( + chrome_navigation_data.release()); offliner()->web_contents_tester()->SetNavigationData( - handle.get(), chrome_navigation_data.ToValue()); + handle.get(), std::move(navigation_data)); scoped_refptr<net::HttpResponseHeaders> header( new net::HttpResponseHeaders("HTTP/1.1 200 OK")); offliner()->web_contents_tester()->SetHttpResponseHeaders(handle.get(), @@ -639,11 +641,14 @@ kHttpUrl, offliner()->web_contents()->GetMainFrame(), true, net::Error::OK)); // Set up ChromeNavigationData on the handle. - ChromeNavigationData chrome_navigation_data; - chrome_navigation_data.set_previews_state( + std::unique_ptr<ChromeNavigationData> chrome_navigation_data( + new ChromeNavigationData()); + chrome_navigation_data->set_previews_state( content::PreviewsTypes::CLIENT_LOFI_ON); + std::unique_ptr<content::NavigationData> navigation_data( + chrome_navigation_data.release()); offliner()->web_contents_tester()->SetNavigationData( - handle.get(), chrome_navigation_data.ToValue()); + handle.get(), std::move(navigation_data)); scoped_refptr<net::HttpResponseHeaders> header( new net::HttpResponseHeaders("HTTP/1.1 200 OK")); offliner()->web_contents_tester()->SetHttpResponseHeaders(handle.get(),
diff --git a/chrome/browser/offline_pages/offline_page_info_handler.cc b/chrome/browser/offline_pages/offline_page_info_handler.cc index 886565e..a007abf3 100644 --- a/chrome/browser/offline_pages/offline_page_info_handler.cc +++ b/chrome/browser/offline_pages/offline_page_info_handler.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/offline_pages/offline_page_info_handler.h" #include "base/strings/string_util.h" +#include "chrome/browser/offline_pages/offline_page_utils.h" #include "components/offline_pages/core/request_header/offline_page_header.h" #include "components/sessions/content/content_serialized_navigation_driver.h" #include "content/public/browser/navigation_entry.h" @@ -28,19 +29,9 @@ std::string OfflinePageInfoHandler::GetExtendedInfo( const content::NavigationEntry& entry) const { - std::string extra_headers = entry.GetExtraHeaders(); - if (extra_headers.empty()) - return std::string(); - - // The offline header will be the only extra header if it is present. - std::string offline_header_key(offline_pages::kOfflinePageHeader); - offline_header_key += ": "; - if (!base::StartsWith(extra_headers, offline_header_key, - base::CompareCase::INSENSITIVE_ASCII)) { - return std::string(); - } - std::string header_value = extra_headers.substr(offline_header_key.length()); - if (header_value.find("\n") != std::string::npos) + std::string header_value = + OfflinePageUtils::ExtractOfflineHeaderValueFromNavigationEntry(entry); + if (header_value.empty()) return std::string(); OfflinePageHeader header(header_value);
diff --git a/chrome/browser/offline_pages/offline_page_mhtml_archiver.cc b/chrome/browser/offline_pages/offline_page_mhtml_archiver.cc index c37727c..63ea2663 100644 --- a/chrome/browser/offline_pages/offline_page_mhtml_archiver.cc +++ b/chrome/browser/offline_pages/offline_page_mhtml_archiver.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/guid.h" @@ -15,44 +14,20 @@ #include "base/strings/string16.h" #include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" +#include "chrome/browser/offline_pages/offline_page_utils.h" #include "chrome/browser/ssl/security_state_tab_helper.h" +#include "components/offline_pages/core/archive_validator.h" #include "components/security_state/core/security_state.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" #include "content/public/common/mhtml_generation_params.h" -#include "crypto/secure_hash.h" -#include "crypto/sha2.h" #include "net/base/filename_util.h" namespace offline_pages { namespace { const base::FilePath::CharType kMHTMLExtension[] = FILE_PATH_LITERAL("mhtml"); -std::string ComputeDigest(const base::FilePath& file_path) { - base::File file(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); - if (!file.IsValid()) - return std::string(); - - std::unique_ptr<crypto::SecureHash> secure_hash( - crypto::SecureHash::Create(crypto::SecureHash::SHA256)); - - const int kMaxBufferSize = 1024; - std::vector<char> buffer(kMaxBufferSize); - int bytes_read; - do { - bytes_read = file.ReadAtCurrentPos(buffer.data(), kMaxBufferSize); - if (bytes_read > 0) - secure_hash->Update(buffer.data(), bytes_read); - } while (bytes_read > 0); - if (bytes_read < 0) - return std::string(); - - std::string result_bytes(crypto::kSHA256Length, 0); - secure_hash->Finish(&(result_bytes[0]), result_bytes.size()); - return result_bytes; -} - void DeleteFileOnFileThread(const base::FilePath& file_path, const base::Closure& callback) { base::PostTaskWithTraitsAndReply( @@ -70,7 +45,7 @@ const base::Callback<void(const std::string&)>& callback) { base::PostTaskWithTraitsAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, - base::Bind(&ComputeDigest, file_path), callback); + base::Bind(&ArchiveValidator::ComputeDigest, file_path), callback); } } // namespace
diff --git a/chrome/browser/offline_pages/offline_page_request_job.cc b/chrome/browser/offline_pages/offline_page_request_job.cc index d9b66ac..5a432f1 100644 --- a/chrome/browser/offline_pages/offline_page_request_job.cc +++ b/chrome/browser/offline_pages/offline_page_request_job.cc
@@ -21,6 +21,7 @@ #include "chrome/browser/offline_pages/offline_page_utils.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h" +#include "components/offline_pages/core/archive_validator.h" #include "components/offline_pages/core/client_namespace_constants.h" #include "components/offline_pages/core/offline_page_model.h" #include "components/offline_pages/core/request_header/offline_page_header.h" @@ -79,11 +80,23 @@ PAGE_NOT_FRESH, // Offline page was not found, by searching with either final URL or original // URL. - OFFLINE_PAGE_NOT_FOUND + OFFLINE_PAGE_NOT_FOUND, + // Digest for the underlying file does not match with the one saved in the + // metadata database. + DIGEST_MISMATCH, }; const char kUserDataKey[] = "offline_page_key"; +void ValidatePage( + const GURL& url, + const OfflinePageHeader& offline_header, + NetworkState network_state, + base::WeakPtr<OfflinePageRequestJob> job, + content::ResourceRequestInfo::WebContentsGetter web_contents_getter, + const std::vector<OfflinePageItem>& offline_pages, + size_t offline_page_index); + // Contains the info to handle offline page request. class OfflinePageRequestInfo : public base::SupportsUserData::Data { public: @@ -219,6 +232,25 @@ NOTREACHED(); } + if (request_result == RequestResult::DIGEST_MISMATCH) { + switch (network_state) { + case NetworkState::DISCONNECTED_NETWORK: + return OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_DISCONNECTED_NETWORK; + case NetworkState::PROHIBITIVELY_SLOW_NETWORK: + return OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_PROHIBITIVELY_SLOW_NETWORK; + case NetworkState::FLAKY_NETWORK: + return OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_FLAKY_NETWORK; + case NetworkState::FORCE_OFFLINE_ON_CONNECTED_NETWORK: + case NetworkState::CONNECTED_NETWORK: + return OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_CONNECTED_NETWORK; + } + NOTREACHED(); + } + DCHECK_EQ(RequestResult::OFFLINE_PAGE_SERVED, request_result); DCHECK_NE(NetworkState::CONNECTED_NETWORK, network_state); switch (network_state) { @@ -250,9 +282,8 @@ } void ReportOfflinePageSize(NetworkState network_state, - const OfflinePageItem* offline_page) { - DCHECK(offline_page); - if (offline_page->client_id.name_space.empty()) + const OfflinePageItem& offline_page) { + if (offline_page.client_id.name_space.empty()) return; // The two histograms report values between 1KiB and 100MiB. @@ -261,13 +292,13 @@ case NetworkState::PROHIBITIVELY_SLOW_NETWORK: // Fall-through case NetworkState::FLAKY_NETWORK: base::UmaHistogramCounts100000("OfflinePages.PageSizeOnAccess.Offline." + - offline_page->client_id.name_space, - offline_page->file_size / 1024); + offline_page.client_id.name_space, + offline_page.file_size / 1024); return; case NetworkState::FORCE_OFFLINE_ON_CONNECTED_NETWORK: base::UmaHistogramCounts100000("OfflinePages.PageSizeOnAccess.Online." + - offline_page->client_id.name_space, - offline_page->file_size / 1024); + offline_page.client_id.name_space, + offline_page.file_size / 1024); return; case NetworkState::CONNECTED_NETWORK: break; @@ -286,6 +317,18 @@ nullptr; } +void ValidateFileOnBackgroundThread( + const base::FilePath& file_path, + int64_t expected_file_size, + const std::string& expected_digest, + const base::Callback<void(bool)>& callback) { + base::PostTaskWithTraitsAndReplyWithResult( + FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, + base::Bind(&ArchiveValidator::ValidateFile, file_path, expected_file_size, + expected_digest), + callback); +} + void NotifyOfflineFilePathOnIO(base::WeakPtr<OfflinePageRequestJob> job, const std::string& name_space, const base::FilePath& offline_file_path) { @@ -334,34 +377,55 @@ base::Bind(&NotifyOfflineRedirectOnIO, job, redirected_url)); } -// Finds the offline file path based on the select page result and network -// state and marks it as accessed. -RequestResult AccessOfflineFile( +// Failed to find a trusted offline page. +void FailedToFindTrustedOfflinePage(RequestResult request_error_result, + NetworkState network_state, + base::WeakPtr<OfflinePageRequestJob> job) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + DCHECK_NE(RequestResult::OFFLINE_PAGE_SERVED, request_error_result); + + ReportRequestResult(request_error_result, network_state); + + // Proceed with empty file path in order to notify the OfflinePageRequestJob + // about the failure. + base::FilePath empty_file_path; + NotifyOfflineFilePathOnUI(job, std::string(), empty_file_path); +} + +// Succeeded to find a trusted offline page which can be served. +void SucceededToFindTrustedOfflinePage( + const GURL& url, const OfflinePageHeader& offline_header, NetworkState network_state, base::WeakPtr<OfflinePageRequestJob> job, content::ResourceRequestInfo::WebContentsGetter web_contents_getter, - const OfflinePageItem* offline_page, - base::FilePath* offline_file_path) { + const OfflinePageItem& offline_page) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - if (!offline_page) - return RequestResult::OFFLINE_PAGE_NOT_FOUND; - // |web_contents_getter| is passed from IO thread. We need to check if // web contents is still valid. content::WebContents* web_contents = web_contents_getter.Run(); - if (!web_contents) - return RequestResult::NO_WEB_CONTENTS; - - // If the page is being loaded on a slow network, only use the offline page - // if it was created within the past day. - if (network_state == NetworkState::PROHIBITIVELY_SLOW_NETWORK && - base::Time::Now() - offline_page->creation_time > - previews::params::OfflinePreviewFreshnessDuration()) { - return RequestResult::PAGE_NOT_FRESH; + if (!web_contents) { + FailedToFindTrustedOfflinePage(RequestResult::NO_WEB_CONTENTS, + network_state, job); + return; } + // If the match is for original URL, trigger the redirect. + // Note: If the offline page has same orginal URL and final URL, don't trigger + // the redirect. Some websites might route the redirect finally back to itself + // after intermediate redirects for authentication. Previously this case was + // not handled and some pages might be saved with same URLs. Though we fixed + // the problem, we still need to support those pages already saved with this + if (url == offline_page.original_url && url != offline_page.url) { + ReportRequestResult(RequestResult::REDIRECTED, network_state); + NotifyOfflineRedirectOnUI(job, offline_page.url); + return; + } + + ReportRequestResult(RequestResult::OFFLINE_PAGE_SERVED, network_state); + ReportOfflinePageSize(network_state, offline_page); + // Since offline page will be loaded, it should be marked as accessed. OfflinePageModel* offline_page_model = OfflinePageModelFactory::GetForBrowserContext( @@ -369,7 +433,7 @@ // |offline_page_model| cannot be null because OfflinePageRequestInterceptor // will not be created under incognito mode. DCHECK(offline_page_model); - offline_page_model->MarkPageAccessed(offline_page->offline_id); + offline_page_model->MarkPageAccessed(offline_page.offline_id); // Save an cached copy of OfflinePageItem such that Tab code can get // the loaded offline page immediately. @@ -377,64 +441,158 @@ OfflinePageTabHelper::FromWebContents(web_contents); DCHECK(tab_helper); tab_helper->SetOfflinePage( - *offline_page, offline_header, true /*is_trusted*/, + offline_page, offline_header, true /*is_trusted*/, network_state == NetworkState::PROHIBITIVELY_SLOW_NETWORK); - *offline_file_path = offline_page->file_path; - return RequestResult::OFFLINE_PAGE_SERVED; + // NotifyOfflineFilePathOnUI should always be called regardless the failure + // result and empty file path such that OfflinePageRequestJob will be notified + // on failure. + NotifyOfflineFilePathOnUI(job, offline_page.client_id.name_space, + offline_page.file_path); } -// Handles the result of finding an offline page. -void SucceededToFindOfflinePage( +void ValidatePageDone( const GURL& url, const OfflinePageHeader& offline_header, NetworkState network_state, base::WeakPtr<OfflinePageRequestJob> job, content::ResourceRequestInfo::WebContentsGetter web_contents_getter, - const OfflinePageItem* offline_page) { + const std::vector<OfflinePageItem>& offline_pages, + size_t offline_page_index, + bool successfully_validated) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + DCHECK_LT(offline_page_index, offline_pages.size()); - // If the match is for original URL, trigger the redirect. - // Note: If the offline page has same orginal URL and final URL, don't trigger - // the redirect. Some websites might route the redirect finally back to itself - // after intermediate redirects for authentication. Previously this case was - // not handled and some pages might be saved with same URLs. Though we fixed - // the problem, we still need to support those pages already saved with this - if (offline_page && url == offline_page->original_url && - url != offline_page->url) { - ReportRequestResult(RequestResult::REDIRECTED, network_state); - NotifyOfflineRedirectOnUI(job, offline_page->url); + if (successfully_validated) { + SucceededToFindTrustedOfflinePage(url, offline_header, network_state, job, + web_contents_getter, + offline_pages[offline_page_index]); return; } - base::FilePath offline_file_path; - RequestResult request_result = AccessOfflineFile( - offline_header, network_state, job, web_contents_getter, offline_page, - &offline_file_path); + // Bail out if no more page to validate. + offline_page_index++; + if (offline_page_index >= offline_pages.size()) { + FailedToFindTrustedOfflinePage(RequestResult::DIGEST_MISMATCH, + network_state, job); + return; + } - ReportRequestResult(request_result, network_state); - if (request_result == RequestResult::OFFLINE_PAGE_SERVED) - ReportOfflinePageSize(network_state, offline_page); - - // NotifyOfflineFilePathOnUI should always be called regardless the failure - // result and empty file path such that OfflinePageRequestJob will be notified - // on failure. - NotifyOfflineFilePathOnUI( - job, offline_page ? offline_page->client_id.name_space : std::string(), - offline_file_path); + // Move to validating next page. + ValidatePage(url, offline_header, network_state, job, web_contents_getter, + offline_pages, offline_page_index); } -void FailedToFindOfflinePage(base::WeakPtr<OfflinePageRequestJob> job) { +// Validate an offline page at |offline_page_index|. +void ValidatePage( + const GURL& url, + const OfflinePageHeader& offline_header, + NetworkState network_state, + base::WeakPtr<OfflinePageRequestJob> job, + content::ResourceRequestInfo::WebContentsGetter web_contents_getter, + const std::vector<OfflinePageItem>& offline_pages, + size_t offline_page_index) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + DCHECK_LT(offline_page_index, offline_pages.size()); + + const OfflinePageItem& offline_page = offline_pages[offline_page_index]; + + // If the page is being loaded on a slow network, only use the offline page + // if it was created within the past day. + if (network_state == NetworkState::PROHIBITIVELY_SLOW_NETWORK && + base::Time::Now() - offline_page.creation_time > + previews::params::OfflinePreviewFreshnessDuration()) { + FailedToFindTrustedOfflinePage(RequestResult::PAGE_NOT_FRESH, network_state, + job); + return; + } + + OfflinePageModel* offline_page_model = + GetOfflinePageModel(web_contents_getter); + if (!offline_page_model) { + FailedToFindTrustedOfflinePage(RequestResult::NO_WEB_CONTENTS, + network_state, job); + return; + } + + bool can_skip_file_validation = false; + bool is_page_trusted = false; + + // If the file is in internal directory, the page can be trusted without + // validation. + if (offline_page_model->IsArchiveInInternalDir(offline_page.file_path)) { + can_skip_file_validation = true; + is_page_trusted = true; + } else if (offline_page.digest.empty()) { + // Otherwise, the file is in public directory. If the digest is not found in + // the metadata database, it means that the digest is erased when the file + // modification is detected. In this case, the page cannot be trusted. + can_skip_file_validation = true; + is_page_trusted = false; + } + + if (can_skip_file_validation) { + ValidatePageDone(url, offline_header, network_state, job, + web_contents_getter, offline_pages, offline_page_index, + is_page_trusted); + return; + } + + // Validate if the file has been modified. + ValidateFileOnBackgroundThread( + offline_page.file_path, offline_page.file_size, offline_page.digest, + base::Bind(&ValidatePageDone, url, offline_header, network_state, job, + web_contents_getter, offline_pages, offline_page_index)); +} + +// Handles the result of finding matched offline pages. +void SelectPagesForURLDone( + const GURL& url, + const OfflinePageHeader& offline_header, + NetworkState network_state, + base::WeakPtr<OfflinePageRequestJob> job, + content::ResourceRequestInfo::WebContentsGetter web_contents_getter, + const std::vector<OfflinePageItem>& offline_pages) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - // Proceed with empty file path in order to notify the OfflinePageRequestJob - // about the failure. - base::FilePath empty_file_path; - NotifyOfflineFilePathOnUI(job, std::string(), empty_file_path); + // Bail out if no page is found. + if (offline_pages.empty()) { + FailedToFindTrustedOfflinePage(RequestResult::OFFLINE_PAGE_NOT_FOUND, + network_state, job); + return; + } + + // Start to validate the first page. + ValidatePage(url, offline_header, network_state, job, web_contents_getter, + offline_pages, 0); +} + +// Handles the result of finding an offline page with the requested offline ID. +void GetPageByOfflineIdDone( + const GURL& url, + const OfflinePageHeader& offline_header, + NetworkState network_state, + content::ResourceRequestInfo::WebContentsGetter web_contents_getter, + base::WeakPtr<OfflinePageRequestJob> job, + const OfflinePageItem* offline_page) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + // If the found offline page does not match the request URL, fail. + if (!offline_page || offline_page->url != url) { + FailedToFindTrustedOfflinePage(RequestResult::OFFLINE_PAGE_NOT_FOUND, + network_state, job); + return; + } + + // Continue with the validation step. + std::vector<OfflinePageItem> offline_pages; + offline_pages.push_back(*offline_page); + SelectPagesForURLDone(url, offline_header, network_state, job, + web_contents_getter, offline_pages); } // Tries to find the offline page to serve for |url|. -void SelectPageForURL( +void GetPageToServeURL( const GURL& url, const OfflinePageHeader& offline_header, NetworkState network_state, @@ -444,104 +602,39 @@ DCHECK_CURRENTLY_ON(content::BrowserThread::UI); content::WebContents* web_contents = web_contents_getter.Run(); - if (!web_contents){ - ReportRequestResult(RequestResult::NO_WEB_CONTENTS, network_state); - FailedToFindOfflinePage(job); + if (!web_contents) { + FailedToFindTrustedOfflinePage(RequestResult::NO_WEB_CONTENTS, + network_state, job); return; } int tab_id; if (!tab_id_getter.Run(web_contents, &tab_id)) { - ReportRequestResult(RequestResult::NO_TAB_ID, network_state); - FailedToFindOfflinePage(job); + FailedToFindTrustedOfflinePage(RequestResult::NO_TAB_ID, network_state, + job); return; } - OfflinePageUtils::SelectPageForURL( - web_contents->GetBrowserContext(), url, URLSearchMode::SEARCH_BY_ALL_URLS, - tab_id, - base::Bind(&SucceededToFindOfflinePage, url, offline_header, - network_state, job, web_contents_getter)); -} - -void FindPageWithOfflineIDDone( - const GURL& url, - const OfflinePageHeader& offline_header, - NetworkState network_state, - content::ResourceRequestInfo::WebContentsGetter web_contents_getter, - OfflinePageRequestJob::Delegate::TabIdGetter tab_id_getter, - base::WeakPtr<OfflinePageRequestJob> job, - const OfflinePageItem* offline_page) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - - // If the found offline page does not has same URL as the request URL, fall - // back to find the offline page based on the URL. - if (!offline_page || offline_page->url != url) { - SelectPageForURL( - url, offline_header, network_state, web_contents_getter, - tab_id_getter, job); - return; - } - - SucceededToFindOfflinePage( - url, offline_header, network_state, job, web_contents_getter, - offline_page); -} - -// Tries to find an offline page associated with |offline_id|. -void FindPageWithOfflineID( - const GURL& url, - const OfflinePageHeader& offline_header, - int64_t offline_id, - NetworkState network_state, - content::ResourceRequestInfo::WebContentsGetter web_contents_getter, - OfflinePageRequestJob::Delegate::TabIdGetter tab_id_getter, - base::WeakPtr<OfflinePageRequestJob> job) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - - OfflinePageModel* offline_page_model = - GetOfflinePageModel(web_contents_getter); - if (!offline_page_model) { - FailedToFindOfflinePage(job); - return; - } - - offline_page_model->GetPageByOfflineId( - offline_id, - base::Bind(&FindPageWithOfflineIDDone, - url, - offline_header, - network_state, - web_contents_getter, - tab_id_getter, - job)); -} - -// Tries to find the offline page to serve for |url|. -void SelectPage( - const GURL& url, - const OfflinePageHeader& offline_header, - NetworkState network_state, - content::ResourceRequestInfo::WebContentsGetter web_contents_getter, - OfflinePageRequestJob::Delegate::TabIdGetter tab_id_getter, - base::WeakPtr<OfflinePageRequestJob> job) { - DCHECK_CURRENTLY_ON(content::BrowserThread::UI); - - // If an offline ID is present in the offline header, try to load that + // If an int64 offline ID is present in the offline header, try to load that // particular version. if (!offline_header.id.empty()) { - // if the id string cannot be converted to int64 id, fall through to - // select page via URL. int64_t offline_id; if (base::StringToInt64(offline_header.id, &offline_id)) { - FindPageWithOfflineID(url, offline_header, offline_id, - network_state, web_contents_getter, tab_id_getter, - job); + OfflinePageModel* offline_page_model = + OfflinePageModelFactory::GetForBrowserContext( + web_contents->GetBrowserContext()); + DCHECK(offline_page_model); + offline_page_model->GetPageByOfflineId( + offline_id, base::Bind(&GetPageByOfflineIdDone, url, offline_header, + network_state, web_contents_getter, job)); return; } } - SelectPageForURL(url, offline_header, network_state, web_contents_getter, - tab_id_getter, job); + OfflinePageUtils::SelectPagesForURL( + web_contents->GetBrowserContext(), url, URLSearchMode::SEARCH_BY_ALL_URLS, + tab_id, + base::Bind(&SelectPagesForURLDone, url, offline_header, network_state, + job, web_contents_getter)); } void ReportAccessEntryPoint( @@ -641,15 +734,10 @@ } content::BrowserThread::PostTask( - content::BrowserThread::UI, - FROM_HERE, - base::Bind(&SelectPage, - request()->url(), - offline_header, - network_state, - delegate_->GetWebContentsGetter(request()), - delegate_->GetTabIdGetter(), - weak_ptr_factory_.GetWeakPtr())); + content::BrowserThread::UI, FROM_HERE, + base::Bind(&GetPageToServeURL, request()->url(), offline_header, + network_state, delegate_->GetWebContentsGetter(request()), + delegate_->GetTabIdGetter(), weak_ptr_factory_.GetWeakPtr())); } void OfflinePageRequestJob::Kill() {
diff --git a/chrome/browser/offline_pages/offline_page_request_job.h b/chrome/browser/offline_pages/offline_page_request_job.h index 3f4ad65..cdd6f07 100644 --- a/chrome/browser/offline_pages/offline_page_request_job.h +++ b/chrome/browser/offline_pages/offline_page_request_job.h
@@ -35,7 +35,7 @@ // NOTE: because this is used for UMA reporting, these values should not be // changed or reused; new values should be ended immediately before the MAX // value. Make sure to update the histogram enum - // (OfflinePagesAggregatedRequestResult in histograms.xml) accordingly. + // (OfflinePagesAggregatedRequestResult in enums.xml) accordingly. // Public for testing. enum class AggregatedRequestResult { SHOW_OFFLINE_ON_DISCONNECTED_NETWORK, @@ -54,6 +54,10 @@ REDIRECTED_ON_FLAKY_NETWORK, REDIRECTED_ON_PROHIBITIVELY_SLOW_NETWORK, REDIRECTED_ON_CONNECTED_NETWORK, + DIGEST_MISMATCH_ON_DISCONNECTED_NETWORK, + DIGEST_MISMATCH_ON_FLAKY_NETWORK, + DIGEST_MISMATCH_ON_PROHIBITIVELY_SLOW_NETWORK, + DIGEST_MISMATCH_ON_CONNECTED_NETWORK, AGGREGATED_REQUEST_RESULT_MAX };
diff --git a/chrome/browser/offline_pages/offline_page_request_job_unittest.cc b/chrome/browser/offline_pages/offline_page_request_job_unittest.cc index 4f7db41..a590b62 100644 --- a/chrome/browser/offline_pages/offline_page_request_job_unittest.cc +++ b/chrome/browser/offline_pages/offline_page_request_job_unittest.cc
@@ -21,17 +21,19 @@ #include "base/test/histogram_tester.h" #include "base/test/simple_test_clock.h" #include "base/threading/thread_task_runner_handle.h" +#include "base/time/default_clock.h" #include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/offline_pages/offline_page_request_interceptor.h" #include "chrome/browser/offline_pages/offline_page_tab_helper.h" -#include "chrome/browser/offline_pages/test_offline_page_model_builder.h" #include "chrome/browser/renderer_host/chrome_navigation_ui_data.h" +#include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile_manager.h" #include "components/offline_pages/core/client_namespace_constants.h" #include "components/offline_pages/core/model/offline_page_model_taskified.h" +#include "components/offline_pages/core/offline_page_metadata_store_sql.h" #include "components/offline_pages/core/request_header/offline_page_navigation_ui_data.h" #include "components/previews/core/previews_decider.h" #include "components/previews/core/previews_experiments.h" @@ -52,29 +54,60 @@ namespace { +const char kPrivateOfflineFileDir[] = "offline_pages"; +const char kPublicOfflineFileDir[] = "public_offline_pages"; + const GURL kTestUrl1("http://test.org/page1"); const GURL kTestUrl2("http://test.org/page2"); const GURL kTestUrl3("http://test.org/page3"); const GURL kTestUrl3WithFragment("http://test.org/page3#ref1"); const GURL kTestUrl4("http://test.org/page4"); const GURL kTestUrl5("http://test.org/page5"); +const GURL kTestUrl6("http://test.org/page6"); +const GURL kTestUrl7("http://test.org/page7"); const GURL kTestUrlRedirectsTo3("http://test.org/first"); +const GURL kTestUrl8("http://test.org/page8"); +const GURL kTestUrl9("http://test.org/page9"); const ClientId kTestClientId1 = ClientId(kBookmarkNamespace, "1234"); const ClientId kTestClientId2 = ClientId(kDownloadNamespace, "1a2b3c4d"); const ClientId kTestClientId3 = ClientId(kAsyncNamespace, "3456abcd"); const ClientId kTestClientId4 = ClientId(kNTPSuggestionsNamespace, "5678"); const ClientId kTestClientId5 = ClientId(kBrowserActionsNamespace, "9999"); +const ClientId kTestClientId6 = ClientId(kDownloadNamespace, "a1"); +const ClientId kTestClientId7 = ClientId(kDownloadNamespace, "b2"); +const ClientId kTestClientId8 = ClientId(kDownloadNamespace, "c3"); +const ClientId kTestClientId9 = ClientId(kDownloadNamespace, "d4"); +const ClientId kTestClientId10 = ClientId(kDownloadNamespace, "e5"); // Note: as most file size values are below 1 KiB, the file size samples added // to page size histograms will mostly fall into the 0-sized bucket. So when // checking for correct reporting a 0 will be directly used instead of the // specific file size constant divided by 1024. -const int kTestFileSize1 = 444; // Real size of offline_pages/test.mhtml. -const int kTestFileSize2 = 450; // Real size of offline_pages/hello.mhtml. -const int kTestFileSize3 = 450; // Ditto. +const int kTestFileSize1 = 444; // Real size of test.mhtml. +const int kTestFileSize2 = 450; // Real size of hello.mhtml. +const int kTestFileSize3 = 450; // Real size of hello.mhtml. const int kTestFileSize4NonExistent = 9999; -const int kTestFileSize5 = 450; // Ditto. +const int kTestFileSize5 = 450; // Real size of hello.mhtml. +const int kTestFileSize6Mismatch = 1450; // Wrong size of hello.mhtml. +const int kTestFileSize7 = 450; // Real size of hello.mhtml. +const int kTestFileSize8 = 450; // Real size of hello.mhtml. +const int kTestFileSize9 = 444; // Real size of test.mhtml. +const int kTestFileSize10 = 450; // Real size of hello.mhtml. + +const std::string kTestDigest2( + "\x90\x64\xF9\x7C\x94\xE5\x9E\x91\x83\x3D\x41\xB0\x36\x90\x0A\xDF\xB3\xB1" + "\x5C\x13\xBE\xB8\x35\x8C\xF6\x5B\xC4\xB5\x5A\xFC\x3A\xCC", + 32); // SHA256 Hash of hello.mhtml. +const std::string kTestDigest6(kTestDigest2); // SHA256 Hash of hello.mhtml. +const std::string kTestDigest7Mismatch( + "\xff\x64\xF9\x7C\x94\xE5\x9E\x91\x83\x3D\x41\xB0\x36\x90\x0A\xDF\xB3\xB1" + "\x5C\x13\xBE\xB8\x35\x8C\xF6\x5B\xC4\xB5\x5A\xFC\x3A\xCC", + 32); // Wrong SHA256 Hash of hello.mhtml. +const std::string kTestDigest10Mismatch( + "\xff\x64\xF9\x7C\x94\xE5\x9E\x91\x83\x3D\x41\xB0\x36\x90\x0A\xDF\xB3\xB1" + "\x5C\x13\xBE\xB8\x35\x8C\xF6\x5B\xC4\xB5\x5A\xFC\x3A\xCC", + 32); // Wrong SHA256 Hash of hello.mhtml. const int kTabId = 1; const int kBufSize = 1024; @@ -239,10 +272,12 @@ public: TestOfflinePageArchiver(const GURL& url, const base::FilePath& archive_file_path, - int archive_file_size) + int archive_file_size, + const std::string& digest) : url_(url), archive_file_path_(archive_file_path), - archive_file_size_(archive_file_size) {} + archive_file_size_(archive_file_size), + digest_(digest) {} ~TestOfflinePageArchiver() override {} void CreateArchive(const base::FilePath& archives_dir, @@ -252,17 +287,45 @@ FROM_HERE, base::Bind(callback, this, ArchiverResult::SUCCESSFULLY_CREATED, url_, archive_file_path_, base::string16(), archive_file_size_, - std::string())); + digest_)); } private: const GURL url_; const base::FilePath archive_file_path_; const int archive_file_size_; + const std::string digest_; DISALLOW_COPY_AND_ASSIGN(TestOfflinePageArchiver); }; +std::unique_ptr<KeyedService> BuildTestOfflinePageModel( + content::BrowserContext* context) { + scoped_refptr<base::SingleThreadTaskRunner> task_runner = + base::ThreadTaskRunnerHandle::Get(); + + base::FilePath store_path = + context->GetPath().Append(chrome::kOfflinePageMetadataDirname); + std::unique_ptr<OfflinePageMetadataStoreSQL> metadata_store( + new OfflinePageMetadataStoreSQL(task_runner, store_path)); + + base::FilePath test_data_dir_path; + PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_path); + base::FilePath persistent_archives_dir = + test_data_dir_path.AppendASCII("offline_pages"); + + // We're not interested in saving any temporary file in this test. + base::FilePath temporary_archives_dir; + + std::unique_ptr<ArchiveManager> archive_manager(new ArchiveManager( + temporary_archives_dir, persistent_archives_dir, task_runner)); + std::unique_ptr<base::Clock> clock(new base::DefaultClock); + + return std::unique_ptr<KeyedService>(new OfflinePageModelTaskified( + std::move(metadata_store), std::move(archive_manager), task_runner, + std::move(clock))); +} + } // namespace class OfflinePageRequestJobTest : public testing::Test { @@ -275,6 +338,7 @@ void SimulateHasNetworkConnectivity(bool has_connectivity); void RunUntilIdle(); + void WaitForAsyncOperation(); void SavePage(const GURL& url, const ClientId& client_id, @@ -329,11 +393,7 @@ OfflinePageTabHelper* offline_page_tab_helper() const { return offline_page_tab_helper_; } - int64_t offline_id() const { return offline_id_; } - int64_t offline_id2() const { return offline_id2_; } - int64_t offline_id3() const { return offline_id3_; } - int64_t offline_id4() const { return offline_id4_; } - int64_t offline_id5() const { return offline_id5_; } + const std::vector<int64_t>& offline_ids() const { return offline_ids_; } int bytes_read() const { return bytes_read_; } bool is_offline_page_set_in_navigation_data() const { return is_offline_page_set_in_navigation_data_; @@ -373,11 +433,7 @@ std::unique_ptr<content::WebContents> web_contents_; base::HistogramTester histogram_tester_; OfflinePageTabHelper* offline_page_tab_helper_; // Not owned. - int64_t offline_id_; - int64_t offline_id2_; - int64_t offline_id3_; - int64_t offline_id4_; - int64_t offline_id5_; + std::vector<int64_t> offline_ids_; int bytes_read_; bool is_offline_page_set_in_navigation_data_; OfflinePageItem page_; @@ -396,6 +452,9 @@ std::unique_ptr<TestURLRequestDelegate> url_request_delegate_; std::unique_ptr<net::URLRequest> request_; + bool async_operation_completed_ = false; + base::Closure async_operation_completed_callback_; + DISALLOW_COPY_AND_ASSIGN(OfflinePageRequestJobTest); }; @@ -404,11 +463,6 @@ clock_(new base::SimpleTestClock), clock_ptr_(clock_.get()), profile_manager_(TestingBrowserProcess::GetGlobal()), - offline_id_(-1), - offline_id2_(-1), - offline_id3_(-1), - offline_id4_(-1), - offline_id5_(-1), bytes_read_(0), is_offline_page_set_in_navigation_data_(false), network_change_notifier_(new TestNetworkChangeNotifier), @@ -452,20 +506,21 @@ // Save an offline page. base::FilePath archive_file_path = - test_data_dir_path.AppendASCII("offline_pages").AppendASCII("test.mhtml"); + test_data_dir_path.AppendASCII(kPrivateOfflineFileDir) + .AppendASCII("test.mhtml"); std::unique_ptr<TestOfflinePageArchiver> archiver(new TestOfflinePageArchiver( - kTestUrl1, archive_file_path, kTestFileSize1)); + kTestUrl1, archive_file_path, kTestFileSize1, std::string())); SavePage(kTestUrl1, kTestClientId1, GURL(), std::move(archiver)); // Save another offline page associated with same online URL as above, but // pointing to different archive file. base::FilePath archive_file_path2 = - test_data_dir_path.AppendASCII("offline_pages") + test_data_dir_path.AppendASCII(kPrivateOfflineFileDir) .AppendASCII("hello.mhtml"); std::unique_ptr<TestOfflinePageArchiver> archiver2( - new TestOfflinePageArchiver(kTestUrl1, archive_file_path2, - kTestFileSize2)); + new TestOfflinePageArchiver(kTestUrl1, archive_file_path2, kTestFileSize2, + kTestDigest2)); // Make sure that the creation time of 2nd offline file is later. clock_ptr_->Advance(base::TimeDelta::FromMinutes(10)); @@ -475,38 +530,88 @@ // Save an offline page associated with online URL that has a fragment // identifier. base::FilePath archive_file_path3 = - test_data_dir_path.AppendASCII("offline_pages") + test_data_dir_path.AppendASCII(kPrivateOfflineFileDir) .AppendASCII("hello.mhtml"); std::unique_ptr<TestOfflinePageArchiver> archiver3( new TestOfflinePageArchiver(kTestUrl3WithFragment, archive_file_path3, - kTestFileSize3)); + kTestFileSize3, std::string())); SavePage(kTestUrl3WithFragment, kTestClientId3, kTestUrlRedirectsTo3, std::move(archiver3)); // Save an offline page pointing to non-existent archive file. base::FilePath archive_file_path4 = - test_data_dir_path.AppendASCII("offline_pages") + test_data_dir_path.AppendASCII(kPrivateOfflineFileDir) .AppendASCII("nonexistent.mhtml"); std::unique_ptr<TestOfflinePageArchiver> archiver4( new TestOfflinePageArchiver(kTestUrl4, archive_file_path4, - kTestFileSize4NonExistent)); + kTestFileSize4NonExistent, std::string())); SavePage(kTestUrl4, kTestClientId4, GURL(), std::move(archiver4)); // Save an offline page with same original URL and final URL. base::FilePath archive_file_path5 = - test_data_dir_path.AppendASCII("offline_pages") + test_data_dir_path.AppendASCII(kPrivateOfflineFileDir) .AppendASCII("hello.mhtml"); std::unique_ptr<TestOfflinePageArchiver> archiver5( - new TestOfflinePageArchiver(kTestUrl5, archive_file_path5, - kTestFileSize5)); + new TestOfflinePageArchiver(kTestUrl5, archive_file_path5, kTestFileSize5, + std::string())); SavePage(kTestUrl5, kTestClientId5, kTestUrl5, std::move(archiver5)); // Check if the original URL is still present. - OfflinePageItem page = GetPage(offline_id5()); + OfflinePageItem page = GetPage(offline_ids()[5]); EXPECT_EQ(kTestUrl5, page.original_url); + + // Save an offline page in public location with mismatched file size. + base::FilePath archive_file_path6 = + test_data_dir_path.AppendASCII(kPublicOfflineFileDir) + .AppendASCII("hello.mhtml"); + std::unique_ptr<TestOfflinePageArchiver> archiver6( + new TestOfflinePageArchiver(kTestUrl6, archive_file_path6, + kTestFileSize6Mismatch, kTestDigest6)); + + SavePage(kTestUrl6, kTestClientId6, GURL(), std::move(archiver6)); + + // Save an offline page in public location with mismatched digest. + base::FilePath archive_file_path7 = + test_data_dir_path.AppendASCII(kPublicOfflineFileDir) + .AppendASCII("hello.mhtml"); + std::unique_ptr<TestOfflinePageArchiver> archiver7( + new TestOfflinePageArchiver(kTestUrl7, archive_file_path7, kTestFileSize7, + kTestDigest7Mismatch)); + + SavePage(kTestUrl7, kTestClientId7, GURL(), std::move(archiver7)); + + // Save an offline page in public location with no digest. + base::FilePath archive_file_path8 = + test_data_dir_path.AppendASCII(kPublicOfflineFileDir) + .AppendASCII("hello.mhtml"); + std::unique_ptr<TestOfflinePageArchiver> archiver8( + new TestOfflinePageArchiver(kTestUrl8, archive_file_path8, kTestFileSize8, + std::string())); + + SavePage(kTestUrl8, kTestClientId8, GURL(), std::move(archiver8)); + + // Save 2 offline pages associated with same online URL, one in private + // location, while another in public location with mismatched digest. + base::FilePath archive_file_path9 = + test_data_dir_path.AppendASCII(kPrivateOfflineFileDir) + .AppendASCII("test.mhtml"); + std::unique_ptr<TestOfflinePageArchiver> archiver9( + new TestOfflinePageArchiver(kTestUrl9, archive_file_path9, kTestFileSize9, + std::string())); + + SavePage(kTestUrl9, kTestClientId9, GURL(), std::move(archiver9)); + + base::FilePath archive_file_path10 = + test_data_dir_path.AppendASCII(kPublicOfflineFileDir) + .AppendASCII("hello.mhtml"); + std::unique_ptr<TestOfflinePageArchiver> archiver10( + new TestOfflinePageArchiver(kTestUrl9, archive_file_path10, + kTestFileSize10, kTestDigest10Mismatch)); + + SavePage(kTestUrl9, kTestClientId10, GURL(), std::move(archiver10)); } void OfflinePageRequestJobTest::TearDown() { @@ -523,6 +628,15 @@ base::RunLoop().RunUntilIdle(); } +void OfflinePageRequestJobTest::WaitForAsyncOperation() { + // No need to wait if async operation is not needed. + if (async_operation_completed_) + return; + base::RunLoop run_loop; + async_operation_completed_callback_ = run_loop.QuitClosure(); + run_loop.Run(); +} + void OfflinePageRequestJobTest::SetUpNetworkObjectsOnIO() { DCHECK_CURRENTLY_ON(content::BrowserThread::IO); @@ -676,6 +790,7 @@ const ClientId& client_id, const GURL& original_url, std::unique_ptr<OfflinePageArchiver> archiver) { + async_operation_completed_ = false; OfflinePageModel::SavePageParams save_page_params; save_page_params.url = url; save_page_params.client_id = client_id; @@ -684,22 +799,21 @@ save_page_params, std::move(archiver), base::Bind(&OfflinePageRequestJobTest::OnSavePageDone, base::Unretained(this))); - RunUntilIdle(); + WaitForAsyncOperation(); } void OfflinePageRequestJobTest::OnSavePageDone(SavePageResult result, int64_t offline_id) { ASSERT_EQ(SavePageResult::SUCCESS, result); - if (offline_id_ == -1) - offline_id_ = offline_id; - else if (offline_id2_ == -1) - offline_id2_ = offline_id; - else if (offline_id3_ == -1) - offline_id3_ = offline_id; - else if (offline_id4_ == -1) - offline_id4_ = offline_id; - else if (offline_id5_ == -1) - offline_id5_ = offline_id; + // Make a dummy item at index 0 to make offline_ids_ look like to start from + // index 1 in order to match all the indices used in constants. + if (offline_ids_.empty()) + offline_ids_.push_back(0); + offline_ids_.push_back(offline_id); + + async_operation_completed_ = true; + if (!async_operation_completed_callback_.is_null()) + async_operation_completed_callback_.Run(); } OfflinePageItem OfflinePageRequestJobTest::GetPage(int64_t offline_id) { @@ -854,7 +968,7 @@ EXPECT_EQ(kTestFileSize2, bytes_read()); EXPECT_TRUE(is_offline_page_set_in_navigation_data()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id2(), + EXPECT_EQ(offline_ids()[2], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -893,7 +1007,7 @@ EXPECT_EQ(kTestFileSize2, bytes_read()); EXPECT_TRUE(is_offline_page_set_in_navigation_data()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id2(), + EXPECT_EQ(offline_ids()[2], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -959,7 +1073,7 @@ EXPECT_EQ(kTestFileSize2, bytes_read()); EXPECT_TRUE(is_offline_page_set_in_navigation_data()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id2(), + EXPECT_EQ(offline_ids()[2], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1005,7 +1119,7 @@ EXPECT_EQ(kTestFileSize2, bytes_read()); EXPECT_TRUE(is_offline_page_set_in_navigation_data()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id2(), + EXPECT_EQ(offline_ids()[2], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1058,14 +1172,14 @@ InterceptRequest(kTestUrl1, "GET", kOfflinePageHeader, std::string(kOfflinePageHeaderReasonKey) + "=download " + kOfflinePageHeaderIDKey + "=" + - base::Int64ToString(offline_id()), + base::Int64ToString(offline_ids()[1]), content::RESOURCE_TYPE_MAIN_FRAME); base::RunLoop().Run(); EXPECT_EQ(kTestFileSize1, bytes_read()); EXPECT_TRUE(is_offline_page_set_in_navigation_data()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id(), + EXPECT_EQ(offline_ids()[1], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1076,8 +1190,7 @@ ExpectOnlinePageSizeUniqueSample(kTestClientId1, 0, 1); } -TEST_F(OfflinePageRequestJobTest, - LoadOfflinePageByOfflineIDAndFallbackToOnlineURL) { +TEST_F(OfflinePageRequestJobTest, FailToLoadByOfflineIDOnUrlMismatch) { SimulateHasNetworkConnectivity(true); // The offline page found with specific offline ID does not match the passed @@ -1086,7 +1199,7 @@ InterceptRequest(kTestUrl2, "GET", kOfflinePageHeader, std::string(kOfflinePageHeaderReasonKey) + "=download " + kOfflinePageHeaderIDKey + "=" + - base::Int64ToString(offline_id()), + base::Int64ToString(offline_ids()[1]), content::RESOURCE_TYPE_MAIN_FRAME); base::RunLoop().Run(); @@ -1113,7 +1226,7 @@ EXPECT_EQ(kTestFileSize2, bytes_read()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id2(), + EXPECT_EQ(offline_ids()[2], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1129,7 +1242,7 @@ EXPECT_EQ(kTestFileSize3, bytes_read()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id3(), + EXPECT_EQ(offline_ids()[3], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectMultiUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1148,7 +1261,7 @@ EXPECT_EQ(kTestFileSize3, bytes_read()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id3(), + EXPECT_EQ(offline_ids()[3], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectMultiUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1170,7 +1283,7 @@ EXPECT_EQ(kTestFileSize3, bytes_read()); EXPECT_TRUE(is_offline_page_set_in_navigation_data()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id3(), + EXPECT_EQ(offline_ids()[3], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneNonuniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1194,7 +1307,7 @@ EXPECT_EQ(kTestFileSize5, bytes_read()); EXPECT_TRUE(is_offline_page_set_in_navigation_data()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id5(), + EXPECT_EQ(offline_ids()[5], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1214,7 +1327,7 @@ EXPECT_EQ(0, bytes_read()); EXPECT_TRUE(is_offline_page_set_in_navigation_data()); ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); - EXPECT_EQ(offline_id4(), + EXPECT_EQ(offline_ids()[4], offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); ExpectOneUniqueSampleForAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: @@ -1227,4 +1340,224 @@ ExpectOnlinePageSizeTotalSuffixCount(0); } +TEST_F(OfflinePageRequestJobTest, FileSizeMismatchOnDisconnectedNetwork) { + SimulateHasNetworkConnectivity(false); + + InterceptRequest(kTestUrl6, "GET", "", "", content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_DISCONNECTED_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, FileSizeMismatchOnProhibitivelySlowNetwork) { + SimulateHasNetworkConnectivity(true); + test_previews_decider()->set_should_allow_preview(true); + + InterceptRequest(kTestUrl6, "GET", "", "", content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_PROHIBITIVELY_SLOW_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, FileSizeMismatchOnConnectedNetwork) { + SimulateHasNetworkConnectivity(true); + + // When custom offline header exists and contains value other than + // "reason=error", it means that offline page is forced to load. + InterceptRequest(kTestUrl6, "GET", kOfflinePageHeader, + std::string(kOfflinePageHeaderReasonKey) + "=download", + content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_CONNECTED_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, FileSizeMismatchOnFlakyNetwork) { + SimulateHasNetworkConnectivity(true); + + // When custom offline header exists and contains "reason=error", it means + // that net error is hit in last request due to flaky network. + InterceptRequest(kTestUrl6, "GET", kOfflinePageHeader, + std::string(kOfflinePageHeaderReasonKey) + "=" + + kOfflinePageHeaderReasonValueDueToNetError, + content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_FLAKY_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, DigestMismatchOnDisconnectedNetwork) { + SimulateHasNetworkConnectivity(false); + + InterceptRequest(kTestUrl7, "GET", "", "", content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_DISCONNECTED_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, DigestMismatchOnProhibitivelySlowNetwork) { + SimulateHasNetworkConnectivity(true); + test_previews_decider()->set_should_allow_preview(true); + + InterceptRequest(kTestUrl7, "GET", "", "", content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_PROHIBITIVELY_SLOW_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, DigestMismatchOnConnectedNetwork) { + SimulateHasNetworkConnectivity(true); + + // When custom offline header exists and contains value other than + // "reason=error", it means that offline page is forced to load. + InterceptRequest(kTestUrl7, "GET", kOfflinePageHeader, + std::string(kOfflinePageHeaderReasonKey) + "=download", + content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_CONNECTED_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, DigestMismatchOnFlakyNetwork) { + SimulateHasNetworkConnectivity(true); + + // When custom offline header exists and contains "reason=error", it means + // that net error is hit in last request due to flaky network. + InterceptRequest(kTestUrl7, "GET", kOfflinePageHeader, + std::string(kOfflinePageHeaderReasonKey) + "=" + + kOfflinePageHeaderReasonValueDueToNetError, + content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_FLAKY_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, FailOnNoDigestForPublicArchiveFile) { + SimulateHasNetworkConnectivity(false); + + InterceptRequest(kTestUrl8, "GET", "", "", content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_DISCONNECTED_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, FailToLoadByOfflineIDOnDigestMismatch) { + SimulateHasNetworkConnectivity(true); + + // The offline page found with specific offline ID does not pass the + // validation. Though there is another page with the same URL, it will not be + // fetched. Instead, fall back to load the online URL. + InterceptRequest(kTestUrl9, "GET", kOfflinePageHeader, + std::string(kOfflinePageHeaderReasonKey) + "=download " + + kOfflinePageHeaderIDKey + "=" + + base::Int64ToString(offline_ids()[10]), + content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(0, bytes_read()); + EXPECT_FALSE(is_offline_page_set_in_navigation_data()); + EXPECT_FALSE(offline_page_tab_helper()->GetOfflinePageForTest()); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + DIGEST_MISMATCH_ON_CONNECTED_NETWORK); + ExpectNoAccessEntryPoint(); + ExpectOfflinePageSizeTotalSuffixCount(0); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + +TEST_F(OfflinePageRequestJobTest, LoadOtherPageOnDigestMismatch) { + SimulateHasNetworkConnectivity(false); + + // There're 2 offline pages matching kTestUrl9. The most recently created one + // (kTestClientId10) should fail on mistmatched digest. The second most + // recently created offline page (kTestClientId9) should be fetched. + InterceptRequest(kTestUrl9, "GET", "", "", content::RESOURCE_TYPE_MAIN_FRAME); + base::RunLoop().Run(); + + EXPECT_EQ(kTestFileSize9, bytes_read()); + EXPECT_TRUE(is_offline_page_set_in_navigation_data()); + ASSERT_TRUE(offline_page_tab_helper()->GetOfflinePageForTest()); + EXPECT_EQ(offline_ids()[9], + offline_page_tab_helper()->GetOfflinePageForTest()->offline_id); + ExpectOneUniqueSampleForAggregatedRequestResult( + OfflinePageRequestJob::AggregatedRequestResult:: + SHOW_OFFLINE_ON_DISCONNECTED_NETWORK); + ExpectAccessEntryPoint(kTestClientId9, + OfflinePageRequestJob::AccessEntryPoint::LINK); + ExpectOfflinePageSizeUniqueSample(kTestClientId9, 0, 1); + ExpectOnlinePageSizeTotalSuffixCount(0); +} + } // namespace offline_pages
diff --git a/chrome/browser/offline_pages/offline_page_tab_helper.cc b/chrome/browser/offline_pages/offline_page_tab_helper.cc index 5f4f5a80..9482220 100644 --- a/chrome/browser/offline_pages/offline_page_tab_helper.cc +++ b/chrome/browser/offline_pages/offline_page_tab_helper.cc
@@ -9,14 +9,18 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "build/build_config.h" +#include "chrome/browser/offline_pages/offline_page_model_factory.h" #include "chrome/browser/offline_pages/offline_page_request_job.h" +#include "chrome/browser/offline_pages/offline_page_utils.h" #include "chrome/browser/offline_pages/prefetch/prefetch_service_factory.h" #include "chrome/browser/offline_pages/request_coordinator_factory.h" #include "components/offline_pages/core/background/request_coordinator.h" #include "components/offline_pages/core/offline_page_item.h" +#include "components/offline_pages/core/offline_page_model.h" #include "components/offline_pages/core/offline_store_utils.h" #include "components/offline_pages/core/prefetch/offline_metrics_collector.h" #include "components/offline_pages/core/prefetch/prefetch_service.h" +#include "components/offline_pages/core/request_header/offline_page_header.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" @@ -119,14 +123,42 @@ // If a MHTML archive is being loaded for file: or content: URL, create an // untrusted offline page. + content::WebContents* web_contents = navigation_handle->GetWebContents(); if (SchemeIsForUntrustedOfflinePages(navigated_url) && - navigation_handle->GetWebContents()->GetContentsMimeType() == - "multipart/related") { + web_contents->GetContentsMimeType() == "multipart/related") { offline_info_.offline_page = std::make_unique<OfflinePageItem>(); offline_info_.offline_page->offline_id = store_utils::GenerateOfflineId(); offline_info_.is_trusted = false; // TODO(jianli): Extract the url where the MHTML acrhive claims from the // MHTML headers and set it in OfflinePageItem::original_url. + + // If the file: or content: URL is launched due to opening an item from + // Downloads home, a custom offline header containing the offline ID should + // be present. If so, find and use the corresponding offline page. + content::NavigationEntry* entry = + web_contents->GetController().GetLastCommittedEntry(); + DCHECK(entry); + std::string header_value = + OfflinePageUtils::ExtractOfflineHeaderValueFromNavigationEntry(*entry); + if (!header_value.empty()) { + OfflinePageHeader header(header_value); + if (header.reason == OfflinePageHeader::Reason::DOWNLOAD && + !header.id.empty()) { + int64_t offline_id; + if (base::StringToInt64(header.id, &offline_id)) { + offline_info_.offline_page->offline_id = offline_id; + OfflinePageModel* model = + OfflinePageModelFactory::GetForBrowserContext( + web_contents->GetBrowserContext()); + DCHECK(model); + model->GetPageByOfflineId( + offline_id, + base::Bind(&OfflinePageTabHelper::GetPageByOfflineIdDone, + weak_ptr_factory_.GetWeakPtr())); + } + } + } + return; } @@ -217,17 +249,17 @@ return; } - OfflinePageUtils::SelectPageForURL( + OfflinePageUtils::SelectPagesForURL( web_contents()->GetBrowserContext(), navigation_handle->GetURL(), URLSearchMode::SEARCH_BY_ALL_URLS, tab_id, - base::Bind(&OfflinePageTabHelper::SelectPageForURLDone, + base::Bind(&OfflinePageTabHelper::SelectPagesForURLDone, weak_ptr_factory_.GetWeakPtr())); } -void OfflinePageTabHelper::SelectPageForURLDone( - const OfflinePageItem* offline_page) { +void OfflinePageTabHelper::SelectPagesForURLDone( + const std::vector<OfflinePageItem>& offline_pages) { // Bails out if no offline page is found. - if (!offline_page) { + if (offline_pages.empty()) { OfflinePageRequestJob::ReportAggregatedRequestResult( OfflinePageRequestJob::AggregatedRequestResult:: PAGE_NOT_FOUND_ON_FLAKY_NETWORK); @@ -237,7 +269,8 @@ reloading_url_on_net_error_ = true; // Reloads the page with extra header set to force loading the offline page. - content::NavigationController::LoadURLParams load_params(offline_page->url); + content::NavigationController::LoadURLParams load_params( + offline_pages.front().url); load_params.transition_type = ui::PAGE_TRANSITION_RELOAD; OfflinePageHeader offline_header; offline_header.reason = OfflinePageHeader::Reason::NET_ERROR; @@ -245,6 +278,22 @@ web_contents()->GetController().LoadURLWithParams(load_params); } +void OfflinePageTabHelper::GetPageByOfflineIdDone( + const OfflinePageItem* offline_page) { + if (!offline_page) + return; + + // Update the temporary offline page which only contains the offline ID with + // the one retrieved from the metadata database. Do this only when the stored + // offline info is not changed since last time the asynchronous query is + // issued. + if (offline_info_.offline_page && !offline_info_.is_trusted && + offline_info_.offline_page->offline_id == offline_page->offline_id) { + offline_info_.offline_page = + base::MakeUnique<OfflinePageItem>(*offline_page); + } +} + // This is a callback from network request interceptor. It happens between // DidStartNavigation and DidFinishNavigation calls on this tab helper. void OfflinePageTabHelper::SetOfflinePage(
diff --git a/chrome/browser/offline_pages/offline_page_tab_helper.h b/chrome/browser/offline_pages/offline_page_tab_helper.h index d89478d..454fd65 100644 --- a/chrome/browser/offline_pages/offline_page_tab_helper.h +++ b/chrome/browser/offline_pages/offline_page_tab_helper.h
@@ -110,7 +110,9 @@ void TryLoadingOfflinePageOnNetError( content::NavigationHandle* navigation_handle); - void SelectPageForURLDone(const OfflinePageItem* offline_page); + void SelectPagesForURLDone(const std::vector<OfflinePageItem>& offline_pages); + + void GetPageByOfflineIdDone(const OfflinePageItem* offline_page); void DuplicateCheckDoneForScheduleDownload( content::WebContents* web_contents,
diff --git a/chrome/browser/offline_pages/offline_page_utils.cc b/chrome/browser/offline_pages/offline_page_utils.cc index 3efa562..ed0fd51 100644 --- a/chrome/browser/offline_pages/offline_page_utils.cc +++ b/chrome/browser/offline_pages/offline_page_utils.cc
@@ -11,6 +11,7 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" #include "base/time/time.h" #include "build/build_config.h" @@ -36,43 +37,39 @@ namespace offline_pages { namespace { +class OfflinePageComparer { + public: + OfflinePageComparer() = default; + + bool operator()(const OfflinePageItem& a, const OfflinePageItem& b) { + return a.creation_time > b.creation_time; + } +}; + void OnGetPagesByURLDone( const GURL& url, int tab_id, const std::vector<std::string>& namespaces_to_show_in_original_tab, - const base::Callback<void(const OfflinePageItem*)>& callback, + const base::Callback<void(const std::vector<OfflinePageItem>&)>& callback, const MultipleOfflinePageItemResult& pages) { - const OfflinePageItem* selected_page_for_final_url = nullptr; - const OfflinePageItem* selected_page_for_original_url = nullptr; + std::vector<OfflinePageItem> selected_pages; std::string tab_id_str = base::IntToString(tab_id); + // Exclude pages whose tab id does not match. for (const auto& page : pages) { if (base::ContainsValue(namespaces_to_show_in_original_tab, page.client_id.name_space) && page.client_id.id != tab_id_str) { continue; } - - if (OfflinePageUtils::EqualsIgnoringFragment(url, page.url)) { - if (!selected_page_for_final_url || - page.creation_time > selected_page_for_final_url->creation_time) { - selected_page_for_final_url = &page; - } - } else { - // This is consistent with exact match against original url done in - // GetPagesTask. - DCHECK(url == page.original_url); - if (!selected_page_for_original_url || - page.creation_time > selected_page_for_original_url->creation_time) { - selected_page_for_original_url = &page; - } - } + selected_pages.push_back(page); } - // Match for final URL should take high priority than matching for original - // URL. - callback.Run(selected_page_for_final_url ? selected_page_for_final_url - : selected_page_for_original_url); + // Sort based on creation date. + std::sort(selected_pages.begin(), selected_pages.end(), + OfflinePageComparer()); + + callback.Run(selected_pages); } bool IsSupportedByDownload(content::BrowserContext* browser_context, @@ -145,17 +142,17 @@ } // namespace // static -void OfflinePageUtils::SelectPageForURL( +void OfflinePageUtils::SelectPagesForURL( content::BrowserContext* browser_context, const GURL& url, URLSearchMode url_search_mode, int tab_id, - const base::Callback<void(const OfflinePageItem*)>& callback) { + const base::Callback<void(const std::vector<OfflinePageItem>&)>& callback) { OfflinePageModel* offline_page_model = OfflinePageModelFactory::GetForBrowserContext(browser_context); if (!offline_page_model) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::Bind(callback, nullptr)); + FROM_HERE, base::Bind(callback, std::vector<OfflinePageItem>())); return; } @@ -334,4 +331,25 @@ return true; } +// static +std::string OfflinePageUtils::ExtractOfflineHeaderValueFromNavigationEntry( + const content::NavigationEntry& entry) { + std::string extra_headers = entry.GetExtraHeaders(); + if (extra_headers.empty()) + return std::string(); + + // The offline header will be the only extra header if it is present. + std::string offline_header_key(offline_pages::kOfflinePageHeader); + offline_header_key += ": "; + if (!base::StartsWith(extra_headers, offline_header_key, + base::CompareCase::INSENSITIVE_ASCII)) { + return std::string(); + } + std::string header_value = extra_headers.substr(offline_header_key.length()); + if (header_value.find("\n") != std::string::npos) + return std::string(); + + return header_value; +} + } // namespace offline_pages
diff --git a/chrome/browser/offline_pages/offline_page_utils.h b/chrome/browser/offline_pages/offline_page_utils.h index 1c1ac36..0e50e10 100644 --- a/chrome/browser/offline_pages/offline_page_utils.h +++ b/chrome/browser/offline_pages/offline_page_utils.h
@@ -18,6 +18,7 @@ namespace content { class BrowserContext; +class NavigationEntry; class WebContents; } @@ -54,17 +55,18 @@ // Callback to inform the duplicate checking result. using DuplicateCheckCallback = base::Callback<void(DuplicateCheckResult)>; - // Returns via callback an offline page related to |url|, if any. The - // page is chosen based on creation date; a more recently created offline - // page will be preferred over an older one. The offline page captured from - // last visit in the tab will not be considered if its tab id does not match - // the provided |tab_id|. - static void SelectPageForURL( + // Returns via callback all offline pages related to |url|. The offline page + // captured from last visit in the tab will be excluded if its tab id does not + // match the provided |tab_id|. The returned list is sorted based creation + // date in descending order. That is, the most recently created offline will + // appear as the first element of the list. + static void SelectPagesForURL( content::BrowserContext* browser_context, const GURL& url, URLSearchMode url_search_mode, int tab_id, - const base::Callback<void(const OfflinePageItem*)>& callback); + const base::Callback<void(const std::vector<OfflinePageItem>&)>& + callback); // Gets the offline page corresponding to the given web contents. The // returned pointer is owned by the web_contents and may be deleted by user @@ -149,6 +151,13 @@ const SizeInBytesCallback& callback, const base::Time& begin_time, const base::Time& end_time); + + // Extracts and returns the value of the custom offline header from a + // navigation entry. Empty string is returned if it is not found. + // Note that the offline header is assumed to be the onlt extra header if it + // exists. + static std::string ExtractOfflineHeaderValueFromNavigationEntry( + const content::NavigationEntry& entry); }; } // namespace offline_pages
diff --git a/chrome/browser/offline_pages/offline_page_utils_unittest.cc b/chrome/browser/offline_pages/offline_page_utils_unittest.cc index 270713f..4b44c60 100644 --- a/chrome/browser/offline_pages/offline_page_utils_unittest.cc +++ b/chrome/browser/offline_pages/offline_page_utils_unittest.cc
@@ -35,6 +35,7 @@ #include "components/offline_pages/core/offline_page_test_archiver.h" #include "components/offline_pages/core/offline_page_test_store.h" #include "components/offline_pages/core/offline_page_types.h" +#include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" #include "content/public/test/test_browser_thread_bundle.h" #include "net/base/filename_util.h" @@ -497,4 +498,34 @@ EXPECT_EQ(kTestFileSize * 1, last_cache_size()); } +TEST_F(OfflinePageUtilsTest, TestExtractOfflineHeaderValueFromNavigationEntry) { + std::unique_ptr<content::NavigationEntry> entry( + content::NavigationEntry::Create()); + std::string header_value; + + // Expect empty string if no header is present. + header_value = + OfflinePageUtils::ExtractOfflineHeaderValueFromNavigationEntry(*entry); + EXPECT_EQ("", header_value); + + // Expect correct header value for correct header format. + entry->AddExtraHeaders("X-Chrome-offline: foo"); + header_value = + OfflinePageUtils::ExtractOfflineHeaderValueFromNavigationEntry(*entry); + EXPECT_EQ("foo", header_value); + + // Expect empty string if multiple headers are set. + entry->AddExtraHeaders("Another-Header: bar"); + header_value = + OfflinePageUtils::ExtractOfflineHeaderValueFromNavigationEntry(*entry); + EXPECT_EQ("", header_value); + + // Expect empty string for incorrect header format. + entry = content::NavigationEntry::Create(); + entry->AddExtraHeaders("Random value"); + header_value = + OfflinePageUtils::ExtractOfflineHeaderValueFromNavigationEntry(*entry); + EXPECT_EQ("", header_value); +} + } // namespace offline_pages
diff --git a/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle_unittest.cc b/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle_unittest.cc index f8a9a55..0911c566 100644 --- a/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle_unittest.cc +++ b/chrome/browser/page_load_metrics/experiments/delay_navigation_throttle_unittest.cc
@@ -44,10 +44,7 @@ EXPECT_FALSE(mock_time_task_runner->HasPendingTask()); EXPECT_EQ(content::NavigationThrottle::DEFER, - test_handle->CallWillStartRequestForTesting( - false /* is_post */, content::Referrer(), - false /* has_user_gesture */, ui::PAGE_TRANSITION_LINK, - false /* is_external_protocol */)); + test_handle->CallWillStartRequestForTesting()); // There may be other throttles that DEFER and post async tasks to the UI // thread. Allow them to run to completion, so our throttle is guaranteed to
diff --git a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc index 0c6cc46a..e2e0feff 100644 --- a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc
@@ -10,7 +10,6 @@ #include "base/optional.h" #include "base/strings/string_piece.h" #include "base/time/time.h" -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.h" @@ -25,6 +24,7 @@ #include "components/data_reduction_proxy/core/common/data_reduction_proxy_page_load_timing.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h" #include "content/public/browser/browser_context.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/web_contents.h" #include "url/gurl.h" @@ -106,7 +106,7 @@ DataReductionProxyMetricsObserver::~DataReductionProxyMetricsObserver() {} -// Check if the navigation data indicates anything about the DataReductionProxy. +// Check if the NavigationData indicates anything about the DataReductionProxy. page_load_metrics::PageLoadMetricsObserver::ObservePolicy DataReductionProxyMetricsObserver::OnCommit( content::NavigationHandle* navigation_handle, @@ -120,16 +120,18 @@ // will be called is in MetricsWebContentsObserver's destrcutor, which is // called in WebContents destructor. browser_context_ = navigation_handle->GetWebContents()->GetBrowserContext(); - const base::Value& navigation_data = navigation_handle->GetNavigationData(); - if (navigation_data.is_none()) - return STOP_OBSERVING; // As documented in content/public/browser/navigation_handle.h, this - // navigation data is the one returned from - // ResourceDispatcherHostDelegate::GetNavigationData() during commit. - ChromeNavigationData chrome_navigation_data(navigation_data); - + // NavigationData is a clone of the NavigationData instance returned from + // ResourceDispatcherHostDelegate::GetNavigationData during commit. + // Because ChromeResourceDispatcherHostDelegate always returns a + // ChromeNavigationData, it is safe to static_cast here. + ChromeNavigationData* chrome_navigation_data = + static_cast<ChromeNavigationData*>( + navigation_handle->GetNavigationData()); + if (!chrome_navigation_data) + return STOP_OBSERVING; data_reduction_proxy::DataReductionProxyData* data = - chrome_navigation_data.GetDataReductionProxyData(); + chrome_navigation_data->GetDataReductionProxyData(); if (!data || !data->used_data_reduction_proxy()) return STOP_OBSERVING; data_ = data->DeepCopy();
diff --git a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc index 30e5f9b..9cb933eb 100644 --- a/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc
@@ -15,7 +15,6 @@ #include "base/metrics/field_trial.h" #include "base/optional.h" #include "base/time/time.h" -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" #include "chrome/browser/page_load_metrics/observers/histogram_suffixes.h" @@ -38,6 +37,20 @@ const char kDefaultTestUrl[] = "http://google.com"; +data_reduction_proxy::DataReductionProxyData* DataForNavigationHandle( + content::WebContents* web_contents, + content::NavigationHandle* navigation_handle) { + ChromeNavigationData* chrome_navigation_data = new ChromeNavigationData(); + content::WebContentsTester::For(web_contents) + ->SetNavigationData(navigation_handle, + base::WrapUnique(chrome_navigation_data)); + data_reduction_proxy::DataReductionProxyData* data = + new data_reduction_proxy::DataReductionProxyData(); + chrome_navigation_data->SetDataReductionProxyData(base::WrapUnique(data)); + + return data; +} + // Pingback client responsible for recording the timing information it receives // from a SendPingback call. class TestPingbackClient @@ -104,17 +117,11 @@ // page_load_metrics::PageLoadMetricsObserver implementation: ObservePolicy OnCommit(content::NavigationHandle* navigation_handle, ukm::SourceId source_id) override { - auto data = std::make_unique<DataReductionProxyData>(); + DataReductionProxyData* data = + DataForNavigationHandle(web_contents_, navigation_handle); data->set_used_data_reduction_proxy(data_reduction_proxy_used_); data->set_request_url(GURL(kDefaultTestUrl)); data->set_lofi_requested(lofi_used_); - ChromeNavigationData chrome_navigation_data; - chrome_navigation_data.SetDataReductionProxyData(std::move(data)); - - content::WebContentsTester::For(web_contents_) - ->SetNavigationData(navigation_handle, - chrome_navigation_data.ToValue()); - return DataReductionProxyMetricsObserver::OnCommit(navigation_handle, source_id); }
diff --git a/chrome/browser/page_load_metrics/observers/noscript_preview_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/noscript_preview_page_load_metrics_observer.cc index bc05f0e..d29f390 100644 --- a/chrome/browser/page_load_metrics/observers/noscript_preview_page_load_metrics_observer.cc +++ b/chrome/browser/page_load_metrics/observers/noscript_preview_page_load_metrics_observer.cc
@@ -6,7 +6,6 @@ #include "base/optional.h" #include "base/time/time.h" -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" #include "chrome/browser/page_load_metrics/page_load_metrics_util.h" @@ -64,13 +63,13 @@ NoScriptPreviewPageLoadMetricsObserver::OnCommit( content::NavigationHandle* navigation_handle, ukm::SourceId source_id) { - const base::Value& navigation_data = navigation_handle->GetNavigationData(); - if (navigation_data.is_none()) + ChromeNavigationData* nav_data = static_cast<ChromeNavigationData*>( + navigation_handle->GetNavigationData()); + if (!nav_data) return STOP_OBSERVING; - ChromeNavigationData chrome_navigation_data(navigation_data); - previews::PreviewsType preview_type = previews::GetMainFramePreviewsType( - chrome_navigation_data.previews_state()); + previews::PreviewsType preview_type = + previews::GetMainFramePreviewsType(nav_data->previews_state()); if (preview_type == previews::PreviewsType::NOSCRIPT) return CONTINUE_OBSERVING;
diff --git a/chrome/browser/page_load_metrics/observers/noscript_preview_page_load_metrics_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/noscript_preview_page_load_metrics_observer_unittest.cc index 5e511ec7..9de2842 100644 --- a/chrome/browser/page_load_metrics/observers/noscript_preview_page_load_metrics_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/noscript_preview_page_load_metrics_observer_unittest.cc
@@ -12,7 +12,6 @@ #include "base/optional.h" #include "base/test/scoped_feature_list.h" #include "base/time/time.h" -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h" #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" @@ -63,12 +62,11 @@ content::NavigationSimulator::CreateRendererInitiated( GURL(kDefaultTestUrl), main_rfh()); navigation_simulator->Start(); - - ChromeNavigationData chrome_navigation_data; - chrome_navigation_data.set_previews_state(previews_state); + auto chrome_navigation_data = std::make_unique<ChromeNavigationData>(); + chrome_navigation_data->set_previews_state(previews_state); content::WebContentsTester::For(web_contents()) ->SetNavigationData(navigation_simulator->GetNavigationHandle(), - chrome_navigation_data.ToValue()); + std::move(chrome_navigation_data)); navigation_simulator->Commit(); return navigation_simulator->GetGlobalRequestID(); }
diff --git a/chrome/browser/page_load_metrics/observers/previews_ukm_observer.cc b/chrome/browser/page_load_metrics/observers/previews_ukm_observer.cc index 3796785..0c9c6af 100644 --- a/chrome/browser/page_load_metrics/observers/previews_ukm_observer.cc +++ b/chrome/browser/page_load_metrics/observers/previews_ukm_observer.cc
@@ -6,7 +6,6 @@ #include "base/optional.h" #include "base/time/time.h" -#include "base/values.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" @@ -37,18 +36,18 @@ // ResourceDispatcherHostDelegate::GetNavigationData during commit. // Because ChromeResourceDispatcherHostDelegate always returns a // ChromeNavigationData, it is safe to static_cast here. - const base::Value& navigation_data = navigation_handle->GetNavigationData(); - if (navigation_data.is_none()) + ChromeNavigationData* chrome_navigation_data = + static_cast<ChromeNavigationData*>( + navigation_handle->GetNavigationData()); + if (!chrome_navigation_data) return STOP_OBSERVING; - - ChromeNavigationData chrome_navigation_data(navigation_data); data_reduction_proxy::DataReductionProxyData* data = - chrome_navigation_data.GetDataReductionProxyData(); + chrome_navigation_data->GetDataReductionProxyData(); if (data && data->used_data_reduction_proxy() && data->lite_page_received()) { lite_page_seen_ = true; } content::PreviewsState previews_state = - chrome_navigation_data.previews_state(); + chrome_navigation_data->previews_state(); if (previews_state && previews::GetMainFramePreviewsType(previews_state) == previews::PreviewsType::NOSCRIPT) { noscript_seen_ = true;
diff --git a/chrome/browser/page_load_metrics/observers/previews_ukm_observer_unittest.cc b/chrome/browser/page_load_metrics/observers/previews_ukm_observer_unittest.cc index 7ae6691..86fc1c5 100644 --- a/chrome/browser/page_load_metrics/observers/previews_ukm_observer_unittest.cc +++ b/chrome/browser/page_load_metrics/observers/previews_ukm_observer_unittest.cc
@@ -7,7 +7,6 @@ #include "base/macros.h" #include "base/metrics/metrics_hashes.h" #include "base/optional.h" -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" #include "chrome/browser/page_load_metrics/observers/page_load_metrics_observer_test_harness.h" @@ -28,6 +27,20 @@ const char kDefaultTestUrl[] = "https://www.google.com/"; +data_reduction_proxy::DataReductionProxyData* DataForNavigationHandle( + content::WebContents* web_contents, + content::NavigationHandle* navigation_handle) { + ChromeNavigationData* chrome_navigation_data = new ChromeNavigationData(); + content::WebContentsTester::For(web_contents) + ->SetNavigationData(navigation_handle, + base::WrapUnique(chrome_navigation_data)); + data_reduction_proxy::DataReductionProxyData* data = + new data_reduction_proxy::DataReductionProxyData(); + chrome_navigation_data->SetDataReductionProxyData(base::WrapUnique(data)); + + return data; +} + class TestPreviewsUKMObserver : public PreviewsUKMObserver { public: TestPreviewsUKMObserver(content::WebContents* web_contents, @@ -44,23 +57,23 @@ // page_load_metrics::PageLoadMetricsObserver implementation: ObservePolicy OnCommit(content::NavigationHandle* navigation_handle, ukm::SourceId source_id) override { - ChromeNavigationData chrome_navigation_data; + data_reduction_proxy::DataReductionProxyData* data = + DataForNavigationHandle(web_contents_, navigation_handle); + data->set_used_data_reduction_proxy(data_reduction_proxy_used_); + data->set_request_url(GURL(kDefaultTestUrl)); + data->set_lite_page_received(lite_page_received_); - auto data_reduction_proxy_data = - std::make_unique<data_reduction_proxy::DataReductionProxyData>(); - data_reduction_proxy_data->set_used_data_reduction_proxy( - data_reduction_proxy_used_); - data_reduction_proxy_data->set_request_url(GURL(kDefaultTestUrl)); - data_reduction_proxy_data->set_lite_page_received(lite_page_received_); - chrome_navigation_data.SetDataReductionProxyData( - std::move(data_reduction_proxy_data)); - - if (noscript_on_) - chrome_navigation_data.set_previews_state(content::NOSCRIPT_ON); - - content::WebContentsTester::For(web_contents_) - ->SetNavigationData(navigation_handle, - chrome_navigation_data.ToValue()); + if (noscript_on_) { + // ChromeNavigationData is guaranteed to be non-null at this point, as + // DataForNavigationHandle is always called prior to this and creates one. + ChromeNavigationData* chrome_navigation_data = + static_cast<ChromeNavigationData*>( + navigation_handle->GetNavigationData()); + content::PreviewsState previews_state = + chrome_navigation_data->previews_state(); + chrome_navigation_data->set_previews_state(previews_state |= + content::NOSCRIPT_ON); + } return PreviewsUKMObserver::OnCommit(navigation_handle, source_id); }
diff --git a/chrome/browser/password_manager/credential_manager_browsertest.cc b/chrome/browser/password_manager/credential_manager_browsertest.cc index f2b6c13..b1b3026b 100644 --- a/chrome/browser/password_manager/credential_manager_browsertest.cc +++ b/chrome/browser/password_manager/credential_manager_browsertest.cc
@@ -1004,9 +1004,9 @@ // Reload the page and make sure it's autofilled. NavigateToFile("/password/password_form.html"); - WaitForElementValue("username_field", "user"); content::SimulateMouseClickAt( WebContents(), 0, blink::WebMouseEvent::Button::kLeft, gfx::Point(1, 1)); + WaitForElementValue("username_field", "user"); WaitForElementValue("password_field", "12345"); }
diff --git a/chrome/browser/password_manager/password_manager_browsertest.cc b/chrome/browser/password_manager/password_manager_browsertest.cc index 3f77775..4a7f903c 100644 --- a/chrome/browser/password_manager/password_manager_browsertest.cc +++ b/chrome/browser/password_manager/password_manager_browsertest.cc
@@ -968,13 +968,11 @@ // Now navigate to a login form that has similar HTML markup. NavigateToFile("/password/password_form.html"); - // The form should be filled with the previously submitted username. - CheckElementValue("username_field", "my_username"); - // Simulate a user click to force an autofill of the form's DOM value, not // just the suggested value. content::SimulateMouseClick(WebContents(), 0, blink::WebMouseEvent::Button::kLeft); + WaitForElementValue("username_field", "my_username"); WaitForElementValue("password_field", "password"); // Submit the form and verify that there is no infobar (as the password @@ -1153,7 +1151,7 @@ } IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, - PasswordValueAccessible) { + UsernameAndPasswordValueAccessible) { // At first let us save a credential to the password store. scoped_refptr<password_manager::TestPasswordStore> password_store = static_cast<password_manager::TestPasswordStore*>( @@ -1186,18 +1184,16 @@ NavigateToFile("/password/form_and_link.html"); reload_observer.Wait(); - // Wait until the username is filled, to make sure autofill kicked in. - WaitForElementValue("username_field", "admin"); - // Now check that the password is not accessible yet. + // Now check that the username and the password are not accessible yet. + CheckElementValue("username_field", ""); CheckElementValue("password_field", ""); // Let the user interact with the page. content::SimulateMouseClickAt( WebContents(), 0, blink::WebMouseEvent::Button::kLeft, gfx::Point(1, 1)); - // Wait until that interaction causes the password value to be revealed. + // Wait until that interaction causes the username and the password value to + // be revealed. + WaitForElementValue("username_field", "admin"); WaitForElementValue("password_field", "12345"); - // And check that after the side-effects of the interaction took place, the - // username value stays the same. - CheckElementValue("username_field", "admin"); } IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, @@ -2299,10 +2295,8 @@ NavigateToFile("/password/password_form_in_same_origin_iframe.html"); reload_observer.Wait(); - // Verify username is autofilled - CheckElementValue("iframe", "username_field", "temp"); - - // Verify password is not autofilled + // Verify password and username are not accessible yet. + CheckElementValue("iframe", "username_field", ""); CheckElementValue("iframe", "password_field", ""); // Simulate the user interaction in the iframe which should trigger autofill. @@ -2326,11 +2320,9 @@ content::SimulateMouseClickAt( WebContents(), 0, blink::WebMouseEvent::Button::kLeft, gfx::Point(x, y)); - // Verify password has been autofilled + // Verify username and password have been autofilled + WaitForElementValue("iframe", "username_field", "temp"); WaitForElementValue("iframe", "password_field", "pa55w0rd"); - - // Verify username has been autofilled - CheckElementValue("iframe", "username_field", "temp"); } IN_PROC_BROWSER_TEST_F(PasswordManagerBrowserTestBase, NoFormElementTest) { @@ -2965,13 +2957,12 @@ // password is autofilled. NavigateToFile("/password/password_form.html"); - CheckElementValue("hidden_password_form_username", "myusername"); - // Let the user interact with the page, so that DOM gets modification events, // needed for autofilling the password. content::SimulateMouseClickAt( WebContents(), 0, blink::WebMouseEvent::Button::kLeft, gfx::Point(1, 1)); + WaitForElementValue("hidden_password_form_username", "myusername"); WaitForElementValue("hidden_password_form_password", "mypassword"); } @@ -2994,13 +2985,12 @@ // whether username and password is autofilled. NavigateToFile("/password/password_form.html"); - CheckElementValue("form_with_hidden_password_username", "myusername"); - // Let the user interact with the page, so that DOM gets modification events, // needed for autofilling the password. content::SimulateMouseClickAt( WebContents(), 0, blink::WebMouseEvent::Button::kLeft, gfx::Point(1, 1)); + WaitForElementValue("form_with_hidden_password_username", "myusername"); WaitForElementValue("form_with_hidden_password_password", "mypassword"); }
diff --git a/chrome/browser/password_manager/save_password_infobar_delegate_android.cc b/chrome/browser/password_manager/save_password_infobar_delegate_android.cc index 4c9cba8..162b883 100644 --- a/chrome/browser/password_manager/save_password_infobar_delegate_android.cc +++ b/chrome/browser/password_manager/save_password_infobar_delegate_android.cc
@@ -72,7 +72,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier SavePasswordInfoBarDelegate::GetIdentifier() const { - return SAVE_PASSWORD_INFOBAR_DELEGATE; + return SAVE_PASSWORD_INFOBAR_DELEGATE_MOBILE; } void SavePasswordInfoBarDelegate::InfoBarDismissed() {
diff --git a/chrome/browser/password_manager/update_password_infobar_delegate_android.cc b/chrome/browser/password_manager/update_password_infobar_delegate_android.cc index 8e894f0..1b81114 100644 --- a/chrome/browser/password_manager/update_password_infobar_delegate_android.cc +++ b/chrome/browser/password_manager/update_password_infobar_delegate_android.cc
@@ -88,7 +88,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier UpdatePasswordInfoBarDelegate::GetIdentifier() const { - return UPDATE_PASSWORD_INFOBAR_DELEGATE; + return UPDATE_PASSWORD_INFOBAR_DELEGATE_MOBILE; } int UpdatePasswordInfoBarDelegate::GetButtons() const {
diff --git a/chrome/browser/permissions/permission_prompt_android.cc b/chrome/browser/permissions/permission_prompt_android.cc index 60d077f..e2563aca 100644 --- a/chrome/browser/permissions/permission_prompt_android.cc +++ b/chrome/browser/permissions/permission_prompt_android.cc
@@ -105,7 +105,7 @@ return requests[0]->GetMessageText(); CheckValidRequestGroup(requests); return l10n_util::GetStringFUTF16( - IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO, + IDS_MEDIA_CAPTURE_AUDIO_AND_VIDEO_INFOBAR_TEXT, url_formatter::FormatUrlForSecurityDisplay( requests[0]->GetOrigin(), url_formatter::SchemeDisplay::OMIT_CRYPTOGRAPHIC));
diff --git a/chrome/browser/permissions/permission_request_impl.cc b/chrome/browser/permissions/permission_request_impl.cc index 30e3993..4c08ea1 100644 --- a/chrome/browser/permissions/permission_request_impl.cc +++ b/chrome/browser/permissions/permission_request_impl.cc
@@ -93,28 +93,28 @@ int message_id; switch (content_settings_type_) { case CONTENT_SETTINGS_TYPE_GEOLOCATION: - message_id = IDS_GEOLOCATION_INFOBAR_QUESTION; + message_id = IDS_GEOLOCATION_INFOBAR_TEXT; break; case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: - message_id = IDS_NOTIFICATION_PERMISSIONS; + message_id = IDS_NOTIFICATIONS_INFOBAR_TEXT; break; case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: - message_id = IDS_MIDI_SYSEX_INFOBAR_QUESTION; + message_id = IDS_MIDI_SYSEX_INFOBAR_TEXT; break; case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: - message_id = IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_QUESTION; + message_id = IDS_PROTECTED_MEDIA_IDENTIFIER_INFOBAR_TEXT; break; case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: - message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY; + message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY_INFOBAR_TEXT; break; case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: - message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY; + message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY_INFOBAR_TEXT; break; case CONTENT_SETTINGS_TYPE_ACCESSIBILITY_EVENTS: - message_id = IDS_ACCESSIBILITY_EVENTS_INFOBAR_QUESTION; + message_id = IDS_ACCESSIBILITY_EVENTS_INFOBAR_TEXT; break; case CONTENT_SETTINGS_TYPE_CLIPBOARD_READ: - message_id = IDS_CLIPBOARD_INFOBAR_QUESTION; + message_id = IDS_CLIPBOARD_INFOBAR_TEXT; break; default: NOTREACHED();
diff --git a/chrome/browser/permissions/permission_update_infobar_delegate_android.cc b/chrome/browser/permissions/permission_update_infobar_delegate_android.cc index 81ae8ad..17f268e5 100644 --- a/chrome/browser/permissions/permission_update_infobar_delegate_android.cc +++ b/chrome/browser/permissions/permission_update_infobar_delegate_android.cc
@@ -150,7 +150,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier PermissionUpdateInfoBarDelegate::GetIdentifier() const { - return PERMISSION_UPDATE_INFOBAR_DELEGATE; + return PERMISSION_UPDATE_INFOBAR_DELEGATE_ANDROID; } int PermissionUpdateInfoBarDelegate::GetIconId() const {
diff --git a/chrome/browser/permissions/permission_util.cc b/chrome/browser/permissions/permission_util.cc index 6edf0c95..17bda92c 100644 --- a/chrome/browser/permissions/permission_util.cc +++ b/chrome/browser/permissions/permission_util.cc
@@ -224,7 +224,9 @@ ContentSetting final_content_setting = settings_map->GetContentSetting( primary_url_, secondary_url_, content_type_, std::string()); if (final_content_setting != CONTENT_SETTING_ALLOW) { + // PermissionUmaUtil takes origins, even though they're typed as GURL. + GURL requesting_origin = primary_url_.GetOrigin(); PermissionUmaUtil::PermissionRevoked(content_type_, source_ui_, - primary_url_, profile_); + requesting_origin, profile_); } }
diff --git a/chrome/browser/plugins/flash_download_interception_unittest.cc b/chrome/browser/plugins/flash_download_interception_unittest.cc index dcb4f87c..960a654 100644 --- a/chrome/browser/plugins/flash_download_interception_unittest.cc +++ b/chrome/browser/plugins/flash_download_interception_unittest.cc
@@ -4,6 +4,8 @@ #include "chrome/browser/plugins/flash_download_interception.h" +#include <memory> + #include "base/test/scoped_feature_list.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/common/chrome_features.h" @@ -11,6 +13,9 @@ #include "chrome/test/base/testing_profile.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "content/public/browser/navigation_handle.h" +#include "content/public/browser/navigation_throttle.h" +#include "content/public/test/navigation_simulator.h" +#include "content/public/test/test_navigation_throttle_inserter.h" #include "testing/gtest/include/gtest/gtest.h" #include "url/gurl.h" @@ -102,17 +107,16 @@ // Set the source URL to an HTTP source. NavigateAndCommit(GURL("http://example.com")); - std::unique_ptr<NavigationHandle> handle = - NavigationHandle::CreateNavigationHandleForTesting( - GURL("https://get.adobe.com/flashplayer"), main_rfh()); + content::TestNavigationThrottleInserter throttle_inserter( + web_contents(), + base::BindRepeating(&FlashDownloadInterception::MaybeCreateThrottleFor)); - handle->CallWillStartRequestForTesting(true, content::Referrer(), true, - ui::PAGE_TRANSITION_LINK, false); - std::unique_ptr<NavigationThrottle> throttle = - FlashDownloadInterception::MaybeCreateThrottleFor(handle.get()); - EXPECT_NE(nullptr, throttle); - ASSERT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, - throttle->WillStartRequest()); + std::unique_ptr<content::NavigationSimulator> simulator = + content::NavigationSimulator::CreateRendererInitiated( + GURL("https://get.adobe.com/flashplayer"), main_rfh()); + simulator->Commit(); + EXPECT_EQ(content::NavigationThrottle::CANCEL_AND_IGNORE, + simulator->GetLastThrottleCheckResult()); } TEST_F(FlashDownloadInterceptionTest, OnlyInterceptOnDetectContentSetting) {
diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc index 8197707d..528d987 100644 --- a/chrome/browser/plugins/plugin_observer.cc +++ b/chrome/browser/plugins/plugin_observer.cc
@@ -11,7 +11,6 @@ #include "base/debug/crash_logging.h" #include "base/memory/ptr_util.h" #include "base/metrics/histogram_macros.h" -#include "base/strings/utf_string_conversions.h" #include "build/build_config.h" #include "chrome/app/vector_icons/vector_icons.h" #include "chrome/browser/browser_process.h" @@ -22,6 +21,7 @@ #include "chrome/browser/plugins/plugin_infobar_delegates.h" #include "chrome/browser/plugins/plugin_installer.h" #include "chrome/browser/plugins/plugin_installer_observer.h" +#include "chrome/browser/plugins/reload_plugin_infobar_delegate.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/tab_modal_confirm_dialog.h" #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h" @@ -30,9 +30,6 @@ #include "chrome/grit/generated_resources.h" #include "components/component_updater/component_updater_service.h" #include "components/content_settings/core/browser/host_content_settings_map.h" -#include "components/infobars/core/confirm_infobar_delegate.h" -#include "components/infobars/core/infobar.h" -#include "components/infobars/core/infobar_delegate.h" #include "components/infobars/core/simple_alert_infobar_delegate.h" #include "components/metrics_services_manager/metrics_services_manager.h" #include "content/public/browser/browser_thread.h" @@ -49,81 +46,6 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(PluginObserver); -namespace { - -// ReloadPluginInfoBarDelegate ------------------------------------------------- - -class ReloadPluginInfoBarDelegate : public ConfirmInfoBarDelegate { - public: - static void Create(InfoBarService* infobar_service, - content::NavigationController* controller, - const base::string16& message); - - private: - ReloadPluginInfoBarDelegate(content::NavigationController* controller, - const base::string16& message); - ~ReloadPluginInfoBarDelegate() override; - - // ConfirmInfobarDelegate: - infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; - const gfx::VectorIcon& GetVectorIcon() const override; - base::string16 GetMessageText() const override; - int GetButtons() const override; - base::string16 GetButtonLabel(InfoBarButton button) const override; - bool Accept() override; - - content::NavigationController* controller_; - base::string16 message_; -}; - -// static -void ReloadPluginInfoBarDelegate::Create( - InfoBarService* infobar_service, - content::NavigationController* controller, - const base::string16& message) { - infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( - std::unique_ptr<ConfirmInfoBarDelegate>( - new ReloadPluginInfoBarDelegate(controller, message)))); -} - -ReloadPluginInfoBarDelegate::ReloadPluginInfoBarDelegate( - content::NavigationController* controller, - const base::string16& message) - : controller_(controller), - message_(message) {} - -ReloadPluginInfoBarDelegate::~ReloadPluginInfoBarDelegate() {} - -infobars::InfoBarDelegate::InfoBarIdentifier -ReloadPluginInfoBarDelegate::GetIdentifier() const { - return RELOAD_PLUGIN_INFOBAR_DELEGATE; -} - -const gfx::VectorIcon& ReloadPluginInfoBarDelegate::GetVectorIcon() const { - return kExtensionCrashedIcon; -} - -base::string16 ReloadPluginInfoBarDelegate::GetMessageText() const { - return message_; -} - -int ReloadPluginInfoBarDelegate::GetButtons() const { - return BUTTON_OK; -} - -base::string16 ReloadPluginInfoBarDelegate::GetButtonLabel( - InfoBarButton button) const { - DCHECK_EQ(BUTTON_OK, button); - return l10n_util::GetStringUTF16(IDS_RELOAD_PAGE_WITH_PLUGIN); -} - -bool ReloadPluginInfoBarDelegate::Accept() { - controller_->Reload(content::ReloadType::NORMAL, true); - return true; -} - -} // namespace - // PluginObserver ------------------------------------------------------------- class PluginObserver::PluginPlaceholderHost : public PluginInstallerObserver { @@ -261,6 +183,19 @@ infobar_text); } +// static +void PluginObserver::CreatePluginObserverInfoBar( + InfoBarService* infobar_service, + const base::string16& plugin_name) { + SimpleAlertInfoBarDelegate::Create( + infobar_service, + infobars::InfoBarDelegate::PLUGIN_OBSERVER_INFOBAR_DELEGATE, + &kExtensionCrashedIcon, + l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, + plugin_name), + true); +} + void PluginObserver::BlockedOutdatedPlugin( chrome::mojom::PluginRendererPtr plugin_renderer, const std::string& identifier) { @@ -315,10 +250,6 @@ plugin_path); base::string16 plugin_name = PluginService::GetInstance()->GetPluginDisplayNameByPath(plugin_path); - SimpleAlertInfoBarDelegate::Create( - InfoBarService::FromWebContents(web_contents()), - infobars::InfoBarDelegate::PLUGIN_OBSERVER, &kExtensionCrashedIcon, - l10n_util::GetStringFUTF16(IDS_PLUGIN_INITIALIZATION_ERROR_PROMPT, - plugin_name), - true); + CreatePluginObserverInfoBar(InfoBarService::FromWebContents(web_contents()), + plugin_name); }
diff --git a/chrome/browser/plugins/plugin_observer.h b/chrome/browser/plugins/plugin_observer.h index 9fea55db..0499c88f 100644 --- a/chrome/browser/plugins/plugin_observer.h +++ b/chrome/browser/plugins/plugin_observer.h
@@ -11,6 +11,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "base/strings/string16.h" #include "chrome/common/features.h" #include "chrome/common/plugin.mojom.h" #include "components/component_updater/component_updater_service.h" @@ -18,6 +19,8 @@ #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" +class InfoBarService; + namespace content { class WebContents; } @@ -32,6 +35,10 @@ void PluginCrashed(const base::FilePath& plugin_path, base::ProcessId plugin_pid) override; + // Public for tests only. + static void CreatePluginObserverInfoBar(InfoBarService* infobar_service, + const base::string16& plugin_name); + private: class ComponentObserver; class PluginPlaceholderHost;
diff --git a/chrome/browser/plugins/reload_plugin_infobar_delegate.cc b/chrome/browser/plugins/reload_plugin_infobar_delegate.cc new file mode 100644 index 0000000..5c3edde9 --- /dev/null +++ b/chrome/browser/plugins/reload_plugin_infobar_delegate.cc
@@ -0,0 +1,57 @@ +// Copyright 2018 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/plugins/reload_plugin_infobar_delegate.h" + +#include "chrome/app/vector_icons/vector_icons.h" +#include "chrome/browser/infobars/infobar_service.h" +#include "chrome/grit/generated_resources.h" +#include "components/infobars/core/infobar.h" +#include "content/public/browser/navigation_controller.h" +#include "ui/base/l10n/l10n_util.h" + +// static +void ReloadPluginInfoBarDelegate::Create( + InfoBarService* infobar_service, + content::NavigationController* controller, + const base::string16& message) { + infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( + std::unique_ptr<ConfirmInfoBarDelegate>( + new ReloadPluginInfoBarDelegate(controller, message)))); +} + +ReloadPluginInfoBarDelegate::ReloadPluginInfoBarDelegate( + content::NavigationController* controller, + const base::string16& message) + : controller_(controller), message_(message) {} + +ReloadPluginInfoBarDelegate::~ReloadPluginInfoBarDelegate() {} + +infobars::InfoBarDelegate::InfoBarIdentifier +ReloadPluginInfoBarDelegate::GetIdentifier() const { + return RELOAD_PLUGIN_INFOBAR_DELEGATE; +} + +const gfx::VectorIcon& ReloadPluginInfoBarDelegate::GetVectorIcon() const { + return kExtensionCrashedIcon; +} + +base::string16 ReloadPluginInfoBarDelegate::GetMessageText() const { + return message_; +} + +int ReloadPluginInfoBarDelegate::GetButtons() const { + return BUTTON_OK; +} + +base::string16 ReloadPluginInfoBarDelegate::GetButtonLabel( + InfoBarButton button) const { + DCHECK_EQ(BUTTON_OK, button); + return l10n_util::GetStringUTF16(IDS_RELOAD_PAGE_WITH_PLUGIN); +} + +bool ReloadPluginInfoBarDelegate::Accept() { + controller_->Reload(content::ReloadType::NORMAL, true); + return true; +}
diff --git a/chrome/browser/plugins/reload_plugin_infobar_delegate.h b/chrome/browser/plugins/reload_plugin_infobar_delegate.h new file mode 100644 index 0000000..933b9fb --- /dev/null +++ b/chrome/browser/plugins/reload_plugin_infobar_delegate.h
@@ -0,0 +1,40 @@ +// Copyright 2018 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_PLUGINS_RELOAD_PLUGIN_INFOBAR_DELEGATE_H_ +#define CHROME_BROWSER_PLUGINS_RELOAD_PLUGIN_INFOBAR_DELEGATE_H_ + +#include "base/strings/string16.h" +#include "components/infobars/core/confirm_infobar_delegate.h" + +class InfoBarService; + +namespace content { +class NavigationController; +} + +class ReloadPluginInfoBarDelegate : public ConfirmInfoBarDelegate { + public: + static void Create(InfoBarService* infobar_service, + content::NavigationController* controller, + const base::string16& message); + + private: + ReloadPluginInfoBarDelegate(content::NavigationController* controller, + const base::string16& message); + ~ReloadPluginInfoBarDelegate() override; + + // ConfirmInfobarDelegate: + infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override; + const gfx::VectorIcon& GetVectorIcon() const override; + base::string16 GetMessageText() const override; + int GetButtons() const override; + base::string16 GetButtonLabel(InfoBarButton button) const override; + bool Accept() override; + + content::NavigationController* controller_; + base::string16 message_; +}; + +#endif // CHROME_BROWSER_PLUGINS_RELOAD_PLUGIN_INFOBAR_DELEGATE_H_
diff --git a/chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc index e771f55..2f374b4 100644 --- a/chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc +++ b/chrome/browser/policy/cloud/cloud_policy_invalidator_unittest.cc
@@ -884,7 +884,6 @@ } void CloudPolicyInvalidatorUserTypedTest::SetUp() { - base::StatisticsRecorder::Initialize(); refresh_samples_ = GetHistogramSamples( GetPolicyType() == em::DeviceRegisterRequest::DEVICE ? kMetricDevicePolicyRefresh : kMetricUserPolicyRefresh);
diff --git a/chrome/browser/policy/policy_network_browsertest.cc b/chrome/browser/policy/policy_network_browsertest.cc index c3b5e773..8fbb936 100644 --- a/chrome/browser/policy/policy_network_browsertest.cc +++ b/chrome/browser/policy/policy_network_browsertest.cc
@@ -28,6 +28,7 @@ #include "components/policy/policy_constants.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/network_service_instance.h" #include "content/public/browser/storage_partition.h" #include "content/public/common/content_features.h" #include "content/public/test/browser_test.h" @@ -313,6 +314,12 @@ PolicyMap policy_map; provider->UpdateChromePolicy(policy_map); base::RunLoop().RunUntilIdle(); + + // To avoid any races between sending future requests and disabling QUIC in + // the network process, flush the NetworkService Mojo interface, which is + // the one that has the DisableQuic() method. + if (base::FeatureList::IsEnabled(features::kNetworkService)) + content::FlushNetworkServiceInstanceForTesting(); } // Returns the first Profile.
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index 9acfb5b6e..8f4ea3d 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc
@@ -202,7 +202,7 @@ #include "chrome/browser/chromeos/arc/arc_session_manager.h" #include "chrome/browser/chromeos/arc/policy/arc_policy_bridge.h" #include "chrome/browser/chromeos/customization/customization_document.h" -#include "chrome/browser/chromeos/display/display_preferences.h" +#include "chrome/browser/chromeos/display/display_prefs.h" #include "chrome/browser/chromeos/extensions/echo_private_api.h" #include "chrome/browser/chromeos/file_system_provider/registry.h" #include "chrome/browser/chromeos/first_run/first_run.h" @@ -424,7 +424,7 @@ chromeos::NetworkThrottlingObserver::RegisterPrefs(registry); chromeos::PowerMetricsReporter::RegisterLocalStatePrefs(registry); chromeos::Preferences::RegisterPrefs(registry); - chromeos::RegisterDisplayLocalStatePrefs(registry); + chromeos::DisplayPrefs::RegisterLocalStatePrefs(registry); chromeos::ResetScreen::RegisterPrefs(registry); chromeos::ResourceReporter::RegisterPrefs(registry); chromeos::ServicesCustomizationDocument::RegisterPrefs(registry);
diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index f0242b8..3aacaf5 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc
@@ -23,6 +23,7 @@ #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/bind_test_util.h" #include "base/test/scoped_feature_list.h" #include "base/test/simple_test_tick_clock.h" #include "base/test/test_timeouts.h" @@ -99,6 +100,7 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/common/browser_side_navigation_policy.h" +#include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/resource_request_body.h" #include "content/public/common/url_constants.h" @@ -107,6 +109,7 @@ #include "content/public/test/ppapi_test_utils.h" #include "content/public/test/test_navigation_observer.h" #include "content/public/test/test_utils.h" +#include "content/public/test/url_loader_interceptor.h" #include "extensions/common/constants.h" #include "extensions/common/extension_urls.h" #include "extensions/common/manifest_handlers/mime_types_handler.h" @@ -147,7 +150,6 @@ using net::NetworkChangeNotifier; using prerender::test_utils::RequestCounter; using prerender::test_utils::CreateCountingInterceptorOnIO; -using prerender::test_utils::CreateHangingFirstRequestInterceptor; using prerender::test_utils::CreateMockInterceptorOnIO; using prerender::test_utils::TestPrerender; using prerender::test_utils::TestPrerenderContents; @@ -654,9 +656,9 @@ host_resolver()->AddRule("*", "127.0.0.1"); } - void SetUpInProcessBrowserTestFixture() override { - test_utils::PrerenderInProcessBrowserTest:: - SetUpInProcessBrowserTestFixture(); + void TearDownOnMainThread() override { + test_utils::PrerenderInProcessBrowserTest::TearDownOnMainThread(); + interceptor_.reset(); } void NavigateToDestURL() const { @@ -964,6 +966,35 @@ mid_load_clock_ = nullptr; } + // Makes |url| never respond on the first load, and then with the contents of + // |file| afterwards. When the first load has been scheduled, runs + // |callback_io| on the IO thread. + void CreateHangingFirstRequestInterceptor(const GURL& url, + const base::FilePath& file, + base::Closure closure) { + // TODO(jam): use the URLLoaderInterceptor for the non-network service path + // once http://crbug.com/740130 is fixed. + if (base::FeatureList::IsEnabled(features::kNetworkService)) { + DCHECK(!interceptor_); + interceptor_ = std::make_unique<content::URLLoaderInterceptor>( + base::BindLambdaForTesting( + [=](content::URLLoaderInterceptor::RequestParams* params) { + if (params->url_request.url == url) { + static bool first = true; + if (first) { + first = false; + closure.Run(); + return true; + } + } + return false; + })); + } else { + test_utils::CreateHangingFirstRequestInterceptor( + url, file, GetIOCallbackFromUIClosure(closure)); + } + } + private: // TODO(davidben): Remove this altogether so the tests don't globally assume // only one prerender. @@ -1087,6 +1118,7 @@ base::test::ScopedFeatureList feature_list_; base::TimeDelta mid_load_clock_tick_advance_; base::SimpleTestTickClock* mid_load_clock_; + std::unique_ptr<content::URLLoaderInterceptor> interceptor_; }; // Checks that a page is correctly prerendered in the case of a @@ -1368,9 +1400,8 @@ base::FilePath file(GetTestPath("prerender_page.html")); base::RunLoop prerender_start_loop; - CreateHangingFirstRequestInterceptor( - kNoCommitUrl, file, - GetIOCallbackFromUIClosure(prerender_start_loop.QuitClosure())); + CreateHangingFirstRequestInterceptor(kNoCommitUrl, file, + prerender_start_loop.QuitClosure()); DisableJavascriptCalls(); PrerenderTestURL(kNoCommitUrl, FINAL_STATUS_NAVIGATION_UNCOMMITTED, @@ -1395,9 +1426,8 @@ base::FilePath file(GetTestPath("prerender_page.html")); base::RunLoop prerender_start_loop; - CreateHangingFirstRequestInterceptor( - kNoCommitUrl, file, - GetIOCallbackFromUIClosure(prerender_start_loop.QuitClosure())); + CreateHangingFirstRequestInterceptor(kNoCommitUrl, file, + prerender_start_loop.QuitClosure()); DisableJavascriptCalls(); PrerenderTestURL(CreateClientRedirect(kNoCommitUrl.spec()), FINAL_STATUS_APP_TERMINATING, 1); @@ -2472,21 +2502,12 @@ // unload handlers on the referring page are executed and its WebContents is // destroyed. IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderUnload) { - // Matches URL in prerender_loader_with_unload.html. - const GURL unload_url("http://unload-url.test"); - base::FilePath empty_file = ui_test_utils::GetTestFilePath( - base::FilePath(), base::FilePath(FILE_PATH_LITERAL("empty.html"))); - RequestCounter unload_counter; - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&CreateCountingInterceptorOnIO, unload_url, empty_file, - unload_counter.AsWeakPtr())); - set_loader_path("/prerender/prerender_loader_with_unload.html"); PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1); WebContentsDestructionObserver destruction_observer(GetActiveWebContents()); NavigateToDestURL(); - unload_counter.WaitForCount(1); + // Matches URL in prerender_loader_with_unload.html. + WaitForRequestCount(src_server()->GetURL("/unload-url"), 1); destruction_observer.Wait(); } @@ -2494,40 +2515,23 @@ // prerendered page is swapped in. Also checks that the WebContents of the // referring page is destroyed. IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderBeforeUnload) { - // This URL is requested from prerender_loader_with_beforeunload.html. - const GURL beforeunload_url("http://unload-url.test"); - base::FilePath empty_file = ui_test_utils::GetTestFilePath( - base::FilePath(), base::FilePath(FILE_PATH_LITERAL("empty.html"))); - RequestCounter request_counter; - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&CreateCountingInterceptorOnIO, beforeunload_url, - empty_file, request_counter.AsWeakPtr())); - set_loader_path("/prerender/prerender_loader_with_beforeunload.html"); PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1); WebContentsDestructionObserver destruction_observer(GetActiveWebContents()); NavigateToDestURL(); - request_counter.WaitForCount(1); + // This URL is requested from prerender_loader_with_beforeunload.html. + WaitForRequestCount(src_server()->GetURL("/unload-url"), 1); destruction_observer.Wait(); } // Checks that a hanging unload on the referring page of a prerender swap does // not crash the browser on exit. IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderHangingUnload) { - // Matches URL in prerender_loader_with_unload.html. - const GURL hang_url("http://unload-url.test"); - base::FilePath empty_file = ui_test_utils::GetTestFilePath( - base::FilePath(), base::FilePath(FILE_PATH_LITERAL("empty.html"))); - CreateHangingFirstRequestInterceptor( - hang_url, empty_file, base::Callback<void(net::URLRequest*)>()); - - set_loader_path("/prerender/prerender_loader_with_unload.html"); + set_loader_path("/prerender/prerender_loader_with_hanging_unload.html"); PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1); NavigateToDestURL(); } - // Checks that when the history is cleared, prerendering is cancelled and // prerendering history is cleared. IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderClearHistory) { @@ -3111,19 +3115,11 @@ // Checks that <a ping> requests are not dropped in prerender. IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderPing) { // Count hits to a certain URL. - const GURL kPingURL("http://prerender.test/ping"); - base::FilePath empty_file = ui_test_utils::GetTestFilePath( - base::FilePath(), base::FilePath(FILE_PATH_LITERAL("empty.html"))); - RequestCounter ping_counter; - BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, - base::BindOnce(&CreateCountingInterceptorOnIO, kPingURL, empty_file, - ping_counter.AsWeakPtr())); - + const GURL kPingURL(src_server()->GetURL("/echo")); PrerenderTestURL("/prerender/prerender_page.html", FINAL_STATUS_USED, 1); OpenDestURLViaClickPing(kPingURL); - ping_counter.WaitForCount(1); + WaitForRequestCount(kPingURL, 1); } // Checks that a prerender which calls window.close() on itself is aborted. @@ -3298,7 +3294,7 @@ request->priority(), base::Unretained(out_priority), closure)); }; - CreateHangingFirstRequestInterceptor( + test_utils::CreateHangingFirstRequestInterceptor( image_url, base::FilePath(), base::Bind(io_lambda, base::Unretained(&url_request), base::Unretained(&priority), wait_loop.QuitClosure())); @@ -3373,9 +3369,8 @@ GURL url = embedded_test_server()->GetURL("/prerender/prerender_page.html"); base::RunLoop hanging_request_waiter; - CreateHangingFirstRequestInterceptor( - url, GetTestPath("prerender_page.html"), - GetIOCallbackFromUIClosure(hanging_request_waiter.QuitClosure())); + CreateHangingFirstRequestInterceptor(url, GetTestPath("prerender_page.html"), + hanging_request_waiter.QuitClosure()); // As this load will be canceled, it is not waited for, and hence no // javascript is executed. DisableJavascriptCalls(); @@ -3464,9 +3459,8 @@ base::FilePath(FILE_PATH_LITERAL("prerender/prerender_page.html"))); base::RunLoop prerender_start_loop; - CreateHangingFirstRequestInterceptor( - url, url_file, - GetIOCallbackFromUIClosure(prerender_start_loop.QuitClosure())); + CreateHangingFirstRequestInterceptor(url, url_file, + prerender_start_loop.QuitClosure()); // As this load is uncommitted, it is not waited for, and hence no // javascript is executed. DisableJavascriptCalls(); @@ -3589,9 +3583,9 @@ base::FilePath(FILE_PATH_LITERAL("prerender/prerender_page.html"))); base::RunLoop prerender_start_loop; - CreateHangingFirstRequestInterceptor( - url, url_file, - GetIOCallbackFromUIClosure(prerender_start_loop.QuitClosure())); + CreateHangingFirstRequestInterceptor(url, url_file, + prerender_start_loop.QuitClosure()); + // As this load is uncommitted, it is not waited for, and hence no // javascript is executed. DisableJavascriptCalls();
diff --git a/chrome/browser/previews/previews_infobar_tab_helper.cc b/chrome/browser/previews/previews_infobar_tab_helper.cc index 92ac6b6..db71da1c 100644 --- a/chrome/browser/previews/previews_infobar_tab_helper.cc +++ b/chrome/browser/previews/previews_infobar_tab_helper.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/values.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.h" @@ -73,13 +72,10 @@ previews_user_data_.reset(); // Store Previews information for this navigation. - const base::Value& navigation_data = navigation_handle->GetNavigationData(); - if (!navigation_data.is_none()) { - ChromeNavigationData chrome_navigation_data(navigation_data); - if (chrome_navigation_data.previews_user_data()) { - previews_user_data_ = - chrome_navigation_data.previews_user_data()->DeepCopy(); - } + ChromeNavigationData* nav_data = static_cast<ChromeNavigationData*>( + navigation_handle->GetNavigationData()); + if (nav_data && nav_data->previews_user_data()) { + previews_user_data_ = nav_data->previews_user_data()->DeepCopy(); } uint64_t page_id = (previews_user_data_) ? previews_user_data_->page_id() : 0;
diff --git a/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc b/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc index 8261d8b8..cc1b4e92 100644 --- a/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc +++ b/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc
@@ -11,7 +11,6 @@ #include "base/run_loop.h" #include "base/strings/stringprintf.h" #include "base/threading/thread_task_runner_handle.h" -#include "base/values.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/loader/chrome_navigation_data.h" #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" @@ -90,22 +89,20 @@ } void SetCommittedPreviewsType(previews::PreviewsType previews_type) { - const base::Value& navigation_data = test_handle_->GetNavigationData(); - ChromeNavigationData chrome_navigation_data(navigation_data); - - // Add a PreviewsUserData if it didn't exist. - if (!chrome_navigation_data.previews_user_data()) { - auto previews_user_data = std::make_unique<previews::PreviewsUserData>(1); - chrome_navigation_data.set_previews_user_data( - std::move(previews_user_data)); + ChromeNavigationData* nav_data = + static_cast<ChromeNavigationData*>(test_handle_->GetNavigationData()); + if (nav_data && nav_data->previews_user_data()) { + nav_data->previews_user_data()->SetCommittedPreviewsType(previews_type); + return; } - - chrome_navigation_data.previews_user_data()->SetCommittedPreviewsType( - previews_type); - + std::unique_ptr<ChromeNavigationData> chrome_nav_data( + new ChromeNavigationData()); + std::unique_ptr<previews::PreviewsUserData> previews_user_data( + new previews::PreviewsUserData(1)); + previews_user_data->SetCommittedPreviewsType(previews_type); + chrome_nav_data->set_previews_user_data(std::move(previews_user_data)); content::WebContentsTester::For(web_contents()) - ->SetNavigationData(test_handle_.get(), - chrome_navigation_data.ToValue()); + ->SetNavigationData(test_handle_.get(), std::move(chrome_nav_data)); } void SimulateWillProcessResponse() { @@ -127,13 +124,17 @@ EXPECT_TRUE(test_handle_); EXPECT_TRUE(previews_user_data); // Store Previews information for this navigation. - const base::Value& navigation_data = test_handle_->GetNavigationData(); - ChromeNavigationData chrome_navigation_data(navigation_data); - chrome_navigation_data.set_previews_user_data( - std::move(previews_user_data)); + ChromeNavigationData* nav_data = + static_cast<ChromeNavigationData*>(test_handle_->GetNavigationData()); + if (nav_data) { + nav_data->set_previews_user_data(std::move(previews_user_data)); + return; + } + std::unique_ptr<ChromeNavigationData> navigation_data = + base::MakeUnique<ChromeNavigationData>(); + navigation_data->set_previews_user_data(std::move(previews_user_data)); content::WebContentsTester::For(web_contents()) - ->SetNavigationData(test_handle_.get(), - chrome_navigation_data.ToValue()); + ->SetNavigationData(test_handle_.get(), std::move(navigation_data)); } protected:
diff --git a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc index bcd6b0b..1b0b2e8 100644 --- a/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc +++ b/chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc
@@ -107,6 +107,7 @@ #include "chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.h" #include "chrome/browser/chromeos/printing/cups_print_job_manager_factory.h" #include "chrome/browser/chromeos/printing/synced_printers_manager_factory.h" +#include "chrome/browser/chromeos/smb_client/smb_service_factory.h" #include "chrome/browser/chromeos/tether/tether_service_factory.h" #include "chrome/browser/extensions/api/platform_keys/verify_trust_api.h" #else @@ -246,6 +247,7 @@ #if defined(OS_CHROMEOS) chromeos::CupsPrintJobManagerFactory::GetInstance(); chromeos::SyncedPrintersManagerFactory::GetInstance(); + chromeos::smb_client::SmbServiceFactory::GetInstance(); TetherServiceFactory::GetInstance(); extensions::VerifyTrustAPI::GetFactoryInstance(); #endif
diff --git a/chrome/browser/resources/PRESUBMIT.py b/chrome/browser/resources/PRESUBMIT.py index e7a3e43..9ebdb0a 100644 --- a/chrome/browser/resources/PRESUBMIT.py +++ b/chrome/browser/resources/PRESUBMIT.py
@@ -98,7 +98,8 @@ def RunOptimizeWebUiTests(input_api, output_api): presubmit_path = input_api.PresubmitLocalPath() - tests = [input_api.os_path.join(presubmit_path, 'optimize_webui_test.py')] + sources = ['optimize_webui_test.py', 'unpack_pak.py'] + tests = [input_api.os_path.join(presubmit_path, s) for s in sources] return input_api.canned_checks.RunUnitTests(input_api, output_api, tests)
diff --git a/chrome/browser/resources/chromeos/login/oobe_change_picture.js b/chrome/browser/resources/chromeos/login/oobe_change_picture.js index b9000687..178e897 100644 --- a/chrome/browser/resources/chromeos/login/oobe_change_picture.js +++ b/chrome/browser/resources/chromeos/login/oobe_change_picture.js
@@ -205,8 +205,8 @@ onPhotoTaken_: function(event) { chrome.send('photoTaken', [event.detail.photoDataUrl]); this.pictureList_.setOldImageUrl(event.detail.photoDataUrl); - this.pictureList_.setFocus(); + this.sendSelectImage_(CrPicture.SelectionTypes.OLD, ''); announceAccessibleMessage( loadTimeData.getString('photoCaptureAccessibleText')); },
diff --git a/chrome/browser/resources/chromeos/select_to_speak/options.html b/chrome/browser/resources/chromeos/select_to_speak/options.html index e218099..4cbc4da 100644 --- a/chrome/browser/resources/chromeos/select_to_speak/options.html +++ b/chrome/browser/resources/chromeos/select_to_speak/options.html
@@ -44,6 +44,25 @@ </select> </div> + <div class="option"> + <span class="i18n" msgid="options_pitch_description" + id="pitch_description"></span> + <select id="pitch" aria-labelledby="pitch_description"> + <option value="0.55" class="i18n" msgid="options_pitch_lowest"> + </option> + <option value="0.70" class="i18n" msgid="options_pitch_lower"> + </option> + <option value="0.85" class="i18n" msgid="options_pitch_low"> + </option> + <option value="1.0" class="i18n" msgid="options_pitch_normal"> + </option> + <option value="1.15" class="i18n" msgid="options_pitch_high"> + </option> + <option value="1.3" class="i18n" msgid="options_pitch_highest"> + </option> + </select> + </div> + <h2 class="i18n" msgid="options_highlight"></h2> <div class="option"> <input id="wordHighlight" type="checkbox" class="checkbox pref"
diff --git a/chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js b/chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js index 04eab9a..d4e8f7cd 100644 --- a/chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js +++ b/chrome/browser/resources/chromeos/select_to_speak/select_to_speak.js
@@ -296,6 +296,9 @@ /** @private {number} */ this.speechRate_ = 1.0; + /** @private {number} */ + this.speechPitch_ = 1.0; + /** @private {boolean} */ this.wordHighlight_ = false; @@ -572,6 +575,7 @@ let options = { rate: this.speechRate_, + pitch: this.speechPitch_, 'enqueue': true, onEvent: (function(nodeGroup, isLast, event) { @@ -714,7 +718,7 @@ var updatePrefs = (function() { chrome.storage.sync.get( - ['voice', 'rate', 'wordHighlight', 'highlightColor'], + ['voice', 'rate', 'pitch', 'wordHighlight', 'highlightColor'], (function(prefs) { if (prefs['voice']) { this.voiceNameFromPrefs_ = prefs['voice']; @@ -724,6 +728,11 @@ } else { chrome.storage.sync.set({'rate': this.speechRate_}); } + if (prefs['pitch']) { + this.speechPitch_ = parseFloat(prefs['pitch']); + } else { + chrome.storage.sync.set({'pitch': this.speechPitch_}); + } if (prefs['wordHighlight'] !== undefined) { this.wordHighlight_ = prefs['wordHighlight']; }
diff --git a/chrome/browser/resources/chromeos/select_to_speak/select_to_speak_options.js b/chrome/browser/resources/chromeos/select_to_speak/select_to_speak_options.js index a3cea7ea..bb8a040 100644 --- a/chrome/browser/resources/chromeos/select_to_speak/select_to_speak_options.js +++ b/chrome/browser/resources/chromeos/select_to_speak/select_to_speak_options.js
@@ -22,6 +22,7 @@ }.bind(this)); this.syncSelectControlToPref_('voice', 'voice'); this.syncSelectControlToPref_('rate', 'rate'); + this.syncSelectControlToPref_('pitch', 'pitch'); this.syncCheckboxControlToPref_( 'wordHighlight', 'wordHighlight', function(checked) { let elem = document.getElementById('highlightSubOption');
diff --git a/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd b/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd index c78c65c..8967fce 100644 --- a/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd +++ b/chrome/browser/resources/chromeos/select_to_speak/strings/select_to_speak_strings.grd
@@ -183,6 +183,27 @@ <message desc="Example of a word highlight on a light background in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_HIGHLIGHT_LIGHT"> Light background </message> + <message desc="Label for the control in the Select-to-speak options dialog where the user can choose the pitch of synthesized speech." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_DESCRIPTION"> + Select a speech pitch: + </message> + <message desc="Label for the lowest synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_LOWEST"> + Lowest + </message> + <message desc="Label forer low synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_LOWER"> + Lower + </message> + <message desc="Label for low synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_LOW"> + Low + </message> + <message desc="Label for a normal synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_NORMAL"> + Normal + </message> + <message desc="Label for high synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_HIGH"> + High + </message> + <message desc="Label for highest synthesized speech pitch in the Select-to-speak options dialog." name="IDS_SELECT_TO_SPEAK_OPTIONS_PITCH_HIGHEST"> + Highest + </message> </messages> </release> </grit>
diff --git a/chrome/browser/resources/interventions_internals/index.css b/chrome/browser/resources/interventions_internals/index.css index 295eddc7..1af46cd 100644 --- a/chrome/browser/resources/interventions_internals/index.css +++ b/chrome/browser/resources/interventions_internals/index.css
@@ -273,7 +273,7 @@ } #previews-flags-table { - width: 30%; + width: 60%; } .log-time {
diff --git a/chrome/browser/resources/md_bookmarks/folder_node.html b/chrome/browser/resources/md_bookmarks/folder_node.html index 1dbf675..56d75f5 100644 --- a/chrome/browser/resources/md_bookmarks/folder_node.html +++ b/chrome/browser/resources/md_bookmarks/folder_node.html
@@ -99,7 +99,9 @@ open$="[[isSelectedFolder_]]" no-children$="[[!hasChildFolder_]]"> </div> - <div class="menu-label elided-text">[[item_.title]]</div> + <div class="menu-label elided-text"" title="[[item_.title]]"> + [[item_.title]] + </div> </div> </div> <div id="descendants" role="group">
diff --git a/chrome/browser/resources/md_bookmarks/folder_node.js b/chrome/browser/resources/md_bookmarks/folder_node.js index ba8e361..78008a9 100644 --- a/chrome/browser/resources/md_bookmarks/folder_node.js +++ b/chrome/browser/resources/md_bookmarks/folder_node.js
@@ -58,6 +58,7 @@ observers: [ 'updateAriaExpanded_(hasChildFolder_, isOpen)', + 'scrollIntoViewIfNeeded_(isSelectedFolder_)', ], /** @override */ @@ -76,12 +77,6 @@ }); this.updateFromStore(); - - if (this.isSelectedFolder_) { - this.async(function() { - this.scrollIntoViewIfNeeded(); - }); - } }, /** @@ -387,6 +382,17 @@ }, /** + * Scrolls the folder node into view when the folder is selected. + * @private + */ + scrollIntoViewIfNeeded_: function() { + if (!this.isSelectedFolder_) + return; + + this.async(() => this.$.container.scrollIntoViewIfNeeded()); + }, + + /** * @param {?boolean} openState * @param {number} depth * @return {boolean}
diff --git a/chrome/browser/resources/md_extensions/error_page.html b/chrome/browser/resources/md_extensions/error_page.html index 847dc02..6e55bdd 100644 --- a/chrome/browser/resources/md_extensions/error_page.html +++ b/chrome/browser/resources/md_extensions/error_page.html
@@ -175,6 +175,7 @@ <div id="main"> <div id="heading"> <button id="close-button" is="paper-icon-button-light" + aria-label="$i18n{back}" class="icon-arrow-back no-overlap" on-tap="onCloseButtonTap_"> </button> <span>$i18n{errorsPageHeading}</span> @@ -192,9 +193,14 @@ <div class$="error-item [[computeErrorClass_(item, selectedEntry_)]]"> <div actionable class=" start" on-tap="onErrorItemAction_" - on-keydown="onErrorItemAction_" tabindex="0"> - <iron-icon icon$="[[computeErrorIcon_(item)]]"></iron-icon> - <div class="error-message">[[item.message]]</div> + on-keydown="onErrorItemAction_" tabindex="0" + role="button"> + <iron-icon icon$="[[computeErrorIcon_(item)]]" + aria-label$="[[computeErrorTypeLabel_(item)]]"> + </iron-icon> + <div id$="[[item.id]]" class="error-message"> + [[item.message]] + </div> <div class$="cr-icon [[iconName_(index, selectedEntry_)]]" hidden="[[!computeIsRuntimeError_(item)]]"> </div> @@ -202,6 +208,8 @@ <div class="separator"></div> <button is="paper-icon-button-light" class="icon-delete-gray" on-tap="onDeleteErrorAction_" + aria-describedby$="[[item.id]]" + aria-label="$i18n{clearEntry}" on-keydown="onDeleteErrorAction_"> </button> </div>
diff --git a/chrome/browser/resources/md_extensions/error_page.js b/chrome/browser/resources/md_extensions/error_page.js index f11cb5d..05f081e 100644 --- a/chrome/browser/resources/md_extensions/error_page.js +++ b/chrome/browser/resources/md_extensions/error_page.js
@@ -43,6 +43,32 @@ return url.startsWith(fullUrl) ? url.substring(fullUrl.length) : url; } + /** + * Given 3 strings, this function returns the correct one for the type of + * error that |item| is. + * @param {!ManifestError|!RuntimeError} item + * @param {string} log + * @param {string} warn + * @param {string} error + * @return {string} + * @private + */ + function getErrorSeverityText_(item, log, warn, error) { + if (item.type == chrome.developerPrivate.ErrorType.RUNTIME) { + switch (item.severity) { + case chrome.developerPrivate.ErrorLevel.LOG: + return log; + case chrome.developerPrivate.ErrorLevel.WARN: + return warn; + case chrome.developerPrivate.ErrorLevel.ERROR: + return error; + } + assertNotReached(); + } + assert(item.type == chrome.developerPrivate.ErrorType.MANIFEST); + return warn; + } + const ErrorPage = Polymer({ is: 'extensions-error-page', @@ -131,19 +157,20 @@ * @private */ computeErrorIcon_: function(error) { - if (error.type == chrome.developerPrivate.ErrorType.RUNTIME) { - switch (error.severity) { - case chrome.developerPrivate.ErrorLevel.LOG: - return 'info'; - case chrome.developerPrivate.ErrorLevel.WARN: - return 'warning'; - case chrome.developerPrivate.ErrorLevel.ERROR: - return 'error'; - } - assertNotReached(); - } - assert(error.type == chrome.developerPrivate.ErrorType.MANIFEST); - return 'warning'; + // Do not i18n these strings, they're CSS classes. + return getErrorSeverityText_(error, 'info', 'warning', 'error'); + }, + + /** + * @param {!ManifestError|!RuntimeError} error + * @return {string} + * @private + */ + computeErrorTypeLabel_: function(error) { + return getErrorSeverityText_( + error, loadTimeData.getString('logLevel'), + loadTimeData.getString('warnLevel'), + loadTimeData.getString('errorLevel')); }, /**
diff --git a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js index 507b84d..2a414b1 100644 --- a/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js +++ b/chrome/browser/resources/settings/chrome_cleanup_page/chrome_cleanup_page.js
@@ -905,8 +905,10 @@ ], [ settings.ChromeCleanerCardState.CLEANER_DOWNLOAD_FAILED, { - title: this.i18n('chromeCleanupTitleNoInternet'), - explanation: this.i18n('chromeCleanupExplanationNoInternet'), + // TODO(crbug.com/776538): distinguish between missing network + // connectivity and cleanups being disabled by the server. + title: this.i18n('chromeCleanupTitleCleanupUnavailable'), + explanation: this.i18n('chromeCleanupExplanationCleanupUnavailable'), icon: icons.WARNING, actionButton: actionButtons.TRY_SCAN_AGAIN, flags: learnMoreIfUserInitiatedCleanupsDisabled,
diff --git a/chrome/browser/resources/settings/people_page/lock_screen.html b/chrome/browser/resources/settings/people_page/lock_screen.html index 94cf6755..cdaa250 100644 --- a/chrome/browser/resources/settings/people_page/lock_screen.html +++ b/chrome/browser/resources/settings/people_page/lock_screen.html
@@ -62,11 +62,6 @@ @apply(--settings-list-frame-padding); } - .list-frame[disabled] { - opacity: var(--settings-disabled-opacity); - pointer-events: none; - } - .no-padding { padding: 0; } @@ -74,6 +69,11 @@ .underbar { border-bottom: var(--settings-separator-line); } + + #unlockType[disabled] { + opacity: var(--settings-disabled-opacity); + pointer-events: none; + } </style> <div> @@ -91,8 +91,9 @@ </cr-policy-indicator> </template> </div> - <div class="list-frame" disabled$="[[quickUnlockDisabledByPolicy_]]"> + <div class="list-frame" > <paper-radio-group id="unlockType" + disabled$="[[quickUnlockDisabledByPolicy_]]" selected="{{selectedUnlockType}}"> <paper-radio-button name="password" class="list-item underbar"> <div class="start">
diff --git a/chrome/browser/resources/settings/people_page/lock_screen.js b/chrome/browser/resources/settings/people_page/lock_screen.js index 1f0983d..05d3fd6 100644 --- a/chrome/browser/resources/settings/people_page/lock_screen.js +++ b/chrome/browser/resources/settings/people_page/lock_screen.js
@@ -264,8 +264,10 @@ this.showPasswordPromptDialog_ = false; if (!this.setModes_) settings.navigateToPreviousRoute(); - else + else if (!this.$$('#unlockType').disabled) cr.ui.focusWithoutInk(assert(this.$$('#unlockType'))); + else + cr.ui.focusWithoutInk(assert(this.$$('#screenLockDiv'))); }, /**
diff --git a/chrome/browser/resources/settings/people_page/manage_profile.html b/chrome/browser/resources/settings/people_page/manage_profile.html index fbc49f4..e547ff48 100644 --- a/chrome/browser/resources/settings/people_page/manage_profile.html +++ b/chrome/browser/resources/settings/people_page/manage_profile.html
@@ -20,7 +20,7 @@ <div class="settings-box first"> <paper-input id="name" value="[[profileName]]" pattern=".*\S.*" on-change="onProfileNameChanged_" on-keydown="onProfileNameKeydown_" - disabled="[[isProfileNameDisabled_(syncStatus)]]" + disabled="[[isProfileNameDisabled_(syncStatus)]]" maxlength="500" auto-validate no-label-float required> </paper-input> </div>
diff --git a/chrome/browser/resources/settings/search_settings.js b/chrome/browser/resources/settings/search_settings.js index c5124873..ba19566e 100644 --- a/chrome/browser/resources/settings/search_settings.js +++ b/chrome/browser/resources/settings/search_settings.js
@@ -439,28 +439,25 @@ if (this.running_) return; - while (1) { - var task = this.popNextTask_(); - if (!task) { - this.running_ = false; - if (this.onEmptyCallback_) - this.onEmptyCallback_(); - return; - } - - this.running_ = true; - window.requestIdleCallback(() => { - if (!this.request_.canceled) { - task.exec().then(() => { - this.running_ = false; - this.consumePending_(); - }); - } - // Nothing to do otherwise. Since the request corresponding to this - // queue was canceled, the queue is disposed along with the request. - }); + var task = this.popNextTask_(); + if (!task) { + this.running_ = false; + if (this.onEmptyCallback_) + this.onEmptyCallback_(); return; } + + this.running_ = true; + window.requestIdleCallback(() => { + if (!this.request_.canceled) { + task.exec().then(() => { + this.running_ = false; + this.consumePending_(); + }); + } + // Nothing to do otherwise. Since the request corresponding to this + // queue was canceled, the queue is disposed along with the request. + }); } }
diff --git a/chrome/browser/resources/settings/settings_page/main_page_behavior.js b/chrome/browser/resources/settings/settings_page/main_page_behavior.js index d46d1e6..33a7680 100644 --- a/chrome/browser/resources/settings/settings_page/main_page_behavior.js +++ b/chrome/browser/resources/settings/settings_page/main_page_behavior.js
@@ -360,7 +360,6 @@ }, /** - /** * Hides or unhides the sections not being expanded. * @param {string} sectionName The section to keep visible. * @param {boolean} hidden Whether the sections should be hidden.
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd index 2a5b9f2..34e3036a 100644 --- a/chrome/browser/resources/settings/settings_resources.grd +++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -421,6 +421,9 @@ <structure name="IDR_SETTINGS_CONTROLS_TOGGLE_BUTTON_JS" file="controls/settings_toggle_button.js" type="chrome_html" /> + <structure name="IDR_SETTINGS_COOKIE_INFO_HTML" + file="site_settings/cookie_info.html" + type="chrome_html" /> <structure name="IDR_SETTINGS_COOKIE_INFO_JS" file="site_settings/cookie_info.js" type="chrome_html" />
diff --git a/chrome/browser/resources/settings/site_settings/cookie_info.html b/chrome/browser/resources/settings/site_settings/cookie_info.html new file mode 100644 index 0000000..77485cab --- /dev/null +++ b/chrome/browser/resources/settings/site_settings/cookie_info.html
@@ -0,0 +1 @@ +<script src="cookie_info.js"></script>
diff --git a/chrome/browser/resources/settings/site_settings/site_data.html b/chrome/browser/resources/settings/site_settings/site_data.html index 72c73a8..c50d941 100644 --- a/chrome/browser/resources/settings/site_settings/site_data.html +++ b/chrome/browser/resources/settings/site_settings/site_data.html
@@ -13,6 +13,7 @@ <link rel="import" href="../global_scroll_target_behavior.html"> <link rel="import" href="../settings_page/settings_subpage_search.html"> <link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="cookie_info.html"> <link rel="import" href="local_data_browser_proxy.html"> <link rel="import" href="site_settings_behavior.html"> @@ -89,6 +90,5 @@ </div> </dialog> </template> - <script src="cookie_info.js"></script> <script src="site_data.js"></script> </dom-module>
diff --git a/chrome/browser/resources/settings/site_settings/site_data.js b/chrome/browser/resources/settings/site_settings/site_data.js index e0e85e99..f3cca9a4 100644 --- a/chrome/browser/resources/settings/site_settings/site_data.js +++ b/chrome/browser/resources/settings/site_settings/site_data.js
@@ -113,7 +113,10 @@ * @private */ favicon_: function(url) { - return cr.icon.getFavicon(url); + // If the url doesn't have a scheme, inject HTTP as the scheme. Otherwise, + // the URL isn't valid and no icon will be returned. + var urlWithScheme = url.includes('://') ? url : 'http://' + url; + return cr.icon.getFavicon(urlWithScheme); }, /**
diff --git a/chrome/browser/resources/settings/site_settings/site_data_details_subpage.html b/chrome/browser/resources/settings/site_settings/site_data_details_subpage.html index 92cc647..958e28f 100644 --- a/chrome/browser/resources/settings/site_settings/site_data_details_subpage.html +++ b/chrome/browser/resources/settings/site_settings/site_data_details_subpage.html
@@ -6,6 +6,7 @@ <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> <link rel="import" href="../route.html"> <link rel="import" href="../settings_shared_css.html"> +<link rel="import" href="cookie_info.html"> <link rel="import" href="local_data_browser_proxy.html"> <dom-module id="site-data-details-subpage"> @@ -44,6 +45,5 @@ </iron-collapse> </template> </template> - <script src="cookie_info.js"></script> <script src="site_data_details_subpage.js"></script> </dom-module>
diff --git a/chrome/browser/resources/unpack_pak.py b/chrome/browser/resources/unpack_pak.py index cf77483d..0ffe10c03 100755 --- a/chrome/browser/resources/unpack_pak.py +++ b/chrome/browser/resources/unpack_pak.py
@@ -21,7 +21,11 @@ from grit.format import data_pack -def unpack(pak_path, out_path): +def ParseLine(line): + return re.match(' {"([^"]+)", ([^},]+)', line) + + +def Unpack(pak_path, out_path): pak_dir = os.path.dirname(pak_path) pak_id = os.path.splitext(os.path.basename(pak_path))[0] @@ -43,7 +47,7 @@ resources_map_path = os.path.join(pak_dir, 'grit', pak_id + '_map.cc') with open(resources_map_path) as resources_map: for line in resources_map: - res = re.match(' {"([^"]+)", ([^}]+)', line) + res = ParseLine(line) if res: resource_filenames[res.group(2)] = res.group(1) assert resource_filenames @@ -64,7 +68,7 @@ parser.add_argument('--out_folder') args = parser.parse_args() - unpack(args.pak_file, args.out_folder) + Unpack(args.pak_file, args.out_folder) timestamp_file_path = os.path.join(args.out_folder, _TIMESTAMP_FILENAME) with open(timestamp_file_path, 'a'):
diff --git a/chrome/browser/resources/unpack_pak_test.py b/chrome/browser/resources/unpack_pak_test.py new file mode 100755 index 0000000..ca5b87a --- /dev/null +++ b/chrome/browser/resources/unpack_pak_test.py
@@ -0,0 +1,20 @@ +#!/usr/bin/env python +# Copyright 2018 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 unpack_pak +import unittest + + +class UnpackPakTest(unittest.TestCase): + def testMapFileLine(self): + self.assertTrue(unpack_pak.ParseLine(' {"path.js", IDR_PATH}')) + + def testGzippedMapFileLine(self): + self.assertTrue(unpack_pak.ParseLine(' {"path.js", IDR_PATH, false}')) + self.assertTrue(unpack_pak.ParseLine(' {"path.js", IDR_PATH, true}')) + + +if __name__ == '__main__': + unittest.main()
diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc b/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc index c8ee018..926519a3 100644 --- a/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/chrome_password_protection_service_unittest.cc
@@ -232,9 +232,7 @@ if (throttle) test_handle->RegisterThrottleForTesting(std::move(throttle)); - return test_handle->CallWillStartRequestForTesting( - /*is_post=*/false, content::Referrer(), /*has_user_gesture=*/false, - ui::PAGE_TRANSITION_LINK, /*is_external_protocol=*/false); + return test_handle->CallWillStartRequestForTesting(); } int GetSizeofUnhandledSyncPasswordReuses() {
diff --git a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc index 0393fd9ac..93acb81 100644 --- a/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc +++ b/chrome/browser/safe_browsing/download_protection/check_client_download_request.cc
@@ -873,12 +873,15 @@ !referrer_chain_data->GetReferrerChain()->empty()) { request.mutable_referrer_chain()->Swap( referrer_chain_data->GetReferrerChain()); + request.mutable_referrer_chain_options()->set_recent_navigations_to_collect( + referrer_chain_data->recent_navigations_to_collect()); UMA_HISTOGRAM_COUNTS_100( "SafeBrowsing.ReferrerURLChainSize.DownloadAttribution", - request.referrer_chain().size()); - if (type_ == ClientDownloadRequest::SAMPLED_UNSUPPORTED_FILE) + referrer_chain_data->referrer_chain_length()); + if (type_ == ClientDownloadRequest::SAMPLED_UNSUPPORTED_FILE) { SafeBrowsingNavigationObserverManager::SanitizeReferrerChain( request.mutable_referrer_chain()); + } } #if defined(OS_MACOSX)
diff --git a/chrome/browser/safe_browsing/download_protection/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection/download_protection_service.cc index eaa2557..20bf07a 100644 --- a/chrome/browser/safe_browsing/download_protection/download_protection_service.cc +++ b/chrome/browser/safe_browsing/download_protection/download_protection_service.cc
@@ -355,7 +355,8 @@ } } -std::unique_ptr<ReferrerChain> DownloadProtectionService::IdentifyReferrerChain( +std::unique_ptr<ReferrerChainData> +DownloadProtectionService::IdentifyReferrerChain( const content::DownloadItem& item) { // If navigation_observer_manager_ is null, return immediately. This could // happen in tests. @@ -390,7 +391,24 @@ UMA_HISTOGRAM_ENUMERATION( "SafeBrowsing.ReferrerAttributionResult.DownloadAttribution", result, SafeBrowsingNavigationObserverManager::ATTRIBUTION_FAILURE_TYPE_MAX); - return referrer_chain; + + size_t referrer_chain_length = referrer_chain->size(); + + // Determines how many recent navigation events to append to referrer chain + // if any. + size_t recent_navigations_to_collect = + web_contents ? SafeBrowsingNavigationObserverManager:: + CountOfRecentNavigationsToAppend( + *Profile::FromBrowserContext( + web_contents->GetBrowserContext()), + result) + : 0u; + navigation_observer_manager_->AppendRecentNavigations( + recent_navigations_to_collect, referrer_chain.get()); + + return std::make_unique<ReferrerChainData>(std::move(referrer_chain), + referrer_chain_length, + recent_navigations_to_collect); } void DownloadProtectionService::AddReferrerChainToPPAPIClientDownloadRequest(
diff --git a/chrome/browser/safe_browsing/download_protection/download_protection_service.h b/chrome/browser/safe_browsing/download_protection/download_protection_service.h index 3c207e35..132a5da68f 100644 --- a/chrome/browser/safe_browsing/download_protection/download_protection_service.h +++ b/chrome/browser/safe_browsing/download_protection/download_protection_service.h
@@ -225,7 +225,7 @@ // Identify referrer chain info of a download. This function also records UMA // stats of download attribution result. - std::unique_ptr<ReferrerChain> IdentifyReferrerChain( + std::unique_ptr<ReferrerChainData> IdentifyReferrerChain( const content::DownloadItem& item); // Identify referrer chain of the PPAPI download based on the frame URL where
diff --git a/chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc index 7ee00ae..35707b12 100644 --- a/chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc
@@ -2489,10 +2489,11 @@ FILE_PATH_LITERAL("a.exe")); // final_path ON_CALL(item, GetWebContents()).WillByDefault(Return(web_contents)); - std::unique_ptr<ReferrerChain> referrer_chain = + std::unique_ptr<ReferrerChainData> referrer_chain_data = download_service_->IdentifyReferrerChain(item); + ReferrerChain* referrer_chain = referrer_chain_data->GetReferrerChain(); - ASSERT_EQ(1, referrer_chain->size()); + ASSERT_EQ(1u, referrer_chain_data->referrer_chain_length()); EXPECT_EQ(item.GetUrlChain().back(), referrer_chain->Get(0).url()); EXPECT_EQ(web_contents->GetLastCommittedURL().spec(), referrer_chain->Get(0).referrer_url());
diff --git a/chrome/browser/safe_browsing/download_protection/download_url_sb_client.cc b/chrome/browser/safe_browsing/download_protection/download_url_sb_client.cc index 9763c38..7b97d19 100644 --- a/chrome/browser/safe_browsing/download_protection/download_url_sb_client.cc +++ b/chrome/browser/safe_browsing/download_protection/download_url_sb_client.cc
@@ -130,8 +130,7 @@ return; item_->SetUserData(ReferrerChainData::kDownloadReferrerChainDataKey, - base::MakeUnique<ReferrerChainData>( - service_->IdentifyReferrerChain(*item_))); + service_->IdentifyReferrerChain(*item_)); } void DownloadUrlSBClient::UpdateDownloadCheckStats(SBStatsType stat_type) {
diff --git a/chrome/browser/safe_browsing/permission_reporter.cc b/chrome/browser/safe_browsing/permission_reporter.cc index e549dbb..f77e885 100644 --- a/chrome/browser/safe_browsing/permission_reporter.cc +++ b/chrome/browser/safe_browsing/permission_reporter.cc
@@ -205,6 +205,8 @@ bool PermissionReporter::BuildReport(const PermissionReportInfo& report_info, std::string* output) { PermissionReport report; + // The origin is stored as a GURL, so ensure it's actually an origin. + DCHECK_EQ(report_info.origin, report_info.origin.GetOrigin()); report.set_origin(report_info.origin.spec()); report.set_permission(PermissionTypeForReport(report_info.permission)); report.set_action(PermissionActionForReport(report_info.action));
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc index 6c39c86..41d551a 100644 --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc
@@ -4,6 +4,7 @@ #include "base/run_loop.h" #include "base/strings/stringprintf.h" +#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/download/download_prefs.h" @@ -19,6 +20,7 @@ #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/safe_browsing/features.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/download_item.h" #include "content/public/browser/download_manager.h" @@ -436,6 +438,25 @@ return observer_manager_->host_to_ip_map(); } + int CountOfRecentNavigationsToAppend( + bool extended_reporting_enabled, + bool is_incognito, + SafeBrowsingNavigationObserverManager::AttributionResult result) { + SetExtendedReportingPref(browser()->profile()->GetPrefs(), + extended_reporting_enabled); + return SafeBrowsingNavigationObserverManager:: + CountOfRecentNavigationsToAppend( + is_incognito ? *browser()->profile()->GetOffTheRecordProfile() + : *browser()->profile(), + result); + } + + void AppendRecentNavigations(int recent_navigation_count, + ReferrerChain* out_referrer_chain) { + observer_manager_->AppendRecentNavigations(recent_navigation_count, + out_referrer_chain); + } + protected: SafeBrowsingNavigationObserverManager* observer_manager_; SafeBrowsingNavigationObserver* observer_; @@ -2237,4 +2258,142 @@ referrer_chain.Get(1)); } +IN_PROC_BROWSER_TEST_F(SBNavigationObserverBrowserTest, + VerifyNumberOfRecentNavigationsToCollect) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeatureWithParameters( + kAppendRecentNavigationEvents, {{"recent_navigation_count", "3"}}); + + EXPECT_EQ(0, CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::SUCCESS)); + EXPECT_EQ(0, CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::SUCCESS)); + EXPECT_EQ(0, + CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::SUCCESS_LANDING_PAGE)); + EXPECT_EQ(0, + CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::SUCCESS_LANDING_PAGE)); + EXPECT_EQ( + 0, CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::SUCCESS_LANDING_REFERRER)); + EXPECT_EQ( + 0, CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::SUCCESS_LANDING_REFERRER)); + EXPECT_EQ(0, CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::INVALID_URL)); + EXPECT_EQ(0, CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::INVALID_URL)); + EXPECT_EQ( + 0, + CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::NAVIGATION_EVENT_NOT_FOUND)); + EXPECT_EQ( + 0, + CountOfRecentNavigationsToAppend( + /*sber=*/false, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::NAVIGATION_EVENT_NOT_FOUND)); + + EXPECT_EQ(3, CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::SUCCESS)); + EXPECT_EQ(0, CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::SUCCESS)); + EXPECT_EQ(3, + CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::SUCCESS_LANDING_PAGE)); + EXPECT_EQ(0, + CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::SUCCESS_LANDING_PAGE)); + EXPECT_EQ( + 0, CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::SUCCESS_LANDING_REFERRER)); + EXPECT_EQ( + 0, CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::SUCCESS_LANDING_REFERRER)); + EXPECT_EQ(3, CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::INVALID_URL)); + EXPECT_EQ(0, CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::INVALID_URL)); + EXPECT_EQ( + 3, + CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/false, + SafeBrowsingNavigationObserverManager::NAVIGATION_EVENT_NOT_FOUND)); + EXPECT_EQ( + 0, + CountOfRecentNavigationsToAppend( + /*sber=*/true, /*incognito=*/true, + SafeBrowsingNavigationObserverManager::NAVIGATION_EVENT_NOT_FOUND)); +} + +IN_PROC_BROWSER_TEST_F(SBNavigationObserverBrowserTest, + AppendRecentNavigations) { + base::test::ScopedFeatureList scoped_feature_list; + scoped_feature_list.InitAndEnableFeatureWithParameters( + kAppendRecentNavigationEvents, {{"recent_navigation_count", "3"}}); + ui_test_utils::NavigateToURL( + browser(), embedded_test_server()->GetURL(kSingleFrameTestURL)); + GURL initial_url = embedded_test_server()->GetURL(kSingleFrameTestURL); + ClickTestLink("complete_referrer_chain", 2, initial_url); + GURL redirect_url = embedded_test_server()->GetURL(kRedirectToLandingURL); + GURL landing_url = embedded_test_server()->GetURL(kLandingURL); + ClickTestLink("download_on_landing_page", 1, landing_url); + GURL download_url = embedded_test_server()->GetURL(kDownloadItemURL); + std::string test_server_ip(embedded_test_server()->host_port_pair().host()); + + ReferrerChain referrer_chain; + AppendRecentNavigations(/*recent_navigation_count=*/3, &referrer_chain); + EXPECT_EQ(3, referrer_chain.size()); + VerifyReferrerChainEntry( + download_url, // url + GURL(), // main_frame_url + ReferrerChainEntry::RECENT_NAVIGATION, // type + test_server_ip, // ip_address + landing_url, // referrer_url + GURL(), // referrer_main_frame_url + false, // is_retargeting + std::vector<GURL>(), // server redirects + ReferrerChainEntry::RENDERER_INITIATED_WITH_USER_GESTURE, + referrer_chain.Get(0)); + VerifyReferrerChainEntry( + landing_url, // url + GURL(), // main_frame_url + ReferrerChainEntry::RECENT_NAVIGATION, // type + test_server_ip, // ip_address + redirect_url, // referrer_url + GURL(), // referrer_main_frame_url + false, // is_retargeting + std::vector<GURL>(), // server redirects + ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE, + referrer_chain.Get(1)); + VerifyReferrerChainEntry( + redirect_url, // url + GURL(), // main_frame_url + ReferrerChainEntry::RECENT_NAVIGATION, // type + test_server_ip, // ip_address + initial_url, // referrer_url + GURL(), // referrer_main_frame_url + false, // is_retargeting + std::vector<GURL>(), // server redirects + ReferrerChainEntry::RENDERER_INITIATED_WITH_USER_GESTURE, + referrer_chain.Get(2)); +} + } // namespace safe_browsing
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc index d3dbc58ff..001a6557 100644 --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h" #include "base/memory/ptr_util.h" +#include "base/metrics/field_trial_params.h" #include "base/metrics/histogram_macros.h" #include "base/strings/stringprintf.h" #include "base/time/time.h" @@ -17,6 +18,7 @@ #include "chrome/common/pref_names.h" #include "components/prefs/pref_service.h" #include "components/safe_browsing/common/utils.h" +#include "components/safe_browsing/features.h" #include "content/public/browser/navigation_details.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" @@ -90,8 +92,12 @@ "referrer_chain_data_key"; ReferrerChainData::ReferrerChainData( - std::unique_ptr<ReferrerChain> referrer_chain) - : referrer_chain_(std::move(referrer_chain)) {} + std::unique_ptr<ReferrerChain> referrer_chain, + size_t referrer_chain_length, + size_t recent_navigations_to_collect) + : referrer_chain_(std::move(referrer_chain)), + referrer_chain_length_(referrer_chain_length), + recent_navigations_to_collect_(recent_navigations_to_collect) {} ReferrerChainData::~ReferrerChainData() {} @@ -476,6 +482,34 @@ navigation_event_list_.RecordNavigationEvent(std::move(nav_event)); } +// static +size_t SafeBrowsingNavigationObserverManager::CountOfRecentNavigationsToAppend( + const Profile& profile, + AttributionResult result) { + if (!IsExtendedReportingEnabled(*profile.GetPrefs()) || + profile.IsOffTheRecord() || result == SUCCESS_LANDING_REFERRER || + !base::FeatureList::IsEnabled(kAppendRecentNavigationEvents)) { + return 0u; + } + return static_cast<size_t>(base::GetFieldTrialParamByFeatureAsInt( + kAppendRecentNavigationEvents, "recent_navigation_count", 0)); +} + +void SafeBrowsingNavigationObserverManager::AppendRecentNavigations( + size_t recent_navigation_count, + ReferrerChain* out_referrer_chain) { + if (recent_navigation_count <= 0u) + return; + auto it = navigation_event_list_.navigation_events().rbegin(); + while (it != navigation_event_list_.navigation_events().rend() && + recent_navigation_count > 0u) { + AddToReferrerChain(out_referrer_chain, it->get(), GURL(), + ReferrerChainEntry::RECENT_NAVIGATION); + recent_navigation_count--; + it++; + } +} + void SafeBrowsingNavigationObserverManager::CleanUpNavigationEvents() { std::size_t removal_count = navigation_event_list_.CleanUpNavigationEvents();
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h index 22d502c..562c1d04 100644 --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_manager.h
@@ -27,9 +27,15 @@ // User data stored in DownloadItem for referrer chain information. class ReferrerChainData : public base::SupportsUserData::Data { public: - explicit ReferrerChainData(std::unique_ptr<ReferrerChain> referrer_chain); + ReferrerChainData(std::unique_ptr<ReferrerChain> referrer_chain, + size_t referrer_chain_length, + size_t recent_navigation_to_collect); ~ReferrerChainData() override; ReferrerChain* GetReferrerChain(); + size_t referrer_chain_length() { return referrer_chain_length_; } + size_t recent_navigations_to_collect() { + return recent_navigations_to_collect_; + } // Unique user data key used to get and set referrer chain data in // DownloadItem. @@ -37,6 +43,13 @@ private: std::unique_ptr<ReferrerChain> referrer_chain_; + // This is the actual referrer chain length before appending recent navigation + // events; + size_t referrer_chain_length_; + // |recent_navigations_to_collect_| is controlled by finch parameter. If the + // user is incognito mode or hasn't enabled extended reporting, this value is + // always 0. + size_t recent_navigations_to_collect_; }; // Struct that manages insertion, cleanup, and lookup of NavigationEvent @@ -88,6 +101,11 @@ return navigation_events_[index].get(); } + const base::circular_deque<std::unique_ptr<NavigationEvent>>& + navigation_events() { + return navigation_events_; + } + private: base::circular_deque<std::unique_ptr<NavigationEvent>> navigation_events_; const std::size_t size_limit_; @@ -188,7 +206,7 @@ int user_gesture_count_limit, ReferrerChain* out_referrer_chain); - // Record the creation of a new WebContents by |source_web_contents|. This is + // Records the creation of a new WebContents by |source_web_contents|. This is // used to detect cross-frame and cross-tab navigations. void RecordNewWebContents(content::WebContents* source_web_contents, int source_render_process_id, @@ -197,6 +215,16 @@ content::WebContents* target_web_contents, bool renderer_initiated); + // Based on user state, attribution result and finch parameter, calculates the + // number of recent navigations we want to append to the referrer chain. + static size_t CountOfRecentNavigationsToAppend(const Profile& profile, + AttributionResult result); + + // Appends |recent_navigation_count| number of recent navigation events to + // referrer chain in reverse chronological order. + void AppendRecentNavigations(size_t recent_navigation_count, + ReferrerChain* out_referrer_chain); + private: friend class base::RefCountedThreadSafe< SafeBrowsingNavigationObserverManager>;
diff --git a/chrome/browser/signin/chrome_signin_client_unittest.cc b/chrome/browser/signin/chrome_signin_client_unittest.cc index 1b6af657..0af583fb 100644 --- a/chrome/browser/signin/chrome_signin_client_unittest.cc +++ b/chrome/browser/signin/chrome_signin_client_unittest.cc
@@ -5,8 +5,10 @@ #include "chrome/browser/signin/chrome_signin_client.h" #include <memory> +#include <utility> #include "base/bind.h" +#include "base/logging.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "build/build_config.h" @@ -173,8 +175,15 @@ class MockSigninManager : public SigninManager { public: - explicit MockSigninManager(SigninClient* client) - : SigninManager(client, nullptr, &fake_service_, nullptr) {} + explicit MockSigninManager(SigninClient* client, + SigninErrorController* signin_error_controller) + : SigninManager(client, + nullptr, + &fake_service_, + nullptr, + signin_error_controller) { + DCHECK(signin_error_controller); + } MOCK_METHOD3(DoSignOut, void(signin_metrics::ProfileSignout, @@ -191,7 +200,8 @@ signin_util::SetForceSigninForTesting(true); CreateClient(browser()->profile()); - manager_.reset(new MockSigninManager(client_.get())); + manager_ = std::make_unique<MockSigninManager>(client_.get(), + fake_controller_.get()); } void TearDown() override { @@ -200,7 +210,8 @@ } void CreateClient(Profile* profile) { - SigninErrorController* controller = new SigninErrorController(); + SigninErrorController* controller = new SigninErrorController( + SigninErrorController::AccountMode::ANY_ACCOUNT); client_.reset(new MockChromeSigninClient(profile, controller)); fake_controller_.reset(controller); } @@ -232,7 +243,7 @@ signin_metrics::SignoutDelete delete_metric = signin_metrics::SignoutDelete::IGNORE_METRIC; - MockSigninManager other_manager(client_.get()); + MockSigninManager other_manager(client_.get(), fake_controller_.get()); other_manager.CopyCredentialsFrom(*manager_.get()); EXPECT_CALL(*client_, ShowUserManager(browser()->profile()->GetPath())) @@ -257,7 +268,8 @@ TEST_F(ChromeSigninClientSignoutTest, SignOutWithoutForceSignin) { signin_util::SetForceSigninForTesting(false); CreateClient(browser()->profile()); - manager_.reset(new MockSigninManager(client_.get())); + manager_ = std::make_unique<MockSigninManager>(client_.get(), + fake_controller_.get()); signin_metrics::ProfileSignout source_metric = signin_metrics::ProfileSignout::ABORT_SIGNIN; @@ -279,7 +291,8 @@ std::unique_ptr<TestingProfile> profile = builder.Build(); CreateClient(profile.get()); - manager_.reset(new MockSigninManager(client_.get())); + manager_ = std::make_unique<MockSigninManager>(client_.get(), + fake_controller_.get()); signin_metrics::ProfileSignout source_metric = signin_metrics::ProfileSignout::ABORT_SIGNIN;
diff --git a/chrome/browser/signin/dice_response_handler_unittest.cc b/chrome/browser/signin/dice_response_handler_unittest.cc index 0a0701f..101b144 100644 --- a/chrome/browser/signin/dice_response_handler_unittest.cc +++ b/chrome/browser/signin/dice_response_handler_unittest.cc
@@ -120,10 +120,13 @@ signin_client_(&pref_service_), token_service_(std::make_unique<FakeOAuth2TokenServiceDelegate>( request_context_getter_.get())), + signin_error_controller_( + SigninErrorController::AccountMode::PRIMARY_ACCOUNT), signin_manager_(&signin_client_, &token_service_, &account_tracker_service_, - nullptr), + nullptr, + &signin_error_controller_), cookie_service_(&token_service_, GaiaConstants::kChromeSource, &signin_client_), @@ -213,8 +216,8 @@ DiceTestSigninClient signin_client_; ProfileOAuth2TokenService token_service_; AccountTrackerService account_tracker_service_; - FakeSigninManager signin_manager_; SigninErrorController signin_error_controller_; + FakeSigninManager signin_manager_; FakeGaiaCookieManagerService cookie_service_; AboutSigninInternals about_signin_internals_; std::unique_ptr<AccountReconcilor> account_reconcilor_;
diff --git a/chrome/browser/signin/fake_signin_manager_builder.cc b/chrome/browser/signin/fake_signin_manager_builder.cc index 256a5855..6ee3b91 100644 --- a/chrome/browser/signin/fake_signin_manager_builder.cc +++ b/chrome/browser/signin/fake_signin_manager_builder.cc
@@ -12,6 +12,7 @@ #include "chrome/browser/signin/chrome_signin_client_factory.h" #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" +#include "chrome/browser/signin/signin_error_controller_factory.h" #include "chrome/browser/signin/signin_manager_factory.h" std::unique_ptr<KeyedService> BuildFakeSigninManagerBase( @@ -29,12 +30,14 @@ FakeSigninManagerForTesting::FakeSigninManagerForTesting(Profile* profile) : FakeSigninManagerBase( ChromeSigninClientFactory::GetForProfile(profile), - AccountTrackerServiceFactory::GetForProfile(profile)) {} + AccountTrackerServiceFactory::GetForProfile(profile), + SigninErrorControllerFactory::GetForProfile(profile)) {} #else FakeSigninManagerForTesting::FakeSigninManagerForTesting(Profile* profile) : FakeSigninManager( ChromeSigninClientFactory::GetForProfile(profile), ProfileOAuth2TokenServiceFactory::GetForProfile(profile), AccountTrackerServiceFactory::GetForProfile(profile), - GaiaCookieManagerServiceFactory::GetForProfile(profile)) {} + GaiaCookieManagerServiceFactory::GetForProfile(profile), + SigninErrorControllerFactory::GetForProfile(profile)) {} #endif
diff --git a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc index 90a5e79..93ecfc9 100644 --- a/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc +++ b/chrome/browser/signin/mutable_profile_oauth2_token_service_delegate_unittest.cc
@@ -48,6 +48,8 @@ public: MutableProfileOAuth2TokenServiceDelegateTest() : factory_(NULL), + signin_error_controller_( + SigninErrorController::AccountMode::ANY_ACCOUNT), access_token_success_count_(0), access_token_failure_count_(0), access_token_failure_(GoogleServiceAuthError::NONE),
diff --git a/chrome/browser/signin/signin_error_controller_factory.cc b/chrome/browser/signin/signin_error_controller_factory.cc index 81a95243..5d7f0eb4 100644 --- a/chrome/browser/signin/signin_error_controller_factory.cc +++ b/chrome/browser/signin/signin_error_controller_factory.cc
@@ -4,8 +4,10 @@ #include "chrome/browser/signin/signin_error_controller_factory.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" +#include "components/signin/core/browser/profile_management_switches.h" SigninErrorControllerFactory::SigninErrorControllerFactory() : BrowserContextKeyedServiceFactory( @@ -28,5 +30,13 @@ KeyedService* SigninErrorControllerFactory::BuildServiceInstanceFor( content::BrowserContext* context) const { - return new SigninErrorController(); + SigninErrorController::AccountMode account_mode = +#if defined(OS_CHROMEOS) + SigninErrorController::AccountMode::ANY_ACCOUNT; +#else + signin::IsAccountConsistencyMirrorEnabled() + ? SigninErrorController::AccountMode::ANY_ACCOUNT + : SigninErrorController::AccountMode::PRIMARY_ACCOUNT; +#endif + return new SigninErrorController(account_mode); }
diff --git a/chrome/browser/signin/signin_manager_factory.cc b/chrome/browser/signin/signin_manager_factory.cc index 10f458d7..8d077812d 100644 --- a/chrome/browser/signin/signin_manager_factory.cc +++ b/chrome/browser/signin/signin_manager_factory.cc
@@ -13,6 +13,7 @@ #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" #include "chrome/browser/signin/local_auth.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" +#include "chrome/browser/signin/signin_error_controller_factory.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/prefs/pref_registry_simple.h" #include "components/signin/core/browser/signin_manager.h" @@ -25,6 +26,7 @@ DependsOn(GaiaCookieManagerServiceFactory::GetInstance()); DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); DependsOn(AccountTrackerServiceFactory::GetInstance()); + DependsOn(SigninErrorControllerFactory::GetInstance()); } SigninManagerFactory::~SigninManagerFactory() { @@ -112,14 +114,14 @@ ChromeSigninClientFactory::GetInstance()->GetForProfile(profile); #if defined(OS_CHROMEOS) service = new SigninManagerBase( - client, - AccountTrackerServiceFactory::GetForProfile(profile)); + client, AccountTrackerServiceFactory::GetForProfile(profile), + SigninErrorControllerFactory::GetForProfile(profile)); #else service = new SigninManager( - client, - ProfileOAuth2TokenServiceFactory::GetForProfile(profile), + client, ProfileOAuth2TokenServiceFactory::GetForProfile(profile), AccountTrackerServiceFactory::GetForProfile(profile), - GaiaCookieManagerServiceFactory::GetForProfile(profile)); + GaiaCookieManagerServiceFactory::GetForProfile(profile), + SigninErrorControllerFactory::GetForProfile(profile)); AccountFetcherServiceFactory::GetForProfile(profile); #endif service->Initialize(g_browser_process->local_state());
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc index 5a640b8..c488d18 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
@@ -67,8 +67,6 @@ // Use SetTestingFactoryAndUse to force creation and initialization. SpellcheckServiceFactory::GetInstance()->SetTestingFactoryAndUse( &profile_, &BuildSpellcheckService); - - StatisticsRecorder::Initialize(); } // A wrapper around SpellcheckCustomDictionary::LoadDictionaryFile private @@ -1143,10 +1141,6 @@ // Record a baseline. SpellCheckHostMetrics::RecordCustomWordCountStats(123); - // Determine if test failures are due the statistics recorder not being - // available or because the histogram just isn't there: crbug.com/230534. - EXPECT_TRUE(StatisticsRecorder::IsActive()); - HistogramBase* histogram = StatisticsRecorder::FindHistogram("SpellCheck.CustomWords"); ASSERT_TRUE(histogram != NULL);
diff --git a/chrome/browser/ssl/typed_navigation_timing_throttle_unittest.cc b/chrome/browser/ssl/typed_navigation_timing_throttle_unittest.cc index 3efa30b..11cc7ce 100644 --- a/chrome/browser/ssl/typed_navigation_timing_throttle_unittest.cc +++ b/chrome/browser/ssl/typed_navigation_timing_throttle_unittest.cc
@@ -29,8 +29,12 @@ TEST_F(TypedNavigationTimingThrottleTest, NotCreatedForHTTPS) { GURL https_url("https://example.test"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(https_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + https_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); std::unique_ptr<content::NavigationThrottle> throttle = TypedNavigationTimingThrottle::MaybeCreateThrottleFor(handle.get()); EXPECT_FALSE(throttle); @@ -42,16 +46,15 @@ GURL http_url("http://example.test"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(http_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + http_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_TYPED, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); GURL https_url("https://example.test"); EXPECT_EQ(content::NavigationThrottle::PROCEED, @@ -71,16 +74,15 @@ GURL http_url("http://example.test"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(http_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + http_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_TYPED, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); test.ExpectTotalCount("Omnibox.URLNavigationTimeToRedirectToHTTPS", 0); } @@ -92,16 +94,15 @@ GURL http_url("http://example.test"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(http_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + http_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_TYPED, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); GURL other_url("http://nonexample.test"); EXPECT_EQ(content::NavigationThrottle::PROCEED, @@ -122,16 +123,15 @@ GURL http_url("http://example.test"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(http_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + http_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_TYPED, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); GURL other_url("https://nonexample.test"); EXPECT_EQ(content::NavigationThrottle::PROCEED, @@ -156,12 +156,7 @@ main_rfh()); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_LINK, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); GURL https_url("https://example.test"); EXPECT_EQ(content::NavigationThrottle::PROCEED, @@ -182,16 +177,15 @@ GURL http_url("http://example.test"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(http_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + http_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_TYPED, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); // Redirecting to the "upgraded" URL twice in a row should result in only one // activation of the histogram trigger. @@ -239,16 +233,15 @@ GURL http_url("http://example.test"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(http_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + http_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_TYPED, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); GURL https_url("https://www.example.test"); EXPECT_EQ(content::NavigationThrottle::PROCEED, @@ -268,16 +261,15 @@ GURL http_url("http://www.example.test"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(http_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + http_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_TYPED, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); GURL https_url("https://example.test"); EXPECT_EQ(content::NavigationThrottle::PROCEED, @@ -297,16 +289,15 @@ GURL http_url("http://example.test:8080"); std::unique_ptr<content::NavigationHandle> handle = - content::NavigationHandle::CreateNavigationHandleForTesting(http_url, - main_rfh()); + content::NavigationHandle::CreateNavigationHandleForTesting( + http_url, main_rfh(), false, /* committed */ + net::OK, /* error */ + false, /* is_same_document */ + false, /* is_post */ + ui::PAGE_TRANSITION_TYPED); EXPECT_EQ(content::NavigationThrottle::PROCEED, - handle - ->CallWillStartRequestForTesting( - false, /* is_post */ - content::Referrer(), true, /* has_user_gesture */ - ui::PAGE_TRANSITION_TYPED, false /* is_external_protocol */) - .action()); + handle->CallWillStartRequestForTesting().action()); GURL https_url("https://example.test:4443"); EXPECT_EQ(content::NavigationThrottle::PROCEED,
diff --git a/chrome/browser/sync/sync_ui_util_unittest.cc b/chrome/browser/sync/sync_ui_util_unittest.cc index 0845597..a75f7655 100644 --- a/chrome/browser/sync/sync_ui_util_unittest.cc +++ b/chrome/browser/sync/sync_ui_util_unittest.cc
@@ -78,7 +78,8 @@ explicit FakeSigninManagerForSyncUIUtilTest(Profile* profile) : FakeSigninManagerBase( ChromeSigninClientFactory::GetForProfile(profile), - AccountTrackerServiceFactory::GetForProfile(profile)), + AccountTrackerServiceFactory::GetForProfile(profile), + SigninErrorControllerFactory::GetForProfile(profile)), auth_in_progress_(false) { Initialize(nullptr); }
diff --git a/chrome/browser/task_manager/providers/browser_process_task.cc b/chrome/browser/task_manager/providers/browser_process_task.cc index fd476a1..bb3cc21 100644 --- a/chrome/browser/task_manager/providers/browser_process_task.cc +++ b/chrome/browser/task_manager/providers/browser_process_task.cc
@@ -9,34 +9,17 @@ #include "chrome/grit/theme_resources.h" #include "third_party/sqlite/sqlite3.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/resource/resource_bundle.h" namespace task_manager { -namespace { - -gfx::ImageSkia* g_default_icon = nullptr; - -gfx::ImageSkia* GetDefaultIcon() { - if (!g_default_icon && ui::ResourceBundle::HasSharedInstance()) { - g_default_icon = ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( - IDR_PRODUCT_LOGO_16); - if (g_default_icon) - g_default_icon->MakeThreadSafe(); - } - - return g_default_icon; -} - -} // namespace +gfx::ImageSkia* BrowserProcessTask::s_icon_ = nullptr; BrowserProcessTask::BrowserProcessTask() : Task(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_WEB_BROWSER_CELL_TEXT), "Browser Process", - GetDefaultIcon(), + FetchIcon(IDR_PRODUCT_LOGO_16, &s_icon_), base::GetCurrentProcessHandle()), - used_sqlite_memory_(-1) { -} + used_sqlite_memory_(-1) {} BrowserProcessTask::~BrowserProcessTask() { }
diff --git a/chrome/browser/task_manager/providers/browser_process_task.h b/chrome/browser/task_manager/providers/browser_process_task.h index 53ef16c7..af650999 100644 --- a/chrome/browser/task_manager/providers/browser_process_task.h +++ b/chrome/browser/task_manager/providers/browser_process_task.h
@@ -28,6 +28,8 @@ int64_t GetSqliteMemoryUsed() const override; private: + static gfx::ImageSkia* s_icon_; + int64_t used_sqlite_memory_; DISALLOW_COPY_AND_ASSIGN(BrowserProcessTask);
diff --git a/chrome/browser/task_manager/providers/child_process_task.cc b/chrome/browser/task_manager/providers/child_process_task.cc index 9fb5c49a..ec8eee4 100644 --- a/chrome/browser/task_manager/providers/child_process_task.cc +++ b/chrome/browser/task_manager/providers/child_process_task.cc
@@ -27,23 +27,11 @@ #include "extensions/common/extension_set.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/resource/resource_bundle.h" namespace task_manager { namespace { -gfx::ImageSkia* g_default_icon = nullptr; - -gfx::ImageSkia* GetDefaultIcon() { - if (!g_default_icon && ui::ResourceBundle::HasSharedInstance()) { - g_default_icon = ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( - IDR_PLUGINS_FAVICON); - } - - return g_default_icon; -} - base::string16 GetLocalizedTitle(const base::string16& title, int process_type) { base::string16 result_title = title; @@ -163,18 +151,19 @@ } // namespace +gfx::ImageSkia* ChildProcessTask::s_icon_ = nullptr; + ChildProcessTask::ChildProcessTask(const content::ChildProcessData& data) : Task(GetLocalizedTitle(data.name, data.process_type), base::UTF16ToUTF8(data.name), - GetDefaultIcon(), + FetchIcon(IDR_PLUGINS_FAVICON, &s_icon_), data.handle), process_resources_sampler_(CreateProcessResourcesSampler(data.id)), v8_memory_allocated_(-1), v8_memory_used_(-1), unique_child_process_id_(data.id), process_type_(data.process_type), - uses_v8_memory_(UsesV8Memory(process_type_)) { -} + uses_v8_memory_(UsesV8Memory(process_type_)) {} ChildProcessTask::~ChildProcessTask() { }
diff --git a/chrome/browser/task_manager/providers/child_process_task.h b/chrome/browser/task_manager/providers/child_process_task.h index 877b243..1e217c27 100644 --- a/chrome/browser/task_manager/providers/child_process_task.h +++ b/chrome/browser/task_manager/providers/child_process_task.h
@@ -40,6 +40,8 @@ int64_t GetV8MemoryUsed() const override; private: + static gfx::ImageSkia* s_icon_; + // The Mojo service wrapper that will provide us with the V8 memory usage of // the browser child process represented by this object. std::unique_ptr<ProcessResourceUsage> process_resources_sampler_;
diff --git a/chrome/browser/task_manager/providers/task.cc b/chrome/browser/task_manager/providers/task.cc index 565aeaa..d8905b8 100644 --- a/chrome/browser/task_manager/providers/task.cc +++ b/chrome/browser/task_manager/providers/task.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/task_manager/providers/task_provider_observer.h" #include "chrome/browser/task_manager/task_manager_observer.h" #include "content/public/common/result_codes.h" +#include "ui/base/resource/resource_bundle.h" namespace task_manager { @@ -190,4 +191,15 @@ return -1; } +// static +gfx::ImageSkia* Task::FetchIcon(int id, gfx::ImageSkia** result_image) { + if (!*result_image && ui::ResourceBundle::HasSharedInstance()) { + *result_image = + ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(id); + if (*result_image) + (*result_image)->MakeThreadSafe(); + } + return *result_image; +} + } // namespace task_manager
diff --git a/chrome/browser/task_manager/providers/task.h b/chrome/browser/task_manager/providers/task.h index f6a24f02..6e493bafc 100644 --- a/chrome/browser/task_manager/providers/task.h +++ b/chrome/browser/task_manager/providers/task.h
@@ -175,6 +175,10 @@ const base::ProcessId& process_id() const { return process_id_; } protected: + // If |*result_image| is not already set, fetch the image with id + // |id| from the resource database and put in |*result_image|. + // Returns |*result_image|. + static gfx::ImageSkia* FetchIcon(int id, gfx::ImageSkia** result_image); void set_title(const base::string16& new_title) { title_ = new_title; } void set_rappor_sample_name(const std::string& sample) { rappor_sample_name_ = sample;
diff --git a/chrome/browser/task_manager/providers/web_contents/background_contents_task.cc b/chrome/browser/task_manager/providers/web_contents/background_contents_task.cc index 194338a..a05b946 100644 --- a/chrome/browser/task_manager/providers/web_contents/background_contents_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/background_contents_task.cc
@@ -18,25 +18,12 @@ #include "extensions/browser/view_type_utils.h" #include "extensions/common/extension_set.h" #include "ui/base/l10n/l10n_util.h" -#include "ui/base/resource/resource_bundle.h" #include "ui/gfx/image/image_skia.h" namespace task_manager { namespace { -// The default icon for the background webcontents task. -gfx::ImageSkia* g_default_icon = nullptr; - -gfx::ImageSkia* GetDefaultIcon() { - if (!g_default_icon && ui::ResourceBundle::HasSharedInstance()) { - g_default_icon = ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( - IDR_PLUGINS_FAVICON); - } - - return g_default_icon; -} - base::string16 AdjustAndLocalizeTitle(const base::string16& title, const std::string& url_spec) { base::string16 localized_title(title); @@ -55,12 +42,14 @@ } // namespace +gfx::ImageSkia* BackgroundContentsTask::s_icon_ = nullptr; + BackgroundContentsTask::BackgroundContentsTask( const base::string16& title, BackgroundContents* background_contents) : RendererTask( AdjustAndLocalizeTitle(title, background_contents->GetURL().spec()), - GetDefaultIcon(), + FetchIcon(IDR_PLUGINS_FAVICON, &s_icon_), background_contents->web_contents()) {} BackgroundContentsTask::~BackgroundContentsTask() {
diff --git a/chrome/browser/task_manager/providers/web_contents/background_contents_task.h b/chrome/browser/task_manager/providers/web_contents/background_contents_task.h index 74fdbba8..617275b 100644 --- a/chrome/browser/task_manager/providers/web_contents/background_contents_task.h +++ b/chrome/browser/task_manager/providers/web_contents/background_contents_task.h
@@ -23,6 +23,8 @@ void UpdateFavicon() override; private: + static gfx::ImageSkia* s_icon_; + DISALLOW_COPY_AND_ASSIGN(BackgroundContentsTask); };
diff --git a/chrome/browser/task_manager/providers/web_contents/extension_task.cc b/chrome/browser/task_manager/providers/web_contents/extension_task.cc index 1d0268d..698a52b9 100644 --- a/chrome/browser/task_manager/providers/web_contents/extension_task.cc +++ b/chrome/browser/task_manager/providers/web_contents/extension_task.cc
@@ -18,33 +18,16 @@ #include "extensions/common/extension.h" #include "extensions/common/manifest_handlers/icons_handler.h" #include "extensions/common/view_type.h" -#include "ui/base/resource/resource_bundle.h" namespace task_manager { -namespace { - -gfx::ImageSkia* g_default_icon = nullptr; - -gfx::ImageSkia* GetDefaultIcon() { - if (!ui::ResourceBundle::HasSharedInstance()) - return nullptr; - - if (!g_default_icon) { - g_default_icon = ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( - IDR_EXTENSIONS_FAVICON); - } - - return g_default_icon; -} - -} // namespace +gfx::ImageSkia* ExtensionTask::s_icon_ = nullptr; ExtensionTask::ExtensionTask(content::WebContents* web_contents, const extensions::Extension* extension, extensions::ViewType view_type) : RendererTask(GetExtensionTitle(web_contents, extension, view_type), - GetDefaultIcon(), + FetchIcon(IDR_EXTENSIONS_FAVICON, &s_icon_), web_contents), view_type_(view_type) { LoadExtensionIcon(extension);
diff --git a/chrome/browser/task_manager/providers/web_contents/extension_task.h b/chrome/browser/task_manager/providers/web_contents/extension_task.h index 57fd1c8f..553da8d 100644 --- a/chrome/browser/task_manager/providers/web_contents/extension_task.h +++ b/chrome/browser/task_manager/providers/web_contents/extension_task.h
@@ -52,6 +52,8 @@ // for the first time if any. void LoadExtensionIcon(const extensions::Extension* extension); + static gfx::ImageSkia* s_icon_; + // The favicon of the extension represented by this task. std::unique_ptr<extensions::IconImage> extension_icon_;
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 2441ded..118ede6d 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -818,6 +818,8 @@ "omnibox/chrome_omnibox_navigation_observer.h", "omnibox/clipboard_utils.cc", "omnibox/clipboard_utils.h", + "omnibox/favicon_cache.cc", + "omnibox/favicon_cache.h", "overlay/overlay_surface_embedder.cc", "overlay/overlay_surface_embedder.h", "overlay/overlay_window.h", @@ -1536,6 +1538,7 @@ "//ash/resources/vector_icons", "//ash/strings", "//chrome/browser/chromeos", + "//chromeos:cryptohome_proto", "//chromeos/components/tether", "//components/arc", "//components/drive:drive_chromeos",
diff --git a/chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc b/chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc index 20fe983..2c97bc5 100644 --- a/chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc +++ b/chrome/browser/ui/android/content_settings/popup_blocked_infobar_delegate.cc
@@ -59,7 +59,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier PopupBlockedInfoBarDelegate::GetIdentifier() const { - return POPUP_BLOCKED_INFOBAR_DELEGATE; + return POPUP_BLOCKED_INFOBAR_DELEGATE_MOBILE; } int PopupBlockedInfoBarDelegate::GetIconId() const {
diff --git a/chrome/browser/ui/android/external_protocol_dialog_android.cc b/chrome/browser/ui/android/external_protocol_dialog_android.cc index 56851e1..c84db6c 100644 --- a/chrome/browser/ui/android/external_protocol_dialog_android.cc +++ b/chrome/browser/ui/android/external_protocol_dialog_android.cc
@@ -32,14 +32,14 @@ return; navigation_interception::NavigationParams navigation_params( - url, - content::Referrer(), - has_user_gesture, // has_user_gesture - false, // is_post, doesn't matter here. + url, content::Referrer(), + has_user_gesture, // has_user_gesture + false, // is_post, doesn't matter here. page_transition, - false, // is_redirect, doesn't matter here. - true, // is_external_protocol - false, // is_main_frame - GURL()); // base_url_for_data_url, not applicable. + false, // is_redirect, doesn't matter here. + true, // is_external_protocol + false, // is_main_frame + GURL(), // base_url_for_data_url, not applicable. + base::nullopt); // suggested_filename delegate->ShouldIgnoreNavigation(navigation_params); }
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc index e3ae325..b646109 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -31,7 +31,7 @@ #include "chrome/browser/chromeos/ash_config.h" #include "chrome/browser/chromeos/background/ash_wallpaper_delegate.h" #include "chrome/browser/chromeos/display/display_configuration_observer.h" -#include "chrome/browser/chromeos/display/display_preferences.h" +#include "chrome/browser/chromeos/display/display_prefs.h" #include "chrome/browser/chromeos/policy/display_rotation_default_handler.h" #include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/profiles/profile.h" @@ -304,7 +304,9 @@ bool first_run_after_boot = base::CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kFirstExecAfterBoot); - chromeos::LoadDisplayPreferences(first_run_after_boot); + display_prefs_ = std::make_unique<chromeos::DisplayPrefs>( + g_browser_process->local_state()); + display_prefs_->LoadDisplayPreferences(first_run_after_boot); // Object owns itself, and deletes itself when Observer::OnShutdown is called: new policy::DisplayRotationDefaultHandler(); // Set the observer now so that we can save the initial state
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.h b/chrome/browser/ui/ash/chrome_shell_delegate.h index 76572659..ace03ba 100644 --- a/chrome/browser/ui/ash/chrome_shell_delegate.h +++ b/chrome/browser/ui/ash/chrome_shell_delegate.h
@@ -16,6 +16,7 @@ namespace chromeos { class DisplayConfigurationObserver; +class DisplayPrefs; } namespace keyboard { @@ -54,6 +55,7 @@ content::NotificationRegistrar registrar_; + std::unique_ptr<chromeos::DisplayPrefs> display_prefs_; std::unique_ptr<chromeos::DisplayConfigurationObserver> display_configuration_observer_;
diff --git a/chrome/browser/ui/ash/login_screen_client.cc b/chrome/browser/ui/ash/login_screen_client.cc index f075ac0..df27b1f 100644 --- a/chrome/browser/ui/ash/login_screen_client.cc +++ b/chrome/browser/ui/ash/login_screen_client.cc
@@ -114,6 +114,11 @@ chromeos::UserAddingScreen::Get()->Cancel(); } +void LoginScreenClient::LoginAsGuest() { + if (delegate_) + delegate_->HandleLoginAsGuest(); +} + void LoginScreenClient::OnMaxIncorrectPasswordAttempted( const AccountId& account_id) { RecordReauthReason(account_id,
diff --git a/chrome/browser/ui/ash/login_screen_client.h b/chrome/browser/ui/ash/login_screen_client.h index 338bc2b..565bcd3 100644 --- a/chrome/browser/ui/ash/login_screen_client.h +++ b/chrome/browser/ui/ash/login_screen_client.h
@@ -38,6 +38,7 @@ // focus has been handed over to a lock screen app. For example, this might // fail if a hander for lock screen apps focus has not been set. virtual bool HandleFocusLockScreenApps(bool reverse) = 0; + virtual void HandleLoginAsGuest() = 0; private: DISALLOW_COPY_AND_ASSIGN(Delegate); @@ -59,6 +60,7 @@ void LoadWallpaper(const AccountId& account_id) override; void SignOutUser() override; void CancelAddUser() override; + void LoginAsGuest() override; void OnMaxIncorrectPasswordAttempted(const AccountId& account_id) override; void FocusLockScreenApps(bool reverse) override;
diff --git a/chrome/browser/ui/ash/test_wallpaper_controller.cc b/chrome/browser/ui/ash/test_wallpaper_controller.cc index 018123a..406c591 100644 --- a/chrome/browser/ui/ash/test_wallpaper_controller.cc +++ b/chrome/browser/ui/ash/test_wallpaper_controller.cc
@@ -66,6 +66,12 @@ NOTIMPLEMENTED(); } +void TestWallpaperController::UpdateCustomWallpaperLayout( + ash::mojom::WallpaperUserInfoPtr user_info, + wallpaper::WallpaperLayout layout) { + NOTIMPLEMENTED(); +} + void TestWallpaperController::ShowUserWallpaper( ash::mojom::WallpaperUserInfoPtr user_info) { NOTIMPLEMENTED();
diff --git a/chrome/browser/ui/ash/test_wallpaper_controller.h b/chrome/browser/ui/ash/test_wallpaper_controller.h index 5297f698..5519eb76f 100644 --- a/chrome/browser/ui/ash/test_wallpaper_controller.h +++ b/chrome/browser/ui/ash/test_wallpaper_controller.h
@@ -57,6 +57,8 @@ const base::FilePath& file_path, const base::FilePath& resized_directory) override; void SetDeviceWallpaperPolicyEnforced(bool enforced) override; + void UpdateCustomWallpaperLayout(ash::mojom::WallpaperUserInfoPtr user_info, + wallpaper::WallpaperLayout layout) override; void ShowUserWallpaper(ash::mojom::WallpaperUserInfoPtr user_info) override; void ShowSigninWallpaper() override; void RemoveUserWallpaper(ash::mojom::WallpaperUserInfoPtr user_info,
diff --git a/chrome/browser/ui/ash/wallpaper_controller_client.cc b/chrome/browser/ui/ash/wallpaper_controller_client.cc index 34bf1ce..4949513 100644 --- a/chrome/browser/ui/ash/wallpaper_controller_client.cc +++ b/chrome/browser/ui/ash/wallpaper_controller_client.cc
@@ -191,6 +191,17 @@ resized_directory); } +void WallpaperControllerClient::UpdateCustomWallpaperLayout( + const AccountId& account_id, + wallpaper::WallpaperLayout layout) { + ash::mojom::WallpaperUserInfoPtr user_info = + AccountIdToWallpaperUserInfo(account_id); + if (!user_info) + return; + wallpaper_controller_->UpdateCustomWallpaperLayout(std::move(user_info), + layout); +} + void WallpaperControllerClient::ShowUserWallpaper(const AccountId& account_id) { ash::mojom::WallpaperUserInfoPtr user_info = AccountIdToWallpaperUserInfo(account_id);
diff --git a/chrome/browser/ui/ash/wallpaper_controller_client.h b/chrome/browser/ui/ash/wallpaper_controller_client.h index 9c72ec48..921c1c7 100644 --- a/chrome/browser/ui/ash/wallpaper_controller_client.h +++ b/chrome/browser/ui/ash/wallpaper_controller_client.h
@@ -56,6 +56,8 @@ void SetCustomizedDefaultWallpaper(const GURL& wallpaper_url, const base::FilePath& file_path, const base::FilePath& resized_directory); + void UpdateCustomWallpaperLayout(const AccountId& account_id, + wallpaper::WallpaperLayout layout); void ShowUserWallpaper(const AccountId& account_id); void ShowSigninWallpaper(); void RemoveUserWallpaper(const AccountId& account_id);
diff --git a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc index a122c35..97edd29 100644 --- a/chrome/browser/ui/autofill/autofill_popup_layout_model.cc +++ b/chrome/browser/ui/autofill/autofill_popup_layout_model.cc
@@ -60,6 +60,7 @@ {autofill::kMirCard, IDR_AUTOFILL_CC_MIR}, {autofill::kUnionPay, IDR_AUTOFILL_CC_UNIONPAY}, {autofill::kVisaCard, IDR_AUTOFILL_CC_VISA}, + {"googlePay", IDR_AUTOFILL_GOOGLE_PAY}, #if defined(OS_ANDROID) {"httpWarning", IDR_AUTOFILL_HTTP_WARNING}, {"httpsInvalid", IDR_AUTOFILL_HTTPS_INVALID_WARNING},
diff --git a/chrome/browser/ui/blocked_content/popup_opener_tab_helper_unittest.cc b/chrome/browser/ui/blocked_content/popup_opener_tab_helper_unittest.cc index c212ab3..a4ed5f0 100644 --- a/chrome/browser/ui/blocked_content/popup_opener_tab_helper_unittest.cc +++ b/chrome/browser/ui/blocked_content/popup_opener_tab_helper_unittest.cc
@@ -25,6 +25,7 @@ #include "chrome/browser/ui/blocked_content/tab_under_navigation_throttle.h" #include "chrome/test/base/chrome_render_view_host_test_harness.h" #include "chrome/test/base/testing_browser_process.h" +#include "chrome/test/base/testing_profile.h" #include "components/rappor/public/rappor_parameters.h" #include "components/rappor/test_rappor_service.h" #include "components/ukm/content/source_url_recorder.h" @@ -49,7 +50,8 @@ constexpr char kTabUnderVisibleTime[] = "Tab.TabUnder.VisibleTime"; constexpr char kTabUnderVisibleTimeBefore[] = "Tab.TabUnder.VisibleTimeBefore"; constexpr char kPopupToTabUnder[] = "Tab.TabUnder.PopupToTabUnderTime"; -constexpr char kTabUnderAction[] = "Tab.TabUnderAction"; +constexpr char kTabUnderActionOTR[] = "Tab.TabUnderAction.OTR"; +constexpr char kTabUnderActionNonOTR[] = "Tab.TabUnderAction.NonOTR"; class PopupOpenerTabHelperTest : public ChromeRenderViewHostTestHarness { public: @@ -378,6 +380,43 @@ DISALLOW_COPY_AND_ASSIGN(BlockTabUnderTest); }; +// Parameterized by a boolean which determines if an incognito profile should be +// used. +class BlockTabUnderIncognitoTest : public BlockTabUnderTest, + public testing::WithParamInterface<bool> { + public: + BlockTabUnderIncognitoTest() {} + ~BlockTabUnderIncognitoTest() override {} + + content::BrowserContext* CreateBrowserContext() override { + original_profile_ = ChromeRenderViewHostTestHarness::CreateBrowserContext(); + incognito_profile_ = + static_cast<Profile*>(original_profile_)->GetOffTheRecordProfile(); + return original_profile_; + } + + content::BrowserContext* GetBrowserContext() override { + return GetParam() ? incognito_profile_ : original_profile_; + } + + const char* GetActionHistogram() const { + return GetParam() ? kTabUnderActionOTR : kTabUnderActionNonOTR; + } + + private: + // Owned by the original profile. + content::BrowserContext* incognito_profile_ = nullptr; + + // Owned by the RenderViewHostTestHarness. + content::BrowserContext* original_profile_ = nullptr; + + DISALLOW_COPY_AND_ASSIGN(BlockTabUnderIncognitoTest); +}; + +INSTANTIATE_TEST_CASE_P(, + BlockTabUnderIncognitoTest, + testing::Values(true, false)); + TEST_F(BlockTabUnderTest, SimpleTabUnder_IsBlocked) { EXPECT_TRUE(NavigateAndCommitWithoutGesture(GURL("https://first.test/"))); SimulatePopup(); @@ -523,11 +562,11 @@ ExpectUIShown(true); } -TEST_F(BlockTabUnderTest, +TEST_P(BlockTabUnderIncognitoTest, MultipleRedirectAttempts_AreBlockedAndLogsActionMetrics) { EXPECT_TRUE(NavigateAndCommitWithoutGesture(GURL("https://first.test/"))); histogram_tester()->ExpectUniqueSample( - kTabUnderAction, + GetActionHistogram(), static_cast<int>(TabUnderNavigationThrottle::Action::kStarted), 1); SimulatePopup(); @@ -537,21 +576,21 @@ EXPECT_FALSE(NavigateAndCommitWithoutGesture(blocked_url)); histogram_tester()->ExpectBucketCount( - kTabUnderAction, + GetActionHistogram(), static_cast<int>(TabUnderNavigationThrottle::Action::kStarted), 4); histogram_tester()->ExpectBucketCount( - kTabUnderAction, + GetActionHistogram(), static_cast<int>(TabUnderNavigationThrottle::Action::kBlocked), 3); histogram_tester()->ExpectBucketCount( - kTabUnderAction, + GetActionHistogram(), static_cast<int>(TabUnderNavigationThrottle::Action::kDidTabUnder), 3); - histogram_tester()->ExpectTotalCount(kTabUnderAction, 10); + histogram_tester()->ExpectTotalCount(GetActionHistogram(), 10); } -TEST_F(BlockTabUnderTest, ClickThroughAction) { +TEST_P(BlockTabUnderIncognitoTest, ClickThroughAction) { EXPECT_TRUE(NavigateAndCommitWithoutGesture(GURL("https://first.test/"))); histogram_tester()->ExpectUniqueSample( - kTabUnderAction, + GetActionHistogram(), static_cast<int>(TabUnderNavigationThrottle::Action::kStarted), 1); SimulatePopup(); @@ -572,12 +611,12 @@ static_cast<int>(ListItemPosition::kLastItem), 1); #endif histogram_tester()->ExpectBucketCount( - kTabUnderAction, + GetActionHistogram(), static_cast<int>(TabUnderNavigationThrottle::Action::kClickedThrough), 1); } // kDidTabUnder is not reported multiple times for redirects. -TEST_F(BlockTabUnderTest, DisableFeature_LogsDidTabUnder) { +TEST_P(BlockTabUnderIncognitoTest, DisableFeature_LogsDidTabUnder) { DisableFeature(); EXPECT_TRUE(NavigateAndCommitWithoutGesture(GURL("https://first.test/"))); SimulatePopup(); @@ -591,12 +630,12 @@ simulator->Redirect(a_url); simulator->Commit(); histogram_tester()->ExpectBucketCount( - kTabUnderAction, + GetActionHistogram(), static_cast<int>(TabUnderNavigationThrottle::Action::kStarted), 2); histogram_tester()->ExpectBucketCount( - kTabUnderAction, + GetActionHistogram(), static_cast<int>(TabUnderNavigationThrottle::Action::kDidTabUnder), 1); - histogram_tester()->ExpectTotalCount(kTabUnderAction, 3); + histogram_tester()->ExpectTotalCount(GetActionHistogram(), 3); } TEST_F(BlockTabUnderTest, LogsRapporAndUkm) {
diff --git a/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.cc b/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.cc index f744783..cf1cad7 100644 --- a/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.cc +++ b/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.cc
@@ -21,6 +21,7 @@ #include "components/rappor/public/rappor_parameters.h" #include "components/rappor/public/rappor_utils.h" #include "components/rappor/rappor_service_impl.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" @@ -40,15 +41,22 @@ namespace { -void LogAction(TabUnderNavigationThrottle::Action action) { +void LogAction(TabUnderNavigationThrottle::Action action, bool off_the_record) { UMA_HISTOGRAM_ENUMERATION("Tab.TabUnderAction", action, TabUnderNavigationThrottle::Action::kCount); + if (off_the_record) { + UMA_HISTOGRAM_ENUMERATION("Tab.TabUnderAction.OTR", action, + TabUnderNavigationThrottle::Action::kCount); + } else { + UMA_HISTOGRAM_ENUMERATION("Tab.TabUnderAction.NonOTR", action, + TabUnderNavigationThrottle::Action::kCount); + } } #if defined(OS_ANDROID) typedef FramebustBlockMessageDelegate::InterventionOutcome InterventionOutcome; -void LogOutcome(InterventionOutcome outcome) { +void LogOutcome(bool off_the_record, InterventionOutcome outcome) { TabUnderNavigationThrottle::Action action; switch (outcome) { case InterventionOutcome::kAccepted: @@ -58,11 +66,15 @@ action = TabUnderNavigationThrottle::Action::kClickedThrough; break; } - LogAction(action); + LogAction(action, off_the_record); } #else -void OnListItemClicked(const GURL& url, size_t index, size_t total_size) { - LogAction(TabUnderNavigationThrottle::Action::kClickedThrough); +void OnListItemClicked(bool off_the_record, + const GURL& url, + size_t index, + size_t total_size) { + LogAction(TabUnderNavigationThrottle::Action::kClickedThrough, + off_the_record); UMA_HISTOGRAM_ENUMERATION("Tab.TabUnder.ClickThroughPosition", GetListItemPositionFromDistance(index, total_size), ListItemPosition::kLast); @@ -70,8 +82,9 @@ #endif void LogTabUnderAttempt(content::NavigationHandle* handle, - base::Optional<ukm::SourceId> opener_source_id) { - LogAction(TabUnderNavigationThrottle::Action::kDidTabUnder); + base::Optional<ukm::SourceId> opener_source_id, + bool off_the_record) { + LogAction(TabUnderNavigationThrottle::Action::kDidTabUnder, off_the_record); // Log RAPPOR / UKM based on the opener URL, not the URL navigated to. const GURL& opener_url = handle->GetWebContents()->GetLastCommittedURL(); @@ -93,22 +106,6 @@ } } -void ShowUI(content::WebContents* web_contents, const GURL& url) { -#if defined(OS_ANDROID) - FramebustBlockInfoBar::Show( - web_contents, base::MakeUnique<FramebustBlockMessageDelegate>( - web_contents, url, base::BindOnce(&LogOutcome))); -#else - // TODO(csharrison): Instrument click-through metrics. This may be a bit - // difficult and requires attribution since this UI surface is shared with - // framebusting. - TabSpecificContentSettings* content_settings = - TabSpecificContentSettings::FromWebContents(web_contents); - DCHECK(content_settings); - content_settings->OnFramebustBlocked(url, base::BindOnce(&OnListItemClicked)); -#endif -} - } // namespace const base::Feature TabUnderNavigationThrottle::kBlockTabUnders{ @@ -127,6 +124,8 @@ TabUnderNavigationThrottle::TabUnderNavigationThrottle( content::NavigationHandle* handle) : content::NavigationThrottle(handle), + off_the_record_( + handle->GetWebContents()->GetBrowserContext()->IsOffTheRecord()), block_(base::FeatureList::IsEnabled(kBlockTabUnders)) {} // static @@ -171,26 +170,46 @@ IsSuspiciousClientRedirect(navigation_handle(), started_in_background_)) { seen_tab_under_ = true; popup_opener->OnDidTabUnder(); + LogTabUnderAttempt(navigation_handle(), - popup_opener->last_committed_source_id()); + popup_opener->last_committed_source_id(), + off_the_record_); if (block_) { - const GURL& url = navigation_handle()->GetURL(); const std::string error = - base::StringPrintf(kBlockTabUnderFormatMessage, url.spec().c_str()); + base::StringPrintf(kBlockTabUnderFormatMessage, + navigation_handle()->GetURL().spec().c_str()); contents->GetMainFrame()->AddMessageToConsole( content::CONSOLE_MESSAGE_LEVEL_ERROR, error.c_str()); - LogAction(Action::kBlocked); - ShowUI(contents, url); + LogAction(Action::kBlocked, off_the_record_); + ShowUI(); return content::NavigationThrottle::CANCEL; } } return content::NavigationThrottle::PROCEED; } +void TabUnderNavigationThrottle::ShowUI() { + content::WebContents* web_contents = navigation_handle()->GetWebContents(); + const GURL& url = navigation_handle()->GetURL(); + bool off_the_record = web_contents->GetBrowserContext()->IsOffTheRecord(); +#if defined(OS_ANDROID) + FramebustBlockInfoBar::Show( + web_contents, + base::MakeUnique<FramebustBlockMessageDelegate>( + web_contents, url, base::BindOnce(&LogOutcome, off_the_record))); +#else + TabSpecificContentSettings* content_settings = + TabSpecificContentSettings::FromWebContents(web_contents); + DCHECK(content_settings); + content_settings->OnFramebustBlocked( + url, base::BindOnce(&OnListItemClicked, off_the_record)); +#endif +} + content::NavigationThrottle::ThrottleCheckResult TabUnderNavigationThrottle::WillStartRequest() { - LogAction(Action::kStarted); + LogAction(Action::kStarted, off_the_record_); started_in_background_ = !navigation_handle()->GetWebContents()->IsVisible(); return MaybeBlockNavigation(); }
diff --git a/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.h b/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.h index e9589ba..3f65fbc 100644 --- a/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.h +++ b/chrome/browser/ui/blocked_content/tab_under_navigation_throttle.h
@@ -80,6 +80,7 @@ bool started_in_background); content::NavigationThrottle::ThrottleCheckResult MaybeBlockNavigation(); + void ShowUI(); // content::NavigationThrottle: content::NavigationThrottle::ThrottleCheckResult WillStartRequest() override; @@ -87,6 +88,10 @@ override; const char* GetNameForLogging() override; + // Store whether we're off the record as a member to avoid looking it up all + // the time. + bool off_the_record_ = false; + bool started_in_background_ = false; // True if the experiment is turned on and the class should actually attempt
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc index bba78ad..ad3c8226 100644 --- a/chrome/browser/ui/browser_list.cc +++ b/chrome/browser/ui/browser_list.cc
@@ -56,8 +56,7 @@ // static BrowserList* BrowserList::GetInstance() { - BrowserList** list = NULL; - list = &instance_; + BrowserList** list = &instance_; if (!*list) *list = new BrowserList; return *list;
diff --git a/chrome/browser/ui/browser_navigator.cc b/chrome/browser/ui/browser_navigator.cc index a3bd90d..1b96506 100644 --- a/chrome/browser/ui/browser_navigator.cc +++ b/chrome/browser/ui/browser_navigator.cc
@@ -124,69 +124,68 @@ return true; } -// Returns a Browser that can host the navigation or tab addition specified in -// |params|. This might just return the same Browser specified in |params|, or -// some other if that Browser is deemed incompatible. -Browser* GetBrowserForDisposition(NavigateParams* params) { - // If no source WebContents was specified, we use the selected one from - // the target browser. This must happen first, before - // GetBrowserForDisposition() has a chance to replace |params->browser| with - // another one. - if (!params->source_contents && params->browser) { - params->source_contents = - params->browser->tab_strip_model()->GetActiveWebContents(); - } +// Returns a Browser and tab index. The browser can host the navigation or +// tab addition specified in |params|. This might just return the same +// Browser specified in |params|, or some other if that Browser is deemed +// incompatible. The tab index will be -1 unless a singleton or tab switch +// was requested, in which case it might be the target tab index, or -1 +// if not found. +std::pair<Browser*, int> GetBrowserAndTabForDisposition( + const NavigateParams& params) { + Profile* profile = params.initiating_profile; - Profile* profile = params->initiating_profile; - Browser* current_browser = params->browser; - - switch (params->disposition) { + switch (params.disposition) { + case WindowOpenDisposition::SINGLETON_TAB: case WindowOpenDisposition::SWITCH_TO_TAB: -#if !defined(OS_ANDROID) - for (auto* browser : *BrowserList::GetInstance()) { - // Only look at same profile (and anonymity level). - if (browser->profile()->IsSameProfile(profile) && - browser->profile()->GetProfileType() == profile->GetProfileType()) { - params->browser = browser; - int index = GetIndexOfExistingTab(params); - if (index >= 0) { - params->browser = current_browser; - params->tab_switch_hint = index; - return browser; +#if defined(OS_ANDROID) + // Do not support tab switching on Android yet. + if (params.disposition == WindowOpenDisposition::SINGLETON_TAB) { +#endif + for (auto browser_it = BrowserList::GetInstance()->begin_last_active(); + browser_it != BrowserList::GetInstance()->end_last_active(); + ++browser_it) { + Browser* browser = *browser_it; + // Only look at same profile (and anonymity level). + if (browser->profile()->IsSameProfile(profile) && + browser->profile()->GetProfileType() == + profile->GetProfileType()) { + int index = GetIndexOfExistingTab(browser, params); + if (index >= 0) + return {browser, index}; } } +#if defined(OS_ANDROID) } - params->browser = current_browser; -#endif // !defined(OS_ANDROID) +#endif // fall through case WindowOpenDisposition::CURRENT_TAB: - if (params->browser) - return params->browser; + if (params.browser) + return {params.browser, -1}; // Find a compatible window and re-execute this command in it. Otherwise // re-run with NEW_WINDOW. - return GetOrCreateBrowser(profile, params->user_gesture); - case WindowOpenDisposition::SINGLETON_TAB: + return {GetOrCreateBrowser(profile, params.user_gesture), -1}; case WindowOpenDisposition::NEW_FOREGROUND_TAB: case WindowOpenDisposition::NEW_BACKGROUND_TAB: // See if we can open the tab in the window this navigator is bound to. - if (params->browser && WindowCanOpenTabs(params->browser)) - return params->browser; + if (params.browser && WindowCanOpenTabs(params.browser)) + return {params.browser, -1}; + // Find a compatible window and re-execute this command in it. Otherwise // re-run with NEW_WINDOW. - return GetOrCreateBrowser(profile, params->user_gesture); + return {GetOrCreateBrowser(profile, params.user_gesture), -1}; case WindowOpenDisposition::NEW_POPUP: { // Make a new popup window. // Coerce app-style if |source| represents an app. std::string app_name; #if BUILDFLAG(ENABLE_EXTENSIONS) - if (!params->extension_app_id.empty()) { + if (!params.extension_app_id.empty()) { app_name = web_app::GenerateApplicationNameFromExtensionId( - params->extension_app_id); - } else if (params->browser && !params->browser->app_name().empty()) { - app_name = params->browser->app_name(); - } else if (params->source_contents) { + params.extension_app_id); + } else if (params.browser && !params.browser->app_name().empty()) { + app_name = params.browser->app_name(); + } else if (params.source_contents) { extensions::TabHelper* extensions_tab_helper = - extensions::TabHelper::FromWebContents(params->source_contents); + extensions::TabHelper::FromWebContents(params.source_contents); if (extensions_tab_helper && extensions_tab_helper->is_app()) { app_name = web_app::GenerateApplicationNameFromExtensionId( extensions_tab_helper->extension_app()->id()); @@ -195,32 +194,34 @@ #endif if (app_name.empty()) { Browser::CreateParams browser_params(Browser::TYPE_POPUP, profile, - params->user_gesture); - browser_params.trusted_source = params->trusted_source; - browser_params.initial_bounds = params->window_bounds; - return new Browser(browser_params); + params.user_gesture); + browser_params.trusted_source = params.trusted_source; + browser_params.initial_bounds = params.window_bounds; + return {new Browser(browser_params), -1}; } - - return new Browser(Browser::CreateParams::CreateForApp( - app_name, params->trusted_source, params->window_bounds, profile, - params->user_gesture)); + return {new Browser(Browser::CreateParams::CreateForApp( + app_name, params.trusted_source, params.window_bounds, + profile, params.user_gesture)), + -1}; } case WindowOpenDisposition::NEW_WINDOW: { // Make a new normal browser window. - return new Browser(Browser::CreateParams(profile, params->user_gesture)); + return {new Browser(Browser::CreateParams(profile, params.user_gesture)), + -1}; } case WindowOpenDisposition::OFF_THE_RECORD: // Make or find an incognito window. - return GetOrCreateBrowser(profile->GetOffTheRecordProfile(), - params->user_gesture); + return {GetOrCreateBrowser(profile->GetOffTheRecordProfile(), + params.user_gesture), + -1}; // The following types result in no navigation. case WindowOpenDisposition::SAVE_TO_DISK: case WindowOpenDisposition::IGNORE_ACTION: - return NULL; + return {nullptr, -1}; default: NOTREACHED(); } - return NULL; + return {nullptr, -1}; } // Fix disposition and other parameter values depending on prevailing @@ -472,10 +473,23 @@ params->disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; } - params->browser = GetBrowserForDisposition(params); + // If no source WebContents was specified, we use the selected one from + // the target browser. This must happen first, before + // GetBrowserForDisposition() has a chance to replace |params->browser| with + // another one. + if (!params->source_contents && params->browser) { + params->source_contents = + params->browser->tab_strip_model()->GetActiveWebContents(); + } + int singleton_index; + std::tie(params->browser, singleton_index) = + GetBrowserAndTabForDisposition(*params); if (!params->browser) return; - + if (singleton_index != -1) { + params->target_contents = + params->browser->tab_strip_model()->GetWebContentsAt(singleton_index); + } #if defined(OS_CHROMEOS) if (source_browser && source_browser != params->browser) { // When the newly created browser was spawned by a browser which visits @@ -551,16 +565,13 @@ ui::PageTransitionCoreTypeIs(params->transition, ui::PAGE_TRANSITION_KEYWORD); - // Check if this is a singleton tab that already exists - int singleton_index = GetIndexOfExistingTab(params); - // Did we use a prerender? bool swapped_in_prerender = false; - // If no target WebContents was specified, we need to construct one if - // we are supposed to target a new tab; unless it's a singleton that already - // exists. - if (!params->target_contents && singleton_index < 0) { + // If no target WebContents was specified (and we didn't seek and find a + // singleton), we need to construct one if we are supposed to target a new + // tab. + if (!params->target_contents) { DCHECK(!params->url.is_empty()); if (params->disposition != WindowOpenDisposition::CURRENT_TAB) { params->target_contents = CreateTargetContents(*params, params->url); @@ -637,14 +648,12 @@ params->browser != source_browser) params->window_action = NavigateParams::SHOW_WINDOW; - WebContents* target = - params->browser->tab_strip_model()->GetWebContentsAt(singleton_index); - - if (target->IsCrashed()) { - target->GetController().Reload(content::ReloadType::NORMAL, true); + if (params->target_contents->IsCrashed()) { + params->target_contents->GetController().Reload( + content::ReloadType::NORMAL, true); } else if (params->path_behavior == NavigateParams::IGNORE_AND_NAVIGATE && - target->GetURL() != params->url) { - LoadURLInContents(target, params->url, params); + params->target_contents->GetURL() != params->url) { + LoadURLInContents(params->target_contents, params->url, params); } // If the singleton tab isn't already selected, select it.
diff --git a/chrome/browser/ui/browser_navigator_browsertest.cc b/chrome/browser/ui/browser_navigator_browsertest.cc index e5e416c..04a5505 100644 --- a/chrome/browser/ui/browser_navigator_browsertest.cc +++ b/chrome/browser/ui/browser_navigator_browsertest.cc
@@ -633,6 +633,63 @@ EXPECT_EQ(1, params.browser->tab_strip_model()->count()); } +// This test verifies that navigating to a singleton doesn't mistakenly +// pick the current browser. +IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, SingletonCorrectWindow) { + // Make singleton tab. + NavigateParams params1(MakeNavigateParams()); + params1.disposition = WindowOpenDisposition::CURRENT_TAB; + params1.url = GURL("http://maps.google.com/"); + params1.window_action = NavigateParams::SHOW_WINDOW; + Navigate(¶ms1); + Browser* save_browser = browser(); + + // Make new window. + NavigateParams params2(MakeNavigateParams()); + params2.disposition = WindowOpenDisposition::NEW_WINDOW; + params2.window_action = NavigateParams::SHOW_WINDOW; + Navigate(¶ms2); + + // Navigate to the singleton again. + params1.disposition = WindowOpenDisposition::SINGLETON_TAB; + Navigate(¶ms1); + + EXPECT_EQ(save_browser, browser()); +} + +// This test verifies that navigation to a singleton prefers the latest +// used browser, if multiple exist. +IN_PROC_BROWSER_TEST_F(BrowserNavigatorTest, SingletonLatestWindow) { + // Navigate to a site. + NavigateParams params1(MakeNavigateParams()); + params1.disposition = WindowOpenDisposition::CURRENT_TAB; + params1.url = GURL("http://maps.google.com/"); + params1.window_action = NavigateParams::SHOW_WINDOW; + Navigate(¶ms1); + + // Navigate to a new window. + NavigateParams params2(MakeNavigateParams()); + params2.disposition = WindowOpenDisposition::NEW_WINDOW; + params2.url = GURL("http://maps.google.com/"); + params2.window_action = NavigateParams::SHOW_WINDOW; + Navigate(¶ms2); + Browser* save_browser = browser(); + + // Make yet another window. + NavigateParams params3(MakeNavigateParams()); + params3.disposition = WindowOpenDisposition::NEW_WINDOW; + params3.window_action = NavigateParams::SHOW_WINDOW; + Navigate(¶ms3); + + // Navigate to the latest copy of the URL, in spite of specifying + // the current browser. + params2.browser = browser(); + params2.disposition = WindowOpenDisposition::SINGLETON_TAB; + Navigate(¶ms2); + + EXPECT_EQ(save_browser, browser()); +} + #if defined(OS_MACOSX) && defined(ADDRESS_SANITIZER) // Flaky on ASAN on Mac. See https://crbug.com/674497. #define MAYBE_Disposition_Incognito DISABLED_Disposition_Incognito @@ -1383,7 +1440,7 @@ NavigateParams singleton_params(browser(), GURL(chrome::kChromeUIVersionURL), ui::PAGE_TRANSITION_LINK); singleton_params.disposition = WindowOpenDisposition::SINGLETON_TAB; - EXPECT_EQ(-1, GetIndexOfExistingTab(&singleton_params)); + EXPECT_EQ(-1, GetIndexOfExistingTab(browser(), singleton_params)); } // This test verifies that browser initiated navigations can send requests
diff --git a/chrome/browser/ui/browser_navigator_params.h b/chrome/browser/ui/browser_navigator_params.h index 2433f4d..1403597c 100644 --- a/chrome/browser/ui/browser_navigator_params.h +++ b/chrome/browser/ui/browser_navigator_params.h
@@ -245,9 +245,6 @@ // an about:blank or a data url navigation. scoped_refptr<content::SiteInstance> source_site_instance; - // If non-default, provides a hint to GetIndexOfSingleton() where to start. - int tab_switch_hint = -1; - private: NavigateParams(); };
diff --git a/chrome/browser/ui/chrome_select_file_policy.cc b/chrome/browser/ui/chrome_select_file_policy.cc index 43dd8ee3..b842531 100644 --- a/chrome/browser/ui/chrome_select_file_policy.cc +++ b/chrome/browser/ui/chrome_select_file_policy.cc
@@ -32,8 +32,9 @@ if (source_contents_) { SimpleAlertInfoBarDelegate::Create( InfoBarService::FromWebContents(source_contents_), - infobars::InfoBarDelegate::CHROME_SELECT_FILE_POLICY, nullptr, - l10n_util::GetStringUTF16(IDS_FILE_SELECTION_DIALOG_INFOBAR), true); + infobars::InfoBarDelegate::FILE_ACCESS_DISABLED_INFOBAR_DELEGATE, + nullptr, l10n_util::GetStringUTF16(IDS_FILE_SELECTION_DIALOG_INFOBAR), + true); } else { LOG(WARNING) << "File-selection dialogs are disabled but no WebContents " << "is given to display the InfoBar.";
diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.mm b/chrome/browser/ui/cocoa/download/download_item_controller.mm index df27633..1a319ce 100644 --- a/chrome/browser/ui/cocoa/download/download_item_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_item_controller.mm
@@ -30,6 +30,7 @@ #include "content/public/browser/download_item.h" #include "content/public/browser/page_navigator.h" #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTweaker.h" +#include "ui/base/cocoa/a11y_util.h" #include "ui/base/l10n/l10n_util_mac.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/font.h" @@ -228,6 +229,10 @@ - (void)setStateFromDownload:(DownloadItemModel*)downloadModel { DCHECK_EQ([self download], downloadModel->download()); + + if (downloadModel->download()->GetState() != DownloadItem::IN_PROGRESS) + ui::a11y_util::PlayElementUpdatedSound(self.view.window); + if (base::FeatureList::IsEnabled(features::kMacMaterialDesignDownloadShelf)) { [progressView_ setStateFromDownload:downloadModel]; CGFloat preferredWidth = progressView_.preferredWidth;
diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm index 4e199294..d6b1f763 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller.mm
@@ -421,6 +421,14 @@ [self cancelAutoClose]; shouldCloseOnMouseExit_ = NO; + // Announce the new download. + NSAccessibilityPostNotificationWithUserInfo( + self.view.window, NSAccessibilityAnnouncementRequestedNotification, @{ + NSAccessibilityAnnouncementKey : + l10n_util::GetNSString(IDS_DOWNLOAD_STARTED), + NSAccessibilityPriorityKey : @(NSAccessibilityPriorityMedium), + }); + // Insert new item at the left. // Adding at index 0 in NSMutableArrays is O(1). [downloadItemControllers_ insertObject:controller atIndex:0];
diff --git a/chrome/browser/ui/cocoa/download/md_download_item_view.mm b/chrome/browser/ui/cocoa/download/md_download_item_view.mm index 8e2cc79..a32f4e9a 100644 --- a/chrome/browser/ui/cocoa/download/md_download_item_view.mm +++ b/chrome/browser/ui/cocoa/download/md_download_item_view.mm
@@ -35,7 +35,7 @@ namespace { // Size of a download item in a non-dangerous state. -constexpr CGSize kNormalSize = {239, 44}; +constexpr CGSize kNormalSize = {245, 44}; constexpr CGFloat kDangerousDownloadIconX = 16; constexpr CGFloat kDangerousDownloadIconSize = 16; @@ -311,7 +311,15 @@ [NSView cr_localizedAutoresizingMask:NSViewMaxXMargin]; [self addSubview:filenameView_]; - statusTextView_ = MakeLabel([NSFont systemFontOfSize:12]); + NSFont* statusFont; + if (@available(macOS 10.11, *)) { + statusFont = [NSFont monospacedDigitSystemFontOfSize:12 + weight:NSFontWeightRegular]; + } else { + statusFont = [NSFont systemFontOfSize:12]; + } + statusTextView_ = MakeLabel(statusFont); + NSRect statusTextRect = NSMakeRect(kTextX, kStatusTextY, NSWidth(filenameRect), NSHeight(statusTextView_.bounds));
diff --git a/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm b/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm index 954b9399..f5d9c6e 100644 --- a/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm +++ b/chrome/browser/ui/cocoa/keystone_infobar_delegate.mm
@@ -109,7 +109,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier KeystonePromotionInfoBarDelegate::GetIdentifier() const { - return KEYSTONE_PROMOTION_INFOBAR_DELEGATE; + return KEYSTONE_PROMOTION_INFOBAR_DELEGATE_MAC; } int KeystonePromotionInfoBarDelegate::GetIconId() const {
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm index e937bd5..d7b3cc0 100644 --- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm +++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
@@ -373,7 +373,8 @@ withFrame:(NSRect)cellFrame origin:(NSPoint)origin withMaxWidth:(int)maxWidth - forDarkTheme:(BOOL)isDarkTheme; + forDarkTheme:(BOOL)isDarkTheme + withHeightCap:(BOOL)hasHeightCap; - (void)drawMatchWithFrame:(NSRect)cellFrame inView:(NSView*)controlView; @end @@ -530,7 +531,8 @@ withFrame:cellFrame origin:origin withMaxWidth:contentsMaxWidth - forDarkTheme:isDarkTheme]; + forDarkTheme:isDarkTheme + withHeightCap:true]; if (descriptionMaxWidth > 0) { if ([cellData isAnswer]) { @@ -563,14 +565,16 @@ withFrame:cellFrame origin:origin withMaxWidth:separatorWidth - forDarkTheme:isDarkTheme]; + forDarkTheme:isDarkTheme + withHeightCap:true]; } } [self drawMatchPart:[cellData description] withFrame:cellFrame origin:origin withMaxWidth:descriptionMaxWidth - forDarkTheme:isDarkTheme]; + forDarkTheme:isDarkTheme + withHeightCap:false]; } } @@ -578,13 +582,15 @@ withFrame:(NSRect)cellFrame origin:(NSPoint)origin withMaxWidth:(int)maxWidth - forDarkTheme:(BOOL)isDarkTheme { + forDarkTheme:(BOOL)isDarkTheme + withHeightCap:(BOOL)hasHeightCap { NSRect renderRect = NSIntersectionRect( cellFrame, NSOffsetRect(cellFrame, origin.x, origin.y)); renderRect.size.width = std::min(NSWidth(renderRect), static_cast<CGFloat>(maxWidth)); - renderRect.size.height = - std::min(NSHeight(renderRect), [attributedString size].height); + if (hasHeightCap) + renderRect.size.height = + std::min(NSHeight(renderRect), [attributedString size].height); if (!NSIsEmptyRect(renderRect)) { [attributedString drawWithRect:FlipIfRTL(renderRect, cellFrame) options:NSStringDrawingUsesLineFragmentOrigin |
diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.h b/chrome/browser/ui/cocoa/status_bubble_mac.h index f490c0d..10107f25b 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.h +++ b/chrome/browser/ui/cocoa/status_bubble_mac.h
@@ -23,7 +23,6 @@ } class StatusBubbleMacTest; -@class StatusBubbleWindow; class StatusBubbleMac : public StatusBubble { public: @@ -154,7 +153,7 @@ id delegate_; // WEAK // The window we own. - StatusBubbleWindow* window_; + NSWindow* window_; // The status text we want to display when there are no URLs to display. NSString* status_text_;
diff --git a/chrome/browser/ui/cocoa/status_bubble_mac.mm b/chrome/browser/ui/cocoa/status_bubble_mac.mm index 105c540..5aa268a 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/status_bubble_mac.mm
@@ -64,124 +64,6 @@ } // namespace -@interface StatusBubbleAnimationDelegate : NSObject <CAAnimationDelegate> { - @private - base::mac::ScopedBlock<void (^)(void)> completionHandler_; -} - -- (id)initWithCompletionHandler:(void (^)(void))completionHandler; - -// CAAnimation delegate methods -- (void)animationDidStart:(CAAnimation*)animation; -- (void)animationDidStop:(CAAnimation*)animation finished:(BOOL)finished; -@end - -@implementation StatusBubbleAnimationDelegate - -- (id)initWithCompletionHandler:(void (^)(void))completionHandler { - if ((self = [super init])) { - completionHandler_.reset(completionHandler, base::scoped_policy::RETAIN); - } - - return self; -} - -- (void)animationDidStart:(CAAnimation*)theAnimation { - // CAAnimationDelegate method added on OSX 10.12. -} -- (void)animationDidStop:(CAAnimation*)animation finished:(BOOL)finished { - completionHandler_.get()(); -} - -@end - -@interface StatusBubbleWindow : NSWindow { - @private - void (^completionHandler_)(void); -} - -- (id)animationForKey:(NSString *)key; -- (void)runAnimationGroup:(void (^)(NSAnimationContext *context))changes - completionHandler:(void (^)(void))completionHandler; -@end - -@implementation StatusBubbleWindow - -- (id)animationForKey:(NSString *)key { - CAAnimation* animation = [super animationForKey:key]; - // If completionHandler_ isn't nil, then this is the first of (potentially) - // multiple animations in a grouping; give it the completion handler. If - // completionHandler_ is nil, then some other animation was tagged with the - // completion handler. - if (completionHandler_) { - DCHECK(![NSAnimationContext respondsToSelector: - @selector(runAnimationGroup:completionHandler:)]); - StatusBubbleAnimationDelegate* animation_delegate = - [[StatusBubbleAnimationDelegate alloc] - initWithCompletionHandler:completionHandler_]; - [animation setDelegate:animation_delegate]; - completionHandler_ = nil; - } - return animation; -} - -- (void)runAnimationGroup:(void (^)(NSAnimationContext *context))changes - completionHandler:(void (^)(void))completionHandler { - if ([NSAnimationContext respondsToSelector: - @selector(runAnimationGroup:completionHandler:)]) { - [NSAnimationContext runAnimationGroup:changes - completionHandler:completionHandler]; - } else { - // Mac OS 10.6 does not have completion handler callbacks at the Cocoa - // level, only at the CoreAnimation level. So intercept calls made to - // -animationForKey: and tag one of the animations with a delegate that will - // execute the completion handler. - completionHandler_ = completionHandler; - [NSAnimationContext beginGrouping]; - changes([NSAnimationContext currentContext]); - // At this point, -animationForKey should have been called by CoreAnimation - // to set up the animation to run. Verify this. - DCHECK(completionHandler_ == nil); - [NSAnimationContext endGrouping]; - } -} - -@end - -// Mac implementation of the status bubble. -// -// TODO(crbug.com/780521): The comment below no longer applies and should be -// cleaned up along with all of the code it refers to. Setting the bubble's -// collectionBehavior lets it be removed from the screen with orderOut: instead -// of just made very small and invisible. Full screen low power will shortly -// depend on this (crrev.com/c/739185). -// -// - - - -// -// Child windows interact with Spaces in interesting ways, so this code has to -// follow these rules: -// -// 1) NSWindows cannot have zero size. At times when the status bubble window -// has no specific size (for example, when hidden), its size is set to -// ui::kWindowSizeDeterminedLater. -// -// 2) Child window frames are in the coordinate space of the screen, not of the -// parent window. If a child window has its origin at (0, 0), Spaces will -// position it in the corner of the screen but group it with the parent -// window in Spaces. This causes Chrome windows to have a large (mostly -// blank) area in Spaces. To avoid this, child windows always have their -// origin set to the lower-left corner of the window. -// -// 3) Detached child windows may show up as top-level windows in Spaces. To -// avoid this, once the status bubble is Attach()ed to the parent, it is -// never detached (except in rare cases when reparenting to a fullscreen -// window). -// -// 4) To avoid unnecessary redraws, if a bubble is in the kBubbleHidden state, -// its size is always set to ui::kWindowSizeDeterminedLater. The proper -// width for the current URL or status text is not calculated until the -// bubble leaves the kBubbleHidden state. - StatusBubbleMac::StatusBubbleMac(NSWindow* parent, id delegate) : parent_(parent), delegate_(delegate), @@ -444,11 +326,10 @@ void StatusBubbleMac::Create() { DCHECK(!window_); - window_ = [[StatusBubbleWindow alloc] - initWithContentRect:ui::kWindowSizeDeterminedLater - styleMask:NSBorderlessWindowMask - backing:NSBackingStoreBuffered - defer:NO]; + window_ = [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater + styleMask:NSBorderlessWindowMask + backing:NSBackingStoreBuffered + defer:NO]; [window_ setCollectionBehavior:[window_ collectionBehavior] | NSWindowCollectionBehaviorTransient]; [window_ setMovableByWindowBackground:NO]; @@ -572,14 +453,13 @@ completion_handler_factory_.InvalidateWeakPtrs(); base::WeakPtr<StatusBubbleMac> weak_ptr( completion_handler_factory_.GetWeakPtr()); - [window_ - runAnimationGroup:^(NSAnimationContext* context) { - [context setDuration:duration]; - [[window_ animator] setAlphaValue:alpha]; - } + [NSAnimationContext runAnimationGroup:^(NSAnimationContext* context) { + [context setDuration:duration]; + [[window_ animator] setAlphaValue:alpha]; + } completionHandler:^{ - if (weak_ptr) - weak_ptr->AnimationDidStop(); + if (weak_ptr) + weak_ptr->AnimationDidStop(); }]; }
diff --git a/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm b/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm index c03ef86..8714c1cb 100644 --- a/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm +++ b/chrome/browser/ui/cocoa/status_bubble_mac_unittest.mm
@@ -133,9 +133,7 @@ BubbleView* bubbleView = [bubble_->window_ contentView]; return [bubbleView content]; } - StatusBubbleWindow* GetWindow() { - return bubble_->window_; - } + NSWindow* GetWindow() { return bubble_->window_; } NSWindow* parent() { return bubble_->parent_; } @@ -534,7 +532,7 @@ // Show the bubble and make sure it has the same origin as |window|. bubble_->SetStatus(UTF8ToUTF16("Showing")); - StatusBubbleWindow* child = GetWindow(); + NSWindow* child = GetWindow(); EXPECT_NSEQ([window frame].origin, [child frame].origin); // Hide the bubble, move the window, and show it again. @@ -554,7 +552,7 @@ // Show the bubble and make sure it has the same origin as |window|. bubble_->SetStatus(UTF8ToUTF16("Showing")); - StatusBubbleWindow* child = GetWindow(); + NSWindow* child = GetWindow(); EXPECT_NSEQ([window frame].origin, [child frame].origin); // Hide the bubble, change base frame offset, and show it again.
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc index dd09cfac..f33d2d9 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -41,7 +41,6 @@ #include "chrome/common/insecure_content_renderer.mojom.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" -#include "chrome/grit/chromium_strings.h" #include "chrome/grit/generated_resources.h" #include "chrome/grit/theme_resources.h" #include "components/content_settings/core/browser/content_settings_utils.h" @@ -1608,7 +1607,7 @@ set_manage_text_style(ContentSettingBubbleModel::ManageTextStyle::kNone); set_show_learn_more(false); set_title(l10n_util::GetStringUTF16(IDS_REDIRECT_BLOCKED_MESSAGE)); - set_done_button_text(l10n_util::GetStringUTF16(IDS_OK)); + set_done_button_text(l10n_util::GetStringUTF16(IDS_REDIRECT_BLOCKED_GOT_IT)); auto* helper = FramebustBlockTabHelper::FromWebContents(web_contents);
diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc b/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc index 3466cf7..93c3324f 100644 --- a/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc +++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
@@ -4,12 +4,16 @@ #include "chrome/browser/ui/media_router/presentation_receiver_window_controller.h" +#include <utility> + #include "base/logging.h" #include "base/memory/ptr_util.h" +#include "base/strings/utf_string_conversions.h" #include "chrome/browser/media/router/presentation/receiver_presentation_service_delegate_impl.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/media_router/presentation_receiver_window.h" #include "content/public/browser/navigation_controller.h" +#include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" #include "third_party/WebKit/public/web/WebPresentationReceiverFlags.h" #include "ui/views/widget/widget.h" @@ -31,12 +35,14 @@ PresentationReceiverWindowController::CreateFromOriginalProfile( Profile* profile, const gfx::Rect& bounds, - base::OnceClosure termination_callback) { + base::OnceClosure termination_callback, + TitleChangeCallback title_change_callback) { DCHECK(profile); DCHECK(!profile->IsOffTheRecord()); DCHECK(termination_callback); return base::WrapUnique(new PresentationReceiverWindowController( - profile, bounds, std::move(termination_callback))); + profile, bounds, std::move(termination_callback), + std::move(title_change_callback))); } PresentationReceiverWindowController::~PresentationReceiverWindowController() { @@ -94,7 +100,8 @@ PresentationReceiverWindowController::PresentationReceiverWindowController( Profile* profile, const gfx::Rect& bounds, - base::OnceClosure termination_callback) + base::OnceClosure termination_callback, + TitleChangeCallback title_change_callback) : otr_profile_registration_( IndependentOTRProfileManager::GetInstance() ->CreateFromOriginalProfile( @@ -105,7 +112,8 @@ web_contents_(WebContents::Create( CreateWebContentsParams(otr_profile_registration_->profile()))), window_(PresentationReceiverWindow::Create(this, bounds)), - termination_callback_(std::move(termination_callback)) { + termination_callback_(std::move(termination_callback)), + title_change_callback_(std::move(title_change_callback)) { DCHECK(otr_profile_registration_->profile()); DCHECK(otr_profile_registration_->profile()->IsOffTheRecord()); content::WebContentsObserver::Observe(web_contents_.get()); @@ -134,6 +142,8 @@ void PresentationReceiverWindowController::TitleWasSet( content::NavigationEntry* entry) { window_->UpdateWindowTitle(); + if (entry) + title_change_callback_.Run(base::UTF16ToUTF8(entry->GetTitle())); } void PresentationReceiverWindowController::NavigationStateChanged(
diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller.h b/chrome/browser/ui/media_router/presentation_receiver_window_controller.h index 4ffaeef..6819119d 100644 --- a/chrome/browser/ui/media_router/presentation_receiver_window_controller.h +++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller.h
@@ -12,6 +12,7 @@ #include "base/macros.h" #include "chrome/browser/media/router/presentation/independent_otr_profile_manager.h" #include "chrome/browser/media/router/presentation/presentation_navigation_policy.h" +#include "chrome/browser/media/router/providers/wired_display/wired_display_presentation_receiver.h" #include "chrome/browser/ui/media_router/presentation_receiver_window_delegate.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" @@ -36,21 +37,23 @@ class PresentationReceiverWindowController final : public PresentationReceiverWindowDelegate, public content::WebContentsObserver, - public content::WebContentsDelegate { + public content::WebContentsDelegate, + public media_router::WiredDisplayPresentationReceiver { public: + using TitleChangeCallback = base::RepeatingCallback<void(const std::string&)>; + static std::unique_ptr<PresentationReceiverWindowController> CreateFromOriginalProfile(Profile* profile, const gfx::Rect& bounds, - base::OnceClosure termination_callback); + base::OnceClosure termination_callback, + TitleChangeCallback title_change_callback); ~PresentationReceiverWindowController() final; - // Starts the presentation with the receiver page |start_url| and the - // presentation ID |presentation_id| for the purpose of messaging. - void Start(const std::string& presentation_id, const GURL& start_url); - - // Closes the window and stops the presentation. - void Terminate(); + // WiredDisplayPresentationReceiver overrides. + void Start(const std::string& presentation_id, + const GURL& start_url) override; + void Terminate() override; // PresentationReceiverWindowDelegate overrides. content::WebContents* web_contents() const final; @@ -58,9 +61,11 @@ private: friend class PresentationReceiverWindowControllerBrowserTest; - PresentationReceiverWindowController(Profile* profile, - const gfx::Rect& bounds, - base::OnceClosure termination_callback); + PresentationReceiverWindowController( + Profile* profile, + const gfx::Rect& bounds, + base::OnceClosure termination_callback, + TitleChangeCallback title_change_callback); void OriginalProfileDestroyed(Profile* profile); @@ -113,6 +118,9 @@ base::OnceClosure termination_callback_; + // Gets called with the new title whenever TitleWasSet() is called. + TitleChangeCallback title_change_callback_; + media_router::PresentationNavigationPolicy navigation_policy_; DISALLOW_COPY_AND_ASSIGN(PresentationReceiverWindowController);
diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc b/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc index 091d2825..d27dbc70 100644 --- a/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc +++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller_browsertest.cc
@@ -45,6 +45,10 @@ const base::FilePath::StringPieceType kResourcePath = FILE_PATH_LITERAL("media/router/"); +base::RepeatingCallback<void(const std::string&)> GetNoopTitleChangeCallback() { + return base::BindRepeating([](const std::string& title) {}); +} + base::FilePath GetResourceFile(base::FilePath::StringPieceType relative_path) { base::FilePath base_dir; if (!PathService::Get(chrome::DIR_TEST_DATA, &base_dir)) @@ -183,7 +187,8 @@ PresentationReceiverWindowController::CreateFromOriginalProfile( browser()->profile(), gfx::Rect(100, 100), base::BindOnce(&ReceiverWindowDestroyer::OnTerminate, - base::Unretained(&destroyer))); + base::Unretained(&destroyer)), + GetNoopTitleChangeCallback()); receiver_window->Start(kPresentationId, GURL("about:blank")); base::RunLoop().RunUntilIdle(); @@ -220,7 +225,8 @@ PresentationReceiverWindowController::CreateFromOriginalProfile( browser()->profile(), target_display.bounds(), base::BindOnce(&ReceiverWindowDestroyer::OnTerminate, - base::Unretained(&destroyer))); + base::Unretained(&destroyer)), + GetNoopTitleChangeCallback()); receiver_window->Start(kPresentationId, GURL("about:blank")); ASSERT_TRUE(content::WaitForLoadStop(receiver_window->web_contents())); @@ -249,7 +255,8 @@ PresentationReceiverWindowController::CreateFromOriginalProfile( browser()->profile(), gfx::Rect(100, 100), base::BindOnce(&ReceiverWindowDestroyer::OnTerminate, - base::Unretained(&destroyer))); + base::Unretained(&destroyer)), + GetNoopTitleChangeCallback()); receiver_window->Start(kPresentationId, presentation_url); ASSERT_TRUE(content::WaitForLoadStop(receiver_window->web_contents())); @@ -276,7 +283,8 @@ PresentationReceiverWindowController::CreateFromOriginalProfile( browser()->profile(), gfx::Rect(100, 100), base::BindOnce(&ReceiverWindowDestroyer::OnTerminate, - base::Unretained(&destroyer))); + base::Unretained(&destroyer)), + GetNoopTitleChangeCallback()); receiver_window->Start(kPresentationId, presentation_url); // Register controller with LocalPresentationManager using test-local @@ -328,7 +336,8 @@ PresentationReceiverWindowController::CreateFromOriginalProfile( browser()->profile(), gfx::Rect(100, 100), base::BindOnce(&ReceiverWindowDestroyer::OnTerminate, - base::Unretained(&destroyer))); + base::Unretained(&destroyer)), + GetNoopTitleChangeCallback()); receiver_window->Start(kPresentationId, GURL("about:blank")); ASSERT_TRUE(content::WaitForLoadStop(receiver_window->web_contents()));
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc index 19802a6..a18f852a 100644 --- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc +++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
@@ -22,7 +22,6 @@ #include "chrome/browser/bookmarks/bookmark_stats.h" #include "chrome/browser/command_updater.h" #include "chrome/browser/extensions/api/omnibox/omnibox_api.h" -#include "chrome/browser/favicon/favicon_service_factory.h" #include "chrome/browser/net/predictor.h" #include "chrome/browser/predictors/autocomplete_action_predictor.h" #include "chrome/browser/predictors/autocomplete_action_predictor_factory.h" @@ -40,8 +39,6 @@ #include "chrome/common/search/instant_types.h" #include "chrome/common/url_constants.h" #include "components/favicon/content/content_favicon_driver.h" -#include "components/favicon/core/favicon_service.h" -#include "components/favicon_base/favicon_types.h" #include "components/feature_engagement/features.h" #include "components/omnibox/browser/autocomplete_match.h" #include "components/omnibox/browser/autocomplete_result.h" @@ -95,11 +92,6 @@ callback_.Run(image); } -void OnFaviconFetched(const FaviconFetchedCallback& on_favicon_fetched, - const favicon_base::FaviconImageResult& result) { - on_favicon_fetched.Run(result.image); -} - } // namespace ChromeOmniboxClient::ChromeOmniboxClient(OmniboxEditController* controller, @@ -107,7 +99,8 @@ : controller_(static_cast<ChromeOmniboxEditController*>(controller)), profile_(profile), scheme_classifier_(profile), - request_id_(BitmapFetcherService::REQUEST_ID_INVALID) {} + request_id_(BitmapFetcherService::REQUEST_ID_INVALID), + favicon_cache_(profile) {} ChromeOmniboxClient::~ChromeOmniboxClient() { BitmapFetcherService* image_service = @@ -316,20 +309,11 @@ } } -void ChromeOmniboxClient::GetFaviconForPageUrl( - base::CancelableTaskTracker* tracker, +gfx::Image ChromeOmniboxClient::GetFaviconForPageUrl( const GURL& page_url, - const FaviconFetchedCallback& on_favicon_fetched) { - favicon::FaviconService* favicon_service = - FaviconServiceFactory::GetForProfile(profile_, - ServiceAccessType::EXPLICIT_ACCESS); - if (!favicon_service) - return; - - // TODO(tommycli): Investigate using the version of this method that specifies - // the desired size. - favicon_service->GetFaviconImageForPageURL( - page_url, base::Bind(&OnFaviconFetched, on_favicon_fetched), tracker); + FaviconFetchedCallback on_favicon_fetched) { + return favicon_cache_.GetFaviconForPageUrl(page_url, + std::move(on_favicon_fetched)); } void ChromeOmniboxClient::OnCurrentMatchChanged(
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.h b/chrome/browser/ui/omnibox/chrome_omnibox_client.h index 52361846..0bc9c954 100644 --- a/chrome/browser/ui/omnibox/chrome_omnibox_client.h +++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.h
@@ -9,6 +9,7 @@ #include "base/macros.h" #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" +#include "chrome/browser/ui/omnibox/favicon_cache.h" #include "chrome/common/search/instant_types.h" #include "components/omnibox/browser/omnibox_client.h" @@ -56,10 +57,9 @@ void OnResultChanged(const AutocompleteResult& result, bool default_match_changed, const BitmapFetchedCallback& on_bitmap_fetched) override; - void GetFaviconForPageUrl( - base::CancelableTaskTracker* tracker, + gfx::Image GetFaviconForPageUrl( const GURL& page_url, - const FaviconFetchedCallback& on_favicon_fetched) override; + FaviconFetchedCallback on_favicon_fetched) override; void OnCurrentMatchChanged(const AutocompleteMatch& match) override; void OnTextChanged(const AutocompleteMatch& current_match, bool user_input_in_progress, @@ -86,6 +86,7 @@ Profile* profile_; ChromeAutocompleteSchemeClassifier scheme_classifier_; BitmapFetcherService::RequestId request_id_; + FaviconCache favicon_cache_; DISALLOW_COPY_AND_ASSIGN(ChromeOmniboxClient); };
diff --git a/chrome/browser/ui/omnibox/favicon_cache.cc b/chrome/browser/ui/omnibox/favicon_cache.cc new file mode 100644 index 0000000..a7bee4a8 --- /dev/null +++ b/chrome/browser/ui/omnibox/favicon_cache.cc
@@ -0,0 +1,66 @@ +// Copyright 2018 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/ui/omnibox/favicon_cache.h" + +#include "base/containers/mru_cache.h" +#include "chrome/browser/favicon/favicon_service_factory.h" +#include "components/favicon/core/favicon_service.h" +#include "components/omnibox/browser/autocomplete_result.h" + +namespace { + +size_t GetFaviconCacheSize() { + // Set cache size to twice the number of maximum results to avoid favicon + // refetches as the user types. Favicon fetches are uncached and can hit disk. + return 2 * AutocompleteResult::GetMaxMatches(); +} + +} // namespace + +FaviconCache::FaviconCache(Profile* profile) + : mru_cache_(GetFaviconCacheSize()), + profile_(profile), + weak_factory_(this) {} + +FaviconCache::~FaviconCache() {} + +gfx::Image FaviconCache::GetFaviconForPageUrl( + const GURL& page_url, + FaviconFetchedCallback on_favicon_fetched) { + auto cache_iterator = mru_cache_.Get(page_url); + if (cache_iterator != mru_cache_.end()) + return cache_iterator->second; + + // We don't have the favicon in the cache. We kick off the request and return + // an empty gfx::Image. + favicon::FaviconService* favicon_service = + FaviconServiceFactory::GetForProfile(profile_, + ServiceAccessType::EXPLICIT_ACCESS); + if (!favicon_service) + return gfx::Image(); + + // TODO(tommycli): Investigate using the version of this method that specifies + // the desired size. + favicon_service->GetFaviconImageForPageURL( + page_url, + base::BindRepeating(&FaviconCache::OnFaviconFetched, + weak_factory_.GetWeakPtr(), page_url, + base::Passed(std::move(on_favicon_fetched))), + &task_tracker_); + + return gfx::Image(); +} + +void FaviconCache::OnFaviconFetched( + const GURL& page_url, + FaviconFetchedCallback on_favicon_fetched, + const favicon_base::FaviconImageResult& result) { + if (result.image.IsEmpty()) + return; + + mru_cache_.Put(page_url, result.image); + + std::move(on_favicon_fetched).Run(result.image); +}
diff --git a/chrome/browser/ui/omnibox/favicon_cache.h b/chrome/browser/ui/omnibox/favicon_cache.h new file mode 100644 index 0000000..147934c --- /dev/null +++ b/chrome/browser/ui/omnibox/favicon_cache.h
@@ -0,0 +1,48 @@ +// Copyright 2018 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_UI_OMNIBOX_FAVICON_CACHE_H_ +#define CHROME_BROWSER_UI_OMNIBOX_FAVICON_CACHE_H_ + +#include "base/callback_forward.h" +#include "base/containers/mru_cache.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/task/cancelable_task_tracker.h" +#include "components/favicon_base/favicon_types.h" + +namespace gfx { +class Image; +} + +class GURL; +class Profile; + +typedef base::OnceCallback<void(const gfx::Image& favicon)> + FaviconFetchedCallback; + +// We cache a very small number of favicons so we can synchronously deliver +// them to prevent flicker as the user types. +class FaviconCache { + public: + explicit FaviconCache(Profile* profile); + virtual ~FaviconCache(); + + gfx::Image GetFaviconForPageUrl(const GURL& page_url, + FaviconFetchedCallback on_favicon_fetched); + + private: + void OnFaviconFetched(const GURL& page_url, + FaviconFetchedCallback on_favicon_fetched, + const favicon_base::FaviconImageResult& result); + + base::CancelableTaskTracker task_tracker_; + base::MRUCache<GURL, gfx::Image> mru_cache_; + Profile* profile_; + base::WeakPtrFactory<FaviconCache> weak_factory_; + + DISALLOW_COPY_AND_ASSIGN(FaviconCache); +}; + +#endif // CHROME_BROWSER_UI_OMNIBOX_FAVICON_CACHE_H_
diff --git a/chrome/browser/ui/overlay/overlay_surface_embedder.cc b/chrome/browser/ui/overlay/overlay_surface_embedder.cc index 93d8089..6d66e7d 100644 --- a/chrome/browser/ui/overlay/overlay_surface_embedder.cc +++ b/chrome/browser/ui/overlay/overlay_surface_embedder.cc
@@ -25,5 +25,5 @@ const viz::SurfaceId& surface_id) { // SurfaceInfo has information about the embedded surface. surface_layer_->SetShowPrimarySurface(surface_id, window_->GetBounds().size(), - ref_factory_); + SK_ColorBLACK, ref_factory_); }
diff --git a/chrome/browser/ui/search/ntp_user_data_logger_unittest.cc b/chrome/browser/ui/search/ntp_user_data_logger_unittest.cc index 83df3d0..b80809a2 100644 --- a/chrome/browser/ui/search/ntp_user_data_logger_unittest.cc +++ b/chrome/browser/ui/search/ntp_user_data_logger_unittest.cc
@@ -9,7 +9,6 @@ #include <vector> #include "base/metrics/histogram.h" -#include "base/metrics/statistics_recorder.h" #include "base/test/histogram_tester.h" #include "base/time/time.h" #include "chrome/common/search/ntp_logging_events.h" @@ -73,8 +72,6 @@ } // namespace TEST(NTPUserDataLoggerTest, ShouldRecordNumberOfTiles) { - base::StatisticsRecorder::Initialize(); - base::HistogramTester histogram_tester; // Ensure non-zero statistics. @@ -107,8 +104,6 @@ } TEST(NTPUserDataLoggerTest, ShouldNotRecordImpressionsBeforeAllTilesLoaded) { - base::StatisticsRecorder::Initialize(); - TestNTPUserDataLogger logger(GURL("chrome://newtab/")); base::HistogramTester histogram_tester; @@ -145,8 +140,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordImpressions) { - base::StatisticsRecorder::Initialize(); - TestNTPUserDataLogger logger(GURL("chrome://newtab/")); base::HistogramTester histogram_tester; @@ -231,8 +224,6 @@ } TEST(NTPUserDataLoggerTest, ShouldNotRecordRepeatedImpressions) { - base::StatisticsRecorder::Initialize(); - TestNTPUserDataLogger logger(GURL("chrome://newtab/")); base::HistogramTester histogram_tester; @@ -296,8 +287,6 @@ } TEST(NTPUserDataLoggerTest, ShouldNotRecordImpressionsForBinsBeyondEight) { - base::StatisticsRecorder::Initialize(); - TestNTPUserDataLogger logger(GURL("chrome://newtab/")); base::HistogramTester histogram_tester; @@ -346,8 +335,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordImpressionsAgainAfterNavigating) { - base::StatisticsRecorder::Initialize(); - TestNTPUserDataLogger logger(GURL("chrome://newtab/")); // Record some previous tile impressions. @@ -426,8 +413,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordNavigations) { - base::StatisticsRecorder::Initialize(); - TestNTPUserDataLogger logger(GURL("chrome://newtab/")); { @@ -603,8 +588,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordLoadTime) { - base::StatisticsRecorder::Initialize(); - base::HistogramTester histogram_tester; TestNTPUserDataLogger logger(GURL("chrome://newtab/")); @@ -697,8 +680,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordLoadTimeLocalNTPGoogle) { - base::StatisticsRecorder::Initialize(); - base::HistogramTester histogram_tester; TestNTPUserDataLogger logger((GURL(chrome::kChromeSearchLocalNtpUrl))); @@ -734,8 +715,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordLoadTimeLocalNTPOther) { - base::StatisticsRecorder::Initialize(); - base::HistogramTester histogram_tester; TestNTPUserDataLogger logger((GURL(chrome::kChromeSearchLocalNtpUrl))); @@ -771,8 +750,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordLoadTimeRemoteNTPGoogle) { - base::StatisticsRecorder::Initialize(); - base::HistogramTester histogram_tester; TestNTPUserDataLogger logger(GURL("https://www.google.com/_/chrome/newtab")); @@ -806,8 +783,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordLoadTimeRemoteNTPOther) { - base::StatisticsRecorder::Initialize(); - base::HistogramTester histogram_tester; TestNTPUserDataLogger logger(GURL("https://www.notgoogle.com/newtab")); @@ -841,8 +816,6 @@ } TEST(NTPUserDataLoggerTest, ShouldRecordImpressionsAge) { - base::StatisticsRecorder::Initialize(); - base::HistogramTester histogram_tester; // Ensure non-zero statistics.
diff --git a/chrome/browser/ui/singleton_tabs.cc b/chrome/browser/ui/singleton_tabs.cc index b5b8518..8e47941 100644 --- a/chrome/browser/ui/singleton_tabs.cc +++ b/chrome/browser/ui/singleton_tabs.cc
@@ -49,11 +49,15 @@ browser->tab_strip_model()->GetActiveWebContents(); if (contents) { const GURL& contents_url = contents->GetURL(); - if ((contents_url == chrome::kChromeUINewTabURL || - search::IsInstantNTP(contents) || - contents_url == url::kAboutBlankURL) && - GetIndexOfExistingTab(&local_params) < 0) { - local_params.disposition = WindowOpenDisposition::CURRENT_TAB; + if (contents_url == chrome::kChromeUINewTabURL || + search::IsInstantNTP(contents) || contents_url == url::kAboutBlankURL) { + int tab_index = GetIndexOfExistingTab(browser, local_params); + if (tab_index < 0) { + local_params.disposition = WindowOpenDisposition::CURRENT_TAB; + } else { + local_params.target_contents = + browser->tab_strip_model()->GetWebContentsAt(tab_index); + } } } @@ -70,36 +74,28 @@ return params; } -// Returns the index of an existing singleton tab in |params->browser| matching +// Returns the index of an existing singleton tab in |browser| matching // the URL specified in |params|. -int GetIndexOfExistingTab(NavigateParams* params) { - if (params->disposition != WindowOpenDisposition::SINGLETON_TAB && - params->disposition != WindowOpenDisposition::SWITCH_TO_TAB) +int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params) { + if (params.disposition != WindowOpenDisposition::SINGLETON_TAB && + params.disposition != WindowOpenDisposition::SWITCH_TO_TAB) return -1; // In case the URL was rewritten by the BrowserURLHandler we need to ensure // that we do not open another URL that will get redirected to the rewritten // URL. - GURL rewritten_url(params->url); + GURL rewritten_url(params.url); bool reverse_on_redirect = false; content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( - &rewritten_url, - params->browser->profile(), - &reverse_on_redirect); + &rewritten_url, browser->profile(), &reverse_on_redirect); // If there are several matches: prefer the active tab by starting there. - int start_index; - if (params->disposition == WindowOpenDisposition::SINGLETON_TAB) { - start_index = - std::max(0, params->browser->tab_strip_model()->active_index()); - } else { - start_index = std::max(0, params->tab_switch_hint); - } - int tab_count = params->browser->tab_strip_model()->count(); + int start_index = std::max(0, browser->tab_strip_model()->active_index()); + int tab_count = browser->tab_strip_model()->count(); for (int i = 0; i < tab_count; ++i) { int tab_index = (start_index + i) % tab_count; content::WebContents* tab = - params->browser->tab_strip_model()->GetWebContentsAt(tab_index); + browser->tab_strip_model()->GetWebContentsAt(tab_index); GURL tab_url = tab->GetURL(); @@ -110,24 +106,20 @@ GURL rewritten_tab_url = tab_url; content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( - &rewritten_tab_url, - params->browser->profile(), - &reverse_on_redirect); + &rewritten_tab_url, browser->profile(), &reverse_on_redirect); url::Replacements<char> replacements; - if (params->ref_behavior == NavigateParams::IGNORE_REF) + if (params.ref_behavior == NavigateParams::IGNORE_REF) replacements.ClearRef(); - if (params->path_behavior == NavigateParams::IGNORE_AND_NAVIGATE || - params->path_behavior == NavigateParams::IGNORE_AND_STAY_PUT) { + if (params.path_behavior == NavigateParams::IGNORE_AND_NAVIGATE || + params.path_behavior == NavigateParams::IGNORE_AND_STAY_PUT) { replacements.ClearPath(); replacements.ClearQuery(); } - if (CompareURLsWithReplacements(tab_url, params->url, replacements) || - CompareURLsWithReplacements(rewritten_tab_url, - rewritten_url, + if (CompareURLsWithReplacements(tab_url, params.url, replacements) || + CompareURLsWithReplacements(rewritten_tab_url, rewritten_url, replacements)) { - params->target_contents = tab; return tab_index; } }
diff --git a/chrome/browser/ui/singleton_tabs.h b/chrome/browser/ui/singleton_tabs.h index 71397c3..f9115b98 100644 --- a/chrome/browser/ui/singleton_tabs.h +++ b/chrome/browser/ui/singleton_tabs.h
@@ -31,8 +31,8 @@ // Creates a NavigateParams struct for a singleton tab navigation. NavigateParams GetSingletonTabNavigateParams(Browser* browser, const GURL& url); -// If the given navigational URL is already open in |params->browser|, return -// the tab index for it. Otherwise, returns -1. -int GetIndexOfExistingTab(NavigateParams* params); +// If the given navigational URL is already open in |browser|, return +// the tab and tab index for it. Otherwise, returns -1. +int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params); #endif // CHROME_BROWSER_UI_SINGLETON_TABS_H_
diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc index 44906af..bb36e7d 100644 --- a/chrome/browser/ui/startup/bad_flags_prompt.cc +++ b/chrome/browser/ui/startup/bad_flags_prompt.cc
@@ -49,7 +49,7 @@ switch_value = "=" + switch_value; SimpleAlertInfoBarDelegate::Create( InfoBarService::FromWebContents(web_contents), - infobars::InfoBarDelegate::BAD_FLAGS_PROMPT, nullptr, + infobars::InfoBarDelegate::BAD_FLAGS_INFOBAR_DELEGATE, nullptr, l10n_util::GetStringFUTF16( message_id, base::UTF8ToUTF16(std::string("--") + flag + switch_value)),
diff --git a/chrome/browser/ui/startup/default_browser_infobar_delegate.cc b/chrome/browser/ui/startup/default_browser_infobar_delegate.cc index 6fb27ee..642aa63 100644 --- a/chrome/browser/ui/startup/default_browser_infobar_delegate.cc +++ b/chrome/browser/ui/startup/default_browser_infobar_delegate.cc
@@ -85,7 +85,7 @@ } base::string16 DefaultBrowserInfoBarDelegate::GetMessageText() const { - return l10n_util::GetStringUTF16(IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT); + return l10n_util::GetStringUTF16(IDS_DEFAULT_BROWSER_INFOBAR_TEXT); } int DefaultBrowserInfoBarDelegate::GetButtons() const {
diff --git a/chrome/browser/ui/startup/session_crashed_infobar_delegate.cc b/chrome/browser/ui/startup/session_crashed_infobar_delegate.cc index f52be5a..a22855e 100644 --- a/chrome/browser/ui/startup/session_crashed_infobar_delegate.cc +++ b/chrome/browser/ui/startup/session_crashed_infobar_delegate.cc
@@ -57,7 +57,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier SessionCrashedInfoBarDelegate::GetIdentifier() const { - return SESSION_CRASHED_INFOBAR_DELEGATE; + return SESSION_CRASHED_INFOBAR_DELEGATE_MAC_IOS; } const gfx::VectorIcon& SessionCrashedInfoBarDelegate::GetVectorIcon() const {
diff --git a/chrome/browser/ui/views/autofill/save_card_bubble_views.h b/chrome/browser/ui/views/autofill/save_card_bubble_views.h index e245a22..cc7d1be 100644 --- a/chrome/browser/ui/views/autofill/save_card_bubble_views.h +++ b/chrome/browser/ui/views/autofill/save_card_bubble_views.h
@@ -82,6 +82,10 @@ views::View* GetFootnoteViewForTesting(); private: + FRIEND_TEST_ALL_PREFIXES( + SaveCardBubbleViewsFullFormBrowserTest, + Upload_ClickingCloseClosesBubbleIfSecondaryUiMdExpOn); + // The current step of the save card flow. Accounts for: // 1) Local save vs. Upload save // 2) Upload save can have all information or be missing CVC
diff --git a/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest.cc b/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest.cc index aa2eac6..0c2cdaa 100644 --- a/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest.cc +++ b/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest.cc
@@ -9,9 +9,12 @@ #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h" #include "chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.h" +#include "components/autofill/core/browser/autofill_experiments.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/test_navigation_observer.h" #include "net/url_request/test_url_fetcher_factory.h" +#include "ui/base/ui_base_features.h" +#include "ui/views/bubble/bubble_frame_view.h" #include "ui/views/controls/button/label_button.h" #include "ui/views/controls/styled_label.h" #include "ui/views/controls/textfield/textfield.h" @@ -103,7 +106,8 @@ IN_PROC_BROWSER_TEST_F( SaveCardBubbleViewsFullFormBrowserTest, Local_ClickingNoThanksClosesBubbleIfSecondaryUiMdExpOff) { - DisableSecondaryUiMdExperiment(); + // Disable the SecondaryUiMd experiment. + scoped_feature_list_.InitAndDisableFeature(features::kSecondaryUiMd); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsDeclines(); @@ -138,7 +142,8 @@ // does not have a [No thanks] button (it has an [X] Close button instead.) IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, Local_ShouldNotHaveNoThanksButtonIfSecondaryUiMdExpOn) { - EnableSecondaryUiMdExperiment(); + // Enable the SecondaryUiMd experiment. + scoped_feature_list_.InitAndEnableFeature(features::kSecondaryUiMd); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsDeclines(); @@ -234,7 +239,8 @@ IN_PROC_BROWSER_TEST_F( SaveCardBubbleViewsFullFormBrowserTest, Upload_ClickingNoThanksClosesBubbleIfSecondaryUiMdExpOff) { - DisableSecondaryUiMdExperiment(); + // Disable the SecondaryUiMd experiment. + scoped_feature_list_.InitAndDisableFeature(features::kSecondaryUiMd); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsAccepts(); @@ -268,7 +274,8 @@ // does not have a [No thanks] button (it has an [X] Close button instead.) IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, Upload_ShouldNotHaveNoThanksButtonIfSecondaryUiMdExpOn) { - EnableSecondaryUiMdExperiment(); + // Enable the SecondaryUiMd experiment. + scoped_feature_list_.InitAndEnableFeature(features::kSecondaryUiMd); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsAccepts(); @@ -288,12 +295,37 @@ EXPECT_FALSE(FindViewInBubbleById(DialogViewId::CANCEL_BUTTON)); } -// TODO(crbug.com/791861): There doesn't seem to be a good way of accessing and -// clicking the [X] close button in the top-right corner of the dialog. Calling -// Close() on the bubble doesn't reach WindowClosing(). The closest thing would -// be forcibly destroying the bubble, but at that point the test is already far -// removed from emulating clicking the [X]. When/if that can be worked around, -// create an Upload_ClickingCloseClosesBubbleIfSecondaryUiMdExpOn test. +// Tests the upload save bubble. Ensures that clicking the top-right [X] close +// button successfully causes the bubble to go away. +IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, + Upload_ClickingCloseClosesBubbleIfSecondaryUiMdExpOn) { + // Enable the SecondaryUiMd experiment. + scoped_feature_list_.InitAndEnableFeature(features::kSecondaryUiMd); + + // Set up the Payments RPC. + SetUploadDetailsRpcPaymentsAccepts(); + + // Submitting the form should show the upload save bubble and legal footer. + // (Must wait for response from Payments before accessing the controller.) + ResetEventWaiterForSequence( + {DialogEvent::REQUESTED_UPLOAD_SAVE, + DialogEvent::RECEIVED_GET_UPLOAD_DETAILS_RESPONSE}); + FillAndSubmitForm(); + WaitForObservedEvent(); + EXPECT_TRUE( + FindViewInBubbleById(DialogViewId::MAIN_CONTENT_VIEW_UPLOAD)->visible()); + EXPECT_TRUE(FindViewInBubbleById(DialogViewId::FOOTNOTE_VIEW)->visible()); + + // Clicking the [X] close button should dismiss the bubble. + base::HistogramTester histogram_tester; + content::TestNavigationObserver nav_observer(GetActiveWebContents(), 1); + ClickOnDialogView( + GetSaveCardBubbleViews()->GetBubbleFrameView()->GetCloseButtonForTest()); + // The bubble should be closed. + // (Must wait for page navigation to complete before checking.) + nav_observer.Wait(); + EXPECT_FALSE(GetSaveCardBubbleViews()); +} // Tests the upload save bubble. Ensures that the updated UI version of the // bubble (as of M62) does not have a [Learn more] link. @@ -329,7 +361,9 @@ IN_PROC_BROWSER_TEST_F( SaveCardBubbleViewsFullFormBrowserTest, Upload_SubmittingFormWithInvalidCvcShowsBubbleIfCvcExpOn) { - EnableRequestCvcIfMissingExperiment(); + // Enable the RequestCvcIfMissing experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamRequestCvcIfMissing); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsAccepts(); @@ -353,7 +387,9 @@ // [Confirm] button is disabled if CVC has not yet been entered. IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, Upload_ConfirmButtonIsDisabledIfNoCvcAndCvcExpOn) { - EnableRequestCvcIfMissingExperiment(); + // Enable the RequestCvcIfMissing experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamRequestCvcIfMissing); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsAccepts(); @@ -389,7 +425,9 @@ // [Confirm] button is disabled if the entered CVC is invalid. IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, Upload_ConfirmButtonIsDisabledIfInvalidCvcAndCvcExpOn) { - EnableRequestCvcIfMissingExperiment(); + // Enable the RequestCvcIfMissing experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamRequestCvcIfMissing); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsAccepts(); @@ -432,7 +470,9 @@ IN_PROC_BROWSER_TEST_F( SaveCardBubbleViewsFullFormBrowserTest, Upload_Entering3DigitCvcAndClickingConfirmClosesBubbleIfNoCvcAndCvcExpOn) { - EnableRequestCvcIfMissingExperiment(); + // Enable the RequestCvcIfMissing experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamRequestCvcIfMissing); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsAccepts(); @@ -487,7 +527,9 @@ IN_PROC_BROWSER_TEST_F( SaveCardBubbleViewsFullFormBrowserTest, Upload_Entering4DigitCvcAndClickingConfirmClosesBubbleIfNoCvcAndCvcExpOn) { - EnableRequestCvcIfMissingExperiment(); + // Enable the RequestCvcIfMissing experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamRequestCvcIfMissing); // Set up the Payments RPC. SetUploadDetailsRpcPaymentsAccepts(); @@ -535,11 +577,66 @@ 1))); } +// Tests the upload save logic. Ensures that Chrome delegates the offer-to-save +// call to Payments when the detected values experiment is on, and offers to +// upload save the card if Payments allows it. +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOn_CanOfferToSaveEvenIfNothingFoundIfPaymentsAccepts) { + // Enable the SendDetectedValues experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamSendDetectedValues); + + // Set up the Payments RPC. + SetUploadDetailsRpcPaymentsAccepts(); + + // Submitting the form, even with only card number and expiration date, should + // start the flow of asking Payments if Chrome should offer to save the card + // to Google. In this case, Payments says yes, and the offer to save bubble + // should be shown. + ResetEventWaiterForSequence( + {DialogEvent::REQUESTED_UPLOAD_SAVE, + DialogEvent::RECEIVED_GET_UPLOAD_DETAILS_RESPONSE}); + FillAndSubmitFormWithCardDetailsOnly(); + WaitForObservedEvent(); + EXPECT_TRUE( + FindViewInBubbleById(DialogViewId::MAIN_CONTENT_VIEW_UPLOAD)->visible()); + EXPECT_TRUE(FindViewInBubbleById(DialogViewId::FOOTNOTE_VIEW)->visible()); +} + +// Tests the upload save logic. Ensures that Chrome delegates the offer-to-save +// call to Payments when the detected values experiment is on, and still does +// not surface the offer to upload save dialog if Payments declines it. +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOn_ShouldNotOfferToSaveIfNothingFoundAndPaymentsDeclines) { + // Enable the SendDetectedValues experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamSendDetectedValues); + + // Set up the Payments RPC. + SetUploadDetailsRpcPaymentsDeclines(); + + // Submitting the form, even with only card number and expiration date, should + // start the flow of asking Payments if Chrome should offer to save the card + // to Google. In this case, Payments says no, so the offer to save bubble + // should not be shown. + ResetEventWaiterForSequence( + {DialogEvent::REQUESTED_UPLOAD_SAVE, + DialogEvent::RECEIVED_GET_UPLOAD_DETAILS_RESPONSE}); + FillAndSubmitFormWithCardDetailsOnly(); + WaitForObservedEvent(); + EXPECT_FALSE(GetSaveCardBubbleViews()); +} + // Tests the upload save logic. Ensures that credit card upload is offered if // name, address, and CVC are detected. -IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, - Logic_ShouldAttemptToOfferToSaveIfEverythingFound) { - DisableSendDetectedValuesExperiment(); +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOff_ShouldAttemptToOfferToSaveIfEverythingFound) { + // Disable the SendDetectedValues experiment. + scoped_feature_list_.InitAndDisableFeature( + kAutofillUpstreamSendDetectedValues); // Submitting the form should start the flow of asking Payments if Chrome // should offer to save the card to Google. @@ -552,8 +649,10 @@ // if street addresses conflict, as long as their postal codes are the same. IN_PROC_BROWSER_TEST_F( SaveCardBubbleViewsFullFormWithShippingBrowserTest, - Logic_ShouldAttemptToOfferToSaveIfStreetAddressesConflict) { - DisableSendDetectedValuesExperiment(); + Logic_DetectedValuesOff_ShouldAttemptToOfferToSaveIfStreetAddressesConflict) { + // Disable the SendDetectedValues experiment. + scoped_feature_list_.InitAndDisableFeature( + kAutofillUpstreamSendDetectedValues); // Submit first shipping address form with a conflicting street address. content::TestNavigationObserver shipping_form_nav_observer( @@ -571,9 +670,15 @@ // Tests the upload save logic. Ensures that credit card upload is not offered // if CVC is not detected and the CVC fix flow is not enabled. -IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, - Logic_ShouldNotOfferToSaveIfCvcNotFoundAndCvcExpOff) { - DisableRequestCvcIfMissingAndSendDetectedValuesExperiments(); +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOff_ShouldNotOfferToSaveIfCvcNotFoundAndCvcExpOff) { + // Disable both the RequestCvcIfMissing and SendDetectedValues experiments. + scoped_feature_list_.InitWithFeatures( + {}, // Enabled + {kAutofillUpstreamRequestCvcIfMissing, + kAutofillUpstreamSendDetectedValues} // Disabled + ); // Submitting the form should not show the upload save bubble because CVC is // missing. @@ -582,12 +687,37 @@ WaitForObservedEvent(); } +// Tests the upload save logic. Ensures that Chrome lets Payments decide whether +// upload save should be offered if the detected values experiment is on, even +// if CVC is not detected and the CVC fix flow experiment is disabled. +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOn_ShouldAttemptToOfferToSaveIfCvcNotFoundAndCvcExpOff) { + // Enable the SendDetectedValues experiment, but disable the + // RequestCvcIfMissing experiment. + scoped_feature_list_.InitWithFeatures( + {kAutofillUpstreamSendDetectedValues}, // Enabled + {kAutofillUpstreamRequestCvcIfMissing} // Disabled + ); + + // Submitting the form should still start the flow of asking Payments if + // Chrome should offer to save the card to Google, even though CVC is missing. + ResetEventWaiterForSequence({DialogEvent::REQUESTED_UPLOAD_SAVE}); + FillAndSubmitFormWithoutCvc(); + WaitForObservedEvent(); +} + // Tests the upload save logic. Ensures that credit card upload is not offered // if an invalid CVC is detected and the CVC fix flow is not enabled. IN_PROC_BROWSER_TEST_F( SaveCardBubbleViewsFullFormBrowserTest, - Logic_ShouldNotOfferToSaveIfInvalidCvcFoundAndCvcExpOff) { - DisableRequestCvcIfMissingAndSendDetectedValuesExperiments(); + Logic_DetectedValuesOff_ShouldNotOfferToSaveIfInvalidCvcFoundAndCvcExpOff) { + // Disable both the RequestCvcIfMissing and SendDetectedValues experiments. + scoped_feature_list_.InitWithFeatures( + {}, // Enabled + {kAutofillUpstreamRequestCvcIfMissing, + kAutofillUpstreamSendDetectedValues} // Disabled + ); // Submitting the form should not show the upload save bubble because CVC is // invalid. @@ -596,11 +726,35 @@ WaitForObservedEvent(); } +// Tests the upload save logic. Ensures that Chrome lets Payments decide whether +// upload save should be offered if the detected values experiment is on, even +// if the detected CVC is invalid and the CVC fix flow experiment is disabled. +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOn_ShouldAttemptToOfferToSaveIfInvalidCvcFoundAndCvcExpOff) { + // Enable the SendDetectedValues experiment, but disable the + // RequestCvcIfMissing experiment. + scoped_feature_list_.InitWithFeatures( + {kAutofillUpstreamSendDetectedValues}, // Enabled + {kAutofillUpstreamRequestCvcIfMissing} // Disabled + ); + + // Submitting the form should still start the flow of asking Payments if + // Chrome should offer to save the card to Google, even though the provided + // CVC is invalid. + ResetEventWaiterForSequence({DialogEvent::REQUESTED_UPLOAD_SAVE}); + FillAndSubmitFormWithInvalidCvc(); + WaitForObservedEvent(); +} + // Tests the upload save logic. Ensures that credit card upload is not offered // if address/cardholder name is not detected. -IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, - Logic_ShouldNotOfferToSaveIfNameNotFound) { - DisableSendDetectedValuesExperiment(); +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOff_ShouldNotOfferToSaveIfNameNotFound) { + // Disable the SendDetectedValues experiment. + scoped_feature_list_.InitAndDisableFeature( + kAutofillUpstreamSendDetectedValues); // Submitting the form should not show the upload save bubble because name is // missing. @@ -609,11 +763,32 @@ WaitForObservedEvent(); } +// Tests the upload save logic. Ensures that Chrome lets Payments decide whether +// upload save should be offered if the detected values experiment is on, even +// if address/cardholder name is not detected. +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOn_ShouldAttemptToOfferToSaveIfNameNotFound) { + // Enable the SendDetectedValues experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamSendDetectedValues); + + // Submitting the form should still start the flow of asking Payments if + // Chrome should offer to save the card to Google, even though name is + // missing. + ResetEventWaiterForSequence({DialogEvent::REQUESTED_UPLOAD_SAVE}); + FillAndSubmitFormWithoutName(); + WaitForObservedEvent(); +} + // Tests the upload save logic. Ensures that credit card upload is not offered // if multiple conflicting names are detected. -IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormWithShippingBrowserTest, - Logic_ShouldNotOfferToSaveIfNamesConflict) { - DisableSendDetectedValuesExperiment(); +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormWithShippingBrowserTest, + Logic_DetectedValuesOff_ShouldNotOfferToSaveIfNamesConflict) { + // Disable the SendDetectedValues experiment. + scoped_feature_list_.InitAndDisableFeature( + kAutofillUpstreamSendDetectedValues); // Submit first shipping address form with a conflicting name. content::TestNavigationObserver shipping_form_nav_observer( @@ -628,11 +803,38 @@ WaitForObservedEvent(); } +// Tests the upload save logic. Ensures that Chrome lets Payments decide whether +// upload save should be offered if the detected values experiment is on, even +// if multiple conflicting names are detected. +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormWithShippingBrowserTest, + Logic_DetectedValuesOn_ShouldAttemptToOfferToSaveIfNamesConflict) { + // Enable the SendDetectedValues experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamSendDetectedValues); + + // Submit first shipping address form with a conflicting name. + content::TestNavigationObserver shipping_form_nav_observer( + GetActiveWebContents(), 1); + FillAndSubmitFormWithConflictingName(); + shipping_form_nav_observer.Wait(); + + // Submitting the form should still start the flow of asking Payments if + // Chrome should offer to save the card to Google, even though the name + // conflicts with the previous form. + ResetEventWaiterForSequence({DialogEvent::REQUESTED_UPLOAD_SAVE}); + FillAndSubmitForm(); + WaitForObservedEvent(); +} + // Tests the upload save logic. Ensures that credit card upload is not offered // if billing address is not detected. -IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormBrowserTest, - Logic_ShouldNotOfferToSaveIfAddressNotFound) { - DisableSendDetectedValuesExperiment(); +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOff_ShouldNotOfferToSaveIfAddressNotFound) { + // Disable the SendDetectedValues experiment. + scoped_feature_list_.InitAndDisableFeature( + kAutofillUpstreamSendDetectedValues); // Submitting the form should not show the upload save bubble because address // is missing. @@ -641,11 +843,32 @@ WaitForObservedEvent(); } +// Tests the upload save logic. Ensures that Chrome lets Payments decide whether +// upload save should be offered if the detected values experiment is on, even +// if billing address is not detected. +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormBrowserTest, + Logic_DetectedValuesOn_ShouldAttemptToOfferToSaveIfAddressNotFound) { + // Enable the SendDetectedValues experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamSendDetectedValues); + + // Submitting the form should still start the flow of asking Payments if + // Chrome should offer to save the card to Google, even though billing address + // is missing. + ResetEventWaiterForSequence({DialogEvent::REQUESTED_UPLOAD_SAVE}); + FillAndSubmitFormWithoutAddress(); + WaitForObservedEvent(); +} + // Tests the upload save logic. Ensures that credit card upload is not offered // if multiple conflicting billing address postal codes are detected. -IN_PROC_BROWSER_TEST_F(SaveCardBubbleViewsFullFormWithShippingBrowserTest, - Logic_ShouldNotOfferToSaveIfPostalCodesConflict) { - DisableSendDetectedValuesExperiment(); +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormWithShippingBrowserTest, + Logic_DetectedValuesOff_ShouldNotOfferToSaveIfPostalCodesConflict) { + // Disable the SendDetectedValues experiment. + scoped_feature_list_.InitAndDisableFeature( + kAutofillUpstreamSendDetectedValues); // Submit first shipping address form with a conflicting postal code. content::TestNavigationObserver shipping_form_nav_observer( @@ -660,4 +883,28 @@ WaitForObservedEvent(); } +// Tests the upload save logic. Ensures that Chrome lets Payments decide whether +// upload save should be offered if the detected values experiment is on, even +// if multiple conflicting billing address postal codes are detected. +IN_PROC_BROWSER_TEST_F( + SaveCardBubbleViewsFullFormWithShippingBrowserTest, + Logic_DetectedValuesOn_ShouldAttemptToOfferToSaveIfPostalCodesConflict) { + // Enable the SendDetectedValues experiment. + scoped_feature_list_.InitAndEnableFeature( + kAutofillUpstreamSendDetectedValues); + + // Submit first shipping address form with a conflicting postal code. + content::TestNavigationObserver shipping_form_nav_observer( + GetActiveWebContents(), 1); + FillAndSubmitFormWithConflictingPostalCode(); + shipping_form_nav_observer.Wait(); + + // Submitting the form should still start the flow of asking Payments if + // Chrome should offer to save the card to Google, even though the postal code + // conflicts with the previous form. + ResetEventWaiterForSequence({DialogEvent::REQUESTED_UPLOAD_SAVE}); + FillAndSubmitForm(); + WaitForObservedEvent(); +} + } // namespace autofill
diff --git a/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.cc b/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.cc index 3793d96..b95d50b 100644 --- a/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.cc +++ b/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.cc
@@ -17,17 +17,14 @@ #include "chrome/browser/ui/views/autofill/save_card_bubble_views.h" #include "chrome/test/base/ui_test_utils.h" #include "components/autofill/content/browser/content_autofill_driver.h" -#include "components/autofill/core/browser/autofill_experiments.h" #include "components/autofill/core/browser/credit_card_save_manager.h" #include "components/network_session_configurator/common/network_switches.h" #include "content/public/test/browser_test_utils.h" #include "device/geolocation/public/interfaces/geolocation_context.mojom.h" #include "mojo/public/cpp/bindings/binding.h" -#include "net/dns/mock_host_resolver.h" #include "net/url_request/test_url_fetcher_factory.h" #include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/connector.h" -#include "ui/base/ui_base_features.h" #include "ui/events/base_event_utils.h" #include "ui/views/controls/button/button.h" #include "ui/views/window/dialog_client_view.h" @@ -119,16 +116,8 @@ SaveCardBubbleViewsBrowserTestBase::~SaveCardBubbleViewsBrowserTestBase() {} -void SaveCardBubbleViewsBrowserTestBase::SetUpCommandLine( - base::CommandLine* command_line) { - // HTTPS server only serves a valid cert for localhost, so this is needed to - // load pages from "a.com" without an interstitial. - command_line->AppendSwitch(switches::kIgnoreCertificateErrors); -} - void SaveCardBubbleViewsBrowserTestBase::SetUpOnMainThread() { // Set up the HTTPS server (uses the embedded_test_server). - host_resolver()->AddRule("*", "127.0.0.1"); ASSERT_TRUE(embedded_test_server()->InitializeAndListen()); embedded_test_server()->ServeFilesFromSourceDirectory( "components/test/data/autofill"); @@ -174,8 +163,8 @@ if (file_path.find("data:") == 0U) { ui_test_utils::NavigateToURL(browser(), GURL(file_path)); } else { - ui_test_utils::NavigateToURL( - browser(), embedded_test_server()->GetURL("a.com", file_path)); + ui_test_utils::NavigateToURL(browser(), + embedded_test_server()->GetURL(file_path)); } } @@ -204,33 +193,6 @@ event_waiter_->OnEvent(DialogEvent::SENT_UPLOAD_CARD_REQUEST); } -void SaveCardBubbleViewsBrowserTestBase:: - DisableRequestCvcIfMissingAndSendDetectedValuesExperiments() { - scoped_feature_list_.InitWithFeatures( - {}, // Enabled - {kAutofillUpstreamRequestCvcIfMissing, - kAutofillUpstreamSendDetectedValues} // Disabled - ); -} - -void SaveCardBubbleViewsBrowserTestBase::DisableSendDetectedValuesExperiment() { - scoped_feature_list_.InitAndDisableFeature( - kAutofillUpstreamSendDetectedValues); -} - -void SaveCardBubbleViewsBrowserTestBase::DisableSecondaryUiMdExperiment() { - scoped_feature_list_.InitAndDisableFeature(features::kSecondaryUiMd); -} - -void SaveCardBubbleViewsBrowserTestBase::EnableRequestCvcIfMissingExperiment() { - scoped_feature_list_.InitAndEnableFeature( - kAutofillUpstreamRequestCvcIfMissing); -} - -void SaveCardBubbleViewsBrowserTestBase::EnableSecondaryUiMdExperiment() { - scoped_feature_list_.InitAndEnableFeature(features::kSecondaryUiMd); -} - // Should be called for credit_card_upload_form_address_and_cc.html. void SaveCardBubbleViewsBrowserTestBase::FillAndSubmitForm() { content::WebContents* web_contents = GetActiveWebContents(); @@ -243,6 +205,18 @@ ASSERT_TRUE(content::ExecuteScript(web_contents, click_submit_button_js)); } +void SaveCardBubbleViewsBrowserTestBase:: + FillAndSubmitFormWithCardDetailsOnly() { + content::WebContents* web_contents = GetActiveWebContents(); + const std::string click_fill_card_button_js = + "(function() { document.getElementById('fill_card_only').click(); })();"; + ASSERT_TRUE(content::ExecuteScript(web_contents, click_fill_card_button_js)); + + const std::string click_submit_button_js = + "(function() { document.getElementById('submit').click(); })();"; + ASSERT_TRUE(content::ExecuteScript(web_contents, click_submit_button_js)); +} + // Should be called for credit_card_upload_form_address_and_cc.html. void SaveCardBubbleViewsBrowserTestBase::FillAndSubmitFormWithoutCvc() { content::WebContents* web_contents = GetActiveWebContents(); @@ -400,20 +374,21 @@ net::HTTP_INTERNAL_SERVER_ERROR, net::URLRequestStatus::FAILED); } -void SaveCardBubbleViewsBrowserTestBase::ClickOnDialogViewWithIdAndWait( - DialogViewId view_id) { - views::View* specified_view = FindViewInBubbleById(view_id); - DCHECK(specified_view); - +void SaveCardBubbleViewsBrowserTestBase::ClickOnDialogView(views::View* view) { + DCHECK(view); ui::MouseEvent pressed(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); - specified_view->OnMousePressed(pressed); + view->OnMousePressed(pressed); ui::MouseEvent released_event = ui::MouseEvent( ui::ET_MOUSE_RELEASED, gfx::Point(), gfx::Point(), ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); - specified_view->OnMouseReleased(released_event); + view->OnMouseReleased(released_event); +} +void SaveCardBubbleViewsBrowserTestBase::ClickOnDialogViewWithIdAndWait( + DialogViewId view_id) { + ClickOnDialogView(FindViewInBubbleById(view_id)); WaitForObservedEvent(); }
diff --git a/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.h b/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.h index 597f7925..2f398c8 100644 --- a/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.h +++ b/chrome/browser/ui/views/autofill/save_card_bubble_views_browsertest_base.h
@@ -50,7 +50,6 @@ const std::string& test_file_path); ~SaveCardBubbleViewsBrowserTestBase() override; - void SetUpCommandLine(base::CommandLine* command_line) override; void SetUpOnMainThread() override; void NavigateTo(const std::string& file_path); @@ -62,15 +61,9 @@ void OnReceivedGetUploadDetailsResponse() override; void OnSentUploadCardRequest() override; - // Experiments. - void DisableRequestCvcIfMissingAndSendDetectedValuesExperiments(); - void DisableSendDetectedValuesExperiment(); - void DisableSecondaryUiMdExperiment(); - void EnableRequestCvcIfMissingExperiment(); - void EnableSecondaryUiMdExperiment(); - // Will call JavaScript to fill and submit the form in different ways. void FillAndSubmitForm(); + void FillAndSubmitFormWithCardDetailsOnly(); void FillAndSubmitFormWithoutCvc(); void FillAndSubmitFormWithInvalidCvc(); void FillAndSubmitFormWithAmexWithoutCvc(); @@ -85,9 +78,14 @@ void SetUploadDetailsRpcPaymentsDeclines(); void SetUploadDetailsRpcServerError(); + // Clicks on the given views::View*. + void ClickOnDialogView(views::View* view); + // Clicks on a view from within the dialog and waits for a certain event to be // observed. void ClickOnDialogViewWithIdAndWait(DialogViewId view_id); + + // Returns the views::View* that was previously assigned the id |view_id|. views::View* FindViewInBubbleById(DialogViewId view_id); // Gets the views::View* instance of the save credit card bubble. @@ -100,10 +98,11 @@ // Wait for the event(s) passed to ResetEventWaiter*() to occur. void WaitForObservedEvent(); + base::test::ScopedFeatureList scoped_feature_list_; + private: std::unique_ptr<DialogEventWaiter<DialogEvent>> event_waiter_; std::unique_ptr<net::FakeURLFetcherFactory> url_fetcher_factory_; - base::test::ScopedFeatureList scoped_feature_list_; const std::string test_file_path_; // FakeGeolocation setup:
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc index 5914b70..a7732de 100644 --- a/chrome/browser/ui/views/create_application_shortcut_view.cc +++ b/chrome/browser/ui/views/create_application_shortcut_view.cc
@@ -50,7 +50,7 @@ quick_launch_check_box_(nullptr), weak_ptr_factory_(this) { set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( - views::TEXT, views::CONTROL)); + views::TEXT, views::TEXT)); InitControls(); // Get shortcut and icon information; needed for creating the shortcut.
diff --git a/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc b/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc index 130ff981..48e06f9 100644 --- a/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc +++ b/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc
@@ -42,7 +42,7 @@ title_tf_(nullptr) { const ChromeLayoutProvider* layout_provider = ChromeLayoutProvider::Get(); set_margins(layout_provider->GetDialogInsetsForContentType(views::CONTROL, - views::CONTROL)); + views::TEXT)); views::GridLayout* layout = SetLayoutManager(std::make_unique<views::GridLayout>(this)); constexpr int kColumnSetId = 0;
diff --git a/chrome/browser/ui/views/external_protocol_dialog.cc b/chrome/browser/ui/views/external_protocol_dialog.cc index a764f63..4e5b17d 100644 --- a/chrome/browser/ui/views/external_protocol_dialog.cc +++ b/chrome/browser/ui/views/external_protocol_dialog.cc
@@ -101,7 +101,7 @@ creation_time_(base::TimeTicks::Now()) { ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); set_margins( - provider->GetDialogInsetsForContentType(views::CONTROL, views::CONTROL)); + provider->GetDialogInsetsForContentType(views::TEXT, views::TEXT)); SetLayoutManager(std::make_unique<views::FillLayout>());
diff --git a/chrome/browser/ui/views/first_run_dialog.cc b/chrome/browser/ui/views/first_run_dialog.cc index 68d39c0..ce5f152 100644 --- a/chrome/browser/ui/views/first_run_dialog.cc +++ b/chrome/browser/ui/views/first_run_dialog.cc
@@ -71,7 +71,7 @@ make_default_(NULL), report_crashes_(NULL) { set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( - views::CONTROL, views::CONTROL)); + views::TEXT, views::TEXT)); GridLayout* layout = SetLayoutManager(std::make_unique<views::GridLayout>(this));
diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc index e42ac9e..5ca1171 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc
@@ -351,6 +351,13 @@ // ash::ShellObserver: void BrowserNonClientFrameViewAsh::OnOverviewModeStarting() { + // Update the window icon so that overview mode can grab the icon from + // aura::client::kWindowIcon to display. + if (base::CommandLine::ForCurrentProcess()->HasSwitch( + ash::switches::kAshEnableNewOverviewUi)) { + frame()->UpdateWindowIcon(); + } + frame()->GetNativeWindow()->SetProperty(aura::client::kTopViewColor, GetFrameColor()); OnOverviewModeChanged(true);
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index d493122..7b04401 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -1682,6 +1682,13 @@ if (browser_->is_app() || browser_->is_type_popup()) return browser_->GetCurrentPageIcon().AsImageSkia(); +#if defined(OS_CHROMEOS) + if (browser_->is_type_tabbed()) { + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); + return rb.GetImageNamed(IDR_PRODUCT_LOGO_32).AsImageSkia(); + } +#endif + return gfx::ImageSkia(); }
diff --git a/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view_layout_unittest.cc b/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view_layout_unittest.cc index 8ba56246..78f7011 100644 --- a/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view_layout_unittest.cc +++ b/chrome/browser/ui/views/frame/desktop_linux_browser_frame_view_layout_unittest.cc
@@ -63,6 +63,7 @@ return gfx::Size(78, 29); } int GetTopAreaHeight() const override { return 0; } + bool UseCustomFrame() const override { return true; } private: DISALLOW_COPY_AND_ASSIGN(TestLayoutDelegate);
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc index d72acddf..c35baec 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -437,6 +437,10 @@ return top_area_height; } +bool OpaqueBrowserFrameView::UseCustomFrame() const { + return frame()->UseCustomFrame(); +} + /////////////////////////////////////////////////////////////////////////////// // OpaqueBrowserFrameView, protected:
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h index 3fa03f1a..24eec1f2 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.h
@@ -101,6 +101,7 @@ bool IsToolbarVisible() const override; gfx::Size GetTabstripPreferredSize() const override; int GetTopAreaHeight() const override; + bool UseCustomFrame() const override; protected: views::ImageButton* minimize_button() const { return minimize_button_; }
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc index aa1aa21..a3e5c0c 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.cc
@@ -183,6 +183,8 @@ } int OpaqueBrowserFrameViewLayout::TitlebarTopThickness(bool restored) const { + if (!delegate_->UseCustomFrame()) + return 0; return (restored || !IsTitleBarCondensed()) ? kTitlebarTopEdgeThickness : FrameBorderThickness(false); }
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h index bbc1baa2..faffb29f 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h
@@ -55,6 +55,9 @@ // Computes the height of the top area of the frame. virtual int GetTopAreaHeight() const = 0; + // Returns true if the window frame is rendered by Chrome. + virtual bool UseCustomFrame() const = 0; + protected: virtual ~OpaqueBrowserFrameViewLayoutDelegate() {} };
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc index 22c6efa..cbbcfd8 100644 --- a/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc +++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc
@@ -75,6 +75,7 @@ return IsTabStripVisible() ? gfx::Size(78, 29) : gfx::Size(); } int GetTopAreaHeight() const override { return 0; } + bool UseCustomFrame() const override { return true; } private: base::string16 window_title_;
diff --git a/chrome/browser/ui/views/uninstall_view.cc b/chrome/browser/ui/views/uninstall_view.cc index c350b99..c791b984 100644 --- a/chrome/browser/ui/views/uninstall_view.cc +++ b/chrome/browser/ui/views/uninstall_view.cc
@@ -31,7 +31,7 @@ user_selection_(*user_selection), quit_closure_(quit_closure) { set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( - views::TEXT, views::CONTROL)); + views::TEXT, views::TEXT)); SetupControls(); }
diff --git a/chrome/browser/ui/webui/chromeos/DEPS b/chrome/browser/ui/webui/chromeos/DEPS index f742e9b..20c74c91 100644 --- a/chrome/browser/ui/webui/chromeos/DEPS +++ b/chrome/browser/ui/webui/chromeos/DEPS
@@ -1,6 +1,4 @@ include_rules = [ - # TODO(mash): Remove. http://crbug.com/678705 - "+ash", "+components/login", "+components/user_manager", "+media/audio/sounds", @@ -11,4 +9,12 @@ "drive_internals_ui\.cc": [ "+components/drive" ], + "keyboard_overlay_ui\.cc": [ + # TODO(mash): Remove. http://crbug.com/770866 + "+ash/shell.h", + ], + "keyboard_overlay_ui_browsertest\.cc": [ + # TODO(mash): Remove. http://crbug.com/770866 + "+ash/accelerators/accelerator_table.h", + ], }
diff --git a/chrome/browser/ui/webui/chromeos/emulator/DEPS b/chrome/browser/ui/webui/chromeos/emulator/DEPS new file mode 100644 index 0000000..d12b86a --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/emulator/DEPS
@@ -0,0 +1,7 @@ +specific_include_rules = { + "device_emulator_message_handler\.cc": [ + # TODO(mash): Remove. http://crbug.com/770866 + "+ash/shell.h", + "+ash/system/bluetooth/tray_bluetooth_helper.h", + ], +}
diff --git a/chrome/browser/ui/webui/chromeos/first_run/DEPS b/chrome/browser/ui/webui/chromeos/first_run/DEPS new file mode 100644 index 0000000..5d44c60 --- /dev/null +++ b/chrome/browser/ui/webui/chromeos/first_run/DEPS
@@ -0,0 +1,7 @@ +specific_include_rules = { + "first_run_ui\.cc": [ + # TODO(mash): Remove. http://crbug.com/770866 + "+ash/shell.h", + "+ash/shelf/shelf.h", + ], +}
diff --git a/chrome/browser/ui/webui/chromeos/login/DEPS b/chrome/browser/ui/webui/chromeos/login/DEPS index 7554fa7..c453b8d 100644 --- a/chrome/browser/ui/webui/chromeos/login/DEPS +++ b/chrome/browser/ui/webui/chromeos/login/DEPS
@@ -1,6 +1,38 @@ +# TODO(mash): Remove ash includes. http://crbug.com/770866 specific_include_rules = { - # TODO(mash): Remove. http://crbug.com/720917. + "core_oobe_handler\.cc": [ + "+ash/shell.h", + ], + "network_dropdown\.cc": [ + "+ash/system/network/network_icon.h", + "+ash/system/network/network_icon_animation.h", + ], + "network_dropdown\.h": [ + "+ash/system/network/network_icon_animation_observer.h", + ], + "oobe_display_chooser\.cc": [ + "+ash/display/window_tree_host_manager.h", + "+ash/shell.h", + ], + "oobe_display_chooser_browsertest\.cc": [ + "+ash/shell.h", + ], "oobe_display_chooser_unittest.cc": [ + "+ash/display/display_configuration_controller.h", + "+ash/shell.h", + "+ash/test/ash_test_base.h", + # TODO(mash): Remove. http://crbug.com/720917. "+ui/events/devices/device_data_manager.h", - ] + ], + "signin_screen_handler\.cc": [ + "+ash/login/ui/login_constants.h", + "+ash/shell.h", + "+ash/wallpaper/wallpaper_controller.h", + ], + "signin_screen_handler\.h": [ + "+ash/wallpaper/wallpaper_controller_observer.h", + ], + "signin_userlist_unittest\.cc": [ + "+ash/test/ash_test_base.h" + ], }
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc index 7b74243c..0abc65a 100644 --- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
@@ -27,6 +27,7 @@ #include "chrome/grit/generated_resources.h" #include "chromeos/chromeos_switches.h" #include "chromeos/cryptohome/async_method_caller.h" +#include "chromeos/cryptohome/cryptohome_util.h" #include "chromeos/cryptohome/homedir_methods.h" #include "chromeos/dbus/cryptohome_client.h" #include "chromeos/dbus/dbus_thread_manager.h" @@ -564,29 +565,24 @@ // Mount the existing eCryptfs vault to a temporary location for migration. cryptohome::MountRequest mount; + cryptohome::AuthorizationRequest auth_request; mount.set_to_migrate_from_ecryptfs(true); if (IsArcKiosk()) { mount.set_public_mount(true); - cryptohome::HomedirMethods::GetInstance()->MountEx( - cryptohome::Identification(user_context_.GetAccountId()), - cryptohome::AuthorizationRequest(), mount, - base::Bind(&EncryptionMigrationScreenHandler::OnMountExistingVault, - weak_ptr_factory_.GetWeakPtr())); - } else { - cryptohome::HomedirMethods::GetInstance()->MountEx( - cryptohome::Identification(user_context_.GetAccountId()), - CreateAuthorizationRequest(), mount, - base::Bind(&EncryptionMigrationScreenHandler::OnMountExistingVault, - weak_ptr_factory_.GetWeakPtr())); + auth_request = CreateAuthorizationRequest(); } + DBusThreadManager::Get()->GetCryptohomeClient()->MountEx( + cryptohome::Identification(user_context_.GetAccountId()), + cryptohome::AuthorizationRequest(), mount, + base::BindOnce(&EncryptionMigrationScreenHandler::OnMountExistingVault, + weak_ptr_factory_.GetWeakPtr())); } void EncryptionMigrationScreenHandler::OnMountExistingVault( - bool success, - cryptohome::MountError return_code, - const std::string& mount_hash) { - if (!success || return_code != cryptohome::MOUNT_ERROR_NONE) { + base::Optional<cryptohome::BaseReply> reply) { + if (cryptohome::BaseReplyToMountError(reply) != + cryptohome::MOUNT_ERROR_NONE) { RecordMigrationResultMountFailure(IsResumingIncompleteMigration(), IsArcKiosk()); UpdateUIState(UIState::MIGRATION_FAILED);
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h index 7afab02..e117c20 100644 --- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h
@@ -15,6 +15,7 @@ #include "chrome/browser/chromeos/login/screens/encryption_migration_screen_view.h" #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" #include "chromeos/cryptohome/cryptohome_parameters.h" +#include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/cryptohome_client.h" #include "chromeos/dbus/power_manager_client.h" #include "chromeos/login/auth/user_context.h" @@ -102,9 +103,7 @@ void OnGetAvailableStorage(int64_t size); void WaitBatteryAndMigrate(); void StartMigration(); - void OnMountExistingVault(bool success, - cryptohome::MountError return_code, - const std::string& mount_hash); + void OnMountExistingVault(base::Optional<cryptohome::BaseReply> reply); // Removes cryptohome and shows the error screen after the removal finishes. void RemoveCryptohome(); void OnRemoveCryptohome(bool success, cryptohome::MountError return_code);
diff --git a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc index de7754d..ef57f7f1 100644 --- a/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc +++ b/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler_unittest.cc
@@ -15,7 +15,6 @@ #include "chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.h" #include "chromeos/cryptohome/homedir_methods.h" #include "chromeos/cryptohome/mock_async_method_caller.h" -#include "chromeos/cryptohome/mock_homedir_methods.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/fake_cryptohome_client.h" #include "chromeos/dbus/fake_power_manager_client.h" @@ -110,33 +109,6 @@ int64_t free_disk_space_; }; -// Fake CryptohomeClient implementation for this test. -class TestCryptohomeClient : public FakeCryptohomeClient { - public: - TestCryptohomeClient() = default; - ~TestCryptohomeClient() override = default; - - const cryptohome::Identification& id() const { return id_; } - - const cryptohome::MigrateToDircryptoRequest& request() const { - return request_; - } - - void MigrateToDircrypto(const cryptohome::Identification& id, - const cryptohome::MigrateToDircryptoRequest& request, - VoidDBusMethodCallback callback) override { - id_ = id; - request_ = request; - FakeCryptohomeClient::MigrateToDircrypto(id, request, std::move(callback)); - } - - private: - cryptohome::Identification id_; - cryptohome::MigrateToDircryptoRequest request_; - - DISALLOW_COPY_AND_ASSIGN(TestCryptohomeClient); -}; - class EncryptionMigrationScreenHandlerTest : public testing::Test { public: EncryptionMigrationScreenHandlerTest() = default; @@ -149,12 +121,6 @@ base::MakeUnique<user_manager::ScopedUserManager>( base::WrapUnique(mock_user_manager)); - // This is used by EncryptionMigrationScreenHandler to mount the existing - // cryptohome. Ownership of mock_homedir_methods_ is transferred to - // HomedirMethods::InitializeForTesting. - mock_homedir_methods_ = new cryptohome::MockHomedirMethods; - cryptohome::HomedirMethods::InitializeForTesting(mock_homedir_methods_); - // This is used by EncryptionMigrationScreenHandler to remove the existing // cryptohome. Ownership of mock_async_method_caller_ is transferred to // AsyncMethodCaller::InitializeForTesting. @@ -163,7 +129,7 @@ mock_async_method_caller_); // Set up fake DBusThreadManager parts. - fake_cryptohome_client_ = new TestCryptohomeClient(); + fake_cryptohome_client_ = new FakeCryptohomeClient(); DBusThreadManager::GetSetterForTesting()->SetCryptohomeClient( base::WrapUnique<CryptohomeClient>(fake_cryptohome_client_)); @@ -200,26 +166,6 @@ PowerPolicyController::Shutdown(); DBusThreadManager::Shutdown(); cryptohome::AsyncMethodCaller::Shutdown(); - cryptohome::HomedirMethods::Shutdown(); - } - - // Sets up expectation that the existing user home will be mounted for - // migration using |mock_homedir_methods_|. - // TODO(crbug.com/741274): Use the fake when homedir_methods is dead. - void ExpectMountExistingVault(cryptohome::MountError mount_error) { - EXPECT_CALL( - *mock_homedir_methods_, - MountEx(cryptohome::Identification( - user_context_.GetAccountId()) /* 0: id */, - _ /* 1: auth */, _ /* 2: request */, _ /* 3: callback */)) - .WillOnce(WithArgs<2, 3>(Invoke( - [mount_error](const cryptohome::MountRequest& mount_request, - cryptohome::HomedirMethods::MountCallback callback) { - // Expect that the migration flag is set. - EXPECT_TRUE(mount_request.to_migrate_from_ecryptfs()); - callback.Run(true /* success */, mount_error, - std::string() /* mount_hash */); - }))); } protected: @@ -227,8 +173,7 @@ base::test::ScopedTaskEnvironment scoped_task_environment_; std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_enabler_; - cryptohome::MockHomedirMethods* mock_homedir_methods_ = nullptr; - TestCryptohomeClient* fake_cryptohome_client_ = nullptr; + FakeCryptohomeClient* fake_cryptohome_client_ = nullptr; cryptohome::MockAsyncMethodCaller* mock_async_method_caller_ = nullptr; std::unique_ptr<TestEncryptionMigrationScreenHandler> encryption_migration_screen_handler_; @@ -271,15 +216,12 @@ // Tests handling of a minimal migration run that finishes immediately. TEST_F(EncryptionMigrationScreenHandlerTest, MinimalMigration) { - ExpectMountExistingVault(cryptohome::MountError::MOUNT_ERROR_NONE); encryption_migration_screen_handler_->SetMode( EncryptionMigrationMode::START_MINIMAL_MIGRATION); encryption_migration_screen_handler_->SetupInitialView(); scoped_task_environment_.RunUntilIdle(); - Mock::VerifyAndClearExpectations(mock_homedir_methods_); - EXPECT_TRUE( encryption_migration_screen_handler_->fake_wake_lock()->HasWakeLock()); fake_cryptohome_client_->NotifyDircryptoMigrationProgress( @@ -289,47 +231,43 @@ EXPECT_TRUE(continue_login_callback_called_); EXPECT_FALSE( encryption_migration_screen_handler_->fake_wake_lock()->HasWakeLock()); - EXPECT_TRUE(fake_cryptohome_client_->request().minimal_migration()); + EXPECT_TRUE(fake_cryptohome_client_->to_migrate_from_ecryptfs()); + EXPECT_TRUE(fake_cryptohome_client_->minimal_migration()); EXPECT_EQ(cryptohome::Identification(user_context_.GetAccountId()), - fake_cryptohome_client_->id()); + fake_cryptohome_client_->get_id_for_disk_migrated_to_dircrypto()); } // Tests handling of a resumed minimal migration run. This should behave the // same way that a freshly started minimal migration does (only UMA stats are // different, but we don't test that at the moment). TEST_F(EncryptionMigrationScreenHandlerTest, ResumeMinimalMigration) { - ExpectMountExistingVault(cryptohome::MountError::MOUNT_ERROR_NONE); encryption_migration_screen_handler_->SetMode( EncryptionMigrationMode::RESUME_MINIMAL_MIGRATION); encryption_migration_screen_handler_->SetupInitialView(); scoped_task_environment_.RunUntilIdle(); - Mock::VerifyAndClearExpectations(mock_homedir_methods_); - fake_cryptohome_client_->NotifyDircryptoMigrationProgress( cryptohome::DircryptoMigrationStatus::DIRCRYPTO_MIGRATION_SUCCESS, 0 /* current */, 0 /* total */); EXPECT_TRUE(continue_login_callback_called_); - EXPECT_TRUE(fake_cryptohome_client_->request().minimal_migration()); + EXPECT_TRUE(fake_cryptohome_client_->to_migrate_from_ecryptfs()); + EXPECT_TRUE(fake_cryptohome_client_->minimal_migration()); EXPECT_EQ(cryptohome::Identification(user_context_.GetAccountId()), - fake_cryptohome_client_->id()); + fake_cryptohome_client_->get_id_for_disk_migrated_to_dircrypto()); } // Tests handling of a minimal migration run that takes a long time to finish. // We expect that EncryptionMigrationScreenHandler will require the user to // re-enter their password. TEST_F(EncryptionMigrationScreenHandlerTest, MinimalMigrationSlow) { - ExpectMountExistingVault(cryptohome::MountError::MOUNT_ERROR_NONE); encryption_migration_screen_handler_->SetMode( EncryptionMigrationMode::START_MINIMAL_MIGRATION); encryption_migration_screen_handler_->SetupInitialView(); scoped_task_environment_.RunUntilIdle(); - Mock::VerifyAndClearExpectations(mock_homedir_methods_); - encryption_migration_screen_handler_->testing_tick_clock()->Advance( base::TimeDelta::FromMinutes(1)); fake_cryptohome_client_->NotifyDircryptoMigrationProgress( @@ -337,22 +275,20 @@ 0 /* current */, 0 /* total */); EXPECT_TRUE(restart_login_callback_called_); - EXPECT_TRUE(fake_cryptohome_client_->request().minimal_migration()); + EXPECT_TRUE(fake_cryptohome_client_->to_migrate_from_ecryptfs()); + EXPECT_TRUE(fake_cryptohome_client_->minimal_migration()); EXPECT_EQ(cryptohome::Identification(user_context_.GetAccountId()), - fake_cryptohome_client_->id()); + fake_cryptohome_client_->get_id_for_disk_migrated_to_dircrypto()); } // Tests handling of a minimal migration run that fails. TEST_F(EncryptionMigrationScreenHandlerTest, MinimalMigrationFails) { - ExpectMountExistingVault(cryptohome::MountError::MOUNT_ERROR_NONE); encryption_migration_screen_handler_->SetMode( EncryptionMigrationMode::START_MINIMAL_MIGRATION); encryption_migration_screen_handler_->SetupInitialView(); scoped_task_environment_.RunUntilIdle(); - Mock::VerifyAndClearExpectations(mock_homedir_methods_); - EXPECT_CALL( *mock_async_method_caller_, AsyncRemove(cryptohome::Identification(user_context_.GetAccountId()), @@ -364,9 +300,10 @@ 0 /* current */, 0 /* total */); Mock::VerifyAndClearExpectations(mock_async_method_caller_); - EXPECT_TRUE(fake_cryptohome_client_->request().minimal_migration()); + EXPECT_TRUE(fake_cryptohome_client_->to_migrate_from_ecryptfs()); + EXPECT_TRUE(fake_cryptohome_client_->minimal_migration()); EXPECT_EQ(cryptohome::Identification(user_context_.GetAccountId()), - fake_cryptohome_client_->id()); + fake_cryptohome_client_->get_id_for_disk_migrated_to_dircrypto()); } } // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc index 492913c..aaca6cae 100644 --- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
@@ -707,13 +707,16 @@ login::SigninPartitionManager* signin_partition_manager = login::SigninPartitionManager::Factory::GetForBrowserContext( Profile::FromWebUI(web_ui())); - signin_partition_manager->StartSigninSession(web_ui()->GetWebContents()); + signin_partition_manager->StartSigninSession( + web_ui()->GetWebContents(), + base::BindOnce(&EnrollmentScreenHandler::DoShowWithPartition, + weak_ptr_factory_.GetWeakPtr())); +} - // Then leave it running forever. +void EnrollmentScreenHandler::DoShowWithPartition( + const std::string& partition_name) { base::DictionaryValue screen_data; - screen_data.SetString( - "webviewPartitionName", - signin_partition_manager->GetCurrentStoragePartitionName()); + screen_data.SetString("webviewPartitionName", partition_name); screen_data.SetString("gaiaUrl", GaiaUrls::GetInstance()->gaia_url().spec()); screen_data.SetString("clientId", GaiaUrls::GetInstance()->oauth2_chrome_client_id());
diff --git a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h index 23b7d798..e97c73e 100644 --- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h
@@ -118,6 +118,9 @@ // Shows the screen. void DoShow(); + // Shows the screen. + void DoShowWithPartition(const std::string& partition_name); + // Returns true if current visible screen is the enrollment sign-in page. bool IsOnEnrollmentScreen() const;
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc index a27ea28..f9d8266 100644 --- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
@@ -300,31 +300,39 @@ } void GaiaScreenHandler::LoadGaia(const GaiaContext& context) { + // Start a new session with SigninPartitionManager, generating a unique + // StoragePartition. + login::SigninPartitionManager* signin_partition_manager = + login::SigninPartitionManager::Factory::GetForBrowserContext( + Profile::FromWebUI(web_ui())); + signin_partition_manager->StartSigninSession( + web_ui()->GetWebContents(), + base::BindOnce(&GaiaScreenHandler::LoadGaiaWithPartition, + weak_factory_.GetWeakPtr(), context)); +} + +void GaiaScreenHandler::LoadGaiaWithPartition( + const GaiaContext& context, + const std::string& partition_name) { std::unique_ptr<std::string> version = std::make_unique<std::string>(); std::unique_ptr<bool> consent = std::make_unique<bool>(); base::OnceClosure get_version_and_consent = base::BindOnce(&GetVersionAndConsent, base::Unretained(version.get()), base::Unretained(consent.get())); base::OnceClosure load_gaia = base::BindOnce( - &GaiaScreenHandler::LoadGaiaWithVersionAndConsent, - weak_factory_.GetWeakPtr(), context, base::Owned(version.release()), - base::Owned(consent.release())); + &GaiaScreenHandler::LoadGaiaWithPartitionAndVersionAndConsent, + weak_factory_.GetWeakPtr(), context, partition_name, + base::Owned(version.release()), base::Owned(consent.release())); base::PostTaskWithTraitsAndReply( FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_VISIBLE}, std::move(get_version_and_consent), std::move(load_gaia)); } -void GaiaScreenHandler::LoadGaiaWithVersionAndConsent( +void GaiaScreenHandler::LoadGaiaWithPartitionAndVersionAndConsent( const GaiaContext& context, + const std::string& partition_name, const std::string* platform_version, const bool* collect_stats_consent) { - // Start a new session with SigninPartitionManager, generating a a unique - // StoragePartition. - login::SigninPartitionManager* signin_partition_manager = - login::SigninPartitionManager::Factory::GetForBrowserContext( - Profile::FromWebUI(web_ui())); - signin_partition_manager->StartSigninSession(web_ui()->GetWebContents()); - base::DictionaryValue params; params.SetBoolean("forceReload", context.force_reload); @@ -400,8 +408,8 @@ // sending device statistics. if (*collect_stats_consent) params.SetString("lsbReleaseBoard", base::SysInfo::GetLsbReleaseBoard()); - params.SetString("webviewPartitionName", - signin_partition_manager->GetCurrentStoragePartitionName()); + + params.SetString("webviewPartitionName", partition_name); frame_state_ = FRAME_STATE_LOADING; CallJS("loadAuthExtension", params);
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h index 7e91022e..749c2de03 100644 --- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
@@ -64,9 +64,16 @@ // Callback that loads GAIA after version and stat consent information has // been retrieved. - void LoadGaiaWithVersionAndConsent(const GaiaContext& context, - const std::string* platform_version, - const bool* collect_stats_consent); + void LoadGaiaWithPartition(const GaiaContext& context, + const std::string& partition_name); + + // Callback that loads GAIA after version and stat consent information has + // been retrieved. + void LoadGaiaWithPartitionAndVersionAndConsent( + const GaiaContext& context, + const std::string& partition_name, + const std::string* platform_version, + const bool* collect_stats_consent); // Sends request to reload Gaia. If |force_reload| is true, request // will be sent in any case, otherwise it will be sent only when Gaia is
diff --git a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc index 4b2ccea6..14d288b 100644 --- a/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc +++ b/chrome/browser/ui/webui/chromeos/login/oobe_ui.cc
@@ -525,15 +525,6 @@ localized_strings->SetString("buildType", "chromium"); #endif - // If we're not doing boot animation then WebUI should trigger - // wallpaper load on boot. - if (base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableBootAnimation)) { - localized_strings->SetString("bootIntoWallpaper", "on"); - } else { - localized_strings->SetString("bootIntoWallpaper", "off"); - } - bool keyboard_driven_oobe = system::InputDeviceSettings::Get()->ForceKeyboardDrivenUINavigation(); localized_strings->SetString("highlightStrength",
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index af4dfdc..f8be2e3 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -357,8 +357,8 @@ builder->Add("launchAppButton", IDS_LAUNCH_APP_BUTTON); builder->Add("restart", IDS_ASH_SHELF_RESTART_BUTTON); builder->Add("shutDown", IDS_ASH_SHELF_SHUTDOWN_BUTTON); - builder->Add("addUser", IDS_ADD_USER_BUTTON); - builder->Add("browseAsGuest", IDS_BROWSE_AS_GUEST_BUTTON); + builder->Add("addUser", IDS_ASH_ADD_USER_BUTTON); + builder->Add("browseAsGuest", IDS_ASH_BROWSE_AS_GUEST_BUTTON); builder->Add("moreOptions", IDS_MORE_OPTIONS_BUTTON); builder->Add("addSupervisedUser", IDS_CREATE_LEGACY_SUPERVISED_USER_MENU_LABEL); @@ -685,7 +685,8 @@ // Skip "update" notification about OFFLINE state from // NetworkStateInformer if previous notification already was // delayed. - if ((state == NetworkStateInformer::OFFLINE || has_pending_auth_ui_) && + if ((state == NetworkStateInformer::OFFLINE || + network_state_ignored_until_proxy_auth_) && !force_update && !update_state_closure_.IsCancelled()) { return; } @@ -693,7 +694,7 @@ update_state_closure_.Cancel(); if ((state == NetworkStateInformer::OFFLINE && !force_update) || - has_pending_auth_ui_) { + network_state_ignored_until_proxy_auth_) { update_state_closure_.Reset( base::Bind(&SigninScreenHandler::UpdateStateInternal, weak_factory_.GetWeakPtr(), @@ -789,7 +790,6 @@ if (is_gaia_loading_timeout) { LOG(WARNING) << "Retry frame load due to loading timeout."; - LOG(ERROR) << "UpdateStateInternal reload 4"; reload_gaia.ScheduleCall(); } @@ -1082,20 +1082,33 @@ const content::NotificationDetails& details) { switch (type) { case chrome::NOTIFICATION_AUTH_NEEDED: { - has_pending_auth_ui_ = true; + network_state_ignored_until_proxy_auth_ = true; break; } - case chrome::NOTIFICATION_AUTH_SUPPLIED: - has_pending_auth_ui_ = false; - // Reload auth extension as proxy credentials are supplied. - if (!IsSigninScreenHiddenByError() && ui_state_ == UI_STATE_GAIA_SIGNIN) - ReloadGaia(true); - update_state_closure_.Cancel(); + case chrome::NOTIFICATION_AUTH_SUPPLIED: { + if (IsGaiaHiddenByError()) { + // Start listening to network state notifications immediately, hoping + // that the network will switch to ONLINE soon. + update_state_closure_.Cancel(); + ReenableNetworkStateUpdatesAfterProxyAuth(); + } else { + // Gaia is not hidden behind an error yet. Discard last cached network + // state notification and wait for |kOfflineTimeoutSec| before + // considering network update notifications again (hoping the network + // will become ONLINE by then). + update_state_closure_.Cancel(); + base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( + FROM_HERE, + base::BindOnce( + &SigninScreenHandler::ReenableNetworkStateUpdatesAfterProxyAuth, + weak_factory_.GetWeakPtr()), + base::TimeDelta::FromSeconds(kOfflineTimeoutSec)); + } break; + } case chrome::NOTIFICATION_AUTH_CANCELLED: { - // Don't reload auth extension if proxy auth dialog was cancelled. - has_pending_auth_ui_ = false; update_state_closure_.Cancel(); + ReenableNetworkStateUpdatesAfterProxyAuth(); break; } default: @@ -1103,6 +1116,10 @@ } } +void SigninScreenHandler::ReenableNetworkStateUpdatesAfterProxyAuth() { + network_state_ignored_until_proxy_auth_ = false; +} + void SigninScreenHandler::SuspendDone(const base::TimeDelta& sleep_duration) { for (user_manager::User* user : user_manager::UserManager::Get()->GetUnlockUsers()) { @@ -1169,7 +1186,12 @@ const user_manager::User* user = user_manager::UserManager::Get()->FindUser(account_id); DCHECK(user); - user_context.SetUserType(user->GetType()); + if (!user) { + LOG(ERROR) << "HandleAuthenticateUser: User not found! account type=" + << AccountId::AccountTypeToString(account_id.GetAccountType()); + } else { + user_context.SetUserType(user->GetType()); + } if (account_id.GetAccountType() == AccountType::ACTIVE_DIRECTORY) user_context.SetUserType(user_manager::USER_TYPE_ACTIVE_DIRECTORY); delegate_->Login(user_context, SigninSpecifics());
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h index 680ab51..d63b0652f 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h
@@ -483,6 +483,10 @@ // Called when the cros property controlling allowed input methods changes. void OnAllowedInputMethodsChanged(); + // After proxy auth information has been supplied, this function re-enables + // responding to network state notifications. + void ReenableNetworkStateUpdatesAfterProxyAuth(); + // Current UI state of the signin screen. UIState ui_state_ = UI_STATE_UNKNOWN; @@ -522,10 +526,10 @@ std::unique_ptr<CrosSettings::ObserverSubscription> allowed_input_methods_subscription_; - // Whether there is an auth UI pending. This flag is set on receiving - // NOTIFICATION_AUTH_NEEDED and reset on either NOTIFICATION_AUTH_SUPPLIED or - // NOTIFICATION_AUTH_CANCELLED. - bool has_pending_auth_ui_ = false; + // Whether we're currently ignoring network state updates because a proxy auth + // UI pending (or we're waiting for a grace period after the proxy auth UI is + // finished for the network to switch into the ONLINE state). + bool network_state_ignored_until_proxy_auth_ = false; // Used for pending GAIA reloads. NetworkError::ErrorReason gaia_reload_reason_ =
diff --git a/chrome/browser/ui/webui/chromeos/system_web_dialog_browsertest.cc b/chrome/browser/ui/webui/chromeos/system_web_dialog_browsertest.cc index fdb0737..24c45fd7 100644 --- a/chrome/browser/ui/webui/chromeos/system_web_dialog_browsertest.cc +++ b/chrome/browser/ui/webui/chromeos/system_web_dialog_browsertest.cc
@@ -4,11 +4,15 @@ #include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h" -#include "ash/shell_port.h" +#include "ash/public/interfaces/constants.mojom.h" +#include "ash/public/interfaces/shell_test_api.mojom.h" #include "chrome/browser/chromeos/login/login_manager_test.h" #include "chrome/browser/chromeos/login/startup_utils.h" #include "chrome/common/webui_url_constants.h" #include "components/signin/core/account_id/account_id.h" +#include "content/public/common/service_manager_connection.h" +#include "services/service_manager/public/cpp/connector.h" +#include "ui/aura/test/mus/change_completion_waiter.h" #include "url/gurl.h" namespace { @@ -16,6 +20,23 @@ constexpr char kTestUser[] = "test-user@gmail.com"; constexpr char kTestUserGaiaId[] = "1234567890"; +// Returns whether a system modal window (e.g. modal dialog) is open. Blocks +// until the ash service responds. +bool IsSystemModalWindowOpen() { + // Wait for window visibility to stabilize. + aura::test::WaitForAllChangesToComplete(); + + // Connect to the ash test interface. + ash::mojom::ShellTestApiPtr shell_test_api; + content::ServiceManagerConnection::GetForProcess() + ->GetConnector() + ->BindInterface(ash::mojom::kServiceName, &shell_test_api); + ash::mojom::ShellTestApiAsyncWaiter waiter(shell_test_api.get()); + bool modal_open = false; + waiter.IsSystemModalWindowOpen(&modal_open); + return modal_open; +} + class SystemWebDialogTest : public chromeos::LoginManagerTest { public: SystemWebDialogTest() : LoginManagerTest(false) {} @@ -40,10 +61,11 @@ } // namespace +// Verifies that system dialogs are modal before login (e.g. during OOBE). IN_PROC_BROWSER_TEST_F(SystemWebDialogTest, ModalTest) { chromeos::SystemWebDialogDelegate* dialog = new MockSystemWebDialog(); dialog->ShowSystemDialog(); - EXPECT_TRUE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(IsSystemModalWindowOpen()); } IN_PROC_BROWSER_TEST_F(SystemWebDialogTest, PRE_NonModalTest) { @@ -51,9 +73,10 @@ chromeos::StartupUtils::MarkOobeCompleted(); } +// Verifies that system dialogs are not modal after login. IN_PROC_BROWSER_TEST_F(SystemWebDialogTest, NonModalTest) { LoginUser(AccountId::FromUserEmailGaiaId(kTestUser, kTestUserGaiaId)); chromeos::SystemWebDialogDelegate* dialog = new MockSystemWebDialog(); dialog->ShowSystemDialog(); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(IsSystemModalWindowOpen()); }
diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc index abf82d1..782d1ed 100644 --- a/chrome/browser/ui/webui/extensions/extensions_ui.cc +++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc
@@ -155,6 +155,10 @@ source->AddLocalizedString("errorsPageHeading", IDS_MD_EXTENSIONS_ERROR_PAGE_HEADING); source->AddLocalizedString("clearAll", IDS_MD_EXTENSIONS_ERROR_CLEAR_ALL); + source->AddLocalizedString("clearEntry", IDS_MD_EXTENSIONS_A11Y_CLEAR_ENTRY); + source->AddLocalizedString("logLevel", IDS_EXTENSIONS_LOG_LEVEL_INFO); + source->AddLocalizedString("warnLevel", IDS_EXTENSIONS_LOG_LEVEL_WARN); + source->AddLocalizedString("errorLevel", IDS_EXTENSIONS_LOG_LEVEL_ERROR); source->AddLocalizedString("anonymousFunction", IDS_MD_EXTENSIONS_ERROR_ANONYMOUS_FUNCTION); source->AddLocalizedString("errorContext", IDS_MD_EXTENSIONS_ERROR_CONTEXT);
diff --git a/chrome/browser/ui/webui/flags_ui.cc b/chrome/browser/ui/webui/flags_ui.cc index f6d30fe..064c363 100644 --- a/chrome/browser/ui/webui/flags_ui.cc +++ b/chrome/browser/ui/webui/flags_ui.cc
@@ -41,6 +41,7 @@ #if defined(OS_CHROMEOS) #include "base/sys_info.h" +#include "chrome/browser/chromeos/login/session/user_session_manager.h" #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos.h" #include "chrome/browser/chromeos/ownership/owner_settings_service_chromeos_factory.h" #include "chrome/browser/chromeos/settings/cros_settings.h" @@ -245,6 +246,11 @@ about_flags::ConvertFlagsToSwitches(flags_storage_.get(), &user_flags, flags_ui::kAddSentinels); + + // Apply additional switches from policy that should not be dropped when + // applying flags.. + chromeos::UserSessionManager::MaybeAppendPolicySwitches(&user_flags); + base::CommandLine::StringVector flags; // argv[0] is the program name |base::CommandLine::NO_PROGRAM|. flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end());
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc index edb172e..baf3bb0 100644 --- a/chrome/browser/ui/webui/print_preview/print_preview_ui.cc +++ b/chrome/browser/ui/webui/print_preview/print_preview_ui.cc
@@ -42,6 +42,7 @@ #include "components/prefs/pref_service.h" #include "components/printing/common/print_messages.h" #include "components/strings/grit/components_strings.h" +#include "components/user_manager/user_manager.h" #include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui_data_source.h" @@ -54,6 +55,12 @@ #include "ui/web_dialogs/web_dialog_delegate.h" #include "ui/web_dialogs/web_dialog_ui.h" +#if defined(OS_CHROMEOS) +#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" +#elif defined(OS_WIN) +#include "base/win/win_util.h" +#endif + using content::WebContents; using printing::PageSizeMargins; @@ -167,6 +174,7 @@ void AddPrintPreviewStrings(content::WebUIDataSource* source) { source->AddLocalizedString("title", IDS_PRINT_PREVIEW_TITLE); + source->AddLocalizedString("learnMore", IDS_LEARN_MORE); source->AddLocalizedString("loading", IDS_PRINT_PREVIEW_LOADING); source->AddLocalizedString("noPlugin", IDS_PRINT_PREVIEW_NO_PLUGIN); source->AddLocalizedString("launchNativeDialog", @@ -174,6 +182,8 @@ source->AddLocalizedString("previewFailed", IDS_PRINT_PREVIEW_FAILED); source->AddLocalizedString("invalidPrinterSettings", IDS_PRINT_INVALID_PRINTER_SETTINGS); + source->AddLocalizedString("unsupportedCloudPrinter", + IDS_PRINT_PREVIEW_UNSUPPORTED_CLOUD_PRINTER); source->AddLocalizedString("printButton", IDS_PRINT_PREVIEW_PRINT_BUTTON); source->AddLocalizedString("saveButton", IDS_PRINT_PREVIEW_SAVE_BUTTON); source->AddLocalizedString("printing", IDS_PRINT_PREVIEW_PRINTING); @@ -304,6 +314,8 @@ source->AddLocalizedString("offlineForWeek", IDS_PRINT_PREVIEW_OFFLINE_FOR_WEEK); source->AddLocalizedString("offline", IDS_PRINT_PREVIEW_OFFLINE); + source->AddLocalizedString("noLongerSupported", + IDS_PRINT_PREVIEW_NO_LONGER_SUPPORTED); source->AddLocalizedString("couldNotPrint", IDS_PRINT_PREVIEW_COULD_NOT_PRINT); source->AddLocalizedString("registerPromoButtonText", @@ -394,6 +406,16 @@ prefs::kPrintPreviewUseSystemDefaultPrinter); source->AddBoolean("useSystemDefaultPrinter", system_default_printer); #endif + + bool enterprise_managed = false; +#if defined(OS_CHROMEOS) + policy::BrowserPolicyConnectorChromeOS* connector = + g_browser_process->platform_part()->browser_policy_connector_chromeos(); + enterprise_managed = connector->IsEnterpriseManaged(); +#elif defined(OS_WIN) + enterprise_managed = base::win::IsEnterpriseManaged(); +#endif + source->AddBoolean("isEnterpriseManaged", enterprise_managed); } content::WebUIDataSource* CreateNewPrintPreviewUISource(Profile* profile) {
diff --git a/chrome/browser/ui/webui/settings/DEPS b/chrome/browser/ui/webui/settings/DEPS deleted file mode 100644 index 72e2db9..0000000 --- a/chrome/browser/ui/webui/settings/DEPS +++ /dev/null
@@ -1,4 +0,0 @@ -include_rules = [ - # TODO(mash): Remove. http://crbug.com/644348 - "+ash/system/power", -]
diff --git a/chrome/browser/ui/webui/settings/chromeos/DEPS b/chrome/browser/ui/webui/settings/chromeos/DEPS new file mode 100644 index 0000000..9f60b59 --- /dev/null +++ b/chrome/browser/ui/webui/settings/chromeos/DEPS
@@ -0,0 +1,6 @@ +specific_include_rules = { + "device_power_handler(|_unittest)\.(h|cc)": [ + # TODO(mash): Remove. http://crbug.com/770866 + "+ash/system/power/power_status.h", + ], +}
diff --git a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc index ceb6baa..9e52afd 100644 --- a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc +++ b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
@@ -571,8 +571,8 @@ // model. bool found = false; for (const auto& resolved_printer : resolved_printers_[ppd_manufacturer]) { - if (resolved_printer.first == ppd_model) { - *printer->mutable_ppd_reference() = resolved_printer.second; + if (resolved_printer.name == ppd_model) { + *(printer->mutable_ppd_reference()) = resolved_printer.ppd_ref; found = true; break; } @@ -749,7 +749,7 @@ if (result_code == PpdProvider::SUCCESS) { resolved_printers_[manufacturer] = printers; for (const auto& printer : printers) { - printers_value->AppendString(printer.first); + printers_value->AppendString(printer.name); } } base::DictionaryValue response;
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc index 3eb0679..72823519 100644 --- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -651,8 +651,8 @@ base::CommandLine::ForCurrentProcess()->HasSwitch( ::switches::kEnableUnifiedDesktop)); html_source->AddBoolean("multiMirroringAvailable", - base::CommandLine::ForCurrentProcess()->HasSwitch( - ::switches::kEnableMultiMirroring)); + !base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kDisableMultiMirroring)); html_source->AddBoolean( "enableTouchCalibrationSetting", @@ -792,6 +792,10 @@ IDS_SETTINGS_RESET_CLEANUP_TRY_AGAIN_BUTTON_LABEL}, {"chromeCleanupTitleLogsPermissionExplanation", IDS_SETTINGS_RESET_CLEANUP_LOGS_PERMISSION_EXPLANATION}, + {"chromeCleanupTitleCleanupUnavailable", + IDS_SETTINGS_RESET_CLEANUP_TITLE_CLEANUP_UNAVAILABLE}, + {"chromeCleanupExplanationCleanupUnavailable", + IDS_SETTINGS_RESET_CLEANUP_EXPLANATION_CLEANUP_UNAVAILABLE}, }; AddLocalizedStringsBulk(html_source, localized_strings,
diff --git a/chrome/browser/ui/webui/settings/md_settings_ui.cc b/chrome/browser/ui/webui/settings/md_settings_ui.cc index 31915a45..41b7383 100644 --- a/chrome/browser/ui/webui/settings/md_settings_ui.cc +++ b/chrome/browser/ui/webui/settings/md_settings_ui.cc
@@ -64,7 +64,6 @@ #if defined(OS_CHROMEOS) #include "ash/public/cpp/stylus_utils.h" -#include "ash/system/power/power_status.h" #include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" #include "chrome/browser/ui/ash/ash_util.h"
diff --git a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc index 798751e..47380ec 100644 --- a/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc +++ b/chrome/browser/ui/webui/signin/user_manager_screen_handler.cc
@@ -771,7 +771,6 @@ l10n_util::GetStringUTF16(IDS_LOGIN_POD_USER_REMOVE_WARNING_BUTTON)); localized_strings->SetString("passwordFieldAccessibleName", l10n_util::GetStringUTF16(IDS_LOGIN_POD_PASSWORD_FIELD_ACCESSIBLE_NAME)); - localized_strings->SetString("bootIntoWallpaper", "off"); // For AccountPickerScreen, the remove user warning overlay. localized_strings->SetString("removeUserWarningButtonTitle",
diff --git a/chrome/browser/vr/BUILD.gn b/chrome/browser/vr/BUILD.gn index c9ffe9d..df58521c 100644 --- a/chrome/browser/vr/BUILD.gn +++ b/chrome/browser/vr/BUILD.gn
@@ -17,10 +17,10 @@ sources = [ "animation_player.cc", "animation_player.h", - "assets.cc", - "assets.h", "assets_component_update_status.h", "assets_load_status.h", + "assets_loader.cc", + "assets_loader.h", "browser_ui_interface.h", "content_input_delegate.cc", "content_input_delegate.h", @@ -35,8 +35,6 @@ "elements/audio_permission_prompt.h", "elements/audio_permission_prompt_texture.cc", "elements/audio_permission_prompt_texture.h", - "elements/background.cc", - "elements/background.h", "elements/button.cc", "elements/button.h", "elements/content_element.cc", @@ -48,14 +46,18 @@ "elements/disc_button.h", "elements/draw_phase.cc", "elements/draw_phase.h", + "elements/environment/background.cc", + "elements/environment/background.h", + "elements/environment/grid.cc", + "elements/environment/grid.h", + "elements/environment/stars.cc", + "elements/environment/stars.h", "elements/exit_prompt.cc", "elements/exit_prompt.h", "elements/exit_prompt_texture.cc", "elements/exit_prompt_texture.h", "elements/full_screen_rect.cc", "elements/full_screen_rect.h", - "elements/grid.cc", - "elements/grid.h", "elements/invisible_hit_target.cc", "elements/invisible_hit_target.h", "elements/keyboard.cc", @@ -68,6 +70,8 @@ "elements/rect.h", "elements/render_text_wrapper.cc", "elements/render_text_wrapper.h", + "elements/repositioner.cc", + "elements/repositioner.h", "elements/reticle.cc", "elements/reticle.h", "elements/scaled_depth_adjuster.cc", @@ -126,6 +130,8 @@ "metrics_helper.cc", "metrics_helper.h", "mode.h", + "model/assets.cc", + "model/assets.h", "model/camera_model.h", "model/color_scheme.cc", "model/color_scheme.h", @@ -199,12 +205,14 @@ "web_contents_event_forwarder.h", ] + public_deps = [ + "//ui/gl", + ] + if (enable_gvr_services) { sources += [ "controller_mesh.cc" ] - public_deps = [ - "//chrome/browser/resources:vr_shell_resources", - ] + public_deps += [ "//chrome/browser/resources:vr_shell_resources" ] } deps = [ @@ -228,7 +236,6 @@ "//skia", "//ui/base", "//ui/display", - "//ui/gl", "//ui/gl/init", ] } @@ -242,6 +249,7 @@ "elements/exit_prompt_unittest.cc", "elements/linear_layout_unittest.cc", "elements/rect_unittest.cc", + "elements/repositioner_unittest.cc", "elements/scaled_depth_adjuster_unittest.cc", "elements/shadow_unittest.cc", "elements/spinner_unittest.cc",
diff --git a/chrome/browser/vr/assets.cc b/chrome/browser/vr/assets.cc deleted file mode 100644 index 30cb1ba0..0000000 --- a/chrome/browser/vr/assets.cc +++ /dev/null
@@ -1,176 +0,0 @@ -// Copyright 2017 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/vr/assets.h" - -#include "base/files/file_util.h" -#include "base/memory/singleton.h" -#include "base/task_scheduler/post_task.h" -#include "base/task_scheduler/task_traits.h" -#include "base/threading/thread_task_runner_handle.h" -#include "base/values.h" -#include "base/version.h" -#include "chrome/browser/vr/metrics_helper.h" -#include "content/public/browser/browser_thread.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "ui/gfx/codec/jpeg_codec.h" -#include "ui/gfx/codec/png_codec.h" - -namespace vr { - -namespace { - -static const base::FilePath::CharType kBackgroundFileNamePng[] = - FILE_PATH_LITERAL("background.png"); -static const base::FilePath::CharType kBackgroundFileNameJpeg[] = - FILE_PATH_LITERAL("background.jpeg"); - -} // namespace - -struct AssetsSingletonTrait : public base::DefaultSingletonTraits<Assets> { - static Assets* New() { return new Assets(); } - static void Delete(Assets* assets) { delete assets; } -}; - -// static -Assets* Assets::GetInstance() { - return base::Singleton<Assets, AssetsSingletonTrait>::get(); -} - -void Assets::OnComponentReady(const base::Version& version, - const base::FilePath& install_dir, - std::unique_ptr<base::DictionaryValue> manifest) { - main_thread_task_runner_->PostTask( - FROM_HERE, - base::BindOnce(&Assets::OnComponentReadyInternal, - weak_ptr_factory_.GetWeakPtr(), version, install_dir)); -} - -void Assets::Load(OnAssetsLoadedCallback on_loaded) { - main_thread_task_runner_->PostTask( - FROM_HERE, - base::BindOnce(&Assets::LoadInternal, weak_ptr_factory_.GetWeakPtr(), - base::ThreadTaskRunnerHandle::Get(), - std::move(on_loaded))); -} - -MetricsHelper* Assets::GetMetricsHelper() { - // If we instantiate metrics_helper_ in the constructor all functions of - // MetricsHelper must be called in a valid sequence from the thread the - // constructor ran on. However, the assets class can be instantiated from any - // thread. To avoid the aforementioned restriction, create metrics_helper_ the - // first time it is used and, thus, give the caller control over when the - // sequence starts. - if (!metrics_helper_) { - metrics_helper_ = base::MakeUnique<MetricsHelper>(); - } - return metrics_helper_.get(); -} - -bool Assets::ComponentReady() { - DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); - return component_ready_; -} - -void Assets::SetOnComponentReadyCallback( - const base::RepeatingCallback<void()>& on_component_ready) { - DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); - on_component_ready_callback_ = on_component_ready; -} - -// static -void Assets::LoadAssetsTask( - scoped_refptr<base::SingleThreadTaskRunner> task_runner, - const base::Version& component_version, - const base::FilePath& component_install_dir, - OnAssetsLoadedCallback on_loaded) { - std::string background_file_content; - base::FilePath background_file_path; - bool is_png = false; - - if (base::PathExists(component_install_dir.Append(kBackgroundFileNamePng))) { - background_file_path = component_install_dir.Append(kBackgroundFileNamePng); - is_png = true; - } else if (base::PathExists( - component_install_dir.Append(kBackgroundFileNameJpeg))) { - background_file_path = - component_install_dir.Append(kBackgroundFileNameJpeg); - } else { - task_runner->PostTask( - FROM_HERE, - base::BindOnce(std::move(on_loaded), AssetsLoadStatus::kNotFound, - nullptr, component_version)); - return; - } - - if (!base::ReadFileToString(background_file_path, &background_file_content)) { - task_runner->PostTask( - FROM_HERE, - base::BindOnce(std::move(on_loaded), AssetsLoadStatus::kParseFailure, - nullptr, component_version)); - return; - } - - std::unique_ptr<SkBitmap> background_image; - if (is_png) { - background_image = base::MakeUnique<SkBitmap>(); - if (!gfx::PNGCodec::Decode(reinterpret_cast<const unsigned char*>( - background_file_content.data()), - background_file_content.size(), - background_image.get())) { - background_image = nullptr; - } - } else { - background_image = gfx::JPEGCodec::Decode( - reinterpret_cast<const unsigned char*>(background_file_content.data()), - background_file_content.size()); - } - - if (!background_image) { - task_runner->PostTask( - FROM_HERE, - base::BindOnce(std::move(on_loaded), AssetsLoadStatus::kInvalidContent, - nullptr, component_version)); - return; - } - - task_runner->PostTask( - FROM_HERE, - base::BindOnce(std::move(on_loaded), AssetsLoadStatus::kSuccess, - std::move(background_image), component_version)); -} - -Assets::Assets() - : main_thread_task_runner_(content::BrowserThread::GetTaskRunnerForThread( - content::BrowserThread::UI)), - weak_ptr_factory_(this) { - DCHECK(main_thread_task_runner_.get()); -} - -Assets::~Assets() = default; - -void Assets::OnComponentReadyInternal(const base::Version& version, - const base::FilePath& install_dir) { - DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); - component_version_ = version; - component_install_dir_ = install_dir; - component_ready_ = true; - if (on_component_ready_callback_) { - on_component_ready_callback_.Run(); - } - GetMetricsHelper()->OnComponentReady(version); -} - -void Assets::LoadInternal( - scoped_refptr<base::SingleThreadTaskRunner> task_runner, - OnAssetsLoadedCallback on_loaded) { - DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); - DCHECK(component_ready_); - base::PostTaskWithTraits( - FROM_HERE, {base::TaskPriority::BACKGROUND, base::MayBlock()}, - base::BindOnce(&Assets::LoadAssetsTask, task_runner, component_version_, - component_install_dir_, std::move(on_loaded))); -} - -} // namespace vr
diff --git a/chrome/browser/vr/assets_loader.cc b/chrome/browser/vr/assets_loader.cc new file mode 100644 index 0000000..e31628d1 --- /dev/null +++ b/chrome/browser/vr/assets_loader.cc
@@ -0,0 +1,207 @@ +// Copyright 2017 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/vr/assets_loader.h" + +#include "base/files/file_util.h" +#include "base/memory/singleton.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_traits.h" +#include "base/threading/thread_task_runner_handle.h" +#include "base/values.h" +#include "base/version.h" +#include "chrome/browser/vr/metrics_helper.h" +#include "chrome/browser/vr/model/assets.h" +#include "content/public/browser/browser_thread.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "ui/gfx/codec/jpeg_codec.h" +#include "ui/gfx/codec/png_codec.h" + +namespace vr { + +namespace { + +static const base::FilePath::CharType kBackgroundBaseFilename[] = + FILE_PATH_LITERAL("background"); +static const base::FilePath::CharType kNormalGradientBaseFilename[] = + FILE_PATH_LITERAL("normal_gradient"); +static const base::FilePath::CharType kIncognitoGradientBaseFilename[] = + FILE_PATH_LITERAL("incognito_gradient"); +static const base::FilePath::CharType kFullscreenGradientBaseFilename[] = + FILE_PATH_LITERAL("fullscreen_gradient"); +static const base::FilePath::CharType kPngExtension[] = + FILE_PATH_LITERAL("png"); +static const base::FilePath::CharType kJpegExtension[] = + FILE_PATH_LITERAL("jpeg"); + +constexpr uint32_t kMinMinorVersionWithGradients = 1; +constexpr uint32_t kMinMajorVersionWithGradients = 1; + +} // namespace + +struct AssetsLoaderSingletonTrait + : public base::DefaultSingletonTraits<AssetsLoader> { + static AssetsLoader* New() { return new AssetsLoader(); } + static void Delete(AssetsLoader* assets) { delete assets; } +}; + +// static +AssetsLoader* AssetsLoader::GetInstance() { + return base::Singleton<AssetsLoader, AssetsLoaderSingletonTrait>::get(); +} + +void AssetsLoader::OnComponentReady( + const base::Version& version, + const base::FilePath& install_dir, + std::unique_ptr<base::DictionaryValue> manifest) { + main_thread_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(&AssetsLoader::OnComponentReadyInternal, + weak_ptr_factory_.GetWeakPtr(), version, install_dir)); +} + +void AssetsLoader::Load(OnAssetsLoadedCallback on_loaded) { + main_thread_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&AssetsLoader::LoadInternal, + weak_ptr_factory_.GetWeakPtr(), + base::ThreadTaskRunnerHandle::Get(), + std::move(on_loaded))); +} + +MetricsHelper* AssetsLoader::GetMetricsHelper() { + // If we instantiate metrics_helper_ in the constructor all functions of + // MetricsHelper must be called in a valid sequence from the thread the + // constructor ran on. However, the assets class can be instantiated from any + // thread. To avoid the aforementioned restriction, create metrics_helper_ the + // first time it is used and, thus, give the caller control over when the + // sequence starts. + if (!metrics_helper_) { + metrics_helper_ = base::MakeUnique<MetricsHelper>(); + } + return metrics_helper_.get(); +} + +bool AssetsLoader::ComponentReady() { + DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); + return component_ready_; +} + +void AssetsLoader::SetOnComponentReadyCallback( + const base::RepeatingCallback<void()>& on_component_ready) { + DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); + on_component_ready_callback_ = on_component_ready; +} + +AssetsLoadStatus LoadImage(const base::FilePath& component_install_dir, + const base::FilePath::CharType* base_file, + std::unique_ptr<SkBitmap>* out_image) { + bool is_png = false; + std::string encoded_file_content; + + base::FilePath file_path = component_install_dir.Append(base_file); + + if (base::PathExists(file_path.AddExtension(kPngExtension))) { + file_path = file_path.AddExtension(kPngExtension); + is_png = true; + } else if (base::PathExists(file_path.AddExtension(kJpegExtension))) { + file_path = file_path.AddExtension(kJpegExtension); + } else { + return AssetsLoadStatus::kNotFound; + } + + if (!base::ReadFileToString(file_path, &encoded_file_content)) { + return AssetsLoadStatus::kParseFailure; + } + + if (is_png) { + (*out_image) = base::MakeUnique<SkBitmap>(); + if (!gfx::PNGCodec::Decode( + reinterpret_cast<const unsigned char*>(encoded_file_content.data()), + encoded_file_content.size(), out_image->get())) { + out_image->reset(); + } + } else { + (*out_image) = gfx::JPEGCodec::Decode( + reinterpret_cast<const unsigned char*>(encoded_file_content.data()), + encoded_file_content.size()); + } + + if (!out_image->get()) { + return AssetsLoadStatus::kInvalidContent; + } + + return AssetsLoadStatus::kSuccess; +} + +// static +void AssetsLoader::LoadAssetsTask( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + const base::Version& component_version, + const base::FilePath& component_install_dir, + OnAssetsLoadedCallback on_loaded) { + auto assets = base::MakeUnique<Assets>(); + AssetsLoadStatus status = AssetsLoadStatus::kSuccess; + + status = LoadImage(component_install_dir, kBackgroundBaseFilename, + &assets->background); + + if (component_version.components()[0] >= kMinMajorVersionWithGradients && + component_version.components()[1] >= kMinMinorVersionWithGradients) { + if (status == AssetsLoadStatus::kSuccess) { + status = LoadImage(component_install_dir, kNormalGradientBaseFilename, + &assets->normal_gradient); + } + if (status == AssetsLoadStatus::kSuccess) { + status = LoadImage(component_install_dir, kIncognitoGradientBaseFilename, + &assets->incognito_gradient); + } + if (status == AssetsLoadStatus::kSuccess) { + status = LoadImage(component_install_dir, kFullscreenGradientBaseFilename, + &assets->fullscreen_gradient); + } + } + + if (status != AssetsLoadStatus::kSuccess) { + assets.reset(); + } + + task_runner->PostTask( + FROM_HERE, base::BindOnce(std::move(on_loaded), status, std::move(assets), + component_version)); +} + +AssetsLoader::AssetsLoader() + : main_thread_task_runner_(content::BrowserThread::GetTaskRunnerForThread( + content::BrowserThread::UI)), + weak_ptr_factory_(this) { + DCHECK(main_thread_task_runner_.get()); +} + +AssetsLoader::~AssetsLoader() = default; + +void AssetsLoader::OnComponentReadyInternal(const base::Version& version, + const base::FilePath& install_dir) { + DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); + component_version_ = version; + component_install_dir_ = install_dir; + component_ready_ = true; + if (on_component_ready_callback_) { + on_component_ready_callback_.Run(); + } + GetMetricsHelper()->OnComponentReady(version); +} + +void AssetsLoader::LoadInternal( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + OnAssetsLoadedCallback on_loaded) { + DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); + DCHECK(component_ready_); + base::PostTaskWithTraits( + FROM_HERE, {base::TaskPriority::BACKGROUND, base::MayBlock()}, + base::BindOnce(&AssetsLoader::LoadAssetsTask, task_runner, + component_version_, component_install_dir_, + std::move(on_loaded))); +} + +} // namespace vr
diff --git a/chrome/browser/vr/assets.h b/chrome/browser/vr/assets_loader.h similarity index 86% rename from chrome/browser/vr/assets.h rename to chrome/browser/vr/assets_loader.h index 352ad82..70eeb66 100644 --- a/chrome/browser/vr/assets.h +++ b/chrome/browser/vr/assets_loader.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_VR_ASSETS_H_ -#define CHROME_BROWSER_VR_ASSETS_H_ +#ifndef CHROME_BROWSER_VR_ASSETS_LOADER_H_ +#define CHROME_BROWSER_VR_ASSETS_LOADER_H_ #include <stdint.h> #include <memory> @@ -14,8 +14,6 @@ #include "base/version.h" #include "chrome/browser/vr/assets_load_status.h" -class SkBitmap; - namespace base { class DictionaryValue; class SingleThreadTaskRunner; @@ -27,7 +25,8 @@ constexpr uint32_t kCompatibleMajorVrAssetsComponentVersion = 1; class MetricsHelper; -struct AssetsSingletonTrait; +struct AssetsLoaderSingletonTrait; +struct Assets; // Manages VR assets such as the environment. Gets updated by the VR assets // component. @@ -36,16 +35,16 @@ // component will be made available on a different thread than the asset load // request. Internally, the function calls will be posted on the main thread. // The asset load may be performed on a worker thread. -class Assets { +class AssetsLoader { public: typedef base::OnceCallback<void(AssetsLoadStatus status, - std::unique_ptr<SkBitmap> background_image, + std::unique_ptr<Assets> assets, const base::Version& component_version)> OnAssetsLoadedCallback; typedef base::RepeatingCallback<void()> OnComponentReadyCallback; // Returns the single assets instance and creates it on first call. - static Assets* GetInstance(); + static AssetsLoader* GetInstance(); // Tells VR assets that a new VR assets component version is ready for use. void OnComponentReady(const base::Version& version, @@ -75,8 +74,8 @@ const base::FilePath& component_install_dir, OnAssetsLoadedCallback on_loaded); - Assets(); - ~Assets(); + AssetsLoader(); + ~AssetsLoader(); void OnComponentReadyInternal(const base::Version& version, const base::FilePath& install_dir); void LoadInternal(scoped_refptr<base::SingleThreadTaskRunner> task_runner, @@ -89,11 +88,11 @@ std::unique_ptr<MetricsHelper> metrics_helper_; OnComponentReadyCallback on_component_ready_callback_; - base::WeakPtrFactory<Assets> weak_ptr_factory_; + base::WeakPtrFactory<AssetsLoader> weak_ptr_factory_; - friend struct AssetsSingletonTrait; + friend struct AssetsLoaderSingletonTrait; }; } // namespace vr -#endif // CHROME_BROWSER_VR_ASSETS_H_ +#endif // CHROME_BROWSER_VR_ASSETS_LOADER_H_
diff --git a/chrome/browser/vr/databinding/binding.h b/chrome/browser/vr/databinding/binding.h index 1904a979..7dbf0f2 100644 --- a/chrome/browser/vr/databinding/binding.h +++ b/chrome/browser/vr/databinding/binding.h
@@ -104,28 +104,26 @@ // VR_BIND_FUNC(int, MyModel, &m, source, MyView, &v, SetAwesomeness); // #ifndef NDEBUG -#define VR_BIND(T, M, m, Get, V, v, Set) \ - base::MakeUnique<Binding<T>>( \ - base::BindRepeating([](M* model) { return model->Get; }, \ - base::Unretained(m)), \ - #Get, \ - base::BindRepeating([](V* view, const T& value) { view->Set; }, \ - base::Unretained(v)), \ +#define VR_BIND(T, M, m, Get, V, v, Set) \ + base::MakeUnique<Binding<T>>( \ + base::BindRepeating([](M* model) { return Get; }, base::Unretained(m)), \ + #Get, \ + base::BindRepeating([](V* view, const T& value) { Set; }, \ + base::Unretained(v)), \ #Set) #else -#define VR_BIND(T, M, m, Get, V, v, Set) \ - base::MakeUnique<Binding<T>>( \ - base::BindRepeating([](M* model) { return model->Get; }, \ - base::Unretained(m)), \ - base::BindRepeating([](V* view, const T& value) { view->Set; }, \ +#define VR_BIND(T, M, m, Get, V, v, Set) \ + base::MakeUnique<Binding<T>>( \ + base::BindRepeating([](M* model) { return Get; }, base::Unretained(m)), \ + base::BindRepeating([](V* view, const T& value) { Set; }, \ base::Unretained(v))) #endif #define VR_BIND_FUNC(T, M, m, Get, V, v, f) \ - VR_BIND(T, M, m, Get, V, v, f(value)) + VR_BIND(T, M, m, Get, V, v, view->f(value)) #define VR_BIND_FIELD(T, M, m, Get, V, v, f) \ - VR_BIND(T, M, m, Get, V, v, f = value) + VR_BIND(T, M, m, Get, V, v, view->f = value) #define VR_BIND_LAMBDA(...) base::BindRepeating(__VA_ARGS__), #__VA_ARGS__
diff --git a/chrome/browser/vr/databinding/binding_unittest.cc b/chrome/browser/vr/databinding/binding_unittest.cc index bba4517..3515a94 100644 --- a/chrome/browser/vr/databinding/binding_unittest.cc +++ b/chrome/browser/vr/databinding/binding_unittest.cc
@@ -29,7 +29,8 @@ TestView b; b.value = false; - b.binding = VR_BIND_FIELD(bool, TestModel, &a, value, TestView, &b, value); + b.binding = + VR_BIND_FIELD(bool, TestModel, &a, model->value, TestView, &b, value); EXPECT_NE(a.value, b.value); b.binding->Update();
diff --git a/chrome/browser/vr/elements/background.cc b/chrome/browser/vr/elements/background.cc deleted file mode 100644 index 5f27982d..0000000 --- a/chrome/browser/vr/elements/background.cc +++ /dev/null
@@ -1,174 +0,0 @@ -// Copyright 2017 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/vr/elements/background.h" - -#include "base/memory/ptr_util.h" -#include "chrome/browser/vr/skia_surface_provider.h" -#include "chrome/browser/vr/ui_element_renderer.h" -#include "chrome/browser/vr/vr_gl_util.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "third_party/skia/include/core/SkCanvas.h" -#include "third_party/skia/include/core/SkSurface.h" - -namespace vr { - -namespace { - -// On the background sphere, this is the number of faces between poles. -int kSteps = 20; - -// clang-format off -constexpr char const* kVertexShader = SHADER( - precision mediump float; - uniform mat4 u_ModelViewProjMatrix; - attribute vec2 a_TexCoordinate; - varying vec2 v_TexCoordinate; - - void main() { - vec4 sphereVertex; - float theta = a_TexCoordinate.x * 6.28319; - float phi = a_TexCoordinate.y * 3.14159; - - // Place the background at 1000 m, an arbitrary large distance. This - // nullifies the translational portion of eye transforms, which is what we - // want for ODS backgrounds. - sphereVertex.x = 1000. * -cos(theta) * sin(phi); - sphereVertex.y = 1000. * cos(phi); - sphereVertex.z = 1000. * -sin(theta) * sin(phi); - sphereVertex.w = 1.0; - - gl_Position = u_ModelViewProjMatrix * sphereVertex; - v_TexCoordinate = a_TexCoordinate; - } -); - -constexpr char const* kFragmentShader = SHADER( - precision mediump float; - uniform sampler2D u_Texture; - varying vec2 v_TexCoordinate; - - void main() { - gl_FragColor = texture2D(u_Texture, v_TexCoordinate); - } -); -/* clang-format on */ - -} // namespace - -Background::Background() { - set_hit_testable(false); -} -Background::~Background() = default; - -void Background::Render(UiElementRenderer* renderer, - const CameraModel& model) const { - if (texture_handle_ != 0) { - renderer->DrawBackground(model.view_proj_matrix * world_space_transform(), - texture_handle_); - } -} - -void Background::Initialize(SkiaSurfaceProvider* provider) { - provider_ = provider; - if (initialization_bitmap_) - CreateTexture(); -} - -void Background::SetImage(std::unique_ptr<SkBitmap> bitmap) { - initialization_bitmap_ = std::move(bitmap); - if (provider_) - CreateTexture(); -} - -void Background::CreateTexture() { - DCHECK(provider_); - DCHECK(initialization_bitmap_); - - // The bitmap data is thrown away after the texture is generated. - auto bitmap = std::move(initialization_bitmap_); - - surface_ = provider_->MakeSurface({bitmap->width(), bitmap->height()}); - DCHECK(surface_.get()); - SkCanvas* canvas = surface_->getCanvas(); - canvas->drawBitmap(*bitmap, 0, 0); - texture_handle_ = provider_->FlushSurface(surface_.get(), texture_handle_); -} - -Background::Renderer::Renderer() - : BaseRenderer(kVertexShader, kFragmentShader) { - model_view_proj_matrix_handle_ = - glGetUniformLocation(program_handle_, "u_ModelViewProjMatrix"); - position_handle_ = glGetAttribLocation(program_handle_, "a_TexCoordinate"); - tex_uniform_handle_ = glGetUniformLocation(program_handle_, "u_Texture"); - - // Build the set of texture points representing the sphere. - std::vector<float> vertices; - for (int x = 0; x <= 2 * kSteps; x++) { - for (int y = 0; y <= kSteps; y++) { - vertices.push_back(static_cast<float>(x) / (kSteps * 2)); - vertices.push_back(static_cast<float>(y) / kSteps); - } - } - std::vector<GLushort> indices; - int y_stride = kSteps + 1; - for (int x = 0; x < 2 * kSteps; x++) { - for (int y = 0; y < kSteps; y++) { - GLushort p0 = x * y_stride + y; - GLushort p1 = x * y_stride + y + 1; - GLushort p2 = (x + 1) * y_stride + y; - GLushort p3 = (x + 1) * y_stride + y + 1; - indices.push_back(p0); - indices.push_back(p1); - indices.push_back(p3); - indices.push_back(p0); - indices.push_back(p3); - indices.push_back(p2); - } - } - - GLuint buffers[2]; - glGenBuffersARB(2, buffers); - vertex_buffer_ = buffers[0]; - index_buffer_ = buffers[1]; - index_count_ = indices.size(); - - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_); - glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(float), - vertices.data(), GL_STATIC_DRAW); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer_); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(GLushort), - indices.data(), GL_STATIC_DRAW); -} - -Background::Renderer::~Renderer() = default; - -void Background::Renderer::Draw(const gfx::Transform& view_proj_matrix, - int texture_data_handle) { - glUseProgram(program_handle_); - - // Pass in model view project matrix. - glUniformMatrix4fv(model_view_proj_matrix_handle_, 1, false, - MatrixToGLArray(view_proj_matrix).data()); - - // Set up vertex attributes. - glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_); - glVertexAttribPointer(position_handle_, 2, GL_FLOAT, GL_FALSE, 0, - VOID_OFFSET(0)); - glEnableVertexAttribArray(position_handle_); - - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_2D, texture_data_handle); - - // Set up uniforms. - glUniform1i(tex_uniform_handle_, 0); - - glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer_); - glDrawElements(GL_TRIANGLES, index_count_, GL_UNSIGNED_SHORT, 0); - - glDisableVertexAttribArray(position_handle_); -} - -} // namespace vr
diff --git a/chrome/browser/vr/elements/background.h b/chrome/browser/vr/elements/background.h deleted file mode 100644 index b917113..0000000 --- a/chrome/browser/vr/elements/background.h +++ /dev/null
@@ -1,61 +0,0 @@ -// Copyright 2017 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_VR_ELEMENTS_BACKGROUND_H_ -#define CHROME_BROWSER_VR_ELEMENTS_BACKGROUND_H_ - -#include "chrome/browser/vr/elements/ui_element.h" -#include "chrome/browser/vr/renderers/base_quad_renderer.h" -#include "third_party/skia/include/core/SkRefCnt.h" -#include "ui/gl/gl_bindings.h" - -class SkBitmap; -class SkSurface; - -namespace vr { - -class Background : public UiElement { - public: - Background(); - ~Background() override; - - // UiElement: - void Render(UiElementRenderer* renderer, - const CameraModel& model) const override; - void Initialize(SkiaSurfaceProvider* provider) override; - - void SetImage(std::unique_ptr<SkBitmap> bitmap); - - class Renderer : public BaseRenderer { - public: - Renderer(); - ~Renderer() final; - - void Draw(const gfx::Transform& view_proj_matrix, int texture_data_handle); - - private: - GLuint model_view_proj_matrix_handle_; - GLuint tex_uniform_handle_; - - GLuint vertex_buffer_; - GLuint index_buffer_; - GLuint index_count_; - - DISALLOW_COPY_AND_ASSIGN(Renderer); - }; - - private: - void CreateTexture(); - - std::unique_ptr<SkBitmap> initialization_bitmap_; - GLuint texture_handle_ = 0; - sk_sp<SkSurface> surface_; - SkiaSurfaceProvider* provider_ = nullptr; - - DISALLOW_COPY_AND_ASSIGN(Background); -}; - -} // namespace vr - -#endif // CHROME_BROWSER_VR_ELEMENTS_BACKGROUND_H_
diff --git a/chrome/browser/vr/elements/content_element.cc b/chrome/browser/vr/elements/content_element.cc index 9c84f55b..2e6b305 100644 --- a/chrome/browser/vr/elements/content_element.cc +++ b/chrome/browser/vr/elements/content_element.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/vr/elements/content_element.h" #include "chrome/browser/vr/ui_element_renderer.h" +#include "chrome/browser/vr/ui_scene_constants.h" #include "chrome/browser/vr/vr_gl_util.h" #include "third_party/WebKit/public/platform/WebGestureEvent.h" #include "ui/gfx/geometry/rect_f.h" @@ -21,6 +22,16 @@ // distorted content much more quickly. Thus, have a smaller threshold here. static constexpr float kContentAspectRatioPropagationThreshold = 0.01f; +gfx::Vector3dF GetNormalFromTransform(const gfx::Transform& transform) { + gfx::Vector3dF x_axis(1, 0, 0); + gfx::Vector3dF y_axis(0, 1, 0); + transform.TransformVector(&x_axis); + transform.TransformVector(&y_axis); + gfx::Vector3dF normal = CrossProduct(x_axis, y_axis); + normal.GetNormalized(&normal); + return normal; +} + } // namespace ContentElement::ContentElement( @@ -104,7 +115,7 @@ } bool ContentElement::OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) { + const gfx::Transform& head_pose) { // TODO(mthiesse): This projection matrix is always going to be a frame // behind when computing the content size. We'll need to address this somehow // when we allow content resizing, or we could end up triggering an extra @@ -127,8 +138,13 @@ // is animated. This approach only works with the current scene hierarchy and // set of animated properties. gfx::Transform target_transform = ComputeTargetWorldSpaceTransform(); + + gfx::Point3F target_center; + target_transform.TransformPoint(&target_center); + gfx::Vector3dF target_normal = GetNormalFromTransform(target_transform); + float distance = gfx::DotProduct(target_center - kOrigin, -target_normal); gfx::SizeF screen_size = - CalculateScreenSize(projection_matrix_, target_transform, target_size); + CalculateScreenSize(projection_matrix_, distance, target_size); float aspect_ratio = target_size.width() / target_size.height(); gfx::SizeF screen_bounds;
diff --git a/chrome/browser/vr/elements/content_element.h b/chrome/browser/vr/elements/content_element.h index 937d551..4ce3f45 100644 --- a/chrome/browser/vr/elements/content_element.h +++ b/chrome/browser/vr/elements/content_element.h
@@ -36,7 +36,7 @@ void OnScrollEnd(std::unique_ptr<blink::WebGestureEvent> gesture, const gfx::PointF& position) override; bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) override; + const gfx::Transform& head_pose) override; void Render(UiElementRenderer* renderer, const CameraModel& model) const final;
diff --git a/chrome/browser/vr/elements/environment/background.cc b/chrome/browser/vr/elements/environment/background.cc new file mode 100644 index 0000000..2455a38 --- /dev/null +++ b/chrome/browser/vr/elements/environment/background.cc
@@ -0,0 +1,331 @@ +// Copyright 2017 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/vr/elements/environment/background.h" + +#include "base/memory/ptr_util.h" +#include "chrome/browser/vr/model/assets.h" +#include "chrome/browser/vr/skia_surface_provider.h" +#include "chrome/browser/vr/ui_element_renderer.h" +#include "chrome/browser/vr/vr_gl_util.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/skia/include/core/SkCanvas.h" +#include "third_party/skia/include/core/SkSurface.h" + +namespace vr { + +namespace { + +// On the background sphere, this is the number of faces between poles. +int kSteps = 20; + +// clang-format off +constexpr char const* kVertexShader = SHADER( + precision mediump float; + uniform mat4 u_ModelViewProjMatrix; + attribute vec2 a_TexCoordinate; + varying vec2 v_TexCoordinate; + + void main() { + vec4 sphereVertex; + float theta = a_TexCoordinate.x * 6.28319; + float phi = a_TexCoordinate.y * 3.14159; + + // Place the background at 1000 m, an arbitrary large distance. This + // nullifies the translational portion of eye transforms, which is what we + // want for ODS backgrounds. + sphereVertex.x = 1000. * -cos(theta) * sin(phi); + sphereVertex.y = 1000. * cos(phi); + sphereVertex.z = 1000. * -sin(theta) * sin(phi); + sphereVertex.w = 1.0; + + gl_Position = u_ModelViewProjMatrix * sphereVertex; + v_TexCoordinate = a_TexCoordinate; + } +); + +constexpr char const* kFragmentShader = SHADER( + precision mediump float; + uniform sampler2D u_Texture; + uniform sampler2D u_NormalGradientTexture; + uniform sampler2D u_IncognitoGradientTexture; + uniform sampler2D u_FullscreenGradientTexture; + uniform float u_NormalFactor; + uniform float u_IncognitoFactor; + uniform float u_FullscreenFactor; + varying vec2 v_TexCoordinate; + + void OverlayChannel(in float a, in float b, out float c) { + if (a < 0.5) { + c = 2.0 * a * b; + } else { + c = 1.0 - 2.0 * (1.0 - a) * (1.0 - b); + } + } + + void main() { + vec4 background_color = texture2D(u_Texture, v_TexCoordinate); + + vec4 normal_gradient_color = + texture2D(u_NormalGradientTexture, vec2(0, v_TexCoordinate.y)); + vec4 incognito_gradient_color = + texture2D(u_IncognitoGradientTexture, vec2(0, v_TexCoordinate.y)); + vec4 fullscreen_gradient_color = + texture2D(u_FullscreenGradientTexture, vec2(0, v_TexCoordinate.y)); + + vec4 gradient_color = + normal_gradient_color * u_NormalFactor + + incognito_gradient_color * u_IncognitoFactor + + fullscreen_gradient_color * u_FullscreenFactor; + + vec4 color = vec4(0.0, 0.0, 0.0, 1.0); + + OverlayChannel(gradient_color.r, background_color.r, color.r); + OverlayChannel(gradient_color.g, background_color.g, color.g); + OverlayChannel(gradient_color.b, background_color.b, color.b); + + // Add some noise to prevent banding artifacts in the gradient. + float n = + (fract(dot(v_TexCoordinate.xy, vec2(12345.67, 456.7))) - 0.5) / 255.0; + + gl_FragColor = vec4(color.rgb + n, 1); + } +); +/* clang-format on */ + +// The passed bitmap data is thrown away after the texture is generated. +GLuint UploadImage(std::unique_ptr<SkBitmap> bitmap, + SkiaSurfaceProvider* provider, + sk_sp<SkSurface>* surface) { + if (bitmap) { + *surface = provider->MakeSurface({bitmap->width(), bitmap->height()}); + } else { + *surface = provider->MakeSurface({1, 1}); + } + + // TODO(tiborg): proper error handling. + DCHECK(surface->get()); + SkCanvas* canvas = (*surface)->getCanvas(); + if (bitmap) { + canvas->drawBitmap(*bitmap, 0, 0); + } else { + // If we are missing a gradient image, blending with channels at .5 will + // have no effect -- it will be as if there is no gradient image. + canvas->clear(0xFF808080); + } + + return provider->FlushSurface(surface->get(), 0); +} + +} // namespace + +Background::Background() { + set_hit_testable(false); + SetTransitionedProperties( + {NORMAL_COLOR_FACTOR, INCOGNITO_COLOR_FACTOR, FULLSCREEN_COLOR_FACTOR}); + SetTransitionDuration(base::TimeDelta::FromMilliseconds(500)); +} + +Background::~Background() = default; + +void Background::Render(UiElementRenderer* renderer, + const CameraModel& model) const { + if (texture_handle_ != 0) { + renderer->DrawBackground( + model.view_proj_matrix * world_space_transform(), texture_handle_, + normal_gradient_texture_handle_, incognito_gradient_texture_handle_, + fullscreen_gradient_texture_handle_, normal_factor_, incognito_factor_, + fullscreen_factor_); + } +} + +void Background::Initialize(SkiaSurfaceProvider* provider) { + provider_ = provider; + if (initialization_bitmap_) { + CreateBackgroundTexture(); + } + + CreateGradientTextures(); +} + +void Background::SetBackgroundImage(std::unique_ptr<SkBitmap> background) { + // We take the objects off the model here so that we can destroy them after + // uploading to the GPU (they're pretty big). + initialization_bitmap_ = std::move(background); + if (provider_) + CreateBackgroundTexture(); +} + +void Background::SetGradientImages( + std::unique_ptr<SkBitmap> normal_gradient, + std::unique_ptr<SkBitmap> incognito_gradient, + std::unique_ptr<SkBitmap> fullscreen_gradient) { + initialization_normal_gradient_bitmap_ = std::move(normal_gradient); + initialization_incognito_gradient_bitmap_ = std::move(incognito_gradient); + initialization_fullscreen_gradient_bitmap_ = std::move(fullscreen_gradient); + if (provider_) + CreateGradientTextures(); +} + +void Background::SetNormalFactor(float factor) { + animation_player().TransitionFloatTo(last_frame_time(), NORMAL_COLOR_FACTOR, + normal_factor_, factor); +} + +void Background::SetIncognitoFactor(float factor) { + animation_player().TransitionFloatTo( + last_frame_time(), INCOGNITO_COLOR_FACTOR, incognito_factor_, factor); +} + +void Background::SetFullscreenFactor(float factor) { + animation_player().TransitionFloatTo( + last_frame_time(), FULLSCREEN_COLOR_FACTOR, fullscreen_factor_, factor); +} + +void Background::CreateBackgroundTexture() { + DCHECK(provider_); + DCHECK(initialization_bitmap_); + texture_handle_ = + UploadImage(std::move(initialization_bitmap_), provider_, &surface_); +} + +void Background::CreateGradientTextures() { + DCHECK(provider_); + normal_gradient_texture_handle_ = + UploadImage(std::move(initialization_normal_gradient_bitmap_), provider_, + &normal_gradient_surface_); + incognito_gradient_texture_handle_ = + UploadImage(std::move(initialization_incognito_gradient_bitmap_), + provider_, &incognito_gradient_surface_); + fullscreen_gradient_texture_handle_ = + UploadImage(std::move(initialization_fullscreen_gradient_bitmap_), + provider_, &fullscreen_gradient_surface_); +} + +void Background::NotifyClientFloatAnimated(float value, + int target_property_id, + cc::Animation* animation) { + switch (target_property_id) { + case NORMAL_COLOR_FACTOR: + normal_factor_ = value; + break; + case INCOGNITO_COLOR_FACTOR: + incognito_factor_ = value; + break; + case FULLSCREEN_COLOR_FACTOR: + fullscreen_factor_ = value; + break; + default: + UiElement::NotifyClientFloatAnimated(value, target_property_id, + animation); + } +} + +Background::Renderer::Renderer() + : BaseRenderer(kVertexShader, kFragmentShader) { + model_view_proj_matrix_handle_ = + glGetUniformLocation(program_handle_, "u_ModelViewProjMatrix"); + position_handle_ = glGetAttribLocation(program_handle_, "a_TexCoordinate"); + tex_uniform_handle_ = glGetUniformLocation(program_handle_, "u_Texture"); + normal_gradient_tex_uniform_handle_ = + glGetUniformLocation(program_handle_, "u_NormalGradientTexture"); + incognito_gradient_tex_uniform_handle_ = + glGetUniformLocation(program_handle_, "u_IncognitoGradientTexture"); + fullscreen_gradient_tex_uniform_handle_ = + glGetUniformLocation(program_handle_, "u_FullscreenGradientTexture"); + normal_factor_handle_ = + glGetUniformLocation(program_handle_, "u_NormalFactor"); + incognito_factor_handle_ = + glGetUniformLocation(program_handle_, "u_IncognitoFactor"); + fullscreen_factor_handle_ = + glGetUniformLocation(program_handle_, "u_FullscreenFactor"); + + // Build the set of texture points representing the sphere. + std::vector<float> vertices; + for (int x = 0; x <= 2 * kSteps; x++) { + for (int y = 0; y <= kSteps; y++) { + vertices.push_back(static_cast<float>(x) / (kSteps * 2)); + vertices.push_back(static_cast<float>(y) / kSteps); + } + } + std::vector<GLushort> indices; + int y_stride = kSteps + 1; + for (int x = 0; x < 2 * kSteps; x++) { + for (int y = 0; y < kSteps; y++) { + GLushort p0 = x * y_stride + y; + GLushort p1 = x * y_stride + y + 1; + GLushort p2 = (x + 1) * y_stride + y; + GLushort p3 = (x + 1) * y_stride + y + 1; + indices.push_back(p0); + indices.push_back(p1); + indices.push_back(p3); + indices.push_back(p0); + indices.push_back(p3); + indices.push_back(p2); + } + } + + GLuint buffers[2]; + glGenBuffersARB(2, buffers); + vertex_buffer_ = buffers[0]; + index_buffer_ = buffers[1]; + index_count_ = indices.size(); + + glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_); + glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(float), + vertices.data(), GL_STATIC_DRAW); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer_); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(GLushort), + indices.data(), GL_STATIC_DRAW); +} + +Background::Renderer::~Renderer() = default; + +void Background::Renderer::Draw(const gfx::Transform& view_proj_matrix, + int texture_data_handle, + int normal_gradient_texture_data_handle, + int incognito_gradient_texture_data_handle, + int fullscreen_gradient_texture_data_handle, + float normal_factor, + float incognito_factor, + float fullscreen_factor) { + glUseProgram(program_handle_); + + // Pass in model view project matrix. + glUniformMatrix4fv(model_view_proj_matrix_handle_, 1, false, + MatrixToGLArray(view_proj_matrix).data()); + + // Set up vertex attributes. + glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_); + glVertexAttribPointer(position_handle_, 2, GL_FLOAT, GL_FALSE, 0, + VOID_OFFSET(0)); + glEnableVertexAttribArray(position_handle_); + + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, texture_data_handle); + glActiveTexture(GL_TEXTURE1); + glBindTexture(GL_TEXTURE_2D, normal_gradient_texture_data_handle); + glActiveTexture(GL_TEXTURE2); + glBindTexture(GL_TEXTURE_2D, incognito_gradient_texture_data_handle); + glActiveTexture(GL_TEXTURE3); + glBindTexture(GL_TEXTURE_2D, fullscreen_gradient_texture_data_handle); + + // Set up uniforms. + glUniform1i(tex_uniform_handle_, 0); + glUniform1i(normal_gradient_tex_uniform_handle_, 1); + glUniform1i(incognito_gradient_tex_uniform_handle_, 2); + glUniform1i(fullscreen_gradient_tex_uniform_handle_, 3); + + glUniform1f(normal_factor_handle_, normal_factor); + glUniform1f(incognito_factor_handle_, incognito_factor); + glUniform1f(fullscreen_factor_handle_, fullscreen_factor); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer_); + glDrawElements(GL_TRIANGLES, index_count_, GL_UNSIGNED_SHORT, 0); + + glDisableVertexAttribArray(position_handle_); +} + +} // namespace vr
diff --git a/chrome/browser/vr/elements/environment/background.h b/chrome/browser/vr/elements/environment/background.h new file mode 100644 index 0000000..edca1c6 --- /dev/null +++ b/chrome/browser/vr/elements/environment/background.h
@@ -0,0 +1,101 @@ +// Copyright 2017 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_VR_ELEMENTS_ENVIRONMENT_BACKGROUND_H_ +#define CHROME_BROWSER_VR_ELEMENTS_ENVIRONMENT_BACKGROUND_H_ + +#include "chrome/browser/vr/elements/ui_element.h" +#include "chrome/browser/vr/renderers/base_quad_renderer.h" +#include "third_party/skia/include/core/SkRefCnt.h" +#include "ui/gl/gl_bindings.h" + +class SkBitmap; +class SkSurface; + +namespace vr { + +class Background : public UiElement { + public: + Background(); + ~Background() override; + + // UiElement: + void Render(UiElementRenderer* renderer, + const CameraModel& model) const override; + void Initialize(SkiaSurfaceProvider* provider) override; + + void SetBackgroundImage(std::unique_ptr<SkBitmap> background); + void SetGradientImages(std::unique_ptr<SkBitmap> normal_gradient, + std::unique_ptr<SkBitmap> incognito_gradient, + std::unique_ptr<SkBitmap> fullscreen_gradient); + + // These factors control the relative contribution of the the mode gradients + // to the final background color. + void SetNormalFactor(float factor); + void SetIncognitoFactor(float factor); + void SetFullscreenFactor(float factor); + + class Renderer : public BaseRenderer { + public: + Renderer(); + ~Renderer() final; + + void Draw(const gfx::Transform& view_proj_matrix, + int texture_data_handle, + int normal_gradient_data_handle, + int incognito_gradient_data_handle, + int fullscreen_gradient_data_handle, + float normal_factor, + float incognito_factor, + float fullscreen_factork); + + private: + GLuint model_view_proj_matrix_handle_; + GLuint tex_uniform_handle_; + GLuint normal_gradient_tex_uniform_handle_; + GLuint incognito_gradient_tex_uniform_handle_; + GLuint fullscreen_gradient_tex_uniform_handle_; + GLuint normal_factor_handle_; + GLuint incognito_factor_handle_; + GLuint fullscreen_factor_handle_; + + GLuint vertex_buffer_; + GLuint index_buffer_; + GLuint index_count_; + + DISALLOW_COPY_AND_ASSIGN(Renderer); + }; + + private: + void CreateBackgroundTexture(); + void CreateGradientTextures(); + + void NotifyClientFloatAnimated(float value, + int target_property_id, + cc::Animation* animation) override; + + std::unique_ptr<SkBitmap> initialization_bitmap_; + std::unique_ptr<SkBitmap> initialization_normal_gradient_bitmap_; + std::unique_ptr<SkBitmap> initialization_incognito_gradient_bitmap_; + std::unique_ptr<SkBitmap> initialization_fullscreen_gradient_bitmap_; + GLuint texture_handle_ = 0; + GLuint normal_gradient_texture_handle_ = 0; + GLuint incognito_gradient_texture_handle_ = 0; + GLuint fullscreen_gradient_texture_handle_ = 0; + sk_sp<SkSurface> surface_; + sk_sp<SkSurface> normal_gradient_surface_; + sk_sp<SkSurface> incognito_gradient_surface_; + sk_sp<SkSurface> fullscreen_gradient_surface_; + SkiaSurfaceProvider* provider_ = nullptr; + + float normal_factor_ = 1.0f; + float incognito_factor_ = 0.0f; + float fullscreen_factor_ = 0.0f; + + DISALLOW_COPY_AND_ASSIGN(Background); +}; + +} // namespace vr + +#endif // CHROME_BROWSER_VR_ELEMENTS_ENVIRONMENT_BACKGROUND_H_
diff --git a/chrome/browser/vr/elements/grid.cc b/chrome/browser/vr/elements/environment/grid.cc similarity index 98% rename from chrome/browser/vr/elements/grid.cc rename to chrome/browser/vr/elements/environment/grid.cc index 207c267..5a93010f 100644 --- a/chrome/browser/vr/elements/grid.cc +++ b/chrome/browser/vr/elements/environment/grid.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/vr/elements/grid.h" +#include "chrome/browser/vr/elements/environment/grid.h" #include "chrome/browser/vr/target_property.h" #include "chrome/browser/vr/ui_element_renderer.h"
diff --git a/chrome/browser/vr/elements/grid.h b/chrome/browser/vr/elements/environment/grid.h similarity index 91% rename from chrome/browser/vr/elements/grid.h rename to chrome/browser/vr/elements/environment/grid.h index 8b0dae4..934816d 100644 --- a/chrome/browser/vr/elements/grid.h +++ b/chrome/browser/vr/elements/environment/grid.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_VR_ELEMENTS_GRID_H_ -#define CHROME_BROWSER_VR_ELEMENTS_GRID_H_ +#ifndef CHROME_BROWSER_VR_ELEMENTS_ENVIRONMENT_GRID_H_ +#define CHROME_BROWSER_VR_ELEMENTS_ENVIRONMENT_GRID_H_ #include "chrome/browser/vr/elements/rect.h" #include "chrome/browser/vr/renderers/base_quad_renderer.h" @@ -67,4 +67,4 @@ } // namespace vr -#endif // CHROME_BROWSER_VR_ELEMENTS_GRID_H_ +#endif // CHROME_BROWSER_VR_ELEMENTS_ENVIRONMENT_GRID_H_
diff --git a/chrome/browser/vr/elements/environment/stars.cc b/chrome/browser/vr/elements/environment/stars.cc new file mode 100644 index 0000000..5db8e26c --- /dev/null +++ b/chrome/browser/vr/elements/environment/stars.cc
@@ -0,0 +1,171 @@ +// Copyright 2018 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/vr/elements/environment/stars.h" + +#include "base/numerics/math_constants.h" +#include "base/rand_util.h" +#include "chrome/browser/vr/ui_element_renderer.h" +#include "chrome/browser/vr/ui_scene_constants.h" +#include "chrome/browser/vr/vr_gl_util.h" +#include "ui/gfx/animation/tween.h" + +namespace vr { + +namespace { +constexpr size_t kNumStars = 200lu; + +// Position & opacity. +constexpr size_t kFloatsPerStarVertex = 4lu; +constexpr size_t kDataStride = kFloatsPerStarVertex * sizeof(float); +constexpr size_t kOpacityDataOffset = 3 * sizeof(float); +constexpr size_t kVerticesPerStar = 6lu; +constexpr size_t kTrianglesPerStar = kVerticesPerStar - 1lu; + +constexpr float kOpacityScale = 80.0f; + +float g_vertices[kNumStars * kFloatsPerStarVertex * kVerticesPerStar]; +GLushort g_indices[kNumStars * kTrianglesPerStar * 3lu]; + +// clang-format off +static constexpr char const* kVertexShader = SHADER( + precision mediump float; + uniform mat4 u_ModelViewProjMatrix; + attribute vec4 a_Position; + attribute float a_Opacity; + varying mediump float v_Opacity; + + void main() { + v_Opacity = a_Opacity; + gl_Position = u_ModelViewProjMatrix * a_Position; + } +); + +static constexpr char const* kFragmentShader = SHADER( + precision highp float; + varying mediump float v_Opacity; + void main() { + mediump vec4 color = vec4(1.0, 1.0, 1.0, 1.0); + // This is somewhat arbitrary, but makes the bright part of the star larger. + gl_FragColor = color * v_Opacity * v_Opacity; + } +); +// clang-format on + +} // namespace + +Stars::Stars() { + set_hit_testable(false); +} + +Stars::~Stars() = default; + +void Stars::Render(UiElementRenderer* renderer, + const CameraModel& camera) const { + renderer->DrawStars((last_frame_time() - start_time_).InSecondsF(), + camera.view_proj_matrix * world_space_transform()); +} + +void Stars::Initialize(SkiaSurfaceProvider* provider) { + start_time_ = base::TimeTicks::Now(); +} + +Stars::Renderer::Renderer() : BaseRenderer(kVertexShader, kFragmentShader) { + model_view_proj_matrix_handle_ = + glGetUniformLocation(program_handle_, "u_ModelViewProjMatrix"); + opacity_handle_ = glGetAttribLocation(program_handle_, "a_Opacity"); +} + +Stars::Renderer::~Renderer() {} + +// TODO(vollick): use time |t| to animate the stars. +void Stars::Renderer::Draw(float t, const gfx::Transform& view_proj_matrix) { + glUseProgram(program_handle_); + + // Pass in model view project matrix. + glUniformMatrix4fv(model_view_proj_matrix_handle_, 1, false, + MatrixToGLArray(view_proj_matrix).data()); + + glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_); + + // Set up position attribute. + glVertexAttribPointer(position_handle_, 3, GL_FLOAT, false, kDataStride, + VOID_OFFSET(0)); + glEnableVertexAttribArray(position_handle_); + + // Set up opacity attribute. + glVertexAttribPointer(opacity_handle_, 1, GL_FLOAT, false, kDataStride, + VOID_OFFSET(kOpacityDataOffset)); + glEnableVertexAttribArray(opacity_handle_); + + glEnable(GL_BLEND); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + + glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer_); + + glDrawElements(GL_TRIANGLES, arraysize(g_indices), GL_UNSIGNED_SHORT, 0); + + glDisableVertexAttribArray(position_handle_); + glDisableVertexAttribArray(opacity_handle_); +} + +GLuint Stars::Renderer::vertex_buffer_ = 0; +GLuint Stars::Renderer::index_buffer_ = 0; + +void Stars::Renderer::CreateBuffers() { + gfx::Point3F local_star_geometry[kVerticesPerStar]; + for (size_t i = 1; i < kVerticesPerStar; ++i) { + float k = 2.0f / (kVerticesPerStar - 1.0f); + k *= i - 1; + local_star_geometry[i].set_x(cos(base::kPiFloat * k)); + local_star_geometry[i].set_y(sin(base::kPiFloat * k)); + } + size_t cur_vertex = 0; + size_t cur_index = 0; + for (size_t i = 0; i < kNumStars; ++i) { + float x_rot = + gfx::Tween::FloatValueBetween(base::RandDouble(), -60.0f, 60.0f); + float y_rot = + gfx::Tween::FloatValueBetween(base::RandDouble(), -60.0f, 60.0f); + float size = + gfx::Tween::FloatValueBetween(base::RandDouble(), 0.007f, 0.002f); + float opacity = 1.0 - gfx::Vector2dF(x_rot, y_rot).Length() / kOpacityScale; + + gfx::Transform local; + local.RotateAboutYAxis(x_rot); + local.RotateAboutXAxis(y_rot); + local.Translate3d({0, 0, -kSkyDistance}); + local.Scale3d(size * kSkyDistance, size * kSkyDistance, 1.0f); + for (size_t j = 0; j < kVerticesPerStar - 1; j++, cur_index += 3) { + size_t j_next = (j + 1) % (kVerticesPerStar - 1); + g_indices[cur_index] = cur_vertex; + g_indices[cur_index + 1] = cur_vertex + j + 1; + g_indices[cur_index + 2] = cur_vertex + j_next + 1; + } + for (size_t j = 0; j < kVerticesPerStar; j++, cur_vertex++) { + gfx::Point3F p = local_star_geometry[j]; + local.TransformPoint(&p); + g_vertices[cur_vertex * kFloatsPerStarVertex] = p.x(); + g_vertices[cur_vertex * kFloatsPerStarVertex + 1] = p.y(); + g_vertices[cur_vertex * kFloatsPerStarVertex + 2] = p.z(); + g_vertices[cur_vertex * kFloatsPerStarVertex + 3] = j ? 0 : opacity; + } + } + + GLuint buffers[2]; + glGenBuffersARB(2, buffers); + vertex_buffer_ = buffers[0]; + index_buffer_ = buffers[1]; + + glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer_); + glBufferData(GL_ARRAY_BUFFER, arraysize(g_vertices) * sizeof(float), + g_vertices, GL_STATIC_DRAW); + + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer_); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, arraysize(g_indices) * sizeof(GLushort), + g_indices, GL_STATIC_DRAW); +} + +} // namespace vr
diff --git a/chrome/browser/vr/elements/environment/stars.h b/chrome/browser/vr/elements/environment/stars.h new file mode 100644 index 0000000..51e6dc4 --- /dev/null +++ b/chrome/browser/vr/elements/environment/stars.h
@@ -0,0 +1,55 @@ +// Copyright 2018 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_VR_ELEMENTS_ENVIRONMENT_STARS_H_ +#define CHROME_BROWSER_VR_ELEMENTS_ENVIRONMENT_STARS_H_ + +#include <vector> + +#include "base/time/time.h" +#include "chrome/browser/vr/elements/ui_element.h" +#include "chrome/browser/vr/renderers/base_renderer.h" + +namespace vr { + +class Stars : public UiElement { + public: + Stars(); + ~Stars() override; + + void Render(UiElementRenderer* renderer, + const CameraModel& camera) const override; + + class Renderer : public BaseRenderer { + public: + Renderer(); + ~Renderer() override; + void Draw(float t, const gfx::Transform& view_proj_matrix); + + static void CreateBuffers(); + + private: + static GLuint vertex_buffer_; + static GLuint index_buffer_; + + // Uniforms + GLuint model_view_proj_matrix_handle_ = 0; + + // Attributes + GLuint opacity_handle_; + + DISALLOW_COPY_AND_ASSIGN(Renderer); + }; + + private: + void Initialize(SkiaSurfaceProvider* provider) override; + + base::TimeTicks start_time_; + + DISALLOW_COPY_AND_ASSIGN(Stars); +}; + +} // namespace vr + +#endif // CHROME_BROWSER_VR_ELEMENTS_ENVIRONMENT_STARS_H_
diff --git a/chrome/browser/vr/elements/keyboard.cc b/chrome/browser/vr/elements/keyboard.cc index 982a864..5181d0d 100644 --- a/chrome/browser/vr/elements/keyboard.cc +++ b/chrome/browser/vr/elements/keyboard.cc
@@ -91,7 +91,7 @@ } bool Keyboard::OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& head_direction) { + const gfx::Transform& head_pose) { if (!delegate_) return false;
diff --git a/chrome/browser/vr/elements/keyboard.h b/chrome/browser/vr/elements/keyboard.h index 282b1241..ea8d736c 100644 --- a/chrome/browser/vr/elements/keyboard.h +++ b/chrome/browser/vr/elements/keyboard.h
@@ -33,7 +33,7 @@ private: bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& head_direction) override; + const gfx::Transform& head_pose) override; void OnUpdatedWorldSpaceTransform() override; void Render(UiElementRenderer* renderer, const CameraModel& camera_model) const final;
diff --git a/chrome/browser/vr/elements/linear_layout_unittest.cc b/chrome/browser/vr/elements/linear_layout_unittest.cc index 5a3bab00..ec9a7453 100644 --- a/chrome/browser/vr/elements/linear_layout_unittest.cc +++ b/chrome/browser/vr/elements/linear_layout_unittest.cc
@@ -122,7 +122,7 @@ auto scene = base::MakeUnique<UiScene>(); scene->AddUiElement(kRoot, std::move(parent_layout)); - scene->OnBeginFrame(MicrosecondsToTicks(1), kForwardVector); + scene->OnBeginFrame(MicrosecondsToTicks(1), kStartHeadPose); // Ensure that layouts expand to include the cumulative size of children. EXPECT_FLOAT_EQ(p_parent_layout->size().width(), 999.f);
diff --git a/chrome/browser/vr/elements/rect_unittest.cc b/chrome/browser/vr/elements/rect_unittest.cc index 6eb5969..a9c22c7 100644 --- a/chrome/browser/vr/elements/rect_unittest.cc +++ b/chrome/browser/vr/elements/rect_unittest.cc
@@ -43,11 +43,11 @@ rect->SetTransitionedProperties({BACKGROUND_COLOR, FOREGROUND_COLOR}); rect->SetColor(SK_ColorBLACK); - scene.OnBeginFrame(MsToTicks(1), kForwardVector); + scene.OnBeginFrame(MsToTicks(1), kStartHeadPose); EXPECT_EQ(SK_ColorRED, rect->edge_color()); EXPECT_EQ(SK_ColorBLUE, rect->center_color()); - scene.OnBeginFrame(MsToTicks(5000), kForwardVector); + scene.OnBeginFrame(MsToTicks(5000), kStartHeadPose); EXPECT_EQ(SK_ColorBLACK, rect->edge_color()); EXPECT_EQ(SK_ColorBLACK, rect->center_color()); }
diff --git a/chrome/browser/vr/elements/repositioner.cc b/chrome/browser/vr/elements/repositioner.cc new file mode 100644 index 0000000..c91915a5 --- /dev/null +++ b/chrome/browser/vr/elements/repositioner.cc
@@ -0,0 +1,90 @@ +// Copyright 2018 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/vr/elements/repositioner.h" + +#include "chrome/browser/vr/ui_scene_constants.h" +#include "ui/gfx/geometry/angle_conversions.h" +#include "ui/gfx/geometry/quaternion.h" + +namespace vr { + +Repositioner::Repositioner(float content_depth) + : content_depth_(content_depth) { + set_hit_testable(false); +} + +Repositioner::~Repositioner() = default; + +gfx::Transform Repositioner::LocalTransform() const { + return transform_; +} + +gfx::Transform Repositioner::GetTargetLocalTransform() const { + return transform_; +} + +void Repositioner::UpdateTransform() { + DCHECK(kOrigin.SquaredDistanceTo(laser_origin_) < + content_depth_ * content_depth_); + + gfx::Vector3dF laser_origin_vector = laser_origin_ - kOrigin; + float laser_origin_vector_length = laser_origin_vector.Length(); + gfx::Vector3dF normalized_laser_direction; + bool success = laser_direction_.GetNormalized(&normalized_laser_direction); + DCHECK(success); + float d1 = -gfx::DotProduct(laser_origin_vector, normalized_laser_direction); + float d2 = std::sqrt( + content_depth_ * content_depth_ - + (laser_origin_vector_length * laser_origin_vector_length - d1 * d1)); + float new_ray_distance = d1 + d2; + gfx::Vector3dF new_ray = + gfx::ScaleVector3d(normalized_laser_direction, new_ray_distance); + gfx::Vector3dF new_reticle_vector = laser_origin_vector; + new_reticle_vector.Add(new_ray); + + if (new_reticle_vector.x() == 0.f && new_reticle_vector.z() == 0.f) + return; + + transform_.MakeIdentity(); + + gfx::Quaternion rotate_to_new_position({0, 0, -1}, new_reticle_vector); + transform_.ConcatTransform(gfx::Transform(rotate_to_new_position)); + + gfx::Vector3dF new_right_vector = {1, 0, 0}; + transform_.TransformVector(&new_right_vector); + // Right vector should be othogonal to world space x-z plane. + gfx::Vector3dF expected_right_vector = + gfx::CrossProduct(new_reticle_vector, {0, 1, 0}); + + gfx::Quaternion rotate_to_expected_right(new_right_vector, + expected_right_vector); + transform_.ConcatTransform(gfx::Transform(rotate_to_expected_right)); +} + +bool Repositioner::OnBeginFrame(const base::TimeTicks& time, + const gfx::Transform& head_pose) { + if (enabled_) { + UpdateTransform(); + return true; + } + return false; +} + +void Repositioner::DumpGeometry(std::ostringstream* os) const { + gfx::Transform t = world_space_transform(); + gfx::Vector3dF forward = {0, 0, -1}; + t.TransformVector(&forward); + // Decompose the rotation to world x axis followed by world y axis + float x_rotation = std::asin(forward.y() / forward.Length()); + gfx::Vector3dF projected_forward = {forward.x(), 0, forward.z()}; + float y_rotation = std::acos(gfx::DotProduct(projected_forward, {0, 0, -1}) / + projected_forward.Length()); + if (projected_forward.x() > 0.f) + y_rotation *= -1; + *os << "rx(" << gfx::RadToDeg(x_rotation) << ") " + << "ry(" << gfx::RadToDeg(y_rotation) << ") "; +} + +} // namespace vr
diff --git a/chrome/browser/vr/elements/repositioner.h b/chrome/browser/vr/elements/repositioner.h new file mode 100644 index 0000000..3f34699 --- /dev/null +++ b/chrome/browser/vr/elements/repositioner.h
@@ -0,0 +1,53 @@ +// Copyright 2018 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_VR_ELEMENTS_REPOSITIONER_H_ +#define CHROME_BROWSER_VR_ELEMENTS_REPOSITIONER_H_ + +#include <sstream> + +#include "base/macros.h" +#include "chrome/browser/vr/elements/ui_element.h" +#include "chrome/browser/vr/model/reticle_model.h" +#include "ui/gfx/transform.h" + +namespace vr { + +// A repositioner adjusts the position of its children by rotation. The +// reposition is driven by controller. +class Repositioner : public UiElement { + public: + explicit Repositioner(float content_depth); + ~Repositioner() override; + + void set_laser_origin(const gfx::Point3F& laser_origin) { + laser_origin_ = laser_origin; + } + + void set_laser_direction(const gfx::Vector3dF& laser_direction) { + laser_direction_ = laser_direction; + } + + void set_enable(bool enable) { enabled_ = enable; } + + private: + gfx::Transform LocalTransform() const override; + gfx::Transform GetTargetLocalTransform() const override; + void UpdateTransform(); + bool OnBeginFrame(const base::TimeTicks& time, + const gfx::Transform& head_pose) override; + void DumpGeometry(std::ostringstream* os) const override; + + gfx::Transform transform_; + bool enabled_ = false; + float content_depth_; + gfx::Point3F laser_origin_; + gfx::Vector3dF laser_direction_; + + DISALLOW_COPY_AND_ASSIGN(Repositioner); +}; + +} // namespace vr + +#endif // CHROME_BROWSER_VR_ELEMENTS_REPOSITIONER_H_
diff --git a/chrome/browser/vr/elements/repositioner_unittest.cc b/chrome/browser/vr/elements/repositioner_unittest.cc new file mode 100644 index 0000000..885d86d --- /dev/null +++ b/chrome/browser/vr/elements/repositioner_unittest.cc
@@ -0,0 +1,89 @@ +// Copyright 2018 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/vr/elements/repositioner.h" + +#include "base/memory/ptr_util.h" +#include "base/strings/stringprintf.h" +#include "cc/test/geometry_test_utils.h" +#include "chrome/browser/vr/test/animation_utils.h" +#include "chrome/browser/vr/test/constants.h" +#include "chrome/browser/vr/ui_scene.h" +#include "chrome/browser/vr/ui_scene_constants.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "ui/gfx/transform.h" + +namespace vr { + +namespace { + +constexpr float kTestRepositionDistance = 2.f; + +void CheckRepositionedCorrectly(size_t test_case_index, + UiElement* element, + const gfx::Point3F& expected_center) { + SCOPED_TRACE(base::StringPrintf("Test case index = %zd", test_case_index)); + gfx::Point3F center = element->GetCenter(); + EXPECT_NEAR(center.x(), expected_center.x(), kEpsilon); + EXPECT_NEAR(center.y(), expected_center.y(), kEpsilon); + EXPECT_NEAR(center.z(), expected_center.z(), kEpsilon); + gfx::Vector3dF right_vector = {1, 0, 0}; + element->world_space_transform().TransformVector(&right_vector); + gfx::Vector3dF expected_right = + gfx::CrossProduct(expected_center - kOrigin, {0, 1, 0}); + gfx::Vector3dF normalized_expected_right_vector; + expected_right.GetNormalized(&normalized_expected_right_vector); + EXPECT_VECTOR3DF_NEAR(right_vector, normalized_expected_right_vector, + kEpsilon); +} + +} // namespace + +TEST(Repositioner, RepositionNegativeZWithReticle) { + UiScene scene; + auto child = base::MakeUnique<UiElement>(); + child->SetTranslate(0, 0, -kTestRepositionDistance); + auto* element = child.get(); + auto parent = base::MakeUnique<Repositioner>(kTestRepositionDistance); + auto* repositioner = parent.get(); + parent->AddChild(std::move(child)); + scene.AddUiElement(kRoot, std::move(parent)); + + repositioner->set_laser_origin(gfx::Point3F(1, -1, 0)); + + struct TestCase { + TestCase(gfx::Vector3dF v, gfx::Point3F p) + : laser_direction(v), expected_element_center(p) {} + gfx::Vector3dF laser_direction; + gfx::Point3F expected_element_center; + }; + std::vector<TestCase> test_cases = { + {{-2, 2.41421f, -1}, {-1, 1.41421f, -1}}, + {{-2, 2.41421f, 1}, {-1, 1.41421f, 1}}, + {{0, 2.41421f, 1}, {1, 1.41421f, 1}}, + {{0, 2.41421f, -1}, {1, 1.41421f, -1}}, + {{-2, -0.41421f, -1}, {-1, -1.41421f, -1}}, + {{-2, -0.41421f, 1}, {-1, -1.41421f, 1}}, + {{0, -0.41421f, 1}, {1, -1.41421f, 1}}, + {{0, -0.41421f, -1}, {1, -1.41421f, -1}}, + }; + + for (size_t i = 0; i < test_cases.size(); i++) { + repositioner->set_laser_direction(test_cases[i].laser_direction); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); + // Before enable repositioner, child element should NOT have rotation. + CheckRepositionedCorrectly(i, element, {0, 0, -kTestRepositionDistance}); + } + + repositioner->set_enable(true); + + for (size_t i = 0; i < test_cases.size(); i++) { + repositioner->set_laser_direction(test_cases[i].laser_direction); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); + CheckRepositionedCorrectly(i, element, + test_cases[i].expected_element_center); + } +} + +} // namespace vr
diff --git a/chrome/browser/vr/elements/scaled_depth_adjuster.cc b/chrome/browser/vr/elements/scaled_depth_adjuster.cc index e106ae9..addaad4 100644 --- a/chrome/browser/vr/elements/scaled_depth_adjuster.cc +++ b/chrome/browser/vr/elements/scaled_depth_adjuster.cc
@@ -22,7 +22,7 @@ } bool ScaledDepthAdjuster::OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) { + const gfx::Transform& head_pose) { // NB: we compute our local transform only once in the first call to // OnBeginFrame that occurs after this element's construction. This permits // ScaledDepthAdjuster elements to be added to subtrees that are later added
diff --git a/chrome/browser/vr/elements/scaled_depth_adjuster.h b/chrome/browser/vr/elements/scaled_depth_adjuster.h index 0a8eafe..ba51e528 100644 --- a/chrome/browser/vr/elements/scaled_depth_adjuster.h +++ b/chrome/browser/vr/elements/scaled_depth_adjuster.h
@@ -26,7 +26,7 @@ gfx::Transform LocalTransform() const override; gfx::Transform GetTargetLocalTransform() const override; bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) override; + const gfx::Transform& head_pose) override; void OnSetType() override; void DumpGeometry(std::ostringstream* os) const override;
diff --git a/chrome/browser/vr/elements/scaled_depth_adjuster_unittest.cc b/chrome/browser/vr/elements/scaled_depth_adjuster_unittest.cc index 8a2e854..363b320 100644 --- a/chrome/browser/vr/elements/scaled_depth_adjuster_unittest.cc +++ b/chrome/browser/vr/elements/scaled_depth_adjuster_unittest.cc
@@ -30,7 +30,7 @@ auto adjuster = base::MakeUnique<ScaledDepthAdjuster>(2.5); adjuster->AddChild(std::move(element)); scene.AddUiElement(kRoot, std::move(adjuster)); - scene.OnBeginFrame(MsToTicks(0), kForwardVector); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); CheckScaleAndDepth(p_element, 2.5); } @@ -63,7 +63,7 @@ grandparent->AddChild(std::move(parent_adjuster)); grandparent_adjuster->AddChild(std::move(grandparent)); scene.AddUiElement(kRoot, std::move(grandparent_adjuster)); - scene.OnBeginFrame(MsToTicks(0), kForwardVector); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); CheckScaleAndDepth(p_child, 2.6f); CheckScaleAndDepth(p_parent, 2.4f);
diff --git a/chrome/browser/vr/elements/shadow_unittest.cc b/chrome/browser/vr/elements/shadow_unittest.cc index 7fc1333..90ebb3a 100644 --- a/chrome/browser/vr/elements/shadow_unittest.cc +++ b/chrome/browser/vr/elements/shadow_unittest.cc
@@ -24,14 +24,14 @@ shadow->AddChild(std::move(rect)); scene.AddUiElement(kRoot, std::move(shadow)); - scene.OnBeginFrame(MsToTicks(0), kForwardVector); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); float old_x_padding = shadow_ptr->x_padding(); float old_y_padding = shadow_ptr->y_padding(); EXPECT_LE(0.0f, old_x_padding); EXPECT_LE(0.0f, old_y_padding); rect_ptr->SetTranslate(0, 0, 0.15); - scene.OnBeginFrame(MsToTicks(0), kForwardVector); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); float new_x_padding = shadow_ptr->x_padding(); float new_y_padding = shadow_ptr->y_padding(); EXPECT_LE(old_x_padding, new_x_padding);
diff --git a/chrome/browser/vr/elements/spinner_unittest.cc b/chrome/browser/vr/elements/spinner_unittest.cc index c68b52d..8a511f9 100644 --- a/chrome/browser/vr/elements/spinner_unittest.cc +++ b/chrome/browser/vr/elements/spinner_unittest.cc
@@ -54,7 +54,7 @@ UiTexture* texture = spinner_element->GetTexture(); scene.AddUiElement(kRoot, std::move(spinner_element)); base::TimeTicks start_time = MsToTicks(1); - scene.OnBeginFrame(start_time, kForwardVector); + scene.OnBeginFrame(start_time, kStartHeadPose); struct TestCase { float start_angle; @@ -73,7 +73,7 @@ }; for (const auto& test_case : test_cases) { - scene.OnBeginFrame(MsToTicks(1) + test_case.delta, kForwardVector); + scene.OnBeginFrame(MsToTicks(1) + test_case.delta, kStartHeadPose); CheckArc(texture, test_case.start_angle, test_case.sweep_angle); } }
diff --git a/chrome/browser/vr/elements/text_input.cc b/chrome/browser/vr/elements/text_input.cc index a8747a3..364a3b0 100644 --- a/chrome/browser/vr/elements/text_input.cc +++ b/chrome/browser/vr/elements/text_input.cc
@@ -135,7 +135,7 @@ } bool TextInput::OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) { + const gfx::Transform& head_pose) { return SetCursorBlinkState(time); }
diff --git a/chrome/browser/vr/elements/text_input.h b/chrome/browser/vr/elements/text_input.h index 1ba81038..1621214d 100644 --- a/chrome/browser/vr/elements/text_input.h +++ b/chrome/browser/vr/elements/text_input.h
@@ -53,7 +53,7 @@ } bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) final; + const gfx::Transform& head_pose) final; void OnSetSize(const gfx::SizeF& size) final; void OnSetName() final;
diff --git a/chrome/browser/vr/elements/throbber_unittest.cc b/chrome/browser/vr/elements/throbber_unittest.cc index 4857ba9..1c794b8d 100644 --- a/chrome/browser/vr/elements/throbber_unittest.cc +++ b/chrome/browser/vr/elements/throbber_unittest.cc
@@ -33,11 +33,11 @@ scene.AddUiElement(kRoot, std::move(element)); throbber->SetCircleGrowAnimationEnabled(true); - scene.OnBeginFrame(MsToTicks(1), kForwardVector); + scene.OnBeginFrame(MsToTicks(1), kStartHeadPose); EXPECT_TRUE(throbber->IsAnimatingProperty(CIRCLE_GROW)); // Half way through animation. - scene.OnBeginFrame(MsToTicks(501), kForwardVector); + scene.OnBeginFrame(MsToTicks(501), kStartHeadPose); EXPECT_FLOAT_EQ(throbber->opacity(), kInitialOpacity / 2); EXPECT_FLOAT_EQ( throbber->GetTargetTransform().at(UiElement::kScaleIndex).scale.x,
diff --git a/chrome/browser/vr/elements/transient_element.cc b/chrome/browser/vr/elements/transient_element.cc index 3ba40d50..bdc83375 100644 --- a/chrome/browser/vr/elements/transient_element.cc +++ b/chrome/browser/vr/elements/transient_element.cc
@@ -46,9 +46,8 @@ SimpleTransientElement::~SimpleTransientElement() {} -bool SimpleTransientElement::OnBeginFrame( - const base::TimeTicks& time, - const gfx::Vector3dF& head_direction) { +bool SimpleTransientElement::OnBeginFrame(const base::TimeTicks& time, + const gfx::Transform& head_pose) { // Do nothing if we're not going to be visible. if (GetTargetOpacity() != opacity_when_visible()) return false; @@ -79,7 +78,7 @@ bool ShowUntilSignalTransientElement::OnBeginFrame( const base::TimeTicks& time, - const gfx::Vector3dF& head_direction) { + const gfx::Transform& head_pose) { // Do nothing if we're not going to be visible. if (GetTargetOpacity() != opacity_when_visible()) return false;
diff --git a/chrome/browser/vr/elements/transient_element.h b/chrome/browser/vr/elements/transient_element.h index 1c60ce0..2ef1f48 100644 --- a/chrome/browser/vr/elements/transient_element.h +++ b/chrome/browser/vr/elements/transient_element.h
@@ -45,7 +45,7 @@ private: bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& head_direction) override; + const gfx::Transform& head_pose) override; typedef TransientElement super; @@ -76,7 +76,7 @@ private: bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& head_direction) override; + const gfx::Transform& head_pose) override; typedef TransientElement super;
diff --git a/chrome/browser/vr/elements/transient_element_unittest.cc b/chrome/browser/vr/elements/transient_element_unittest.cc index a667900..312e2ea 100644 --- a/chrome/browser/vr/elements/transient_element_unittest.cc +++ b/chrome/browser/vr/elements/transient_element_unittest.cc
@@ -28,30 +28,30 @@ // Enable, and ensure that the element transiently disappears. element.SetVisible(true); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(0), kForwardVector)); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(10), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(0), kStartHeadPose)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(10), kStartHeadPose)); EXPECT_EQ(element.opacity_when_visible(), element.opacity()); - EXPECT_TRUE(element.DoBeginFrame(MsToTicks(2010), kForwardVector)); + EXPECT_TRUE(element.DoBeginFrame(MsToTicks(2010), kStartHeadPose)); EXPECT_EQ(0.0f, element.opacity()); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(2020), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(2020), kStartHeadPose)); // Enable, and ensure that the element transiently disappears using // SetVisibleImmediately. element.SetVisibleImmediately(true); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(2020), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(2020), kStartHeadPose)); EXPECT_EQ(element.opacity_when_visible(), element.opacity()); - EXPECT_TRUE(element.DoBeginFrame(MsToTicks(4020), kForwardVector)); + EXPECT_TRUE(element.DoBeginFrame(MsToTicks(4020), kStartHeadPose)); EXPECT_EQ(0.0f, element.opacity()); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(4030), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(4030), kStartHeadPose)); element.SetTransitionedProperties({OPACITY}); element.SetVisible(true); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(4030), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(4030), kStartHeadPose)); EXPECT_NE(element.opacity_when_visible(), element.opacity()); element.SetVisibleImmediately(true); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(4030), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(4030), kStartHeadPose)); EXPECT_EQ(element.opacity_when_visible(), element.opacity()); - EXPECT_TRUE(element.DoBeginFrame(MsToTicks(6060), kForwardVector)); + EXPECT_TRUE(element.DoBeginFrame(MsToTicks(6060), kStartHeadPose)); EXPECT_EQ(0.0f, element.GetTargetOpacity()); } @@ -64,25 +64,25 @@ // Enable, and ensure that the element is visible. element.SetVisible(true); EXPECT_EQ(element.opacity_when_visible(), element.opacity()); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(0), kForwardVector)); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(1000), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(0), kStartHeadPose)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(1000), kStartHeadPose)); // Refresh visibility, and ensure that the element still transiently // disappears, but at a later time. element.RefreshVisible(); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(1000), kForwardVector)); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(2000), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(1000), kStartHeadPose)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(2000), kStartHeadPose)); EXPECT_EQ(element.opacity_when_visible(), element.opacity()); - EXPECT_TRUE(element.DoBeginFrame(MsToTicks(3000), kForwardVector)); + EXPECT_TRUE(element.DoBeginFrame(MsToTicks(3000), kStartHeadPose)); EXPECT_EQ(0.0f, element.opacity()); // Refresh visibility, and ensure that disabling hides the element. element.SetVisible(true); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(3000), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(3000), kStartHeadPose)); EXPECT_EQ(element.opacity_when_visible(), element.opacity()); element.RefreshVisible(); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(3000), kForwardVector)); - EXPECT_FALSE(element.DoBeginFrame(MsToTicks(4000), kForwardVector)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(3000), kStartHeadPose)); + EXPECT_FALSE(element.DoBeginFrame(MsToTicks(4000), kStartHeadPose)); EXPECT_EQ(element.opacity_when_visible(), element.opacity()); element.SetVisible(false); EXPECT_EQ(0.0f, element.opacity()); @@ -108,31 +108,31 @@ parent->AddChild(std::move(element)); // Child hidden because parent is hidden. - EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(0), kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(0), kStartHeadPose)); EXPECT_FALSE(child->IsVisible()); EXPECT_FALSE(parent->IsVisible()); // Setting visiblity on parent should make the child visible. parent->SetVisible(true); scene.set_dirty(); - EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(10), kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(10), kStartHeadPose)); EXPECT_TRUE(child->IsVisible()); EXPECT_TRUE(parent->IsVisible()); // Make sure the elements go away. - EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(2010), kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(2010), kStartHeadPose)); EXPECT_FALSE(child->IsVisible()); EXPECT_FALSE(parent->IsVisible()); // Test again, but this time manually set the visibility to false. parent->SetVisible(true); scene.set_dirty(); - EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(2020), kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(2020), kStartHeadPose)); EXPECT_TRUE(child->IsVisible()); EXPECT_TRUE(parent->IsVisible()); parent->SetVisible(false); scene.set_dirty(); - EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(2030), kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(2030), kStartHeadPose)); EXPECT_FALSE(child->IsVisible()); EXPECT_FALSE(parent->IsVisible()); } @@ -170,16 +170,16 @@ // Make element visible. element().SetVisible(true); - EXPECT_FALSE(element().DoBeginFrame(MsToTicks(10), kForwardVector)); + EXPECT_FALSE(element().DoBeginFrame(MsToTicks(10), kStartHeadPose)); EXPECT_EQ(element().opacity_when_visible(), element().opacity()); // Signal, element should still be visible since time < min duration. element().Signal(true); - EXPECT_FALSE(element().DoBeginFrame(MsToTicks(200), kForwardVector)); + EXPECT_FALSE(element().DoBeginFrame(MsToTicks(200), kStartHeadPose)); EXPECT_EQ(element().opacity_when_visible(), element().opacity()); // Element hides and callback triggered. - EXPECT_TRUE(element().DoBeginFrame(MsToTicks(2010), kForwardVector)); + EXPECT_TRUE(element().DoBeginFrame(MsToTicks(2010), kStartHeadPose)); EXPECT_EQ(0.0f, element().opacity()); EXPECT_TRUE(callback_triggered()); EXPECT_EQ(TransientElementHideReason::kSignal, hide_reason()); @@ -191,15 +191,15 @@ // Make element visible. element().SetVisible(true); - EXPECT_FALSE(element().DoBeginFrame(MsToTicks(10), kForwardVector)); + EXPECT_FALSE(element().DoBeginFrame(MsToTicks(10), kStartHeadPose)); EXPECT_EQ(element().opacity_when_visible(), element().opacity()); // Element should be visible since we haven't signalled. - EXPECT_FALSE(element().DoBeginFrame(MsToTicks(2010), kForwardVector)); + EXPECT_FALSE(element().DoBeginFrame(MsToTicks(2010), kStartHeadPose)); EXPECT_EQ(element().opacity_when_visible(), element().opacity()); // Element hides and callback triggered. - EXPECT_TRUE(element().DoBeginFrame(MsToTicks(6010), kForwardVector)); + EXPECT_TRUE(element().DoBeginFrame(MsToTicks(6010), kStartHeadPose)); EXPECT_EQ(0.0f, element().opacity()); EXPECT_TRUE(callback_triggered()); EXPECT_EQ(TransientElementHideReason::kTimeout, hide_reason()); @@ -211,17 +211,17 @@ // Enable, and ensure that the element is visible. element().SetVisible(true); EXPECT_EQ(element().opacity_when_visible(), element().opacity()); - EXPECT_FALSE(element().DoBeginFrame(MsToTicks(0), kForwardVector)); - EXPECT_FALSE(element().DoBeginFrame(MsToTicks(1000), kForwardVector)); + EXPECT_FALSE(element().DoBeginFrame(MsToTicks(0), kStartHeadPose)); + EXPECT_FALSE(element().DoBeginFrame(MsToTicks(1000), kStartHeadPose)); element().Signal(true); // Refresh visibility, and ensure that the element still transiently // disappears, but at a later time. element().RefreshVisible(); - EXPECT_FALSE(element().DoBeginFrame(MsToTicks(1000), kForwardVector)); - EXPECT_FALSE(element().DoBeginFrame(MsToTicks(2500), kForwardVector)); + EXPECT_FALSE(element().DoBeginFrame(MsToTicks(1000), kStartHeadPose)); + EXPECT_FALSE(element().DoBeginFrame(MsToTicks(2500), kStartHeadPose)); EXPECT_EQ(element().opacity_when_visible(), element().opacity()); - EXPECT_TRUE(element().DoBeginFrame(MsToTicks(3000), kForwardVector)); + EXPECT_TRUE(element().DoBeginFrame(MsToTicks(3000), kStartHeadPose)); EXPECT_EQ(0.0f, element().opacity()); EXPECT_EQ(TransientElementHideReason::kSignal, hide_reason()); }
diff --git a/chrome/browser/vr/elements/ui_element.cc b/chrome/browser/vr/elements/ui_element.cc index 4b1f0978..66b5e317 100644 --- a/chrome/browser/vr/elements/ui_element.cc +++ b/chrome/browser/vr/elements/ui_element.cc
@@ -174,7 +174,7 @@ } bool UiElement::DoBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) { + const gfx::Transform& head_pose) { // TODO(mthiesse): This is overly cautious. We may have animations but not // trigger any updates, so we should refine this logic and have // AnimationPlayer::Tick return a boolean. @@ -182,7 +182,7 @@ animation_player_.Tick(time); last_frame_time_ = time; set_update_phase(kUpdatedAnimations); - bool begin_frame_updated = OnBeginFrame(time, look_at); + bool begin_frame_updated = OnBeginFrame(time, head_pose); UpdateComputedOpacity(); bool was_visible_at_any_point = IsVisible() || updated_visibility_this_frame_; return (begin_frame_updated || animations_updated) && @@ -190,7 +190,7 @@ } bool UiElement::OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) { + const gfx::Transform& head_pose) { return false; }
diff --git a/chrome/browser/vr/elements/ui_element.h b/chrome/browser/vr/elements/ui_element.h index e3fb5eb..a82eeb8 100644 --- a/chrome/browser/vr/elements/ui_element.h +++ b/chrome/browser/vr/elements/ui_element.h
@@ -136,7 +136,7 @@ // Returns true if the element has been updated in any visible way. bool DoBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& head_direction); + const gfx::Transform& head_pose); // Indicates whether the element should be tested for cursor input. bool IsHitTestable() const; @@ -444,7 +444,7 @@ // Returns true if the element has been updated in any visible way. virtual bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at); + const gfx::Transform& head_pose); // Valid IDs are non-negative. int id_ = -1;
diff --git a/chrome/browser/vr/elements/ui_element_name.cc b/chrome/browser/vr/elements/ui_element_name.cc index 3687101..8922f521 100644 --- a/chrome/browser/vr/elements/ui_element_name.cc +++ b/chrome/browser/vr/elements/ui_element_name.cc
@@ -14,6 +14,7 @@ static const char* g_ui_element_name_strings[] = { "kNone", "kRoot", + "k2dBrowsingRepositioner", "k2dBrowsingRoot", "k2dBrowsingBackground", "k2dBrowsingDefaultBackground", @@ -24,6 +25,7 @@ "kWebVrRoot", "kWebVrViewportAwareRoot", "kContentQuad", + "kContentQuadShadow", "kControllerRoot", "kControllerGroup", "kLaser", @@ -35,6 +37,7 @@ "kBackplane", "kCeiling", "kFloor", + "kStars", "kUrlBarDmmRoot", "kUrlBar", "kOmniboxVisibiltyControlForVoice",
diff --git a/chrome/browser/vr/elements/ui_element_name.h b/chrome/browser/vr/elements/ui_element_name.h index b0ef1ff..f0764a1 100644 --- a/chrome/browser/vr/elements/ui_element_name.h +++ b/chrome/browser/vr/elements/ui_element_name.h
@@ -13,6 +13,7 @@ enum UiElementName { kNone = 0, kRoot, + k2dBrowsingRepositioner, k2dBrowsingRoot, k2dBrowsingBackground, k2dBrowsingDefaultBackground, @@ -23,6 +24,7 @@ kWebVrRoot, kWebVrViewportAwareRoot, kContentQuad, + kContentQuadShadow, kControllerRoot, kControllerGroup, kLaser, @@ -34,6 +36,7 @@ kBackplane, kCeiling, kFloor, + kStars, kUrlBarDmmRoot, kUrlBar, kOmniboxVisibiltyControlForVoice,
diff --git a/chrome/browser/vr/elements/ui_element_unittest.cc b/chrome/browser/vr/elements/ui_element_unittest.cc index a52c8533..aad6e42 100644 --- a/chrome/browser/vr/elements/ui_element_unittest.cc +++ b/chrome/browser/vr/elements/ui_element_unittest.cc
@@ -109,10 +109,10 @@ UiElement* rect_ptr = rect.get(); scene.AddUiElement(kRoot, std::move(rect)); base::TimeTicks start_time = MicrosecondsToTicks(1); - EXPECT_TRUE(scene.OnBeginFrame(start_time, kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(start_time, kStartHeadPose)); EXPECT_FLOAT_SIZE_EQ(gfx::SizeF(10, 100), rect_ptr->size()); EXPECT_TRUE(scene.OnBeginFrame(start_time + MicrosecondsToDelta(10000), - kForwardVector)); + kStartHeadPose)); EXPECT_FLOAT_SIZE_EQ(gfx::SizeF(20, 200), rect_ptr->size()); } @@ -130,13 +130,13 @@ 2, 2, from_operations, to_operations, MicrosecondsToDelta(10000))); base::TimeTicks start_time = MicrosecondsToTicks(1); - EXPECT_TRUE(scene.OnBeginFrame(start_time, kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(start_time, kStartHeadPose)); gfx::Point3F p; rect_ptr->LocalTransform().TransformPoint(&p); EXPECT_VECTOR3DF_EQ(gfx::Vector3dF(10, 100, 1000), p); p = gfx::Point3F(); EXPECT_TRUE(scene.OnBeginFrame(start_time + MicrosecondsToDelta(10000), - kForwardVector)); + kStartHeadPose)); rect_ptr->LocalTransform().TransformPoint(&p); EXPECT_VECTOR3DF_EQ(gfx::Vector3dF(20, 200, 2000), p); }
diff --git a/chrome/browser/vr/elements/vector_icon_unittest.cc b/chrome/browser/vr/elements/vector_icon_unittest.cc index e59d2cc0..eae860e 100644 --- a/chrome/browser/vr/elements/vector_icon_unittest.cc +++ b/chrome/browser/vr/elements/vector_icon_unittest.cc
@@ -44,7 +44,7 @@ UiTexture* texture = icon->GetTexture(); scene.AddUiElement(kRoot, std::move(icon)); base::TimeTicks start_time = MsToTicks(1); - scene.OnBeginFrame(start_time, kForwardVector); + scene.OnBeginFrame(start_time, kStartHeadPose); InSequence scope; cc::MockCanvas canvas;
diff --git a/chrome/browser/vr/elements/viewport_aware_root.cc b/chrome/browser/vr/elements/viewport_aware_root.cc index fcc7c374..8885d92 100644 --- a/chrome/browser/vr/elements/viewport_aware_root.cc +++ b/chrome/browser/vr/elements/viewport_aware_root.cc
@@ -6,6 +6,7 @@ #include <cmath> +#include "chrome/browser/vr/pose_util.h" #include "ui/gfx/geometry/angle_conversions.h" namespace vr { @@ -41,8 +42,9 @@ ViewportAwareRoot::~ViewportAwareRoot() = default; bool ViewportAwareRoot::OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& head_direction) { - return AdjustRotationForHeadPose(head_direction); + const gfx::Transform& head_pose) { + gfx::Vector3dF look_at = vr::GetForwardVector(head_pose); + return AdjustRotationForHeadPose(look_at); } bool ViewportAwareRoot::AdjustRotationForHeadPose( @@ -89,9 +91,4 @@ return ElementHasVisibleChildren(this); } -void ViewportAwareRoot::OnUpdatedWorldSpaceTransform() { - // We must not inherit a transform. - DCHECK(parent()->world_space_transform().IsIdentity()); -} - } // namespace vr
diff --git a/chrome/browser/vr/elements/viewport_aware_root.h b/chrome/browser/vr/elements/viewport_aware_root.h index 3e28187..29cf0f3 100644 --- a/chrome/browser/vr/elements/viewport_aware_root.h +++ b/chrome/browser/vr/elements/viewport_aware_root.h
@@ -31,8 +31,7 @@ private: bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& head_direction) override; - void OnUpdatedWorldSpaceTransform() override; + const gfx::Transform& head_pose) override; float viewport_aware_total_rotation_ = 0.f; bool children_visible_ = false;
diff --git a/chrome/browser/vr/elements/viewport_aware_root_unittest.cc b/chrome/browser/vr/elements/viewport_aware_root_unittest.cc index ab6df2a..153718e6 100644 --- a/chrome/browser/vr/elements/viewport_aware_root_unittest.cc +++ b/chrome/browser/vr/elements/viewport_aware_root_unittest.cc
@@ -14,6 +14,7 @@ #include "chrome/browser/vr/ui_scene.h" #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/geometry/insets_f.h" +#include "ui/gfx/geometry/quaternion.h" #include "ui/gfx/transform.h" namespace vr { @@ -131,12 +132,14 @@ viewport_root->Reset(); } - bool AnimateWithHeadPose(base::TimeDelta delta, - const gfx::Vector3dF& head_pose) { + bool AnimateWithForwardVector(base::TimeDelta delta, + const gfx::Vector3dF& forward_vector) { base::TimeTicks target_time = current_time_ + delta; base::TimeDelta frame_duration = base::TimeDelta::FromSecondsD(1.0 / kFramesPerSecond); bool changed = false; + gfx::Quaternion head_movement_quat(forward_vector, {0.f, 0.f, -1.f}); + gfx::Transform head_pose(head_movement_quat); for (; current_time_ < target_time; current_time_ += frame_duration) { if (scene_->OnBeginFrame(current_time_, head_pose)) changed = true; @@ -167,56 +170,56 @@ TEST_F(ViewportAwareRootTest, ChildElementsRepositioned) { gfx::Vector3dF look_at{0.f, 0.f, -1.f}; - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(0), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(0), look_at)); EXPECT_TRUE(Point3FAreNearlyEqual(gfx::Point3F(0.f, 0.f, -1.f), viewport_element->GetCenter())); // This should trigger reposition of viewport aware elements. RotateAboutYAxis(90.f, &look_at); - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(10), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(10), look_at)); EXPECT_TRUE(Point3FAreNearlyEqual(gfx::Point3F(-1.f, 0.f, 0.f), viewport_element->GetCenter())); } TEST_F(ViewportAwareRootTest, ChildElementsHasOpacityAnimation) { gfx::Vector3dF look_at{0.f, 0.f, -1.f}; - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(0), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(0), look_at)); EXPECT_TRUE(viewport_element->IsVisible()); // Trigger a reposition. RotateAboutYAxis(90.f, &look_at); - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(5), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(5), look_at)); // Initially the element should be invisible and then animate to its full // opacity. EXPECT_FALSE(viewport_element->IsVisible()); - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(50), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(50), look_at)); EXPECT_TRUE(viewport_element->IsVisible()); EXPECT_TRUE(IsAnimating(viewport_root, {OPACITY})); - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(500), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(500), look_at)); EXPECT_TRUE(viewport_element->IsVisible()); EXPECT_FALSE(IsAnimating(viewport_root, {OPACITY})); } TEST_F(ViewportAwareRootTest, ResetPositionWhenReshow) { gfx::Vector3dF look_at{0.f, 0.f, -1.f}; - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(0), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(0), look_at)); gfx::Point3F original_position = viewport_element->GetCenter(); RotateAboutYAxis(90.f, &look_at); - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(10), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(10), look_at)); RotateAboutYAxis(-60.f, &look_at); - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(20), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(20), look_at)); // Viewport element should have 90 - 60 = 30 degrees rotation. EXPECT_TRUE(Point3FAreNearlyEqual(gfx::Point3F(-0.5f, 0.f, -0.866025f), viewport_element->GetCenter())); // Hide all children and then reshow later should reset children's position. viewport_element->SetVisibleImmediately(false); - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(30), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(30), look_at)); viewport_element->SetVisibleImmediately(true); - EXPECT_TRUE(AnimateWithHeadPose(MsToDelta(40), look_at)); + EXPECT_TRUE(AnimateWithForwardVector(MsToDelta(40), look_at)); EXPECT_TRUE( Point3FAreNearlyEqual(original_position, viewport_element->GetCenter())); }
diff --git a/chrome/browser/vr/features.gni b/chrome/browser/vr/features.gni index 9707e9d7..cf92927 100644 --- a/chrome/browser/vr/features.gni +++ b/chrome/browser/vr/features.gni
@@ -8,6 +8,6 @@ assert(enable_vr) declare_args() { - # Whether to register and subsequently download the VR assets component. - register_vr_assets_component = is_chrome_branded + # Whether to register, download, etc. the VR assets component. + use_vr_assets_component = is_chrome_branded }
diff --git a/chrome/browser/vr/metrics_helper.cc b/chrome/browser/vr/metrics_helper.cc index cacdeb3..7eec7c0 100644 --- a/chrome/browser/vr/metrics_helper.cc +++ b/chrome/browser/vr/metrics_helper.cc
@@ -25,6 +25,8 @@ "VR.Component.Assets.DurationUntilReady.OnEnter.WebVRPresentation"; constexpr char kLatencyLaunchBrowser[] = "VR.Component.Assets.DurationUntilReady.OnChromeStart"; +constexpr char kLatencyRegisterComponent[] = + "VR.Component.Assets.DurationUntilReady.OnRegisterComponent"; // TODO(tiborg): Rename VRAssetsComponentStatus and VRAssetsLoadStatus in // enums.xml and consider merging them. constexpr char kComponentUpdateStatus[] = @@ -135,19 +137,25 @@ void MetricsHelper::OnComponentReady(const base::Version& version) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); component_ready_ = true; - auto now = base::Time::Now(); + auto now = base::TimeTicks::Now(); LogLatencyIfWaited(Mode::kVrBrowsing, now); LogLatencyIfWaited(Mode::kWebVr, now); OnComponentUpdated(AssetsComponentUpdateStatus::kSuccess, version); - if (logged_ready_duration_on_chrome_start_) { - return; + if (!logged_ready_duration_on_chrome_start_) { + DCHECK(chrome_start_time_); + auto ready_duration = now - *chrome_start_time_; + UMA_HISTOGRAM_CUSTOM_TIMES(kLatencyLaunchBrowser, ready_duration, + kMinLatency, kMaxLatency, kLatencyBucketCount); + logged_ready_duration_on_chrome_start_ = true; } - DCHECK(chrome_start_time_); - auto ready_duration = now - *chrome_start_time_; - UMA_HISTOGRAM_CUSTOM_TIMES(kLatencyLaunchBrowser, ready_duration, kMinLatency, - kMaxLatency, kLatencyBucketCount); - logged_ready_duration_on_chrome_start_ = true; + if (!logged_ready_duration_on_component_register_) { + DCHECK(component_register_time_); + auto ready_duration = now - *component_register_time_; + UMA_HISTOGRAM_CUSTOM_TIMES(kLatencyRegisterComponent, ready_duration, + kMinLatency, kMaxLatency, kLatencyBucketCount); + logged_ready_duration_on_component_register_ = true; + } } void MetricsHelper::OnEnter(Mode mode) { @@ -163,15 +171,18 @@ LogStatus(mode, component_ready_ ? ComponentStatus::kReady : ComponentStatus::kUnreadyOther); if (!component_ready_) { - enter_time = base::Time::Now(); + enter_time = base::TimeTicks::Now(); } } void MetricsHelper::OnRegisteredComponent() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); UMA_HISTOGRAM_ENUMERATION( kNetworkConnectionTypeRegisterComponent, net::NetworkChangeNotifier::GetConnectionType(), net::NetworkChangeNotifier::ConnectionType::CONNECTION_LAST + 1); + DCHECK(!component_register_time_); + component_register_time_ = base::TimeTicks::Now(); } void MetricsHelper::OnComponentUpdated( @@ -194,10 +205,10 @@ void MetricsHelper::OnChromeStarted() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!chrome_start_time_); - chrome_start_time_ = base::Time::Now(); + chrome_start_time_ = base::TimeTicks::Now(); } -base::Optional<base::Time>& MetricsHelper::GetEnterTime(Mode mode) { +base::Optional<base::TimeTicks>& MetricsHelper::GetEnterTime(Mode mode) { switch (mode) { case Mode::kVr: return enter_vr_time_; @@ -211,7 +222,7 @@ } } -void MetricsHelper::LogLatencyIfWaited(Mode mode, const base::Time& now) { +void MetricsHelper::LogLatencyIfWaited(Mode mode, const base::TimeTicks& now) { auto& enter_time = GetEnterTime(mode); if (enter_time) { LogLatency(mode, now - *enter_time);
diff --git a/chrome/browser/vr/metrics_helper.h b/chrome/browser/vr/metrics_helper.h index 3a23309..6ea1ece 100644 --- a/chrome/browser/vr/metrics_helper.h +++ b/chrome/browser/vr/metrics_helper.h
@@ -38,14 +38,16 @@ void OnChromeStarted(); private: - base::Optional<base::Time>& GetEnterTime(Mode mode); - void LogLatencyIfWaited(Mode mode, const base::Time& now); + base::Optional<base::TimeTicks>& GetEnterTime(Mode mode); + void LogLatencyIfWaited(Mode mode, const base::TimeTicks& now); - base::Optional<base::Time> enter_vr_time_; - base::Optional<base::Time> enter_vr_browsing_time_; - base::Optional<base::Time> enter_web_vr_time_; - base::Optional<base::Time> chrome_start_time_; + base::Optional<base::TimeTicks> enter_vr_time_; + base::Optional<base::TimeTicks> enter_vr_browsing_time_; + base::Optional<base::TimeTicks> enter_web_vr_time_; + base::Optional<base::TimeTicks> chrome_start_time_; bool logged_ready_duration_on_chrome_start_ = false; + base::Optional<base::TimeTicks> component_register_time_; + bool logged_ready_duration_on_component_register_ = false; bool component_ready_ = false; SEQUENCE_CHECKER(sequence_checker_);
diff --git a/chrome/browser/vr/model/assets.cc b/chrome/browser/vr/model/assets.cc new file mode 100644 index 0000000..c1d331ef --- /dev/null +++ b/chrome/browser/vr/model/assets.cc
@@ -0,0 +1,14 @@ +// Copyright 2018 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/vr/model/assets.h" + +#include "third_party/skia/include/core/SkBitmap.h" + +namespace vr { + +Assets::Assets() = default; +Assets::~Assets() = default; + +} // namespace vr
diff --git a/chrome/browser/vr/model/assets.h b/chrome/browser/vr/model/assets.h new file mode 100644 index 0000000..ff402e0 --- /dev/null +++ b/chrome/browser/vr/model/assets.h
@@ -0,0 +1,37 @@ +// Copyright 2018 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_VR_MODEL_ASSETS_H_ +#define CHROME_BROWSER_VR_MODEL_ASSETS_H_ + +#include <memory> + +#include "base/version.h" + +class SkBitmap; + +namespace vr { + +struct Assets { + Assets(); + ~Assets(); + + // This is required. This image (and the gradients below) are destroyed after + // they are uploaded to the GPU. So while this image is never initially null + // after a successful load, after the image has been consumed, it will be. + std::unique_ptr<SkBitmap> background; + + // For backwards compatibility, we may not have these gradients in the + // component. Receiving code must be able to cope with these gradient images + // not existing. + std::unique_ptr<SkBitmap> normal_gradient; + std::unique_ptr<SkBitmap> incognito_gradient; + std::unique_ptr<SkBitmap> fullscreen_gradient; + + base::Version version; +}; + +} // namespace vr + +#endif // CHROME_BROWSER_VR_MODEL_ASSETS_H_
diff --git a/chrome/browser/vr/model/color_scheme.cc b/chrome/browser/vr/model/color_scheme.cc index f651d48..3aaf045 100644 --- a/chrome/browser/vr/model/color_scheme.cc +++ b/chrome/browser/vr/model/color_scheme.cc
@@ -141,6 +141,10 @@ normal_scheme.snackbar_button_colors.background_hover = 0xDD2D2D2D; normal_scheme.snackbar_button_colors.background_down = 0xDD2D2D2D; + normal_scheme.normal_factor = 1.0f; + normal_scheme.incognito_factor = 0.0f; + normal_scheme.fullscreen_factor = 0.0f; + g_fullscreen_scheme.Get() = normal_scheme; ColorScheme& fullscreen_scheme = g_fullscreen_scheme.Get(); fullscreen_scheme.world_background = 0xFF000714; @@ -168,6 +172,10 @@ fullscreen_scheme.system_indicator_background = fullscreen_scheme.element_background; + fullscreen_scheme.normal_factor = 0.0f; + fullscreen_scheme.incognito_factor = 0.0f; + fullscreen_scheme.fullscreen_factor = 1.0f; + g_incognito_scheme.Get() = normal_scheme; ColorScheme& incognito_scheme = g_incognito_scheme.Get(); incognito_scheme.world_background = 0xFF2E2E2E; @@ -238,6 +246,10 @@ incognito_scheme.suggestion_button_colors.background_hover = 0xFF656565; incognito_scheme.suggestion_button_colors.background_down = 0xFF656565; + incognito_scheme.normal_factor = 0.0f; + incognito_scheme.incognito_factor = 1.0f; + incognito_scheme.fullscreen_factor = 0.0f; + initialized = true; }
diff --git a/chrome/browser/vr/model/color_scheme.h b/chrome/browser/vr/model/color_scheme.h index 684a07d6..de83df1 100644 --- a/chrome/browser/vr/model/color_scheme.h +++ b/chrome/browser/vr/model/color_scheme.h
@@ -114,6 +114,13 @@ SkColor snackbar_foreground; ButtonColors snackbar_button_colors; + // These are used for blending between colors that are available only in + // shaders. They are, as you might expect, one for a given mode, but zero + // otherwise. + float normal_factor = 0.0f; + float incognito_factor = 0.0f; + float fullscreen_factor = 0.0f; + SkColor cursor; };
diff --git a/chrome/browser/vr/model/model.cc b/chrome/browser/vr/model/model.cc index 78dce31..beab13f 100644 --- a/chrome/browser/vr/model/model.cc +++ b/chrome/browser/vr/model/model.cc
@@ -6,6 +6,26 @@ namespace vr { +namespace { + +bool IsOpaqueUiMode(UiMode mode) { + switch (mode) { + case kModeBrowsing: + case kModeFullscreen: + case kModeWebVr: + case kModeWebVrAutopresented: + case kModeVoiceSearch: + case kModeEditingOmnibox: + return true; + case kModeRepositionWindow: + return false; + } + NOTREACHED(); + return true; +} + +} // namespace + Model::Model() {} Model::~Model() {} @@ -19,4 +39,73 @@ return ColorScheme::GetColorScheme(mode); } +void Model::push_mode(UiMode mode) { + if (!ui_modes.empty() && ui_modes.back() == mode) + return; + ui_modes.push_back(mode); +} + +void Model::pop_mode() { + pop_mode(ui_modes.back()); +} + +void Model::pop_mode(UiMode mode) { + if (ui_modes.empty() || ui_modes.back() != mode) + return; + // We should always have a mode to be in when we're clearing a mode. + DCHECK_GE(ui_modes.size(), 2u); + ui_modes.pop_back(); +} + +void Model::toggle_mode(UiMode mode) { + if (!ui_modes.empty() && ui_modes.back() == mode) { + pop_mode(mode); + return; + } + push_mode(mode); +} + +UiMode Model::get_last_opaque_mode() const { + for (auto iter = ui_modes.rbegin(); iter != ui_modes.rend(); ++iter) { + if (IsOpaqueUiMode(*iter)) + return *iter; + } + DCHECK(false) << "get_last_opaque_mode should only be called with at least " + "one opaque mode."; + return kModeBrowsing; +} + +bool Model::browsing_enabled() const { + return !web_vr_enabled(); +} + +bool Model::default_browsing_enabled() const { + return get_last_opaque_mode() == kModeBrowsing; +} + +bool Model::voice_search_enabled() const { + return get_last_opaque_mode() == kModeVoiceSearch; +} + +bool Model::omnibox_editing_enabled() const { + return get_last_opaque_mode() == kModeEditingOmnibox; +} + +bool Model::fullscreen_enabled() const { + return get_last_opaque_mode() == kModeFullscreen; +} + +bool Model::web_vr_enabled() const { + return get_last_opaque_mode() == kModeWebVr || + get_last_opaque_mode() == kModeWebVrAutopresented; +} + +bool Model::web_vr_autopresentation_enabled() const { + return get_last_opaque_mode() == kModeWebVrAutopresented; +} + +bool Model::reposition_window_enabled() const { + return ui_modes.back() == kModeRepositionWindow; +} + } // namespace vr
diff --git a/chrome/browser/vr/model/model.h b/chrome/browser/vr/model/model.h index 90b10657..601f4fc 100644 --- a/chrome/browser/vr/model/model.h +++ b/chrome/browser/vr/model/model.h
@@ -48,37 +48,19 @@ WebVrModel web_vr; std::vector<UiMode> ui_modes; - void push_mode(UiMode mode) { - if (!ui_modes.empty() && ui_modes.back() == mode) - return; - ui_modes.push_back(mode); - } - void pop_mode() { pop_mode(ui_modes.back()); } - void pop_mode(UiMode mode) { - if (ui_modes.empty() || ui_modes.back() != mode) - return; - // We should always have a mode to be in when we're clearing a mode. - DCHECK_GE(ui_modes.size(), 2u); - ui_modes.pop_back(); - } - bool browsing_enabled() const { return !web_vr_enabled(); } - bool default_browsing_enabled() const { - return ui_modes.back() == kModeBrowsing; - } - bool voice_search_enabled() const { - return ui_modes.back() == kModeVoiceSearch; - } - bool omnibox_editing_enabled() const { - return ui_modes.back() == kModeEditingOmnibox; - } - bool fullscreen_enabled() const { return ui_modes.back() == kModeFullscreen; } - bool web_vr_enabled() const { - return ui_modes.back() == kModeWebVr || - ui_modes.back() == kModeWebVrAutopresented; - } - bool web_vr_autopresentation_enabled() const { - return ui_modes.back() == kModeWebVrAutopresented; - } + void push_mode(UiMode mode); + void pop_mode(); + void pop_mode(UiMode mode); + void toggle_mode(UiMode mode); + UiMode get_last_opaque_mode() const; + bool browsing_enabled() const; + bool default_browsing_enabled() const; + bool voice_search_enabled() const; + bool omnibox_editing_enabled() const; + bool fullscreen_enabled() const; + bool web_vr_enabled() const; + bool web_vr_autopresentation_enabled() const; + bool reposition_window_enabled() const; // Focused text state. bool editing_input = false;
diff --git a/chrome/browser/vr/model/ui_mode.h b/chrome/browser/vr/model/ui_mode.h index 1c926f6..e0854b24c 100644 --- a/chrome/browser/vr/model/ui_mode.h +++ b/chrome/browser/vr/model/ui_mode.h
@@ -8,12 +8,18 @@ namespace vr { enum UiMode { + // Opaque modes. These modes should hide previous opaque UiMode. kModeBrowsing, kModeFullscreen, kModeWebVr, kModeWebVrAutopresented, kModeVoiceSearch, kModeEditingOmnibox, + + // Translucent modes. These modes should NOT hide previous opaque UiMode. + // This is useful for modal style UiMode which should not hide kModeBrowsing + // for example. + kModeRepositionWindow, }; } // namespace vr
diff --git a/chrome/browser/vr/service/vr_display_host.cc b/chrome/browser/vr/service/vr_display_host.cc index 45951236..2af22bb9 100644 --- a/chrome/browser/vr/service/vr_display_host.cc +++ b/chrome/browser/vr/service/vr_display_host.cc
@@ -51,17 +51,18 @@ void VRDisplayHost::RequestPresent( device::mojom::VRSubmitFrameClientPtr client, device::mojom::VRPresentationProviderRequest request, + device::mojom::VRRequestPresentOptionsPtr options, RequestPresentCallback callback) { bool requires_secure_context = !kAllowHTTPWebVRWithFlag || !base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableWebVR); if (requires_secure_context && !IsSecureContext(render_frame_host_)) { - std::move(callback).Run(false); + std::move(callback).Run(false, nullptr); return; } display_->RequestPresent(std::move(client), std::move(request), - std::move(callback)); + std::move(options), std::move(callback)); } void VRDisplayHost::ExitPresent() {
diff --git a/chrome/browser/vr/service/vr_display_host.h b/chrome/browser/vr/service/vr_display_host.h index e91a061..6bc77cd 100644 --- a/chrome/browser/vr/service/vr_display_host.h +++ b/chrome/browser/vr/service/vr_display_host.h
@@ -36,6 +36,7 @@ void RequestPresent(device::mojom::VRSubmitFrameClientPtr client, device::mojom::VRPresentationProviderRequest request, + device::mojom::VRRequestPresentOptionsPtr options, RequestPresentCallback callback) override; void ExitPresent() override; void SetListeningForActivate(bool listening);
diff --git a/chrome/browser/vr/target_property.cc b/chrome/browser/vr/target_property.cc index fbe66e5..c484a30 100644 --- a/chrome/browser/vr/target_property.cc +++ b/chrome/browser/vr/target_property.cc
@@ -8,7 +8,7 @@ namespace vr { -static_assert(TargetProperty::LAST_TARGET_PROPERTY < +static_assert(TargetProperty::NUM_TARGET_PROPERTIES - 1 < cc::kMaxTargetPropertyIndex, "The number of vr target properties has exceeded the capacity of" " TargetProperties");
diff --git a/chrome/browser/vr/target_property.h b/chrome/browser/vr/target_property.h index 48936c7..4fa4b30 100644 --- a/chrome/browser/vr/target_property.h +++ b/chrome/browser/vr/target_property.h
@@ -20,9 +20,12 @@ SPINNER_ANGLE_SWEEP, SPINNER_ROTATION, CIRCLE_GROW, + NORMAL_COLOR_FACTOR, + INCOGNITO_COLOR_FACTOR, + FULLSCREEN_COLOR_FACTOR, // This must be last. - LAST_TARGET_PROPERTY = SPINNER_ROTATION, + NUM_TARGET_PROPERTIES }; } // namespace vr
diff --git a/chrome/browser/vr/test/constants.h b/chrome/browser/vr/test/constants.h index 29c471a..641c292e4 100644 --- a/chrome/browser/vr/test/constants.h +++ b/chrome/browser/vr/test/constants.h
@@ -28,7 +28,7 @@ 0.0f, -1.0f, 0.0f); - +static const gfx::Transform kStartHeadPose; static const gfx::Vector3dF kForwardVector(0.0f, 0.0f, -1.0f); static const gfx::Vector3dF kBackwardVector(0.0f, 0.0f, 1.0f);
diff --git a/chrome/browser/vr/test/fake_ui_element_renderer.cc b/chrome/browser/vr/test/fake_ui_element_renderer.cc index 82680d1..fb93706 100644 --- a/chrome/browser/vr/test/fake_ui_element_renderer.cc +++ b/chrome/browser/vr/test/fake_ui_element_renderer.cc
@@ -79,4 +79,8 @@ // last moment before calling into the UiElementRenderer. } +void FakeUiElementRenderer::DrawStars( + float t, + const gfx::Transform& model_view_proj_matrix) {} + } // namespace vr
diff --git a/chrome/browser/vr/test/fake_ui_element_renderer.h b/chrome/browser/vr/test/fake_ui_element_renderer.h index 8bb65fd..8486d84 100644 --- a/chrome/browser/vr/test/fake_ui_element_renderer.h +++ b/chrome/browser/vr/test/fake_ui_element_renderer.h
@@ -59,6 +59,9 @@ float opacity, float corner_radius) override; + void DrawStars(float t, + const gfx::Transform& model_view_proj_matrix) override; + private: float opacity_ = -1.f; float called_ = false;
diff --git a/chrome/browser/vr/test/gl_test_environment.cc b/chrome/browser/vr/test/gl_test_environment.cc index 091013a..465af89 100644 --- a/chrome/browser/vr/test/gl_test_environment.cc +++ b/chrome/browser/vr/test/gl_test_environment.cc
@@ -12,7 +12,7 @@ GlTestEnvironment::GlTestEnvironment(const gfx::Size frame_buffer_size) { // Setup offscreen GL context. - gl::GLImageTestSupport::InitializeGL(); + gl::GLImageTestSupport::InitializeGL(base::nullopt); surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); context_ = gl::init::CreateGLContext(nullptr, surface_.get(), gl::GLContextAttribs());
diff --git a/chrome/browser/vr/test/ui_pixel_test.cc b/chrome/browser/vr/test/ui_pixel_test.cc index 3dc9f59..ede5d63 100644 --- a/chrome/browser/vr/test/ui_pixel_test.cc +++ b/chrome/browser/vr/test/ui_pixel_test.cc
@@ -91,11 +91,8 @@ GestureList gesture_list; ReticleModel reticle_model; - EXPECT_TRUE(ui_->scene()->OnBeginFrame( - base::TimeTicks(), - gfx::Vector3dF(-render_info.head_pose.matrix().get(2, 0), - -render_info.head_pose.matrix().get(2, 1), - -render_info.head_pose.matrix().get(2, 2)))); + EXPECT_TRUE( + ui_->scene()->OnBeginFrame(base::TimeTicks(), render_info.head_pose)); ui_->input_manager()->HandleInput(MsToTicks(1), controller_model, &reticle_model, &gesture_list); ui_->OnControllerUpdated(controller_model, reticle_model);
diff --git a/chrome/browser/vr/test/ui_test.cc b/chrome/browser/vr/test/ui_test.cc index 60b88053..29ca11a7 100644 --- a/chrome/browser/vr/test/ui_test.cc +++ b/chrome/browser/vr/test/ui_test.cc
@@ -220,17 +220,17 @@ base::TimeDelta frame_time = base::TimeDelta::FromSecondsD(1.0 / 60.0); bool changed = false; for (; current_time_ < target_time; current_time_ += frame_time) { - if (scene_->OnBeginFrame(current_time_, kForwardVector)) + if (scene_->OnBeginFrame(current_time_, kStartHeadPose)) changed = true; } current_time_ = target_time; - if (scene_->OnBeginFrame(current_time_, kForwardVector)) + if (scene_->OnBeginFrame(current_time_, kStartHeadPose)) changed = true; return changed; } bool UiTest::OnBeginFrame() const { - return scene_->OnBeginFrame(current_time_, kForwardVector); + return scene_->OnBeginFrame(current_time_, kStartHeadPose); } bool UiTest::OnBeginFrame(base::TimeDelta delta) {
diff --git a/chrome/browser/vr/test/vr_browser_test.cc b/chrome/browser/vr/test/vr_browser_test.cc index 85d4346..4a929894 100644 --- a/chrome/browser/vr/test/vr_browser_test.cc +++ b/chrome/browser/vr/test/vr_browser_test.cc
@@ -18,31 +18,28 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/vr/test/vr_browser_test.h" -#include "chrome/common/chrome_features.h" #include "chrome/test/base/in_process_browser_test.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/web_contents.h" -#include "content/public/common/content_features.h" -#include "content/public/common/content_switches.h" #include "content/public/test/browser_test_utils.h" #include "url/gurl.h" namespace vr { -constexpr base::TimeDelta VrBrowserTest::kPollCheckIntervalShort; -constexpr base::TimeDelta VrBrowserTest::kPollCheckIntervalLong; -constexpr base::TimeDelta VrBrowserTest::kPollTimeoutShort; -constexpr base::TimeDelta VrBrowserTest::kPollTimeoutLong; -constexpr char VrBrowserTest::kVrOverrideEnvVar[]; -constexpr char VrBrowserTest::kVrOverrideVal[]; -constexpr char VrBrowserTest::kVrConfigPathEnvVar[]; -constexpr char VrBrowserTest::kVrConfigPathVal[]; -constexpr char VrBrowserTest::kVrLogPathEnvVar[]; -constexpr char VrBrowserTest::kVrLogPathVal[]; +constexpr base::TimeDelta VrBrowserTestBase::kPollCheckIntervalShort; +constexpr base::TimeDelta VrBrowserTestBase::kPollCheckIntervalLong; +constexpr base::TimeDelta VrBrowserTestBase::kPollTimeoutShort; +constexpr base::TimeDelta VrBrowserTestBase::kPollTimeoutLong; +constexpr char VrBrowserTestBase::kVrOverrideEnvVar[]; +constexpr char VrBrowserTestBase::kVrOverrideVal[]; +constexpr char VrBrowserTestBase::kVrConfigPathEnvVar[]; +constexpr char VrBrowserTestBase::kVrConfigPathVal[]; +constexpr char VrBrowserTestBase::kVrLogPathEnvVar[]; +constexpr char VrBrowserTestBase::kVrLogPathVal[]; -VrBrowserTest::VrBrowserTest() : env_(base::Environment::Create()) {} +VrBrowserTestBase::VrBrowserTestBase() : env_(base::Environment::Create()) {} -VrBrowserTest::~VrBrowserTest() = default; +VrBrowserTestBase::~VrBrowserTestBase() = default; // We need an std::string that is an absolute file path, which requires // platform-specific logic since Windows uses std::wstring instead of @@ -55,21 +52,24 @@ #define MAKE_ABSOLUTE(x) base::MakeAbsoluteFilePath(base::FilePath(x)).value() #endif -void VrBrowserTest::SetUp() { +void VrBrowserTestBase::SetUp() { // Set the environment variable to use the mock OpenVR client EXPECT_TRUE(env_->SetVar(kVrOverrideEnvVar, MAKE_ABSOLUTE(kVrOverrideVal))); EXPECT_TRUE( env_->SetVar(kVrConfigPathEnvVar, MAKE_ABSOLUTE(kVrConfigPathVal))); EXPECT_TRUE(env_->SetVar(kVrLogPathEnvVar, MAKE_ABSOLUTE(kVrLogPathVal))); - // Make sure the WebVR, Gamepad, and OpenVR features are enabled - base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableWebVR); - scoped_feature_list_.InitWithFeatures( - {features::kOpenVR, features::kGamepadExtensions}, {}); + // Set any command line flags that subclasses have set, e.g. enabling WebVR + // and OpenVR support + for (const auto& switch_string : append_switches_) { + base::CommandLine::ForCurrentProcess()->AppendSwitch(switch_string); + } + scoped_feature_list_.InitWithFeatures(enable_features_, {}); + InProcessBrowserTest::SetUp(); } -GURL VrBrowserTest::GetHtmlTestFile(const std::string& test_name) { +GURL VrBrowserTestBase::GetHtmlTestFile(const std::string& test_name) { return ui_test_utils::GetTestUrl( base::FilePath(FILE_PATH_LITERAL("vr/e2e_test_files/html")), #ifdef OS_WIN @@ -80,11 +80,11 @@ )); } -content::WebContents* VrBrowserTest::GetFirstTabWebContents() { +content::WebContents* VrBrowserTestBase::GetFirstTabWebContents() { return browser()->tab_strip_model()->GetWebContentsAt(0); } -void VrBrowserTest::LoadUrlAndAwaitInitialization(const GURL& url) { +void VrBrowserTestBase::LoadUrlAndAwaitInitialization(const GURL& url) { ui_test_utils::NavigateToURL(browser(), url); EXPECT_TRUE(PollJavaScriptBoolean( "isInitializationComplete()", kPollTimeoutShort, @@ -92,36 +92,35 @@ << "Timed out waiting for JavaScript test initialization."; } -bool VrBrowserTest::VrDisplayFound(content::WebContents* web_contents) { +bool VrBrowserTestBase::VrDisplayFound(content::WebContents* web_contents) { return RunJavaScriptAndExtractBoolOrFail("vrDisplay != null", web_contents); } -VrBrowserTest::TestStatus VrBrowserTest::CheckTestStatus( +VrBrowserTestBase::TestStatus VrBrowserTestBase::CheckTestStatus( content::WebContents* web_contents) { std::string result_string = RunJavaScriptAndExtractStringOrFail("resultString", web_contents); bool test_passed = RunJavaScriptAndExtractBoolOrFail("testPassed", web_contents); if (test_passed) { - return VrBrowserTest::TestStatus::STATUS_PASSED; + return VrBrowserTestBase::TestStatus::STATUS_PASSED; } else if (!test_passed && result_string == "") { - return VrBrowserTest::TestStatus::STATUS_RUNNING; - } else { - // !test_passed && result_string != "" - return VrBrowserTest::TestStatus::STATUS_FAILED; + return VrBrowserTestBase::TestStatus::STATUS_RUNNING; } + // !test_passed && result_string != "" + return VrBrowserTestBase::TestStatus::STATUS_FAILED; } -void VrBrowserTest::EndTest(content::WebContents* web_contents) { +void VrBrowserTestBase::EndTest(content::WebContents* web_contents) { switch (CheckTestStatus(web_contents)) { - case VrBrowserTest::TestStatus::STATUS_PASSED: + case VrBrowserTestBase::TestStatus::STATUS_PASSED: break; - case VrBrowserTest::TestStatus::STATUS_FAILED: + case VrBrowserTestBase::TestStatus::STATUS_FAILED: FAIL() << "JavaScript testharness failed with result: " << RunJavaScriptAndExtractStringOrFail("resultString", web_contents); break; - case VrBrowserTest::TestStatus::STATUS_RUNNING: + case VrBrowserTestBase::TestStatus::STATUS_RUNNING: FAIL() << "Attempted to end test in C++ without finishing in JavaScript"; break; default: @@ -129,16 +128,18 @@ } } -bool VrBrowserTest::PollJavaScriptBoolean(const std::string& bool_expression, - const base::TimeDelta& timeout, - content::WebContents* web_contents) { +bool VrBrowserTestBase::PollJavaScriptBoolean( + const std::string& bool_expression, + const base::TimeDelta& timeout, + content::WebContents* web_contents) { return BlockOnConditionUnsafe( base::BindRepeating(RunJavaScriptAndExtractBoolOrFail, bool_expression, web_contents), timeout); } -void VrBrowserTest::WaitOnJavaScriptStep(content::WebContents* web_contents) { +void VrBrowserTestBase::WaitOnJavaScriptStep( + content::WebContents* web_contents) { // Make sure we aren't trying to wait on a JavaScript test step without the // code to do so. bool code_available = RunJavaScriptAndExtractBoolOrFail( @@ -154,8 +155,8 @@ // Check what state we're in to make sure javascriptDone wasn't called // because the test failed. - VrBrowserTest::TestStatus test_status = CheckTestStatus(web_contents); - if (!success || test_status == VrBrowserTest::TestStatus::STATUS_FAILED) { + VrBrowserTestBase::TestStatus test_status = CheckTestStatus(web_contents); + if (!success || test_status == VrBrowserTestBase::TestStatus::STATUS_FAILED) { // Failure states: Either polling failed or polling succeeded, but because // the test failed. std::string reason; @@ -181,13 +182,13 @@ EXPECT_TRUE(content::ExecuteScript(web_contents, "javascriptDone = false")); } -void VrBrowserTest::ExecuteStepAndWait(const std::string& step_function, - content::WebContents* web_contents) { +void VrBrowserTestBase::ExecuteStepAndWait(const std::string& step_function, + content::WebContents* web_contents) { EXPECT_TRUE(content::ExecuteScript(web_contents, step_function)); WaitOnJavaScriptStep(web_contents); } -bool VrBrowserTest::BlockOnConditionUnsafe( +bool VrBrowserTestBase::BlockOnConditionUnsafe( base::RepeatingCallback<bool()> condition, const base::TimeDelta& timeout, const base::TimeDelta& period) { @@ -203,7 +204,7 @@ return successful; } -bool VrBrowserTest::RunJavaScriptAndExtractBoolOrFail( +bool VrBrowserTestBase::RunJavaScriptAndExtractBoolOrFail( const std::string& js_expression, content::WebContents* web_contents) { bool result; @@ -213,7 +214,7 @@ return result; } -std::string VrBrowserTest::RunJavaScriptAndExtractStringOrFail( +std::string VrBrowserTestBase::RunJavaScriptAndExtractStringOrFail( const std::string& js_expression, content::WebContents* web_contents) { std::string result;
diff --git a/chrome/browser/vr/test/vr_browser_test.h b/chrome/browser/vr/test/vr_browser_test.h index 9e19f3b..5bc95a1 100644 --- a/chrome/browser/vr/test/vr_browser_test.h +++ b/chrome/browser/vr/test/vr_browser_test.h
@@ -9,8 +9,11 @@ #include "base/environment.h" #include "base/test/scoped_feature_list.h" #include "base/time/time.h" +#include "chrome/common/chrome_features.h" #include "chrome/test/base/in_process_browser_test.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/content_features.h" +#include "content/public/common/content_switches.h" #include "url/gurl.h" #define REQUIRES_GPU(x) DISABLED_##x @@ -20,7 +23,7 @@ // Base browser test class for running VR-related tests. // This is essentially a C++ port of the way Android does similar tests in // //chrome/android/javatests/src/.../browser/vr_shell/VrTestFramework.java -class VrBrowserTest : public InProcessBrowserTest { +class VrBrowserTestBase : public InProcessBrowserTest { public: static constexpr base::TimeDelta kPollCheckIntervalShort = base::TimeDelta::FromMilliseconds(50); @@ -42,8 +45,8 @@ STATUS_FAILED = 2 }; - VrBrowserTest(); - ~VrBrowserTest() override; + VrBrowserTestBase(); + ~VrBrowserTestBase() override; void SetUp() override; @@ -114,10 +117,41 @@ protected: std::unique_ptr<base::Environment> env_; + std::vector<base::Feature> enable_features_; + std::vector<std::string> append_switches_; private: base::test::ScopedFeatureList scoped_feature_list_; - DISALLOW_COPY_AND_ASSIGN(VrBrowserTest); + DISALLOW_COPY_AND_ASSIGN(VrBrowserTestBase); +}; + +// Test class with standard features enabled: WebVR, OpenVR support, and the +// Gamepad API. +class VrBrowserTestStandard : public VrBrowserTestBase { + public: + VrBrowserTestStandard() { + append_switches_.push_back(switches::kEnableWebVR); + enable_features_.push_back(features::kOpenVR); + enable_features_.push_back(features::kGamepadExtensions); + } +}; + +// Test class with WebVR disabled. +class VrBrowserTestWebVrDisabled : public VrBrowserTestBase { + public: + VrBrowserTestWebVrDisabled() { + enable_features_.push_back(features::kOpenVR); + enable_features_.push_back(features::kGamepadExtensions); + } +}; + +// Test class with OpenVR support disabled. +class VrBrowserTestOpenVrDisabled : public VrBrowserTestBase { + public: + VrBrowserTestOpenVrDisabled() { + append_switches_.push_back(switches::kEnableWebVR); + enable_features_.push_back(features::kGamepadExtensions); + } }; } // namespace vr
diff --git a/chrome/browser/vr/test/vr_transition_utils.cc b/chrome/browser/vr/test/vr_transition_utils.cc index 0bae593..16cef88a 100644 --- a/chrome/browser/vr/test/vr_transition_utils.cc +++ b/chrome/browser/vr/test/vr_transition_utils.cc
@@ -18,13 +18,14 @@ void EnterPresentationAndWait(content::WebContents* web_contents) { EnterPresentation(web_contents); - VrBrowserTest::WaitOnJavaScriptStep(web_contents); + VrBrowserTestBase::WaitOnJavaScriptStep(web_contents); } void EnterPresentationOrFail(content::WebContents* web_contents) { EnterPresentation(web_contents); - EXPECT_TRUE(VrBrowserTest::PollJavaScriptBoolean( - "vrDisplay.isPresenting", VrBrowserTest::kPollTimeoutLong, web_contents)); + EXPECT_TRUE(VrBrowserTestBase::PollJavaScriptBoolean( + "vrDisplay.isPresenting", VrBrowserTestBase::kPollTimeoutLong, + web_contents)); } void ExitPresentation(content::WebContents* web_contents) { @@ -33,13 +34,13 @@ void ExitPresentationAndWait(content::WebContents* web_contents) { ExitPresentation(web_contents); - VrBrowserTest::WaitOnJavaScriptStep(web_contents); + VrBrowserTestBase::WaitOnJavaScriptStep(web_contents); } void ExitPresentationOrFail(content::WebContents* web_contents) { ExitPresentation(web_contents); - EXPECT_TRUE(VrBrowserTest::PollJavaScriptBoolean( - "vrDisplay.isPresenting == false", VrBrowserTest::kPollTimeoutLong, + EXPECT_TRUE(VrBrowserTestBase::PollJavaScriptBoolean( + "vrDisplay.isPresenting == false", VrBrowserTestBase::kPollTimeoutLong, web_contents)); }
diff --git a/chrome/browser/vr/testapp/vr_test_context.cc b/chrome/browser/vr/testapp/vr_test_context.cc index c36ba5b3..cd65840 100644 --- a/chrome/browser/vr/testapp/vr_test_context.cc +++ b/chrome/browser/vr/testapp/vr_test_context.cc
@@ -116,7 +116,7 @@ UpdateController(); // Update the render position of all UI elements (including desktop). - ui_->scene()->OnBeginFrame(current_time, kForwardVector); + ui_->scene()->OnBeginFrame(current_time, head_pose_); ui_->OnProjMatrixChanged(render_info.left_eye_model.proj_matrix); ui_->ui_renderer()->Draw(render_info); @@ -183,6 +183,9 @@ case ui::DomCode::US_C: model_->can_apply_new_background = true; break; + case ui::DomCode::US_P: + model_->toggle_mode(kModeRepositionWindow); + break; default: break; }
diff --git a/chrome/browser/vr/text_input_unittest.cc b/chrome/browser/vr/text_input_unittest.cc index b1a006c1..e0035e7 100644 --- a/chrome/browser/vr/text_input_unittest.cc +++ b/chrome/browser/vr/text_input_unittest.cc
@@ -175,14 +175,14 @@ scene.root_element().AddChild(std::move(instance)); // Text field is empty, so we should be showing hint text. - scene.OnBeginFrame(base::TimeTicks(), kForwardVector); + scene.OnBeginFrame(base::TimeTicks(), kStartHeadPose); EXPECT_GT(element->get_hint_element()->GetTargetOpacity(), 0); // When text enters the field, the hint should disappear. TextInputInfo info; info.text = base::UTF8ToUTF16("text"); element->UpdateInput(info); - scene.OnBeginFrame(base::TimeTicks(), kForwardVector); + scene.OnBeginFrame(base::TimeTicks(), kStartHeadPose); EXPECT_EQ(element->get_hint_element()->GetTargetOpacity(), 0); } @@ -201,7 +201,7 @@ float initial = element->get_cursor_element()->GetTargetOpacity(); EXPECT_EQ(initial, 0.f); for (int ms = 0; ms <= 2000; ms += 100) { - scene.OnBeginFrame(MsToTicks(ms), kForwardVector); + scene.OnBeginFrame(MsToTicks(ms), kStartHeadPose); EXPECT_EQ(initial, element->get_cursor_element()->GetTargetOpacity()); } @@ -210,7 +210,7 @@ initial = element->get_cursor_element()->GetTargetOpacity(); bool toggled = false; for (int ms = 0; ms <= 2000; ms += 100) { - scene.OnBeginFrame(MsToTicks(ms), kForwardVector); + scene.OnBeginFrame(MsToTicks(ms), kStartHeadPose); if (initial != element->get_cursor_element()->GetTargetOpacity()) toggled = true; }
diff --git a/chrome/browser/vr/ui.cc b/chrome/browser/vr/ui.cc index 08872e92..e83f786a 100644 --- a/chrome/browser/vr/ui.cc +++ b/chrome/browser/vr/ui.cc
@@ -15,6 +15,7 @@ #include "chrome/browser/vr/elements/text_input.h" #include "chrome/browser/vr/ganesh_surface_provider.h" #include "chrome/browser/vr/keyboard_delegate.h" +#include "chrome/browser/vr/model/assets.h" #include "chrome/browser/vr/model/model.h" #include "chrome/browser/vr/model/omnibox_suggestions.h" #include "chrome/browser/vr/speech_recognizer.h" @@ -321,13 +322,26 @@ LOG(ERROR) << os.str(); } -void Ui::SetBackgroundImage(std::unique_ptr<SkBitmap> bitmap) { - Background* background = reinterpret_cast<Background*>( +void Ui::OnAssetsLoading() { + model_->can_apply_new_background = false; +} + +void Ui::OnAssetsLoaded(AssetsLoadStatus status, + std::unique_ptr<Assets> assets, + const base::Version& component_version) { + if (status != AssetsLoadStatus::kSuccess) { + return; + } + + Background* background = static_cast<Background*>( scene_->GetUiElementByName(k2dBrowsingTexturedBackground)); DCHECK(background); - background->SetImage(std::move(bitmap)); + background->SetBackgroundImage(std::move(assets->background)); + background->SetGradientImages(std::move(assets->normal_gradient), + std::move(assets->incognito_gradient), + std::move(assets->fullscreen_gradient)); + model_->background_loaded = true; - model_->can_apply_new_background = false; } void Ui::ReinitializeForTest(const UiInitialState& ui_initial_state) {
diff --git a/chrome/browser/vr/ui.h b/chrome/browser/vr/ui.h index 86d011b7..8ca02895 100644 --- a/chrome/browser/vr/ui.h +++ b/chrome/browser/vr/ui.h
@@ -9,6 +9,8 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "base/version.h" +#include "chrome/browser/vr/assets_load_status.h" #include "chrome/browser/vr/browser_ui_interface.h" #include "chrome/browser/vr/keyboard_ui_interface.h" #include "chrome/browser/vr/platform_controller.h" @@ -25,6 +27,7 @@ class UiInputManager; class UiRenderer; class UiScene; +struct Assets; struct ControllerModel; struct Model; struct OmniboxSuggestions; @@ -89,7 +92,11 @@ void SetOmniboxSuggestions( std::unique_ptr<OmniboxSuggestions> suggestions) override; void OnAssetsComponentReady() override; + void OnAssetsLoaded(AssetsLoadStatus status, + std::unique_ptr<Assets> assets, + const base::Version& component_version); + void OnAssetsLoading(); bool ShouldRenderWebVr(); void OnGlInitialized(unsigned int content_texture_id, UiElementRenderer::TextureLocation content_location, @@ -117,8 +124,6 @@ void Dump(bool include_bindings); - void SetBackgroundImage(std::unique_ptr<SkBitmap> bitmap); - // Keyboard input related. void RequestFocus(int element_id); void RequestUnfocus(int element_id);
diff --git a/chrome/browser/vr/ui_element_renderer.cc b/chrome/browser/vr/ui_element_renderer.cc index 8f493de..b1a652dd 100644 --- a/chrome/browser/vr/ui_element_renderer.cc +++ b/chrome/browser/vr/ui_element_renderer.cc
@@ -30,6 +30,7 @@ Init(); BaseQuadRenderer::CreateBuffers(); TexturedQuadRenderer::CreateBuffers(); + Stars::Renderer::CreateBuffers(); } UiElementRenderer::~UiElementRenderer() = default; @@ -45,6 +46,7 @@ controller_renderer_ = base::MakeUnique<Controller::Renderer>(); gradient_grid_renderer_ = base::MakeUnique<Grid::Renderer>(); shadow_renderer_ = base::MakeUnique<Shadow::Renderer>(); + stars_renderer_ = base::MakeUnique<Stars::Renderer>(); background_renderer_ = base::MakeUnique<Background::Renderer>(); } @@ -137,11 +139,29 @@ y_padding, y_offset, color, opacity, corner_radius); } +void UiElementRenderer::DrawStars( + float t, + const gfx::Transform& model_view_proj_matrix) { + FlushIfNecessary(stars_renderer_.get()); + stars_renderer_->Draw(t, model_view_proj_matrix); +} + void UiElementRenderer::DrawBackground( const gfx::Transform& model_view_proj_matrix, - int texture_data_handle) { + int texture_data_handle, + int normal_gradient_texture_data_handle, + int incognito_gradient_texture_data_handle, + int fullscreen_gradient_texture_data_handle, + float normal_factor, + float incognito_factor, + float fullscreen_factor) { FlushIfNecessary(background_renderer_.get()); - background_renderer_->Draw(model_view_proj_matrix, texture_data_handle); + background_renderer_->Draw(model_view_proj_matrix, texture_data_handle, + normal_gradient_texture_data_handle, + incognito_gradient_texture_data_handle, + fullscreen_gradient_texture_data_handle, + normal_factor, incognito_factor, + fullscreen_factor); } void UiElementRenderer::Flush() {
diff --git a/chrome/browser/vr/ui_element_renderer.h b/chrome/browser/vr/ui_element_renderer.h index 586234b..6b7b9f3 100644 --- a/chrome/browser/vr/ui_element_renderer.h +++ b/chrome/browser/vr/ui_element_renderer.h
@@ -10,9 +10,10 @@ #include "base/macros.h" #include "chrome/browser/vr/controller_mesh.h" -#include "chrome/browser/vr/elements/background.h" #include "chrome/browser/vr/elements/controller.h" -#include "chrome/browser/vr/elements/grid.h" +#include "chrome/browser/vr/elements/environment/background.h" +#include "chrome/browser/vr/elements/environment/grid.h" +#include "chrome/browser/vr/elements/environment/stars.h" #include "chrome/browser/vr/elements/laser.h" #include "chrome/browser/vr/elements/reticle.h" #include "chrome/browser/vr/elements/shadow.h" @@ -106,9 +107,19 @@ float opacity, float corner_radius); + VIRTUAL_FOR_MOCKS void DrawStars( + float t, + const gfx::Transform& model_view_proj_matrix); + VIRTUAL_FOR_MOCKS void DrawBackground( const gfx::Transform& model_view_proj_matrix, - int texture_data_handle); + int texture_data_handle, + int normal_gradient_texture_data_handle, + int incognito_gradient_texture_data_handle, + int fullscreen_gradient_texture_data_handle, + float normal_factor, + float incognito_factor, + float fullscreen_factor); void Flush(); void SetUpController(std::unique_ptr<ControllerMesh> mesh); @@ -132,6 +143,7 @@ std::unique_ptr<Controller::Renderer> controller_renderer_; std::unique_ptr<Grid::Renderer> gradient_grid_renderer_; std::unique_ptr<Shadow::Renderer> shadow_renderer_; + std::unique_ptr<Stars::Renderer> stars_renderer_; std::unique_ptr<Background::Renderer> background_renderer_; DISALLOW_COPY_AND_ASSIGN(UiElementRenderer);
diff --git a/chrome/browser/vr/ui_input_manager.cc b/chrome/browser/vr/ui_input_manager.cc index 9e13b3bc..ccdcba25 100644 --- a/chrome/browser/vr/ui_input_manager.cc +++ b/chrome/browser/vr/ui_input_manager.cc
@@ -342,10 +342,10 @@ // usability, do the following instead: // // - Project the controller laser onto a distance-limiting sphere. - // - Create a vector between the eyes and the outer surface point. - // - If any UI elements intersect this vector, and is within the bounding - // sphere, choose the closest to the eyes, and place the reticle at the - // intersection point. + // - Create a vector between the eyes and the point on the sphere. + // - If any UI elements intersect this vector, and are within the bounding + // sphere, choose the element that is last in scene draw order (which is + // typically the closest to the eye). // Compute the distance from the eyes to the distance limiting sphere. Note // that the sphere is centered at the controller, rather than the eye, for @@ -361,16 +361,16 @@ // more intuitive. For testing, however, we occasionally hit test along the // laser precisely since this geometric accuracy is important and we are not // dealing with a physical controller. - float closest_element_distance = - (reticle_model->target_point - kOrigin).Length(); - - HitTestRequest request; - request.ray_origin = + gfx::Point3F ray_origin = hit_test_strategy_ == HitTestStrategy::PROJECT_TO_WORLD_ORIGIN ? kOrigin : controller_model.laser_origin; + float distance_limit = (reticle_model->target_point - ray_origin).Length(); + + HitTestRequest request; + request.ray_origin = ray_origin; request.ray_target = reticle_model->target_point; - request.max_distance_to_plane = closest_element_distance; + request.max_distance_to_plane = distance_limit; HitTestElements(&scene_->root_element(), reticle_model, &request); }
diff --git a/chrome/browser/vr/ui_input_manager_unittest.cc b/chrome/browser/vr/ui_input_manager_unittest.cc index cc071ee..4cbaeba 100644 --- a/chrome/browser/vr/ui_input_manager_unittest.cc +++ b/chrome/browser/vr/ui_input_manager_unittest.cc
@@ -81,7 +81,7 @@ StrictMock<MockRect>* p_element = element.get(); element->SetTranslate(0, 0, z_position); scene_->AddUiElement(kRoot, std::move(element)); - scene_->OnBeginFrame(base::TimeTicks(), kForwardVector); + scene_->OnBeginFrame(base::TimeTicks(), kStartHeadPose); return p_element; } @@ -90,7 +90,7 @@ StrictMock<MockTextInput>* p_element = element.get(); element->SetTranslate(0, 0, z_position); scene_->AddUiElement(kRoot, std::move(element)); - scene_->OnBeginFrame(base::TimeTicks(), kForwardVector); + scene_->OnBeginFrame(base::TimeTicks(), kStartHeadPose); return p_element; } @@ -165,7 +165,7 @@ child->set_hit_testable(true); child->set_focusable(true); p_element->AddChild(std::move(child)); - scene_->OnBeginFrame(base::TimeTicks(), kForwardVector); + scene_->OnBeginFrame(base::TimeTicks(), kStartHeadPose); // Focus element. testing::Sequence s; @@ -191,7 +191,7 @@ child->set_hit_testable(true); child->set_focusable(false); p_element->AddChild(std::move(child)); - scene_->OnBeginFrame(base::TimeTicks(), kForwardVector); + scene_->OnBeginFrame(base::TimeTicks(), kStartHeadPose); // Focus element. testing::Sequence s; @@ -210,7 +210,7 @@ UiElement* p_element = element.get(); element->SetTranslate(0, 0, -1.f); scene_->AddUiElement(kRoot, std::move(element)); - scene_->OnBeginFrame(base::TimeTicks(), kForwardVector); + scene_->OnBeginFrame(base::TimeTicks(), kStartHeadPose); ControllerModel controller_model; controller_model.laser_direction = kBackwardVector; @@ -322,7 +322,7 @@ // Re-add the element to the scene, and press on it to lock it for input. scene_->AddUiElement(kRoot, std::move(deleted_element)); - scene_->OnBeginFrame(base::TimeTicks(), kForwardVector); + scene_->OnBeginFrame(base::TimeTicks(), kStartHeadPose); EXPECT_CALL(*p_element, OnHoverEnter(_)); EXPECT_CALL(*p_element, OnButtonDown(_)); HandleInput(kForwardVector, kDown); @@ -345,7 +345,7 @@ element->SetTranslate(0, 0, -2.5); element->SetSize(1000.0f, 1000.0f); scene_->AddUiElement(kRoot, std::move(element)); - scene_->OnBeginFrame(base::TimeTicks(), kForwardVector); + scene_->OnBeginFrame(base::TimeTicks(), kStartHeadPose); gfx::Point3F center; p_element->world_space_transform().TransformPoint(¢er);
diff --git a/chrome/browser/vr/ui_scene.cc b/chrome/browser/vr/ui_scene.cc index 9a24dcd3..31429b42 100644 --- a/chrome/browser/vr/ui_scene.cc +++ b/chrome/browser/vr/ui_scene.cc
@@ -60,7 +60,7 @@ } bool UiScene::OnBeginFrame(const base::TimeTicks& current_time, - const gfx::Vector3dF& look_at) { + const gfx::Transform& head_pose) { bool scene_dirty = !initialized_scene_ || is_dirty_; initialized_scene_ = true; is_dirty_ = false; @@ -82,7 +82,7 @@ // time-related "dirtiness" on the scene graph. for (auto& element : *root_element_) { element.set_update_phase(UiElement::kDirty); - if ((element.DoBeginFrame(current_time, look_at) || + if ((element.DoBeginFrame(current_time, head_pose) || element.updated_bindings_this_frame()) && (element.IsVisible() || element.updated_visiblity_this_frame())) { scene_dirty = true;
diff --git a/chrome/browser/vr/ui_scene.h b/chrome/browser/vr/ui_scene.h index a0680efc..674b6965 100644 --- a/chrome/browser/vr/ui_scene.h +++ b/chrome/browser/vr/ui_scene.h
@@ -21,7 +21,7 @@ } // namespace base namespace gfx { -class Vector3dF; +class Transform; } // namespace gfx namespace vr { @@ -42,7 +42,7 @@ // absolute begin frame time. // Returns true if *anything* was updated. bool OnBeginFrame(const base::TimeTicks& current_time, - const gfx::Vector3dF& look_at); + const gfx::Transform& head_pose); // Returns true if any textures were redrawn. bool UpdateTextures();
diff --git a/chrome/browser/vr/ui_scene_constants.h b/chrome/browser/vr/ui_scene_constants.h index 3ef4d5b..9dfe374 100644 --- a/chrome/browser/vr/ui_scene_constants.h +++ b/chrome/browser/vr/ui_scene_constants.h
@@ -33,6 +33,8 @@ static constexpr float kContentVerticalOffset = kContentVerticalOffsetDMM * kContentDistance; static constexpr float kContentCornerRadius = 0.005f * kContentWidth; +static constexpr float kContentShadowOffset = 0.09f; +static constexpr float kContentShadowIntesity = 0.3f; static constexpr float kBackplaneSize = 1000.0; static constexpr float kBackgroundDistanceMultiplier = 1.414f; @@ -88,7 +90,6 @@ static constexpr float kWebVrUrlToastRotationRad = gfx::DegToRad(14.0f); static constexpr float kWebVrToastDistance = 1.0; -static constexpr float kFullscreenToastDistance = kFullscreenDistance; static constexpr float kToastWidthDMM = 0.512f; static constexpr float kToastHeightDMM = 0.064f; static constexpr float kToastOffsetDMM = 0.004f; @@ -116,18 +117,13 @@ static constexpr float kCloseButtonDistance = 2.4f; static constexpr float kCloseButtonVerticalOffset = kFullscreenVerticalOffset - (kFullscreenHeight * 0.5f) - 0.35f; -static constexpr float kCloseButtonHeightDMM = kButtonDiameterDMM; -static constexpr float kCloseButtonHeight = - kCloseButtonHeightDMM * kCloseButtonDistance; -static constexpr float kCloseButtonWidth = - kCloseButtonHeightDMM * kCloseButtonDistance; +static constexpr float kCloseButtonDiameter = + kButtonDiameterDMM * kCloseButtonDistance; static constexpr float kCloseButtonFullscreenDistance = 2.9f; static constexpr float kCloseButtonFullscreenVerticalOffset = kFullscreenVerticalOffset - (kFullscreenHeight / 2) - 0.35f; -static constexpr float kCloseButtonFullscreenHeight = - kCloseButtonHeightDMM * kCloseButtonFullscreenDistance; -static constexpr float kCloseButtonFullscreenWidth = - kCloseButtonHeightDMM * kCloseButtonFullscreenDistance; +static constexpr float kCloseButtonFullscreenDiameter = + kButtonDiameterDMM * kCloseButtonFullscreenDistance; static constexpr float kLoadingIndicatorWidthDMM = 0.24f; static constexpr float kLoadingIndicatorHeightDMM = 0.008f; @@ -253,6 +249,9 @@ static constexpr float kSnackbarMoveInAngle = -base::kPiFloat / 10; static constexpr int kSnackbarTransitionDurationMs = 300; +static constexpr float kSkyDistance = 1000.0f; +static constexpr float kGridOpacity = 0.5f; + } // namespace vr #endif // CHROME_BROWSER_VR_UI_SCENE_CONSTANTS_H_
diff --git a/chrome/browser/vr/ui_scene_creator.cc b/chrome/browser/vr/ui_scene_creator.cc index 9cdfaa7..fd1a0dd 100644 --- a/chrome/browser/vr/ui_scene_creator.cc +++ b/chrome/browser/vr/ui_scene_creator.cc
@@ -12,20 +12,22 @@ #include "chrome/browser/vr/databinding/binding.h" #include "chrome/browser/vr/databinding/vector_binding.h" #include "chrome/browser/vr/elements/audio_permission_prompt.h" -#include "chrome/browser/vr/elements/background.h" #include "chrome/browser/vr/elements/button.h" #include "chrome/browser/vr/elements/content_element.h" #include "chrome/browser/vr/elements/controller.h" #include "chrome/browser/vr/elements/disc_button.h" #include "chrome/browser/vr/elements/draw_phase.h" +#include "chrome/browser/vr/elements/environment/background.h" +#include "chrome/browser/vr/elements/environment/grid.h" +#include "chrome/browser/vr/elements/environment/stars.h" #include "chrome/browser/vr/elements/exit_prompt.h" #include "chrome/browser/vr/elements/full_screen_rect.h" -#include "chrome/browser/vr/elements/grid.h" #include "chrome/browser/vr/elements/invisible_hit_target.h" #include "chrome/browser/vr/elements/keyboard.h" #include "chrome/browser/vr/elements/laser.h" #include "chrome/browser/vr/elements/linear_layout.h" #include "chrome/browser/vr/elements/rect.h" +#include "chrome/browser/vr/elements/repositioner.h" #include "chrome/browser/vr/elements/reticle.h" #include "chrome/browser/vr/elements/scaled_depth_adjuster.h" #include "chrome/browser/vr/elements/spinner.h" @@ -106,6 +108,10 @@ #define VR_BIND_BUTTON_COLORS(m, v, c, s) BindButtonColors(m, v, c, "", s, "") #endif +#define VR_BIND_VISIBILITY(v, c) \ + v->AddBinding( \ + VR_BIND_FUNC(bool, Model, model_, c, UiElement, v.get(), SetVisible)); + template <typename T, typename... Args> std::unique_ptr<T> Create(UiElementName name, DrawPhase phase, Args&&... args) { auto element = base::MakeUnique<T>(std::forward<Args>(args)...); @@ -200,7 +206,7 @@ element_binding->bindings().push_back( VR_BIND_FUNC(base::string16, SuggestionBinding, element_binding, - model()->content, Text, p_content_text, SetText)); + model->model()->content, Text, p_content_text, SetText)); element_binding->bindings().push_back( base::MakeUnique<Binding<base::string16>>( VR_BIND_LAMBDA( @@ -217,8 +223,8 @@ base::Unretained(p_description_text)))); element_binding->bindings().push_back( VR_BIND(AutocompleteMatch::Type, SuggestionBinding, element_binding, - model()->type, VectorIcon, p_icon, - SetIcon(AutocompleteMatch::TypeToVectorIcon(value)))); + model->model()->type, VectorIcon, p_icon, + view->SetIcon(AutocompleteMatch::TypeToVectorIcon(value)))); element_binding->set_view(background.get()); scene->AddUiElement(kOmniboxSuggestions, std::move(background)); } @@ -227,21 +233,17 @@ scene->RemoveUiElement(binding->view()->id()); } -TransientElement* AddTransientParent(UiElementName name, - UiElementName parent_name, - int timeout_seconds, - bool animate_opacity, - UiScene* scene) { +std::unique_ptr<TransientElement> CreateTransientParent(UiElementName name, + int timeout_seconds, + bool animate_opacity) { auto element = base::MakeUnique<SimpleTransientElement>( base::TimeDelta::FromSeconds(timeout_seconds)); - TransientElement* to_return = element.get(); element->SetName(name); element->SetVisible(false); element->set_hit_testable(false); if (animate_opacity) element->SetTransitionedProperties({OPACITY}); - scene->AddUiElement(parent_name, std::move(element)); - return to_return; + return element; } std::unique_ptr<Rect> CreateOmniboxSpacer(Model* model) { @@ -314,10 +316,10 @@ Create<LinearLayout>(kNone, kPhaseNone, LinearLayout::kRight); snackbar_inner_layout->set_margin(kSnackbarPaddingDMM * 0.5f); snackbar_inner_layout->set_hit_testable(false); - snackbar_oval_left->AddBinding( - VR_BIND(float, UiElement, snackbar_inner_layout.get(), - stale_size().width() + kSnackbarPaddingDMM, UiElement, - snackbar_oval_left.get(), SetSize(value, kSnackbarHeightDMM))); + snackbar_oval_left->AddBinding(VR_BIND( + float, UiElement, snackbar_inner_layout.get(), + model->stale_size().width() + kSnackbarPaddingDMM, UiElement, + snackbar_oval_left.get(), view->SetSize(value, kSnackbarHeightDMM))); auto icon = Create<VectorIcon>(kNone, kPhaseForeground, 256); icon->SetSize(kSnackbarIconWidthDMM, kSnackbarIconWidthDMM); @@ -354,14 +356,15 @@ button_text->SetText(button_label); button_text->SetLayoutMode(TextLayoutMode::kSingleLineFixedHeight); button_text->set_hit_testable(false); - button_text->AddBinding(VR_BIND_FUNC( - SkColor, Model, model, color_scheme().snackbar_button_colors.foreground, - Text, button_text.get(), SetColor)); + button_text->AddBinding( + VR_BIND_FUNC(SkColor, Model, model, + model->color_scheme().snackbar_button_colors.foreground, + Text, button_text.get(), SetColor)); button->AddBinding(VR_BIND(float, UiElement, button_layout.get(), - stale_size().width() + kSnackbarPaddingDMM, + model->stale_size().width() + kSnackbarPaddingDMM, UiElement, button.get(), - SetSize(value, kSnackbarHeightDMM))); + view->SetSize(value, kSnackbarHeightDMM))); button_layout->AddChild(std::move(button_text)); button_layout->AddChild(CreateSpacer(0.5f * kSnackbarPaddingDMM, 0.0f)); @@ -444,17 +447,30 @@ element->set_hit_testable(false); scene_->AddUiElement(k2dBrowsingRoot, std::move(element)); + auto repositioner = base::MakeUnique<Repositioner>(kContentDistance); + repositioner->SetName(k2dBrowsingRepositioner); + repositioner->AddBinding( + VR_BIND_FUNC(bool, Model, model_, model->reposition_window_enabled(), + Repositioner, repositioner.get(), set_enable)); + repositioner->AddBinding( + VR_BIND_FUNC(gfx::Point3F, Model, model_, model->controller.laser_origin, + Repositioner, repositioner.get(), set_laser_origin)); + repositioner->AddBinding(VR_BIND_FUNC( + gfx::Vector3dF, Model, model_, model->controller.laser_direction, + Repositioner, repositioner.get(), set_laser_direction)); + scene_->AddUiElement(k2dBrowsingRoot, std::move(repositioner)); + element = Create<UiElement>(k2dBrowsingVisibiltyControlForVoice, kPhaseNone); element->set_hit_testable(false); - scene_->AddUiElement(k2dBrowsingRoot, std::move(element)); + scene_->AddUiElement(k2dBrowsingRepositioner, std::move(element)); element = Create<UiElement>(k2dBrowsingVisibiltyControlForSiteInfoPrompt, kPhaseNone); element->set_hit_testable(false); element->AddBinding(VR_BIND_FUNC( bool, Model, model_, - active_modal_prompt_type != kModalPromptTypeExitVRForSiteInfo, UiElement, - element.get(), SetVisible)); + model->active_modal_prompt_type != kModalPromptTypeExitVRForSiteInfo, + UiElement, element.get(), SetVisible)); scene_->AddUiElement(k2dBrowsingVisibiltyControlForVoice, std::move(element)); element = Create<UiElement>(k2dBrowsingOpacityControlForAudioPermissionPrompt, @@ -462,10 +478,10 @@ element->set_hit_testable(false); element->AddBinding( VR_BIND(bool, Model, model_, - active_modal_prompt_type != + model->active_modal_prompt_type != kModalPromptTypeExitVRForVoiceSearchRecordAudioOsPermission, UiElement, element.get(), - SetOpacity(value ? 1.0 : kModalPromptFadeOpacity))); + view->SetOpacity(value ? 1.0 : kModalPromptFadeOpacity))); scene_->AddUiElement(k2dBrowsingVisibiltyControlForSiteInfoPrompt, std::move(element)); @@ -474,10 +490,8 @@ element->SetTransitionedProperties({OPACITY}); element->SetTransitionDuration(base::TimeDelta::FromMilliseconds( kSpeechRecognitionOpacityAnimationDurationMs)); - element->AddBinding( - VR_BIND_FUNC(bool, Model, model_, - default_browsing_enabled() || model->fullscreen_enabled(), - UiElement, element.get(), SetVisible)); + VR_BIND_VISIBILITY(element, model->default_browsing_enabled() || + model->fullscreen_enabled()); scene_->AddUiElement(k2dBrowsingOpacityControlForAudioPermissionPrompt, std::move(element)); @@ -486,11 +500,12 @@ element->SetSize(kContentWidth, kContentHeight); element->set_hit_testable(false); element->SetTransitionedProperties({TRANSFORM}); - element->AddBinding(VR_BIND( - bool, Model, model_, fullscreen_enabled(), UiElement, element.get(), - SetTranslate(0, - value ? kFullscreenVerticalOffset : kContentVerticalOffset, - value ? -kFullscreenToastDistance : -kContentDistance))); + element->AddBinding( + VR_BIND(bool, Model, model_, model->fullscreen_enabled(), UiElement, + element.get(), + view->SetTranslate( + 0, value ? kFullscreenVerticalOffset : kContentVerticalOffset, + value ? -kFullscreenDistance : -kContentDistance))); scene_->AddUiElement(k2dBrowsingForeground, std::move(element)); } @@ -498,8 +513,7 @@ auto element = base::MakeUnique<UiElement>(); element->SetName(kWebVrRoot); element->set_hit_testable(false); - element->AddBinding(VR_BIND_FUNC(bool, Model, model_, web_vr_enabled(), - UiElement, element.get(), SetVisible)); + VR_BIND_VISIBILITY(element, model->web_vr_enabled()); scene_->AddUiElement(kRoot, std::move(element)); } @@ -512,8 +526,7 @@ scrim->SetOpacity(kScreenDimmerOpacity); scrim->SetCenterColor(model_->color_scheme().dimmer_inner); scrim->SetEdgeColor(model_->color_scheme().dimmer_outer); - scrim->AddBinding(VR_BIND_FUNC(bool, Model, model_, exiting_vr, UiElement, - scrim.get(), SetVisible)); + VR_BIND_VISIBILITY(scrim, model->exiting_vr); scene_->AddUiElement(k2dBrowsingViewportAwareRoot, std::move(scrim)); // Create transient exit warning. @@ -538,9 +551,7 @@ exit_warning_bg->set_corner_radius(kExitWarningCornerRadiusDMM); exit_warning_bg->set_hit_testable(false); exit_warning_bg->AddChild(std::move(exit_warning_text)); - exit_warning_bg->AddBinding(VR_BIND_FUNC(bool, Model, model_, exiting_vr, - UiElement, exit_warning_bg.get(), - SetVisible)); + VR_BIND_VISIBILITY(exit_warning_bg, model->exiting_vr); VR_BIND_COLOR(model_, exit_warning_bg.get(), &ColorScheme::exit_warning_background, &Rect::SetColor); scaler->AddChild(std::move(exit_warning_bg)); @@ -578,9 +589,7 @@ indicator_layout->SetTranslate(0, kIndicatorVerticalOffset, kIndicatorDistanceOffset); indicator_layout->set_margin(kIndicatorGap); - indicator_layout->AddBinding( - VR_BIND_FUNC(bool, Model, model_, fullscreen_enabled() == false, - UiElement, indicator_layout.get(), SetVisible)); + VR_BIND_VISIBILITY(indicator_layout, !model->fullscreen_enabled()); for (const auto& indicator : indicators) { auto element = base::MakeUnique<Toast>(); @@ -629,6 +638,10 @@ hit_plane->SetSize(kBackplaneSize, kSceneHeight); scene_->AddUiElement(k2dBrowsingContentGroup, std::move(hit_plane)); + auto shadow = Create<Shadow>(kContentQuadShadow, kPhaseForeground); + shadow->set_intensity(kContentShadowIntesity); + shadow->SetTranslate(0, 0, -kContentShadowOffset); + auto main_content = base::MakeUnique<ContentElement>( content_input_delegate_, base::BindRepeating(&UiBrowserInterface::OnContentScreenBoundsChanged, @@ -637,24 +650,29 @@ main_content->SetDrawPhase(kPhaseForeground); main_content->SetSize(kContentWidth, kContentHeight); main_content->set_corner_radius(kContentCornerRadius); + main_content->SetTranslate(0, 0, kContentShadowOffset); main_content->SetTransitionedProperties({BOUNDS}); - main_content->AddBinding(VR_BIND( - bool, Model, model_, fullscreen_enabled(), UiElement, main_content.get(), - SetSize(value ? kFullscreenWidth : kContentWidth, - value ? kFullscreenHeight : kContentHeight))); main_content->AddBinding( - VR_BIND_FUNC(gfx::Transform, Model, model_, projection_matrix, + VR_BIND(bool, Model, model_, model->fullscreen_enabled(), UiElement, + main_content.get(), + view->SetSize(value ? kFullscreenWidth : kContentWidth, + value ? kFullscreenHeight : kContentHeight))); + main_content->AddBinding( + VR_BIND_FUNC(gfx::Transform, Model, model_, model->projection_matrix, ContentElement, main_content.get(), SetProjectionMatrix)); - main_content->AddBinding(VR_BIND_FUNC(unsigned int, Model, model_, - content_texture_id, ContentElement, - main_content.get(), SetTextureId)); - main_content->AddBinding(VR_BIND_FUNC( - UiElementRenderer::TextureLocation, Model, model_, content_location, - ContentElement, main_content.get(), SetTextureLocation)); - scene_->AddUiElement(k2dBrowsingContentGroup, std::move(main_content)); + main_content->AddBinding( + VR_BIND_FUNC(unsigned int, Model, model_, model->content_texture_id, + ContentElement, main_content.get(), SetTextureId)); + main_content->AddBinding(VR_BIND_FUNC(UiElementRenderer::TextureLocation, + Model, model_, model->content_location, + ContentElement, main_content.get(), + SetTextureLocation)); - // Limit reticle distance to a sphere based on content distance. - scene_->set_background_distance(kContentDistance * + shadow->AddChild(std::move(main_content)); + scene_->AddUiElement(k2dBrowsingContentGroup, std::move(shadow)); + + // Limit reticle distance to a sphere based on maximum content distance. + scene_->set_background_distance(kFullscreenDistance * kBackgroundDistanceMultiplier); } @@ -672,10 +690,8 @@ bg->set_hit_testable(false); bg->SetColor(model_->color_scheme().web_vr_background); bg->SetTransitionedProperties({OPACITY}); - bg->AddBinding( - VR_BIND_FUNC(bool, Model, model_, - web_vr_enabled() && !model->web_vr.has_produced_frames(), - FullScreenRect, bg.get(), SetVisible)); + VR_BIND_VISIBILITY( + bg, model->web_vr_enabled() && !model->web_vr.has_produced_frames()); scene_->AddUiElement(kWebVrRoot, std::move(bg)); } @@ -697,12 +713,11 @@ transient_parent->SetName(kSplashScreenTransientParent); transient_parent->set_hit_testable(false); transient_parent->SetTransitionedProperties({OPACITY}); - transient_parent->AddBinding(VR_BIND_FUNC( - bool, Model, model_, web_vr_autopresentation_enabled(), - ShowUntilSignalTransientElement, transient_parent.get(), SetVisible)); + VR_BIND_VISIBILITY(transient_parent, + model->web_vr_autopresentation_enabled()); transient_parent->AddBinding(VR_BIND_FUNC( bool, Model, model_, - web_vr_autopresentation_enabled() && + model->web_vr_autopresentation_enabled() && model->web_vr.state > kWebVrAwaitingFirstFrame, ShowUntilSignalTransientElement, transient_parent.get(), Signal)); scene_->AddUiElement(kWebVrViewportAwareRoot, std::move(transient_parent)); @@ -750,9 +765,7 @@ spinner->SetSize(kTimeoutSpinnerSizeDMM, kTimeoutSpinnerSizeDMM); spinner->SetTranslate(0, kTimeoutSpinnerVerticalOffsetDMM, 0); spinner->SetColor(model_->color_scheme().web_vr_timeout_spinner); - spinner->AddBinding(VR_BIND_FUNC(bool, Model, model_, - web_vr.state == kWebVrTimeoutImminent, - Spinner, spinner.get(), SetVisible)); + VR_BIND_VISIBILITY(spinner, model->web_vr.state == kWebVrTimeoutImminent); auto timeout_message = Create<Rect>(kWebVrTimeoutMessage, kPhaseForeground); timeout_message->SetVisible(false); @@ -761,9 +774,7 @@ timeout_message->SetTransitionedProperties({OPACITY, TRANSFORM}); timeout_message->set_padding(kTimeoutMessageHorizontalPaddingDMM, kTimeoutMessageVerticalPaddingDMM); - timeout_message->AddBinding(VR_BIND_FUNC(bool, Model, model_, - web_vr.state == kWebVrTimedOut, Rect, - timeout_message.get(), SetVisible)); + VR_BIND_VISIBILITY(timeout_message, model->web_vr.state == kWebVrTimedOut); timeout_message->SetColor( model_->color_scheme().web_vr_timeout_message_background); @@ -802,9 +813,7 @@ button->SetTransitionedProperties({OPACITY}); button->SetSize(kWebVrTimeoutMessageButtonDiameterDMM, kWebVrTimeoutMessageButtonDiameterDMM); - button->AddBinding(VR_BIND_FUNC(bool, Model, model_, - web_vr.state == kWebVrTimedOut, DiscButton, - button.get(), SetVisible)); + VR_BIND_VISIBILITY(button, model->web_vr.state == kWebVrTimedOut); VR_BIND_BUTTON_COLORS(model_, button.get(), &ColorScheme::button_colors, &DiscButton::SetButtonColors); @@ -852,19 +861,22 @@ // Textured background. auto background = Create<Background>(k2dBrowsingTexturedBackground, kPhaseBackground); - background->SetVisible(false); - background->AddBinding(base::MakeUnique<Binding<bool>>( - VR_BIND_LAMBDA([](Model* m) { return m->background_loaded; }, - base::Unretained(model_)), - VR_BIND_LAMBDA([](UiElement* e, const bool& v) { e->SetVisible(v); }, - base::Unretained(background.get())))); + background->SetVisible(true); + VR_BIND_VISIBILITY(background, model->background_loaded); + background->AddBinding( + VR_BIND_FUNC(float, Model, model_, model->color_scheme().normal_factor, + Background, background.get(), SetNormalFactor)); + background->AddBinding( + VR_BIND_FUNC(float, Model, model_, model->color_scheme().incognito_factor, + Background, background.get(), SetIncognitoFactor)); + background->AddBinding(VR_BIND_FUNC( + float, Model, model_, model->color_scheme().fullscreen_factor, Background, + background.get(), SetFullscreenFactor)); scene_->AddUiElement(k2dBrowsingBackground, std::move(background)); auto element = Create<UiElement>(k2dBrowsingDefaultBackground, kPhaseNone); element->set_hit_testable(false); - element->AddBinding(VR_BIND_FUNC(bool, Model, model_, - background_loaded == false, UiElement, - element.get(), SetVisible)); + VR_BIND_VISIBILITY(element, !model->background_loaded); scene_->AddUiElement(k2dBrowsingBackground, std::move(element)); // Background solid-color panels. @@ -896,14 +908,27 @@ panel_element->set_hit_testable(false); VR_BIND_COLOR(model_, panel_element.get(), &ColorScheme::world_background, &Rect::SetColor); - panel_element->AddBinding(VR_BIND_FUNC(bool, Model, model_, - browsing_enabled(), UiElement, - panel_element.get(), SetVisible)); + VR_BIND_VISIBILITY(panel_element, model->browsing_enabled()); scene_->AddUiElement(k2dBrowsingDefaultBackground, std::move(panel_element)); } - // Floor. + auto stars = Create<Stars>(kStars, kPhaseBackground); + stars->SetRotate(1, 0, 0, base::kPiFloat * 0.5); + scene_->AddUiElement(k2dBrowsingTexturedBackground, std::move(stars)); + + auto grid = Create<Grid>(kNone, kPhaseBackground); + grid->SetSize(kSceneSize, kSceneSize); + grid->SetTranslate(0.0, -kSceneHeight / 2, 0.0); + grid->SetRotate(1, 0, 0, -base::kPiFloat / 2); + grid->set_gridline_count(kFloorGridlineCount); + grid->SetEdgeColor(SK_ColorTRANSPARENT); + grid->SetCenterColor(SK_ColorTRANSPARENT); + grid->SetGridColor(model_->color_scheme().floor_grid); + grid->set_hit_testable(false); + grid->SetOpacity(kGridOpacity); + scene_->AddUiElement(k2dBrowsingTexturedBackground, std::move(grid)); + auto floor = Create<Grid>(kFloor, kPhaseBackground); floor->SetSize(kSceneSize, kSceneSize); floor->SetTranslate(0.0, -kSceneHeight / 2, 0.0); @@ -940,7 +965,7 @@ element = base::MakeUnique<ViewportAwareRoot>(); element->SetName(k2dBrowsingViewportAwareRoot); element->set_hit_testable(false); - scene_->AddUiElement(k2dBrowsingRoot, std::move(element)); + scene_->AddUiElement(k2dBrowsingRepositioner, std::move(element)); } void UiSceneCreator::CreateVoiceSearchUiGroup() { @@ -955,10 +980,9 @@ voice_search_button->SetTranslate(0.f, -kVoiceSearchButtonYOffsetDMM, 0.f); voice_search_button->set_y_anchoring(BOTTOM); voice_search_button->set_y_centering(TOP); - voice_search_button->AddBinding(VR_BIND_FUNC( - bool, Model, model_, - speech.has_or_can_request_audio_permission && !model->incognito, - UiElement, voice_search_button.get(), SetVisible)); + VR_BIND_VISIBILITY( + voice_search_button, + model->speech.has_or_can_request_audio_permission && !model->incognito); VR_BIND_BUTTON_COLORS(model_, voice_search_button.get(), &ColorScheme::button_colors, &DiscButton::SetButtonColors); @@ -974,13 +998,14 @@ kSpeechRecognitionOpacityAnimationDurationMs)); // Set initial visibility so we don't see the voice search ui fade out. speech_recognition_root->SetVisibleImmediately(false); - scene_->AddUiElement(k2dBrowsingRoot, std::move(speech_recognition_root)); + scene_->AddUiElement(k2dBrowsingRepositioner, + std::move(speech_recognition_root)); auto inner_circle = base::MakeUnique<Rect>(); inner_circle->SetName(kSpeechRecognitionCircle); inner_circle->SetDrawPhase(kPhaseForeground); - inner_circle->SetSize(kCloseButtonWidth * 2, kCloseButtonHeight * 2); - inner_circle->set_corner_radius(kCloseButtonWidth); + inner_circle->SetSize(kCloseButtonDiameter * 2, kCloseButtonDiameter * 2); + inner_circle->set_corner_radius(kCloseButtonDiameter); inner_circle->set_hit_testable(false); VR_BIND_COLOR(model_, inner_circle.get(), &ColorScheme::speech_recognition_circle_background, @@ -992,12 +1017,12 @@ microphone_icon->SetName(kSpeechRecognitionMicrophoneIcon); microphone_icon->SetDrawPhase(kPhaseForeground); microphone_icon->set_hit_testable(false); - microphone_icon->SetSize(kCloseButtonWidth, kCloseButtonHeight); + microphone_icon->SetSize(kCloseButtonDiameter, kCloseButtonDiameter); scene_->AddUiElement(kSpeechRecognitionRoot, std::move(microphone_icon)); - TransientElement* speech_result_parent = - AddTransientParent(kSpeechRecognitionResult, kSpeechRecognitionRoot, - kSpeechRecognitionResultTimeoutSeconds, false, scene_); + auto speech_result_parent = CreateTransientParent( + kSpeechRecognitionResult, kSpeechRecognitionResultTimeoutSeconds, false); + // We need to explicitly set the initial visibility of // kSpeechRecognitionResult as k2dBrowsingForeground's visibility depends on // it in a binding. However, k2dBrowsingForeground's binding updated before @@ -1019,7 +1044,7 @@ e->SetVisibleImmediately(true); } }, - speech_result_parent))); + speech_result_parent.get()))); auto speech_result = base::MakeUnique<Text>(kVoiceSearchRecognitionResultTextHeight); speech_result->SetName(kSpeechRecognitionResultText); @@ -1031,7 +1056,7 @@ VR_BIND_COLOR(model_, speech_result.get(), &ColorScheme::prompt_foreground, &Text::SetColor); speech_result->AddBinding(VR_BIND_FUNC(base::string16, Model, model_, - speech.recognition_result, Text, + model->speech.recognition_result, Text, speech_result.get(), SetText)); speech_result_parent->AddChild(std::move(speech_result)); @@ -1039,7 +1064,7 @@ hit_target->SetName(kSpeechRecognitionResultBackplane); hit_target->SetDrawPhase(kPhaseForeground); hit_target->SetSize(kPromptBackplaneSize, kPromptBackplaneSize); - scene_->AddUiElement(kSpeechRecognitionResult, std::move(hit_target)); + speech_result_parent->AddChild(std::move(hit_target)); auto speech_recognition_listening = base::MakeUnique<UiElement>(); UiElement* listening_ui_root = speech_recognition_listening.get(); @@ -1060,7 +1085,8 @@ m->voice_search_enabled(), result_parent->GetTargetOpacity()); }, - base::Unretained(model_), base::Unretained(speech_result_parent)), + base::Unretained(model_), + base::Unretained(speech_result_parent.get())), VR_BIND_LAMBDA( [](UiElement* listening, const std::pair<bool, float>& value) { if (!value.first && value.second != 0.f) { @@ -1072,22 +1098,24 @@ base::Unretained(listening_ui_root)))); scene_->AddUiElement(kSpeechRecognitionRoot, std::move(speech_recognition_listening)); + scene_->AddUiElement(kSpeechRecognitionRoot, std::move(speech_result_parent)); auto growing_circle = base::MakeUnique<Throbber>(); growing_circle->SetName(kSpeechRecognitionListeningGrowingCircle); growing_circle->SetDrawPhase(kPhaseForeground); - growing_circle->SetSize(kCloseButtonWidth * 2, kCloseButtonHeight * 2); - growing_circle->set_corner_radius(kCloseButtonWidth); + growing_circle->SetSize(kCloseButtonDiameter * 2, kCloseButtonDiameter * 2); + growing_circle->set_corner_radius(kCloseButtonDiameter); growing_circle->set_hit_testable(false); VR_BIND_COLOR(model_, growing_circle.get(), &ColorScheme::speech_recognition_circle_background, &Rect::SetColor); - growing_circle->AddBinding(VR_BIND( - int, Model, model_, speech.speech_recognition_state, Throbber, - growing_circle.get(), - SetCircleGrowAnimationEnabled(value == SPEECH_RECOGNITION_IN_SPEECH || - value == SPEECH_RECOGNITION_RECOGNIZING || - value == SPEECH_RECOGNITION_READY))); + growing_circle->AddBinding( + VR_BIND(int, Model, model_, model->speech.speech_recognition_state, + Throbber, growing_circle.get(), + view->SetCircleGrowAnimationEnabled( + value == SPEECH_RECOGNITION_IN_SPEECH || + value == SPEECH_RECOGNITION_RECOGNIZING || + value == SPEECH_RECOGNITION_READY))); scene_->AddUiElement(kSpeechRecognitionListening, std::move(growing_circle)); auto close_button = Create<DiscButton>( @@ -1135,10 +1163,8 @@ auto root = base::MakeUnique<UiElement>(); root->SetName(kControllerRoot); root->set_hit_testable(false); - root->AddBinding( - VR_BIND_FUNC(bool, Model, model_, - browsing_enabled() || model->web_vr.state == kWebVrTimedOut, - UiElement, root.get(), SetVisible)); + VR_BIND_VISIBILITY( + root, model->browsing_enabled() || model->web_vr.state == kWebVrTimedOut); scene_->AddUiElement(kRoot, std::move(root)); auto group = base::MakeUnique<UiElement>(); @@ -1163,27 +1189,30 @@ auto controller = base::MakeUnique<Controller>(); controller->SetDrawPhase(kPhaseForeground); controller->AddBinding(VR_BIND_FUNC(gfx::Transform, Model, model_, - controller.transform, Controller, + model->controller.transform, Controller, controller.get(), set_local_transform)); + controller->AddBinding(VR_BIND_FUNC( + bool, Model, model_, + model->controller.touchpad_button_state == UiInputManager::DOWN, + Controller, controller.get(), set_touchpad_button_pressed)); controller->AddBinding( VR_BIND_FUNC(bool, Model, model_, - controller.touchpad_button_state == UiInputManager::DOWN, - Controller, controller.get(), set_touchpad_button_pressed)); - controller->AddBinding(VR_BIND_FUNC( - bool, Model, model_, controller.app_button_state == UiInputManager::DOWN, - Controller, controller.get(), set_app_button_pressed)); - controller->AddBinding(VR_BIND_FUNC( - bool, Model, model_, controller.home_button_state == UiInputManager::DOWN, - Controller, controller.get(), set_home_button_pressed)); - controller->AddBinding(VR_BIND_FUNC(float, Model, model_, controller.opacity, - Controller, controller.get(), - SetOpacity)); + model->controller.app_button_state == UiInputManager::DOWN, + Controller, controller.get(), set_app_button_pressed)); + controller->AddBinding( + VR_BIND_FUNC(bool, Model, model_, + model->controller.home_button_state == UiInputManager::DOWN, + Controller, controller.get(), set_home_button_pressed)); + controller->AddBinding(VR_BIND_FUNC(float, Model, model_, + model->controller.opacity, Controller, + controller.get(), SetOpacity)); scene_->AddUiElement(kControllerGroup, std::move(controller)); auto laser = base::MakeUnique<Laser>(model_); laser->SetDrawPhase(kPhaseForeground); - laser->AddBinding(VR_BIND_FUNC(float, Model, model_, controller.opacity, - Laser, laser.get(), SetOpacity)); + laser->AddBinding(VR_BIND_FUNC(float, Model, model_, + model->controller.opacity, Laser, laser.get(), + SetOpacity)); scene_->AddUiElement(kControllerGroup, std::move(laser)); auto reticle = base::MakeUnique<Reticle>(scene_, model_); @@ -1232,11 +1261,11 @@ keyboard->SetKeyboardDelegate(keyboard_delegate_); keyboard->SetDrawPhase(kPhaseForeground); keyboard->SetTranslate(0.0, kKeyboardVerticalOffsetDMM, 0.0); - keyboard->AddBinding(VR_BIND_FUNC(bool, Model, model_, editing_input, - UiElement, keyboard.get(), SetVisible)); + VR_BIND_VISIBILITY(keyboard, model->editing_input); scaler->AddChild(std::move(keyboard)); visibility_control_root->AddChild(std::move(scaler)); - scene_->AddUiElement(kRoot, std::move(visibility_control_root)); + scene_->AddUiElement(k2dBrowsingRepositioner, + std::move(visibility_control_root)); } void UiSceneCreator::CreateUrlBar() { @@ -1265,17 +1294,16 @@ url_bar->SetTranslate(0, kUrlBarVerticalOffsetDMM, 0); url_bar->SetRotate(1, 0, 0, kUrlBarRotationRad); url_bar->SetSize(kUrlBarWidthDMM, kUrlBarHeightDMM); - url_bar->AddBinding(VR_BIND_FUNC(bool, Model, model_, - fullscreen_enabled() == false, UiElement, - url_bar.get(), SetVisible)); - url_bar->AddBinding(VR_BIND_FUNC(ToolbarState, Model, model_, toolbar_state, - UrlBar, url_bar.get(), SetToolbarState)); + VR_BIND_VISIBILITY(url_bar, !model->fullscreen_enabled()); + url_bar->AddBinding(VR_BIND_FUNC(ToolbarState, Model, model_, + model->toolbar_state, UrlBar, url_bar.get(), + SetToolbarState)); url_bar->AddBinding(VR_BIND_FUNC(UrlBarColors, Model, model_, - color_scheme().url_bar, UrlBar, + model->color_scheme().url_bar, UrlBar, url_bar.get(), SetColors)); - url_bar->AddBinding(VR_BIND_FUNC(bool, Model, model_, can_navigate_back, - UrlBar, url_bar.get(), - SetHistoryButtonsEnabled)); + url_bar->AddBinding(VR_BIND_FUNC(bool, Model, model_, + model->can_navigate_back, UrlBar, + url_bar.get(), SetHistoryButtonsEnabled)); VR_BIND_COLOR(model_, url_bar.get(), &ColorScheme::element_background, &TexturedElement::SetBackgroundColor); scene_->AddUiElement(kUrlBarDmmRoot, std::move(url_bar)); @@ -1288,8 +1316,7 @@ indicator_bg->set_y_anchoring(TOP); indicator_bg->SetTransitionedProperties({OPACITY}); indicator_bg->set_corner_radius(kLoadingIndicatorHeightDMM * 0.5f); - indicator_bg->AddBinding(VR_BIND_FUNC(bool, Model, model_, loading, Rect, - indicator_bg.get(), SetVisible)); + VR_BIND_VISIBILITY(indicator_bg, model->loading); VR_BIND_COLOR(model_, indicator_bg.get(), &ColorScheme::loading_indicator_background, &Rect::SetColor); @@ -1323,8 +1350,11 @@ l10n_util::GetStringUTF16(IDS_VR_COMPONENT_UPDATE_READY), base::i18n::ToUpper(l10n_util::GetStringUTF16(IDS_VR_COMPONENT_APPLY)), base::BindRepeating( - [](UiBrowserInterface* browser) { browser->LoadAssets(); }, - base::Unretained(browser_))); + [](UiBrowserInterface* browser, Ui* ui) { + ui->OnAssetsLoading(); + browser->LoadAssets(); + }, + base::Unretained(browser_), base::Unretained(ui_))); snackbar->AddBinding(base::MakeUnique<Binding<bool>>( VR_BIND_LAMBDA([](Model* m) { return m->can_apply_new_background; }, base::Unretained(model_)), @@ -1339,7 +1369,7 @@ snackbar->SetTransitionedProperties({OPACITY, TRANSFORM}); snackbar->SetTransitionDuration( base::TimeDelta::FromMilliseconds(kSnackbarTransitionDurationMs)); - scene_->AddUiElement(k2dBrowsingRoot, std::move(snackbar)); + scene_->AddUiElement(k2dBrowsingRepositioner, std::move(snackbar)); } void UiSceneCreator::CreateOmnibox() { @@ -1358,7 +1388,7 @@ // the default browsing case. visibility_toggle_for_audio_permission->AddBinding(VR_BIND_FUNC( bool, Model, model_, - active_modal_prompt_type != + model->active_modal_prompt_type != kModalPromptTypeExitVRForVoiceSearchRecordAudioOsPermission, UiElement, visibility_toggle_for_audio_permission.get(), SetVisible)); @@ -1368,9 +1398,7 @@ omnibox_root->SetVisible(false); omnibox_root->set_hit_testable(false); omnibox_root->SetTransitionedProperties({OPACITY}); - omnibox_root->AddBinding(VR_BIND_FUNC(bool, Model, model_, - omnibox_editing_enabled(), UiElement, - omnibox_root.get(), SetVisible)); + VR_BIND_VISIBILITY(omnibox_root, model->omnibox_editing_enabled()); auto shadow = base::MakeUnique<Shadow>(); shadow->SetName(kOmniboxShadow); @@ -1440,9 +1468,9 @@ }, base::Unretained(model_), base::Unretained(browser_), base::Unretained(ui_))); - omnibox_text_field->AddBinding( - VR_BIND(TextInputInfo, Model, model_, omnibox_text_field_info, - UiBrowserInterface, browser_, StartAutocomplete(value.text))); + omnibox_text_field->AddBinding(VR_BIND( + TextInputInfo, Model, model_, model->omnibox_text_field_info, + UiBrowserInterface, browser_, view->StartAutocomplete(value.text))); omnibox_text_field->SetSize(width, 0); omnibox_text_field->SetHintText( l10n_util::GetStringUTF16(IDS_SEARCH_OR_TYPE_URL)); @@ -1583,7 +1611,8 @@ visibility_control_root->AddChild(std::move(scaler)); - scene_->AddUiElement(k2dBrowsingRoot, std::move(visibility_control_root)); + scene_->AddUiElement(k2dBrowsingRepositioner, + std::move(visibility_control_root)); } void UiSceneCreator::CreateCloseButton() { @@ -1600,7 +1629,7 @@ std::unique_ptr<DiscButton> element = Create<DiscButton>(kCloseButton, kPhaseForeground, click_handler, vector_icons::kClose16Icon); - element->SetSize(kCloseButtonWidth, kCloseButtonHeight); + element->SetSize(kCloseButtonDiameter, kCloseButtonDiameter); element->set_hover_offset(kButtonZOffsetHoverDMM * kCloseButtonDistance); element->SetTranslate(0, kCloseButtonVerticalOffset, -kCloseButtonDistance); VR_BIND_BUTTON_COLORS(model_, element.get(), &ColorScheme::button_colors, @@ -1608,20 +1637,21 @@ // Close button is a special control element that needs to be hidden when // in WebVR, but it needs to be visible when in cct or fullscreen. - element->AddBinding(VR_BIND_FUNC(bool, Model, model_, - fullscreen_enabled() || model->in_cct, - UiElement, element.get(), SetVisible)); + VR_BIND_VISIBILITY(element, model->fullscreen_enabled() || model->in_cct); + element->AddBinding( + VR_BIND(bool, Model, model_, model->fullscreen_enabled(), UiElement, + element.get(), + view->SetTranslate(0, + value ? kCloseButtonFullscreenVerticalOffset + : kCloseButtonVerticalOffset, + value ? -kCloseButtonFullscreenDistance + : -kCloseButtonDistance))); element->AddBinding(VR_BIND( - bool, Model, model_, fullscreen_enabled(), UiElement, element.get(), - SetTranslate( - 0, - value ? kCloseButtonFullscreenVerticalOffset - : kCloseButtonVerticalOffset, - value ? -kCloseButtonFullscreenDistance : -kCloseButtonDistance))); - element->AddBinding(VR_BIND( - bool, Model, model_, fullscreen_enabled(), UiElement, element.get(), - SetSize(value ? kCloseButtonFullscreenWidth : kCloseButtonWidth, - value ? kCloseButtonFullscreenHeight : kCloseButtonHeight))); + bool, Model, model_, model->fullscreen_enabled(), UiElement, + element.get(), + view->SetSize( + value ? kCloseButtonFullscreenDiameter : kCloseButtonDiameter, + value ? kCloseButtonFullscreenDiameter : kCloseButtonDiameter))); scene_->AddUiElement(k2dBrowsingForeground, std::move(element)); } @@ -1647,11 +1677,9 @@ }, base::Unretained(browser_), base::Unretained(model_)); backplane->set_event_handlers(event_handlers); - backplane->AddBinding(VR_BIND_FUNC( - bool, Model, model_, - active_modal_prompt_type == kModalPromptTypeExitVRForSiteInfo, UiElement, - backplane.get(), SetVisible)); - scene_->AddUiElement(k2dBrowsingRoot, std::move(backplane)); + VR_BIND_VISIBILITY(backplane, model->active_modal_prompt_type == + kModalPromptTypeExitVRForSiteInfo); + scene_->AddUiElement(k2dBrowsingRepositioner, std::move(backplane)); std::unique_ptr<ExitPrompt> exit_prompt = base::MakeUnique<ExitPrompt>( 512, @@ -1713,11 +1741,10 @@ backplane->set_event_handlers(event_handlers); backplane->SetVisible(false); backplane->SetTransitionedProperties({OPACITY}); - backplane->AddBinding(VR_BIND_FUNC( - bool, Model, model_, - active_modal_prompt_type == - kModalPromptTypeExitVRForVoiceSearchRecordAudioOsPermission, - UiElement, backplane.get(), SetVisible)); + VR_BIND_VISIBILITY( + backplane, + model->active_modal_prompt_type == + kModalPromptTypeExitVRForVoiceSearchRecordAudioOsPermission); std::unique_ptr<Shadow> shadow = base::MakeUnique<Shadow>(); shadow->SetName(kAudioPermissionPromptShadow); @@ -1756,14 +1783,13 @@ &TexturedElement::SetForegroundColor); shadow->AddChild(std::move(prompt)); backplane->AddChild(std::move(shadow)); - scene_->AddUiElement(k2dBrowsingRoot, std::move(backplane)); + scene_->AddUiElement(k2dBrowsingRepositioner, std::move(backplane)); } void UiSceneCreator::CreateWebVrOverlayElements() { // Create url toast shown when WebVR is auto-presented. - auto* parent = - AddTransientParent(kWebVrUrlToastTransientParent, kWebVrViewportAwareRoot, - kWebVrUrlToastTimeoutSeconds, true, scene_); + auto parent = CreateTransientParent(kWebVrUrlToastTransientParent, + kWebVrUrlToastTimeoutSeconds, true); parent->AddBinding(base::MakeUnique<Binding<bool>>( VR_BIND_LAMBDA( [](Model* model, UiElement* splash_screen) { @@ -1778,7 +1804,8 @@ scene_->GetUiElementByName(kSplashScreenTransientParent))), VR_BIND_LAMBDA( [](UiElement* e, const bool& value) { e->SetVisible(value); }, - base::Unretained(parent)))); + base::Unretained(parent.get())))); + scene_->AddUiElement(kWebVrViewportAwareRoot, std::move(parent)); auto url_toast = base::MakeUnique<WebVrUrlToast>( 512, base::BindRepeating(&UiBrowserInterface::OnUnsupportedMode, @@ -1798,22 +1825,21 @@ VR_BIND_COLOR(model_, url_toast.get(), &ColorScheme::web_vr_transient_toast_foreground, &TexturedElement::SetForegroundColor); - url_toast->AddBinding(VR_BIND_FUNC(ToolbarState, Model, model_, toolbar_state, - WebVrUrlToast, url_toast.get(), - SetToolbarState)); + url_toast->AddBinding(VR_BIND_FUNC(ToolbarState, Model, model_, + model->toolbar_state, WebVrUrlToast, + url_toast.get(), SetToolbarState)); scene_->AddUiElement(kWebVrUrlToastTransientParent, std::move(url_toast)); // Create "Press app button to exit" toast. - parent = AddTransientParent(kExclusiveScreenToastViewportAwareTransientParent, - kWebVrViewportAwareRoot, kToastTimeoutSeconds, - false, scene_); + parent = + CreateTransientParent(kExclusiveScreenToastViewportAwareTransientParent, + kToastTimeoutSeconds, false); // When we first get a web vr frame, we switch states to // kWebVrNoTimeoutPending, when that happens, we want to SetVisible(true) to // kick the visibility of this element. - parent->AddBinding(VR_BIND_FUNC( - bool, Model, model_, - web_vr.has_produced_frames() && model->web_vr.show_exit_toast, UiElement, - parent, SetVisible)); + VR_BIND_VISIBILITY(parent, model->web_vr.has_produced_frames() && + model->web_vr.show_exit_toast); + scene_->AddUiElement(kWebVrViewportAwareRoot, std::move(parent)); auto scaler = base::MakeUnique<ScaledDepthAdjuster>(kWebVrToastDistance); @@ -1844,13 +1870,12 @@ } void UiSceneCreator::CreateFullscreenToast() { - auto* parent = AddTransientParent(kExclusiveScreenToastTransientParent, - k2dBrowsingForeground, kToastTimeoutSeconds, - false, scene_); - parent->AddBinding(VR_BIND_FUNC(bool, Model, model_, fullscreen_enabled(), - UiElement, parent, SetVisible)); + auto parent = CreateTransientParent(kExclusiveScreenToastTransientParent, + kToastTimeoutSeconds, false); + VR_BIND_VISIBILITY(parent, model->fullscreen_enabled()); + scene_->AddUiElement(k2dBrowsingForeground, std::move(parent)); - auto scaler = base::MakeUnique<ScaledDepthAdjuster>(kFullscreenToastDistance); + auto scaler = base::MakeUnique<ScaledDepthAdjuster>(kFullscreenDistance); auto element = base::MakeUnique<Toast>(); element->SetName(kExclusiveScreenToast);
diff --git a/chrome/browser/vr/ui_scene_unittest.cc b/chrome/browser/vr/ui_scene_unittest.cc index 5a66d25..92113317 100644 --- a/chrome/browser/vr/ui_scene_unittest.cc +++ b/chrome/browser/vr/ui_scene_unittest.cc
@@ -46,7 +46,7 @@ ~AlwaysDirty() override {} bool OnBeginFrame(const base::TimeTicks& time, - const gfx::Vector3dF& look_at) override { + const gfx::Transform& head_pose) override { return true; } }; @@ -119,7 +119,7 @@ gfx::Point3F origin(0, 0, 0); gfx::Point3F point(1, 0, 0); - scene.OnBeginFrame(MsToTicks(0), kForwardVector); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); child->world_space_transform().TransformPoint(&origin); child->world_space_transform().TransformPoint(&point); EXPECT_VEC3F_NEAR(gfx::Point3F(6, 10, 0), origin); @@ -139,7 +139,7 @@ element->SetOpacity(0.5); parent->AddChild(std::move(element)); - scene.OnBeginFrame(MsToTicks(0), kForwardVector); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); EXPECT_EQ(0.5f, parent->computed_opacity()); EXPECT_EQ(0.25f, child->computed_opacity()); } @@ -166,7 +166,7 @@ EXPECT_FALSE(scene.GetVisibleWebVrOverlayElementsToDraw().empty()); child->SetVisible(false); - scene.OnBeginFrame(MsToTicks(0), kForwardVector); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); EXPECT_TRUE(scene.GetVisibleWebVrOverlayElementsToDraw().empty()); } @@ -177,11 +177,11 @@ 1, 1, SK_ColorBLACK, SK_ColorWHITE, MsToDelta(1000))); UiElement* element_ptr = element.get(); scene.AddUiElement(kRoot, std::move(element)); - EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(1), kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(1), kStartHeadPose)); element_ptr->SetVisible(false); element_ptr->UpdateComputedOpacity(); - EXPECT_FALSE(scene.OnBeginFrame(MsToTicks(2), kForwardVector)); + EXPECT_FALSE(scene.OnBeginFrame(MsToTicks(2), kStartHeadPose)); } TEST(UiScene, InvisibleElementsDoNotCauseBindingDirtiness) { @@ -190,16 +190,16 @@ struct FakeModel { int foo = 1; } model; - element->AddBinding(VR_BIND(int, FakeModel, &model, foo, UiElement, - element.get(), SetSize(1, value))); + element->AddBinding(VR_BIND(int, FakeModel, &model, model->foo, UiElement, + element.get(), view->SetSize(1, value))); UiElement* element_ptr = element.get(); scene.AddUiElement(kRoot, std::move(element)); - EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(1), kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(1), kStartHeadPose)); model.foo = 2; element_ptr->SetVisible(false); element_ptr->UpdateComputedOpacity(); - EXPECT_FALSE(scene.OnBeginFrame(MsToTicks(2), kForwardVector)); + EXPECT_FALSE(scene.OnBeginFrame(MsToTicks(2), kStartHeadPose)); } TEST(UiScene, InvisibleElementsDoNotCauseOnBeginFrameDirtiness) { @@ -207,11 +207,11 @@ auto element = base::MakeUnique<AlwaysDirty>(); UiElement* element_ptr = element.get(); scene.AddUiElement(kRoot, std::move(element)); - EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(1), kForwardVector)); + EXPECT_TRUE(scene.OnBeginFrame(MsToTicks(1), kStartHeadPose)); element_ptr->SetVisible(false); element_ptr->UpdateComputedOpacity(); - EXPECT_FALSE(scene.OnBeginFrame(MsToTicks(2), kForwardVector)); + EXPECT_FALSE(scene.OnBeginFrame(MsToTicks(2), kStartHeadPose)); } typedef struct { @@ -245,7 +245,7 @@ element->set_y_centering(GetParam().y_centering); parent->AddChild(std::move(element)); - scene.OnBeginFrame(MsToTicks(0), kForwardVector); + scene.OnBeginFrame(MsToTicks(0), kStartHeadPose); EXPECT_NEAR(GetParam().expected_x, child->GetCenter().x(), TOLERANCE); EXPECT_NEAR(GetParam().expected_y, child->GetCenter().y(), TOLERANCE); }
diff --git a/chrome/browser/vr/ui_unittest.cc b/chrome/browser/vr/ui_unittest.cc index 14cd2b2..4b825ee 100644 --- a/chrome/browser/vr/ui_unittest.cc +++ b/chrome/browser/vr/ui_unittest.cc
@@ -9,6 +9,7 @@ #include "base/numerics/ranges.h" #include "base/stl_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/version.h" #include "chrome/browser/vr/elements/button.h" #include "chrome/browser/vr/elements/content_element.h" #include "chrome/browser/vr/elements/disc_button.h" @@ -17,6 +18,7 @@ #include "chrome/browser/vr/elements/ui_element.h" #include "chrome/browser/vr/elements/ui_element_name.h" #include "chrome/browser/vr/elements/vector_icon.h" +#include "chrome/browser/vr/model/assets.h" #include "chrome/browser/vr/model/model.h" #include "chrome/browser/vr/speech_recognizer.h" #include "chrome/browser/vr/target_property.h" @@ -38,11 +40,22 @@ kBackgroundFront, kBackgroundLeft, kBackgroundBack, kBackgroundRight, kBackgroundTop, kBackgroundBottom, kCeiling, kFloor}; const std::set<UiElementName> kElementsVisibleInBrowsing = { - kBackgroundFront, kBackgroundLeft, kBackgroundBack, - kBackgroundRight, kBackgroundTop, kBackgroundBottom, - kCeiling, kFloor, kContentQuad, - kBackplane, kUrlBar, kUnderDevelopmentNotice, - kController, kReticle, kLaser, + kBackgroundFront, + kBackgroundLeft, + kBackgroundBack, + kBackgroundRight, + kBackgroundTop, + kBackgroundBottom, + kCeiling, + kFloor, + kContentQuad, + kContentQuadShadow, + kBackplane, + kUrlBar, + kUnderDevelopmentNotice, + kController, + kReticle, + kLaser, kVoiceSearchButton, }; const std::set<UiElementName> kElementsVisibleWithExitPrompt = { @@ -425,6 +438,7 @@ TEST_F(UiTest, UiUpdatesForFullscreenChanges) { auto visible_in_fullscreen = kFloorCeilingBackgroundElements; visible_in_fullscreen.insert(kContentQuad); + visible_in_fullscreen.insert(kContentQuadShadow); visible_in_fullscreen.insert(kBackplane); visible_in_fullscreen.insert(kCloseButton); visible_in_fullscreen.insert(kExclusiveScreenToast); @@ -1081,8 +1095,9 @@ EXPECT_FALSE(IsVisible(k2dBrowsingDefaultBackground)); EXPECT_FALSE(IsVisible(kContentQuad)); - auto bitmap = base::MakeUnique<SkBitmap>(); - ui_->SetBackgroundImage(std::move(bitmap)); + auto assets = base::MakeUnique<Assets>(); + ui_->OnAssetsLoaded(AssetsLoadStatus::kSuccess, std::move(assets), + base::Version("1.0")); EXPECT_TRUE(IsVisible(k2dBrowsingTexturedBackground)); EXPECT_TRUE(IsVisible(kContentQuad));
diff --git a/chrome/browser/vr/vr_gl_util.cc b/chrome/browser/vr/vr_gl_util.cc index 230add4d..9096f26 100644 --- a/chrome/browser/vr/vr_gl_util.cc +++ b/chrome/browser/vr/vr_gl_util.cc
@@ -95,14 +95,17 @@ } gfx::SizeF CalculateScreenSize(const gfx::Transform& proj_matrix, - const gfx::Transform& model_matrix, + float distance, const gfx::SizeF& size) { // View matrix is the identity, thus, not needed in the calculation. gfx::Transform scale_transform; scale_transform.Scale(size.width(), size.height()); + gfx::Transform translate_transform; + translate_transform.Translate3d(0, 0, -distance); + gfx::Transform model_view_proj_matrix = - proj_matrix * model_matrix * scale_transform; + proj_matrix * translate_transform * scale_transform; gfx::Point3F projected_upper_right_corner(0.5f, 0.5f, 0.0f); model_view_proj_matrix.TransformPoint(&projected_upper_right_corner); @@ -130,4 +133,9 @@ SkColorGetB(c) / 255.0, SkColorGetA(c) / 255.0); } +void SetOpaqueColorUniform(GLuint handle, SkColor c) { + glUniform3f(handle, SkColorGetR(c) / 255.0, SkColorGetG(c) / 255.0, + SkColorGetB(c) / 255.0); +} + } // namespace vr
diff --git a/chrome/browser/vr/vr_gl_util.h b/chrome/browser/vr/vr_gl_util.h index 1442d88..5686249 100644 --- a/chrome/browser/vr/vr_gl_util.h +++ b/chrome/browser/vr/vr_gl_util.h
@@ -44,7 +44,7 @@ // Returns the normalized size of the element projected into screen space. // If (1, 1) the element fills the entire buffer. gfx::SizeF CalculateScreenSize(const gfx::Transform& proj_matrix, - const gfx::Transform& model_matrix, + float distance, const gfx::SizeF& size); // Sets default texture parameters given a texture type. @@ -53,6 +53,10 @@ // Sets color uniforms given an SkColor. void SetColorUniform(GLuint handle, SkColor c); +// Sets color uniforms (but not alpha) given an SkColor. The alpha is assumed to +// be 1.0 in this case. +void SetOpaqueColorUniform(GLuint handle, SkColor c); + } // namespace vr #endif // CHROME_BROWSER_VR_VR_GL_UTIL_H_
diff --git a/chrome/browser/vr/vr_gl_util_unittest.cc b/chrome/browser/vr/vr_gl_util_unittest.cc index d24776ae..74ba936 100644 --- a/chrome/browser/vr/vr_gl_util_unittest.cc +++ b/chrome/browser/vr/vr_gl_util_unittest.cc
@@ -12,12 +12,10 @@ namespace vr { TEST(VrGlUtilTest, CalculateScreenSize) { - gfx::Transform model_matrix; - model_matrix.Translate3d(0.0f, -0.25f, -2.5f); gfx::SizeF size(2.4f, 1.6f); gfx::SizeF screen_size = - CalculateScreenSize(kPixelDaydreamProjMatrix, model_matrix, size); + CalculateScreenSize(kPixelDaydreamProjMatrix, 2.5f, size); EXPECT_FLOAT_EQ(screen_size.width(), 0.49592164f); EXPECT_FLOAT_EQ(screen_size.height(), 0.27598655f);
diff --git a/chrome/browser/vr/webvr_tab_browser_test.cc b/chrome/browser/vr/webvr_tab_browser_test.cc index 8b0e261..f1c8f7fc 100644 --- a/chrome/browser/vr/webvr_tab_browser_test.cc +++ b/chrome/browser/vr/webvr_tab_browser_test.cc
@@ -15,7 +15,8 @@ namespace vr { // Tests that non-focused tabs cannot get pose information -IN_PROC_BROWSER_TEST_F(VrBrowserTest, REQUIRES_GPU(TestPoseDataUnfocusedTab)) { +IN_PROC_BROWSER_TEST_F(VrBrowserTestStandard, + REQUIRES_GPU(TestPoseDataUnfocusedTab)) { LoadUrlAndAwaitInitialization( GetHtmlTestFile("test_pose_data_unfocused_tab")); ExecuteStepAndWait("stepCheckFrameDataWhileFocusedTab()",
diff --git a/chrome/browser/vr/webvr_transition_browser_test.cc b/chrome/browser/vr/webvr_transition_browser_test.cc index 4b047e9..d6958f0b 100644 --- a/chrome/browser/vr/webvr_transition_browser_test.cc +++ b/chrome/browser/vr/webvr_transition_browser_test.cc
@@ -14,7 +14,7 @@ namespace vr { // Tests that a successful requestPresent call actually enters VR. -IN_PROC_BROWSER_TEST_F(VrBrowserTest, +IN_PROC_BROWSER_TEST_F(VrBrowserTestStandard, REQUIRES_GPU(TestRequestPresentEntersVr)) { LoadUrlAndAwaitInitialization( GetHtmlTestFile("test_requestPresent_enters_vr")); @@ -27,7 +27,7 @@ // Tests that window.requestAnimationFrame continues to fire while in WebVR // presentation since the tab is still visible. -IN_PROC_BROWSER_TEST_F(VrBrowserTest, +IN_PROC_BROWSER_TEST_F(VrBrowserTestStandard, REQUIRES_GPU(TestWindowRafFiresWhilePresenting)) { LoadUrlAndAwaitInitialization( GetHtmlTestFile("test_window_raf_fires_while_presenting")); @@ -39,4 +39,23 @@ EndTest(GetFirstTabWebContents()); } +// Tests that WebVR is not exposed if the flag is not on and the page does not +// have an origin trial token. Since WebVR isn't actually used, we can remove +// the GPU requirement. +IN_PROC_BROWSER_TEST_F(VrBrowserTestWebVrDisabled, + TestWebVrDisabledWithoutFlagSet) { + LoadUrlAndAwaitInitialization( + GetHtmlTestFile("test_webvr_disabled_without_flag_set")); + WaitOnJavaScriptStep(GetFirstTabWebContents()); + EndTest(GetFirstTabWebContents()); +} + +// Tests that WebVR does not return any devices if OpenVR support is disabled. +// Since OpenVR isn't actually used, we can remove the GPU requirement. +IN_PROC_BROWSER_TEST_F(VrBrowserTestOpenVrDisabled, + TestWebVrNoDevicesWithoutOpenVr) { + LoadUrlAndAwaitInitialization(GetHtmlTestFile("generic_webvr_page")); + EXPECT_FALSE(VrDisplayFound(GetFirstTabWebContents())); +} + } // namespace vr
diff --git a/chrome/gpu/BUILD.gn b/chrome/gpu/BUILD.gn index e050947..7ee09d8 100644 --- a/chrome/gpu/BUILD.gn +++ b/chrome/gpu/BUILD.gn
@@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//media/media_options.gni") + static_library("gpu") { deps = [ "//components/metrics:child_call_stacks", @@ -14,6 +16,13 @@ "chrome_content_gpu_client.h", ] + if (enable_library_cdms) { + deps += [ + "//media/cdm:cdm_paths", + "//media/cdm/ppapi/clear_key_cdm:clear_key_cdm_proxy", + ] + } + if (is_chromeos) { deps += [ "//components/arc/common:media",
diff --git a/chrome/gpu/DEPS b/chrome/gpu/DEPS index 5815eb28..82955bee 100644 --- a/chrome/gpu/DEPS +++ b/chrome/gpu/DEPS
@@ -5,5 +5,6 @@ "+components/metrics", "+content/public/child", "+content/public/gpu", + "+media/cdm", "+services/service_manager/public/cpp", ]
diff --git a/chrome/gpu/chrome_content_gpu_client.cc b/chrome/gpu/chrome_content_gpu_client.cc index 2c1be0fe..2d1614c7 100644 --- a/chrome/gpu/chrome_content_gpu_client.cc +++ b/chrome/gpu/chrome_content_gpu_client.cc
@@ -18,6 +18,11 @@ #include "mojo/public/cpp/bindings/strong_binding.h" #include "services/service_manager/public/cpp/connector.h" +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) +#include "media/cdm/cdm_paths.h" +#include "media/cdm/ppapi/clear_key_cdm/clear_key_cdm_proxy.h" +#endif + #if defined(OS_CHROMEOS) #include "components/arc/video_accelerator/gpu_arc_video_decode_accelerator.h" #include "components/arc/video_accelerator/gpu_arc_video_encode_accelerator.h" @@ -93,6 +98,17 @@ std::move(browser_interface)); } +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) +std::unique_ptr<media::CdmProxy> ChromeContentGpuClient::CreateCdmProxy( + const std::string& cdm_guid) { + if (cdm_guid == media::kClearKeyCdmGuid) + return std::make_unique<media::ClearKeyCdmProxy>(); + + // TODO(rkuroiwa): Support creating Widevine specific CDM proxy here. + return nullptr; +} +#endif + #if defined(OS_CHROMEOS) void ChromeContentGpuClient::CreateArcVideoDecodeAccelerator( ::arc::mojom::VideoDecodeAcceleratorRequest request) {
diff --git a/chrome/gpu/chrome_content_gpu_client.h b/chrome/gpu/chrome_content_gpu_client.h index f820c0a..3572adce 100644 --- a/chrome/gpu/chrome_content_gpu_client.h +++ b/chrome/gpu/chrome_content_gpu_client.h
@@ -32,6 +32,11 @@ void GpuServiceInitialized( const gpu::GpuPreferences& gpu_preferences) override; +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) + std::unique_ptr<media::CdmProxy> CreateCdmProxy( + const std::string& cdm_guid) override; +#endif + private: #if defined(OS_CHROMEOS) void CreateArcVideoDecodeAccelerator(
diff --git a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc index b24e895a..8591c01 100644 --- a/chrome/renderer/autofill/password_autofill_agent_browsertest.cc +++ b/chrome/renderer/autofill/password_autofill_agent_browsertest.cc
@@ -28,6 +28,7 @@ #include "components/password_manager/core/common/password_manager_features.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_view.h" +#include "content/public/test/browser_test_utils.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/WebKit/common/associated_interfaces/associated_interface_provider.h" @@ -426,12 +427,14 @@ const base::string16& password) { // This call is necessary to setup the autofill agent appropriate for the // user selection; simulates the menu actually popping up. + SimulatePointClick(gfx::Point(1, 1)); autofill_agent_->FormControlElementClicked(input, false); autofill_agent_->FillPasswordSuggestion(username, password); } void SimulateUsernameTyping(const std::string& username) { + SimulatePointClick(gfx::Point(1, 1)); SimulateUserInputChangeForElement(&username_element_, username); } @@ -485,10 +488,10 @@ // Checks the DOM-accessible value of the username element and the // *suggested* value of the password element. - void CheckTextFieldsState(const std::string& username, - bool username_autofilled, - const std::string& password, - bool password_autofilled) { + void CheckUsernameDOMStatePasswordSuggestedState(const std::string& username, + bool username_autofilled, + const std::string& password, + bool password_autofilled) { CheckTextFieldsStateForElements( username_element_, username, username_autofilled, password_element_, password, password_autofilled, false /* check_suggested_username */, @@ -727,7 +730,7 @@ SimulateOnFillPasswordForm(fill_data_); // The username and password should have been autocompleted. - CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true); + CheckTextFieldsSuggestedState(kAliceUsername, true, kAlicePassword, true); } // Tests that we correctly fill forms having an empty 'action' attribute. @@ -752,7 +755,7 @@ SimulateOnFillPasswordForm(fill_data_); // The username and password should have been autocompleted. - CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true); + CheckTextFieldsSuggestedState(kAliceUsername, true, kAlicePassword, true); } // Tests that if a password is marked as readonly, neither field is autofilled @@ -764,7 +767,7 @@ // autocomplete. SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsSuggestedState(std::string(), false, std::string(), false); } // Can still fill a password field if the username is set to a value that @@ -776,8 +779,8 @@ // Filled even though username is not the preferred match. SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState(UTF16ToUTF8(username3_), false, - UTF16ToUTF8(password3_), true); + CheckUsernameDOMStatePasswordSuggestedState(UTF16ToUTF8(username3_), false, + UTF16ToUTF8(password3_), true); } // Fill a password field if the stored username is a prefix of username in @@ -791,8 +794,8 @@ // Filled even though the username in the form is only a proper prefix of the // stored username. SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState(UTF16ToUTF8(username_at), false, UTF16ToUTF8(password3_), - true); + CheckUsernameDOMStatePasswordSuggestedState(UTF16ToUTF8(username_at), false, + UTF16ToUTF8(password3_), true); } // Do not fill a password field if the stored username is a prefix without @ @@ -807,8 +810,8 @@ // Filled even though the username in the form is only a proper prefix of the // stored username. SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState(UTF16ToUTF8(prefilled_username), false, std::string(), - false); + CheckUsernameDOMStatePasswordSuggestedState(UTF16ToUTF8(prefilled_username), + false, std::string(), false); } // Do not fill a password field if the field isn't readonly despite the stored @@ -823,8 +826,8 @@ // Filled even though the username in the form is only a proper prefix of the // stored username. SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState(UTF16ToUTF8(prefilled_username), false, std::string(), - false); + CheckUsernameDOMStatePasswordSuggestedState(UTF16ToUTF8(prefilled_username), + false, std::string(), false); } // If a username field is empty and readonly, don't autofill. @@ -834,7 +837,8 @@ SetElementReadOnly(username_element_, true); SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckUsernameDOMStatePasswordSuggestedState(std::string(), false, + std::string(), false); } // Tests that having a non-matching username precludes the autocomplete. @@ -846,7 +850,8 @@ SimulateOnFillPasswordForm(fill_data_); // Neither field should be autocompleted. - CheckTextFieldsState("bogus", false, std::string(), false); + CheckUsernameDOMStatePasswordSuggestedState("bogus", false, std::string(), + false); } // Don't try to complete a prefilled value even if it's a partial match @@ -856,7 +861,9 @@ SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState("ali", false, std::string(), false); + CheckTextFieldsSuggestedState("", false, std::string(), false); + CheckUsernameDOMStatePasswordSuggestedState("ali", false, std::string(), + false); } TEST_F(PasswordAutofillAgentTest, InputWithNoForms) { @@ -868,7 +875,7 @@ SimulateOnFillPasswordForm(fill_data_); // Input elements that aren't in a <form> won't autofill. - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsSuggestedState(std::string(), false, std::string(), false); } TEST_F(PasswordAutofillAgentTest, NoAutocompleteForTextFieldPasswords) { @@ -889,7 +896,7 @@ SimulateOnFillPasswordForm(fill_data_); // Fields should still be empty. - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsSuggestedState(std::string(), false, std::string(), false); } TEST_F(PasswordAutofillAgentTest, NoAutocompleteForPasswordFieldUsernames) { @@ -910,7 +917,7 @@ SimulateOnFillPasswordForm(fill_data_); // Fields should still be empty. - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsSuggestedState(std::string(), false, std::string(), false); } // Tests that having a matching username does not preclude the autocomplete. @@ -922,7 +929,8 @@ SimulateOnFillPasswordForm(fill_data_); // The username and password should have been autocompleted. - CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true); + CheckUsernameDOMStatePasswordSuggestedState(kAliceUsername, true, + kAlicePassword, true); } TEST_F(PasswordAutofillAgentTest, PasswordNotClearedOnEdit) { @@ -945,14 +953,15 @@ SimulateOnFillPasswordForm(fill_data_); // No auto-fill should have taken place. - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsSuggestedState(std::string(), false, std::string(), false); SimulateUsernameTyping(kAliceUsername); // Change focus in between to make sure blur events don't trigger filling. SetFocused(password_element_); SetFocused(username_element_); // No autocomplete should happen when text is entered in the username. - CheckTextFieldsState(kAliceUsername, false, std::string(), false); + CheckUsernameDOMStatePasswordSuggestedState(kAliceUsername, false, + std::string(), false); } TEST_F(PasswordAutofillAgentTest, IsWebElementVisibleTest) { @@ -1135,12 +1144,12 @@ SimulateOnFillPasswordForm(fill_data_); // The username and password should have been autocompleted. - CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true); + CheckTextFieldsSuggestedState(kAliceUsername, true, kAlicePassword, true); // However, it should only have completed with the suggested value, as tested // above, and it should not have completed into the DOM accessible value for // the password field. - CheckTextFieldsDOMState(kAliceUsername, true, std::string(), true); + CheckTextFieldsDOMState(std::string(), true, std::string(), true); // Simulate a user click so that the password field's real value is filled. SimulateElementClick(kUsernameName); @@ -1153,7 +1162,7 @@ SimulateOnFillPasswordForm(fill_data_); ExecuteJavaScriptForTests(kJavaScriptClick); - CheckTextFieldsDOMState(kAliceUsername, true, "", true); + CheckTextFieldsDOMState("", true, "", true); } // Verifies that password autofill triggers events in JavaScript for forms that @@ -1175,21 +1184,22 @@ SimulateOnFillPasswordForm(fill_data_); // The username and password should have been autocompleted... - CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true); + CheckTextFieldsSuggestedState(kAliceUsername, true, kAlicePassword, true); // ... but since there hasn't been a user gesture yet, the autocompleted - // password should only be visible to the user. - CheckTextFieldsDOMState(kAliceUsername, true, std::string(), true); + // username and password should only be visible to the user. + CheckTextFieldsDOMState(std::string(), true, std::string(), true); - // JavaScript events should have been triggered for the username, but not yet - // for the password. - CheckIfEventsAreCalled(username_event_checkers, true); + // JavaScript events shouldn't have been triggered for the username and the + // password yet. + CheckIfEventsAreCalled(username_event_checkers, false); CheckIfEventsAreCalled(password_event_checkers, false); // Simulate a user click so that the password field's real value is filled. SimulateElementClick(kUsernameName); CheckTextFieldsDOMState(kAliceUsername, true, kAlicePassword, true); - // Now, JavaScript events should have been triggered for the password as well. + // Now, JavaScript events should have been triggered. + CheckIfEventsAreCalled(username_event_checkers, true); CheckIfEventsAreCalled(password_event_checkers, true); } @@ -1212,7 +1222,7 @@ SimulateOnFillPasswordForm(fill_data_); // The username and password should not yet have been autocompleted. - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsSuggestedState(std::string(), false, std::string(), false); // Simulate a click just to force a user gesture, since the username value is // set directly. @@ -1819,7 +1829,8 @@ // The username should not be autofilled, because it was typed by the user. CheckTextFieldsDOMState(old_username, false, new_password, false); // The password should not have a suggested value. - CheckTextFieldsState(old_username, false, std::string(), false); + CheckUsernameDOMStatePasswordSuggestedState(old_username, false, + std::string(), false); } // The user types the username, then accepts a suggestion. This test checks @@ -1872,9 +1883,9 @@ std::map<base::string16, FieldPropertiesMask> expected_properties_masks; expected_properties_masks[ASCIIToUTF16("random_field")] = - FieldPropertiesFlags::NO_FLAGS; + FieldPropertiesFlags::HAD_FOCUS; expected_properties_masks[ASCIIToUTF16("username")] = - FieldPropertiesFlags::USER_TYPED; + FieldPropertiesFlags::USER_TYPED | FieldPropertiesFlags::HAD_FOCUS; expected_properties_masks[ASCIIToUTF16("password")] = FieldPropertiesFlags::USER_TYPED | FieldPropertiesFlags::HAD_FOCUS; @@ -1899,7 +1910,7 @@ std::map<base::string16, FieldPropertiesMask> expected_properties_masks; expected_properties_masks[ASCIIToUTF16("username")] = - FieldPropertiesFlags::USER_TYPED; + FieldPropertiesFlags::USER_TYPED | FieldPropertiesFlags::HAD_FOCUS; expected_properties_masks[ASCIIToUTF16("password")] = FieldPropertiesFlags::USER_TYPED | FieldPropertiesFlags::HAD_FOCUS; @@ -1927,7 +1938,7 @@ std::map<base::string16, FieldPropertiesMask> expected_properties_masks; expected_properties_masks[ASCIIToUTF16("username")] = - FieldPropertiesFlags::USER_TYPED; + FieldPropertiesFlags::USER_TYPED | FieldPropertiesFlags::HAD_FOCUS; expected_properties_masks[ASCIIToUTF16("password")] = FieldPropertiesFlags::USER_TYPED | FieldPropertiesFlags::HAD_FOCUS; @@ -2026,7 +2037,7 @@ SimulateOnFillPasswordForm(no_username_fill_data); // The username and password should not have been autocompleted. - CheckTextFieldsState("", false, "", false); + CheckTextFieldsSuggestedState("", false, "", false); } TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnly) { @@ -2037,7 +2048,7 @@ // Simulate the browser sending back the login info for an initial page load. SimulateOnShowInitialPasswordAccountSuggestions(fill_data_); - CheckTextFieldsState(std::string(), false, std::string(), false); + CheckTextFieldsSuggestedState(std::string(), false, std::string(), false); CheckSuggestions(std::string(), true); } @@ -2052,7 +2063,8 @@ // Simulate the browser sending back the login info for an initial page load. SimulateOnShowInitialPasswordAccountSuggestions(fill_data_); - CheckTextFieldsState(std::string("alice"), false, std::string(), false); + CheckUsernameDOMStatePasswordSuggestedState(std::string("alice"), false, + std::string(), false); } TEST_F(PasswordAutofillAgentTest, @@ -2067,7 +2079,8 @@ // Simulate the browser sending back the login info for an initial page load. SimulateOnShowInitialPasswordAccountSuggestions(fill_data_); - CheckTextFieldsState(std::string("Carol"), false, std::string(), false); + CheckUsernameDOMStatePasswordSuggestedState(std::string("Carol"), false, + std::string(), false); } TEST_F(PasswordAutofillAgentTest, FillOnAccountSelectOnlyNoUsername) { @@ -2181,7 +2194,8 @@ username_element_.SetValue("foobar"); SetElementReadOnly(username_element_, true); - CheckTextFieldsState(std::string("foobar"), false, std::string(), false); + CheckUsernameDOMStatePasswordSuggestedState(std::string("foobar"), false, + std::string(), false); } // Test that the last plain text field before a password field is chosen as a @@ -2460,7 +2474,7 @@ fill_data_.additional_logins.clear(); SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState("", false, kAlicePassword, true); + CheckTextFieldsSuggestedState("", false, kAlicePassword, true); } // Tests that both the username and the password fields are autocompleted @@ -2472,7 +2486,7 @@ ASSERT_FALSE(fill_data_.additional_logins.empty()); SimulateOnFillPasswordForm(fill_data_); - CheckTextFieldsState("", true, kAlicePassword, true); + CheckTextFieldsSuggestedState("", true, kAlicePassword, true); } TEST_F(PasswordAutofillAgentTest, NoForm_PromptForAJAXSubmitWithoutNavigation) { @@ -3115,7 +3129,7 @@ SimulateOnFillPasswordForm(fill_data_); // The username and password should have been autocompleted. - CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true); + CheckTextFieldsSuggestedState(kAliceUsername, true, kAlicePassword, true); } // Regression test for https://crbug.com/728028. @@ -3299,14 +3313,15 @@ // Supply old fill data password_autofill_agent_->FillPasswordForm(0, fill_data_); // The username and password should have been autocompleted. - CheckTextFieldsState(kAliceUsername, true, kAlicePassword, true); + CheckTextFieldsSuggestedState(kAliceUsername, true, kAlicePassword, true); // Change fill data fill_data_.password_field.value = ASCIIToUTF16("a-changed-password"); // Supply changed fill data password_autofill_agent_->FillPasswordForm(1 /* New key means new data */, fill_data_); - CheckTextFieldsState(kAliceUsername, true, "a-changed-password", true); + CheckTextFieldsSuggestedState(kAliceUsername, true, "a-changed-password", + true); } TEST_F(PasswordAutofillAgentTest, SuggestLatestCredentials) {
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc index aa14f288..effd30b 100644 --- a/chrome/renderer/chrome_content_renderer_client.cc +++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -1294,6 +1294,7 @@ WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, + content::ResourceType resource_type, std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles, GURL* new_url) { if (base::FeatureList::IsEnabled(features::kNetworkService)) {
diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h index 9427391..408d25c 100644 --- a/chrome/renderer/chrome_content_renderer_client.h +++ b/chrome/renderer/chrome_content_renderer_client.h
@@ -158,6 +158,7 @@ blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, + content::ResourceType resource_type, std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles, GURL* new_url) override; bool IsPrefetchOnly(content::RenderFrame* render_frame,
diff --git a/chrome/renderer/chrome_content_renderer_client_browsertest.cc b/chrome/renderer/chrome_content_renderer_client_browsertest.cc index 8f18002..f0d6223 100644 --- a/chrome/renderer/chrome_content_renderer_client_browsertest.cc +++ b/chrome/renderer/chrome_content_renderer_client_browsertest.cc
@@ -102,9 +102,9 @@ std::vector<std::unique_ptr<content::URLLoaderThrottle>> throttles; GURL result; // Make sure the SearchBox rewrites a thumbnail request from the main frame. - EXPECT_TRUE(client.WillSendRequest(GetMainFrame(), ui::PAGE_TRANSITION_LINK, - blink::WebURL(thumbnail_url), &throttles, - &result)); + EXPECT_TRUE(client.WillSendRequest( + GetMainFrame(), ui::PAGE_TRANSITION_LINK, blink::WebURL(thumbnail_url), + content::RESOURCE_TYPE_MAIN_FRAME, &throttles, &result)); // Make sure the SearchBox rewrites a thumbnail request from the iframe. blink::WebFrame* child_frame = GetMainFrame()->FirstChild(); @@ -112,9 +112,9 @@ ASSERT_TRUE(child_frame->IsWebLocalFrame()); blink::WebLocalFrame* local_child = static_cast<blink::WebLocalFrame*>(child_frame); - EXPECT_TRUE(client.WillSendRequest(local_child, ui::PAGE_TRANSITION_LINK, - blink::WebURL(thumbnail_url), &throttles, - &result)); + EXPECT_TRUE(client.WillSendRequest( + local_child, ui::PAGE_TRANSITION_LINK, blink::WebURL(thumbnail_url), + content::RESOURCE_TYPE_MAIN_FRAME, &throttles, &result)); } // The tests below examine Youtube requests that use the Flash API and ensure
diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc index bd0fc9c..57943e8 100644 --- a/chrome/renderer/media/chrome_key_systems.cc +++ b/chrome/renderer/media/chrome_key_systems.cc
@@ -76,8 +76,8 @@ "org.chromium.externalclearkey"; static const char kExternalClearKeyDecryptOnlyKeySystem[] = "org.chromium.externalclearkey.decryptonly"; - static const char kExternalClearKeyRenewalKeySystem[] = - "org.chromium.externalclearkey.renewal"; + static const char kExternalClearKeyMessageTypeTestKeySystem[] = + "org.chromium.externalclearkey.messagetypetest"; static const char kExternalClearKeyFileIOTestKeySystem[] = "org.chromium.externalclearkey.fileiotest"; static const char kExternalClearKeyOutputProtectionTestKeySystem[] = @@ -110,9 +110,9 @@ concrete_key_systems->emplace_back(new cdm::ExternalClearKeyProperties( kExternalClearKeyDecryptOnlyKeySystem)); - // A key system that triggers renewal message in ClearKeyCdm. - concrete_key_systems->emplace_back( - new cdm::ExternalClearKeyProperties(kExternalClearKeyRenewalKeySystem)); + // A key system that triggers various types of messages in ClearKeyCdm. + concrete_key_systems->emplace_back(new cdm::ExternalClearKeyProperties( + kExternalClearKeyMessageTypeTestKeySystem)); // A key system that triggers the FileIO test in ClearKeyCdm. concrete_key_systems->emplace_back(new cdm::ExternalClearKeyProperties(
diff --git a/chrome/renderer/net/net_error_helper_core_unittest.cc b/chrome/renderer/net/net_error_helper_core_unittest.cc index c36dffb..3f7c74d 100644 --- a/chrome/renderer/net/net_error_helper_core_unittest.cc +++ b/chrome/renderer/net/net_error_helper_core_unittest.cc
@@ -18,7 +18,6 @@ #include "base/logging.h" #include "base/macros.h" #include "base/memory/ptr_util.h" -#include "base/metrics/statistics_recorder.h" #include "base/strings/stringprintf.h" #include "base/test/histogram_tester.h" #include "base/timer/mock_timer.h" @@ -173,8 +172,6 @@ EXPECT_FALSE(is_url_being_fetched()); } - void SetUp() override { base::StatisticsRecorder::Initialize(); } - void SetUpCore(bool auto_reload_enabled, bool auto_reload_visible_only, bool visible) {
diff --git a/chrome/renderer/security_filter_peer.h b/chrome/renderer/security_filter_peer.h index 05f77aa..5a08833a 100644 --- a/chrome/renderer/security_filter_peer.h +++ b/chrome/renderer/security_filter_peer.h
@@ -70,7 +70,6 @@ const network::URLLoaderCompletionStatus& status) override; private: - content::ResourceResponseInfo response_info_; std::string mime_type_; std::string data_;
diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc index 2482706..1af4ea7 100644 --- a/chrome/service/service_main.cc +++ b/chrome/service/service_main.cc
@@ -5,7 +5,6 @@ #include "base/base_switches.h" #include "base/debug/debugger.h" #include "base/message_loop/message_loop.h" -#include "base/metrics/statistics_recorder.h" #include "base/run_loop.h" #include "chrome/common/service_process_util.h" #include "chrome/service/service_process.h" @@ -28,8 +27,6 @@ VLOG(1) << "Service process launched: " << parameters.command_line.GetCommandLineString(); - base::StatisticsRecorder::Initialize(); - // If there is already a service process running, quit now. std::unique_ptr<ServiceProcessState> state(new ServiceProcessState); if (!state->Initialize())
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index cd79274d..cc46bda6 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -2978,6 +2978,8 @@ "../browser/download/download_dir_policy_handler_unittest.cc", "../browser/media/router/discovery/dial/device_description_fetcher_unittest.cc", "../browser/media/router/discovery/dial/device_description_service_unittest.cc", + "../browser/media/router/discovery/dial/dial_app_discovery_service_unittest.cc", + "../browser/media/router/discovery/dial/dial_app_info_fetcher_unittest.cc", "../browser/media/router/discovery/dial/dial_device_data_unittest.cc", "../browser/media/router/discovery/dial/dial_media_sink_service_impl_unittest.cc", "../browser/media/router/discovery/dial/dial_media_sink_service_unittest.cc", @@ -4757,6 +4759,7 @@ if (is_win) { sources += [ "../browser/downgrade/user_data_downgrade_browsertest.cc", + "../browser/notifications/notification_platform_bridge_win_interactive_uitest.cc", "../browser/ui/views/touch_events_interactive_uitest_win.cc", "//ui/resources/cursors/aliasb.cur", "//ui/resources/cursors/cell.cur", @@ -4783,7 +4786,16 @@ configs += [ "//build/config/win:default_large_module_incremental_linking" ] - libs = [ "oleacc.lib" ] + libs = [ + "oleacc.lib", + "runtimeobject.lib", + ] + + ldflags += [ + "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll", + "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll", + "/DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll", + ] } if (is_mac) {
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java index c95b186..5853ff16 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/ChromeActivityTestRule.java
@@ -274,6 +274,7 @@ }); } }, secondsToWait); + ChromeTabUtils.waitForInteractable(tab); InstrumentationRegistry.getInstrumentation().waitForIdleSync(); return result.get(); } @@ -329,6 +330,7 @@ Assert.fail("Failed to create new tab"); } ChromeTabUtils.waitForTabPageLoaded(tab, url); + ChromeTabUtils.waitForInteractable(tab); InstrumentationRegistry.getInstrumentation().waitForIdleSync(); return tab; }
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ChromeTabUtils.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ChromeTabUtils.java index 0345f56..e2a5b43 100644 --- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ChromeTabUtils.java +++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ChromeTabUtils.java
@@ -236,6 +236,78 @@ } /** + * An observer that waits for a Tab to become interactable. + * + * Notifies the provided callback when: + * - the page has become interactable + * - the tab has been hidden and will not become interactable. + * Stops observing with a failure if the tab has crashed. + * + * We treat the hidden case as success to handle loads in which a page immediately closes itself + * or opens a new foreground tab (popup), and may not become interactable. + */ + private static class TabPageInteractableObserver extends EmptyTabObserver { + private Tab mTab; + private CallbackHelper mCallback; + + public TabPageInteractableObserver(Tab tab, CallbackHelper interactableCallback) { + mTab = tab; + mCallback = interactableCallback; + } + + @Override + public void onCrash(Tab tab, boolean sadTabShown) { + mCallback.notifyFailed("Tab crashed :("); + mTab.removeObserver(this); + } + + @Override + public void onHidden(Tab tab) { + mCallback.notifyCalled(); + mTab.removeObserver(this); + } + + @Override + public void onInteractabilityChanged(boolean interactable) { + if (interactable) { + mCallback.notifyCalled(); + mTab.removeObserver(this); + } + } + } + + /** + * Waits for the tab to become interactable. This occurs after load, once all view + * animations have completed. + * + * @param tab The tab to wait for interactability on. + */ + public static void waitForInteractable(final Tab tab) throws InterruptedException { + Assert.assertFalse(ThreadUtils.runningOnUiThread()); + + final CallbackHelper interactableCallback = new CallbackHelper(); + ThreadUtils.runOnUiThreadBlocking(new Runnable() { + @Override + public void run() { + // If a tab is hidden, don't wait for interactivity. See note in + // TabPageInteractableObserver. + if (tab.isUserInteractable() || tab.isHidden()) { + interactableCallback.notifyCalled(); + return; + } + tab.addObserver(new TabPageInteractableObserver(tab, interactableCallback)); + } + }); + + try { + interactableCallback.waitForCallback( + 0, 1, ScalableTimeout.scaleTimeout(10), TimeUnit.SECONDS); + } catch (TimeoutException e) { + Assert.fail("Page never became interactable."); + } + } + + /** * Switch to the given TabIndex in the current tabModel. * @param tabIndex */
diff --git a/chrome/test/base/chrome_render_view_host_test_harness.cc b/chrome/test/base/chrome_render_view_host_test_harness.cc index 24bc6d33..b9de82b 100644 --- a/chrome/test/base/chrome_render_view_host_test_harness.cc +++ b/chrome/test/base/chrome_render_view_host_test_harness.cc
@@ -12,9 +12,11 @@ #include "chrome/browser/signin/chrome_signin_client_factory.h" #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" +#include "chrome/browser/signin/signin_error_controller_factory.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/test/base/testing_profile.h" #include "components/signin/core/browser/fake_signin_manager.h" +#include "components/signin/core/browser/signin_error_controller.h" #if defined(OS_CHROMEOS) #include "ash/shell.h" @@ -32,16 +34,19 @@ ChromeSigninClientFactory::GetForProfile(profile); AccountTrackerService* account_tracker_service = AccountTrackerServiceFactory::GetForProfile(profile); + SigninErrorController* signin_error_controller = + SigninErrorControllerFactory::GetForProfile(profile); #if defined (OS_CHROMEOS) - std::unique_ptr<SigninManagerBase> signin( - new SigninManagerBase(signin_client, account_tracker_service)); + std::unique_ptr<SigninManagerBase> signin(new SigninManagerBase( + signin_client, account_tracker_service, signin_error_controller)); signin->Initialize(NULL); return std::move(signin); #else std::unique_ptr<FakeSigninManager> manager(new FakeSigninManager( signin_client, ProfileOAuth2TokenServiceFactory::GetForProfile(profile), account_tracker_service, - GaiaCookieManagerServiceFactory::GetForProfile(profile))); + GaiaCookieManagerServiceFactory::GetForProfile(profile), + signin_error_controller)); manager->Initialize(g_browser_process->local_state()); return std::move(manager); #endif
diff --git a/chrome/test/chromedriver/capabilities_unittest.cc b/chrome/test/chromedriver/capabilities_unittest.cc index 31fa8dd..a2c5c9a073 100644 --- a/chrome/test/chromedriver/capabilities_unittest.cc +++ b/chrome/test/chromedriver/capabilities_unittest.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/stl_util.h" +#include "base/strings/pattern.h" #include "base/values.h" #include "chrome/test/chromedriver/chrome/log.h" #include "chrome/test/chromedriver/chrome/status.h" @@ -530,11 +531,11 @@ ASSERT_EQ(1u, capabilities.switches.GetSize()); ASSERT_TRUE(capabilities.switches.HasSwitch("user-agent")); - ASSERT_EQ( + ASSERT_TRUE(base::MatchPattern( + capabilities.switches.GetSwitchValue("user-agent"), "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) " - "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3227.0 Mobile " - "Safari/537.36", - capabilities.switches.GetSwitchValue("user-agent")); + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/*.*.*.* Mobile " + "Safari/537.36")); ASSERT_EQ(360, capabilities.device_metrics->width); ASSERT_EQ(640, capabilities.device_metrics->height);
diff --git a/chrome/test/chromedriver/chrome/mobile_device_list.cc b/chrome/test/chromedriver/chrome/mobile_device_list.cc index 22a2873..a2aa9ed 100644 --- a/chrome/test/chromedriver/chrome/mobile_device_list.cc +++ b/chrome/test/chromedriver/chrome/mobile_device_list.cc
@@ -1,8 +1,8 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. +// Copyright 2018 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. -// This file was generated at (2017-09-29 09:51:48.959567) by running: +// This file was generated at (2018-01-03 09:47:36.639726) by running: // ./chrome/test/chromedriver/embed_mobile_devices_in_cpp.py --directory // chrome/test/chromedriver/chrome/ // third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json @@ -22,20 +22,20 @@ "Safari/537.10+\"}, \"Nexus 6\": {\"deviceScaleFactor\": 3.5, \"mobile\": " "true, \"height\": 732, \"width\": 412, \"touch\": true, \"userAgent\": " "\"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) " - "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3227.0 Mobile " + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3302.0 Mobile " "Safari/537.36\"}, \"LG Optimus L70\": {\"deviceScaleFactor\": 1.25, " "\"mobile\": true, \"height\": 640, \"width\": 384, \"touch\": true, " "\"userAgent\": \"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 " "Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 " - "Chrome/63.0.3227.0 Mobile Safari/537.36\"}, \"Nexus 4\": " + "Chrome/65.0.3302.0 Mobile Safari/537.36\"}, \"Nexus 4\": " "{\"deviceScaleFactor\": 2, \"mobile\": true, \"height\": 640, \"width\": " "384, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (Linux; Android 4.4.2; " "Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/63.0.3227.0 Mobile Safari/537.36\"}, \"Nexus 5\": " + "Chrome/65.0.3302.0 Mobile Safari/537.36\"}, \"Nexus 5\": " "{\"deviceScaleFactor\": 3, \"mobile\": true, \"height\": 640, \"width\": " "360, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (Linux; Android 6.0; " "Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/63.0.3227.0 Mobile Safari/537.36\"}, \"Blackberry PlayBook\": " + "Chrome/65.0.3302.0 Mobile Safari/537.36\"}, \"Blackberry PlayBook\": " "{\"deviceScaleFactor\": 1, \"mobile\": true, \"height\": 1024, \"width\": " "600, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (PlayBook; U; RIM " "Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) " @@ -47,36 +47,53 @@ "{\"deviceScaleFactor\": 3.5, \"mobile\": true, \"height\": 732, " "\"width\": 412, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (Linux; " "Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like " - "Gecko) Chrome/63.0.3227.0 Mobile Safari/537.36\"}, \"Laptop with HiDPI " + "Gecko) Chrome/65.0.3302.0 Mobile Safari/537.36\"}, \"iPhone 8 Plus\": " + "{\"deviceScaleFactor\": 3, \"mobile\": true, \"height\": 736, \"width\": " + "414, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS " + "10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) " + "CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1\"}, \"iPhone 7 Plus\": " + "{\"deviceScaleFactor\": 3, \"mobile\": true, \"height\": 736, \"width\": " + "414, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS " + "10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) " + "CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1\"}, \"Laptop with HiDPI " "screen\": {\"deviceScaleFactor\": 2, \"mobile\": false, \"height\": 1440, " "\"width\": 900, \"touch\": false, \"userAgent\": \"\"}, \"Nexus 7\": " "{\"deviceScaleFactor\": 2, \"mobile\": true, \"height\": 960, \"width\": " "600, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (Linux; Android 4.3; " "Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) " - "Chrome/63.0.3227.0 Safari/537.36\"}, \"Nokia N9\": " + "Chrome/65.0.3302.0 Safari/537.36\"}, \"Nokia N9\": " "{\"deviceScaleFactor\": 1, \"mobile\": true, \"height\": 854, \"width\": " "480, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (MeeGo; NokiaN9) " "AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile " "Safari/534.13\"}, \"Nokia Lumia 520\": {\"deviceScaleFactor\": 1.5, " "\"mobile\": true, \"height\": 533, \"width\": 320, \"touch\": true, " "\"userAgent\": \"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; " - "Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)\"}, \"Nexus " - "10\": {\"deviceScaleFactor\": 2, \"mobile\": true, \"height\": 1280, " - "\"width\": 800, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (Linux; " - "Android 4.3; Nexus 10 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like " - "Gecko) Chrome/63.0.3227.0 Safari/537.36\"}, \"Microsoft Lumia 950\": " - "{\"deviceScaleFactor\": 4, \"mobile\": true, \"height\": 640, \"width\": " - "360, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (Windows Phone 10.0; " - "Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like " - "Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263\"}, \"iPhone " - "5\": {\"deviceScaleFactor\": 2, \"mobile\": true, \"height\": 568, " - "\"width\": 320, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (iPhone; " - "CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) " - "Version/9.0 Mobile/13B143 Safari/601.1\"}, \"iPhone 4\": " - "{\"deviceScaleFactor\": 2, \"mobile\": true, \"height\": 480, \"width\": " - "320, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS " - "9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 " - "Mobile/13B143 Safari/601.1\"}, \"iPhone 6\": {\"deviceScaleFactor\": 2, " + "Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)\"}, \"iPhone " + "7\": {\"deviceScaleFactor\": 2, \"mobile\": true, \"height\": 667, " + "\"width\": 375, \"touch\": true, \"userAgent\": \"Mozilla/5.0 (iPhone; " + "CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like " + "Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1\"}, \"Microsoft " + "Lumia 950\": {\"deviceScaleFactor\": 4, \"mobile\": true, \"height\": " + "640, \"width\": 360, \"touch\": true, \"userAgent\": \"Mozilla/5.0 " + "(Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) " + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile " + "Safari/537.36 Edge/14.14263\"}, \"iPhone 5\": {\"deviceScaleFactor\": 2, " + "\"mobile\": true, \"height\": 568, \"width\": 320, \"touch\": true, " + "\"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) " + "AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 " + "Safari/601.1\"}, \"iPhone 4\": {\"deviceScaleFactor\": 2, \"mobile\": " + "true, \"height\": 480, \"width\": 320, \"touch\": true, \"userAgent\": " + "\"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) " + "AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 " + "Safari/601.1\"}, \"Nexus 10\": {\"deviceScaleFactor\": 2, \"mobile\": " + "true, \"height\": 1280, \"width\": 800, \"touch\": true, \"userAgent\": " + "\"Mozilla/5.0 (Linux; Android 4.3; Nexus 10 Build/JSS15Q) " + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3302.0 " + "Safari/537.36\"}, \"iPhone 8\": {\"deviceScaleFactor\": 2, \"mobile\": " + "true, \"height\": 667, \"width\": 375, \"touch\": true, \"userAgent\": " + "\"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) " + "AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 " + "Mobile/14E5239e Safari/602.1\"}, \"iPhone 6\": {\"deviceScaleFactor\": 2, " "\"mobile\": true, \"height\": 667, \"width\": 375, \"touch\": true, " "\"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) " "AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 " @@ -99,7 +116,7 @@ "Safari/601.1\"}, \"Nexus 5X\": {\"deviceScaleFactor\": 2.625, \"mobile\": " "true, \"height\": 732, \"width\": 412, \"touch\": true, \"userAgent\": " "\"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) " - "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3227.0 Mobile " + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3302.0 Mobile " "Safari/537.36\"}, \"Galaxy Note II\": {\"deviceScaleFactor\": 2, " "\"mobile\": true, \"height\": 640, \"width\": 360, \"touch\": true, " "\"userAgent\": \"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 " @@ -108,10 +125,14 @@ "\"mobile\": true, \"height\": 736, \"width\": 414, \"touch\": true, " "\"userAgent\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) " "AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 " - "Safari/601.1\"}, \"Galaxy S5\": {\"deviceScaleFactor\": 3, \"mobile\": " - "true, \"height\": 640, \"width\": 360, \"touch\": true, \"userAgent\": " - "\"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) " - "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3227.0 Mobile " + "Safari/601.1\"}, \"iPhone X\": {\"deviceScaleFactor\": 3, \"mobile\": " + "true, \"height\": 812, \"width\": 375, \"touch\": true, \"userAgent\": " + "\"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) " + "AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 " + "Mobile/14E5239e Safari/602.1\"}, \"Galaxy S5\": {\"deviceScaleFactor\": " + "3, \"mobile\": true, \"height\": 640, \"width\": 360, \"touch\": true, " + "\"userAgent\": \"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) " + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3302.0 Mobile " "Safari/537.36\"}, \"Kindle Fire HDX\": {\"deviceScaleFactor\": 2, " "\"mobile\": true, \"height\": 1280, \"width\": 800, \"touch\": true, " "\"userAgent\": \"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) "
diff --git a/chrome/test/chromedriver/chrome/mobile_device_list.h b/chrome/test/chromedriver/chrome/mobile_device_list.h index f8cd1368..925680edd 100644 --- a/chrome/test/chromedriver/chrome/mobile_device_list.h +++ b/chrome/test/chromedriver/chrome/mobile_device_list.h
@@ -1,8 +1,8 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. +// Copyright 2018 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. -// This file was generated at (2017-09-29 09:51:48.959567) by running: +// This file was generated at (2018-01-03 09:47:36.639726) by running: // ./chrome/test/chromedriver/embed_mobile_devices_in_cpp.py --directory // chrome/test/chromedriver/chrome/ // third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
diff --git a/chrome/test/chromedriver/server/chromedriver_server.cc b/chrome/test/chromedriver/server/chromedriver_server.cc index 0903de1..08c69b15 100644 --- a/chrome/test/chromedriver/server/chromedriver_server.cc +++ b/chrome/test/chromedriver/server/chromedriver_server.cc
@@ -106,7 +106,8 @@ info, base::Bind(&HttpServer::OnResponse, weak_factory_.GetWeakPtr(), - connection_id)); + connection_id, + info.HasHeaderValue("connection", "keep-alive"))); } void OnWebSocketRequest(int connection_id, const net::HttpServerRequestInfo& info) override {} @@ -116,11 +117,10 @@ private: void OnResponse(int connection_id, + bool keep_alive, std::unique_ptr<net::HttpServerResponseInfo> response) { - // Don't support keep-alive, since there's no way to detect if the - // client is HTTP/1.0. In such cases, the client may hang waiting for - // the connection to close (e.g., python 2.7 urllib). - response->AddHeader("Connection", "close"); + if (!keep_alive) + response->AddHeader("Connection", "close"); server_->SendResponse(connection_id, *response); // Don't need to call server_->Close(), since SendResponse() will handle // this for us.
diff --git a/chrome/test/data/extensions/api_test/wallpaper_manager/test.js b/chrome/test/data/extensions/api_test/wallpaper_manager/test.js index cc42ffa49..4188ad75 100644 --- a/chrome/test/data/extensions/api_test/wallpaper_manager/test.js +++ b/chrome/test/data/extensions/api_test/wallpaper_manager/test.js
@@ -39,13 +39,8 @@ requestImage(url, function(requestStatus, response) { if (requestStatus === 200) { wallpaperJpeg = response; - chrome.wallpaperPrivate.setWallpaper(wallpaperJpeg, - 'CENTER_CROPPED', - url, - pass(function() { - chrome.wallpaperPrivate.setCustomWallpaperLayout('CENTER', - fail('Only custom wallpaper can change layout.')); - })); + chrome.wallpaperPrivate.setWallpaper( + wallpaperJpeg, 'CENTER_CROPPED', url, pass()); } else { chrome.test.fail('Failed to load test.jpg from local server.'); }
diff --git a/chrome/test/data/extensions/zipfile_installer/bad.zip b/chrome/test/data/extensions/zipfile_installer/bad.zip new file mode 100644 index 0000000..64c123a --- /dev/null +++ b/chrome/test/data/extensions/zipfile_installer/bad.zip Binary files differ
diff --git a/chrome/test/data/extensions/zipfile_installer/bad/hello.txt b/chrome/test/data/extensions/zipfile_installer/bad/hello.txt new file mode 100644 index 0000000..d200f1a --- /dev/null +++ b/chrome/test/data/extensions/zipfile_installer/bad/hello.txt
@@ -0,0 +1 @@ +No manifest in this archive.
diff --git a/chrome/test/data/prerender/prerender_loader_with_beforeunload.html b/chrome/test/data/prerender/prerender_loader_with_beforeunload.html index 7fec96c..b225ff69 100644 --- a/chrome/test/data/prerender/prerender_loader_with_beforeunload.html +++ b/chrome/test/data/prerender/prerender_loader_with_beforeunload.html
@@ -9,7 +9,7 @@ // The request must be async in order to be allowed in a beforeunload // handler. var xhr = new XMLHttpRequest(); - xhr.open('GET', 'http://unload-url.test', true); + xhr.open('GET', '/unload-url', true); xhr.send(); }
diff --git a/chrome/test/data/prerender/prerender_loader_with_hanging_unload.html b/chrome/test/data/prerender/prerender_loader_with_hanging_unload.html new file mode 100644 index 0000000..079912d --- /dev/null +++ b/chrome/test/data/prerender/prerender_loader_with_hanging_unload.html
@@ -0,0 +1,24 @@ +<html> +<head> +<title>Preloader</title> +<script src="prerender_events_common.js"></script> + +<script> + function UnloadHandler() { + // Signal to the browser the unload happened by hitting a URL. Must + // be synchronous so the request isn't cancelled. + var xhr = new XMLHttpRequest(); + xhr.open('GET', '/hung', false); + xhr.send(); + } + + addEventListener('unload', UnloadHandler, false); +</script> + +</head> +<body> +<script> + AddPrerender('REPLACE_WITH_PRERENDER_URL', 0); +</script> +</body> +</html>
diff --git a/chrome/test/data/prerender/prerender_loader_with_unload.html b/chrome/test/data/prerender/prerender_loader_with_unload.html index 5e84680d..53e3398 100644 --- a/chrome/test/data/prerender/prerender_loader_with_unload.html +++ b/chrome/test/data/prerender/prerender_loader_with_unload.html
@@ -8,7 +8,7 @@ // Signal to the browser the unload happened by hitting a URL. Must // be synchronous so the request isn't cancelled. var xhr = new XMLHttpRequest(); - xhr.open('GET', 'http://unload-url.test', false); + xhr.open('GET', '/unload-url', false); xhr.send(); }
diff --git a/chrome/test/data/public_offline_pages/hello.mhtml b/chrome/test/data/public_offline_pages/hello.mhtml new file mode 100644 index 0000000..1ac5223 --- /dev/null +++ b/chrome/test/data/public_offline_pages/hello.mhtml
@@ -0,0 +1,17 @@ +From: <Saved by UnMHT> +Subject: Hello +Date: Mon, Nov 21 2011 10:59:06 GMT-0800 +MIME-Version: 1.0 +Content-Type: multipart/related; + boundary="----=_NextPart_000_0000_0324C3DC.A3C79392"; + type="text/html" + +------=_NextPart_000_0000_0324C3DC.A3C79392 +Content-Type: text/html; charset="UTF-8" +Content-Transfer-Encoding: quoted-printable +Content-Location: http://www.example.com + +<html> +Hello, World! +</html> +------=_NextPart_000_0000_0324C3DC.A3C79392--
diff --git a/chrome/test/data/webui/settings/.eslintrc.js b/chrome/test/data/webui/settings/.eslintrc.js new file mode 100644 index 0000000..994fc37 --- /dev/null +++ b/chrome/test/data/webui/settings/.eslintrc.js
@@ -0,0 +1,9 @@ +// Copyright 2017 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.exports = { + 'rules': { + 'no-var': 'error', + }, +};
diff --git a/chrome/test/data/webui/settings/a11y/basic_a11y_test.js b/chrome/test/data/webui/settings/a11y/basic_a11y_test.js index 556bcec4..d9c86006 100644 --- a/chrome/test/data/webui/settings/a11y/basic_a11y_test.js +++ b/chrome/test/data/webui/settings/a11y/basic_a11y_test.js
@@ -22,8 +22,8 @@ violationFilter: Object.assign({}, SettingsAccessibilityTest.violationFilter, { 'button-name': function(nodeResult) { - var node = nodeResult.element; + const node = nodeResult.element; return node.classList.contains('icon-expand-more'); }, }), -}); \ No newline at end of file +});
diff --git a/chrome/test/data/webui/settings/a11y/edit_dictionary_a11y_test.js b/chrome/test/data/webui/settings/a11y/edit_dictionary_a11y_test.js index 4338943..557d894 100644 --- a/chrome/test/data/webui/settings/a11y/edit_dictionary_a11y_test.js +++ b/chrome/test/data/webui/settings/a11y/edit_dictionary_a11y_test.js
@@ -31,14 +31,15 @@ Object.assign({}, SettingsAccessibilityTest.violationFilter, { // Excuse Polymer paper-input elements. 'aria-valid-attr-value': function(nodeResult) { - var describerId = nodeResult.element.getAttribute('aria-describedby'); + const describerId = + nodeResult.element.getAttribute('aria-describedby'); return describerId === '' && nodeResult.element.id === 'input'; }, 'button-name': function(nodeResult) { - var node = nodeResult.element; + const node = nodeResult.element; return node.classList.contains('icon-expand-more'); }, }) }); -GEN('#endif // !defined(OS_MACOSX)'); \ No newline at end of file +GEN('#endif // !defined(OS_MACOSX)');
diff --git a/chrome/test/data/webui/settings/a11y/manage_profile_a11y_test.js b/chrome/test/data/webui/settings/a11y/manage_profile_a11y_test.js index 2830ba5..2fb90b9 100644 --- a/chrome/test/data/webui/settings/a11y/manage_profile_a11y_test.js +++ b/chrome/test/data/webui/settings/a11y/manage_profile_a11y_test.js
@@ -33,11 +33,11 @@ }, // Excuse Polymer paper-input elements. 'aria-valid-attr-value': function(nodeResult) { - var describerId = nodeResult.element.getAttribute('aria-describedby'); + const describerId = nodeResult.element.getAttribute('aria-describedby'); return describerId === '' && nodeResult.element.id === 'input'; }, 'button-name': function(nodeResult) { - var node = nodeResult.element; + const node = nodeResult.element; return node.classList.contains('icon-expand-more'); }, },
diff --git a/chrome/test/data/webui/settings/a11y/passwords_a11y_test.js b/chrome/test/data/webui/settings/a11y/passwords_a11y_test.js index 1aebb48..4d2db5a 100644 --- a/chrome/test/data/webui/settings/a11y/passwords_a11y_test.js +++ b/chrome/test/data/webui/settings/a11y/passwords_a11y_test.js
@@ -61,7 +61,7 @@ PasswordManagerImpl.instance_ = new TestPasswordManager(); this.passwordManager = PasswordManagerImpl.instance_; - var settingsUi = document.createElement('settings-ui'); + const settingsUi = document.createElement('settings-ui'); // The settings section will expand to load the MANAGE_PASSWORDS route // (based on the URL set above) once the settings-ui element is attached @@ -89,8 +89,8 @@ assertEquals(0, this.passwordsSection.savedPasswords.length); }, 'Accessible with 10 passwords': function() { - var fakePasswords = []; - for (var i = 0; i < 10; i++) { + const fakePasswords = []; + for (let i = 0; i < 10; i++) { fakePasswords.push(FakeDataMaker.passwordEntry()); } // Set list of passwords. @@ -105,7 +105,7 @@ violationFilter: Object.assign({}, SettingsAccessibilityTest.violationFilter, { 'button-name': function(nodeResult) { - var node = nodeResult.element; + const node = nodeResult.element; return node.classList.contains('icon-expand-more'); }, }),
diff --git a/chrome/test/data/webui/settings/a11y/sign_out_a11y_test.js b/chrome/test/data/webui/settings/a11y/sign_out_a11y_test.js index fb19d29..e055ede 100644 --- a/chrome/test/data/webui/settings/a11y/sign_out_a11y_test.js +++ b/chrome/test/data/webui/settings/a11y/sign_out_a11y_test.js
@@ -52,7 +52,7 @@ this.browserProxy = new TestSyncBrowserProxy(); settings.SyncBrowserProxyImpl.instance_ = this.browserProxy; - var settingsUi = document.createElement('settings-ui'); + const settingsUi = document.createElement('settings-ui'); document.body.appendChild(settingsUi); Polymer.dom.flush(); @@ -64,11 +64,10 @@ /** @override */ tests: { 'Accessible Dialog': function() { - var disconnectButton = null; return this.browserProxy.getSyncStatus().then((syncStatus) => { // Navigate to the sign out dialog. Polymer.dom.flush(); - var disconnectButton = this.peoplePage.$$('#disconnectButton'); + const disconnectButton = this.peoplePage.$$('#disconnectButton'); assert(!!disconnectButton); MockInteractions.tap(disconnectButton); Polymer.dom.flush(); @@ -79,4 +78,4 @@ violationFilter: SettingsAccessibilityTest.violationFilter, }); -GEN('#endif // defined(OS_CHROMEOS)'); \ No newline at end of file +GEN('#endif // defined(OS_CHROMEOS)');
diff --git a/chrome/test/data/webui/settings/about_page_tests.js b/chrome/test/data/webui/settings/about_page_tests.js index e9acf648..d46694aa 100644 --- a/chrome/test/data/webui/settings/about_page_tests.js +++ b/chrome/test/data/webui/settings/about_page_tests.js
@@ -6,7 +6,7 @@ /** @implements {settings.AboutPageBrowserProxy} */ class TestAboutPageBrowserProxy extends TestBrowserProxy { constructor() { - var methodNames = [ + const methodNames = [ 'pageReady', 'refreshUpdateStatus', 'openHelpPage', @@ -178,7 +178,7 @@ * }} opt_options */ function fireStatusChanged(status, opt_options) { - var options = opt_options || {}; + const options = opt_options || {}; cr.webUIListenerCallback('update-status-changed', { progress: options.progress === undefined ? 1 : options.progress, message: options.message, @@ -187,15 +187,15 @@ } suite('AboutPageTest', function() { - var page = null; + let page = null; /** @type {?settings.TestAboutPageBrowserProxy} */ - var aboutBrowserProxy = null; + let aboutBrowserProxy = null; /** @type {?settings.TestLifetimeBrowserProxy} */ - var lifetimeBrowserProxy = null; + let lifetimeBrowserProxy = null; - var SPINNER_ICON = 'chrome://resources/images/throbber_small.svg'; + const SPINNER_ICON = 'chrome://resources/images/throbber_small.svg'; setup(function() { lifetimeBrowserProxy = new settings.TestLifetimeBrowserProxy(); @@ -239,10 +239,10 @@ * incoming 'update-status-changed' events. */ test('IconAndMessageUpdates', function() { - var icon = page.$$('iron-icon'); + const icon = page.$$('iron-icon'); assertTrue(!!icon); - var statusMessageEl = page.$$('#updateStatusMessage div'); - var previousMessageText = statusMessageEl.textContent; + const statusMessageEl = page.$$('#updateStatusMessage div'); + let previousMessageText = statusMessageEl.textContent; fireStatusChanged(UpdateStatus.CHECKING); assertEquals(SPINNER_ICON, icon.src); @@ -285,10 +285,10 @@ }); test('ErrorMessageWithHtml', function() { - var htmlError = 'hello<br>there<br>was<pre>an</pre>error'; + const htmlError = 'hello<br>there<br>was<pre>an</pre>error'; fireStatusChanged( UpdateStatus.FAILED, {message: htmlError}); - var statusMessageEl = page.$$('#updateStatusMessage div'); + const statusMessageEl = page.$$('#updateStatusMessage div'); assertEquals(htmlError, statusMessageEl.innerHTML); }); @@ -314,7 +314,7 @@ }); return initNewPage().then(function() { - var icon = page.$$('iron-icon'); + const icon = page.$$('iron-icon'); assertTrue(!!icon); assertTrue(!!page.$.updateStatusMessage); assertTrue(!!page.$.deprecationWarning); @@ -354,7 +354,7 @@ aboutObsoleteEndOfTheLine: true, }); return initNewPage().then(function() { - var icon = page.$$('iron-icon'); + const icon = page.$$('iron-icon'); assertTrue(!!icon); assertTrue(!!page.$.deprecationWarning); assertTrue(!!page.$.updateStatusMessage); @@ -383,14 +383,14 @@ }); test('Relaunch', function() { - var relaunch = page.$.relaunch; + let relaunch = page.$.relaunch; assertTrue(!!relaunch); assertTrue(relaunch.hidden); fireStatusChanged(UpdateStatus.NEARLY_UPDATED); assertFalse(relaunch.hidden); - var relaunch = page.$.relaunch; + relaunch = page.$.relaunch; assertTrue(!!relaunch); MockInteractions.tap(relaunch); return lifetimeBrowserProxy.whenCalled('relaunch'); @@ -412,9 +412,9 @@ * channel are the same. */ test('ButtonsUpdate_SameChannel', function() { - var relaunch = page.$.relaunch; - var checkForUpdates = page.$.checkForUpdates; - var relaunchAndPowerwash = page.$.relaunchAndPowerwash; + const relaunch = page.$.relaunch; + const checkForUpdates = page.$.checkForUpdates; + const relaunchAndPowerwash = page.$.relaunchAndPowerwash; assertTrue(!!relaunch); assertTrue(!!relaunchAndPowerwash); @@ -542,7 +542,7 @@ }); test('RegulatoryInfo', function() { - var regulatoryInfo = null; + let regulatoryInfo = null; /** * Checks the visibility of the "regulatory info" section. @@ -553,12 +553,12 @@ function checkRegulatoryInfo(isShowing) { return aboutBrowserProxy.whenCalled('getRegulatoryInfo').then( function() { - var regulatoryInfoEl = page.$.regulatoryInfo; + const regulatoryInfoEl = page.$.regulatoryInfo; assertTrue(!!regulatoryInfoEl); assertEquals(isShowing, !regulatoryInfoEl.hidden); if (isShowing) { - var img = regulatoryInfoEl.querySelector('img'); + const img = regulatoryInfoEl.querySelector('img'); assertTrue(!!img); assertEquals(regulatoryInfo.text, img.getAttribute('alt')); assertEquals(regulatoryInfo.url, img.getAttribute('src')); @@ -585,7 +585,7 @@ assertFalse(page.$.aboutTPMFirmwareUpdate.hidden); MockInteractions.tap(page.$.aboutTPMFirmwareUpdate); }).then(function() { - var dialog = page.$$('settings-powerwash-dialog'); + const dialog = page.$$('settings-powerwash-dialog'); assertTrue(!!dialog); assertTrue(dialog.$.dialog.open); MockInteractions.tap(dialog.$$('#powerwash')); @@ -603,7 +603,7 @@ * 'update-status-changed' events. */ test('ButtonsUpdate', function() { - var relaunch = page.$.relaunch; + const relaunch = page.$.relaunch; assertTrue(!!relaunch); fireStatusChanged(UpdateStatus.CHECKING); @@ -639,8 +639,8 @@ function registerOfficialBuildTests() { suite('AboutPageTest_OfficialBuild', function() { - var page = null; - var browserProxy = null; + let page = null; + let browserProxy = null; setup(function() { browserProxy = new TestAboutPageBrowserProxy(); @@ -661,7 +661,7 @@ * A list of possible scenarios for the promoteUpdater. * @enum {!PromoteUpdaterStatus} */ - var PromoStatusScenarios = { + const PromoStatusScenarios = { CANT_PROMOTE: { hidden: true, disabled: true, @@ -695,8 +695,8 @@ * Tests that the button's states are wired up to the status correctly. */ test('PromoteUpdaterButtonCorrectStates', function() { - var item = page.$$('#promoteUpdater'); - var arrow = page.$$('#promoteUpdater button'); + let item = page.$$('#promoteUpdater'); + let arrow = page.$$('#promoteUpdater button'); assertFalse(!!item); assertFalse(!!arrow); @@ -748,7 +748,7 @@ test('PromoteUpdaterButtonWorksWhenEnabled', function() { firePromoteUpdaterStatusChanged(PromoStatusScenarios.CAN_PROMOTE); Polymer.dom.flush(); - var item = page.$$('#promoteUpdater'); + const item = page.$$('#promoteUpdater'); assertTrue(!!item); MockInteractions.tap(item); @@ -762,8 +762,8 @@ if (cr.isChromeOS) { function registerDetailedBuildInfoTests() { suite('DetailedBuildInfoTest', function() { - var page = null; - var browserProxy = null; + let page = null; + let browserProxy = null; setup(function() { browserProxy = new TestAboutPageBrowserProxy(); @@ -777,7 +777,7 @@ }); test('Initialization', function() { - var versionInfo = { + const versionInfo = { arcVersion: 'dummyArcVersion', osFirmware: 'dummyOsFirmware', osVersion: 'dummyOsVersion', @@ -811,7 +811,7 @@ page = document.createElement('settings-detailed-build-info'); document.body.appendChild(page); return browserProxy.whenCalled('getChannelInfo').then(function() { - var changeChannelButton = page.$$('paper-button'); + const changeChannelButton = page.$$('paper-button'); assertTrue(!!changeChannelButton); assertEquals(canChangeChannel, !changeChannelButton.disabled); }); @@ -829,10 +829,10 @@ function registerChannelSwitcherDialogTests() { suite('ChannelSwitcherDialogTest', function() { - var dialog = null; - var radioButtons = null; - var browserProxy = null; - var currentChannel = BrowserChannel.BETA; + let dialog = null; + let radioButtons = null; + let browserProxy = null; + const currentChannel = BrowserChannel.BETA; setup(function() { browserProxy = new TestAboutPageBrowserProxy(); @@ -851,7 +851,7 @@ teardown(function() { dialog.remove(); }); test('Initialization', function() { - var radioGroup = dialog.$$('paper-radio-group'); + const radioGroup = dialog.$$('paper-radio-group'); assertTrue(!!radioGroup); assertTrue(!!dialog.$.warning); assertTrue(!!dialog.$.changeChannel); @@ -880,7 +880,7 @@ assertTrue(dialog.$.changeChannelAndPowerwash.hidden); assertFalse(dialog.$.changeChannel.hidden); - var whenTargetChannelChangedFired = test_util.eventToPromise( + const whenTargetChannelChangedFired = test_util.eventToPromise( 'target-channel-changed', dialog); MockInteractions.tap(dialog.$.changeChannel); @@ -907,7 +907,7 @@ assertFalse(dialog.$.changeChannelAndPowerwash.hidden); assertTrue(dialog.$.changeChannel.hidden); - var whenTargetChannelChangedFired = test_util.eventToPromise( + const whenTargetChannelChangedFired = test_util.eventToPromise( 'target-channel-changed', dialog); MockInteractions.tap(dialog.$.changeChannelAndPowerwash);
diff --git a/chrome/test/data/webui/settings/advanced_page_browsertest.js b/chrome/test/data/webui/settings/advanced_page_browsertest.js index 117e1f2..d857d7b6 100644 --- a/chrome/test/data/webui/settings/advanced_page_browsertest.js +++ b/chrome/test/data/webui/settings/advanced_page_browsertest.js
@@ -28,7 +28,7 @@ TEST_F('SettingsAdvancedPageBrowserTest', 'MAYBE_Load', function() { // Assign |self| to |this| instead of binding since 'this' in suite() // and test() will be a Mocha 'Suite' or 'Test' instance. - var self = this; + const self = this; // Register mocha tests. suite('SettingsPage', function() { @@ -41,14 +41,14 @@ }); test('advanced pages', function() { - var page = self.basicPage; - var sections = ['privacy', 'passwordsAndForms', 'languages', 'downloads', + const page = self.basicPage; + let sections = ['privacy', 'passwordsAndForms', 'languages', 'downloads', 'reset']; if (cr.isChromeOS) sections = sections.concat(['dateTime', 'a11y']); - for (var i = 0; i < sections.length; i++) { - var section = self.getSection(page, sections[i]); + for (let i = 0; i < sections.length; i++) { + const section = self.getSection(page, sections[i]); assertTrue(!!section); self.verifySubpagesHidden(section); }
diff --git a/chrome/test/data/webui/settings/all_sites_tests.js b/chrome/test/data/webui/settings/all_sites_tests.js index 33f1835..6a97a48 100644 --- a/chrome/test/data/webui/settings/all_sites_tests.js +++ b/chrome/test/data/webui/settings/all_sites_tests.js
@@ -7,7 +7,7 @@ * different providers. * @type {SiteSettingsPref} */ -var prefsMixedProvider = { +const prefsMixedProvider = { exceptions: { geolocation: [ { @@ -37,7 +37,7 @@ * An example pref with mixed origin and pattern. * @type {SiteSettingsPref} */ -var prefsMixedOriginAndPattern = { +const prefsMixedOriginAndPattern = { exceptions: { ads: [], auto_downloads: [], @@ -78,7 +78,7 @@ * state. * @type {SiteSettingsPref} */ -var prefsVarious = { +const prefsVarious = { exceptions: { ads: [], auto_downloads: [], @@ -142,13 +142,13 @@ * A site list element created before each test. * @type {SiteList} */ - var testElement; + let testElement; /** * The mock proxy object to use during test. * @type {TestSiteSettingsPrefsBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; suiteSetup(function() { CrSettingsPrefs.setInitialized(); @@ -194,11 +194,11 @@ return browserProxy.whenCalled('getExceptionList') .then(function(contentType) { // Use resolver to ensure that the list container is populated. - var resolver = new PromiseResolver(); + const resolver = new PromiseResolver(); testElement.async(resolver.resolve); return resolver.promise.then(function() { - var item = testElement.$.listContainer.children[0]; - var name = item.querySelector('#displayName'); + const item = testElement.$.listContainer.children[0]; + const name = item.querySelector('#displayName'); assertTrue(!!name); }); }); @@ -212,7 +212,7 @@ .then(function(contentType) { // Use resolver to ensure asserts bubble up to the framework with // meaningful errors. - var resolver = new PromiseResolver(); + const resolver = new PromiseResolver(); testElement.async(resolver.resolve); return resolver.promise.then(function() { // All Sites calls getExceptionList for all categories, starting @@ -239,8 +239,8 @@ assertEquals(undefined, testElement.selectedOrigin); // Validate that the sites are shown in UI and can be selected. - var firstItem = testElement.$.listContainer.children[1]; - var clickable = firstItem.querySelector('.middle'); + const firstItem = testElement.$.listContainer.children[1]; + const clickable = firstItem.querySelector('.middle'); assertNotEquals(undefined, clickable); MockInteractions.tap(clickable); assertEquals( @@ -258,7 +258,7 @@ .then(function(contentType) { // Use resolver to ensure asserts bubble up to the framework with // meaningful errors. - var resolver = new PromiseResolver(); + const resolver = new PromiseResolver(); testElement.async(resolver.resolve); return resolver.promise.then(function() { // All Sites calls getExceptionList for all categories, starting @@ -284,8 +284,8 @@ assertEquals(undefined, testElement.selectedOrigin); // Validate that the sites are shown in UI and can be selected. - var firstItem = testElement.$.listContainer.children[0]; - var clickable = firstItem.querySelector('.middle'); + const firstItem = testElement.$.listContainer.children[0]; + const clickable = firstItem.querySelector('.middle'); assertNotEquals(undefined, clickable); MockInteractions.tap(clickable); if (testElement.sites.length == 1) {
diff --git a/chrome/test/data/webui/settings/android_apps_page_test.js b/chrome/test/data/webui/settings/android_apps_page_test.js index b0d3a2c..2b59f1b 100644 --- a/chrome/test/data/webui/settings/android_apps_page_test.js +++ b/chrome/test/data/webui/settings/android_apps_page_test.js
@@ -3,13 +3,13 @@ // found in the LICENSE file. /** @type {?SettingsAndroidAppsPageElement} */ -var androidAppsPage = null; +let androidAppsPage = null; /** @type {?TestAndroidAppsBrowserProxy} */ -var androidAppsBrowserProxy = null; +let androidAppsBrowserProxy = null; -var setAndroidAppsState = function(playStoreEnabled, settingsAppAvailable) { - var appsInfo = { +const setAndroidAppsState = function(playStoreEnabled, settingsAppAvailable) { + const appsInfo = { playStoreEnabled: playStoreEnabled, settingsAppAvailable: settingsAppAvailable, }; @@ -43,7 +43,7 @@ }); test('Enable', function() { - var button = androidAppsPage.$$('#enable'); + const button = androidAppsPage.$$('#enable'); assertTrue(!!button); assertFalse(!!androidAppsPage.$$('.subpage-arrow')); @@ -57,7 +57,7 @@ }); suite('SubPage', function() { - var subpage; + let subpage; function flushAsync() { Polymer.dom.flush(); @@ -108,10 +108,10 @@ test('ManageAppsOpenRequest', function() { setAndroidAppsState(true, true); - var button = subpage.$$('settings-android-settings-element'). + const button = subpage.$$('settings-android-settings-element'). $$('#manageApps'); assertTrue(!!button); - var promise = androidAppsBrowserProxy.whenCalled( + const promise = androidAppsBrowserProxy.whenCalled( 'showAndroidAppsSettings'); // MockInteractions.tap does not work here due style is not updated. button.click(); @@ -120,11 +120,11 @@ }); test('Disable', function() { - var dialog = subpage.$$('#confirmDisableDialog'); + const dialog = subpage.$$('#confirmDisableDialog'); assertTrue(!!dialog); assertFalse(dialog.open); - var remove = subpage.$$('#remove'); + const remove = subpage.$$('#remove'); assertTrue(!!remove); subpage.onRemoveTap_(); @@ -144,7 +144,7 @@ }); suite('Enforced', function() { - var subpage; + let subpage; setup(function() { androidAppsPage.havePlayStoreApp = true; @@ -186,10 +186,10 @@ }); test('ManageAppsOpenRequest', function() { - var button = androidAppsPage.$$('settings-android-settings-element'). + const button = androidAppsPage.$$('settings-android-settings-element'). $$('#manageApps'); assertTrue(!!button); - var promise = androidAppsBrowserProxy.whenCalled( + const promise = androidAppsBrowserProxy.whenCalled( 'showAndroidAppsSettings'); // MockInteractions.tap does not work here due style is not updated. button.click();
diff --git a/chrome/test/data/webui/settings/animation_browsertest.js b/chrome/test/data/webui/settings/animation_browsertest.js index c7b3214..257e075 100644 --- a/chrome/test/data/webui/settings/animation_browsertest.js +++ b/chrome/test/data/webui/settings/animation_browsertest.js
@@ -5,7 +5,7 @@ /** @fileoverview Tests for settings.animation. */ /** @const {string} Path to root from chrome/test/data/webui/settings/. */ -var ROOT_PATH = '../../../../../'; +const ROOT_PATH = '../../../../../'; /** * @constructor @@ -33,23 +33,23 @@ }; TEST_F('SettingsAnimationBrowserTest', 'Animation', function() { - var self = this; + const self = this; - var Animation = settings.animation.Animation; + const Animation = settings.animation.Animation; - var onFinishBeforePromise = function() { + const onFinishBeforePromise = function() { assertNotReached('Animation fired finish event before resolving promise'); }; - var onCancelUnexpectedly = function() { + const onCancelUnexpectedly = function() { assertNotReached('Animation should have finished, but fired cancel event'); }; // Register mocha tests. suite('settings.animation.Animation', function() { - var div; - var keyframes; - var options; + let div; + let keyframes; + let options; setup(function() { keyframes = [{ @@ -74,7 +74,7 @@ }); test('Animation plays', function(done) { - var animation = new Animation(div, keyframes, options); + const animation = new Animation(div, keyframes, options); animation.addEventListener('cancel', onCancelUnexpectedly); animation.addEventListener('finish', onFinishBeforePromise); @@ -95,7 +95,7 @@ // Absurdly large finite value to ensure we call finish() before the // animation finishes automatically. options.duration = Number.MAX_VALUE; - var animation = new Animation(div, keyframes, options); + const animation = new Animation(div, keyframes, options); animation.addEventListener('cancel', onCancelUnexpectedly); animation.addEventListener('finish', onFinishBeforePromise); @@ -120,7 +120,7 @@ // Absurdly large finite value to ensure we call cancel() before the // animation finishes automatically. options.duration = Number.MAX_VALUE; - var animation = new Animation(div, keyframes, options); + const animation = new Animation(div, keyframes, options); animation.addEventListener('cancel', onCancelUnexpectedly); animation.addEventListener('finish', onFinishBeforePromise);
diff --git a/chrome/test/data/webui/settings/appearance_fonts_page_test.js b/chrome/test/data/webui/settings/appearance_fonts_page_test.js index afd9c3a..eaeac51 100644 --- a/chrome/test/data/webui/settings/appearance_fonts_page_test.js +++ b/chrome/test/data/webui/settings/appearance_fonts_page_test.js
@@ -35,10 +35,10 @@ } } -var fontsPage = null; +let fontsPage = null; /** @type {?TestFontsBrowserProxy} */ -var fontsBrowserProxy = null; +let fontsBrowserProxy = null; suite('AppearanceFontHandler', function() { setup(function() { @@ -60,7 +60,7 @@ test('openAdvancedFontSettings', function() { cr.webUIListenerCallback('advanced-font-settings-installed', [true]); Polymer.dom.flush(); - var button = fontsPage.$$('#advancedButton'); + const button = fontsPage.$$('#advancedButton'); assert(!!button); MockInteractions.tap(button); return fontsBrowserProxy.whenCalled('openAdvancedFontSettings');
diff --git a/chrome/test/data/webui/settings/appearance_page_test.js b/chrome/test/data/webui/settings/appearance_page_test.js index f87cf8cb..fe3eb79b 100644 --- a/chrome/test/data/webui/settings/appearance_page_test.js +++ b/chrome/test/data/webui/settings/appearance_page_test.js
@@ -107,10 +107,10 @@ } } -var appearancePage = null; +let appearancePage = null; /** @type {?TestAppearanceBrowserProxy} */ -var appearanceBrowserProxy = null; +let appearanceBrowserProxy = null; function createAppearancePage() { appearanceBrowserProxy.reset(); @@ -155,7 +155,7 @@ createAppearancePage(); return appearanceBrowserProxy.whenCalled('isWallpaperPolicyControlled') .then(() => { - var button = appearancePage.$.wallpaperButton; + const button = appearancePage.$.wallpaperButton; assertTrue(!!button); assertFalse(button.disabled); MockInteractions.tap(button); @@ -187,15 +187,15 @@ } else { test('noWallpaperManager', function() { // The wallpaper button should not be present. - var button = appearancePage.$.wallpaperButton; + const button = appearancePage.$.wallpaperButton; assertFalse(!!button); }); } - var THEME_ID_PREF = 'prefs.extensions.theme.id.value'; + const THEME_ID_PREF = 'prefs.extensions.theme.id.value'; if (cr.isLinux && !cr.isChromeOS) { - var USE_SYSTEM_PREF = 'prefs.extensions.theme.use_system.value'; + const USE_SYSTEM_PREF = 'prefs.extensions.theme.use_system.value'; test('useDefaultThemeLinux', function() { assertFalse(!!appearancePage.get(THEME_ID_PREF)); @@ -213,7 +213,7 @@ Polymer.dom.flush(); // With a custom theme installed, "USE CLASSIC" should show. - var button = appearancePage.$$('#useDefault'); + const button = appearancePage.$$('#useDefault'); assertTrue(!!button); MockInteractions.tap(button); @@ -243,7 +243,7 @@ assertTrue(!!appearancePage.$$('#useDefault')); assertFalse(appearancePage.$$('#themesSecondaryActions').hidden); - var button = appearancePage.$$('#useSystem'); + const button = appearancePage.$$('#useSystem'); assertTrue(!!button); MockInteractions.tap(button); @@ -258,7 +258,7 @@ Polymer.dom.flush(); // With a custom theme installed, "RESET TO DEFAULT" should show. - var button = appearancePage.$$('#useDefault'); + const button = appearancePage.$$('#useDefault'); assertTrue(!!button); MockInteractions.tap(button); @@ -268,7 +268,7 @@ test('default zoom handling', function() { function getDefaultZoomText() { - var zoomLevel = appearancePage.$.zoomLevel; + const zoomLevel = appearancePage.$.zoomLevel; return zoomLevel.options[zoomLevel.selectedIndex].textContent.trim(); } @@ -306,7 +306,7 @@ }); suite('HomeUrlInput', function() { - var homeUrlInput; + let homeUrlInput; setup(function() { appearanceBrowserProxy = new TestAppearanceBrowserProxy();
diff --git a/chrome/test/data/webui/settings/basic_page_browsertest.js b/chrome/test/data/webui/settings/basic_page_browsertest.js index 374e354..2e8155c 100644 --- a/chrome/test/data/webui/settings/basic_page_browsertest.js +++ b/chrome/test/data/webui/settings/basic_page_browsertest.js
@@ -25,7 +25,7 @@ TEST_F('SettingsBasicPageBrowserTest', 'DISABLED_Load', function() { // Assign |self| to |this| instead of binding since 'this' in suite() // and test() will be a Mocha 'Suite' or 'Test' instance. - var self = this; + const self = this; /** * This fake SearchManager just hides and re-displays the sections on search. @@ -55,9 +55,9 @@ setTimeout(function() { // All the sections must be hidden by the TestSearchManager, just like // the real SearchManager. Otherwise, the bug doesn't manifest. - var sections = + const sections = Polymer.dom().querySelectorAll('* /deep/ settings-section'); - for (var i = 0; i < sections.length; i++) + for (let i = 0; i < sections.length; i++) sections[i].hiddenBySearch = !!text; this.searchRequest_.resolver.resolve(this.searchRequest_); @@ -75,30 +75,30 @@ }); test('basic pages', function() { - var page = self.basicPage; - var sections = ['appearance', 'onStartup', 'people', 'search']; + const page = self.basicPage; + let sections = ['appearance', 'onStartup', 'people', 'search']; expectTrue(!!self.getSection(page, 'appearance')); if (!cr.isChromeOS) sections.push('defaultBrowser'); else sections = sections.concat(['internet', 'bluetooth', 'device']); - for (var i = 0; i < sections.length; i++) { - var section = self.getSection(page, sections[i]); + for (let i = 0; i < sections.length; i++) { + const section = self.getSection(page, sections[i]); expectTrue(!!section); self.verifySubpagesHidden(section); } }); test('scroll to section', function() { - var page = self.basicPage; + const page = self.basicPage; // Setting the page and section will cause a scrollToSection_. settings.navigateTo(settings.routes.ON_STARTUP); return new Promise(function(resolve, reject) { // This test checks for a regression that occurred with scrollToSection_ // failing to find its host element. - var intervalId = window.setInterval(function() { + const intervalId = window.setInterval(function() { if (self.getSection(page, settings.getCurrentRoute().section)) { window.clearInterval(intervalId); resolve(); @@ -127,8 +127,8 @@ }); test('scroll to section after exiting search', function() { - var page = self.basicPage; - var searchManager = new TestSearchManager(); + const page = self.basicPage; + const searchManager = new TestSearchManager(); settings.setSearchManagerForTesting(searchManager); settings.navigateTo( @@ -144,7 +144,7 @@ assertTrue(!!page); // Should (after some time) be scrolled to the On Startup section. - var intervalId = window.setInterval(function() { + const intervalId = window.setInterval(function() { if (page.scroller.scrollTop != 0) { window.clearInterval(intervalId); resolve(); @@ -155,7 +155,7 @@ }); test('scroll to top before navigating to about', function() { - var page = self.basicPage; + const page = self.basicPage; // Set the viewport small to force the scrollbar to appear on ABOUT. Polymer.dom().querySelector('settings-ui').style.height = '200px';
diff --git a/chrome/test/data/webui/settings/bluetooth_page_tests.js b/chrome/test/data/webui/settings/bluetooth_page_tests.js index 0bbf9e7..5523722 100644 --- a/chrome/test/data/webui/settings/bluetooth_page_tests.js +++ b/chrome/test/data/webui/settings/bluetooth_page_tests.js
@@ -19,15 +19,15 @@ } suite('Bluetooth', function() { - var bluetoothPage = null; + let bluetoothPage = null; /** @type {Bluetooth} */ - var bluetoothApi_; + let bluetoothApi_; /** @type {BluetoothPrivate} */ - var bluetoothPrivateApi_; + let bluetoothPrivateApi_; - /** @type {!Array<!chrome.bluetooth.Device>} */ var fakeDevices_ = [ + /** @type {!Array<!chrome.bluetooth.Device>} */ const fakeDevices_ = [ { address: '10:00:00:00:00:01', name: 'FakePairedDevice1', @@ -92,7 +92,7 @@ assertFalse(bluetoothApi_.getAdapterStateForTest().powered); assertFalse(bluetoothPage.bluetoothToggleState_); // Test that tapping the single settings-box div enables bluetooth. - var div = bluetoothPage.$$('div.settings-box'); + const div = bluetoothPage.$$('div.settings-box'); assertTrue(!!div); MockInteractions.tap(div); assertTrue(bluetoothPage.bluetoothToggleState_); @@ -100,7 +100,7 @@ }); suite('SubPage', function() { - var subpage; + let subpage; function flushAsync() { Polymer.dom.flush(); @@ -112,7 +112,7 @@ setup(function() { bluetoothApi_.setEnabled(true); Polymer.dom.flush(); - var div = bluetoothPage.$$('div.settings-box'); + const div = bluetoothPage.$$('div.settings-box'); MockInteractions.tap(div); return flushAsync().then(() => { subpage = bluetoothPage.$$('settings-bluetooth-subpage'); @@ -127,7 +127,7 @@ test('toggle', function() { assertTrue(subpage.bluetoothToggleState); - var enableButton = subpage.$.enableBluetooth; + const enableButton = subpage.$.enableBluetooth; assertTrue(!!enableButton); assertTrue(enableButton.checked); @@ -148,7 +148,7 @@ } test('paired device list', function() { - var pairedContainer = subpage.$.pairedContainer; + const pairedContainer = subpage.$.pairedContainer; assertTrue(!!pairedContainer); assertTrue(pairedContainer.hidden); assertFalse(subpage.$.noPairedDevices.hidden); @@ -160,11 +160,11 @@ assertEquals(2, subpage.pairedDeviceList_.length); assertTrue(subpage.$.noPairedDevices.hidden); - var ironList = subpage.$.pairedDevices; + const ironList = subpage.$.pairedDevices; assertTrue(!!ironList); ironList.notifyResize(); Polymer.dom.flush(); - var devices = ironList.querySelectorAll('bluetooth-device-list-item'); + const devices = ironList.querySelectorAll('bluetooth-device-list-item'); assertEquals(2, devices.length); assertTrue(devices[0].device.connected); assertFalse(devices[1].device.connected); @@ -172,7 +172,7 @@ }); test('unpaired device list', function() { - var unpairedContainer = subpage.$.unpairedContainer; + const unpairedContainer = subpage.$.unpairedContainer; assertTrue(!!unpairedContainer); assertTrue(unpairedContainer.hidden); assertFalse(subpage.$.noUnpairedDevices.hidden); @@ -184,11 +184,11 @@ assertEquals(2, subpage.unpairedDeviceList_.length); assertTrue(subpage.$.noUnpairedDevices.hidden); - var ironList = subpage.$.unpairedDevices; + const ironList = subpage.$.unpairedDevices; assertTrue(!!ironList); ironList.notifyResize(); Polymer.dom.flush(); - var devices = ironList.querySelectorAll('bluetooth-device-list-item'); + const devices = ironList.querySelectorAll('bluetooth-device-list-item'); assertEquals(2, devices.length); assertFalse(devices[0].device.paired); assertFalse(devices[1].device.paired); @@ -203,7 +203,7 @@ assertEquals(2, subpage.pairedDeviceList_.length); assertEquals(2, subpage.unpairedDeviceList_.length); - var address = subpage.unpairedDeviceList_[0].address; + const address = subpage.unpairedDeviceList_[0].address; bluetoothPrivateApi_.connect(address, function() { Polymer.dom.flush(); assertEquals(3, subpage.pairedDeviceList_.length); @@ -217,7 +217,7 @@ bluetoothApi_.setDevicesForTest(fakeDevices_); return waitForListUpdateTimeout().then(function() { Polymer.dom.flush(); - var dialog = subpage.$.deviceDialog; + const dialog = subpage.$.deviceDialog; assertTrue(!!dialog); assertFalse(dialog.$.dialog.open);
diff --git a/chrome/test/data/webui/settings/category_default_setting_tests.js b/chrome/test/data/webui/settings/category_default_setting_tests.js index 7db8add..e877269f 100644 --- a/chrome/test/data/webui/settings/category_default_setting_tests.js +++ b/chrome/test/data/webui/settings/category_default_setting_tests.js
@@ -8,13 +8,13 @@ * A site settings category created before each test. * @type {SiteSettingsCategory} */ - var testElement; + let testElement; /** * The mock proxy object to use during test. * @type {TestSiteSettingsPrefsBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; // Initialize a site-settings-category before each test. setup(function() { @@ -53,7 +53,7 @@ }) .then(function(args) { assertEquals(category, args[0]); - var oppositeSetting = expectedEnabled ? + const oppositeSetting = expectedEnabled ? settings.ContentSetting.BLOCK : expectedEnabledContentSetting; assertEquals(oppositeSetting, args[1]); @@ -66,7 +66,7 @@ * An example pref where the location category is enabled. * @type {SiteSettingsPref} */ - var prefsLocationEnabled = { + const prefsLocationEnabled = { defaults: { geolocation: { setting: 'allow', @@ -84,7 +84,7 @@ * An example pref where the location category is disabled. * @type {SiteSettingsPref} */ - var prefsLocationDisabled = { + const prefsLocationDisabled = { defaults: { geolocation: { setting: 'block', @@ -98,7 +98,7 @@ }); test('test Flash content setting in DETECT/ASK setting', function() { - var prefsFlash = { + const prefsFlash = { defaults: { plugins: { setting: 'detect_important_content', @@ -112,7 +112,7 @@ }); test('test Flash content setting in legacy ALLOW setting', function() { - var prefsFlash = { + const prefsFlash = { defaults: { plugins: { setting: 'allow', @@ -126,7 +126,7 @@ }); test('test Flash content setting in BLOCK setting', function() { - var prefsFlash = { + const prefsFlash = { defaults: { plugins: { setting: 'block', @@ -140,7 +140,7 @@ }); test('test content setting from extension', function() { - var prefs = { + const prefs = { defaults: { mic: { setting: 'block', @@ -166,7 +166,7 @@ browserProxy.setPrefs(prefs); testElement.category = category; - var secondaryToggle = null; + let secondaryToggle = null; return browserProxy.whenCalled('getDefaultValueForContentType') .then(function(contentType) { @@ -270,7 +270,7 @@ * An example pref where the Cookies category is set to delete when * session ends. */ - var prefsCookiesSessionOnly = { + const prefsCookiesSessionOnly = { defaults: { cookies: { setting: 'session_only',
diff --git a/chrome/test/data/webui/settings/category_setting_exceptions_tests.js b/chrome/test/data/webui/settings/category_setting_exceptions_tests.js index 6cd0bb2..f4d3626 100644 --- a/chrome/test/data/webui/settings/category_setting_exceptions_tests.js +++ b/chrome/test/data/webui/settings/category_setting_exceptions_tests.js
@@ -8,7 +8,7 @@ * A site settings exceptions created before each test. * @type {SiteSettingsExceptionsElement} */ - var testElement; + let testElement; // Initialize a category-setting-exceptions before each test. setup(function() {
diff --git a/chrome/test/data/webui/settings/certificate_manager_test.js b/chrome/test/data/webui/settings/certificate_manager_test.js index 107ef3e..6b54a35 100644 --- a/chrome/test/data/webui/settings/certificate_manager_test.js +++ b/chrome/test/data/webui/settings/certificate_manager_test.js
@@ -174,19 +174,19 @@ */ function triggerInputEvent(element) { // The actual key code is irrelevant for tests. - var kSpaceBar = 32; + const kSpaceBar = 32; MockInteractions.keyEventOn(element, 'input', kSpaceBar); } suite('CaTrustEditDialogTests', function() { /** @type {?CaTrustEditDialogElement} */ - var dialog = null; + let dialog = null; /** @type {?TestCertificatesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** @type {!CaTrustInfo} */ - var caTrustInfo = {ssl: true, email: false, objSign: false}; + const caTrustInfo = {ssl: true, email: false, objSign: false}; setup(function() { settings.navigateTo(settings.routes.CERTIFICATES); @@ -261,7 +261,7 @@ document.body.appendChild(dialog); browserProxy.forceCertificatesError(); - var whenErrorEventFired = + const whenErrorEventFired = test_util.eventToPromise('certificates-error', dialog); return browserProxy.whenCalled('getCaCertificateTrust') @@ -277,13 +277,13 @@ suite('CertificateDeleteConfirmationDialogTests', function() { /** @type {?CertificateDeleteConfirmationDialogElement} */ - var dialog = null; + let dialog = null; /** @type {?TestCertificatesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** @type {!CertificateSubnode} */ - var model = createSampleCertificateSubnode(); + const model = createSampleCertificateSubnode(); setup(function() { settings.navigateTo(settings.routes.CERTIFICATES); @@ -303,7 +303,8 @@ test('DeleteSuccess', function() { assertTrue(dialog.$.dialog.open); // Check that the dialog title includes the certificate name. - var titleEl = Polymer.dom(dialog.$.dialog).querySelector('[slot=title]'); + const titleEl = + Polymer.dom(dialog.$.dialog).querySelector('[slot=title]'); assertTrue(titleEl.textContent.includes(model.name)); // Simulate clicking 'OK'. @@ -318,7 +319,7 @@ test('DeleteError', function() { browserProxy.forceCertificatesError(); - var whenErrorEventFired = + const whenErrorEventFired = test_util.eventToPromise('certificates-error', dialog); // Simulate clicking 'OK'. @@ -333,15 +334,15 @@ suite('CertificatePasswordEncryptionDialogTests', function() { /** @type {?CertificatePasswordEncryptionDialogElement} */ - var dialog = null; + let dialog = null; /** @type {?TestCertificatesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** @type {!CertificateSubnode} */ - var model = createSampleCertificateSubnode(); + const model = createSampleCertificateSubnode(); - var methodName = 'exportPersonalCertificatePasswordSelected'; + const methodName = 'exportPersonalCertificatePasswordSelected'; setup(function() { settings.navigateTo(settings.routes.CERTIFICATES); @@ -358,10 +359,10 @@ }); test('EncryptSuccess', function() { - var passwordInputElements = + const passwordInputElements = Polymer.dom(dialog.$.dialog).querySelectorAll('paper-input'); - var passwordInputElement = passwordInputElements[0]; - var confirmPasswordInputElement = passwordInputElements[1]; + const passwordInputElement = passwordInputElements[0]; + const confirmPasswordInputElement = passwordInputElements[1]; assertTrue(dialog.$.dialog.open); assertTrue(dialog.$.ok.disabled); @@ -393,15 +394,15 @@ test('EncryptError', function() { browserProxy.forceCertificatesError(); - var passwordInputElements = + const passwordInputElements = Polymer.dom(dialog.$.dialog).querySelectorAll('paper-input'); - var passwordInputElement = passwordInputElements[0]; + const passwordInputElement = passwordInputElements[0]; passwordInputElement.value = 'foopassword'; - var confirmPasswordInputElement = passwordInputElements[1]; + const confirmPasswordInputElement = passwordInputElements[1]; confirmPasswordInputElement.value = passwordInputElement.value; triggerInputEvent(passwordInputElement); - var whenErrorEventFired = + const whenErrorEventFired = test_util.eventToPromise('certificates-error', dialog); MockInteractions.tap(dialog.$.ok); @@ -413,12 +414,12 @@ suite('CertificatePasswordDecryptionDialogTests', function() { /** @type {?CertificatePasswordDecryptionDialogElement} */ - var dialog = null; + let dialog = null; /** @type {?TestCertificatesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; - var methodName = 'importPersonalCertificatePasswordSelected'; + const methodName = 'importPersonalCertificatePasswordSelected'; setup(function() { settings.navigateTo(settings.routes.CERTIFICATES); @@ -434,7 +435,7 @@ }); test('DecryptSuccess', function() { - var passwordInputElement = + const passwordInputElement = Polymer.dom(dialog.$.dialog).querySelector('paper-input'); assertTrue(dialog.$.dialog.open); @@ -459,12 +460,12 @@ test('DecryptError', function() { browserProxy.forceCertificatesError(); // Simulate entering some password. - var passwordInputElement = + const passwordInputElement = Polymer.dom(dialog.$.dialog).querySelector('paper-input'); passwordInputElement.value = 'foopassword'; triggerInputEvent(passwordInputElement); - var whenErrorEventFired = + const whenErrorEventFired = test_util.eventToPromise('certificates-error', dialog); MockInteractions.tap(dialog.$.ok); return browserProxy.whenCalled(methodName).then(function() { @@ -474,15 +475,15 @@ }); suite('CertificateSubentryTests', function() { - var subentry = null; + let subentry = null; /** @type {?TestCertificatesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** * @return {!Promise} A promise firing once |CertificateActionEvent| fires. */ - var actionEventToPromise = function() { + const actionEventToPromise = function() { return test_util.eventToPromise(CertificateActionEvent, subentry); }; @@ -507,7 +508,7 @@ // Test case where 'View' option is tapped. test('MenuOptions_View', function() { - var viewButton = subentry.shadowRoot.querySelector('#view'); + const viewButton = subentry.shadowRoot.querySelector('#view'); MockInteractions.tap(viewButton); return browserProxy.whenCalled('viewCertificate').then(function(id) { assertEquals(subentry.model.id, id); @@ -517,7 +518,7 @@ // Test that the 'Edit' option is only shown when appropriate and that // once tapped the correct event is fired. test('MenuOptions_Edit', function() { - var editButton = subentry.shadowRoot.querySelector('#edit'); + const editButton = subentry.shadowRoot.querySelector('#edit'); assertTrue(!!editButton); // Should be disabled for any certificate type other than // CertificateType.CA @@ -526,16 +527,16 @@ assertFalse(editButton.hidden); // Should be disabled if |policy| is true. - var model = createSampleCertificateSubnode(); + const model = createSampleCertificateSubnode(); model.policy = true; subentry.model = model; assertTrue(editButton.hidden); subentry.model = createSampleCertificateSubnode(); - var waitForActionEvent = actionEventToPromise(); + const waitForActionEvent = actionEventToPromise(); MockInteractions.tap(editButton); return waitForActionEvent.then(function(event) { - var detail = + const detail = /** @type {!CertificateActionEventDetail} */ (event.detail); assertEquals(CertificateAction.EDIT, detail.action); assertEquals(subentry.model.id, detail.subnode.id); @@ -546,26 +547,26 @@ // Test that the 'Delete' option is only shown when appropriate and that // once tapped the correct event is fired. test('MenuOptions_Delete', function() { - var deleteButton = subentry.shadowRoot.querySelector('#delete'); + const deleteButton = subentry.shadowRoot.querySelector('#delete'); assertTrue(!!deleteButton); // Should be disabled when 'model.readonly' is true. - var model = createSampleCertificateSubnode(); + let model = createSampleCertificateSubnode(); model.readonly = true; subentry.model = model; assertTrue(deleteButton.hidden); // Should be disabled when 'model.policy' is true. - var model = createSampleCertificateSubnode(); + model = createSampleCertificateSubnode(); model.policy = true; subentry.model = model; assertTrue(deleteButton.hidden); subentry.model = createSampleCertificateSubnode(); - var waitForActionEvent = actionEventToPromise(); + const waitForActionEvent = actionEventToPromise(); MockInteractions.tap(deleteButton); return waitForActionEvent.then(function(event) { - var detail = + const detail = /** @type {!CertificateActionEventDetail} */ (event.detail); assertEquals(CertificateAction.DELETE, detail.action); assertEquals(subentry.model.id, detail.subnode.id); @@ -576,7 +577,7 @@ // is not PERSONAL and that once tapped the correct event is fired. test('MenuOptions_Export', function() { subentry.certificateType = CertificateType.SERVER; - var exportButton = subentry.shadowRoot.querySelector('#export'); + const exportButton = subentry.shadowRoot.querySelector('#export'); assertTrue(!!exportButton); assertFalse(exportButton.hidden); MockInteractions.tap(exportButton); @@ -587,18 +588,18 @@ // Test case of exporting a PERSONAL certificate. test('MenuOptions_ExportPersonal', function() { - var exportButton = subentry.shadowRoot.querySelector('#export'); + const exportButton = subentry.shadowRoot.querySelector('#export'); assertTrue(!!exportButton); // Should be disabled when 'model.extractable' is false. assertTrue(exportButton.hidden); - var model = createSampleCertificateSubnode(); + const model = createSampleCertificateSubnode(); model.extractable = true; subentry.model = model; assertFalse(exportButton.hidden); - var waitForActionEvent = actionEventToPromise(); + const waitForActionEvent = actionEventToPromise(); MockInteractions.tap(exportButton); return browserProxy.whenCalled('exportPersonalCertificate') .then(function(id) { @@ -609,7 +610,7 @@ return waitForActionEvent; }) .then(function(event) { - var detail = + const detail = /** @type {!CertificateActionEventDetail} */ (event.detail); assertEquals(CertificateAction.EXPORT_PERSONAL, detail.action); assertEquals(subentry.model.id, detail.subnode.id); @@ -619,13 +620,13 @@ suite('CertificateManagerTests', function() { /** @type {?CertificateManagerElement} */ - var page = null; + let page = null; /** @type {?TestCertificatesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** @enum {number} */ - var CertificateCategoryIndex = { + const CertificateCategoryIndex = { PERSONAL: 0, SERVER: 1, CA: 2, @@ -651,7 +652,7 @@ */ test('Initialization', function() { // Trigger all category tabs to be added to the DOM. - var paperTabsElement = page.shadowRoot.querySelector('paper-tabs'); + const paperTabsElement = page.shadowRoot.querySelector('paper-tabs'); paperTabsElement.selected = CertificateCategoryIndex.PERSONAL; Polymer.dom.flush(); paperTabsElement.selected = CertificateCategoryIndex.SERVER; @@ -660,12 +661,12 @@ Polymer.dom.flush(); paperTabsElement.selected = CertificateCategoryIndex.OTHER; Polymer.dom.flush(); - var certificateLists = + const certificateLists = page.shadowRoot.querySelectorAll('certificate-list'); assertEquals(4, certificateLists.length); - var assertCertificateListLength = function(listIndex, expectedSize) { - var certificateEntries = + const assertCertificateListLength = function(listIndex, expectedSize) { + const certificateEntries = certificateLists[listIndex].shadowRoot.querySelectorAll( 'certificate-entry'); assertEquals(expectedSize, certificateEntries.length); @@ -704,7 +705,7 @@ assertFalse(!!page.shadowRoot.querySelector(dialogTagName)); page.fire(CertificateActionEvent, eventDetail); Polymer.dom.flush(); - var dialog = page.shadowRoot.querySelector(dialogTagName); + const dialog = page.shadowRoot.querySelector(dialogTagName); assertTrue(!!dialog); // Some dialogs are opened after some async operation to fetch initial @@ -766,10 +767,10 @@ suite('CertificateListTests', function() { /** @type {?CertificateListElement} */ - var element = null; + let element = null; /** @type {?TestCertificatesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; setup(function() { settings.navigateTo(settings.routes.CERTIFICATES); @@ -799,11 +800,11 @@ element.certificateType = certificateType; Polymer.dom.flush(); - var importButton = + const importButton = bindBtn ? element.$$('#importAndBind') : element.$$('#import'); assertTrue(!!importButton); - var waitForActionEvent = actionEventExpected ? + const waitForActionEvent = actionEventExpected ? test_util.eventToPromise(CertificateActionEvent, element) : Promise.resolve(null);
diff --git a/chrome/test/data/webui/settings/checkbox_tests.js b/chrome/test/data/webui/settings/checkbox_tests.js index 8b1c6f2..5b77a3e 100644 --- a/chrome/test/data/webui/settings/checkbox_tests.js +++ b/chrome/test/data/webui/settings/checkbox_tests.js
@@ -9,13 +9,13 @@ * Checkbox created before each test. * @type {SettingsCheckbox} */ - var testElement; + let testElement; /** * Pref value used in tests, should reflect checkbox 'checked' attribute. * @type {SettingsCheckbox} */ - var pref = { + const pref = { key: 'test', type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true @@ -61,7 +61,7 @@ }); test('numerical pref', function() { - var prefNum = { + const prefNum = { key: 'test', type: chrome.settingsPrivate.PrefType.NUMBER, value: 1
diff --git a/chrome/test/data/webui/settings/chrome_cleanup_page_test.js b/chrome/test/data/webui/settings/chrome_cleanup_page_test.js index ca18619..d0e2d40 100644 --- a/chrome/test/data/webui/settings/chrome_cleanup_page_test.js +++ b/chrome/test/data/webui/settings/chrome_cleanup_page_test.js
@@ -72,20 +72,20 @@ } } -var chromeCleanupPage = null; +let chromeCleanupPage = null; /** @type {?TestDownloadsBrowserProxy} */ -var chromeCleanupProxy = null; +let chromeCleanupProxy = null; -var shortFileList = ['file 1', 'file 2', 'file 3']; -var exactSizeFileList = ['file 1', 'file 2', 'file 3', 'file 4']; -var longFileList = ['file 1', 'file 2', 'file 3', 'file 4', 'file 5']; -var shortRegistryKeysList = ['key 1', 'key 2']; -var exactSizeRegistryKeysList = ['key 1', 'key 2', 'key 3', 'key 4']; -var longRegistryKeysList = +const shortFileList = ['file 1', 'file 2', 'file 3']; +const exactSizeFileList = ['file 1', 'file 2', 'file 3', 'file 4']; +const longFileList = ['file 1', 'file 2', 'file 3', 'file 4', 'file 5']; +const shortRegistryKeysList = ['key 1', 'key 2']; +const exactSizeRegistryKeysList = ['key 1', 'key 2', 'key 3', 'key 4']; +const longRegistryKeysList = ['key 1', 'key 2', 'key 3', 'key 4', 'key 5', 'key 6']; -var defaultScannerResults = { +const defaultScannerResults = { 'files': shortFileList, 'registryKeys': shortRegistryKeysList, }; @@ -115,8 +115,8 @@ */ function validateVisibleItemsList( originalItems, visibleItems, listCanBeShortened) { - var visibleItemsList = visibleItems.querySelectorAll('.visible-item'); - var moreItemsLInk = visibleItems.querySelector('#more-items-link'); + let visibleItemsList = visibleItems.querySelectorAll('.visible-item'); + const moreItemsLInk = visibleItems.querySelector('#more-items-link'); if (!listCanBeShortened || originalItems.length <= settings.CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW) { @@ -146,28 +146,28 @@ */ function startCleanupFromInfected( userInitiatedCleanupsEnabled, files, registryKeys) { - var scannerResults = {'files': files, 'registryKeys': registryKeys}; + const scannerResults = {'files': files, 'registryKeys': registryKeys}; cr.webUIListenerCallback('chrome-cleanup-upload-permission-change', false); cr.webUIListenerCallback('chrome-cleanup-on-infected', scannerResults); Polymer.dom.flush(); - var showItemsButton = chromeCleanupPage.$$('#show-items-button'); + const showItemsButton = chromeCleanupPage.$$('#show-items-button'); assertTrue(!!showItemsButton); MockInteractions.tap(showItemsButton); - var filesToRemoveList = + const filesToRemoveList = chromeCleanupPage.$$('#files-to-remove-list').$$('#list'); assertTrue(!!filesToRemoveList); validateVisibleItemsList( files, filesToRemoveList, userInitiatedCleanupsEnabled /* listCanBeShortened */); - var registryKeysListContainer = chromeCleanupPage.$$('#registry-keys-list'); + const registryKeysListContainer = chromeCleanupPage.$$('#registry-keys-list'); assertTrue(!!registryKeysListContainer); if (userInitiatedCleanupsEnabled && registryKeys.length > 0) { assertFalse(registryKeysListContainer.hidden); - var registryKeysList = registryKeysListContainer.$$('#list'); + const registryKeysList = registryKeysListContainer.$$('#list'); assertTrue(!!registryKeysList); validateVisibleItemsList( registryKeys, registryKeysList, @@ -176,7 +176,7 @@ assertTrue(registryKeysListContainer.hidden); } - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertTrue(!!actionButton); MockInteractions.tap(actionButton); return chromeCleanupProxy.whenCalled('startCleanup') @@ -186,7 +186,7 @@ 'chrome-cleanup-on-cleaning', defaultScannerResults); Polymer.dom.flush(); - var spinner = chromeCleanupPage.$$('#waiting-spinner'); + const spinner = chromeCleanupPage.$$('#waiting-spinner'); assertTrue(spinner.active); }); } @@ -195,7 +195,7 @@ cr.webUIListenerCallback('chrome-cleanup-on-reboot-required'); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertTrue(!!actionButton); MockInteractions.tap(actionButton); return chromeCleanupProxy.whenCalled('restartComputer'); @@ -213,7 +213,7 @@ settings.ChromeCleanupIdleReason.CLEANING_FAILED); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); if (userInitiatedCleanupsEnabled) { assertFalse(!!actionButton); } else { @@ -234,7 +234,7 @@ settings.ChromeCleanupIdleReason.CLEANING_SUCCEEDED); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); if (userInitiatedCleanupsEnabled) { assertFalse(!!actionButton); } else { @@ -258,7 +258,7 @@ } Polymer.dom.flush(); - var logsControl = chromeCleanupPage.$$('#chromeCleanupLogsUploadControl'); + const logsControl = chromeCleanupPage.$$('#chromeCleanupLogsUploadControl'); assertTrue(!!logsControl); cr.webUIListenerCallback('chrome-cleanup-upload-permission-change', true); @@ -378,7 +378,7 @@ cr.webUIListenerCallback('chrome-cleanup-on-idle', idleReason); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertTrue(!!actionButton); } @@ -434,7 +434,7 @@ settings.ChromeCleanupIdleReason.CLEANER_DOWNLOAD_FAILED); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertTrue(!!actionButton); MockInteractions.tap(actionButton); return chromeCleanupProxy.whenCalled('startScanning'); @@ -447,7 +447,7 @@ settings.ChromeCleanupIdleReason.REPORTER_FOUND_NOTHING); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertFalse(!!actionButton); }); @@ -458,7 +458,7 @@ settings.ChromeCleanupIdleReason.REPORTER_FOUND_NOTHING); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertFalse(!!actionButton); }); @@ -468,7 +468,7 @@ 'chrome-cleanup-on-idle', settings.ChromeCleanupIdleReason.INITIAL); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertTrue(!!actionButton); MockInteractions.tap(actionButton); return chromeCleanupProxy.whenCalled('startScanning') @@ -477,7 +477,7 @@ cr.webUIListenerCallback('chrome-cleanup-on-scanning', false); Polymer.dom.flush(); - var spinner = chromeCleanupPage.$$('#waiting-spinner'); + const spinner = chromeCleanupPage.$$('#waiting-spinner'); assertTrue(spinner.active); }); }); @@ -489,7 +489,7 @@ settings.ChromeCleanupIdleReason.SCANNING_FOUND_NOTHING); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertFalse(!!actionButton); }); @@ -500,7 +500,7 @@ settings.ChromeCleanupIdleReason.SCANNING_FAILED); Polymer.dom.flush(); - var actionButton = chromeCleanupPage.$$('#action-button'); + const actionButton = chromeCleanupPage.$$('#action-button'); assertFalse(!!actionButton); });
diff --git a/chrome/test/data/webui/settings/controlled_button_tests.js b/chrome/test/data/webui/settings/controlled_button_tests.js index 100bc4c9..487f28c5 100644 --- a/chrome/test/data/webui/settings/controlled_button_tests.js +++ b/chrome/test/data/webui/settings/controlled_button_tests.js
@@ -4,23 +4,23 @@ suite('controlled button', function() { /** @type {ControlledButtonElement} */ - var controlledButton; + let controlledButton; /** @type {!chrome.settingsPrivate.PrefObject} */ - var uncontrolledPref = { + const uncontrolledPref = { key: 'test', type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true }; /** @type {!chrome.settingsPrivate.PrefObject} */ - var extensionControlledPref = Object.assign({ + const extensionControlledPref = Object.assign({ controlledBy: chrome.settingsPrivate.ControlledBy.EXTENSION, enforcement: chrome.settingsPrivate.Enforcement.ENFORCED, }, uncontrolledPref); /** @type {!chrome.settingsPrivate.PrefObject} */ - var policyControlledPref = Object.assign({ + const policyControlledPref = Object.assign({ controlledBy: chrome.settingsPrivate.ControlledBy.USER_POLICY, enforcement: chrome.settingsPrivate.Enforcement.ENFORCED, }, uncontrolledPref); @@ -45,7 +45,7 @@ controlledButton.pref = policyControlledPref; Polymer.dom.flush(); assertTrue(controlledButton.$$('paper-button').disabled); - var indicator = controlledButton.$$('cr-policy-pref-indicator'); + const indicator = controlledButton.$$('cr-policy-pref-indicator'); assertTrue(!!indicator); assertGT(indicator.clientHeight, 0);
diff --git a/chrome/test/data/webui/settings/controlled_radio_button_tests.js b/chrome/test/data/webui/settings/controlled_radio_button_tests.js index 12290a7..6b233be 100644 --- a/chrome/test/data/webui/settings/controlled_radio_button_tests.js +++ b/chrome/test/data/webui/settings/controlled_radio_button_tests.js
@@ -4,10 +4,10 @@ suite('controlled radio button', function() { /** @type {ControlledRadioButtonElement} */ - var radioButton; + let radioButton; /** @type {!chrome.settingsPrivate.PrefObject} */ - var pref = { + const pref = { key: 'test', type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true
diff --git a/chrome/test/data/webui/settings/cr_settings_browsertest.js b/chrome/test/data/webui/settings/cr_settings_browsertest.js index aaae02f..f5e57da3 100644 --- a/chrome/test/data/webui/settings/cr_settings_browsertest.js +++ b/chrome/test/data/webui/settings/cr_settings_browsertest.js
@@ -5,7 +5,7 @@ /** @fileoverview Runs the Polymer Settings tests. */ /** @const {string} Path to source root. */ -var ROOT_PATH = '../../../../../'; +const ROOT_PATH = '../../../../../'; // Polymer BrowserTest fixture. GEN_INCLUDE( @@ -1426,7 +1426,7 @@ assertEquals('a/b', settings.getQueryParameters().get('guid')); assertEquals('42', settings.getQueryParameters().get('foo')); - var params = new URLSearchParams(); + const params = new URLSearchParams(); params.set('bar', 'b=z'); params.set('biz', '3'); settings.navigateTo(settings.routes.SEARCH_ENGINES, params);
diff --git a/chrome/test/data/webui/settings/cr_settings_interactive_ui_tests.js b/chrome/test/data/webui/settings/cr_settings_interactive_ui_tests.js index 733f9ad..b69b42d 100644 --- a/chrome/test/data/webui/settings/cr_settings_interactive_ui_tests.js +++ b/chrome/test/data/webui/settings/cr_settings_interactive_ui_tests.js
@@ -5,7 +5,7 @@ /** @fileoverview Runs the Polymer Settings interactive UI tests. */ /** @const {string} Path to source root. */ -var ROOT_PATH = '../../../../../'; +const ROOT_PATH = '../../../../../'; // Polymer BrowserTest fixture. GEN_INCLUDE(
diff --git a/chrome/test/data/webui/settings/cups_printer_page_tests.js b/chrome/test/data/webui/settings/cups_printer_page_tests.js index 87667a8..cc4c7b9a 100644 --- a/chrome/test/data/webui/settings/cups_printer_page_tests.js +++ b/chrome/test/data/webui/settings/cups_printer_page_tests.js
@@ -69,8 +69,8 @@ suite('CupsAddPrinterDialogTests', function() { function fillAddManuallyDialog(addDialog) { - var name = addDialog.$$('#printerNameInput'); - var address = addDialog.$$('#printerAddressInput'); + const name = addDialog.$$('#printerNameInput'); + const address = addDialog.$$('#printerAddressInput'); assertTrue(!!name); name.value = 'Test printer'; @@ -78,30 +78,30 @@ assertTrue(!!address); address.value = '127.0.0.1'; - var addButton = addDialog.$$('#addPrinterButton'); + const addButton = addDialog.$$('#addPrinterButton'); assertTrue(!!addButton); assertFalse(addButton.disabled); } function clickAddButton(dialog) { assertTrue(!!dialog, 'Dialog is null for add'); - var addButton = dialog.$$('.action-button'); + const addButton = dialog.$$('.action-button'); assertTrue(!!addButton, 'Button is null'); MockInteractions.tap(addButton); } function clickCancelButton(dialog) { assertTrue(!!dialog, 'Dialog is null for cancel'); - var cancelButton = dialog.$$('.cancel-button'); + const cancelButton = dialog.$$('.cancel-button'); assertTrue(!!cancelButton, 'Button is null'); MockInteractions.tap(cancelButton); } - var page = null; - var dialog = null; + let page = null; + let dialog = null; /** @type {?settings.TestCupsPrintersBrowserProxy} */ - var cupsPrintersBrowserProxy = null; + let cupsPrintersBrowserProxy = null; setup(function() { cupsPrintersBrowserProxy = new TestCupsPrintersBrowserProxy(); @@ -146,17 +146,17 @@ }); test('ValidIPV4', function() { - var dialog = document.createElement('add-printer-manually-dialog'); + const dialog = document.createElement('add-printer-manually-dialog'); expectTrue(dialog.canAddPrinter_('Test printer', '127.0.0.1')); }); test('ValidIPV4WithPort', function() { - var dialog = document.createElement('add-printer-manually-dialog'); + const dialog = document.createElement('add-printer-manually-dialog'); expectTrue(dialog.canAddPrinter_('Test printer', '127.0.1.183:1234')); }); test('ValidIPV6', function() { - var dialog = document.createElement('add-printer-manually-dialog'); + const dialog = document.createElement('add-printer-manually-dialog'); // Test the full ipv6 address scheme. expectTrue(dialog.canAddPrinter_('Test printer', '1:2:a3:ff4:5:6:7:8')); @@ -169,7 +169,7 @@ }); test('ValidIPV6WithPort', function() { - var dialog = document.createElement('add-printer-manually-dialog'); + const dialog = document.createElement('add-printer-manually-dialog'); expectTrue(dialog.canAddPrinter_('Test printer', '[1:2:aa2:4]:12')); expectTrue(dialog.canAddPrinter_('Test printer', '[::255]:54')); @@ -177,7 +177,7 @@ }); test('InvalidIPV6', function() { - var dialog = document.createElement('add-printer-manually-dialog'); + const dialog = document.createElement('add-printer-manually-dialog'); expectFalse(dialog.canAddPrinter_('Test printer', '1:2:3:4:5:6:7:8:9')); expectFalse(dialog.canAddPrinter_('Test printer', '1:2:3:aa:a1245:2')); @@ -187,14 +187,14 @@ }); test('ValidHostname', function() { - var dialog = document.createElement('add-printer-manually-dialog'); + const dialog = document.createElement('add-printer-manually-dialog'); expectTrue(dialog.canAddPrinter_('Test printer', 'hello-world.com')); expectTrue(dialog.canAddPrinter_('Test printer', 'hello.world.com:12345')); }); test('InvalidHostname', function() { - var dialog = document.createElement('add-printer-manually-dialog'); + const dialog = document.createElement('add-printer-manually-dialog'); expectFalse(dialog.canAddPrinter_('Test printer', 'helloworld!123.com')); expectFalse(dialog.canAddPrinter_('Test printer', 'helloworld123-.com')); @@ -206,13 +206,13 @@ */ test('ValidAddOpensModelSelection', function() { // Starts in discovery dialog, select add manually button. - var discoveryDialog = dialog.$$('add-printer-discovery-dialog'); + const discoveryDialog = dialog.$$('add-printer-discovery-dialog'); assertTrue(!!discoveryDialog); MockInteractions.tap(discoveryDialog.$$('.secondary-button')); Polymer.dom.flush(); // Now we should be in the manually add dialog. - var addDialog = dialog.$$('add-printer-manually-dialog'); + const addDialog = dialog.$$('add-printer-manually-dialog'); assertTrue(!!addDialog); fillAddManuallyDialog(addDialog); @@ -243,12 +243,12 @@ * Test that getModels isn't called with a blank query. */ test('NoBlankQueries', function() { - var discoveryDialog = dialog.$$('add-printer-discovery-dialog'); + const discoveryDialog = dialog.$$('add-printer-discovery-dialog'); assertTrue(!!discoveryDialog); MockInteractions.tap(discoveryDialog.$$('.secondary-button')); Polymer.dom.flush(); - var addDialog = dialog.$$('add-printer-manually-dialog'); + const addDialog = dialog.$$('add-printer-manually-dialog'); assertTrue(!!addDialog); fillAddManuallyDialog(addDialog); @@ -279,7 +279,7 @@ * IPP printers. */ test('LogDialogCancelledIpp', function() { - var makeAndModel = 'Printer Make And Model'; + const makeAndModel = 'Printer Make And Model'; // Start on add manually. dialog.fire('open-manually-add-printer-dialog'); Polymer.dom.flush(); @@ -312,7 +312,7 @@ }; // Press the add button to advance dialog. - var addDialog = dialog.$$('add-printer-manually-dialog'); + const addDialog = dialog.$$('add-printer-manually-dialog'); assertTrue(!!addDialog); clickAddButton(addDialog); @@ -337,21 +337,21 @@ * USB printers. */ test('LogDialogCancelledUSB', function() { - var vendorId = 0x1234; - var modelId = 0xDEAD; - var manufacturer = 'PrinterMFG'; - var model = 'Printy Printerson'; + const vendorId = 0x1234; + const modelId = 0xDEAD; + const manufacturer = 'PrinterMFG'; + const model = 'Printy Printerson'; - var usbInfo = { + const usbInfo = { usbVendorId: vendorId, usbProductId: modelId, usbVendorName: manufacturer, usbProductName: model, }; - var expectedPrinter = 'PICK_ME!'; + const expectedPrinter = 'PICK_ME!'; - var newPrinter = { + const newPrinter = { ppdManufacturer: '', ppdModel: '', printerAddress: 'EEAADDAA',
diff --git a/chrome/test/data/webui/settings/date_time_page_tests.js b/chrome/test/data/webui/settings/date_time_page_tests.js index 76329f3a..7b5acb9 100644 --- a/chrome/test/data/webui/settings/date_time_page_tests.js +++ b/chrome/test/data/webui/settings/date_time_page_tests.js
@@ -56,7 +56,7 @@ } function updatePrefsWithPolicy(prefs, managed, valueFromPolicy) { - var prefsCopy = JSON.parse(JSON.stringify(prefs)); + const prefsCopy = JSON.parse(JSON.stringify(prefs)); if (managed) { prefsCopy.settings.resolve_timezone_by_geolocation_method.controlledBy = chrome.settingsPrivate.ControlledBy.USER_POLICY; @@ -103,11 +103,11 @@ */ function initializeDateTime(prefs, hasPolicy, opt_autoDetectPolicyValue) { // Find the desired initial time zone by ID. - var timeZone = assert(fakeTimeZones.find(function(timeZonePair) { + const timeZone = assert(fakeTimeZones.find(function(timeZonePair) { return timeZonePair[0] == prefs.cros.system.timezone.value; })); - var data = { + const data = { timeZoneID: timeZone[0], timeZoneName: timeZone[1], controlledSettingPolicy: 'This setting is enforced by your administrator', @@ -133,7 +133,7 @@ window.loadTimeData = new LoadTimeData; loadTimeData.data = data; - var dateTime = document.createElement('settings-date-time-page'); + const dateTime = document.createElement('settings-date-time-page'); dateTime.prefs = updatePrefsWithPolicy(prefs, hasPolicy, opt_autoDetectPolicyValue); CrSettingsPrefs.setInitialized(); @@ -146,7 +146,7 @@ } // CrOS sends time zones as [id, friendly name] pairs. - var fakeTimeZones = [ + const fakeTimeZones = [ ['Westeros/Highgarden', '(KNG-2:00) The Reach Time (Highgarden)'], ['Westeros/Winterfell', '(KNG-1:00) The North Time (Winterfell)'], ['Westeros/Kings_Landing', @@ -159,11 +159,11 @@ ]; suite('settings-date-time-page', function() { - var dateTime; + let dateTime; // Track whether handler functions have been called. - var dateTimePageReadyCalled; - var getTimeZonesCalled; + let dateTimePageReadyCalled; + let getTimeZonesCalled; setup(function() { PolymerTest.clearBody(); @@ -192,7 +192,7 @@ }); function popuateSubpage() { - var timeZoneSettingsSubmenuButton = + const timeZoneSettingsSubmenuButton = dateTime.$$('#timeZoneSettingsTrigger'); MockInteractions.tap(timeZoneSettingsSubmenuButton); Polymer.dom.flush(); @@ -203,18 +203,18 @@ } function verifyAutoDetectSetting(autoDetect, managed) { - var selector = getTimeZoneSelector('#userTimeZoneSelector'); - var selectorHidden = selector ? selector.hidden : true; + const selector = getTimeZoneSelector('#userTimeZoneSelector'); + const selectorHidden = selector ? selector.hidden : true; assertEquals(managed || autoDetect, selectorHidden); - var checkButton = dateTime.$$('#timeZoneAutoDetect'); - var checkButtonChecked = checkButton ? checkButton.checked : false; + const checkButton = dateTime.$$('#timeZoneAutoDetect'); + const checkButtonChecked = checkButton ? checkButton.checked : false; if (!managed) assertEquals(autoDetect, checkButtonChecked); } function verifyPolicy(policy) { - var indicator = dateTime.$$('cr-policy-indicator'); + let indicator = dateTime.$$('cr-policy-indicator'); if (indicator && indicator.style.display == 'none') indicator = null; @@ -231,11 +231,11 @@ } function verifyTimeZonesPopulated(populated) { - var userTimezoneDropdown = getTimeZoneSelector('#userTimeZoneSelector'); - var systemTimezoneDropdown = + const userTimezoneDropdown = getTimeZoneSelector('#userTimeZoneSelector'); + const systemTimezoneDropdown = getTimeZoneSelector('#systemTimezoneSelector'); - var dropdown = + const dropdown = userTimezoneDropdown ? userTimezoneDropdown : systemTimezoneDropdown; if (populated) assertEquals(fakeTimeZones.length, dropdown.menuOptions.length); @@ -251,7 +251,7 @@ } test('auto-detect on', function(done) { - var prefs = getFakePrefs(); + const prefs = getFakePrefs(); dateTime = initializeDateTime(prefs, false); assertTrue(dateTimePageReadyCalled); @@ -302,7 +302,7 @@ }); test('auto-detect forced on', function(done) { - var prefs = getFakePrefs(); + const prefs = getFakePrefs(); dateTime = initializeDateTime(prefs, true, true); setTimeout(function() { dateTime.set( @@ -340,7 +340,7 @@ }); test('auto-detect forced off', function(done) { - var prefs = getFakePrefs(); + const prefs = getFakePrefs(); dateTime = initializeDateTime(prefs, true, false); setTimeout(function() { @@ -370,14 +370,14 @@ test('set date and time button', function() { dateTime = initializeDateTime(getFakePrefs(), false); - var showSetDateTimeUICalled = false; + let showSetDateTimeUICalled = false; registerMessageCallback('showSetDateTimeUI', null, function() { assertFalse(showSetDateTimeUICalled); showSetDateTimeUICalled = true; }); setTimeout(function() { - var setDateTimeButton = dateTime.$$('#setDateTime'); + const setDateTimeButton = dateTime.$$('#setDateTime'); assertEquals(0, setDateTimeButton.offsetHeight); // Make the date and time editable.
diff --git a/chrome/test/data/webui/settings/default_browser_browsertest.js b/chrome/test/data/webui/settings/default_browser_browsertest.js index a251ecee..c4e96b1 100644 --- a/chrome/test/data/webui/settings/default_browser_browsertest.js +++ b/chrome/test/data/webui/settings/default_browser_browsertest.js
@@ -47,10 +47,10 @@ } suite('DefaultBrowserPageTest', function() { - var page = null; + let page = null; /** @type {?settings.TestDefaultBrowserBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; setup(function() { browserProxy = new TestDefaultBrowserBrowserProxy();
diff --git a/chrome/test/data/webui/settings/device_page_tests.js b/chrome/test/data/webui/settings/device_page_tests.js index d3828c4b..c2aff05 100644 --- a/chrome/test/data/webui/settings/device_page_tests.js +++ b/chrome/test/data/webui/settings/device_page_tests.js
@@ -4,7 +4,7 @@ cr.define('device_page_tests', function() { /** @enum {string} */ - var TestNames = { + const TestNames = { DevicePage: 'device page', Display: 'display', Keyboard: 'keyboard', @@ -99,7 +99,7 @@ setPreferredNoteTakingApp: function(appId) { ++this.setPreferredAppCount_; - var changed = false; + let changed = false; this.noteTakingApps_.forEach(function(app) { changed = changed || app.preferred != (app.value == appId); app.preferred = app.value == appId; @@ -154,7 +154,7 @@ * @return {string} App id of the app currently selected as preferred. */ getPreferredNoteTakingAppId: function() { - var app = this.noteTakingApps_.find(function(existing) { + const app = this.noteTakingApps_.find(function(existing) { return existing.preferred; }); @@ -166,7 +166,7 @@ * support state of the app currently selected as preferred. */ getPreferredAppLockScreenState: function() { - var app = this.noteTakingApps_.find(function(existing) { + const app = this.noteTakingApps_.find(function(existing) { return existing.preferred; }); @@ -364,10 +364,10 @@ suite('SettingsDevicePage', function() { /** @type {!SettingsDevicePage|undefined} */ - var devicePage; + let devicePage; /** @type {!FakeSystemDisplay|undefined} */ - var fakeSystemDisplay; + let fakeSystemDisplay; suiteSetup(function() { // Disable animations so sub-pages open within one event loop. @@ -387,7 +387,7 @@ new TestDevicePageBrowserProxy(); // settings-animated-pages expects a parent with data-page set. - var basicPage = document.createElement('div'); + const basicPage = document.createElement('div'); basicPage.dataset.page = 'basic'; basicPage.appendChild(devicePage); document.body.appendChild(basicPage); @@ -399,13 +399,13 @@ /** @return {!Promise<!HTMLElement>} */ function showAndGetDeviceSubpage(subpage, expectedRoute) { return new Promise(function(resolve, reject) { - var row = assert(devicePage.$$('#main #' + subpage + 'Row')); + const row = assert(devicePage.$$('#main #' + subpage + 'Row')); devicePage.$$('#pages').addEventListener( 'neon-animation-finish', resolve); MockInteractions.tap(row); }).then(function() { assertEquals(expectedRoute, settings.getCurrentRoute()); - var page = devicePage.$$('settings-' + subpage); + const page = devicePage.$$('settings-' + subpage); return assert(page); }); } @@ -447,9 +447,9 @@ * @param {boolean} expected */ function expectNaturalScrollValue(pointersPage, expected) { - var naturalScrollOff = + const naturalScrollOff = pointersPage.$$('paper-radio-button[name="false"]'); - var naturalScrollOn = + const naturalScrollOn = pointersPage.$$('paper-radio-button[name="true"]'); assertTrue(!!naturalScrollOff); assertTrue(!!naturalScrollOn); @@ -474,7 +474,7 @@ }); suite(assert(TestNames.Pointers), function() { - var pointersPage; + let pointersPage; setup(function() { return showAndGetDeviceSubpage('pointers', settings.routes.POINTERS) @@ -534,7 +534,7 @@ expectFalse(pointersPage.$$('#mouse settings-toggle-button').checked); - var slider = assert(pointersPage.$$('#mouse settings-slider')); + const slider = assert(pointersPage.$$('#mouse settings-slider')); expectEquals(4, slider.pref.value); MockInteractions.pressAndReleaseKeyOn( slider.$$('#slider'), 37 /* left */); @@ -550,7 +550,7 @@ expectTrue(pointersPage.$$('#touchpad #enableTapToClick').checked); expectFalse(pointersPage.$$('#touchpad #enableTapDragging').checked); - var slider = assert(pointersPage.$$('#touchpad settings-slider')); + const slider = assert(pointersPage.$$('#touchpad settings-slider')); expectEquals(3, slider.pref.value); MockInteractions.pressAndReleaseKeyOn( slider.$$('#slider'), 39 /* right */); @@ -564,9 +564,9 @@ expectNaturalScrollValue(pointersPage, false); // Tapping the link shouldn't enable the radio button. - var naturalScrollOn = + const naturalScrollOn = pointersPage.$$('paper-radio-button[name="true"]'); - var a = naturalScrollOn.querySelector('a'); + const a = naturalScrollOn.querySelector('a'); MockInteractions.tap(a); expectNaturalScrollValue(pointersPage, false); @@ -603,8 +603,8 @@ expectFalse(!!keyboardPage.$$('#diamondKey')); // Pretend the diamond key is available. - var showCapsLock = false; - var showDiamondKey = true; + let showCapsLock = false; + const showDiamondKey = true; cr.webUIListenerCallback( 'show-keys-changed', showCapsLock, showDiamondKey); Polymer.dom.flush(); @@ -619,7 +619,7 @@ expectTrue(!!keyboardPage.$$('#capsLockKey')); expectTrue(!!keyboardPage.$$('#diamondKey')); - var collapse = keyboardPage.$$('iron-collapse'); + const collapse = keyboardPage.$$('iron-collapse'); assertTrue(!!collapse); expectTrue(collapse.opened); @@ -633,7 +633,7 @@ MockInteractions.pressAndReleaseKeyOn( keyboardPage.$$('#repeatRateSlider').$$('#slider'), 39 /* right */); - var language = devicePage.prefs.settings.language; + const language = devicePage.prefs.settings.language; expectEquals(1000, language.xkb_auto_repeat_delay_r2.value); expectEquals(300, language.xkb_auto_repeat_interval_r2.value); @@ -670,8 +670,8 @@ }); test(assert(TestNames.Display), function() { - var addDisplay = function(n) { - var display = { + const addDisplay = function(n) { + const display = { id: 'fakeDisplayId' + n, name: 'fakeDisplayName' + n, mirroring: '', @@ -688,7 +688,7 @@ fakeSystemDisplay.addDisplayForTest(display); }; - var displayPage; + let displayPage; return Promise .all([ // Get the display sub-page. @@ -745,9 +745,9 @@ // Select the second display and make it primary. Also change the // orientation of the second display. - var displayLayout = displayPage.$$('#displayLayout'); + const displayLayout = displayPage.$$('#displayLayout'); assertTrue(!!displayLayout); - var displayDiv = displayLayout.$$('#_fakeDisplayId2'); + const displayDiv = displayLayout.$$('#_fakeDisplayId2'); assertTrue(!!displayDiv); MockInteractions.tap(displayDiv); expectEquals( @@ -808,7 +808,7 @@ * @param {bool} isLowPowerCharger */ function setPowerSources(sources, powerSourceId, isLowPowerCharger) { - var sourcesCopy = sources.map(function(source) { + const sourcesCopy = sources.map(function(source) { return Object.assign({}, source); }); cr.webUIListenerCallback('power-sources-changed', @@ -832,12 +832,12 @@ }); suite('power settings', function() { - var powerPage; - var powerSourceRow; - var powerSourceWrapper; - var powerSourceSelect; - var idleSelect; - var lidClosedToggle; + let powerPage; + let powerSourceRow; + let powerSourceWrapper; + let powerSourceSelect; + let idleSelect; + let lidClosedToggle; suiteSetup(function() { // Always show power settings. @@ -875,7 +875,7 @@ }); test('no battery', function() { - var batteryStatus = { + const batteryStatus = { present: false, charging: false, calculating: false, @@ -891,7 +891,7 @@ }); test('power sources', function() { - var batteryStatus = { + const batteryStatus = { present: true, charging: false, calculating: false, @@ -908,7 +908,7 @@ assertTrue(powerSourceWrapper.hidden); // Attach a dual-role USB device. - var powerSource = { + const powerSource = { id: '2', type: settings.PowerDeviceType.DUAL_ROLE_USB, description: 'USB-C device', @@ -927,7 +927,7 @@ assertEquals(powerSource.id, powerSourceSelect.value); // Send another power source; the first should still be selected. - var otherPowerSource = Object.assign({}, powerSource); + const otherPowerSource = Object.assign({}, powerSource); otherPowerSource.id = '3'; setPowerSources( [otherPowerSource, powerSource], powerSource.id, true); @@ -937,7 +937,7 @@ }); test('choose power source', function() { - var batteryStatus = { + const batteryStatus = { present: true, charging: false, calculating: false, @@ -948,7 +948,7 @@ 'battery-status-changed', Object.assign({}, batteryStatus)); // Attach a dual-role USB device. - var powerSource = { + const powerSource = { id: '3', type: settings.PowerDeviceType.DUAL_ROLE_USB, description: 'USB-C device', @@ -976,7 +976,7 @@ }); test('set lid behavior', function() { - var sendLid = function(lidBehavior) { + const sendLid = function(lidBehavior) { sendPowerManagementSettings( settings.IdleBehavior.DISPLAY_OFF, false /* idleControlled */, lidBehavior, @@ -1093,15 +1093,15 @@ }); suite(assert(TestNames.Stylus), function() { - var stylusPage; - var appSelector; - var browserProxy; - var noAppsDiv; - var waitingDiv; - var selectAppDiv; + let stylusPage; + let appSelector; + let browserProxy; + let noAppsDiv; + let waitingDiv; + let selectAppDiv; // Shorthand for settings.NoteAppLockScreenSupport. - var LockScreenSupport; + let LockScreenSupport; suiteSetup(function() { // Always show stylus settings.
diff --git a/chrome/test/data/webui/settings/downloads_page_test.js b/chrome/test/data/webui/settings/downloads_page_test.js index 586976fd..1462407 100644 --- a/chrome/test/data/webui/settings/downloads_page_test.js +++ b/chrome/test/data/webui/settings/downloads_page_test.js
@@ -28,10 +28,10 @@ } } -var downloadsPage = null; +let downloadsPage = null; /** @type {?TestDownloadsBrowserProxy} */ -var DownloadsBrowserProxy = null; +let DownloadsBrowserProxy = null; suite('DownloadsHandler', function() { setup(function() { @@ -52,7 +52,7 @@ }); test('select downloads location', function() { - var button = downloadsPage.$$('#changeDownloadsPath'); + const button = downloadsPage.$$('#changeDownloadsPath'); assertTrue(!!button); MockInteractions.tap(button); button.fire('transitionend'); @@ -60,12 +60,12 @@ }); test('openAdvancedDownloadsettings', function() { - var button = downloadsPage.$$('#resetAutoOpenFileTypes'); + let button = downloadsPage.$$('#resetAutoOpenFileTypes'); assertTrue(!button); cr.webUIListenerCallback('auto-open-downloads-changed', true); Polymer.dom.flush(); - var button = downloadsPage.$$('#resetAutoOpenFileTypes'); + button = downloadsPage.$$('#resetAutoOpenFileTypes'); assertTrue(!!button); MockInteractions.tap(button); @@ -73,7 +73,7 @@ .then(function() { cr.webUIListenerCallback('auto-open-downloads-changed', false); Polymer.dom.flush(); - var button = downloadsPage.$$('#resetAutoOpenFileTypes'); + const button = downloadsPage.$$('#resetAutoOpenFileTypes'); assertTrue(!button); }); });
diff --git a/chrome/test/data/webui/settings/dropdown_menu_tests.js b/chrome/test/data/webui/settings/dropdown_menu_tests.js index 4e0eedb..b46ab5c 100644 --- a/chrome/test/data/webui/settings/dropdown_menu_tests.js +++ b/chrome/test/data/webui/settings/dropdown_menu_tests.js
@@ -6,19 +6,19 @@ cr.define('settings_dropdown_menu', function() { suite('SettingsDropdownMenu', function() { /** @type {SettingsDropdownMenu} */ - var dropdown; + let dropdown; /** * The <select> used internally by the dropdown menu. * @type {HTMLSelectElement} */ - var selectElement; + let selectElement; /** * The "Custom" option in the <select> menu. * @type {HTMLOptionElement} */ - var customOption; + let customOption; function waitUntilDropdownUpdated() { return new Promise(function(resolve) { dropdown.async(resolve); }); @@ -34,7 +34,7 @@ PolymerTest.clearBody(); dropdown = document.createElement('settings-dropdown-menu'); selectElement = assert(dropdown.$$('select')); - var options = selectElement.options; + const options = selectElement.options; customOption = assert(options[options.length - 1]); document.body.appendChild(dropdown); }); @@ -92,7 +92,7 @@ assertEquals('a', dropdown.pref.value); // Item remains selected after updating menu items. - var newMenuOptions = dropdown.menuOptions.slice().reverse(); + const newMenuOptions = dropdown.menuOptions.slice().reverse(); dropdown.menuOptions = newMenuOptions; return waitUntilDropdownUpdated(); }).then(function() {
diff --git a/chrome/test/data/webui/settings/easy_unlock_browsertest_chromeos.js b/chrome/test/data/webui/settings/easy_unlock_browsertest_chromeos.js index 6ff6b1e..41e294b 100644 --- a/chrome/test/data/webui/settings/easy_unlock_browsertest_chromeos.js +++ b/chrome/test/data/webui/settings/easy_unlock_browsertest_chromeos.js
@@ -86,10 +86,10 @@ } /** @type {?SettingsLockScreenElement} */ - var lockScreen = null; + let lockScreen = null; /** @type {?TestEasyUnlockBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; suite('SettingsEasyUnlock', function() { suiteSetup(function() { @@ -129,7 +129,7 @@ Polymer.dom.flush(); - var setupButton = lockScreen.$$('#easyUnlockSetup'); + const setupButton = lockScreen.$$('#easyUnlockSetup'); assertTrue(!!setupButton); expectFalse(setupButton.hidden); @@ -142,7 +142,7 @@ browserProxy.setEnabledStatus(true); document.body.appendChild(lockScreen); - var turnOffDialog = null; + let turnOffDialog = null; return browserProxy.whenCalled('getEnabledStatus') .then(function() { @@ -151,7 +151,7 @@ Polymer.dom.flush(); - var turnOffButton = lockScreen.$$('#easyUnlockTurnOff'); + const turnOffButton = lockScreen.$$('#easyUnlockTurnOff'); assertTrue(!!turnOffButton); expectFalse(turnOffButton.hidden); @@ -166,12 +166,13 @@ // Verify that elements on the turn off dialog are hidden or active // according to the easy unlock turn off status. - var turnOffDialogButtonContainer = + const turnOffDialogButtonContainer = turnOffDialog.$$('[slot=button-container]'); - var turnOffDialogButtonSpinner = + const turnOffDialogButtonSpinner = turnOffDialog.$$('paper-spinner-lite'); - var turnOffDialogConfirmButton = turnOffDialog.$$('#turnOff'); - var turnOffDialogCancelButton = turnOffDialog.$$('.cancel-button'); + const turnOffDialogConfirmButton = turnOffDialog.$$('#turnOff'); + const turnOffDialogCancelButton = + turnOffDialog.$$('.cancel-button'); assertTrue(!!turnOffDialogButtonContainer); assertTrue(!!turnOffDialogButtonSpinner); assertTrue(!!turnOffDialogConfirmButton);
diff --git a/chrome/test/data/webui/settings/edit_dictionary_a11y_test.js b/chrome/test/data/webui/settings/edit_dictionary_a11y_test.js index 94f049ab..757685b 100644 --- a/chrome/test/data/webui/settings/edit_dictionary_a11y_test.js +++ b/chrome/test/data/webui/settings/edit_dictionary_a11y_test.js
@@ -10,7 +10,7 @@ GEN('#if !defined(OS_MACOSX)'); /** @const {string} Path to root from chrome/test/data/webui/settings/. */ -var ROOT_PATH = '../../../../../'; +const ROOT_PATH = '../../../../../'; // SettingsAccessibilityTest fixture. GEN_INCLUDE([ @@ -36,14 +36,15 @@ Object.assign({}, SettingsAccessibilityTest.violationFilter, { // Excuse Polymer paper-input elements. 'aria-valid-attr-value': function(nodeResult) { - var describerId = nodeResult.element.getAttribute('aria-describedby'); + const describerId = + nodeResult.element.getAttribute('aria-describedby'); return describerId === '' && nodeResult.element.id === 'input'; }, 'button-name': function(nodeResult) { - var node = nodeResult.element; + const node = nodeResult.element; return node.classList.contains('icon-expand-more'); }, }) }); -GEN('#endif // !defined(OS_MACOSX)'); \ No newline at end of file +GEN('#endif // !defined(OS_MACOSX)');
diff --git a/chrome/test/data/webui/settings/edit_dictionary_page_test.js b/chrome/test/data/webui/settings/edit_dictionary_page_test.js index e9bcc8e..570caece 100644 --- a/chrome/test/data/webui/settings/edit_dictionary_page_test.js +++ b/chrome/test/data/webui/settings/edit_dictionary_page_test.js
@@ -4,7 +4,7 @@ suite('settings-edit-dictionary-page', function() { function getFakePrefs() { - var fakePrefs = [{ + const fakePrefs = [{ key: 'intl.app_locale', type: chrome.settingsPrivate.PrefType.STRING, value: 'en-US', @@ -43,11 +43,11 @@ } /** @type {?SettingsEditDictionaryPageElement} */ - var editDictPage; + let editDictPage; /** @type {?FakeLanguageSettingsPrivate} */ - var languageSettingsPrivate; + let languageSettingsPrivate; /** @type {?FakeSettingsPrivate} */ - var settingsPrefs; + let settingsPrefs; suiteSetup(function() { CrSettingsPrefs.deferInitialization = true; @@ -56,7 +56,7 @@ setup(function() { PolymerTest.clearBody(); settingsPrefs = document.createElement('settings-prefs'); - var settingsPrivate = new settings.FakeSettingsPrivate(getFakePrefs()); + const settingsPrivate = new settings.FakeSettingsPrivate(getFakePrefs()); settingsPrefs.initialize(settingsPrivate); languageSettingsPrivate = new settings.FakeLanguageSettingsPrivate(); @@ -75,7 +75,7 @@ test('add word validation', function() { // Check addWord enable/disable logic - var addWordButton = editDictPage.$.addWord; + const addWordButton = editDictPage.$.addWord; assertTrue(!!addWordButton); editDictPage.$.newWord.value = ''; assertTrue(addWordButton.disabled); @@ -97,7 +97,7 @@ }); test('spellcheck edit dictionary page list has words', function() { - var addWordButton = editDictPage.$$('#addWord'); + const addWordButton = editDictPage.$$('#addWord'); editDictPage.$.newWord.value = "valid word"; MockInteractions.tap(addWordButton); editDictPage.$.newWord.value = "valid word2";
diff --git a/chrome/test/data/webui/settings/extension_controlled_indicator_tests.js b/chrome/test/data/webui/settings/extension_controlled_indicator_tests.js index bf5972b..bf95fa8 100644 --- a/chrome/test/data/webui/settings/extension_controlled_indicator_tests.js +++ b/chrome/test/data/webui/settings/extension_controlled_indicator_tests.js
@@ -4,10 +4,10 @@ suite('extension controlled indicator', function() { /** @type {TestExtensionControlBrowserProxy} */ - var browserProxy; + let browserProxy; /** @type {ExtensionControlledIndicatorElement} */ - var indicator; + let indicator; setup(function() { PolymerTest.clearBody(); @@ -31,12 +31,12 @@ }); test('label text and href', function() { - var imgSrc = indicator.$$('img').src; + let imgSrc = indicator.$$('img').src; assertTrue(imgSrc.includes(indicator.extensionId)); - var label = indicator.$$('span'); + let label = indicator.$$('span'); assertTrue(!!label); - var labelLink = label.querySelector('a'); + let labelLink = label.querySelector('a'); assertTrue(!!labelLink); assertEquals(labelLink.textContent, indicator.extensionName); @@ -58,7 +58,7 @@ }); test('tapping disable button invokes browser proxy', function() { - var disableButton = indicator.$$('paper-button'); + const disableButton = indicator.$$('paper-button'); assertTrue(!!disableButton); MockInteractions.tap(disableButton); return browserProxy.whenCalled('disableExtension').then(
diff --git a/chrome/test/data/webui/settings/fake_bluetooth.js b/chrome/test/data/webui/settings/fake_bluetooth.js index 834b0cd..9558523d 100644 --- a/chrome/test/data/webui/settings/fake_bluetooth.js +++ b/chrome/test/data/webui/settings/fake_bluetooth.js
@@ -44,10 +44,10 @@ /** @param {!Array<!chrome.bluetooth.Device>} devices */ setDevicesForTest: function(devices) { - for (var d of this.devices) + for (const d of this.devices) this.onDeviceRemoved.callListeners(d); this.devices = devices.slice(); - for (var d of this.devices) + for (const d of this.devices) this.onDeviceAdded.callListeners(d); }, @@ -63,7 +63,7 @@ /** @param {!chrome.bluetooth.Device} device */ updateDeviceForTest: function(device, opt_callback) { - var index = this.devices.findIndex(function(d) { + const index = this.devices.findIndex(function(d) { return d.address == device.address; }); if (index == -1) {
diff --git a/chrome/test/data/webui/settings/fake_bluetooth_private.js b/chrome/test/data/webui/settings/fake_bluetooth_private.js index d3a3cec5..492b2e9 100644 --- a/chrome/test/data/webui/settings/fake_bluetooth_private.js +++ b/chrome/test/data/webui/settings/fake_bluetooth_private.js
@@ -47,7 +47,7 @@ /** @override */ connect: function(address, opt_callback) { - var device = + const device = this.bluetoothApi_.getDeviceForTest(address) || {address: address}; device.paired = true; device.connecting = true;
diff --git a/chrome/test/data/webui/settings/fake_language_settings_private.js b/chrome/test/data/webui/settings/fake_language_settings_private.js index 72ed7cb..dfa02c0 100644 --- a/chrome/test/data/webui/settings/fake_language_settings_private.js +++ b/chrome/test/data/webui/settings/fake_language_settings_private.js
@@ -148,8 +148,8 @@ * @param {string} languageCode */ enableLanguage(languageCode) { - var languageCodes = this.settingsPrefs_.prefs.intl.accept_languages.value; - var languages = languageCodes.split(','); + let languageCodes = this.settingsPrefs_.prefs.intl.accept_languages.value; + const languages = languageCodes.split(','); if (languages.indexOf(languageCode) != -1) return; languages.push(languageCode); @@ -167,9 +167,9 @@ * @param {string} languageCode */ disableLanguage(languageCode) { - var languageCodes = this.settingsPrefs_.prefs.intl.accept_languages.value; - var languages = languageCodes.split(','); - var index = languages.indexOf(languageCode); + let languageCodes = this.settingsPrefs_.prefs.intl.accept_languages.value; + const languages = languageCodes.split(','); + const index = languages.indexOf(languageCode); if (index == -1) return; languages.splice(index, 1); @@ -190,7 +190,7 @@ * @param {boolean} enable */ setEnableTranslationForLanguage(languageCode, enable) { - var index = + const index = this.settingsPrefs_.prefs.translate_blocked_languages.value.indexOf( languageCode); if (enable) { @@ -315,13 +315,13 @@ */ addInputMethod(inputMethodId) { assert(cr.isChromeOS); - var inputMethod = this.componentExtensionImes.find(function(ime) { + const inputMethod = this.componentExtensionImes.find(function(ime) { return ime.id == inputMethodId; }); assertTrue(!!inputMethod); inputMethod.enabled = true; - var prefPath = 'prefs.settings.language.preload_engines.value'; - var enabledInputMethods = this.settingsPrefs_.get(prefPath).split(','); + const prefPath = 'prefs.settings.language.preload_engines.value'; + const enabledInputMethods = this.settingsPrefs_.get(prefPath).split(','); enabledInputMethods.push(inputMethodId); this.settingsPrefs_.set(prefPath, enabledInputMethods.join(',')); } @@ -333,7 +333,7 @@ */ removeInputMethod(inputMethodId) { assert(cr.isChromeOS); - var inputMethod = this.componentExtensionImes.find(function(ime) { + const inputMethod = this.componentExtensionImes.find(function(ime) { return ime.id == inputMethodId; }); assertTrue(!!inputMethod); @@ -347,7 +347,7 @@ // List of language-related preferences suitable for testing. function getFakeLanguagePrefs() { - var fakePrefs = [ + const fakePrefs = [ { key: 'browser.enable_spellchecking', type: chrome.settingsPrivate.PrefType.BOOLEAN,
diff --git a/chrome/test/data/webui/settings/fake_quick_unlock_private.js b/chrome/test/data/webui/settings/fake_quick_unlock_private.js index ae005e7..e17c014 100644 --- a/chrome/test/data/webui/settings/fake_quick_unlock_private.js +++ b/chrome/test/data/webui/settings/fake_quick_unlock_private.js
@@ -10,7 +10,7 @@ * A couple weak pins to use for testing. * @const */ -var TEST_WEAK_PINS = ['1111', '1234', '1313', '2001', '1010']; +const TEST_WEAK_PINS = ['1111', '1234', '1313', '2001', '1010']; cr.define('settings', function() { /** @@ -73,9 +73,9 @@ * !chrome.quickUnlockPrivate.CredentialCheck):void} onComplete */ checkCredential: function(mode, credential, onComplete) { - var message = {}; - var errors = []; - var warnings = []; + const message = {}; + const errors = []; + const warnings = []; if (!!credential && credential.length < this.credentialRequirements.minLength) {
diff --git a/chrome/test/data/webui/settings/fake_quick_unlock_uma.js b/chrome/test/data/webui/settings/fake_quick_unlock_uma.js index a472bb48..1a4f49b 100644 --- a/chrome/test/data/webui/settings/fake_quick_unlock_uma.js +++ b/chrome/test/data/webui/settings/fake_quick_unlock_uma.js
@@ -12,7 +12,7 @@ */ function FakeQuickUnlockUma() { this.histogram = {}; - for (var key in LockScreenProgress) + for (const key in LockScreenProgress) this.histogram[LockScreenProgress[key]] = 0; }
diff --git a/chrome/test/data/webui/settings/fake_settings_private.js b/chrome/test/data/webui/settings/fake_settings_private.js index ccdfd1d..def118c 100644 --- a/chrome/test/data/webui/settings/fake_settings_private.js +++ b/chrome/test/data/webui/settings/fake_settings_private.js
@@ -26,7 +26,7 @@ if (!opt_initialPrefs) return; - for (var pref of opt_initialPrefs) + for (const pref of opt_initialPrefs) this.addPref_(pref.type, pref.key, pref.value); } @@ -36,8 +36,8 @@ getAllPrefs: function(callback) { // Send a copy of prefs to keep our internal state private. - var prefs = []; - for (var key in this.prefs) + const prefs = []; + for (const key in this.prefs) prefs.push(deepCopy(this.prefs[key])); // Run the callback asynchronously to test that the prefs aren't actually @@ -46,7 +46,7 @@ }, setPref: function(key, value, pageId, callback) { - var pref = this.prefs[key]; + const pref = this.prefs[key]; assertNotEquals(undefined, pref); assertEquals(typeof value, typeof pref.value); assertEquals(Array.isArray(value), Array.isArray(pref.value)); @@ -58,7 +58,7 @@ } assertNotEquals(true, this.disallowSetPref_); - var changed = JSON.stringify(pref.value) != JSON.stringify(value); + const changed = JSON.stringify(pref.value) != JSON.stringify(value); pref.value = deepCopy(value); callback(true); @@ -68,7 +68,7 @@ }, getPref: function(key, callback) { - var pref = this.prefs[key]; + const pref = this.prefs[key]; assertNotEquals(undefined, pref); callback(deepCopy(pref)); }, @@ -94,9 +94,9 @@ * @param {!Object<{key: string, value: *}>} changes */ sendPrefChanges: function(changes) { - var prefs = []; - for (var change of changes) { - var pref = this.prefs[change.key]; + const prefs = []; + for (const change of changes) { + const pref = this.prefs[change.key]; assertNotEquals(undefined, pref); pref.value = change.value; prefs.push(deepCopy(pref));
diff --git a/chrome/test/data/webui/settings/fake_system_display.js b/chrome/test/data/webui/settings/fake_system_display.js index b182c2a..e2a1ed1 100644 --- a/chrome/test/data/webui/settings/fake_system_display.js +++ b/chrome/test/data/webui/settings/fake_system_display.js
@@ -34,12 +34,12 @@ getInfo: function(flags, callback) { setTimeout(function() { // Create a shallow copy to trigger Polymer data binding updates. - var displays; + let displays; if (this.fakeDisplays.length > 0 && this.fakeDisplays[0].mirroringSourceId) { // When mirroring is enabled, send only the info for the display // being mirrored. - var display = + const display = this.getFakeDisplay_(this.fakeDisplays[0].mirroringSourceId); assert(!!display); displays = [display]; @@ -55,7 +55,7 @@ /** @override */ setDisplayProperties: function(id, info, callback) { - var display = this.getFakeDisplay_(id); + const display = this.getFakeDisplay_(id); if (!display) { chrome.runtime.lastError = 'Display not found.'; callback(); @@ -67,7 +67,7 @@ } if (info.isPrimary != undefined) { - var havePrimary = info.isPrimary; + let havePrimary = info.isPrimary; for (let d of this.fakeDisplays) { if (d.id == id) { d.isPrimary = info.isPrimary; @@ -106,7 +106,7 @@ /** @private */ getFakeDisplay_(id) { - var idx = this.fakeDisplays.findIndex(function(display) { + const idx = this.fakeDisplays.findIndex(function(display) { return display.id == id; }); if (idx >= 0) @@ -117,7 +117,7 @@ /** @private */ updateLayouts_() { this.fakeLayouts = []; - var primaryId = ''; + let primaryId = ''; for (let d of this.fakeDisplays) { if (d.isPrimary) { primaryId = d.id;
diff --git a/chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js b/chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js index 86c0c39..f0a2079 100644 --- a/chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js +++ b/chrome/test/data/webui/settings/fingerprint_browsertest_chromeos.js
@@ -43,7 +43,7 @@ getFingerprintsList() { this.methodCalled('getFingerprintsList'); /** @type {settings.FingerprintInfo} */ - var fingerprintInfo = {fingerprintsList: this.fingerprintsList_.slice(), + const fingerprintInfo = {fingerprintsList: this.fingerprintsList_.slice(), isMaxed: this.fingerprintsList_.length >= 5}; return Promise.resolve(fingerprintInfo); } @@ -97,14 +97,14 @@ suite('settings-fingerprint-list', function() { /** @type {?SettingsFingerprintListElement} */ - var fingerprintList = null; + let fingerprintList = null; /** @type {?SettingsSetupFingerprintDialogElement} */ - var dialog = null; + let dialog = null; /** @type {?HTMLButtonElement} */ - var addAnotherButton= null; + let addAnotherButton= null; /** @type {?settings.TestFingerprintBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** * @param {number} index
diff --git a/chrome/test/data/webui/settings/fingerprint_progress_arc_browsertest_chromeos.js b/chrome/test/data/webui/settings/fingerprint_progress_arc_browsertest_chromeos.js index 2f880e4..cda92933 100644 --- a/chrome/test/data/webui/settings/fingerprint_progress_arc_browsertest_chromeos.js +++ b/chrome/test/data/webui/settings/fingerprint_progress_arc_browsertest_chromeos.js
@@ -10,7 +10,7 @@ * y: number, * }} */ - var Point; + let Point; /** * An object descrbing a color with r, g and b values. @@ -20,20 +20,20 @@ * b: number, * }} */ - var Color; + let Color; /** @type {?SettingsFingerprintProgressArcElement} */ - var progressArc = null; + let progressArc = null; /** @type {?HTMLCanvasElement} */ - var canvas = null; + let canvas = null; /** @type {Color} */ - var black = {r: 0, g: 0, b: 0}; + const black = {r: 0, g: 0, b: 0}; /** @type {Color} */ - var blue = {r: 0, g: 0, b: 255}; + const blue = {r: 0, g: 0, b: 255}; /** @type {Color} */ - var white = {r: 255, g: 255, b: 255}; + const white = {r: 255, g: 255, b: 255}; /** * Helper function which gets the rgb values at |point| on the canvas. @@ -41,8 +41,8 @@ * @return {Color} */ function getRGBData(point) { - var ctx = canvas.getContext('2d'); - var pixel = ctx.getImageData(point.x, point.y, 1, 1).data; + const ctx = canvas.getContext('2d'); + const pixel = ctx.getImageData(point.x, point.y, 1, 1).data; return {r: pixel[0], g: pixel[1], b: pixel[2]}; } @@ -64,7 +64,7 @@ * @param {!Array<Point>} listOfPoints */ function checkListOfNotWhiteData(listOfPoints) { - for (var i = 0; i < listOfPoints.length; ++i) + for (let i = 0; i < listOfPoints.length; ++i) checkColorNotWhite(getRGBData(listOfPoints[i])); } @@ -87,7 +87,7 @@ * @param {!Array<Point>} listOfPoints */ function checkListOfRGBData(expectedColor, listOfPoints) { - for (var i = 0; i < listOfPoints.length; ++i) + for (let i = 0; i < listOfPoints.length; ++i) checkRGBData(expectedColor, getRGBData(listOfPoints[i])); } @@ -103,7 +103,7 @@ progressArc.canvasCircleProgressColor_ = 'rgba(0,0,255,1.0)'; progressArc.canvasCircleShadowColor_= 'rgba(0,0,0,1.0)'; progressArc.clearCanvas = function() { - var ctx = canvas.getContext('2d'); + const ctx = canvas.getContext('2d'); ctx.fillStyle = 'rgba(255,255,255,1.0)'; ctx.fillRect(0, 0, canvas.width, canvas.height); }; @@ -120,10 +120,10 @@ progressArc.drawArc(0, Math.PI / 2, progressArc.canvasCircleProgressColor_); /** @type {Array<Point>} */ - var expectedPointsOnArc = [{x:200, y:75} /* 0rad */, + let expectedPointsOnArc = [{x:200, y:75} /* 0rad */, {x:185, y:110} /* PI/4rad */, {x:150, y:125} /* PI/2rad */]; /** @type {Array<Point>} */ - var expectedPointsNotOnArc = [{x:115, y:110} /* 3PI/4rad */, + let expectedPointsNotOnArc = [{x:115, y:110} /* 3PI/4rad */, {x:100, y:75} /* PI */]; checkListOfRGBData(blue, expectedPointsOnArc); checkListOfRGBData(white, expectedPointsNotOnArc); @@ -152,11 +152,11 @@ // remain white. progressArc.drawBackgroundCircle(); /** @type {Array<Point>} */ - var expectedPointsInCircle = [{x:200, y:75} /* 0rad */, + const expectedPointsInCircle = [{x:200, y:75} /* 0rad */, {x:150, y:125} /* PI/2rad */, {x:100, y:75} /* PIrad */, {x:150, y:25} /* 3PI/2rad */]; /** @type {Array<Point>} */ - var expectedPointsNotInCircle = + const expectedPointsNotInCircle = [{x:110, y:75} /* Too left, outside of stroke */, {x:90, y:75} /* Too right, inside of stroke */, {x:200, y:100} /* Outside of circle */, @@ -175,11 +175,11 @@ // should not be white. progressArc.drawShadow(20, 0, 0); /** @type {Array<Point>} */ - var expectedPointsInShadowBlur10 = [{x:210, y:75} /* 0rad */, + const expectedPointsInShadowBlur10 = [{x:210, y:75} /* 0rad */, {x:150, y:135} /* PI/2rad */, {x:90, y:75} /* PIrad */, {x:150, y:15} /* 3PI/2rad */]; /** @type {Array<Point>} */ - var expectedPointsInShadowBlur20 = [{x:220, y:75} /* 0rad */, + const expectedPointsInShadowBlur20 = [{x:220, y:75} /* 0rad */, {x:150, y:145} /* PI/2rad */, {x:80, y:75} /* PIrad */, {x:150, y:5} /* 3PI/2rad */];
diff --git a/chrome/test/data/webui/settings/focus_row_behavior_test.js b/chrome/test/data/webui/settings/focus_row_behavior_test.js index dbaaee9..3ce369d 100644 --- a/chrome/test/data/webui/settings/focus_row_behavior_test.js +++ b/chrome/test/data/webui/settings/focus_row_behavior_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. suite('focus-row-behavior', function() { - /** @type {FocusableIronListItemElement} */ var testElement; + /** @type {FocusableIronListItemElement} */ let testElement; suiteSetup(function() { document.body.innerHTML = ` @@ -41,7 +41,7 @@ }); test('item passes focus to first focusable child', function() { - var focused = false; + let focused = false; testElement.$.control.addEventListener('focus', function() { focused = true; }); @@ -50,11 +50,11 @@ }); test('will focus a similar item that was last focused', function() { - var lastButton = document.createElement('button'); + const lastButton = document.createElement('button'); lastButton.setAttribute('focus-type', 'fake-btn-two'); testElement.lastFocused = lastButton; - var focused = false; + let focused = false; testElement.$.controlTwo.addEventListener('focus', function() { focused = true; }); @@ -63,7 +63,7 @@ }); test('mouse clicks on the row does not focus the controls', function() { - var focused = false; + let focused = false; testElement.$.control.addEventListener('focus', function() { focused = true; });
diff --git a/chrome/test/data/webui/settings/google_assistant_page_test.js b/chrome/test/data/webui/settings/google_assistant_page_test.js index 3fcc73a..e23f345 100644 --- a/chrome/test/data/webui/settings/google_assistant_page_test.js +++ b/chrome/test/data/webui/settings/google_assistant_page_test.js
@@ -33,10 +33,10 @@ suite('GoogleAssistantHandler', function() { /** @type {SettingsGoogleAssistantPageElement} */ - var page = null; + let page = null; /** @type {?TestGoogleAssistantBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; setup(function() { browserProxy = new TestGoogleAssistantBrowserProxy(); @@ -44,7 +44,7 @@ PolymerTest.clearBody(); - var prefElement = document.createElement('settings-prefs'); + const prefElement = document.createElement('settings-prefs'); document.body.appendChild(prefElement); return CrSettingsPrefs.initialized.then(function() { @@ -60,7 +60,7 @@ test('toggleAssistant', function() { Polymer.dom.flush(); - var button = page.$$('#googleAssistantEnable'); + const button = page.$$('#googleAssistantEnable'); assertTrue(!!button); assertFalse(button.disabled); assertFalse(button.checked); @@ -74,7 +74,7 @@ }); test('toggleAssistantContext', function() { - var button = page.$$('#googleAssistantContextEnable'); + let button = page.$$('#googleAssistantContextEnable'); assertFalse(!!button); page.setPrefValue('settings.voice_interaction.enabled', true); Polymer.dom.flush(); @@ -91,7 +91,7 @@ }); test('tapOnAssistantSettings', function() { - var button = page.$$('#googleAssistantSettings'); + let button = page.$$('#googleAssistantSettings'); assertFalse(!!button); page.setPrefValue('settings.voice_interaction.enabled', true); Polymer.dom.flush();
diff --git a/chrome/test/data/webui/settings/help_page_browsertest.js b/chrome/test/data/webui/settings/help_page_browsertest.js index ed1bcf7..7e09fd55 100644 --- a/chrome/test/data/webui/settings/help_page_browsertest.js +++ b/chrome/test/data/webui/settings/help_page_browsertest.js
@@ -31,7 +31,7 @@ TEST_F('SettingsHelpPageBrowserTest', 'Load', function() { // Assign |self| to |this| instead of binding since 'this' in suite() // and test() will be a Mocha 'Suite' or 'Test' instance. - var self = this; + const self = this; // Register mocha tests. suite('Help page', function() {
diff --git a/chrome/test/data/webui/settings/import_data_dialog_test.js b/chrome/test/data/webui/settings/import_data_dialog_test.js index 128a899..85e8ca20 100644 --- a/chrome/test/data/webui/settings/import_data_dialog_test.js +++ b/chrome/test/data/webui/settings/import_data_dialog_test.js
@@ -39,7 +39,7 @@ suite('ImportDataDialog', function() { /** @type {!Array<!settings.BrowserProfile} */ - var browserProfiles = [ + const browserProfiles = [ { autofillFormData: true, favorites: true, @@ -68,7 +68,7 @@ }; } - var prefs = {}; + const prefs = {}; ['import_dialog_history', 'import_dialog_bookmarks', 'import_dialog_saved_passwords', 'import_dialog_search_engine', 'import_dialog_autofill_form_data', @@ -76,7 +76,7 @@ prefs[name] = createBooleanPref(name); }); - var dialog = null; + let dialog = null; setup(function() { browserProxy = new TestImportDataBrowserProxy(); @@ -168,7 +168,7 @@ test('ImportFromBrowserProfile', function() { dialog.set('prefs.import_dialog_bookmarks.value', false); - var expectedIndex = 0; + const expectedIndex = 0; simulateBrowserProfileChange(expectedIndex); MockInteractions.tap(dialog.$.import); return browserProxy.whenCalled('importData').then(function(actualIndex) {
diff --git a/chrome/test/data/webui/settings/internet_page_tests.js b/chrome/test/data/webui/settings/internet_page_tests.js index 61086da0..7ae0ea0 100644 --- a/chrome/test/data/webui/settings/internet_page_tests.js +++ b/chrome/test/data/webui/settings/internet_page_tests.js
@@ -4,13 +4,13 @@ suite('Internet', function() { /** @type {InternetPageElement} */ - var internetPage = null; + let internetPage = null; /** @type {NetworkSummaryElement} */ - var networkSummary_ = null; + let networkSummary_ = null; /** @type {NetworkingPrivate} */ - var api_; + let api_; suiteSetup(function() { loadTimeData.overrideValues({ @@ -91,7 +91,7 @@ suite('MainPage', function() { test('Ethernet', function() { // Default fake device state is Ethernet enabled only. - var ethernet = networkSummary_.$$('#Ethernet'); + const ethernet = networkSummary_.$$('#Ethernet'); assertTrue(!!ethernet); assertEquals(1, ethernet.networkStateList.length); assertEquals(null, networkSummary_.$$('#Cellular')); @@ -107,7 +107,7 @@ ]); api_.enableNetworkType('WiFi'); Polymer.dom.flush(); - var wifi = networkSummary_.$$('#WiFi'); + const wifi = networkSummary_.$$('#WiFi'); assertTrue(!!wifi); assertEquals(2, wifi.networkStateList.length); }); @@ -116,13 +116,13 @@ // Make WiFi an available but disabled technology. api_.disableNetworkType('WiFi'); Polymer.dom.flush(); - var wifi = networkSummary_.$$('#WiFi'); + const wifi = networkSummary_.$$('#WiFi'); assertTrue(!!wifi); // Ensure that the initial state is disabled and the toggle is // enabled but unchecked. assertEquals('Disabled', api_.getDeviceStateForTest('WiFi').State); - var toggle = wifi.$$('#deviceEnabledButton'); + const toggle = wifi.$$('#deviceEnabledButton'); assertTrue(!!toggle); assertFalse(toggle.disabled); assertFalse(toggle.checked); @@ -143,17 +143,17 @@ ]); api_.enableNetworkType('WiFi'); Polymer.dom.flush(); - var wifi = networkSummary_.$$('#WiFi'); + const wifi = networkSummary_.$$('#WiFi'); assertTrue(!!wifi); MockInteractions.tap(wifi.$$('button.subpage-arrow')); return flushAsync().then(() => { - var subpage = internetPage.$$('settings-internet-subpage'); + const subpage = internetPage.$$('settings-internet-subpage'); assertTrue(!!subpage); assertEquals(2, subpage.networkStateList_.length); - var toggle = wifi.$$('#deviceEnabledButton'); + const toggle = wifi.$$('#deviceEnabledButton'); assertTrue(!!toggle); assertFalse(toggle.disabled); - var networkList = subpage.$$('#networkList'); + const networkList = subpage.$$('#networkList'); assertTrue(!!networkList); assertEquals(2, networkList.networks.length); }); @@ -170,14 +170,14 @@ api_.whenCalled('getDeviceStates'), ]); }).then(() => { - var mobile = networkSummary_.$$('#Cellular'); + const mobile = networkSummary_.$$('#Cellular'); assertTrue(!!mobile); MockInteractions.tap(mobile.$$('button.subpage-arrow')); return Promise.all([ api_.whenCalled('getManagedProperties'), ]); }).then(() => { - var detailPage = internetPage.$$('settings-internet-detail-page'); + const detailPage = internetPage.$$('settings-internet-detail-page'); assertTrue(!!detailPage); }); }); @@ -189,20 +189,20 @@ ]); api_.enableNetworkType('Tether'); return flushAsync().then(() => { - var mobile = networkSummary_.$$('#Tether'); + const mobile = networkSummary_.$$('#Tether'); assertTrue(!!mobile); MockInteractions.tap(mobile.$$('button.subpage-arrow')); Polymer.dom.flush(); - var subpage = internetPage.$$('settings-internet-subpage'); + const subpage = internetPage.$$('settings-internet-subpage'); assertTrue(!!subpage); assertEquals(2, subpage.networkStateList_.length); - var toggle = mobile.$$('#deviceEnabledButton'); + const toggle = mobile.$$('#deviceEnabledButton'); assertTrue(!!toggle); assertFalse(toggle.disabled); - var networkList = subpage.$$('#networkList'); + const networkList = subpage.$$('#networkList'); assertTrue(!!networkList); assertEquals(2, networkList.networks.length); - var tetherToggle = mobile.$$('#tetherEnabledButton'); + const tetherToggle = mobile.$$('#tetherEnabledButton'); // No separate tether toggle when Celular is not available; the // primary toggle enables or disables Tether in that case. assertFalse(!!tetherToggle); @@ -218,20 +218,20 @@ api_.enableNetworkType('Cellular'); api_.enableNetworkType('Tether'); return flushAsync().then(() => { - var mobile = networkSummary_.$$('#Cellular'); + const mobile = networkSummary_.$$('#Cellular'); assertTrue(!!mobile); MockInteractions.tap(mobile.$$('button.subpage-arrow')); Polymer.dom.flush(); - var subpage = internetPage.$$('settings-internet-subpage'); + const subpage = internetPage.$$('settings-internet-subpage'); assertTrue(!!subpage); assertEquals(3, subpage.networkStateList_.length); - var toggle = mobile.$$('#deviceEnabledButton'); + const toggle = mobile.$$('#deviceEnabledButton'); assertTrue(!!toggle); assertFalse(toggle.disabled); - var networkList = subpage.$$('#networkList'); + const networkList = subpage.$$('#networkList'); assertTrue(!!networkList); assertEquals(3, networkList.networks.length); - var tetherToggle = subpage.$$('#tetherEnabledButton'); + const tetherToggle = subpage.$$('#tetherEnabledButton'); assertTrue(!!tetherToggle); assertFalse(tetherToggle.disabled); }); @@ -271,14 +271,14 @@ ]); api_.onNetworkListChanged.callListeners(); return flushAsync().then(() => { - var vpn = networkSummary_.$$('#VPN'); + const vpn = networkSummary_.$$('#VPN'); assertTrue(!!vpn); MockInteractions.tap(vpn.$$('button.subpage-arrow')); Polymer.dom.flush(); - var subpage = internetPage.$$('settings-internet-subpage'); + const subpage = internetPage.$$('settings-internet-subpage'); assertTrue(!!subpage); assertEquals(2, subpage.networkStateList_.length); - var networkList = subpage.$$('#networkList'); + const networkList = subpage.$$('#networkList'); assertTrue(!!networkList); assertEquals(2, networkList.networks.length); // TODO(stevenjb): Implement fake management API and test third @@ -301,16 +301,16 @@ LastLaunchTime: 1 }]); return flushAsync().then(() => { - var expandAddConnections = internetPage.$$('#expandAddConnections'); + const expandAddConnections = internetPage.$$('#expandAddConnections'); assertTrue(!!expandAddConnections); assertTrue(!expandAddConnections.expanded); internetPage.addConnectionExpanded_ = true; Polymer.dom.flush(); - var addArcVpn = internetPage.$$('#addArcVpn'); + const addArcVpn = internetPage.$$('#addArcVpn'); assertTrue(!!addArcVpn); MockInteractions.tap(addArcVpn); Polymer.dom.flush(); - var subpage = internetPage.$$('settings-internet-subpage'); + const subpage = internetPage.$$('settings-internet-subpage'); assertTrue(!!subpage); assertEquals(2, subpage.arcVpnProviders.length); });
diff --git a/chrome/test/data/webui/settings/languages_page_tests.js b/chrome/test/data/webui/settings/languages_page_tests.js index df11e26..22ef23e 100644 --- a/chrome/test/data/webui/settings/languages_page_tests.js +++ b/chrome/test/data/webui/settings/languages_page_tests.js
@@ -13,15 +13,15 @@ suite('languages page', function() { /** @type {?LanguageHelper} */ - var languageHelper = null; + let languageHelper = null; /** @type {?SettingsLanguagesPageElement} */ - var languagesPage = null; + let languagesPage = null; /** @type {?IronCollapseElement} */ - var languagesCollapse = null; + let languagesCollapse = null; /** @type {?CrActionMenuElement} */ - var actionMenu = null; + let actionMenu = null; /** @type {?settings.LanguagesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; // Enabled language pref name for the platform. const languagesPref = @@ -38,8 +38,8 @@ }); setup(function() { - var settingsPrefs = document.createElement('settings-prefs'); - var settingsPrivate = + const settingsPrefs = document.createElement('settings-prefs'); + const settingsPrivate = new settings.FakeSettingsPrivate(settings.getFakeLanguagePrefs()); settingsPrefs.initialize(settingsPrivate); document.body.appendChild(settingsPrefs); @@ -49,7 +49,8 @@ settings.LanguagesBrowserProxyImpl.instance_ = browserProxy; // Set up fake languageSettingsPrivate API. - var languageSettingsPrivate = browserProxy.getLanguageSettingsPrivate(); + const languageSettingsPrivate = + browserProxy.getLanguageSettingsPrivate(); languageSettingsPrivate.setSettingsPrefs(settingsPrefs); languagesPage = document.createElement('settings-languages-page'); @@ -73,18 +74,18 @@ }); suite(TestNames.AddLanguagesDialog, function() { - var dialog; - var dialogItems; - var cancelButton; - var actionButton; - var dialogClosedResolver; - var dialogClosedObserver; + let dialog; + let dialogItems; + let cancelButton; + let actionButton; + let dialogClosedResolver; + let dialogClosedObserver; // Resolves the PromiseResolver if the mutation includes removal of the // settings-add-languages-dialog. // TODO(michaelpg): Extract into a common method similar to // test_util.whenAttributeIs for use elsewhere. - var onMutation = function(mutations, observer) { + const onMutation = function(mutations, observer) { if (mutations.some(function(mutation) { return mutation.type == 'childList' && Array.from(mutation.removedNodes).includes(dialog); @@ -98,7 +99,7 @@ }; setup(function(done) { - var addLanguagesButton = + const addLanguagesButton = languagesCollapse.querySelector('#addLanguages'); MockInteractions.tap(addLanguagesButton); @@ -188,9 +189,9 @@ // Test that searching languages works whether the displayed or native // language name is queried. test('search languages', function() { - var searchInput = dialog.$$('settings-subpage-search'); + const searchInput = dialog.$$('settings-subpage-search'); - var getItems = function() { + const getItems = function() { return dialog.$.dialog.querySelectorAll('.list-item:not([hidden])'); }; @@ -221,9 +222,9 @@ * @return {!HTMLElement} Menu item. */ function getMenuItem(i18nKey) { - var i18nString = assert(loadTimeData.getString(i18nKey)); - var menuItems = actionMenu.querySelectorAll('.dropdown-item'); - var menuItem = Array.from(menuItems).find( + const i18nString = assert(loadTimeData.getString(i18nKey)); + const menuItems = actionMenu.querySelectorAll('.dropdown-item'); + const menuItem = Array.from(menuItems).find( item => item.textContent.trim() == i18nString); return assert(menuItem, 'Menu item "' + i18nKey + '" not found'); } @@ -235,21 +236,21 @@ */ function assertMenuItemButtonsVisible(buttonVisibility) { assertTrue(actionMenu.open); - for (var buttonKey of Object.keys(buttonVisibility)) { - var buttonItem = getMenuItem(buttonKey); + for (const buttonKey of Object.keys(buttonVisibility)) { + const buttonItem = getMenuItem(buttonKey); assertEquals(!buttonVisibility[buttonKey], buttonItem.hidden, 'Menu item "' + buttonKey + '" hidden'); } } test('structure', function() { - var languageOptionsDropdownTrigger = languagesCollapse.querySelector( + const languageOptionsDropdownTrigger = languagesCollapse.querySelector( 'button'); assertTrue(!!languageOptionsDropdownTrigger); MockInteractions.tap(languageOptionsDropdownTrigger); assertTrue(actionMenu.open); - var separator = actionMenu.querySelector('hr'); + const separator = actionMenu.querySelector('hr'); assertEquals(1, separator.offsetHeight); // Disable Translate. On platforms that can't change the UI language, @@ -261,13 +262,13 @@ }); test('test translate.enable toggle', function() { - var settingsToggle = languagesPage.$.offerTranslateOtherLanguages; + const settingsToggle = languagesPage.$.offerTranslateOtherLanguages; assertTrue(!!settingsToggle); assertTrue(!!settingsToggle); // Clicking on the toggle switches it to false. MockInteractions.tap(settingsToggle); - var newToggleValue = languageHelper.prefs.translate.enabled.value; + let newToggleValue = languageHelper.prefs.translate.enabled.value; assertFalse(newToggleValue); // Clicking on the toggle switches it to true again. @@ -278,14 +279,14 @@ test('toggle translate for a specific language', function(done) { // Open options for 'sw'. - var languageOptionsDropdownTrigger = + const languageOptionsDropdownTrigger = languagesCollapse.querySelectorAll('button')[1]; assertTrue(!!languageOptionsDropdownTrigger); MockInteractions.tap(languageOptionsDropdownTrigger); assertTrue(actionMenu.open); // 'sw' supports translate to the target language ('en'). - var translateOption = getMenuItem('offerToTranslateInThisLanguage'); + const translateOption = getMenuItem('offerToTranslateInThisLanguage'); assertFalse(translateOption.disabled); assertTrue(translateOption.checked); @@ -309,14 +310,14 @@ languageHelper.setPrefValue('translate.enabled', false); // Open options for 'sw'. - var languageOptionsDropdownTrigger = + const languageOptionsDropdownTrigger = languagesCollapse.querySelectorAll('button')[1]; assertTrue(!!languageOptionsDropdownTrigger); MockInteractions.tap(languageOptionsDropdownTrigger); assertTrue(actionMenu.open); // The language-specific translation option should be hidden. - var translateOption = actionMenu.querySelector('#offerTranslations'); + const translateOption = actionMenu.querySelector('#offerTranslations'); assertTrue(!!translateOption); assertTrue(translateOption.hidden); }); @@ -329,10 +330,10 @@ Polymer.dom.flush(); // Find the new language item. - var items = languagesCollapse.querySelectorAll('.list-item'); - var domRepeat = assert( + const items = languagesCollapse.querySelectorAll('.list-item'); + const domRepeat = assert( languagesCollapse.querySelector('template[is="dom-repeat"]')); - var item = Array.from(items).find(function(el) { + const item = Array.from(items).find(function(el) { return domRepeat.itemForElement(el) && domRepeat.itemForElement(el).language.code == 'no'; }); @@ -341,7 +342,7 @@ MockInteractions.tap(item.querySelector('button')); assertTrue(actionMenu.open); - var removeMenuItem = getMenuItem('removeLanguage'); + const removeMenuItem = getMenuItem('removeLanguage'); assertFalse(removeMenuItem.disabled); MockInteractions.tap(removeMenuItem); assertFalse(actionMenu.open); @@ -352,12 +353,12 @@ test('move up/down buttons', function() { // Add several languages. - for (var language of ['en-CA', 'en-US', 'tk', 'no']) + for (const language of ['en-CA', 'en-US', 'tk', 'no']) languageHelper.enableLanguage(language); Polymer.dom.flush(); - var menuButtons = + const menuButtons = languagesCollapse.querySelectorAll( '.list-item button.icon-more-vert'); @@ -392,11 +393,11 @@ }); test(TestNames.InputMethods, function() { - var inputMethodsCollapse = languagesPage.$.inputMethodsCollapse; - var inputMethodSettingsExist = !!inputMethodsCollapse; + const inputMethodsCollapse = languagesPage.$.inputMethodsCollapse; + const inputMethodSettingsExist = !!inputMethodsCollapse; if (cr.isChromeOS) { assertTrue(inputMethodSettingsExist); - var manageInputMethodsButton = + const manageInputMethodsButton = inputMethodsCollapse.querySelector('#manageInputMethods'); MockInteractions.tap(manageInputMethodsButton); assertTrue(!!languagesPage.$$('settings-manage-input-methods-page')); @@ -406,8 +407,8 @@ }); test(TestNames.Spellcheck, function() { - var spellCheckCollapse = languagesPage.$.spellCheckCollapse; - var spellCheckSettingsExist = !!spellCheckCollapse; + const spellCheckCollapse = languagesPage.$.spellCheckCollapse; + const spellCheckSettingsExist = !!spellCheckCollapse; if (cr.isMac) { assertFalse(spellCheckSettingsExist); } else { @@ -415,7 +416,7 @@ // The row button should have a secondary row specifying which language // spell check is enabled for. - var triggerRow = languagesPage.$.spellCheckSubpageTrigger; + const triggerRow = languagesPage.$.spellCheckSubpageTrigger; // en-US starts with spellcheck enabled, so the secondary row is // populated. @@ -427,7 +428,7 @@ Polymer.dom.flush(); // Disable spellcheck for en-US. - var spellcheckLanguageToggle = + const spellcheckLanguageToggle = spellCheckCollapse.querySelector('cr-toggle[checked]'); assertTrue(!!spellcheckLanguageToggle); MockInteractions.tap(spellcheckLanguageToggle);
diff --git a/chrome/test/data/webui/settings/languages_tests.js b/chrome/test/data/webui/settings/languages_tests.js index fa248643..35428080 100644 --- a/chrome/test/data/webui/settings/languages_tests.js +++ b/chrome/test/data/webui/settings/languages_tests.js
@@ -9,16 +9,16 @@ */ function assertLanguageOrder(expected) { assertEquals(expected.length, languageHelper.languages.enabled.length); - for (var i = 0; i < expected.length; i++) { + for (let i = 0; i < expected.length; i++) { assertEquals( expected[i], languageHelper.languages.enabled[i].language.code); } } /** @type {?settings.LanguagesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; - var languageHelper; + let languageHelper; suiteSetup(function() { CrSettingsPrefs.deferInitialization = true; @@ -26,8 +26,8 @@ }); setup(function() { - var settingsPrefs = document.createElement('settings-prefs'); - var settingsPrivate = + const settingsPrefs = document.createElement('settings-prefs'); + const settingsPrivate = new settings.FakeSettingsPrivate(settings.getFakeLanguagePrefs()); settingsPrefs.initialize(settingsPrivate); document.body.appendChild(settingsPrefs); @@ -37,7 +37,7 @@ settings.LanguagesBrowserProxyImpl.instance_ = browserProxy; // Setup fake languageSettingsPrivate API. - var languageSettingsPrivate = browserProxy.getLanguageSettingsPrivate(); + const languageSettingsPrivate = browserProxy.getLanguageSettingsPrivate(); languageSettingsPrivate.setSettingsPrefs(settingsPrefs); languageHelper = document.createElement('settings-languages'); @@ -53,8 +53,8 @@ }); test('languages model', function() { - var languageSettingsPrivate = browserProxy.getLanguageSettingsPrivate(); - for (var i = 0; i < languageSettingsPrivate.languages.length; + const languageSettingsPrivate = browserProxy.getLanguageSettingsPrivate(); + for (let i = 0; i < languageSettingsPrivate.languages.length; i++) { assertEquals(languageSettingsPrivate.languages[i].code, languageHelper.languages.supported[i].code); @@ -93,7 +93,7 @@ // Can move a language to the front. languageHelper.moveLanguageToFront('sw'); - var expectedOrder = ['sw', 'en-CA', 'en-US']; + const expectedOrder = ['sw', 'en-CA', 'en-US']; assertLanguageOrder(expectedOrder); // Moving the first language up has no effect. @@ -112,11 +112,11 @@ if (cr.isChromeOS) { test('modifying input methods', function() { assertEquals(2, languageHelper.languages.inputMethods.enabled.length); - var inputMethods = languageHelper.getInputMethodsForLanguage('en-US'); + const inputMethods = languageHelper.getInputMethodsForLanguage('en-US'); assertEquals(3, inputMethods.length); // We can remove one input method. - var dvorak = + const dvorak = '_comp_ime_fgoepimhcoialccpbmpnnblemnepkkaoxkb:us:dvorak:eng'; languageHelper.removeInputMethod(dvorak); assertEquals(1, languageHelper.languages.inputMethods.enabled.length); @@ -126,8 +126,8 @@ assertEquals(1, languageHelper.languages.inputMethods.enabled.length); // Add input methods for Swahili. - var sw = '_comp_ime_abcdefghijklmnopqrstuvwxyzabcdefxkb:sw:sw'; - var swUS = '_comp_ime_abcdefghijklmnopqrstuvwxyzabcdefxkb:us:sw'; + const sw = '_comp_ime_abcdefghijklmnopqrstuvwxyzabcdefxkb:sw:sw'; + const swUS = '_comp_ime_abcdefghijklmnopqrstuvwxyzabcdefxkb:us:sw'; languageHelper.addInputMethod(sw); languageHelper.addInputMethod(swUS); assertEquals(3, languageHelper.languages.inputMethods.enabled.length);
diff --git a/chrome/test/data/webui/settings/metrics_reporting_tests.js b/chrome/test/data/webui/settings/metrics_reporting_tests.js index e9ef617d..608deadc 100644 --- a/chrome/test/data/webui/settings/metrics_reporting_tests.js +++ b/chrome/test/data/webui/settings/metrics_reporting_tests.js
@@ -4,10 +4,10 @@ suite('metrics reporting', function() { /** @type {settings.TestPrivacyPageBrowserProxy} */ - var testBrowserProxy; + let testBrowserProxy; /** @type {SettingsPrivacyPageElement} */ - var page; + let page; setup(function() { testBrowserProxy = new TestPrivacyPageBrowserProxy(); @@ -22,12 +22,12 @@ return testBrowserProxy.whenCalled('getMetricsReporting').then(function() { Polymer.dom.flush(); - var control = page.$.metricsReportingControl; + const control = page.$.metricsReportingControl; assertEquals(testBrowserProxy.metricsReporting.enabled, control.checked); assertEquals(testBrowserProxy.metricsReporting.managed, !!control.pref.controlledBy); - var changedMetrics = { + const changedMetrics = { enabled: !testBrowserProxy.metricsReporting.enabled, managed: !testBrowserProxy.metricsReporting.managed, }; @@ -37,7 +37,7 @@ assertEquals(changedMetrics.enabled, control.checked); assertEquals(changedMetrics.managed, !!control.pref.controlledBy); - var toggled = !changedMetrics.enabled; + const toggled = !changedMetrics.enabled; control.checked = toggled; control.notifyChangedByUserInteraction();
diff --git a/chrome/test/data/webui/settings/multidevice_page_tests.js b/chrome/test/data/webui/settings/multidevice_page_tests.js index 6a0f7aa..cc8872ea 100644 --- a/chrome/test/data/webui/settings/multidevice_page_tests.js +++ b/chrome/test/data/webui/settings/multidevice_page_tests.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. suite('Multidevice', function() { - var multidevicePage = null; + let multidevicePage = null; suiteSetup(function() { });
diff --git a/chrome/test/data/webui/settings/on_startup_browsertest.js b/chrome/test/data/webui/settings/on_startup_browsertest.js index 363db06..bf01595 100644 --- a/chrome/test/data/webui/settings/on_startup_browsertest.js +++ b/chrome/test/data/webui/settings/on_startup_browsertest.js
@@ -10,7 +10,7 @@ * Radio button enum values for restore on startup. * @enum */ -var RestoreOnStartupEnum = { +const RestoreOnStartupEnum = { CONTINUE: 1, OPEN_NEW_TAB: 5, OPEN_SPECIFIC: 4, @@ -28,11 +28,11 @@ /** @return {Element} */ getPageElement: function(selector) { - var section = this.getSection(this.basicPage, 'onStartup'); + const section = this.getSection(this.basicPage, 'onStartup'); assertTrue(!!section); - var module = section.querySelector('settings-on-startup-page'); + const module = section.querySelector('settings-on-startup-page'); assertTrue(!!module); - var result = module.$$(selector); + const result = module.$$(selector); assertTrue(!!result); return result; }, @@ -43,10 +43,10 @@ * The prefs API that will get a fake implementation. * @type {!SettingsPrivate} */ - var settingsPrefs; - var self = this; + let settingsPrefs; + const self = this; - var restoreOnStartup = function() { + const restoreOnStartup = function() { return self.getPageElement('#onStartupRadioGroup') .querySelector('.iron-selected') .label;
diff --git a/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js b/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js index d3f4795..e230c11 100644 --- a/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js +++ b/chrome/test/data/webui/settings/passwords_and_autofill_fake_data.js
@@ -68,7 +68,7 @@ * @return {!chrome.autofillPrivate.AddressEntry} */ FakeDataMaker.addressEntry = function() { - var ret = {}; + const ret = {}; ret.guid = FakeDataMaker.makeGuid_(); ret.fullNames = ['John Doe']; ret.companyName = 'Google'; @@ -91,9 +91,9 @@ * @return {!chrome.autofillPrivate.CreditCardEntry} */ FakeDataMaker.emptyCreditCardEntry = function() { - var now = new Date(); - var expirationMonth = now.getMonth() + 1; - var ret = {}; + const now = new Date(); + const expirationMonth = now.getMonth() + 1; + const ret = {}; ret.expirationMonth = expirationMonth.toString(); ret.expirationYear = now.getFullYear().toString(); return ret; @@ -104,15 +104,15 @@ * @return {!chrome.autofillPrivate.CreditCardEntry} */ FakeDataMaker.creditCardEntry = function() { - var ret = {}; + const ret = {}; ret.guid = FakeDataMaker.makeGuid_(); ret.name = 'Jane Doe'; ret.cardNumber = FakeDataMaker.patternMaker_('xxxx xxxx xxxx xxxx', 10); ret.expirationMonth = Math.ceil(Math.random() * 11).toString(); ret.expirationYear = (2016 + Math.floor(Math.random() * 5)).toString(); ret.metadata = {isLocal: true}; - var cards = ['Visa', 'Mastercard', 'Discover', 'Card']; - var card = cards[Math.floor(Math.random() * cards.length)]; + const cards = ['Visa', 'Mastercard', 'Discover', 'Card']; + const card = cards[Math.floor(Math.random() * cards.length)]; ret.metadata.summaryLabel = card + ' ' + '****' + ret.cardNumber.substr(-4); return ret; }; @@ -243,7 +243,7 @@ * @param {!PasswordManagerExpectations} expected */ assertExpectations: function(expected) { - var actual = this.actual_; + const actual = this.actual_; assertEquals(expected.requested.passwords, actual.requested.passwords); assertEquals(expected.requested.exceptions, actual.requested.exceptions); @@ -332,7 +332,7 @@ * @param {!AutofillManagerExpectations} expected */ assertExpectations: function(expected) { - var actual = this.actual_; + const actual = this.actual_; assertEquals(expected.requested.addresses, actual.requested.addresses); assertEquals(expected.requested.creditCards, actual.requested.creditCards);
diff --git a/chrome/test/data/webui/settings/passwords_and_forms_browsertest.js b/chrome/test/data/webui/settings/passwords_and_forms_browsertest.js index c6f5dff..7cb9435 100644 --- a/chrome/test/data/webui/settings/passwords_and_forms_browsertest.js +++ b/chrome/test/data/webui/settings/passwords_and_forms_browsertest.js
@@ -5,7 +5,7 @@ /** @fileoverview Runs the Polymer Passwords and Forms tests. */ /** @const {string} Path to root from chrome/test/data/webui/settings/. */ -var ROOT_PATH = '../../../../../'; +const ROOT_PATH = '../../../../../'; // Polymer BrowserTest fixture. GEN_INCLUDE( @@ -48,15 +48,15 @@ /** This test will validate that the section is loaded with data. */ TEST_F('PasswordsAndFormsBrowserTest', 'uiTests', function() { - var passwordManager; - var autofillManager; + let passwordManager; + let autofillManager; /** * Creates a new passwords and forms element. * @return {!Object} */ function createPasswordsAndFormsElement(prefsElement) { - var element = document.createElement('settings-passwords-and-forms-page'); + const element = document.createElement('settings-passwords-and-forms-page'); element.prefs = prefsElement.prefs; document.body.appendChild(element); element.$$('template[route-path="/passwords"]').if = true; @@ -73,7 +73,7 @@ function createPrefs(autofill, passwords) { return new Promise(function(resolve) { CrSettingsPrefs.deferInitialization = true; - var prefs = document.createElement('settings-prefs'); + const prefs = document.createElement('settings-prefs'); prefs.initialize(new settings.FakeSettingsPrivate([ { key: 'autofill.enabled', @@ -119,7 +119,7 @@ * @return {!PasswordManagerExpectations} */ function basePasswordExpectations() { - var expected = new PasswordManagerExpectations(); + const expected = new PasswordManagerExpectations(); expected.requested.passwords = 1; expected.requested.exceptions = 1; expected.listening.passwords = 1; @@ -133,7 +133,7 @@ * @return {!AutofillManagerExpectations} */ function baseAutofillExpectations() { - var expected = new AutofillManagerExpectations(); + const expected = new AutofillManagerExpectations(); expected.requested.addresses = 1; expected.requested.creditCards = 1; expected.listening.addresses = 1; @@ -156,12 +156,12 @@ suite('PasswordsAndForms', function() { test('baseLoadAndRemove', function() { return createPrefs(true, true).then(function(prefs) { - var element = createPasswordsAndFormsElement(prefs); + const element = createPasswordsAndFormsElement(prefs); - var passwordsExpectations = basePasswordExpectations(); + const passwordsExpectations = basePasswordExpectations(); passwordManager.assertExpectations(passwordsExpectations); - var autofillExpectations = baseAutofillExpectations(); + const autofillExpectations = baseAutofillExpectations(); autofillManager.assertExpectations(autofillExpectations); element.remove(); @@ -181,9 +181,9 @@ test('loadPasswordsAsync', function() { return createPrefs(true, true).then(function(prefs) { - var element = createPasswordsAndFormsElement(prefs); + const element = createPasswordsAndFormsElement(prefs); - var list = [ + const list = [ FakeDataMaker.passwordEntry(), FakeDataMaker.passwordEntry() ]; @@ -207,9 +207,9 @@ test('loadExceptionsAsync', function() { return createPrefs(true, true).then(function(prefs) { - var element = createPasswordsAndFormsElement(prefs); + const element = createPasswordsAndFormsElement(prefs); - var list = [FakeDataMaker.exceptionEntry(), + const list = [FakeDataMaker.exceptionEntry(), FakeDataMaker.exceptionEntry()]; passwordManager.lastCallback.addExceptionListChangedListener(list); Polymer.dom.flush(); @@ -227,9 +227,10 @@ test('loadAddressesAsync', function() { return createPrefs(true, true).then(function(prefs) { - var element = createPasswordsAndFormsElement(prefs); + const element = createPasswordsAndFormsElement(prefs); - var list = [FakeDataMaker.addressEntry(), FakeDataMaker.addressEntry()]; + const list = [ + FakeDataMaker.addressEntry(), FakeDataMaker.addressEntry()]; autofillManager.lastCallback.addAddressListChangedListener(list); Polymer.dom.flush(); @@ -246,9 +247,9 @@ test('loadCreditCardsAsync', function() { return createPrefs(true, true).then(function(prefs) { - var element = createPasswordsAndFormsElement(prefs); + const element = createPasswordsAndFormsElement(prefs); - var list = [FakeDataMaker.creditCardEntry(), + const list = [FakeDataMaker.creditCardEntry(), FakeDataMaker.creditCardEntry()]; autofillManager.lastCallback.addCreditCardListChangedListener(list); Polymer.dom.flush();
diff --git a/chrome/test/data/webui/settings/people_page_change_picture_test.js b/chrome/test/data/webui/settings/people_page_change_picture_test.js index 0568d2b8..3d43efb 100644 --- a/chrome/test/data/webui/settings/people_page_change_picture_test.js +++ b/chrome/test/data/webui/settings/people_page_change_picture_test.js
@@ -23,7 +23,7 @@ 'fake-profile-image-url', false /* selected */); - var fakeDefaultImages = [ + const fakeDefaultImages = [ { author: 'Author_Old', index: 1, @@ -94,10 +94,10 @@ } suite('ChangePictureTests', function() { - var changePicture = null; - var browserProxy = null; - var crPicturePane = null; - var crPictureList = null; + let changePicture = null; + let browserProxy = null; + let crPicturePane = null; + let crPictureList = null; suiteSetup(function() { loadTimeData.overrideValues({ @@ -135,7 +135,7 @@ return new Promise(function(resolve) { changePicture.async(resolve); }).then(function() { - var camera = crPicturePane.$$('#camera'); + const camera = crPicturePane.$$('#camera'); expectFalse(crPicturePane.cameraPresent); expectFalse(crPicturePane.cameraActive_); expectFalse(!!camera && camera.hidden); @@ -146,24 +146,24 @@ changePicture.async(resolve); }); }).then(function() { - var camera = crPicturePane.$$('#camera'); + const camera = crPicturePane.$$('#camera'); expectTrue(crPicturePane.cameraPresent); expectFalse(crPicturePane.cameraActive_); expectFalse(!!camera && camera.hidden); - var cameraImage = crPictureList.$.cameraImage; + const cameraImage = crPictureList.$.cameraImage; MockInteractions.tap(cameraImage); Polymer.dom.flush(); return new Promise(function(resolve) { changePicture.async(resolve); }); }).then(function() { - var camera = crPicturePane.$$('#camera'); + const camera = crPicturePane.$$('#camera'); expectTrue(crPicturePane.cameraActive_); assertTrue(!!camera && !camera.hidden); expectEquals(CrPicture.SelectionTypes.CAMERA, changePicture.selectedItem_.dataset.type); - var discard = crPicturePane.$$('#discard'); + const discard = crPicturePane.$$('#discard'); expectTrue(!discard || discard.hidden); // Ensure that the camera is deactivated if user navigates away. @@ -177,7 +177,7 @@ }); test('ChangePictureProfileImage', function() { - var profileImage = crPictureList.$.profileImage; + const profileImage = crPictureList.$.profileImage; assertTrue(!!profileImage); expectEquals(null, changePicture.selectedItem_); @@ -189,7 +189,7 @@ expectEquals(CrPicture.SelectionTypes.PROFILE, changePicture.selectedItem_.dataset.type); expectFalse(crPicturePane.cameraActive_); - var discard = crPicturePane.$$('#discard'); + const discard = crPicturePane.$$('#discard'); expectTrue(!discard || discard.hidden); // Ensure that the selection is restored after navigating away and @@ -204,7 +204,7 @@ assertFalse(!!changePicture.selectedItem_); // By default there is no old image and the element is hidden. - var oldImage = crPictureList.$.oldImage; + const oldImage = crPictureList.$.oldImage; assertTrue(!!oldImage); assertTrue(oldImage.hidden); @@ -224,11 +224,11 @@ changePicture.selectedItem_.dataset.type); expectFalse(oldImage.hidden); expectFalse(crPicturePane.cameraActive_); - var discard = crPicturePane.$$('#discard'); + const discard = crPicturePane.$$('#discard'); assertTrue(!!discard); expectFalse(discard.hidden); // Ensure the old image shows the author credit. - var credit = changePicture.$$('#authorCredit'); + const credit = changePicture.$$('#authorCredit'); assertTrue(!!credit); expectFalse(credit.hidden); }); @@ -238,7 +238,7 @@ assertFalse(!!changePicture.selectedItem_); // By default there is no old image and the element is hidden. - var oldImage = crPictureList.$.oldImage; + const oldImage = crPictureList.$.oldImage; assertTrue(!!oldImage); assertTrue(oldImage.hidden); @@ -258,17 +258,17 @@ changePicture.selectedItem_.dataset.type); expectFalse(oldImage.hidden); expectFalse(crPicturePane.cameraActive_); - var discard = crPicturePane.$$('#discard'); + const discard = crPicturePane.$$('#discard'); assertTrue(!!discard); expectFalse(discard.hidden); // Ensure the file image does not show the author credit. - var credit = changePicture.$$('#authorCredit'); + const credit = changePicture.$$('#authorCredit'); assertTrue(!credit || credit.hidden); }); }); test('ChangePictureSelectFirstDefaultImage', function() { - var firstDefaultImage = crPictureList.$$('img[data-type="default"]'); + const firstDefaultImage = crPictureList.$$('img[data-type="default"]'); assertTrue(!!firstDefaultImage); MockInteractions.tap(firstDefaultImage); @@ -282,7 +282,7 @@ changePicture.selectedItem_.dataset.type); expectEquals(firstDefaultImage, changePicture.selectedItem_); expectFalse(crPicturePane.cameraActive_); - var discard = crPicturePane.$$('#discard'); + const discard = crPicturePane.$$('#discard'); expectTrue(!discard || discard.hidden); // Now verify that arrow keys actually select the new image. @@ -296,7 +296,7 @@ }); test('ChangePictureRestoreImageAfterDiscard', function() { - var firstDefaultImage = crPictureList.$$('img[data-type="default"]'); + const firstDefaultImage = crPictureList.$$('img[data-type="default"]'); assertTrue(!!firstDefaultImage); MockInteractions.tap(firstDefaultImage); @@ -314,12 +314,12 @@ expectEquals(CrPicture.SelectionTypes.OLD, changePicture.selectedItem_.dataset.type); - var discardButton = crPicturePane.$$('#discard button'); + const discardButton = crPicturePane.$$('#discard button'); assertTrue(!!discardButton); MockInteractions.tap(discardButton); Polymer.dom.flush(); - var profileImage = crPictureList.$.profileImage; + const profileImage = crPictureList.$.profileImage; assertTrue(!!profileImage); expectEquals(profileImage, changePicture.selectedItem_); });
diff --git a/chrome/test/data/webui/settings/people_page_manage_profile_test.js b/chrome/test/data/webui/settings/people_page_manage_profile_test.js index 28f9ac5..7066f89 100644 --- a/chrome/test/data/webui/settings/people_page_manage_profile_test.js +++ b/chrome/test/data/webui/settings/people_page_manage_profile_test.js
@@ -69,8 +69,8 @@ } suite('ManageProfileTests', function() { - var manageProfile = null; - var browserProxy = null; + let manageProfile = null; + let browserProxy = null; setup(function() { browserProxy = new TestManageProfileBrowserProxy(); @@ -90,7 +90,7 @@ // - gets and receives all the available icons // - can select a new icon test('ManageProfileChangeIcon', function() { - var items = null; + let items = null; return browserProxy.whenCalled('getAvailableIcons') .then(function() { Polymer.dom.flush(); @@ -116,7 +116,7 @@ }); test('ManageProfileChangeName', function() { - var nameField = manageProfile.$.name; + const nameField = manageProfile.$.name; assertTrue(!!nameField); assertFalse(!!nameField.disabled); @@ -134,7 +134,7 @@ test('ProfileNameIsDisabledForSupervisedUser', function() { manageProfile.syncStatus = {supervisedUser: true, childUser: false}; - var nameField = manageProfile.$.name; + const nameField = manageProfile.$.name; assertTrue(!!nameField); // Name field should be disabled for legacy supervised users. @@ -143,7 +143,7 @@ // Tests profile name updates pushed from the browser. test('ManageProfileNameUpdated', function() { - var nameField = manageProfile.$.name; + const nameField = manageProfile.$.name; assertTrue(!!nameField); return browserProxy.whenCalled('getAvailableIcons').then(function() { @@ -158,14 +158,14 @@ // Tests profile shortcut toggle is hidden if profile shortcuts feature is // disabled. test('ManageProfileShortcutToggleHidden', function() { - var hasShortcutToggle = manageProfile.$$('#hasShortcutToggle'); + const hasShortcutToggle = manageProfile.$$('#hasShortcutToggle'); assertFalse(!!hasShortcutToggle); }); }); suite('ManageProfileTestsProfileShortcutsEnabled', function() { - var manageProfile = null; - var browserProxy = null; + let manageProfile = null; + let browserProxy = null; setup(function() { loadTimeData.overrideValues({ @@ -196,7 +196,7 @@ .then(function() { Polymer.dom.flush(); - var hasShortcutToggle = manageProfile.$$('#hasShortcutToggle'); + const hasShortcutToggle = manageProfile.$$('#hasShortcutToggle'); assertTrue(!!hasShortcutToggle); // The profile shortcut toggle is checked. @@ -233,7 +233,7 @@ .then(function() { Polymer.dom.flush(); - var hasShortcutToggle = manageProfile.$$('#hasShortcutToggle'); + const hasShortcutToggle = manageProfile.$$('#hasShortcutToggle'); assertTrue(!!hasShortcutToggle); assertFalse(hasShortcutToggle.checked);
diff --git a/chrome/test/data/webui/settings/people_page_sync_page_interactive_test.js b/chrome/test/data/webui/settings/people_page_sync_page_interactive_test.js index d2c42083..7f7c4f5 100644 --- a/chrome/test/data/webui/settings/people_page_sync_page_interactive_test.js +++ b/chrome/test/data/webui/settings/people_page_sync_page_interactive_test.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. suite('sync-page-test', function() { - /** @type {SyncPageElement} */ var testElement; + /** @type {SyncPageElement} */ let testElement; setup(function() { PolymerTest.clearBody(); @@ -16,9 +16,9 @@ cr.webUIListenerCallback('sync-prefs-changed', {passphraseRequired: true}); Polymer.dom.flush(); - var input = testElement.$$('#existingPassphraseInput'); + const input = testElement.$$('#existingPassphraseInput'); - var focused = false; + let focused = false; input.addEventListener('focus', function() { focused = true; });
diff --git a/chrome/test/data/webui/settings/people_page_sync_page_test.js b/chrome/test/data/webui/settings/people_page_sync_page_test.js index 649f9a6..66369459 100644 --- a/chrome/test/data/webui/settings/people_page_sync_page_test.js +++ b/chrome/test/data/webui/settings/people_page_sync_page_test.js
@@ -41,10 +41,10 @@ } suite('AdvancedSyncSettingsTests', function() { - var syncPage = null; - var browserProxy = null; - var encryptWithGoogle = null; - var encyyptWithPassphrase = null; + let syncPage = null; + let browserProxy = null; + let encryptWithGoogle = null; + const encyyptWithPassphrase = null; /** * Returns sync prefs with everything synced and no passphrase required. @@ -158,9 +158,9 @@ }), test('LoadingAndTimeout', function() { - var configurePage = syncPage.$$('#' + settings.PageStatus.CONFIGURE); - var spinnerPage = syncPage.$$('#' + settings.PageStatus.SPINNER); - var timeoutPage = syncPage.$$('#' + settings.PageStatus.TIMEOUT); + const configurePage = syncPage.$$('#' + settings.PageStatus.CONFIGURE); + const spinnerPage = syncPage.$$('#' + settings.PageStatus.SPINNER); + const timeoutPage = syncPage.$$('#' + settings.PageStatus.TIMEOUT); cr.webUIListenerCallback('page-status-changed', settings.PageStatus.SPINNER); @@ -189,14 +189,14 @@ }); test('SettingIndividualDatatypes', function() { - var syncAllDataTypesControl = syncPage.$.syncAllDataTypesControl; + const syncAllDataTypesControl = syncPage.$.syncAllDataTypesControl; assertFalse(syncAllDataTypesControl.disabled); assertTrue(syncAllDataTypesControl.checked); // Assert that all the individual datatype controls are disabled. - var datatypeControls = syncPage + const datatypeControls = syncPage .$$('#configure').querySelectorAll('.list-item cr-toggle'); - for (var control of datatypeControls) { + for (const control of datatypeControls) { assertTrue(control.disabled); assertTrue(control.checked); } @@ -205,14 +205,14 @@ MockInteractions.tap(syncAllDataTypesControl); function verifyPrefs(prefs) { - var expected = getSyncAllPrefs(); + const expected = getSyncAllPrefs(); expected.syncAllDataTypes = false; assertEquals(JSON.stringify(expected), JSON.stringify(prefs)); cr.webUIListenerCallback('sync-prefs-changed', expected); // Assert that all the individual datatype controls are enabled. - for (var control of datatypeControls) { + for (const control of datatypeControls) { assertFalse(control.disabled); assertTrue(control.checked); } @@ -223,7 +223,7 @@ MockInteractions.tap(datatypeControls[3]); return browserProxy.whenCalled('setSyncDatatypes').then( function(prefs) { - var expected = getSyncAllPrefs(); + const expected = getSyncAllPrefs(); expected.syncAllDataTypes = false; expected.extensionsSynced = false; assertEquals(JSON.stringify(expected), JSON.stringify(prefs)); @@ -246,7 +246,7 @@ Polymer.dom.flush(); assertTrue(!!syncPage.$$('#create-password-box')); - var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); + const saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); assertTrue(!!saveNewPassphrase); // Test that a sync prefs update does not reset the selection. @@ -259,7 +259,7 @@ assertFalse(encryptWithPassphrase.disabled); assertFalse(encryptWithPassphrase.checked); - var link = encryptWithPassphrase.querySelector('a[href]'); + const link = encryptWithPassphrase.querySelector('a[href]'); assertTrue(!!link); // Suppress opening a new tab, since then the test will continue running @@ -280,9 +280,9 @@ Polymer.dom.flush(); assertTrue(!!syncPage.$$('#create-password-box')); - var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); - var passphraseInput = syncPage.$$('#passphraseInput'); - var passphraseConfirmationInput = + const saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); + const passphraseInput = syncPage.$$('#passphraseInput'); + const passphraseConfirmationInput = syncPage.$$('#passphraseConfirmationInput'); passphraseInput.value = ''; @@ -303,11 +303,11 @@ Polymer.dom.flush(); assertTrue(!!syncPage.$$('#create-password-box')); - var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); + const saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); assertTrue(!!saveNewPassphrase); - var passphraseInput = syncPage.$$('#passphraseInput'); - var passphraseConfirmationInput = + const passphraseInput = syncPage.$$('#passphraseInput'); + const passphraseConfirmationInput = syncPage.$$('#passphraseConfirmationInput'); passphraseInput.value = 'foo'; passphraseConfirmationInput.value = 'bar'; @@ -326,18 +326,18 @@ Polymer.dom.flush(); assertTrue(!!syncPage.$$('#create-password-box')); - var saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); + const saveNewPassphrase = syncPage.$$('#saveNewPassphrase'); assertTrue(!!saveNewPassphrase); - var passphraseInput = syncPage.$$('#passphraseInput'); - var passphraseConfirmationInput = + const passphraseInput = syncPage.$$('#passphraseInput'); + const passphraseConfirmationInput = syncPage.$$('#passphraseConfirmationInput'); passphraseInput.value = 'foo'; passphraseConfirmationInput.value = 'foo'; MockInteractions.tap(saveNewPassphrase); function verifyPrefs(prefs) { - var expected = getSyncAllPrefs(); + const expected = getSyncAllPrefs(); expected.setNewPassphrase = true; expected.passphrase = 'foo'; expected.encryptAllData = true; @@ -356,7 +356,7 @@ }); test('RadioBoxesHiddenWhenEncrypted', function() { - var prefs = getSyncAllPrefs(); + const prefs = getSyncAllPrefs(); prefs.encryptAllData = true; prefs.passphraseRequired = true; prefs.fullEncryptionBody = 'Sync already encrypted.'; @@ -370,15 +370,15 @@ test('ExistingPassphraseSubmitButtonDisabledWhenExistingPassphraseEmpty', function() { - var prefs = getSyncAllPrefs(); + const prefs = getSyncAllPrefs(); prefs.encryptAllData = true; prefs.passphraseRequired = true; cr.webUIListenerCallback('sync-prefs-changed', prefs); Polymer.dom.flush(); - var existingPassphraseInput = syncPage.$$('#existingPassphraseInput'); - var submitExistingPassphrase = syncPage.$$('#submitExistingPassphrase'); + const existingPassphraseInput = syncPage.$$('#existingPassphraseInput'); + const submitExistingPassphrase = syncPage.$$('#submitExistingPassphrase'); existingPassphraseInput.value = ''; assertTrue(submitExistingPassphrase.disabled); @@ -388,25 +388,25 @@ }); test('EnterExistingWrongPassphrase', function() { - var prefs = getSyncAllPrefs(); + const prefs = getSyncAllPrefs(); prefs.encryptAllData = true; prefs.passphraseRequired = true; cr.webUIListenerCallback('sync-prefs-changed', prefs); Polymer.dom.flush(); - var existingPassphraseInput = syncPage.$$('#existingPassphraseInput'); + const existingPassphraseInput = syncPage.$$('#existingPassphraseInput'); assertTrue(!!existingPassphraseInput); existingPassphraseInput.value = 'wrong'; browserProxy.encryptionResponse = settings.PageStatus.PASSPHRASE_FAILED; - var submitExistingPassphrase = syncPage.$$('#submitExistingPassphrase'); + const submitExistingPassphrase = syncPage.$$('#submitExistingPassphrase'); assertTrue(!!submitExistingPassphrase); MockInteractions.tap(submitExistingPassphrase); return browserProxy.whenCalled('setSyncEncryption').then( function(prefs) { - var expected = getSyncAllPrefs(); + const expected = getSyncAllPrefs(); expected.setNewPassphrase = false; expected.passphrase = 'wrong'; expected.encryptAllData = true; @@ -420,32 +420,32 @@ }); test('EnterExistingCorrectPassphrase', function() { - var prefs = getSyncAllPrefs(); + const prefs = getSyncAllPrefs(); prefs.encryptAllData = true; prefs.passphraseRequired = true; cr.webUIListenerCallback('sync-prefs-changed', prefs); Polymer.dom.flush(); - var existingPassphraseInput = syncPage.$$('#existingPassphraseInput'); + const existingPassphraseInput = syncPage.$$('#existingPassphraseInput'); assertTrue(!!existingPassphraseInput); existingPassphraseInput.value = 'right'; browserProxy.encryptionResponse = settings.PageStatus.CONFIGURE; - var submitExistingPassphrase = syncPage.$$('#submitExistingPassphrase'); + const submitExistingPassphrase = syncPage.$$('#submitExistingPassphrase'); assertTrue(!!submitExistingPassphrase); MockInteractions.tap(submitExistingPassphrase); return browserProxy.whenCalled('setSyncEncryption').then( function(prefs) { - var expected = getSyncAllPrefs(); + const expected = getSyncAllPrefs(); expected.setNewPassphrase = false; expected.passphrase = 'right'; expected.encryptAllData = true; expected.passphraseRequired = true; assertEquals(JSON.stringify(expected), JSON.stringify(prefs)); - var newPrefs = getSyncAllPrefs(); + const newPrefs = getSyncAllPrefs(); newPrefs.encryptAllData = true; cr.webUIListenerCallback('sync-prefs-changed', newPrefs);
diff --git a/chrome/test/data/webui/settings/people_page_test.js b/chrome/test/data/webui/settings/people_page_test.js index a7e3901..50d53a6 100644 --- a/chrome/test/data/webui/settings/people_page_test.js +++ b/chrome/test/data/webui/settings/people_page_test.js
@@ -4,9 +4,9 @@ cr.define('settings_people_page', function() { suite('ProfileInfoTests', function() { - var peoplePage = null; - var browserProxy = null; - var syncBrowserProxy = null; + let peoplePage = null; + let browserProxy = null; + let syncBrowserProxy = null; suiteSetup(function() { // Force easy unlock off. Those have their own ChromeOS-only tests. @@ -36,10 +36,11 @@ Polymer.dom.flush(); assertEquals(browserProxy.fakeProfileInfo.name, peoplePage.$$('#profile-name').textContent.trim()); - var bg = peoplePage.$$('#profile-icon').style.backgroundImage; + const bg = peoplePage.$$('#profile-icon').style.backgroundImage; assertTrue(bg.includes(browserProxy.fakeProfileInfo.iconUrl)); - var iconDataUrl = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEA' + + const iconDataUrl = + 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEA' + 'LAAAAAABAAEAAAICTAEAOw=='; cr.webUIListenerCallback( 'profile-info-changed', @@ -48,7 +49,7 @@ Polymer.dom.flush(); assertEquals('pushedName', peoplePage.$$('#profile-name').textContent.trim()); - var newBg = peoplePage.$$('#profile-icon').style.backgroundImage; + const newBg = peoplePage.$$('#profile-icon').style.backgroundImage; assertTrue(newBg.includes(iconDataUrl)); }); }); @@ -71,9 +72,9 @@ if (!cr.isChromeOS) { suite('SyncStatusTests', function() { - var peoplePage = null; - var browserProxy = null; - var profileInfoBrowserProxy = null; + let peoplePage = null; + let browserProxy = null; + let profileInfoBrowserProxy = null; suiteSetup(function() { // Force easy unlock off. Those have their own ChromeOS-only tests. @@ -98,7 +99,7 @@ teardown(function() { peoplePage.remove(); }); test('GetProfileInfo', function() { - var disconnectButton = null; + let disconnectButton = null; return browserProxy.whenCalled('getSyncStatus').then(function() { Polymer.dom.flush(); disconnectButton = peoplePage.$$('#disconnectButton'); @@ -111,15 +112,15 @@ assertTrue(peoplePage.$$('#disconnectDialog').open); assertFalse(peoplePage.$$('#deleteProfile').hidden); - var deleteProfileCheckbox = peoplePage.$$('#deleteProfile'); + const deleteProfileCheckbox = peoplePage.$$('#deleteProfile'); assertTrue(!!deleteProfileCheckbox); assertLT(0, deleteProfileCheckbox.clientHeight); - var disconnectConfirm = peoplePage.$$('#disconnectConfirm'); + const disconnectConfirm = peoplePage.$$('#disconnectConfirm'); assertTrue(!!disconnectConfirm); assertFalse(disconnectConfirm.hidden); - var popstatePromise = new Promise(function(resolve) { + const popstatePromise = new Promise(function(resolve) { listenOnce(window, 'popstate', resolve); }); @@ -146,14 +147,14 @@ assertTrue(peoplePage.$$('#disconnectDialog').open); assertFalse(!!peoplePage.$$('#deleteProfile')); - var disconnectManagedProfileConfirm = + const disconnectManagedProfileConfirm = peoplePage.$$('#disconnectManagedProfileConfirm'); assertTrue(!!disconnectManagedProfileConfirm); assertFalse(disconnectManagedProfileConfirm.hidden); browserProxy.resetResolver('signOut'); - var popstatePromise = new Promise(function(resolve) { + const popstatePromise = new Promise(function(resolve) { listenOnce(window, 'popstate', resolve); }); @@ -182,7 +183,7 @@ assertTrue(peoplePage.$$('#disconnectDialog').open); // Assert the warning message is as expected. - var warningMessage = peoplePage.$$('.delete-profile-warning'); + const warningMessage = peoplePage.$$('.delete-profile-warning'); cr.webUIListenerCallback('profile-stats-count-ready', 0); assertEquals( @@ -248,7 +249,7 @@ .then(function() { assertTrue(peoplePage.$$('#disconnectDialog').open); - var popstatePromise = new Promise(function(resolve) { + const popstatePromise = new Promise(function(resolve) { listenOnce(window, 'popstate', resolve); }); @@ -259,7 +260,7 @@ return popstatePromise; }) .then(function() { - var popstatePromise = new Promise(function(resolve) { + const popstatePromise = new Promise(function(resolve) { listenOnce(window, 'popstate', resolve); }); @@ -279,7 +280,7 @@ }); Polymer.dom.flush(); - var syncStatusContainer = peoplePage.$$('#sync-status'); + let syncStatusContainer = peoplePage.$$('#sync-status'); assertTrue(!!syncStatusContainer); assertTrue(syncStatusContainer.hasAttribute('actionable')); @@ -290,7 +291,7 @@ }); Polymer.dom.flush(); - var syncStatusContainer = peoplePage.$$('#sync-status'); + syncStatusContainer = peoplePage.$$('#sync-status'); assertTrue(!!syncStatusContainer); assertFalse(syncStatusContainer.hasAttribute('actionable')); }); @@ -308,7 +309,7 @@ }); Polymer.dom.flush(); - var syncStatusContainer = peoplePage.$$('#sync-status'); + let syncStatusContainer = peoplePage.$$('#sync-status'); assertTrue(!!syncStatusContainer); assertFalse(syncStatusContainer.hasAttribute('actionable')); @@ -320,7 +321,7 @@ }); Polymer.dom.flush(); - var syncStatusContainer = peoplePage.$$('#sync-status'); + syncStatusContainer = peoplePage.$$('#sync-status'); assertTrue(!!syncStatusContainer); assertTrue(syncStatusContainer.hasAttribute('actionable')); });
diff --git a/chrome/test/data/webui/settings/pref_util_tests.js b/chrome/test/data/webui/settings/pref_util_tests.js index 4452ac9..0dc344e 100644 --- a/chrome/test/data/webui/settings/pref_util_tests.js +++ b/chrome/test/data/webui/settings/pref_util_tests.js
@@ -5,14 +5,14 @@ /** @fileoverview Suite of tests for Settings.PrefUtil. */ cr.define('settings_prefUtil', function() { suite('PrefUtil', function() { - var global = function() { return this; }(); - var origTraceAssertionsForTesting = global.traceAssertionsForTesting; + const global = function() { return this; }(); + const origTraceAssertionsForTesting = global.traceAssertionsForTesting; /** * @param {function()} fn Function that should throw. * @param {string} message Message to log if function does not throw. */ - var expectThrows = function(fn, message) { + const expectThrows = function(fn, message) { // Temporarily disable printing of stack traces on assert failures. global.traceAssertionsForTesting = false; @@ -27,8 +27,8 @@ // Tests that the given value is converted to the expected value, for a // given prefType. - var expectStringToPrefValue = function(value, prefType, expectedValue) { - var pref = /** @type {PrefObject} */({type: prefType}); + const expectStringToPrefValue = function(value, prefType, expectedValue) { + const pref = /** @type {PrefObject} */({type: prefType}); expectEquals(expectedValue, Settings.PrefUtil.stringToPrefValue(value, pref)); }; @@ -46,7 +46,7 @@ expectStringToPrefValue( 'Foo Bar', chrome.settingsPrivate.PrefType.STRING, 'Foo Bar'); - var url = 'http://example.com'; + const url = 'http://example.com'; expectStringToPrefValue(url, chrome.settingsPrivate.PrefType.URL, url); expectThrows(function() { @@ -62,8 +62,8 @@ // Tests that the pref value is converted to the expected string, for a // given prefType. - var expectPrefToString = function(prefType, prefValue, expectedValue) { - var pref = /** @type {PrefObject} */({ + const expectPrefToString = function(prefType, prefValue, expectedValue) { + const pref = /** @type {PrefObject} */({ type: prefType, value: prefValue, }); @@ -79,7 +79,7 @@ expectPrefToString(chrome.settingsPrivate.PrefType.STRING, 'Foo Bar', 'Foo Bar'); - var url = 'http://example.com'; + const url = 'http://example.com'; expectPrefToString(chrome.settingsPrivate.PrefType.URL, url, url); expectThrows(function() {
diff --git a/chrome/test/data/webui/settings/prefs_test_cases.js b/chrome/test/data/webui/settings/prefs_test_cases.js index 6b21c7f..d7bd452 100644 --- a/chrome/test/data/webui/settings/prefs_test_cases.js +++ b/chrome/test/data/webui/settings/prefs_test_cases.js
@@ -10,7 +10,7 @@ * for a given pref, not every "next" value is different from the previous * value; this tests what happens when stale changes are reported. */ -var prefsTestCases = [{ +const prefsTestCases = [{ pref: { key: 'top_level_pref', type: chrome.settingsPrivate.PrefType.BOOLEAN,
diff --git a/chrome/test/data/webui/settings/prefs_tests.js b/chrome/test/data/webui/settings/prefs_tests.js index c51ea02..47f6f8e 100644 --- a/chrome/test/data/webui/settings/prefs_tests.js +++ b/chrome/test/data/webui/settings/prefs_tests.js
@@ -18,10 +18,10 @@ * Prefs instance created before each test. * @type {SettingsPrefsElement|undefined} */ - var prefs; + let prefs; /** @type {settings.FakeSettingsPrivate} */ - var fakeApi = null; + let fakeApi = null; /** * @param {!Object} prefStore Pref store from <settings-prefs>. @@ -29,9 +29,9 @@ * @return {chrome.settingsPrivate.PrefObject|undefined} */ function getPrefFromKey(prefStore, key) { - var path = key.split('.'); - var pref = prefStore; - for (var part of path) { + const path = key.split('.'); + let pref = prefStore; + for (const part of path) { pref = pref[part]; if (!pref) return undefined; @@ -45,10 +45,10 @@ * from the test case to check. */ function assertFakeApiPrefsSet(testCaseValueIndex) { - for (var testCase of prefsTestCases) { - var expectedValue = JSON.stringify( + for (const testCase of prefsTestCases) { + const expectedValue = JSON.stringify( testCase.nextValues[testCaseValueIndex]); - var actualValue = JSON.stringify( + const actualValue = JSON.stringify( fakeApi.prefs[testCase.pref.key].value); assertEquals(expectedValue, actualValue, testCase.pref.key); } @@ -60,10 +60,10 @@ * from the test case to check. */ function assertPrefsSet(testCaseValueIndex) { - for (var testCase of prefsTestCases) { - var expectedValue = JSON.stringify( + for (const testCase of prefsTestCases) { + const expectedValue = JSON.stringify( testCase.nextValues[testCaseValueIndex]); - var actualValue = JSON.stringify( + const actualValue = JSON.stringify( prefs.get('prefs.' + testCase.pref.key + '.value')); assertEquals(expectedValue, actualValue); } @@ -98,9 +98,9 @@ test('receives and caches prefs', function testGetPrefs() { // Test that each pref has been successfully copied to the Polymer // |prefs| property. - for (var key in fakeApi.prefs) { - var expectedPref = fakeApi.prefs[key]; - var actualPref = getPrefFromKey(prefs.prefs, key); + for (const key in fakeApi.prefs) { + const expectedPref = fakeApi.prefs[key]; + const actualPref = getPrefFromKey(prefs.prefs, key); if (!expectNotEquals(undefined, actualPref)) { // We've already registered an error, so skip the pref. continue; @@ -113,7 +113,7 @@ test('forwards pref changes to API', function testSetPrefs() { // Test that settings-prefs uses the setPref API. - for (var testCase of prefsTestCases) { + for (const testCase of prefsTestCases) { prefs.set('prefs.' + testCase.pref.key + '.value', deepCopy(testCase.nextValues[0])); } @@ -121,7 +121,7 @@ assertFakeApiPrefsSet(0); // Test that when setPref fails, the pref is reverted locally. - for (var testCase of prefsTestCases) { + for (const testCase of prefsTestCases) { fakeApi.failNextSetPref(); prefs.set('prefs.' + testCase.pref.key + '.value', deepCopy(testCase.nextValues[1])); @@ -131,7 +131,7 @@ // Test that setPref is not called when the pref doesn't change. fakeApi.disallowSetPref(); - for (var testCase of prefsTestCases) { + for (const testCase of prefsTestCases) { prefs.set('prefs.' + testCase.pref.key + '.value', deepCopy(testCase.nextValues[0])); } @@ -143,8 +143,8 @@ // Changes from the API should not result in those changes being sent // back to the API, as this could trigger a race condition. fakeApi.disallowSetPref(); - var prefChanges = []; - for (var testCase of prefsTestCases) { + let prefChanges = []; + for (const testCase of prefsTestCases) { prefChanges.push({key: testCase.pref.key, value: testCase.nextValues[0]}); } @@ -154,7 +154,7 @@ assertPrefsSet(0); prefChanges = []; - for (var testCase of prefsTestCases) { + for (const testCase of prefsTestCases) { prefChanges.push({key: testCase.pref.key, value: testCase.nextValues[1]}); }
diff --git a/chrome/test/data/webui/settings/privacy_page_test.js b/chrome/test/data/webui/settings/privacy_page_test.js index 7cc5171..3795224 100644 --- a/chrome/test/data/webui/settings/privacy_page_test.js +++ b/chrome/test/data/webui/settings/privacy_page_test.js
@@ -102,10 +102,10 @@ function registerNativeCertificateManagerTests() { suite('NativeCertificateManager', function() { /** @type {settings.TestPrivacyPageBrowserProxy} */ - var testBrowserProxy; + let testBrowserProxy; /** @type {SettingsPrivacyPageElement} */ - var page; + let page; setup(function() { testBrowserProxy = new TestPrivacyPageBrowserProxy(); @@ -127,7 +127,7 @@ function registerPrivacyPageTests() { suite('PrivacyPage', function() { /** @type {SettingsPrivacyPageElement} */ - var page; + let page; setup(function() { page = document.createElement('settings-privacy-page'); @@ -141,7 +141,7 @@ MockInteractions.tap(page.$$('#clearBrowsingData')); Polymer.dom.flush(); - var dialog = page.$$('settings-clear-browsing-data-dialog-tabs'); + const dialog = page.$$('settings-clear-browsing-data-dialog-tabs'); assertTrue(!!dialog); // Ensure that the dialog is fully opened before returning from this @@ -156,10 +156,10 @@ function registerClearBrowsingDataTests() { suite('ClearBrowsingData', function() { /** @type {settings.TestClearBrowsingDataBrowserProxy} */ - var testBrowserProxy; + let testBrowserProxy; /** @type {SettingsClearBrowsingDataDialogElement} */ - var element; + let element; setup(function() { testBrowserProxy = new TestClearBrowsingDataBrowserProxy(); @@ -178,18 +178,18 @@ assertTrue(element.$$('#clearBrowsingDataDialog').open); assertFalse(element.showImportantSitesDialog_); - var cancelButton = element.$$('.cancel-button'); + const cancelButton = element.$$('.cancel-button'); assertTrue(!!cancelButton); - var actionButton = element.$$('.action-button'); + const actionButton = element.$$('.action-button'); assertTrue(!!actionButton); - var spinner = element.$$('paper-spinner-lite'); + const spinner = element.$$('paper-spinner-lite'); assertTrue(!!spinner); assertFalse(cancelButton.disabled); assertFalse(actionButton.disabled); assertFalse(spinner.active); - var promiseResolver = new PromiseResolver(); + const promiseResolver = new PromiseResolver(); testBrowserProxy.setClearBrowsingDataPromise(promiseResolver.promise); MockInteractions.tap(actionButton); @@ -223,10 +223,10 @@ test('showHistoryDeletionDialog', function() { assertTrue(element.$$('#clearBrowsingDataDialog').open); - var actionButton = element.$$('.action-button'); + const actionButton = element.$$('.action-button'); assertTrue(!!actionButton); - var promiseResolver = new PromiseResolver(); + const promiseResolver = new PromiseResolver(); testBrowserProxy.setClearBrowsingDataPromise(promiseResolver.promise); MockInteractions.tap(actionButton); @@ -241,9 +241,9 @@ // assertions. }).then(function() { Polymer.dom.flush(); - var notice = element.$$('#notice'); + const notice = element.$$('#notice'); assertTrue(!!notice); - var noticeActionButton = notice.$$('.action-button'); + const noticeActionButton = notice.$$('.action-button'); assertTrue(!!noticeActionButton); assertTrue(element.$$('#clearBrowsingDataDialog').open); @@ -257,7 +257,7 @@ // propagate to the parent dialog. The parent dialog should // subsequently close as well. setTimeout(function() { - var notice = element.$$('#notice'); + const notice = element.$$('#notice'); assertFalse(!!notice); assertFalse(element.$$('#clearBrowsingDataDialog').open); resolve(); @@ -269,7 +269,7 @@ test('Counters', function() { assertTrue(element.$$('#clearBrowsingDataDialog').open); - var checkbox = element.$$('#cacheCheckboxBasic'); + const checkbox = element.$$('#cacheCheckboxBasic'); assertEquals('browser.clear_data.cache_basic', checkbox.pref.key); // Simulate a browsing data counter result for history. This checkbox's @@ -305,13 +305,13 @@ suite('ImportantSites', function() { /** @type {settings.TestClearBrowsingDataBrowserProxy} */ - var testBrowserProxy; + let testBrowserProxy; /** @type {SettingsClearBrowsingDataDialogElement} */ - var element; + let element; /** @type {Array<ImportantSite>} */ - var importantSites = [ + const importantSites = [ {registerableDomain: 'google.com', isChecked: true}, {registerableDomain: 'yahoo.com', isChecked: true} ]; @@ -348,7 +348,7 @@ return new Promise(function(resolve) { element.async(resolve); }) .then(function() { assertTrue(element.$$('#importantSitesDialog').open); - var firstImportantSite = element.$$('important-site-checkbox'); + const firstImportantSite = element.$$('important-site-checkbox'); assertTrue(!!firstImportantSite); assertEquals( 'google.com', firstImportantSite.site.registerableDomain); @@ -376,10 +376,10 @@ function registerSafeBrowsingExtendedReportingTests() { suite('SafeBrowsingExtendedReporting', function() { /** @type {settings.TestPrivacyPageBrowserProxy} */ - var testBrowserProxy; + let testBrowserProxy; /** @type {SettingsPrivacyPageElement} */ - var page; + let page; setup(function() { testBrowserProxy = new TestPrivacyPageBrowserProxy(); @@ -396,7 +396,7 @@ Polymer.dom.flush(); // Control starts checked by default - var control = page.$$('#safeBrowsingExtendedReportingControl'); + const control = page.$$('#safeBrowsingExtendedReportingControl'); assertEquals(true, control.checked); // Notification from browser can uncheck the box
diff --git a/chrome/test/data/webui/settings/protocol_handlers_tests.js b/chrome/test/data/webui/settings/protocol_handlers_tests.js index 42744ad..2ed7826 100644 --- a/chrome/test/data/webui/settings/protocol_handlers_tests.js +++ b/chrome/test/data/webui/settings/protocol_handlers_tests.js
@@ -8,13 +8,13 @@ * A dummy protocol handler element created before each test. * @type {ProtocolHandlers} */ - var testElement; + let testElement; /** * A list of ProtocolEntry fixtures. * @type {!Array<!ProtocolEntry>} */ - var protocols = [ + const protocols = [ { default_handler: 0, handlers: [{ @@ -50,7 +50,7 @@ * The mock proxy object to use during test. * @type {TestSiteSettingsPrefsBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; setup(function() { browserProxy = new TestSiteSettingsPrefsBrowserProxy(); @@ -74,7 +74,7 @@ test('empty list', function() { return initPage().then(function() { - var listFrames = testElement.root.querySelectorAll('.list-frame'); + const listFrames = testElement.root.querySelectorAll('.list-frame'); assertEquals(0, listFrames.length); }); }); @@ -83,21 +83,21 @@ browserProxy.setProtocolHandlers(protocols); return initPage().then(function() { - var listFrames = testElement.root.querySelectorAll('.list-frame'); - var listItems = testElement.root.querySelectorAll('.list-item'); + const listFrames = testElement.root.querySelectorAll('.list-frame'); + const listItems = testElement.root.querySelectorAll('.list-item'); // There are two protocols: ["mailto", "webcal"]. assertEquals(2, listFrames.length); // There are three total handlers within the two protocols. assertEquals(3, listItems.length); // Check that item hosts are rendered correctly. - var hosts = testElement.root.querySelectorAll('.protocol-host'); + const hosts = testElement.root.querySelectorAll('.protocol-host'); assertEquals('www.google.com', hosts[0].textContent); assertEquals('www.google1.com', hosts[1].textContent); assertEquals('www.google2.com', hosts[2].textContent); // Check that item default subtexts are rendered correctly. - var defText = testElement.root.querySelectorAll('.protocol-default'); + const defText = testElement.root.querySelectorAll('.protocol-default'); assertFalse(defText[0].hidden); assertFalse(defText[1].hidden); assertTrue(defText[2].hidden); @@ -111,7 +111,9 @@ * @return {!Promise} */ function testButtonFlow(button, browserProxyHandler) { - var menuButtons, functionButton, dialog; + let menuButtons; + let functionButton; + let dialog; return initPage() .then(function() { @@ -136,7 +138,7 @@ assertEquals(protocols[0].protocol, args[0]); assertEquals(protocols[0].handlers[0].spec, args[1]); - var dialog = testElement.$$('dialog[is=cr-action-menu]'); + const dialog = testElement.$$('dialog[is=cr-action-menu]'); assertFalse(dialog.open); // Test the button for the second protocol handler
diff --git a/chrome/test/data/webui/settings/quick_unlock_authenticate_browsertest_chromeos.js b/chrome/test/data/webui/settings/quick_unlock_authenticate_browsertest_chromeos.js index b628d051..eff47d1 100644 --- a/chrome/test/data/webui/settings/quick_unlock_authenticate_browsertest_chromeos.js +++ b/chrome/test/data/webui/settings/quick_unlock_authenticate_browsertest_chromeos.js
@@ -3,10 +3,10 @@ // found in the LICENSE file. cr.define('settings_people_page_quick_unlock', function() { - var element = null; - var quickUnlockPrivateApi = null; - var QuickUnlockMode = chrome.quickUnlockPrivate.QuickUnlockMode; - var fakeUma = null; + let element = null; + let quickUnlockPrivateApi = null; + const QuickUnlockMode = chrome.quickUnlockPrivate.QuickUnlockMode; + let fakeUma = null; /** * Returns if the element is visible. @@ -41,7 +41,7 @@ * @return {Element} */ function getFromElement(selector) { - var childElement = element.$$(selector); + const childElement = element.$$(selector); assertTrue(!!childElement); return childElement; } @@ -57,7 +57,7 @@ function registerAuthenticateTests() { suite('authenticate', function() { - var passwordElement = null; + let passwordElement = null; setup(function() { PolymerTest.clearBody(); @@ -91,7 +91,7 @@ }); test('EnterInvalidPasswordSelectsAllText', function() { - var confirmButton = getFromElement('#passwordInput'); + const confirmButton = getFromElement('#passwordInput'); quickUnlockPrivateApi.accountPassword = 'bar'; passwordElement.value = 'foo'; MockInteractions.tap( @@ -104,7 +104,7 @@ }); test('TapConfirmButtonWithWrongPasswordRestoresFocus', function() { - var confirmButton = getFromElement('#passwordInput'); + const confirmButton = getFromElement('#passwordInput'); quickUnlockPrivateApi.accountPassword = 'bar'; passwordElement.value = 'foo'; MockInteractions.tap( @@ -164,12 +164,12 @@ function registerLockScreenTests() { suite('lock-screen', function() { - /** @const */ var ENABLE_LOCK_SCREEN_PREF = 'settings.enable_screen_lock'; + const ENABLE_LOCK_SCREEN_PREF = 'settings.enable_screen_lock'; - var fakeSettings = null; - var passwordRadioButton = null; - var pinPasswordRadioButton = null; - var noneRadioButton = null; + let fakeSettings = null; + let passwordRadioButton = null; + let pinPasswordRadioButton = null; + const noneRadioButton = null; /** * Asserts that only the given radio button is active and all of the @@ -193,7 +193,7 @@ * @return {boolean} */ function getLockScreenPref() { - var result; + let result; fakeSettings.getPref(ENABLE_LOCK_SCREEN_PREF, function(value) { result = value; }); @@ -212,7 +212,7 @@ function isSetupPinButtonVisible() { Polymer.dom.flush(); - var setupPinButton = element.$$('#setupPinButton'); + const setupPinButton = element.$$('#setupPinButton'); return isVisible(setupPinButton); } @@ -222,7 +222,7 @@ CrSettingsPrefs.deferInitialization = true; // Build pref fakes. - var fakePrefs = [{ + const fakePrefs = [{ key: ENABLE_LOCK_SCREEN_PREF, type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true @@ -230,7 +230,7 @@ fakeSettings = new settings.FakeSettingsPrivate(fakePrefs); fakeUma = new settings.FakeQuickUnlockUma(); setLockScreenPref(true); - var prefElement = document.createElement('settings-prefs'); + const prefElement = document.createElement('settings-prefs'); prefElement.initialize(fakeSettings); document.body.appendChild(prefElement); @@ -330,7 +330,7 @@ Polymer.dom.flush(); MockInteractions.tap(getFromElement('#setupPinButton')); Polymer.dom.flush(); - var setupPinDialog = getFromElement('#setupPin'); + const setupPinDialog = getFromElement('#setupPin'); assertTrue(setupPinDialog.$$('#dialog').open); assertEquals(1, fakeUma.getHistogramValue( LockScreenProgress.CHOOSE_PIN_OR_PASSWORD)); @@ -340,11 +340,11 @@ function registerSetupPinDialogTests() { suite('setup-pin-dialog', function() { - var titleDiv = null; - var problemDiv = null; - var pinKeyboard = null; - var backButton = null; - var continueButton = null; + let titleDiv = null; + let problemDiv = null; + let pinKeyboard = null; + let backButton = null; + let continueButton = null; setup(function() { PolymerTest.clearBody(); @@ -375,8 +375,8 @@ // The continue button and title change text between the setup and confirm // steps. test('TextChangesBetweenSetupAndConfirmStep', function() { - var initialContinue = continueButton.textContent; - var initialTitle = titleDiv.textContent; + const initialContinue = continueButton.textContent; + const initialTitle = titleDiv.textContent; pinKeyboard.value = '1111'; MockInteractions.tap(continueButton);
diff --git a/chrome/test/data/webui/settings/reset_page_test.js b/chrome/test/data/webui/settings/reset_page_test.js index 0fbbe8f..92a66e5b 100644 --- a/chrome/test/data/webui/settings/reset_page_test.js +++ b/chrome/test/data/webui/settings/reset_page_test.js
@@ -4,7 +4,7 @@ cr.define('settings_reset_page', function() { /** @enum {string} */ - var TestNames = { + const TestNames = { PowerwashDialogAction: 'PowerwashDialogAction', PowerwashDialogOpenClose: 'PowerwashDialogOpenClose', ResetProfileDialogAction: 'ResetProfileDialogAction', @@ -17,13 +17,13 @@ function registerDialogTests() { suite('DialogTests', function() { - var resetPage = null; + let resetPage = null; /** @type {!settings.ResetPageBrowserProxy} */ - var resetPageBrowserProxy = null; + let resetPageBrowserProxy = null; /** @type {!settings.LifetimeBrowserProxy} */ - var lifetimeBrowserProxy = null; + let lifetimeBrowserProxy = null; setup(function() { if (cr.isChromeOS) { @@ -53,11 +53,11 @@ // Open reset profile dialog. MockInteractions.tap(resetPage.$.resetProfile); Polymer.dom.flush(); - var dialog = resetPage.$$('settings-reset-profile-dialog'); + const dialog = resetPage.$$('settings-reset-profile-dialog'); assertTrue(!!dialog); assertTrue(dialog.$.dialog.open); - var whenDialogClosed = test_util.eventToPromise('close', dialog); + const whenDialogClosed = test_util.eventToPromise('close', dialog); return resetPageBrowserProxy.whenCalled('onShowResetProfileDialog') .then(function() { @@ -89,12 +89,12 @@ // Open reset profile dialog. MockInteractions.tap(resetPage.$.resetProfile); Polymer.dom.flush(); - var dialog = resetPage.$$('settings-reset-profile-dialog'); + const dialog = resetPage.$$('settings-reset-profile-dialog'); assertTrue(!!dialog); - var checkbox = dialog.$$('[slot=footer] paper-checkbox'); + const checkbox = dialog.$$('[slot=footer] paper-checkbox'); assertTrue(checkbox.checked); - var showReportedSettingsLink = dialog.$$('[slot=footer] a'); + const showReportedSettingsLink = dialog.$$('[slot=footer] a'); assertTrue(!!showReportedSettingsLink); MockInteractions.tap(showReportedSettingsLink); @@ -115,7 +115,7 @@ }); function testResetRequestOrigin(expectedOrigin) { - var dialog = resetPage.$$('settings-reset-profile-dialog'); + const dialog = resetPage.$$('settings-reset-profile-dialog'); assertTrue(!!dialog); MockInteractions.tap(dialog.$.reset); return resetPageBrowserProxy.whenCalled( @@ -155,10 +155,10 @@ // Open powerwash dialog. MockInteractions.tap(resetPage.$.powerwash); Polymer.dom.flush(); - var dialog = resetPage.$$('settings-powerwash-dialog'); + const dialog = resetPage.$$('settings-powerwash-dialog'); assertTrue(!!dialog); assertTrue(dialog.$.dialog.open); - var onDialogClosed = new Promise( + const onDialogClosed = new Promise( function(resolve, reject) { dialog.addEventListener('close', function() { assertFalse(dialog.$.dialog.open); @@ -193,7 +193,7 @@ // Open powerwash dialog. MockInteractions.tap(resetPage.$.powerwash); Polymer.dom.flush(); - var dialog = resetPage.$$('settings-powerwash-dialog'); + const dialog = resetPage.$$('settings-powerwash-dialog'); assertTrue(!!dialog); MockInteractions.tap(dialog.$.powerwash); return lifetimeBrowserProxy.whenCalled('factoryReset');
diff --git a/chrome/test/data/webui/settings/reset_profile_banner_test.js b/chrome/test/data/webui/settings/reset_profile_banner_test.js index 18f15b2..72bd327e 100644 --- a/chrome/test/data/webui/settings/reset_profile_banner_test.js +++ b/chrome/test/data/webui/settings/reset_profile_banner_test.js
@@ -3,8 +3,8 @@ // found in the LICENSE file. suite('BannerTests', function() { - var resetBanner = null; - var browserProxy = null; + let resetBanner = null; + let browserProxy = null; setup(function() { browserProxy = new reset_page.TestResetBrowserProxy();
diff --git a/chrome/test/data/webui/settings/route_tests.js b/chrome/test/data/webui/settings/route_tests.js index 466a7b7..f83ef79 100644 --- a/chrome/test/data/webui/settings/route_tests.js +++ b/chrome/test/data/webui/settings/route_tests.js
@@ -8,7 +8,7 @@ * @return {!Promise} */ function whenPopState(causeEvent) { - var promise = new Promise(function(resolve) { + const promise = new Promise(function(resolve) { window.addEventListener('popstate', function callback() { window.removeEventListener('popstate', callback); resolve(); @@ -45,15 +45,15 @@ test('tree structure', function() { // Set up root page routes. - var BASIC = new settings.Route('/'); + const BASIC = new settings.Route('/'); assertEquals(0, BASIC.depth); - var ADVANCED = new settings.Route('/advanced'); + const ADVANCED = new settings.Route('/advanced'); assertFalse(ADVANCED.isSubpage()); assertEquals(0, ADVANCED.depth); // Test a section route. - var PRIVACY = ADVANCED.createSection('/privacy', 'privacy'); + const PRIVACY = ADVANCED.createSection('/privacy', 'privacy'); assertEquals(ADVANCED, PRIVACY.parent); assertEquals(1, PRIVACY.depth); assertFalse(PRIVACY.isSubpage()); @@ -63,7 +63,7 @@ assertFalse(PRIVACY.contains(ADVANCED)); // Test a subpage route. - var SITE_SETTINGS = PRIVACY.createChild('/siteSettings'); + const SITE_SETTINGS = PRIVACY.createChild('/siteSettings'); assertEquals('/siteSettings', SITE_SETTINGS.path); assertEquals(PRIVACY, SITE_SETTINGS.parent); assertEquals(2, SITE_SETTINGS.depth); @@ -75,20 +75,20 @@ assertTrue(PRIVACY.contains(SITE_SETTINGS)); // Test a sub-subpage route. - var SITE_SETTINGS_ALL = SITE_SETTINGS.createChild('all'); + const SITE_SETTINGS_ALL = SITE_SETTINGS.createChild('all'); assertEquals('/siteSettings/all', SITE_SETTINGS_ALL.path); assertEquals(SITE_SETTINGS, SITE_SETTINGS_ALL.parent); assertEquals(3, SITE_SETTINGS_ALL.depth); assertTrue(SITE_SETTINGS_ALL.isSubpage()); // Test a non-subpage child of ADVANCED. - var CLEAR_BROWSER_DATA = ADVANCED.createChild('/clearBrowserData'); + const CLEAR_BROWSER_DATA = ADVANCED.createChild('/clearBrowserData'); assertFalse(CLEAR_BROWSER_DATA.isSubpage()); assertEquals('', CLEAR_BROWSER_DATA.section); }); test('no duplicate routes', function() { - var paths = new Set(); + const paths = new Set(); Object.values(settings.routes).forEach(function(route) { assertFalse(paths.has(route.path), route.path); paths.add(route.path); @@ -127,7 +127,7 @@ }); test('navigateTo respects removeSearch optional parameter', function() { - var params = new URLSearchParams('search=foo'); + const params = new URLSearchParams('search=foo'); settings.navigateTo(settings.routes.BASIC, params); assertEquals(params.toString(), settings.getQueryParameters().toString()); @@ -215,8 +215,8 @@ reset: false, }; - var router = new settings.Router(); - var hasRoute = route => router.getRoutes().hasOwnProperty(route); + const router = new settings.Router(); + const hasRoute = route => router.getRoutes().hasOwnProperty(route); assertTrue(hasRoute('BASIC'));
diff --git a/chrome/test/data/webui/settings/search_engines_page_test.js b/chrome/test/data/webui/settings/search_engines_page_test.js index 1ebb637..a0fc6a7 100644 --- a/chrome/test/data/webui/settings/search_engines_page_test.js +++ b/chrome/test/data/webui/settings/search_engines_page_test.js
@@ -53,8 +53,8 @@ function registerDialogTests() { suite('AddSearchEngineDialogTests', function() { /** @type {?SettingsAddSearchEngineDialog} */ - var dialog = null; - var browserProxy = null; + let dialog = null; + let browserProxy = null; setup(function() { browserProxy = new settings_search.TestSearchEnginesBrowserProxy(); @@ -99,8 +99,8 @@ * @param {string} inputId * @return {!Promise} */ - var inputAndValidate = function(inputId) { - var inputElement = dialog.$[inputId]; + const inputAndValidate = function(inputId) { + const inputElement = dialog.$[inputId]; browserProxy.resetResolver('validateSearchEngineInput'); inputElement.fire('input'); return inputElement.value != '' ? @@ -112,7 +112,7 @@ assertEquals('', dialog.$.searchEngine.value); assertEquals('', dialog.$.keyword.value); assertEquals('', dialog.$.queryUrl.value); - var actionButton = dialog.$.actionButton; + const actionButton = dialog.$.actionButton; assertTrue(actionButton.disabled); return inputAndValidate('searchEngine').then(function() { @@ -141,13 +141,13 @@ function registerSearchEngineEntryTests() { suite('SearchEngineEntryTests', function() { /** @type {?SettingsSearchEngineEntryElement} */ - var entry = null; + let entry = null; /** @type {!settings_search.TestSearchEnginesBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** @type {!SearchEngine} */ - var searchEngine = createSampleSearchEngine('G', true, true, true); + const searchEngine = createSampleSearchEngine('G', true, true, true); setup(function() { browserProxy = new settings_search.TestSearchEnginesBrowserProxy(); @@ -177,10 +177,10 @@ test('Remove_Enabled', function() { // Open action menu. MockInteractions.tap(entry.$$('button')); - var menu = entry.$$('dialog[is=cr-action-menu]'); + const menu = entry.$$('dialog[is=cr-action-menu]'); assertTrue(menu.open); - var deleteButton = entry.$.delete; + const deleteButton = entry.$.delete; assertTrue(!!deleteButton); assertFalse(deleteButton.hidden); MockInteractions.tap(deleteButton); @@ -194,10 +194,10 @@ test('MakeDefault_Enabled', function() { // Open action menu. MockInteractions.tap(entry.$$('button')); - var menu = entry.$$('dialog[is=cr-action-menu]'); + const menu = entry.$$('dialog[is=cr-action-menu]'); assertTrue(menu.open); - var makeDefaultButton = entry.$.makeDefault; + const makeDefaultButton = entry.$.makeDefault; assertTrue(!!makeDefaultButton); MockInteractions.tap(makeDefaultButton); return browserProxy.whenCalled('setDefaultSearchEngine').then( @@ -211,18 +211,18 @@ test('Edit_Enabled', function() { // Open action menu. MockInteractions.tap(entry.$$('button')); - var menu = entry.$$('dialog[is=cr-action-menu]'); + const menu = entry.$$('dialog[is=cr-action-menu]'); assertTrue(menu.open); - var engine = entry.engine; - var editButton = entry.$.edit; + const engine = entry.engine; + const editButton = entry.$.edit; assertTrue(!!editButton); assertFalse(editButton.hidden); MockInteractions.tap(editButton); return browserProxy.whenCalled('searchEngineEditStarted').then( function(modelIndex) { assertEquals(engine.modelIndex, modelIndex); - var dialog = entry.$$('settings-search-engine-dialog'); + const dialog = entry.$$('settings-search-engine-dialog'); assertTrue(!!dialog); // Check that the paper-input fields are pre-populated. @@ -242,7 +242,7 @@ */ function testButtonDisabled(searchEngine, buttonId) { entry.engine = searchEngine; - var button = entry.$[buttonId]; + const button = entry.$[buttonId]; assertTrue(!!button); assertTrue(button.hidden); } @@ -277,12 +277,12 @@ function registerPageTests() { suite('SearchEnginePageTests', function() { /** @type {?SettingsSearchEnginesPageElement} */ - var page = null; + let page = null; - var browserProxy = null; + let browserProxy = null; /** @type {!SearchEnginesInfo} */ - var searchEnginesInfo = { + const searchEnginesInfo = { defaults: [createSampleSearchEngine( 'search_engine_G', false, false, false)], others: [ @@ -314,21 +314,21 @@ // Tests that the page is querying and displaying search engine info on // startup. test('Initialization', function() { - var searchEnginesLists = page.shadowRoot. + const searchEnginesLists = page.shadowRoot. querySelectorAll('settings-search-engines-list'); assertEquals(2, searchEnginesLists.length); // Note: iron-list may create hidden children, so test the length // if IronList.items instead of the child nodes. Polymer.dom.flush(); - var defaultsList = searchEnginesLists[0]; - var defaultsEntries = Polymer.dom(defaultsList.shadowRoot). + const defaultsList = searchEnginesLists[0]; + const defaultsEntries = Polymer.dom(defaultsList.shadowRoot). querySelector('iron-list').items; assertEquals( searchEnginesInfo.defaults.length, defaultsEntries.length); - var othersList = searchEnginesLists[1]; - var othersEntries = Polymer.dom(othersList.shadowRoot). + const othersList = searchEnginesLists[1]; + const othersEntries = Polymer.dom(othersList.shadowRoot). querySelector('iron-list').items; assertEquals( searchEnginesInfo.others.length, othersEntries.length); @@ -342,7 +342,7 @@ assertEquals(searchEnginesInfo.others[1].name, othersEntries[0].name); assertEquals(searchEnginesInfo.others[0].name, othersEntries[1].name); - var extensionEntries = Polymer.dom(page.shadowRoot). + const extensionEntries = Polymer.dom(page.shadowRoot). querySelector('iron-list').items; assertEquals( searchEnginesInfo.extensions.length, extensionEntries.length); @@ -355,7 +355,7 @@ defaults: [], others: [], extensions: [], }); - var message = page.root.querySelector('#noOtherEngines'); + const message = page.root.querySelector('#noOtherEngines'); assertTrue(!!message); assertFalse(message.hasAttribute('hidden')); @@ -371,7 +371,7 @@ // button is tapped. test('AddSearchEngineDialog', function() { assertFalse(!!page.$$('settings-search-engine-dialog')); - var addSearchEngineButton = page.$.addSearchEngine; + const addSearchEngineButton = page.$.addSearchEngine; assertTrue(!!addSearchEngineButton); MockInteractions.tap(addSearchEngineButton); @@ -385,7 +385,7 @@ Polymer.dom.flush(); function getListItems(listIndex) { - var ironList = listIndex == 2 /* extensions */ ? + const ironList = listIndex == 2 /* extensions */ ? page.shadowRoot.querySelector('iron-list') : page.shadowRoot.querySelectorAll( 'settings-search-engines-list')[listIndex].shadowRoot. @@ -403,7 +403,7 @@ assertEquals(othersCount, getListItems(1).length); assertEquals(extensionsCount, getListItems(2).length); - var noResultsElements = Array.from( + const noResultsElements = Array.from( page.shadowRoot.querySelectorAll('.no-search-results')); assertEquals(defaultsCount > 0, noResultsElements[0].hidden); assertEquals(othersCount > 0, noResultsElements[1].hidden); @@ -448,9 +448,9 @@ function registerOmniboxExtensionEntryTests() { suite('OmniboxExtensionEntryTests', function() { /** @type {?SettingsOmniboxExtensionEntryElement} */ - var entry = null; + let entry = null; - var browserProxy = null; + let browserProxy = null; setup(function() { browserProxy = new TestExtensionControlBrowserProxy(); @@ -467,7 +467,7 @@ teardown(function() { entry.remove(); }); test('Manage', function() { - var manageButton = entry.$.manage; + const manageButton = entry.$.manage; assertTrue(!!manageButton); MockInteractions.tap(manageButton); return browserProxy.whenCalled('manageExtension').then( @@ -477,7 +477,7 @@ }); test('Disable', function() { - var disableButton = entry.$.disable; + const disableButton = entry.$.disable; assertTrue(!!disableButton); MockInteractions.tap(disableButton); return browserProxy.whenCalled('disableExtension').then(
diff --git a/chrome/test/data/webui/settings/search_page_test.js b/chrome/test/data/webui/settings/search_page_test.js index 875f6ae..9464fd8 100644 --- a/chrome/test/data/webui/settings/search_page_test.js +++ b/chrome/test/data/webui/settings/search_page_test.js
@@ -4,13 +4,13 @@ cr.define('settings_search_page', function() { function generateSearchEngineInfo() { - var searchEngines0 = settings_search.createSampleSearchEngine( + const searchEngines0 = settings_search.createSampleSearchEngine( true, false, false); searchEngines0.default = true; - var searchEngines1 = settings_search.createSampleSearchEngine( + const searchEngines1 = settings_search.createSampleSearchEngine( true, false, false); searchEngines1.default = false; - var searchEngines2 = settings_search.createSampleSearchEngine( + const searchEngines2 = settings_search.createSampleSearchEngine( true, false, false); searchEngines2.default = false; @@ -23,9 +23,9 @@ suite('SearchPageTests', function() { /** @type {?SettingsSearchPageElement} */ - var page = null; + let page = null; - var browserProxy = null; + let browserProxy = null; setup(function() { browserProxy = new settings_search.TestSearchEnginesBrowserProxy(); @@ -46,7 +46,7 @@ // Tests that the page is querying and displaying search engine info on // startup. test('Initialization', function() { - var selectElement = page.$$('select'); + const selectElement = page.$$('select'); return browserProxy.whenCalled('getSearchEnginesList').then(function() { Polymer.dom.flush(); @@ -60,7 +60,7 @@ assertEquals(1, selectElement.selectedIndex); // Simulate a change that happened in a different tab. - var searchEnginesInfo = generateSearchEngineInfo(); + const searchEnginesInfo = generateSearchEngineInfo(); searchEnginesInfo.defaults[0].default = false; searchEnginesInfo.defaults[1].default = false; searchEnginesInfo.defaults[2].default = true; @@ -80,7 +80,7 @@ test('ControlledByExtension', function() { return browserProxy.whenCalled('getSearchEnginesList').then(function() { - var selectElement = page.$$('select'); + const selectElement = page.$$('select'); assertFalse(selectElement.disabled); assertFalse(!!page.$$('extension-controlled-indicator')); @@ -102,7 +102,7 @@ test('ControlledByPolicy', function() { return browserProxy.whenCalled('getSearchEnginesList').then(function() { - var selectElement = page.$$('select'); + const selectElement = page.$$('select'); assertFalse(selectElement.disabled); assertFalse(!!page.$$('extension-controlled-indicator'));
diff --git a/chrome/test/data/webui/settings/search_settings_test.js b/chrome/test/data/webui/settings/search_settings_test.js index 16f9155..6dd6f14 100644 --- a/chrome/test/data/webui/settings/search_settings_test.js +++ b/chrome/test/data/webui/settings/search_settings_test.js
@@ -5,7 +5,7 @@ cr.define('settings_test', function() { suite('SearchSettingsTest', function() { - var searchManager; + let searchManager; // Don't import script if already imported (happens in Vulcanized mode). suiteSetup(function() { @@ -24,29 +24,29 @@ * occurs within that node. */ test('normal highlighting', function() { - var optionText = 'FooSettingsFoo'; + const optionText = 'FooSettingsFoo'; document.body.innerHTML = `<settings-section hidden-by-search> <div id="mydiv">${optionText}</div> </settings-section>`; - var section = document.querySelector('settings-section'); - var div = document.querySelector('#mydiv'); + const section = document.querySelector('settings-section'); + const div = document.querySelector('#mydiv'); assertTrue(section.hiddenBySearch); return searchManager.search('settings', section).then(function() { assertFalse(section.hiddenBySearch); - var highlightWrapper = div.querySelector('.search-highlight-wrapper'); + const highlightWrapper = div.querySelector('.search-highlight-wrapper'); assertTrue(!!highlightWrapper); - var originalContent = highlightWrapper.querySelector( + const originalContent = highlightWrapper.querySelector( '.search-highlight-original-content'); assertTrue(!!originalContent); assertEquals(optionText, originalContent.textContent); - var searchHits = highlightWrapper.querySelectorAll( + const searchHits = highlightWrapper.querySelectorAll( '.search-highlight-hit'); assertEquals(1, searchHits.length); assertEquals('Settings', searchHits[0].textContent); @@ -75,14 +75,14 @@ </select> </settings-section>`; - var section = document.querySelector('settings-section'); - var select = section.querySelector('select'); + const section = document.querySelector('settings-section'); + const select = section.querySelector('select'); assertTrue(section.hiddenBySearch); return searchManager.search('settings', section).then(function() { assertFalse(section.hiddenBySearch); - var highlightWrapper = select.querySelector( + const highlightWrapper = select.querySelector( '.search-highlight-wrapper'); assertFalse(!!highlightWrapper); @@ -90,7 +90,7 @@ // highlights are cleared. return searchManager.search('', section); }).then(function() { - var options = select.querySelectorAll('option'); + const options = select.querySelectorAll('option'); assertEquals(3, options.length); assertEquals('Foo', options[0].textContent); assertEquals('Settings', options[1].textContent); @@ -99,7 +99,7 @@ }); test('ignored elements are ignored', function() { - var text = 'hello'; + const text = 'hello'; document.body.innerHTML = `<settings-section hidden-by-search> <cr-events>${text}</cr-events> @@ -114,7 +114,7 @@ <template>${text}</template> </settings-section>`; - var section = document.querySelector('settings-section'); + const section = document.querySelector('settings-section'); assertTrue(section.hiddenBySearch); return searchManager.search(text, section).then(function() { @@ -136,7 +136,7 @@ <div><span>Nothing</span></div> </settings-section>`; - var sections = Array.prototype.slice.call( + const sections = Array.prototype.slice.call( document.querySelectorAll('settings-section')); return Promise.all(sections.map(s => searchManager.search('there', s)))
diff --git a/chrome/test/data/webui/settings/settings_animated_pages_test.js b/chrome/test/data/webui/settings/settings_animated_pages_test.js index f792934..92aebe2c 100644 --- a/chrome/test/data/webui/settings/settings_animated_pages_test.js +++ b/chrome/test/data/webui/settings/settings_animated_pages_test.js
@@ -15,12 +15,13 @@ </neon-animatable> </settings-animated-pages>`; - var animatedPages = document.body.querySelector('settings-animated-pages'); + const animatedPages = + document.body.querySelector('settings-animated-pages'); animatedPages.focusConfig = new Map(); animatedPages.focusConfig.set( settings.routes.SEARCH_ENGINES.path, '#subpage-trigger'); - var trigger = document.body.querySelector('#subpage-trigger'); + const trigger = document.body.querySelector('#subpage-trigger'); assertTrue(!!trigger); trigger.addEventListener('focus', function() { done(); });
diff --git a/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js b/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js index 9b2ee5b..3757702 100644 --- a/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js +++ b/chrome/test/data/webui/settings/settings_autofill_section_browsertest.js
@@ -5,7 +5,7 @@ /** @fileoverview Runs the Polymer Autofill Settings tests. */ /** @const {string} Path to root from chrome/test/data/webui/settings/. */ -var ROOT_PATH = '../../../../../'; +const ROOT_PATH = '../../../../../'; // Polymer BrowserTest fixture. GEN_INCLUDE([ @@ -48,10 +48,10 @@ */ function asyncForEach(items, loopBody) { return new Promise(function(resolve) { - var index = 0; + let index = 0; function loop() { - var item = items[index++]; + const item = items[index++]; if (item) loopBody(item).then(loop); else @@ -73,7 +73,7 @@ */ function expectEvent(element, eventName, causeEvent) { return new Promise(function(resolve) { - var callback = function() { + const callback = function() { element.removeEventListener(eventName, callback); resolve.apply(this, arguments); }; @@ -127,7 +127,7 @@ this.autofillManager.data.creditCards = creditCards; AutofillManagerImpl.instance_ = this.autofillManager; - var section = document.createElement('settings-autofill-section'); + const section = document.createElement('settings-autofill-section'); section.prefs = {autofill: {credit_card_enabled: pref_value}}; document.body.appendChild(section); Polymer.dom.flush(); @@ -143,7 +143,7 @@ */ createAddressDialog_: function(address) { return new Promise(function(resolve) { - var section = document.createElement('settings-address-edit-dialog'); + const section = document.createElement('settings-address-edit-dialog'); section.address = address; document.body.appendChild(section); section.addEventListener('on-update-address-wrapper', function() { @@ -158,7 +158,7 @@ * @return {!Object} */ createCreditCardDialog_: function(creditCardItem) { - var section = document.createElement('settings-credit-card-edit-dialog'); + const section = document.createElement('settings-credit-card-edit-dialog'); section.creditCard = creditCardItem; document.body.appendChild(section); Polymer.dom.flush(); @@ -170,7 +170,7 @@ suite('AutofillSection', function() { test('testAutofillExtensionIndicator', function() { // Initializing with fake prefs - var section = document.createElement('settings-autofill-section'); + const section = document.createElement('settings-autofill-section'); section.prefs = {autofill: {enabled: {}, credit_card_enabled: {}}}; document.body.appendChild(section); @@ -186,7 +186,7 @@ }); TEST_F('SettingsAutofillSectionBrowserTest', 'CreditCardTests', function() { - var self = this; + const self = this; suite('AutofillSection', function() { suiteSetup(function() { @@ -199,9 +199,9 @@ }); test('verifyCreditCardCount', function() { - var section = self.createAutofillSection_([], [], {}); + const section = self.createAutofillSection_([], [], {}); - var creditCardList = section.$$('#creditCardList'); + const creditCardList = section.$$('#creditCardList'); assertTrue(!!creditCardList); assertEquals(0, creditCardList.querySelectorAll('.list-item').length); @@ -211,14 +211,14 @@ }); test('verifyCreditCardsDisabled', function() { - var section = self.createAutofillSection_([], [], {value: false}); + const section = self.createAutofillSection_([], [], {value: false}); assertEquals(0, section.querySelectorAll('#creditCardList').length); assertFalse(section.$$('#CreditCardsDisabledLabel').hidden); }); test('verifyCreditCardCount', function() { - var creditCards = [ + const creditCards = [ FakeDataMaker.creditCardEntry(), FakeDataMaker.creditCardEntry(), FakeDataMaker.creditCardEntry(), @@ -227,8 +227,8 @@ FakeDataMaker.creditCardEntry(), ]; - var section = self.createAutofillSection_([], creditCards, {}); - var creditCardList = section.$$('#creditCardList'); + const section = self.createAutofillSection_([], creditCards, {}); + const creditCardList = section.$$('#creditCardList'); assertTrue(!!creditCardList); assertEquals(creditCards.length, creditCardList.querySelectorAll('.list-item').length); @@ -239,10 +239,10 @@ }); test('verifyCreditCardFields', function() { - var creditCard = FakeDataMaker.creditCardEntry(); - var section = self.createAutofillSection_([], [creditCard], {}); - var creditCardList = section.$$('#creditCardList'); - var row = creditCardList.children[0]; + const creditCard = FakeDataMaker.creditCardEntry(); + const section = self.createAutofillSection_([], [creditCard], {}); + const creditCardList = section.$$('#creditCardList'); + const row = creditCardList.children[0]; assertTrue(!!row); assertEquals(creditCard.metadata.summaryLabel, @@ -252,36 +252,36 @@ }); test('verifyCreditCardRowButtonIsDropdownWhenLocal', function() { - var creditCard = FakeDataMaker.creditCardEntry(); + const creditCard = FakeDataMaker.creditCardEntry(); creditCard.metadata.isLocal = true; - var section = self.createAutofillSection_([], [creditCard], {}); - var creditCardList = section.$$('#creditCardList'); - var row = creditCardList.children[0]; + const section = self.createAutofillSection_([], [creditCard], {}); + const creditCardList = section.$$('#creditCardList'); + const row = creditCardList.children[0]; assertTrue(!!row); - var menuButton = row.querySelector('#creditCardMenu'); + const menuButton = row.querySelector('#creditCardMenu'); assertTrue(!!menuButton); - var outlinkButton = row.querySelector('button.icon-external'); + const outlinkButton = row.querySelector('button.icon-external'); assertFalse(!!outlinkButton); }); test('verifyCreditCardRowButtonIsOutlinkWhenRemote', function() { - var creditCard = FakeDataMaker.creditCardEntry(); + const creditCard = FakeDataMaker.creditCardEntry(); creditCard.metadata.isLocal = false; - var section = self.createAutofillSection_([], [creditCard], {}); - var creditCardList = section.$$('#creditCardList'); - var row = creditCardList.children[0]; + const section = self.createAutofillSection_([], [creditCard], {}); + const creditCardList = section.$$('#creditCardList'); + const row = creditCardList.children[0]; assertTrue(!!row); - var menuButton = row.querySelector('#creditCardMenu'); + const menuButton = row.querySelector('#creditCardMenu'); assertFalse(!!menuButton); - var outlinkButton = row.querySelector('button.icon-external'); + const outlinkButton = row.querySelector('button.icon-external'); assertTrue(!!outlinkButton); }); test('verifyAddVsEditCreditCardTitle', function() { - var newCreditCard = FakeDataMaker.emptyCreditCardEntry(); - var newCreditCardDialog = self.createCreditCardDialog_(newCreditCard); - var oldCreditCard = FakeDataMaker.creditCardEntry(); - var oldCreditCardDialog = self.createCreditCardDialog_(oldCreditCard); + const newCreditCard = FakeDataMaker.emptyCreditCardEntry(); + const newCreditCardDialog = self.createCreditCardDialog_(newCreditCard); + const oldCreditCard = FakeDataMaker.creditCardEntry(); + const oldCreditCardDialog = self.createCreditCardDialog_(oldCreditCard); assertNotEquals(oldCreditCardDialog.title_, newCreditCardDialog.title_); assertNotEquals('', newCreditCardDialog.title_); @@ -295,19 +295,19 @@ }); test('verifyExpiredCreditCardYear', function() { - var creditCard = FakeDataMaker.creditCardEntry(); + const creditCard = FakeDataMaker.creditCardEntry(); // 2015 is over unless time goes wobbly. - var twentyFifteen = 2015; + const twentyFifteen = 2015; creditCard.expirationYear = twentyFifteen.toString(); - var creditCardDialog = self.createCreditCardDialog_(creditCard); + const creditCardDialog = self.createCreditCardDialog_(creditCard); return test_util.whenAttributeIs( creditCardDialog.$.dialog, 'open', '').then(function() { - var now = new Date(); - var maxYear = now.getFullYear() + 9; - var yearOptions = creditCardDialog.$.year.options; + const now = new Date(); + const maxYear = now.getFullYear() + 9; + const yearOptions = creditCardDialog.$.year.options; assertEquals('2015', yearOptions[0].textContent.trim()); assertEquals( @@ -319,18 +319,18 @@ }); test('verifyVeryFutureCreditCardYear', function() { - var creditCard = FakeDataMaker.creditCardEntry(); + const creditCard = FakeDataMaker.creditCardEntry(); // Expiring 20 years from now is unusual. - var now = new Date(); - var farFutureYear = now.getFullYear() + 20; + const now = new Date(); + const farFutureYear = now.getFullYear() + 20; creditCard.expirationYear = farFutureYear.toString(); - var creditCardDialog = self.createCreditCardDialog_(creditCard); + const creditCardDialog = self.createCreditCardDialog_(creditCard); return test_util.whenAttributeIs( creditCardDialog.$.dialog, 'open', '').then(function() { - var yearOptions = creditCardDialog.$.year.options; + const yearOptions = creditCardDialog.$.year.options; assertEquals( now.getFullYear().toString(), @@ -344,19 +344,19 @@ }); test('verifyVeryNormalCreditCardYear', function() { - var creditCard = FakeDataMaker.creditCardEntry(); + const creditCard = FakeDataMaker.creditCardEntry(); // Expiring 2 years from now is not unusual. - var now = new Date(); - var nearFutureYear = now.getFullYear() + 2; + const now = new Date(); + const nearFutureYear = now.getFullYear() + 2; creditCard.expirationYear = nearFutureYear.toString(); - var maxYear = now.getFullYear() + 9; + const maxYear = now.getFullYear() + 9; - var creditCardDialog = self.createCreditCardDialog_(creditCard); + const creditCardDialog = self.createCreditCardDialog_(creditCard); return test_util.whenAttributeIs( creditCardDialog.$.dialog, 'open', '').then(function() { - var yearOptions = creditCardDialog.$.year.options; + const yearOptions = creditCardDialog.$.year.options; assertEquals( now.getFullYear().toString(), @@ -370,14 +370,14 @@ }); test('verify save disabled for expired credit card', function() { - var creditCard = FakeDataMaker.emptyCreditCardEntry(); + const creditCard = FakeDataMaker.emptyCreditCardEntry(); - var now = new Date(); + const now = new Date(); creditCard.expirationYear = now.getFullYear() - 2; // works fine for January. creditCard.expirationMonth = now.getMonth() - 1; - var creditCardDialog = self.createCreditCardDialog_(creditCard); + const creditCardDialog = self.createCreditCardDialog_(creditCard); return test_util.whenAttributeIs( creditCardDialog.$.dialog, 'open', '').then(function() { @@ -387,8 +387,8 @@ // Test will timeout if event is not received. test('verify save new credit card', function(done) { - var creditCard = FakeDataMaker.emptyCreditCardEntry(); - var creditCardDialog = self.createCreditCardDialog_(creditCard); + const creditCard = FakeDataMaker.emptyCreditCardEntry(); + const creditCardDialog = self.createCreditCardDialog_(creditCard); return test_util.whenAttributeIs( creditCardDialog.$.dialog, 'open', '').then(function() { @@ -413,8 +413,8 @@ }); test('verifyCancelCreditCardEdit', function(done) { - var creditCard = FakeDataMaker.emptyCreditCardEntry(); - var creditCardDialog = self.createCreditCardDialog_(creditCard); + const creditCard = FakeDataMaker.emptyCreditCardEntry(); + const creditCardDialog = self.createCreditCardDialog_(creditCard); return test_util.whenAttributeIs( creditCardDialog.$.dialog, 'open', '').then(function() { @@ -436,27 +436,27 @@ }); test('verifyLocalCreditCardMenu', function() { - var creditCard = FakeDataMaker.creditCardEntry(); + const creditCard = FakeDataMaker.creditCardEntry(); // When credit card is local, |isCached| will be undefined. creditCard.metadata.isLocal = true; creditCard.metadata.isCached = undefined; - var section = self.createAutofillSection_([], [creditCard], {}); - var creditCardList = section.$$('#creditCardList'); + const section = self.createAutofillSection_([], [creditCard], {}); + const creditCardList = section.$$('#creditCardList'); assertTrue(!!creditCardList); assertEquals(1, creditCardList.querySelectorAll('.list-item').length); - var row = creditCardList.children[0]; + const row = creditCardList.children[0]; // Local credit cards will show the overflow menu. assertFalse(!!row.querySelector('#remoteCreditCardLink')); - var menuButton = row.querySelector('#creditCardMenu'); + const menuButton = row.querySelector('#creditCardMenu'); assertTrue(!!menuButton); menuButton.click(); Polymer.dom.flush(); - var menu = section.$.creditCardSharedMenu; + const menu = section.$.creditCardSharedMenu; // Menu should have 2 options. assertFalse(menu.querySelector('#menuEditCreditCard').hidden); @@ -468,26 +468,26 @@ }); test('verifyCachedCreditCardMenu', function() { - var creditCard = FakeDataMaker.creditCardEntry(); + const creditCard = FakeDataMaker.creditCardEntry(); creditCard.metadata.isLocal = false; creditCard.metadata.isCached = true; - var section = self.createAutofillSection_([], [creditCard], {}); - var creditCardList = section.$$('#creditCardList'); + const section = self.createAutofillSection_([], [creditCard], {}); + const creditCardList = section.$$('#creditCardList'); assertTrue(!!creditCardList); assertEquals(1, creditCardList.querySelectorAll('.list-item').length); - var row = creditCardList.children[0]; + const row = creditCardList.children[0]; // Cached remote CCs will show overflow menu. assertFalse(!!row.querySelector('#remoteCreditCardLink')); - var menuButton = row.querySelector('#creditCardMenu'); + const menuButton = row.querySelector('#creditCardMenu'); assertTrue(!!menuButton); menuButton.click(); Polymer.dom.flush(); - var menu = section.$.creditCardSharedMenu; + const menu = section.$.creditCardSharedMenu; // Menu should have 2 options. assertFalse(menu.querySelector('#menuEditCreditCard').hidden); @@ -499,16 +499,16 @@ }); test('verifyNotCachedCreditCardMenu', function() { - var creditCard = FakeDataMaker.creditCardEntry(); + const creditCard = FakeDataMaker.creditCardEntry(); creditCard.metadata.isLocal = false; creditCard.metadata.isCached = false; - var section = self.createAutofillSection_([], [creditCard], {}); - var creditCardList = section.$$('#creditCardList'); + const section = self.createAutofillSection_([], [creditCard], {}); + const creditCardList = section.$$('#creditCardList'); assertTrue(!!creditCardList); assertEquals(1, creditCardList.querySelectorAll('.list-item').length); - var row = creditCardList.children[0]; + const row = creditCardList.children[0]; // No overflow menu when not cached. assertTrue(!!row.querySelector('#remoteCreditCardLink')); @@ -520,7 +520,7 @@ }); TEST_F('SettingsAutofillSectionBrowserTest', 'AddressTests', function() { - var self = this; + const self = this; suite('AutofillSection', function() { @@ -534,9 +534,9 @@ }); test('verifyNoAddresses', function() { - var section = self.createAutofillSection_([], [], {}); + const section = self.createAutofillSection_([], [], {}); - var addressList = section.$.addressList; + const addressList = section.$.addressList; assertTrue(!!addressList); // 1 for the template element. assertEquals(1, addressList.children.length); @@ -545,7 +545,7 @@ }); test('verifyAddressCount', function() { - var addresses = [ + const addresses = [ FakeDataMaker.addressEntry(), FakeDataMaker.addressEntry(), FakeDataMaker.addressEntry(), @@ -553,9 +553,9 @@ FakeDataMaker.addressEntry(), ]; - var section = self.createAutofillSection_(addresses, [], {}); + const section = self.createAutofillSection_(addresses, [], {}); - var addressList = section.$.addressList; + const addressList = section.$.addressList; assertTrue(!!addressList); assertEquals(addresses.length, addressList.querySelectorAll('.list-item').length); @@ -564,20 +564,20 @@ }); test('verifyAddressFields', function() { - var address = FakeDataMaker.addressEntry(); - var section = self.createAutofillSection_([address], [], {}); - var addressList = section.$.addressList; - var row = addressList.children[0]; + const address = FakeDataMaker.addressEntry(); + const section = self.createAutofillSection_([address], [], {}); + const addressList = section.$.addressList; + const row = addressList.children[0]; assertTrue(!!row); - var addressSummary = address.metadata.summaryLabel + + const addressSummary = address.metadata.summaryLabel + address.metadata.summarySublabel; - var actualSummary = ''; + let actualSummary = ''; // Eliminate white space between nodes! - var addressPieces = row.querySelector('#addressSummary').children; - for (var i = 0; i < addressPieces.length; ++i) { + const addressPieces = row.querySelector('#addressSummary').children; + for (let i = 0; i < addressPieces.length; ++i) { actualSummary += addressPieces[i].textContent.trim(); } @@ -585,35 +585,35 @@ }); test('verifyAddressRowButtonIsDropdownWhenLocal', function() { - var address = FakeDataMaker.addressEntry(); + const address = FakeDataMaker.addressEntry(); address.metadata.isLocal = true; - var section = self.createAutofillSection_([address], [], {}); - var addressList = section.$.addressList; - var row = addressList.children[0]; + const section = self.createAutofillSection_([address], [], {}); + const addressList = section.$.addressList; + const row = addressList.children[0]; assertTrue(!!row); - var menuButton = row.querySelector('#addressMenu'); + const menuButton = row.querySelector('#addressMenu'); assertTrue(!!menuButton); - var outlinkButton = row.querySelector('button.icon-external'); + const outlinkButton = row.querySelector('button.icon-external'); assertFalse(!!outlinkButton); }); test('verifyAddressRowButtonIsOutlinkWhenRemote', function() { - var address = FakeDataMaker.addressEntry(); + const address = FakeDataMaker.addressEntry(); address.metadata.isLocal = false; - var section = self.createAutofillSection_([address], [], {}); - var addressList = section.$.addressList; - var row = addressList.children[0]; + const section = self.createAutofillSection_([address], [], {}); + const addressList = section.$.addressList; + const row = addressList.children[0]; assertTrue(!!row); - var menuButton = row.querySelector('#addressMenu'); + const menuButton = row.querySelector('#addressMenu'); assertFalse(!!menuButton); - var outlinkButton = row.querySelector('button.icon-external'); + const outlinkButton = row.querySelector('button.icon-external'); assertTrue(!!outlinkButton); }); test('verifyAddAddressDialog', function() { return self.createAddressDialog_(FakeDataMaker.emptyAddressEntry()) .then(function(dialog) { - var title = dialog.$$('[slot=title]'); + const title = dialog.$$('[slot=title]'); assertEquals( loadTimeData.getString('addAddressTitle'), title.textContent); // Shouldn't be possible to save until something is typed in. @@ -624,7 +624,7 @@ test('verifyEditAddressDialog', function() { return self.createAddressDialog_(FakeDataMaker.addressEntry()) .then(function(dialog) { - var title = dialog.$$('[slot=title]'); + const title = dialog.$$('[slot=title]'); assertEquals( loadTimeData.getString('editAddressTitle'), title.textContent); // Should be possible to save when editing because fields are @@ -634,9 +634,9 @@ }); test('verifyCountryIsSaved', function() { - var address = FakeDataMaker.emptyAddressEntry(); + const address = FakeDataMaker.emptyAddressEntry(); return self.createAddressDialog_(address).then(function(dialog) { - var countrySelect = dialog.$$('select'); + const countrySelect = dialog.$$('select'); assertEquals('', countrySelect.value); assertEquals(undefined, address.countryCode); countrySelect.value = 'US'; @@ -648,7 +648,7 @@ }); test('verifyPhoneAndEmailAreSaved', function() { - var address = FakeDataMaker.emptyAddressEntry(); + const address = FakeDataMaker.emptyAddressEntry(); return self.createAddressDialog_(address).then(function(dialog) { assertEquals('', dialog.$.phoneInput.value); assertFalse(!!(address.phoneNumbers && address.phoneNumbers[0])); @@ -656,8 +656,8 @@ assertEquals('', dialog.$.emailInput.value); assertFalse(!!(address.emailAddresses && address.emailAddresses[0])); - var phoneNumber = '(555) 555-5555'; - var emailAddress = 'no-reply@chromium.org'; + const phoneNumber = '(555) 555-5555'; + const emailAddress = 'no-reply@chromium.org'; dialog.$.phoneInput.value = phoneNumber; dialog.$.emailInput.value = emailAddress; @@ -675,10 +675,10 @@ }); test('verifyPhoneAndEmailAreRemoved', function() { - var address = FakeDataMaker.emptyAddressEntry(); + const address = FakeDataMaker.emptyAddressEntry(); - var phoneNumber = '(555) 555-5555'; - var emailAddress = 'no-reply@chromium.org'; + const phoneNumber = '(555) 555-5555'; + const emailAddress = 'no-reply@chromium.org'; address.countryCode = 'US'; // Set to allow save to be active. address.phoneNumbers = [phoneNumber]; @@ -706,8 +706,8 @@ test('verifySaveIsNotClickableIfAllInputFieldsAreEmpty', function() { return self.createAddressDialog_( FakeDataMaker.emptyAddressEntry()).then(function(dialog) { - var saveButton = dialog.$.saveButton; - var testElements = + const saveButton = dialog.$.saveButton; + const testElements = dialog.$.dialog.querySelectorAll('paper-input,paper-textarea'); // Default country is 'US' expecting: Name, Organization, @@ -732,10 +732,10 @@ // Setting the country should allow the address to be saved. test('verifySaveIsNotClickableIfCountryNotSet', function() { - var dialog = null; + let dialog = null; - var simulateCountryChange = function(countryCode) { - var countrySelect = dialog.$$('select'); + const simulateCountryChange = function(countryCode) { + const countrySelect = dialog.$$('select'); countrySelect.value = countryCode; countrySelect.dispatchEvent(new CustomEvent('change')); }; @@ -761,7 +761,7 @@ // Test will timeout if save-address event is not fired. test('verifyDefaultCountryIsAppliedWhenSaving', function() { - var address = FakeDataMaker.emptyAddressEntry(); + const address = FakeDataMaker.emptyAddressEntry(); address.companyName = 'Google'; return self.createAddressDialog_(address).then(function(dialog) { return expectEvent(dialog, 'save-address', function() { @@ -799,7 +799,7 @@ }); TEST_F('SettingsAutofillSectionBrowserTest', 'AddressLocaleTests', function() { - var self = this; + const self = this; suite('AutofillSection', function() { suiteSetup(function() { @@ -813,7 +813,7 @@ // US address has 3 fields on the same line. test('verifyEditingUSAddress', function() { - var address = FakeDataMaker.emptyAddressEntry(); + const address = FakeDataMaker.emptyAddressEntry(); address.fullNames = [ 'Name' ]; address.companyName = 'Organization'; @@ -826,12 +826,12 @@ address.emailAddresses = [ 'Email' ]; return self.createAddressDialog_(address).then(function(dialog) { - var rows = dialog.$.dialog.querySelectorAll('.address-row'); + const rows = dialog.$.dialog.querySelectorAll('.address-row'); assertEquals(6, rows.length); // Name - var row = rows[0]; - var cols = row.querySelectorAll('.address-column'); + let row = rows[0]; + let cols = row.querySelectorAll('.address-column'); assertEquals(1, cols.length); assertEquals(address.fullNames[0], cols[0].value); // Organization @@ -853,7 +853,7 @@ assertEquals(address.postalCode, cols[2].value); // Country row = rows[4]; - var countrySelect = row.querySelector('select'); + const countrySelect = row.querySelector('select'); assertTrue(!!countrySelect); assertEquals( 'United States', @@ -869,7 +869,7 @@ // GB address has 1 field per line for all lines that change. test('verifyEditingGBAddress', function() { - var address = FakeDataMaker.emptyAddressEntry(); + const address = FakeDataMaker.emptyAddressEntry(); address.fullNames = [ 'Name' ]; address.companyName = 'Organization'; @@ -881,12 +881,12 @@ address.emailAddresses = [ 'Email' ]; return self.createAddressDialog_(address).then(function(dialog) { - var rows = dialog.$.dialog.querySelectorAll('.address-row'); + const rows = dialog.$.dialog.querySelectorAll('.address-row'); assertEquals(7, rows.length); // Name - var row = rows[0]; - var cols = row.querySelectorAll('.address-column'); + let row = rows[0]; + let cols = row.querySelectorAll('.address-column'); assertEquals(1, cols.length); assertEquals(address.fullNames[0], cols[0].value); // Organization @@ -911,7 +911,7 @@ assertEquals(address.postalCode, cols[0].value); // Country row = rows[5]; - var countrySelect = row.querySelector('select'); + const countrySelect = row.querySelector('select'); assertTrue(!!countrySelect); assertEquals( 'United Kingdom', @@ -928,7 +928,7 @@ // IL address has 2 fields on the same line and is an RTL locale. // RTL locale shouldn't affect this test. test('verifyEditingILAddress', function() { - var address = FakeDataMaker.emptyAddressEntry(); + const address = FakeDataMaker.emptyAddressEntry(); address.fullNames = [ 'Name' ]; address.companyName = 'Organization'; @@ -940,12 +940,12 @@ address.emailAddresses = [ 'Email' ]; return self.createAddressDialog_(address).then(function(dialog) { - var rows = dialog.$.dialog.querySelectorAll('.address-row'); + const rows = dialog.$.dialog.querySelectorAll('.address-row'); assertEquals(6, rows.length); // Name - var row = rows[0]; - var cols = row.querySelectorAll('.address-column'); + let row = rows[0]; + let cols = row.querySelectorAll('.address-column'); assertEquals(1, cols.length); assertEquals(address.fullNames[0], cols[0].value); // Organization @@ -966,7 +966,7 @@ assertEquals(address.postalCode, cols[1].value); // Country row = rows[4]; - var countrySelect = row.querySelector('select'); + const countrySelect = row.querySelector('select'); assertTrue(!!countrySelect); assertEquals( 'Israel', countrySelect.selectedOptions[0].textContent.trim()); @@ -982,23 +982,23 @@ // US has an extra field 'State'. Validate that this field is // persisted when switching to IL then back to US. test('verifyAddressPersistanceWhenSwitchingCountries', function() { - var address = FakeDataMaker.emptyAddressEntry(); + const address = FakeDataMaker.emptyAddressEntry(); address.countryCode = 'US'; return self.createAddressDialog_(address).then(function(dialog) { - var city = 'Los Angeles'; - var state = 'CA'; - var zip = '90291'; - var countrySelect = dialog.$$('select'); + const city = 'Los Angeles'; + const state = 'CA'; + const zip = '90291'; + const countrySelect = dialog.$$('select'); return expectEvent(dialog, 'on-update-address-wrapper', function() { // US: - var rows = dialog.$.dialog.querySelectorAll('.address-row'); + const rows = dialog.$.dialog.querySelectorAll('.address-row'); assertEquals(6, rows.length); // City, State, ZIP code - var row = rows[3]; - var cols = row.querySelectorAll('.address-column'); + const row = rows[3]; + const cols = row.querySelectorAll('.address-column'); assertEquals(3, cols.length); cols[0].value = city; cols[1].value = state; @@ -1024,7 +1024,7 @@ }); }).then(function() { // US: - var rows = dialog.$.dialog.querySelectorAll('.address-row'); + const rows = dialog.$.dialog.querySelectorAll('.address-row'); assertEquals(6, rows.length); // City, State, ZIP code
diff --git a/chrome/test/data/webui/settings/settings_idle_load_browsertest.js b/chrome/test/data/webui/settings/settings_idle_load_browsertest.js index 7def0ef..e11a7c6 100644 --- a/chrome/test/data/webui/settings/settings_idle_load_browsertest.js +++ b/chrome/test/data/webui/settings/settings_idle_load_browsertest.js
@@ -5,7 +5,7 @@ /** @fileoverview Tests for settings-idle-load. */ /** @const {string} Path to root from chrome/test/data/webui/settings/. */ -var ROOT_PATH = '../../../../../'; +const ROOT_PATH = '../../../../../'; /** * @constructor @@ -36,7 +36,7 @@ // Register mocha tests. suite('Settings idle load tests', function() { setup(function() { - var template = + const template = '<template is="settings-idle-load" id="idleTemplate" '+ ' url="chrome://resources/html/polymer.html">' + ' <div></div>' +
diff --git a/chrome/test/data/webui/settings/settings_main_test.js b/chrome/test/data/webui/settings/settings_main_test.js index aed2a2cb..ae5c707 100644 --- a/chrome/test/data/webui/settings/settings_main_test.js +++ b/chrome/test/data/webui/settings/settings_main_test.js
@@ -45,7 +45,7 @@ } } - var settingsPrefs = null; + let settingsPrefs = null; suiteSetup(function() { settingsPrefs = document.createElement('settings-prefs'); @@ -54,10 +54,10 @@ suite('MainPageTests', function() { /** @type {?TestSearchManager} */ - var searchManager = null; + let searchManager = null; /** @type {?SettingsMainElement} */ - var settingsMain = null; + let settingsMain = null; setup(function() { settings.navigateTo(settings.routes.BASIC); @@ -76,9 +76,9 @@ test('searchContents() triggers SearchManager', function() { Polymer.dom.flush(); - var expectedQuery1 = 'foo'; - var expectedQuery2 = 'bar'; - var expectedQuery3 = ''; + const expectedQuery1 = 'foo'; + const expectedQuery2 = 'bar'; + const expectedQuery3 = ''; return settingsMain.searchContents(expectedQuery1).then(function() { return searchManager.whenCalled('search'); @@ -103,9 +103,9 @@ /** @return {!HTMLElement} */ function getToggleContainer() { - var page = settingsMain.$$('settings-basic-page'); + const page = settingsMain.$$('settings-basic-page'); assertTrue(!!page); - var toggleContainer = page.$$('#toggleContainer'); + const toggleContainer = page.$$('#toggleContainer'); assertTrue(!!toggleContainer); return toggleContainer; } @@ -116,7 +116,7 @@ * @param {boolean} expectedVisible */ function assertToggleContainerVisible(expectedVisible) { - var toggleContainer = getToggleContainer(); + const toggleContainer = getToggleContainer(); if (expectedVisible) assertNotEquals('none', toggleContainer.style.display); else @@ -125,7 +125,7 @@ test('no results page shows and hides', function() { Polymer.dom.flush(); - var noSearchResults = settingsMain.$.noSearchResults; + const noSearchResults = settingsMain.$.noSearchResults; assertTrue(!!noSearchResults); assertTrue(noSearchResults.hidden); @@ -147,7 +147,7 @@ // is hidden and the "advanced page toggle" is visible again. test('no results page hides on clear', function() { Polymer.dom.flush(); - var noSearchResults = settingsMain.$.noSearchResults; + const noSearchResults = settingsMain.$.noSearchResults; assertTrue(!!noSearchResults); assertTrue(noSearchResults.hidden); @@ -170,7 +170,7 @@ */ function assertPageVisibility(expectedBasic, expectedAdvanced) { Polymer.dom.flush(); - var page = settingsMain.$$('settings-basic-page'); + const page = settingsMain.$$('settings-basic-page'); assertEquals( expectedBasic, getComputedStyle(page.$$('#basicPage')).display); @@ -249,17 +249,17 @@ settings.navigateTo(settings.routes.PRIVACY); Polymer.dom.flush(); - var basicPage = settingsMain.$$('settings-basic-page'); - var advancedPage = null; + const basicPage = settingsMain.$$('settings-basic-page'); + let advancedPage = null; return basicPage.$$('#advancedPageTemplate').get().then( function(advanced) { advancedPage = advanced; return assertPageVisibility('block', 'block'); }).then(function() { - var whenHidden = test_util.whenAttributeIs( + const whenHidden = test_util.whenAttributeIs( advancedPage, 'hidden', ''); - var advancedToggle = + const advancedToggle = getToggleContainer().querySelector('#advancedToggle'); assertTrue(!!advancedToggle); MockInteractions.tap(advancedToggle); @@ -285,7 +285,7 @@ test('verify showChangePassword value', function() { settings.navigateTo(settings.routes.BASIC); Polymer.dom.flush(); - var basicPage = settingsMain.$$('settings-basic-page'); + const basicPage = settingsMain.$$('settings-basic-page'); assertTrue(!!basicPage); assertFalse(basicPage.showChangePassword); assertFalse(!!basicPage.$$('settings-change-password-page'));
diff --git a/chrome/test/data/webui/settings/settings_menu_test.js b/chrome/test/data/webui/settings/settings_menu_test.js index aaaa6f9..e7a9f26 100644 --- a/chrome/test/data/webui/settings/settings_menu_test.js +++ b/chrome/test/data/webui/settings/settings_menu_test.js
@@ -5,7 +5,7 @@ /** @fileoverview Runs tests for the settings menu. */ cr.define('settings_menu', function() { - var settingsMenu = null; + let settingsMenu = null; suite('SettingsMenu', function() { setup(function() { @@ -31,7 +31,7 @@ test('tapAdvanced', function() { assertFalse(settingsMenu.advancedOpened); - var advancedToggle = settingsMenu.$$('#advancedButton'); + const advancedToggle = settingsMenu.$$('#advancedButton'); assertTrue(!!advancedToggle); MockInteractions.tap(advancedToggle); @@ -46,12 +46,12 @@ test('upAndDownIcons', function() { // There should be different icons for a top level menu being open // vs. being closed. E.g. arrow-drop-up and arrow-drop-down. - var ironIconElement = settingsMenu.$$('#advancedButton iron-icon'); + const ironIconElement = settingsMenu.$$('#advancedButton iron-icon'); assertTrue(!!ironIconElement); settingsMenu.advancedOpened = true; Polymer.dom.flush(); - var openIcon = ironIconElement.icon; + const openIcon = ironIconElement.icon; assertTrue(!!openIcon); settingsMenu.advancedOpened = false; @@ -62,7 +62,7 @@ // Test that navigating via the paper menu always clears the current // search URL parameter. test('clearsUrlSearchParam', function() { - var urlParams = new URLSearchParams('search=foo'); + const urlParams = new URLSearchParams('search=foo'); settings.navigateTo(settings.routes.BASIC, urlParams); assertEquals( urlParams.toString(), @@ -83,14 +83,14 @@ teardown(function() { settingsMenu.remove(); }); test('openResetSection', function() { - var selector = settingsMenu.$.subMenu; - var path = new window.URL(selector.selected).pathname; + const selector = settingsMenu.$.subMenu; + const path = new window.URL(selector.selected).pathname; assertEquals('/reset', path); }); test('navigateToAnotherSection', function() { - var selector = settingsMenu.$.subMenu; - var path = new window.URL(selector.selected).pathname; + const selector = settingsMenu.$.subMenu; + let path = new window.URL(selector.selected).pathname; assertEquals('/reset', path); settings.navigateTo(settings.routes.PEOPLE, ''); @@ -101,8 +101,8 @@ }); test('navigateToBasic', function() { - var selector = settingsMenu.$.subMenu; - var path = new window.URL(selector.selected).pathname; + const selector = settingsMenu.$.subMenu; + const path = new window.URL(selector.selected).pathname; assertEquals('/reset', path); settings.navigateTo(settings.routes.BASIC, '');
diff --git a/chrome/test/data/webui/settings/settings_page_browsertest.js b/chrome/test/data/webui/settings/settings_page_browsertest.js index 73c0fec..595d91b 100644 --- a/chrome/test/data/webui/settings/settings_page_browsertest.js +++ b/chrome/test/data/webui/settings/settings_page_browsertest.js
@@ -5,6 +5,7 @@ /** @fileoverview Prototype for Settings page tests. */ /** @const {string} Path to root from chrome/test/data/webui/settings/. */ +// eslint-disable-next-line no-var var ROOT_PATH = '../../../../../'; // Polymer BrowserTest fixture. @@ -50,7 +51,7 @@ * Toggles the Advanced sections. */ toggleAdvanced: function() { - var settingsMain = document.querySelector('* /deep/ settings-main'); + const settingsMain = document.querySelector('* /deep/ settings-main'); assert(!!settingsMain); settingsMain.advancedToggleExpanded = !settingsMain.advancedToggleExpanded; Polymer.dom.flush(); @@ -61,14 +62,14 @@ * @return {!PolymerElement} The PolymerElement for the page. */ getPage: function(type) { - var settingsUi = document.querySelector('settings-ui'); + const settingsUi = document.querySelector('settings-ui'); assertTrue(!!settingsUi); - var settingsMain = settingsUi.$$('settings-main'); + const settingsMain = settingsUi.$$('settings-main'); assertTrue(!!settingsMain); - var pageType = 'settings-' + type + '-page'; - var page = settingsMain.$$(pageType); + const pageType = 'settings-' + type + '-page'; + const page = settingsMain.$$(pageType); - var idleRender = page && page.$$('template[is=settings-idle-load]'); + const idleRender = page && page.$$('template[is=settings-idle-load]'); if (!idleRender) return Promise.resolve(page); @@ -85,10 +86,10 @@ * @return {Node|undefined} The DOM node for the section. */ getSection: function(page, section) { - var sections = page.shadowRoot.querySelectorAll('settings-section'); + const sections = page.shadowRoot.querySelectorAll('settings-section'); assertTrue(!!sections); - for (var i = 0; i < sections.length; ++i) { - var s = sections[i]; + for (let i = 0; i < sections.length; ++i) { + const s = sections[i]; if (s.section == section) return s; } @@ -102,17 +103,17 @@ */ verifySubpagesHidden: function(section) { // Check if there are sub-pages to verify. - var pages = section.querySelector('* /deep/ settings-animated-pages'); + const pages = section.querySelector('* /deep/ settings-animated-pages'); if (!pages) return; - var children = pages.getContentChildren(); - var stampedChildren = children.filter(function(element) { + const children = pages.getContentChildren(); + const stampedChildren = children.filter(function(element) { return element.tagName != 'TEMPLATE'; }); // The section's main child should be stamped and visible. - var main = stampedChildren.filter(function(element) { + const main = stampedChildren.filter(function(element) { return element.getAttribute('route-path') == 'default'; }); assertEquals(main.length, 1, 'default card not found for section ' + @@ -120,10 +121,10 @@ assertGT(main[0].offsetHeight, 0); // Any other stamped subpages should not be visible. - var subpages = stampedChildren.filter(function(element) { + const subpages = stampedChildren.filter(function(element) { return element.getAttribute('route-path') != 'default'; }); - for (var subpage of subpages) { + for (const subpage of subpages) { assertEquals(subpage.offsetHeight, 0, 'Expected subpage #' + subpage.id + ' in ' + section.section + ' not to be visible.'); }
diff --git a/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js b/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js index 35ee9c77..ee43d9f 100644 --- a/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js +++ b/chrome/test/data/webui/settings/settings_passwords_section_browsertest.js
@@ -5,7 +5,7 @@ /** @fileoverview Runs the Polymer Password Settings tests. */ /** @const {string} Path to root from chrome/test/data/webui/settings/. */ -var ROOT_PATH = '../../../../../'; +const ROOT_PATH = '../../../../../'; // Polymer BrowserTest fixture. GEN_INCLUDE( @@ -57,9 +57,9 @@ assertEquals(passwordList.length, listElement.items.length); if (passwordList.length > 0) { // The first child is a template, skip and get the real 'first child'. - var node = Polymer.dom(listElement).children[1]; + const node = Polymer.dom(listElement).children[1]; assert(node); - var passwordInfo = passwordList[0]; + const passwordInfo = passwordList[0]; assertEquals(passwordInfo.loginPair.urls.shown, node.$$('#originUrl').textContent.trim()); assertEquals(passwordInfo.loginPair.urls.link, @@ -82,9 +82,9 @@ */ function validateExceptionList(nodes, exceptionList) { assertEquals(exceptionList.length, nodes.length); - for (var index = 0; index < exceptionList.length; ++index) { - var node = nodes[index]; - var exception = exceptionList[index]; + for (let index = 0; index < exceptionList.length; ++index) { + const node = nodes[index]; + const exception = exceptionList[index]; assertEquals( exception.urls.shown, node.querySelector('#exception').textContent.trim()); @@ -101,7 +101,7 @@ * @private */ function getDomRepeatChildren(element) { - var nodes = element.querySelectorAll('.list-item:not([id])'); + const nodes = element.querySelectorAll('.list-item:not([id])'); return nodes; } @@ -130,7 +130,7 @@ passwordManager.data.exceptions = exceptionList; // Create a passwords-section to use for testing. - var passwordsSection = document.createElement('passwords-section'); + const passwordsSection = document.createElement('passwords-section'); document.body.appendChild(passwordsSection); flushPasswordSection(passwordsSection); return passwordsSection; @@ -143,7 +143,7 @@ * @private */ function createPasswordListItem(passwordItem) { - var passwordListItem = document.createElement('password-list-item'); + const passwordListItem = document.createElement('password-list-item'); passwordListItem.item = {entry: passwordItem, password: ''}; document.body.appendChild(passwordListItem); Polymer.dom.flush(); @@ -157,7 +157,7 @@ * @private */ function createPasswordDialog(passwordItem) { - var passwordDialog = document.createElement('password-edit-dialog'); + const passwordDialog = document.createElement('password-edit-dialog'); passwordDialog.item = {entry: passwordItem, password: ''}; document.body.appendChild(passwordDialog); Polymer.dom.flush(); @@ -170,7 +170,7 @@ * @private */ function createExportPasswordsDialog() { - var dialog = document.createElement('passwords-export-dialog'); + const dialog = document.createElement('passwords-export-dialog'); document.body.appendChild(dialog); Polymer.dom.flush(); return dialog; @@ -182,7 +182,7 @@ * @param {string} url The URL that is being searched for. */ function listContainsUrl(passwordList, url) { - for (var i = 0; i < passwordList.length; ++i) { + for (let i = 0; i < passwordList.length; ++i) { if (passwordList[i].loginPair.urls.origin == url) return true; } @@ -195,7 +195,7 @@ * @param {string} url The URL that is being searched for. */ function exceptionsListContainsUrl(exceptionList, url) { - for (var i = 0; i < exceptionList.length; ++i) { + for (let i = 0; i < exceptionList.length; ++i) { if (exceptionList[i].urls.orginUrl == url) return true; } @@ -204,7 +204,7 @@ suite('PasswordsSection', function() { /** @type {TestPasswordManager} */ - var passwordManager = null; + let passwordManager = null; setup(function() { PolymerTest.clearBody(); @@ -215,7 +215,7 @@ test('testPasswordsExtensionIndicator', function() { // Initialize with dummy prefs. - var element = document.createElement('passwords-section'); + const element = document.createElement('passwords-section'); element.prefs = {credentials_enable_service: {}}; document.body.appendChild(element); @@ -227,7 +227,7 @@ }); test('verifyNoSavedPasswords', function() { - var passwordsSection = createPasswordsSection(passwordManager, [], []); + const passwordsSection = createPasswordsSection(passwordManager, [], []); validatePasswordList(passwordsSection.$.passwordList, []); @@ -236,7 +236,7 @@ }); test('verifySavedPasswordLength', function() { - var passwordList = [ + const passwordList = [ FakeDataMaker.passwordEntry('site1.com', 'luigi', 1), FakeDataMaker.passwordEntry('longwebsite.com', 'peach', 7), FakeDataMaker.passwordEntry('site2.com', 'mario', 70), @@ -245,7 +245,7 @@ FakeDataMaker.passwordEntry('site2.com', 'luigi', 8), ]; - var passwordsSection = createPasswordsSection( + const passwordsSection = createPasswordsSection( passwordManager, passwordList, []); // Assert that the data is passed into the iron list. If this fails, @@ -262,13 +262,13 @@ // Test verifies that removing a password will update the elements. test('verifyPasswordListRemove', function() { - var passwordList = [ + const passwordList = [ FakeDataMaker.passwordEntry('anotherwebsite.com', 'luigi', 1), FakeDataMaker.passwordEntry('longwebsite.com', 'peach', 7), FakeDataMaker.passwordEntry('website.com', 'mario', 70) ]; - var passwordsSection = createPasswordsSection( + const passwordsSection = createPasswordsSection( passwordManager, passwordList, []); validatePasswordList(passwordsSection.$.passwordList, passwordList); @@ -288,7 +288,7 @@ // Test verifies that pressing the 'remove' button will trigger a remove // event. Does not actually remove any passwords. test('verifyPasswordItemRemoveButton', function(done) { - var passwordList = [ + const passwordList = [ FakeDataMaker.passwordEntry('one', 'six', 5), FakeDataMaker.passwordEntry('two', 'five', 3), FakeDataMaker.passwordEntry('three', 'four', 1), @@ -297,13 +297,14 @@ FakeDataMaker.passwordEntry('six', 'one', 6), ]; - var passwordsSection = createPasswordsSection( + const passwordsSection = createPasswordsSection( passwordManager, passwordList, []); // The first child is a template, skip and get the real 'first child'. - var firstNode = Polymer.dom(passwordsSection.$.passwordList).children[1]; + const firstNode = + Polymer.dom(passwordsSection.$.passwordList).children[1]; assert(firstNode); - var firstPassword = passwordList[0]; + const firstPassword = passwordList[0]; passwordManager.onRemoveSavedPassword = function(index) { // Verify that the event matches the expected value. @@ -321,7 +322,7 @@ }); test('verifyFilterPasswords', function() { - var passwordList = [ + const passwordList = [ FakeDataMaker.passwordEntry('one.com', 'SHOW', 5), FakeDataMaker.passwordEntry('two.com', 'shower', 3), FakeDataMaker.passwordEntry('three.com/show', 'four', 1), @@ -330,12 +331,12 @@ FakeDataMaker.passwordEntry('six-show.com', 'one', 6), ]; - var passwordsSection = createPasswordsSection( + const passwordsSection = createPasswordsSection( passwordManager, passwordList, []); passwordsSection.filter = 'SHow'; Polymer.dom.flush(); - var expectedList = [ + const expectedList = [ FakeDataMaker.passwordEntry('one.com', 'SHOW', 5), FakeDataMaker.passwordEntry('two.com', 'shower', 3), FakeDataMaker.passwordEntry('three.com/show', 'four', 1), @@ -346,7 +347,7 @@ }); test('verifyFilterPasswordExceptions', function() { - var exceptionList = [ + const exceptionList = [ FakeDataMaker.exceptionEntry('docsshoW.google.com'), FakeDataMaker.exceptionEntry('showmail.com'), FakeDataMaker.exceptionEntry('google.com'), @@ -355,12 +356,12 @@ FakeDataMaker.exceptionEntry('plus.google.comshow'), ]; - var passwordsSection = createPasswordsSection( + const passwordsSection = createPasswordsSection( passwordManager, [], exceptionList); passwordsSection.filter = 'shOW'; Polymer.dom.flush(); - var expectedExceptionList = [ + const expectedExceptionList = [ FakeDataMaker.exceptionEntry('docsshoW.google.com'), FakeDataMaker.exceptionEntry('showmail.com'), FakeDataMaker.exceptionEntry('mapsshow.google.com'), @@ -373,7 +374,7 @@ }); test('verifyNoPasswordExceptions', function() { - var passwordsSection = createPasswordsSection(passwordManager, [], []); + const passwordsSection = createPasswordsSection(passwordManager, [], []); validateExceptionList( getDomRepeatChildren(passwordsSection.$.passwordExceptionsList), @@ -383,7 +384,7 @@ }); test('verifyPasswordExceptions', function() { - var exceptionList = [ + const exceptionList = [ FakeDataMaker.exceptionEntry('docs.google.com'), FakeDataMaker.exceptionEntry('mail.com'), FakeDataMaker.exceptionEntry('google.com'), @@ -392,7 +393,7 @@ FakeDataMaker.exceptionEntry('plus.google.com'), ]; - var passwordsSection = createPasswordsSection( + const passwordsSection = createPasswordsSection( passwordManager, [], exceptionList); validateExceptionList( @@ -404,7 +405,7 @@ // Test verifies that removing an exception will update the elements. test('verifyPasswordExceptionRemove', function() { - var exceptionList = [ + const exceptionList = [ FakeDataMaker.exceptionEntry('docs.google.com'), FakeDataMaker.exceptionEntry('mail.com'), FakeDataMaker.exceptionEntry('google.com'), @@ -413,7 +414,7 @@ FakeDataMaker.exceptionEntry('plus.google.com'), ]; - var passwordsSection = createPasswordsSection( + const passwordsSection = createPasswordsSection( passwordManager, [], exceptionList); validateExceptionList( @@ -435,7 +436,7 @@ // Test verifies that pressing the 'remove' button will trigger a remove // event. Does not actually remove any exceptions. test('verifyPasswordExceptionRemoveButton', function(done) { - var exceptionList = [ + const exceptionList = [ FakeDataMaker.exceptionEntry('docs.google.com'), FakeDataMaker.exceptionEntry('mail.com'), FakeDataMaker.exceptionEntry('google.com'), @@ -444,16 +445,16 @@ FakeDataMaker.exceptionEntry('plus.google.com'), ]; - var passwordsSection = createPasswordsSection( + const passwordsSection = createPasswordsSection( passwordManager, [], exceptionList); - var exceptions = + const exceptions = getDomRepeatChildren(passwordsSection.$.passwordExceptionsList); // The index of the button currently being checked. - var item = 0; + let item = 0; - var clickRemoveButton = function() { + const clickRemoveButton = function() { MockInteractions.tap( exceptions[item].querySelector('#removeExceptionButton')); }; @@ -478,9 +479,9 @@ }); test('verifyFederatedPassword', function() { - var item = FakeDataMaker.passwordEntry('goo.gl', 'bart', 0); + const item = FakeDataMaker.passwordEntry('goo.gl', 'bart', 0); item.federationText = 'with chromium.org'; - var passwordDialog = createPasswordDialog(item); + const passwordDialog = createPasswordDialog(item); Polymer.dom.flush(); @@ -493,9 +494,10 @@ }); test('showSavedPasswordEditDialog', function() { - var PASSWORD = 'bAn@n@5'; - var item = FakeDataMaker.passwordEntry('goo.gl', 'bart', PASSWORD.length); - var passwordDialog = createPasswordDialog(item); + const PASSWORD = 'bAn@n@5'; + const item = FakeDataMaker.passwordEntry( + 'goo.gl', 'bart', PASSWORD.length); + const passwordDialog = createPasswordDialog(item); assertFalse(passwordDialog.$.showPasswordButton.hidden); @@ -511,9 +513,10 @@ }); test('showSavedPasswordListItem', function() { - var PASSWORD = 'bAn@n@5'; - var item = FakeDataMaker.passwordEntry('goo.gl', 'bart', PASSWORD.length); - var passwordListItem = createPasswordListItem(item); + const PASSWORD = 'bAn@n@5'; + const item = + FakeDataMaker.passwordEntry('goo.gl', 'bart', PASSWORD.length); + const passwordListItem = createPasswordListItem(item); // Hidden passwords should be disabled. assertTrue(passwordListItem.$$('#password').disabled); @@ -533,11 +536,11 @@ // Test will timeout if event is not received. test('onShowSavedPasswordEditDialog', function(done) { - var expectedItem = FakeDataMaker.passwordEntry('goo.gl', 'bart', 1); - var passwordDialog = createPasswordDialog(expectedItem); + const expectedItem = FakeDataMaker.passwordEntry('goo.gl', 'bart', 1); + const passwordDialog = createPasswordDialog(expectedItem); passwordDialog.addEventListener('show-password', function(event) { - var actualItem = event.detail.item; + const actualItem = event.detail.item; assertEquals( expectedItem.loginPair.urls.origin, actualItem.entry.loginPair.urls.origin); @@ -551,11 +554,11 @@ }); test('onShowSavedPasswordListItem', function(done) { - var expectedItem = FakeDataMaker.passwordEntry('goo.gl', 'bart', 1); - var passwordListItem = createPasswordListItem(expectedItem); + const expectedItem = FakeDataMaker.passwordEntry('goo.gl', 'bart', 1); + const passwordListItem = createPasswordListItem(expectedItem); passwordListItem.addEventListener('show-password', function(event) { - var actualItem = event.detail.item; + const actualItem = event.detail.item; assertEquals( expectedItem.loginPair.urls.origin, actualItem.entry.loginPair.urls.origin); @@ -570,7 +573,7 @@ // Test that tapping "Export passwords..." notifies the browser accordingly test('startExport', function(done) { - var exportDialog = createExportPasswordsDialog(); + const exportDialog = createExportPasswordsDialog(); passwordManager.exportPasswords = () => { done(); @@ -580,13 +583,14 @@ }); test('closingPasswordsSectionHidesUndoToast', function(done) { - var passwordEntry = FakeDataMaker.passwordEntry('goo.gl', 'bart', 1); - var passwordsSection = + const passwordEntry = FakeDataMaker.passwordEntry('goo.gl', 'bart', 1); + const passwordsSection = createPasswordsSection(passwordManager, [passwordEntry], []); // Click the remove button on the first password and assert that an undo // toast is shown. - var firstNode = Polymer.dom(passwordsSection.$.passwordList).children[1]; + const firstNode = + Polymer.dom(passwordsSection.$.passwordList).children[1]; MockInteractions.tap(firstNode.$$('#passwordMenu')); MockInteractions.tap(passwordsSection.$.menuRemovePassword); assertTrue(passwordsSection.$.undoToast.open);
diff --git a/chrome/test/data/webui/settings/settings_slider_tests.js b/chrome/test/data/webui/settings/settings_slider_tests.js index 12d0cb9d..ea0195d 100644 --- a/chrome/test/data/webui/settings/settings_slider_tests.js +++ b/chrome/test/data/webui/settings/settings_slider_tests.js
@@ -5,15 +5,15 @@ /** @fileoverview Suite of tests for settings-slider. */ suite('SettingsSlider', function() { /** @type {!CrSliderElement} */ - var slider; + let slider; /** * paper-slider instance wrapped by settings-slider. * @type {!PaperSliderElement} */ - var paperSlider; + let paperSlider; - var tickValues = [2, 4, 8, 16, 32, 64, 128]; + const tickValues = [2, 4, 8, 16, 32, 64, 128]; setup(function() { PolymerTest.clearBody(); @@ -86,9 +86,9 @@ }); test('findNearestIndex_', function() { - var slider = document.createElement('settings-slider'); - var testArray = [80, 20, 350, 1000, 200, 100]; - var testFindNearestIndex = function(expectedIndex, value) { + const slider = document.createElement('settings-slider'); + const testArray = [80, 20, 350, 1000, 200, 100]; + const testFindNearestIndex = function(expectedIndex, value) { expectEquals(expectedIndex, slider.findNearestIndex_(testArray, value)); }; testFindNearestIndex(0, 51);
diff --git a/chrome/test/data/webui/settings/settings_subpage_test.js b/chrome/test/data/webui/settings/settings_subpage_test.js index 0a63ded2..27c83e4 100644 --- a/chrome/test/data/webui/settings/settings_subpage_test.js +++ b/chrome/test/data/webui/settings/settings_subpage_test.js
@@ -9,12 +9,12 @@ }); test('clear search', function() { - var subpage = document.createElement('settings-subpage'); + const subpage = document.createElement('settings-subpage'); // Having a searchLabel will create the settings-subpage-search. subpage.searchLabel = 'test'; document.body.appendChild(subpage); Polymer.dom.flush(); - var search = subpage.$$('settings-subpage-search'); + const search = subpage.$$('settings-subpage-search'); assertTrue(!!search); search.setValue('Hello'); subpage.fire('clear-subpage-search'); @@ -29,7 +29,7 @@ settings.initializeRouteFromUrl(); assertEquals(settings.routes.CERTIFICATES, settings.getCurrentRoute()); - var subpage = document.createElement('settings-subpage'); + const subpage = document.createElement('settings-subpage'); document.body.appendChild(subpage); MockInteractions.tap(subpage.$$('button')); @@ -41,7 +41,7 @@ settings.navigateTo(settings.routes.SYNC); assertEquals(settings.routes.SYNC, settings.getCurrentRoute()); - var subpage = document.createElement('settings-subpage'); + const subpage = document.createElement('settings-subpage'); document.body.appendChild(subpage); MockInteractions.tap(subpage.$$('button')); @@ -56,7 +56,7 @@ suite('SettingsSubpageSearch', function() { test('host autofocus propagates to <input>', function() { PolymerTest.clearBody(); - var element = document.createElement('settings-subpage-search'); + const element = document.createElement('settings-subpage-search'); element.setAttribute('autofocus', true); document.body.appendChild(element);
diff --git a/chrome/test/data/webui/settings/settings_toggle_button_tests.js b/chrome/test/data/webui/settings/settings_toggle_button_tests.js index bc1e569b..198bf15f 100644 --- a/chrome/test/data/webui/settings/settings_toggle_button_tests.js +++ b/chrome/test/data/webui/settings/settings_toggle_button_tests.js
@@ -9,7 +9,7 @@ * Toggle button created before each test. * @type {SettingsCheckbox} */ - var testElement; + let testElement; // Initialize a checked control before each test. setup(() => { @@ -19,7 +19,7 @@ * dependencies between tests. * @type {chrome.settingsPrivate.PrefObject} */ - var pref = { + const pref = { key: 'test', type: chrome.settingsPrivate.PrefType.BOOLEAN, value: true @@ -115,7 +115,7 @@ }); test('numerical pref', () => { - var prefNum = { + const prefNum = { key: 'test', type: chrome.settingsPrivate.PrefType.NUMBER, value: 1 @@ -134,7 +134,7 @@ }); test('numerical pref with custom values', () => { - var prefNum = { + const prefNum = { key: 'test', type: chrome.settingsPrivate.PrefType.NUMBER, value: 5 @@ -155,7 +155,7 @@ }); test('numerical pref with unknown initial value', () => { - var prefNum = { + const prefNum = { key: 'test', type: chrome.settingsPrivate.PrefType.NUMBER, value: 3 @@ -185,7 +185,7 @@ test('shows controlled indicator when pref is controlled', () => { assertFalse(!!testElement.$$('cr-policy-pref-indicator')); - var pref = { + const pref = { key: 'test', type: chrome.settingsPrivate.PrefType.NUMBER, value: 3, @@ -203,7 +203,7 @@ assertFalse(!!testElement.$$('cr-policy-pref-indicator')); testElement.noExtensionIndicator = true; - var pref = { + const pref = { key: 'test', type: chrome.settingsPrivate.PrefType.NUMBER, value: 3,
diff --git a/chrome/test/data/webui/settings/settings_ui_browsertest.js b/chrome/test/data/webui/settings/settings_ui_browsertest.js index 79705a2..7f56bc1 100644 --- a/chrome/test/data/webui/settings/settings_ui_browsertest.js +++ b/chrome/test/data/webui/settings/settings_ui_browsertest.js
@@ -23,8 +23,8 @@ TEST_F('SettingsUIBrowserTest', 'DISABLED_All', function() { suite('settings-ui', function() { - var toolbar; - var ui; + let toolbar; + let ui; suiteSetup(function() { ui = assert(document.querySelector('settings-ui')); @@ -43,7 +43,7 @@ test('app drawer', function(done) { assertEquals(null, ui.$$('settings-menu')); - var drawer = ui.$.drawer; + const drawer = ui.$.drawer; assertFalse(!!drawer.open); drawer.openDrawer(); @@ -58,7 +58,7 @@ if (drawer.classList.contains('opening')) { // Click away from the drawer. MockInteractions don't expose a way to // click at a specific location. - var midScreen = MockInteractions.middleOfNode(ui); + const midScreen = MockInteractions.middleOfNode(ui); drawer.dispatchEvent(new MouseEvent('click', { 'bubbles': true, 'cancelable': true, @@ -78,7 +78,7 @@ }); test('advanced UIs stay in sync', function() { - var main = ui.$$('settings-main'); + const main = ui.$$('settings-main'); assertTrue(!!main); assertFalse(!!ui.$$('settings-menu')); @@ -95,7 +95,7 @@ ui.$.drawerTemplate.if = true; Polymer.dom.flush(); - var menu = ui.$$('settings-menu'); + const menu = ui.$$('settings-menu'); assertTrue(!!menu); assertTrue(menu.advancedOpened); @@ -110,18 +110,18 @@ test('URL initiated search propagates to search box', function() { toolbar = /** @type {!CrToolbarElement} */ (ui.$$('cr-toolbar')); - var searchField = /** @type {CrToolbarSearchFieldElement} */ ( + const searchField = /** @type {CrToolbarSearchFieldElement} */ ( toolbar.getSearchField()); assertEquals('', searchField.getSearchInput().value); - var query = 'foo'; + const query = 'foo'; settings.navigateTo( settings.routes.BASIC, new URLSearchParams(`search=${query}`)); assertEquals(query, searchField.getSearchInput().value); }); test('search box initiated search propagates to URL', function() { - var searchField = /** @type {CrToolbarSearchFieldElement} */ ( + const searchField = /** @type {CrToolbarSearchFieldElement} */ ( toolbar.getSearchField()); settings.navigateTo( @@ -130,7 +130,7 @@ assertEquals('', searchField.getSearchInput().value); assertFalse(settings.getQueryParameters().has('search')); - var value = 'GOOG'; + let value = 'GOOG'; searchField.setValue(value); assertEquals(value, settings.getQueryParameters().get('search')); @@ -142,10 +142,10 @@ test('whitespace only search query is ignored', function() { toolbar = /** @type {!CrToolbarElement} */ (ui.$$('cr-toolbar')); - var searchField = /** @type {CrToolbarSearchFieldElement} */ ( + const searchField = /** @type {CrToolbarSearchFieldElement} */ ( toolbar.getSearchField()); searchField.setValue(' '); - var urlParams = settings.getQueryParameters(); + let urlParams = settings.getQueryParameters(); assertFalse(urlParams.has('search')); searchField.setValue(' foo');
diff --git a/chrome/test/data/webui/settings/site_data_details_subpage_tests.js b/chrome/test/data/webui/settings/site_data_details_subpage_tests.js index 4a6e3da..06d78c5 100644 --- a/chrome/test/data/webui/settings/site_data_details_subpage_tests.js +++ b/chrome/test/data/webui/settings/site_data_details_subpage_tests.js
@@ -5,13 +5,13 @@ /** @fileoverview Suite of tests for site-data-details-subpage. */ suite('SiteDataDetailsSubpage', function() { /** @type {?SiteDataDetailsSubpageElement} */ - var page = null; + let page = null; /** @type {TestLocalDataBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** @type {!CookieDetails} */ - var cookieDetails = { + const cookieDetails = { accessibleToScript: "Yes", content: "dummy_cookie_contents", created: "Tuesday, February 7, 2017 at 11:28:45 AM", @@ -28,12 +28,12 @@ }; /** @type {!CookieList} */ - var cookieList = { + const cookieList = { id: 'fooId', children: [cookieDetails], }; - var site = 'foo.com'; + const site = 'foo.com'; setup(function() { browserProxy = new TestLocalDataBrowserProxy(); @@ -58,19 +58,19 @@ assertEquals(site, actualSite); Polymer.dom.flush(); - var entries = page.root.querySelectorAll('.settings-box'); + const entries = page.root.querySelectorAll('.settings-box'); assertEquals(1, entries.length); - var listItems = page.root.querySelectorAll('.list-item'); + const listItems = page.root.querySelectorAll('.list-item'); // |cookieInfo| is a global var defined in // site_settings/cookie_info.js, and specifies the fields that are // shown for a cookie. assertEquals(cookieInfo.cookie.length, listItems.length); // Check that all the cookie information is presented in the DOM. - var cookieDetailValues = page.root.querySelectorAll('.secondary'); + const cookieDetailValues = page.root.querySelectorAll('.secondary'); cookieDetailValues.forEach(function(div, i) { - var key = cookieInfo.cookie[i][0]; + const key = cookieInfo.cookie[i][0]; assertEquals(cookieDetails[key], div.textContent); }); });
diff --git a/chrome/test/data/webui/settings/site_data_test.js b/chrome/test/data/webui/settings/site_data_test.js index 85c3a8f..b453558 100644 --- a/chrome/test/data/webui/settings/site_data_test.js +++ b/chrome/test/data/webui/settings/site_data_test.js
@@ -4,10 +4,10 @@ suite('SiteDataTest', function() { /** @type {SiteDataElement} */ - var siteData; + let siteData; /** @type {TestLocalDataBrowserProxy} */ - var testBrowserProxy; + let testBrowserProxy; setup(function() { settings.navigateTo(settings.routes.SITE_SETTINGS); @@ -25,7 +25,7 @@ test_util.eventToPromise('site-data-list-complete', siteData) .then(() => { Polymer.dom.flush(); - var button = + const button = siteData.$$('.site-item').querySelector('.icon-delete-gray'); assertTrue(!!button); assertEquals(button.is, 'paper-icon-button-light'); @@ -35,7 +35,7 @@ .then(function(path) { assertEquals('Hello', path); }); - var sites = [ + const sites = [ {site: 'Hello', id: '1', localData: 'Cookiez!'}, ]; testBrowserProxy.setCookieList(sites); @@ -56,7 +56,7 @@ .then(() => { assertEquals(1, siteData.$.list.items.length); }); - var sites = [ + const sites = [ {site: 'Hello', id: '1', localData: 'Cookiez!'}, {site: 'World', id: '2', localData: 'Cookiez!'}, ];
diff --git a/chrome/test/data/webui/settings/site_details_permission_tests.js b/chrome/test/data/webui/settings/site_details_permission_tests.js index 52bc725..43fd4eb5 100644 --- a/chrome/test/data/webui/settings/site_details_permission_tests.js +++ b/chrome/test/data/webui/settings/site_details_permission_tests.js
@@ -8,13 +8,13 @@ * A site list element created before each test. * @type {SiteDetailsPermission} */ - var testElement; + let testElement; /** * An example pref with only camera allowed. * @type {SiteSettingsPref} */ - var prefs; + let prefs; // Initialize a site-details-permission before each test. setup(function() { @@ -63,7 +63,7 @@ } test('camera category', function() { - var origin = 'https://www.example.com'; + const origin = 'https://www.example.com'; browserProxy.setPrefs(prefs); testElement.category = settings.ContentSettingsTypes.CAMERA; testElement.label = 'Camera'; @@ -75,7 +75,7 @@ assertFalse(testElement.$.details.hidden); - var header = testElement.$.details.querySelector('#permissionHeader'); + const header = testElement.$.details.querySelector('#permissionHeader'); assertEquals( 'Camera', header.innerText.trim(), 'Widget should be labelled correctly'); @@ -97,7 +97,7 @@ }); test('default string is correct', function() { - var origin = 'https://www.example.com'; + const origin = 'https://www.example.com'; browserProxy.setPrefs(prefs); testElement.category = settings.ContentSettingsTypes.CAMERA; testElement.label = 'Camera'; @@ -118,7 +118,7 @@ 'Allow (default)', testElement.$.permission.options[0].text, 'Default setting string should match prefs'); browserProxy.resetResolver('getDefaultValueForContentType'); - var defaultPrefs = { + const defaultPrefs = { camera: { setting: settings.ContentSetting.BLOCK, } @@ -132,7 +132,7 @@ 'Block (default)', testElement.$.permission.options[0].text, 'Default setting string should match prefs'); browserProxy.resetResolver('getDefaultValueForContentType'); - var defaultPrefs = { + const defaultPrefs = { camera: { setting: settings.ContentSetting.ASK, } @@ -149,12 +149,12 @@ }); test('info string is correct', function() { - var origin = 'https://www.example.com'; + const origin = 'https://www.example.com'; testElement.category = settings.ContentSettingsTypes.CAMERA; // Strings that should be shown for the permission sources that don't depend // on the ContentSetting value. - var permissionSourcesNoSetting = {}; + const permissionSourcesNoSetting = {}; permissionSourcesNoSetting[settings.SiteSettingSource.DEFAULT] = ''; permissionSourcesNoSetting[settings.SiteSettingSource.PREFERENCE] = ''; permissionSourcesNoSetting[settings.SiteSettingSource.EMBARGO] = @@ -188,7 +188,7 @@ } // Permissions that have been set by extensions. - var extensionSourceStrings = {}; + const extensionSourceStrings = {}; extensionSourceStrings[settings.ContentSetting.ALLOW] = 'Allowed by an extension'; extensionSourceStrings[settings.ContentSetting.BLOCK] = @@ -212,7 +212,7 @@ } // Permissions that have been set by enterprise policy. - var policySourceStrings = {}; + const policySourceStrings = {}; policySourceStrings[settings.ContentSetting.ALLOW] = 'Allowed by your administrator'; policySourceStrings[settings.ContentSetting.BLOCK] = @@ -249,7 +249,7 @@ }); test('info string correct for drm disabled source', function() { - var origin = 'https://www.example.com'; + const origin = 'https://www.example.com'; testElement.category = settings.ContentSettingsTypes.PROTECTED_CONTENT; testElement.site = { origin: origin, @@ -265,7 +265,7 @@ }); test('info string correct for ads', function() { - var origin = 'https://www.example.com'; + const origin = 'https://www.example.com'; testElement.category = settings.ContentSettingsTypes.ADS; testElement.site = { origin: origin,
diff --git a/chrome/test/data/webui/settings/site_details_tests.js b/chrome/test/data/webui/settings/site_details_tests.js index cd1f0bb..6d8565a 100644 --- a/chrome/test/data/webui/settings/site_details_tests.js +++ b/chrome/test/data/webui/settings/site_details_tests.js
@@ -8,13 +8,13 @@ * A site list element created before each test. * @type {SiteDetails} */ - var testElement; + let testElement; /** * An example pref with 1 pref in each category. * @type {SiteSettingsPref} */ - var prefs; + let prefs; // Helper to create a mock permission preference. function createExceptionForTest(override) { @@ -117,7 +117,7 @@ }); function createSiteDetails(origin) { - var siteDetailsElement = document.createElement('site-details'); + const siteDetailsElement = document.createElement('site-details'); document.body.appendChild(siteDetailsElement); siteDetailsElement.origin = origin; return siteDetailsElement; @@ -126,7 +126,7 @@ test('all site settings are shown', function() { // Add ContentsSettingsTypes which are not supposed to be shown on the Site // Details page here. - var nonSiteDetailsContentSettingsTypes = [ + const nonSiteDetailsContentSettingsTypes = [ settings.ContentSettingsTypes.ADS, settings.ContentSettingsTypes.COOKIES, settings.ContentSettingsTypes.PROTOCOL_HANDLERS, @@ -139,7 +139,7 @@ // A list of optionally shown content settings mapped to their loadTimeData // flag string. - var optionalSiteDetailsContentSettingsTypes = + const optionalSiteDetailsContentSettingsTypes = /** @type {!settings.ContentSettingsType : string} */ ({}); optionalSiteDetailsContentSettingsTypes[settings.ContentSettingsTypes .SOUND] = @@ -153,12 +153,12 @@ // Iterate over each flag in on / off state, assuming that the on state // means the content setting will show, and off hides it. for (contentSetting in optionalSiteDetailsContentSettingsTypes) { - var numContentSettings = + const numContentSettings = Object.keys(settings.ContentSettingsTypes).length - nonSiteDetailsContentSettingsTypes.length - Object.keys(optionalSiteDetailsContentSettingsTypes).length; - var loadTimeDataOverride = {}; + const loadTimeDataOverride = {}; loadTimeDataOverride [optionalSiteDetailsContentSettingsTypes[contentSetting]] = true; loadTimeData.overrideValues(loadTimeDataOverride); @@ -223,9 +223,9 @@ return; // Verify settings match the values specified in |prefs|. - var expectedSetting = settings.ContentSetting.ALLOW; - var expectedSource = settings.SiteSettingSource.PREFERENCE; - var expectedMenuValue = settings.ContentSetting.ALLOW; + let expectedSetting = settings.ContentSetting.ALLOW; + let expectedSource = settings.SiteSettingSource.PREFERENCE; + let expectedMenuValue = settings.ContentSetting.ALLOW; // For all the categories with non-user-set 'Allow' preferences, // update expected values. @@ -268,7 +268,7 @@ ['cancel-button', 'action-button'].forEach(buttonType => { MockInteractions.tap(testElement.$.clearAndReset); assertTrue(testElement.$.confirmDeleteDialog.open); - var actionButtonList = + const actionButtonList = testElement.$.confirmDeleteDialog.getElementsByClassName(buttonType); assertEquals(1, actionButtonList.length); MockInteractions.tap(actionButtonList[0]); @@ -287,7 +287,7 @@ browserProxy.setPrefs(prefs); testElement = createSiteDetails('https://foo.com:443'); - var siteDetailsPermission = + const siteDetailsPermission = testElement.root.querySelector('#notifications'); // Wait for all the permissions to be populated initially. @@ -307,7 +307,7 @@ siteDetailsPermission.$.permission.value); // Set new prefs and make sure only that permission is updated. - var newException = { + const newException = { embeddingOrigin: testElement.origin, origin: testElement.origin, setting: settings.ContentSetting.BLOCK, @@ -338,7 +338,7 @@ }); test('invalid origins navigate back', function() { - var invalid_url = 'invalid url'; + const invalid_url = 'invalid url'; browserProxy.setIsOriginValid(false); settings.navigateTo(settings.routes.SITE_SETTINGS); @@ -369,7 +369,7 @@ loadTimeData.overrideValues({enableSafeBrowsingSubresourceFilter: true}); testElement = createSiteDetails('https://foo.com:443'); - var siteDetailsPermission = testElement.root.querySelector('#ads'); + const siteDetailsPermission = testElement.root.querySelector('#ads'); return browserProxy.whenCalled('isOriginValid') .then(() => { @@ -387,7 +387,7 @@ // permissions. MockInteractions.tap(testElement.$.clearAndReset); assertTrue(testElement.$.confirmDeleteDialog.open); - var actionButtonList = + const actionButtonList = testElement.$.confirmDeleteDialog.getElementsByClassName( 'action-button'); assertEquals(1, actionButtonList.length);
diff --git a/chrome/test/data/webui/settings/site_list_tests.js b/chrome/test/data/webui/settings/site_list_tests.js index e90e86f..e11ddb1 100644 --- a/chrome/test/data/webui/settings/site_list_tests.js +++ b/chrome/test/data/webui/settings/site_list_tests.js
@@ -10,7 +10,7 @@ * all types, even though some might be blank. * @type {SiteSettingsPref} */ -var prefsGeolocation = { +const prefsGeolocation = { exceptions: { ads: [], auto_downloads: [], @@ -61,7 +61,7 @@ * An example of prefs controlledBy policy. * @type {SiteSettingsPref} */ -var prefsControlled = { +const prefsControlled = { exceptions: { plugins: [ { @@ -78,7 +78,7 @@ * An example pref with mixed schemes (present and absent). * @type {SiteSettingsPref} */ -var prefsMixedSchemes = { +const prefsMixedSchemes = { exceptions: { geolocation: [ { @@ -103,7 +103,7 @@ * different providers. * @type {SiteSettingsPref} */ -var prefsMixedProvider = { +const prefsMixedProvider = { exceptions: { geolocation: [ { @@ -132,7 +132,7 @@ * An example pref with with and without embeddingOrigin. * @type {SiteSettingsPref} */ -var prefsMixedEmbeddingOrigin = { +const prefsMixedEmbeddingOrigin = { exceptions: { images: [ { @@ -156,7 +156,7 @@ * state. * @type {SiteSettingsPref} */ -var prefsVarious = { +const prefsVarious = { exceptions: { ads: [], auto_downloads: [], @@ -217,7 +217,7 @@ * An example pref with 1 allowed location item. * @type {SiteSettingsPref} */ -var prefsOneEnabled = { +const prefsOneEnabled = { exceptions: { geolocation: [ { @@ -235,7 +235,7 @@ * An example pref with 1 blocked location item. * @type {SiteSettingsPref} */ -var prefsOneDisabled = { +const prefsOneDisabled = { exceptions: { geolocation: [ { @@ -253,7 +253,7 @@ * An example Cookies pref with 1 in each of the three categories. * @type {SiteSettingsPref} */ -var prefsSessionOnly = { +const prefsSessionOnly = { exceptions: { cookies: [ { @@ -285,7 +285,7 @@ * An example Cookies pref with mixed incognito and regular settings. * @type {SiteSettingsPref} */ -var prefsIncognito = { +const prefsIncognito = { exceptions: { cookies: [ // foo.com is blocked for regular sessions. @@ -321,7 +321,7 @@ * An example Javascript pref with a chrome-extension:// scheme. * @type {SiteSettingsPref} */ -var prefsChromeExtension = { +const prefsChromeExtension = { exceptions: { javascript: [ { @@ -341,13 +341,13 @@ * A site list element created before each test. * @type {SiteList} */ - var testElement; + let testElement; /** * The mock proxy object to use during test. * @type {TestSiteSettingsPrefsBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; suiteSetup(function() { @@ -380,15 +380,15 @@ * open the action menu for. */ function openActionMenu(index) { - var item = testElement.$.listContainer.children[index]; - var dots = item.querySelector('#actionMenuButton'); + const item = testElement.$.listContainer.children[index]; + const dots = item.querySelector('#actionMenuButton'); MockInteractions.tap(dots); Polymer.dom.flush(); } /** Closes the action menu. */ function closeActionMenu() { - var menu = testElement.$$('dialog[is=cr-action-menu]'); + const menu = testElement.$$('dialog[is=cr-action-menu]'); if (menu.open) menu.close(); } @@ -398,11 +398,11 @@ * @param {Array<string>} items The items expected to show in the menu. */ function assertMenu(items) { - var menu = testElement.$$('dialog[is=cr-action-menu]'); + const menu = testElement.$$('dialog[is=cr-action-menu]'); assertTrue(!!menu); - var menuItems = menu.querySelectorAll('button:not([hidden])'); + const menuItems = menu.querySelectorAll('button:not([hidden])'); assertEquals(items.length, menuItems.length); - for (var i = 0; i < items.length; i++) + for (let i = 0; i < items.length; i++) assertEquals(items[i], menuItems[i].textContent.trim()); } @@ -411,8 +411,8 @@ * @return {boolean} Whether the entry is incognito only. */ function hasAnIncognito(listContainer) { - var descriptions = listContainer.querySelectorAll('#siteDescription'); - for (var i = 0; i < descriptions.length; ++i) { + const descriptions = listContainer.querySelectorAll('#siteDescription'); + for (let i = 0; i < descriptions.length; ++i) { if (descriptions[i].textContent == 'Current incognito session') return true; } @@ -445,7 +445,7 @@ .then(function(contentType) { // Flush to be sure list container is populated. Polymer.dom.flush(); - var dotsMenu = + const dotsMenu = testElement.$.listContainer.querySelector('#actionMenuButton'); assertFalse(dotsMenu.hidden); testElement.setAttribute('read-only-list', true); @@ -513,7 +513,7 @@ setUpCategory( settings.ContentSettingsTypes.GEOLOCATION, settings.ContentSetting.ALLOW, prefsGeolocation); - var actionMenu = testElement.$$('dialog[is=cr-action-menu]'); + const actionMenu = testElement.$$('dialog[is=cr-action-menu]'); return browserProxy.whenCalled('getExceptionList') .then(function(contentType) { Polymer.dom.flush(); // Populates action menu. @@ -541,7 +541,7 @@ .then(function(contentType) { assertEquals(settings.ContentSettingsTypes.GEOLOCATION, contentType); assertEquals(3, testElement.sites.length); - for (var i = 0; i < testElement.sites.length; ++i) { + for (let i = 0; i < testElement.sites.length; ++i) { assertEquals( prefsMixedProvider.exceptions.geolocation[i].origin, testElement.sites[i].origin); @@ -555,8 +555,8 @@ }); test('initial BLOCK state is correct', function() { - var contentType = settings.ContentSettingsTypes.GEOLOCATION; - var categorySubtype = settings.ContentSetting.BLOCK; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; + const categorySubtype = settings.ContentSetting.BLOCK; setUpCategory(contentType, categorySubtype, prefsGeolocation); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -579,8 +579,8 @@ }); test('initial SESSION ONLY state is correct', function() { - var contentType = settings.ContentSettingsTypes.COOKIES; - var categorySubtype = settings.ContentSetting.SESSION_ONLY; + const contentType = settings.ContentSettingsTypes.COOKIES; + const categorySubtype = settings.ContentSetting.SESSION_ONLY; setUpCategory(contentType, categorySubtype, prefsSessionOnly); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -601,10 +601,10 @@ }); test('update lists for incognito', function() { - var contentType = settings.ContentSettingsTypes.PLUGINS; - var categorySubtype = settings.ContentSetting.BLOCK; + const contentType = settings.ContentSettingsTypes.PLUGINS; + const categorySubtype = settings.ContentSetting.BLOCK; setUpCategory(contentType, categorySubtype, prefsControlled); - var list = testElement.$.listContainer; + const list = testElement.$.listContainer; return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { Polymer.dom.flush(); @@ -638,8 +638,8 @@ }); test('initial INCOGNITO BLOCK state is correct', function() { - var contentType = settings.ContentSettingsTypes.COOKIES; - var categorySubtype = settings.ContentSetting.BLOCK; + const contentType = settings.ContentSettingsTypes.COOKIES; + const categorySubtype = settings.ContentSetting.BLOCK; setUpCategory(contentType, categorySubtype, prefsIncognito); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -657,7 +657,7 @@ assertMenu(['Allow', 'Clear on exit', 'Edit', 'Remove'], testElement); // Select 'Remove' from menu. - var remove = testElement.$.reset; + const remove = testElement.$.reset; assertTrue(!!remove); MockInteractions.tap(remove); return browserProxy.whenCalled('resetCategoryPermissionForPattern'); @@ -671,8 +671,8 @@ }); test('initial INCOGNITO ALLOW state is correct', function() { - var contentType = settings.ContentSettingsTypes.COOKIES; - var categorySubtype = settings.ContentSetting.ALLOW; + const contentType = settings.ContentSettingsTypes.COOKIES; + const categorySubtype = settings.ContentSetting.ALLOW; setUpCategory(contentType, categorySubtype, prefsIncognito); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -695,7 +695,7 @@ // Select 'Remove' from menu on 'foo.com'. openActionMenu(1); - var remove = testElement.$.reset; + const remove = testElement.$.reset; assertTrue(!!remove); MockInteractions.tap(remove); return browserProxy.whenCalled('resetCategoryPermissionForPattern'); @@ -712,8 +712,8 @@ testElement.readOnlyList = true; Polymer.dom.flush(); - var contentType = settings.ContentSettingsTypes.GEOLOCATION; - var categorySubtype = settings.ContentSetting.ALLOW; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; + const categorySubtype = settings.ContentSetting.ALLOW; setUpCategory(contentType, categorySubtype, prefsOneEnabled); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -727,15 +727,15 @@ Polymer.dom.flush(); - var item = testElement.$.listContainer.children[0]; + const item = testElement.$.listContainer.children[0]; // Assert action button is hidden. - var dots = item.querySelector('#actionMenuButton'); + const dots = item.querySelector('#actionMenuButton'); assertTrue(!!dots); assertTrue(dots.hidden); // Assert reset button is visible. - var resetButton = item.querySelector('#resetSite'); + const resetButton = item.querySelector('#resetSite'); assertTrue(!!resetButton); assertFalse(resetButton.hidden); @@ -759,9 +759,9 @@ openActionMenu(0); assertMenu(['Allow', 'Block', 'Edit', 'Remove'], testElement); - var menu = testElement.$$('dialog[is=cr-action-menu]'); + const menu = testElement.$$('dialog[is=cr-action-menu]'); assertTrue(menu.open); - var edit = testElement.$.edit; + const edit = testElement.$.edit; assertTrue(!!edit); MockInteractions.tap(edit); Polymer.dom.flush(); @@ -772,7 +772,7 @@ }); test('list items shown and clickable when data is present', function() { - var contentType = settings.ContentSettingsTypes.GEOLOCATION; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; setUpCategory(contentType, settings.ContentSetting.ALLOW, prefsGeolocation); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -792,8 +792,8 @@ assertFalse(!!testElement.selectedOrigin); // Validate that the sites are shown in UI and can be selected. - var firstItem = testElement.$.listContainer.children[0]; - var clickable = firstItem.querySelector('.middle'); + const firstItem = testElement.$.listContainer.children[0]; + const clickable = firstItem.querySelector('.middle'); assertTrue(!!clickable); MockInteractions.tap(clickable); assertEquals( @@ -804,7 +804,7 @@ test('Block list open when Allow list is empty', function() { // Prefs: One item in Block list, nothing in Allow list. - var contentType = settings.ContentSettingsTypes.GEOLOCATION; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; setUpCategory(contentType, settings.ContentSetting.BLOCK, prefsOneDisabled); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -818,7 +818,7 @@ test('Block list closed when Allow list is not empty', function() { // Prefs: Items in both Block and Allow list. - var contentType = settings.ContentSettingsTypes.GEOLOCATION; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; setUpCategory(contentType, settings.ContentSetting.BLOCK, prefsGeolocation); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -830,7 +830,7 @@ test('Allow list is always open (Block list empty)', function() { // Prefs: One item in Allow list, nothing in Block list. - var contentType = settings.ContentSettingsTypes.GEOLOCATION; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; setUpCategory(contentType, settings.ContentSetting.ALLOW, prefsOneEnabled); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -844,7 +844,7 @@ test('Allow list is always open (Block list non-empty)', function() { // Prefs: Items in both Block and Allow list. - var contentType = settings.ContentSettingsTypes.GEOLOCATION; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; setUpCategory(contentType, settings.ContentSetting.ALLOW, prefsGeolocation); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -858,7 +858,7 @@ test('Block list not hidden when empty', function() { // Prefs: One item in Allow list, nothing in Block list. - var contentType = settings.ContentSettingsTypes.GEOLOCATION; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; setUpCategory(contentType, settings.ContentSetting.BLOCK, prefsOneEnabled); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -869,7 +869,7 @@ test('Allow list not hidden when empty', function() { // Prefs: One item in Block list, nothing in Allow list. - var contentType = settings.ContentSettingsTypes.GEOLOCATION; + const contentType = settings.ContentSettingsTypes.GEOLOCATION; setUpCategory(contentType, settings.ContentSetting.ALLOW, prefsOneDisabled); return browserProxy.whenCalled('getExceptionList') .then(function(actualContentType) { @@ -887,11 +887,11 @@ // Required for firstItem to be found below. Polymer.dom.flush(); // Validate that embeddingOrigin sites cannot be edited. - var firstItem = testElement.$.listContainer.children[0]; + const firstItem = testElement.$.listContainer.children[0]; assertTrue(firstItem.querySelector('#actionMenuButton').hidden); assertFalse(firstItem.querySelector('#resetSite').hidden); // Validate that non-embeddingOrigin sites can be edited. - var secondItem = testElement.$.listContainer.children[1]; + const secondItem = testElement.$.listContainer.children[1]; assertFalse(secondItem.querySelector('#actionMenuButton').hidden); assertTrue(secondItem.querySelector('#resetSite').hidden); }); @@ -917,7 +917,7 @@ .then(function(contentType) { Polymer.dom.flush(); openActionMenu(0); - var allow = testElement.$.allow; + const allow = testElement.$.allow; assertTrue(!!allow); MockInteractions.tap(allow); return browserProxy.whenCalled('setCategoryPermissionForPattern'); @@ -934,7 +934,7 @@ openActionMenu(0); assertMenu(['Allow', 'Edit', 'Remove'], testElement); - var allow = testElement.$.allow; + const allow = testElement.$.allow; assertTrue(!!allow); MockInteractions.tap(allow); return browserProxy.whenCalled('setCategoryPermissionForPattern'); @@ -950,14 +950,14 @@ }); suite('EditExceptionDialog', function() { - /** @type {SettingsEditExceptionDialogElement} */ var dialog; + /** @type {SettingsEditExceptionDialogElement} */ let dialog; /** * The dialog tests don't call |getExceptionList| so the exception needs to * be processes as a |SiteSettingsPref|. * @type {SiteSettingsPref} */ - var cookieException = { + const cookieException = { category: 'cookies', embeddingOrigin: 'http://foo.com', incognito: false, @@ -981,11 +981,11 @@ }); test('invalid input', function() { - var input = dialog.$$('paper-input'); + const input = dialog.$$('paper-input'); assertTrue(!!input); assertFalse(input.invalid); - var actionButton = dialog.$.actionButton; + const actionButton = dialog.$.actionButton; assertTrue(!!actionButton); assertFalse(actionButton.disabled); @@ -998,7 +998,7 @@ // Simulate user input of invalid text. browserProxy.setIsPatternValid(false); - var expectedPattern = 'foobarbaz'; + const expectedPattern = 'foobarbaz'; input.value = expectedPattern; input.fire('input'); @@ -1010,13 +1010,13 @@ }); test('action button calls proxy', function() { - var input = dialog.$$('paper-input'); + const input = dialog.$$('paper-input'); assertTrue(!!input); // Simulate user edit. - var newValue = input.value + ':1234'; + const newValue = input.value + ':1234'; input.value = newValue; - var actionButton = dialog.$.actionButton; + const actionButton = dialog.$.actionButton; assertTrue(!!actionButton); assertFalse(actionButton.disabled); @@ -1043,7 +1043,7 @@ }); suite('AddExceptionDialog', function() { - /** @type {AddSiteDialogElement} */ var dialog; + /** @type {AddSiteDialogElement} */ let dialog; setup(function() { browserProxy = new TestSiteSettingsPrefsBrowserProxy(); @@ -1076,17 +1076,17 @@ test('invalid input', function() { // Initially the action button should be disabled, but the error warning // should not be shown for an empty input. - var input = dialog.$$('paper-input'); + const input = dialog.$$('paper-input'); assertTrue(!!input); assertFalse(input.invalid); - var actionButton = dialog.$.add; + const actionButton = dialog.$.add; assertTrue(!!actionButton); assertTrue(actionButton.disabled); // Simulate user input of invalid text. browserProxy.setIsPatternValid(false); - var expectedPattern = 'foobarbaz'; + const expectedPattern = 'foobarbaz'; input.value = expectedPattern; input.fire('input');
diff --git a/chrome/test/data/webui/settings/site_settings_page_browsertest.js b/chrome/test/data/webui/settings/site_settings_page_browsertest.js index 89274a9..b73c09d4 100644 --- a/chrome/test/data/webui/settings/site_settings_page_browsertest.js +++ b/chrome/test/data/webui/settings/site_settings_page_browsertest.js
@@ -23,7 +23,7 @@ GEN('#endif'); TEST_F('SettingsSiteSettingsPageBrowserTest', 'MAYBE_labels', function() { suite('Site settings page', function() { - var ui; + let ui; suiteSetup(function() { ui = assert(document.createElement('settings-site-settings-page'));
diff --git a/chrome/test/data/webui/settings/startup_urls_page_test.js b/chrome/test/data/webui/settings/startup_urls_page_test.js index 27353a7..3d49c50e 100644 --- a/chrome/test/data/webui/settings/startup_urls_page_test.js +++ b/chrome/test/data/webui/settings/startup_urls_page_test.js
@@ -60,9 +60,9 @@ suite('StartupUrlDialog', function() { /** @type {?SettingsStartupUrlDialogElement} */ - var dialog = null; + let dialog = null; - var browserProxy = null; + let browserProxy = null; /** * Triggers an 'input' event on the given text input field, which triggers @@ -88,12 +88,12 @@ assertTrue(dialog.$.dialog.open); // Assert that the "Add" button is disabled. - var actionButton = dialog.$.actionButton; + const actionButton = dialog.$.actionButton; assertTrue(!!actionButton); assertTrue(actionButton.disabled); // Assert that the text field is empty. - var inputElement = dialog.$.url; + const inputElement = dialog.$.url; assertTrue(!!inputElement); assertEquals('', inputElement.value); }); @@ -104,11 +104,11 @@ assertTrue(dialog.$.dialog.open); // Assert that the "Edit" button is enabled. - var actionButton = dialog.$.actionButton; + const actionButton = dialog.$.actionButton; assertTrue(!!actionButton); assertFalse(actionButton.disabled); // Assert that the text field is pre-populated. - var inputElement = dialog.$.url; + const inputElement = dialog.$.url; assertTrue(!!inputElement); assertEquals(dialog.model.url, inputElement.value); }); @@ -118,11 +118,11 @@ test('Validation', function() { document.body.appendChild(dialog); - var actionButton = dialog.$.actionButton; + const actionButton = dialog.$.actionButton; assertTrue(actionButton.disabled); - var inputElement = dialog.$.url; + const inputElement = dialog.$.url; - var expectedUrl = "dummy-foo.com"; + const expectedUrl = "dummy-foo.com"; inputElement.value = expectedUrl; browserProxy.setUrlValidity(false); pressSpace(inputElement); @@ -147,7 +147,7 @@ * @param {string} proxyMethodName */ function testProxyCalled(proxyMethodName) { - var actionButton = dialog.$.actionButton; + const actionButton = dialog.$.actionButton; actionButton.disabled = false; // Test that the dialog remains open if the user somehow manages to submit @@ -182,7 +182,7 @@ document.body.appendChild(dialog); // Input a URL and force validation. - var inputElement = dialog.$.url; + const inputElement = dialog.$.url; inputElement.value = 'foo.com'; pressSpace(inputElement); @@ -197,9 +197,9 @@ suite('StartupUrlsPage', function() { /** @type {?SettingsStartupUrlsPageElement} */ - var page = null; + let page = null; - var browserProxy = null; + let browserProxy = null; setup(function() { browserProxy = new TestStartupUrlsPageBrowserProxy(); @@ -226,14 +226,14 @@ }); test('UseCurrentPages', function() { - var useCurrentPagesButton = page.$$('#useCurrentPages > a'); + const useCurrentPagesButton = page.$$('#useCurrentPages > a'); assertTrue(!!useCurrentPagesButton); MockInteractions.tap(useCurrentPagesButton); return browserProxy.whenCalled('useCurrentPages'); }); test('AddPage_OpensDialog', function() { - var addPageButton = page.$$('#addPage > a'); + const addPageButton = page.$$('#addPage > a'); assertTrue(!!addPageButton); assertFalse(!!page.$$('settings-startup-url-dialog')); @@ -252,14 +252,14 @@ }); test('StartupPagesChanges_CloseOpenEditDialog', function() { - var entry1 = { + const entry1 = { modelIndex: 2, title: 'Test page 1', tooltip: 'test tooltip', url: 'chrome://bar', }; - var entry2 = { + const entry2 = { modelIndex: 2, title: 'Test page 2', tooltip: 'test tooltip', @@ -312,9 +312,9 @@ suite('StartupUrlEntry', function() { /** @type {?SettingsStartupUrlEntryElement} */ - var element = null; + let element = null; - var browserProxy = null; + let browserProxy = null; setup(function() { browserProxy = new TestStartupUrlsPageBrowserProxy(); @@ -338,7 +338,7 @@ Polymer.dom.flush(); assertTrue(!!element.$$('dialog[is=cr-action-menu]')); - var removeButton = element.shadowRoot.querySelector('#remove'); + const removeButton = element.shadowRoot.querySelector('#remove'); MockInteractions.tap(removeButton); return browserProxy.whenCalled('removeStartupPage').then( function(modelIndex) {
diff --git a/chrome/test/data/webui/settings/system_page_tests.js b/chrome/test/data/webui/settings/system_page_tests.js index e86967f4..38ad358 100644 --- a/chrome/test/data/webui/settings/system_page_tests.js +++ b/chrome/test/data/webui/settings/system_page_tests.js
@@ -3,7 +3,7 @@ // found in the LICENSE file. /** @const {boolean} */ -var HARDWARE_ACCELERATION_AT_STARTUP = true; +const HARDWARE_ACCELERATION_AT_STARTUP = true; /** @implements {settings.SystemPageBrowserProxy} */ class TestSystemPageBrowserProxy extends TestBrowserProxy { @@ -24,13 +24,13 @@ suite('settings system page', function() { /** @type {TestSystemPageBrowserProxy} */ - var systemBrowserProxy; + let systemBrowserProxy; /** @type {settings.TestLifetimeBrowserProxy} */ - var lifetimeBrowserProxy; + let lifetimeBrowserProxy; /** @type {SettingsSystemPageElement} */ - var systemPage; + let systemPage; setup(function() { PolymerTest.clearBody(); @@ -69,7 +69,7 @@ }); test('restart button', function() { - var control = systemPage.$.hardwareAcceleration; + const control = systemPage.$.hardwareAcceleration; expectEquals(HARDWARE_ACCELERATION_AT_STARTUP, control.checked); // Restart button should be hidden by default. @@ -81,7 +81,7 @@ Polymer.dom.flush(); expectNotEquals(HARDWARE_ACCELERATION_AT_STARTUP, control.checked); - var restart = control.querySelector('paper-button'); + const restart = control.querySelector('paper-button'); expectTrue(!!restart); // The "RESTART" button should be showing now. MockInteractions.tap(restart); @@ -94,8 +94,8 @@ }); test('proxy row enforcement', function() { - var control = systemPage.$.proxy; - var showProxyButton = control.querySelector('button'); + const control = systemPage.$.proxy; + const showProxyButton = control.querySelector('button'); assertTrue(control.hasAttribute('actionable')); assertEquals(null, control.querySelector('cr-policy-pref-indicator')); assertFalse(showProxyButton.hidden);
diff --git a/chrome/test/data/webui/settings/test_android_apps_browser_proxy.js b/chrome/test/data/webui/settings/test_android_apps_browser_proxy.js index d4395ab..11a28146 100644 --- a/chrome/test/data/webui/settings/test_android_apps_browser_proxy.js +++ b/chrome/test/data/webui/settings/test_android_apps_browser_proxy.js
@@ -25,7 +25,7 @@ setAndroidAppsState(playStoreEnabled, settingsAppAvailable) { // We need to make sure to pass a new object here, otherwise the property // change event may not get fired in the listener. - var appsInfo = { + const appsInfo = { playStoreEnabled: playStoreEnabled, settingsAppAvailable: settingsAppAvailable, };
diff --git a/chrome/test/data/webui/settings/test_languages_browser_proxy.js b/chrome/test/data/webui/settings/test_languages_browser_proxy.js index aadf0dc6..9ec78798 100644 --- a/chrome/test/data/webui/settings/test_languages_browser_proxy.js +++ b/chrome/test/data/webui/settings/test_languages_browser_proxy.js
@@ -6,7 +6,7 @@ /** @implements {settings.LanguagesBrowserProxy} */ class TestLanguagesBrowserProxy extends TestBrowserProxy { constructor() { - var methodNames = []; + const methodNames = []; if (cr.isChromeOS || cr.isWindows) methodNames.push('getProspectiveUILanguage');
diff --git a/chrome/test/data/webui/settings/test_lifetime_browser_proxy.js b/chrome/test/data/webui/settings/test_lifetime_browser_proxy.js index 16a48f9..2cc201e8 100644 --- a/chrome/test/data/webui/settings/test_lifetime_browser_proxy.js +++ b/chrome/test/data/webui/settings/test_lifetime_browser_proxy.js
@@ -10,7 +10,7 @@ */ class TestLifetimeBrowserProxy extends TestBrowserProxy { constructor() { - var methodNames = ['restart', 'relaunch']; + const methodNames = ['restart', 'relaunch']; if (cr.isChromeOS) methodNames.push('signOutAndRestart', 'factoryReset');
diff --git a/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js b/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js index 0ebb542..1b2e7f5 100644 --- a/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js +++ b/chrome/test/data/webui/settings/test_site_settings_prefs_browser_proxy.js
@@ -8,7 +8,7 @@ * @typedef {{defaults: Map<string, !DefaultContentSetting>, * exceptions: !Map<string, !Array<!RawSiteException>>}} */ -var SiteSettingsPref; +let SiteSettingsPref; /** * An example empty pref. @@ -17,7 +17,7 @@ * for these instead. * @type {SiteSettingsPref} */ -var prefsEmpty = { +const prefsEmpty = { defaults: { ads: {}, auto_downloads: {}, @@ -127,9 +127,9 @@ this.prefs_ = prefs; // Notify all listeners that their data may be out of date. - for (var type in this.prefs_.exceptions) { + for (const type in this.prefs_.exceptions) { let exceptionList = this.prefs_.exceptions[type]; - for (var i = 0; i < exceptionList.length; ++i) { + for (let i = 0; i < exceptionList.length; ++i) { cr.webUIListenerCallback( 'contentSettingSitePermissionChanged', type, exceptionList[i].origin, ''); @@ -150,7 +150,7 @@ this.prefs_.defaults = defaultPrefs; // Notify all listeners that their data may be out of date. - for (var type in settings.ContentSettingsTypes) { + for (const type in settings.ContentSettingsTypes) { cr.webUIListenerCallback( 'contentSettingCategoryChanged', settings.ContentSettingsTypes[type]); } @@ -165,7 +165,7 @@ */ setSingleException(category, newException) { // Remove entries from the current prefs which have the same origin. - var newPrefs = /** @type {!Array<RawSiteException>} */ + const newPrefs = /** @type {!Array<RawSiteException>} */ (this.prefs_.exceptions[category].filter((categoryException) => { if (categoryException.origin != newException.origin) return true; @@ -211,10 +211,10 @@ /** @override */ setOriginPermissions(origin, contentTypes, blanketSetting) { - for (var type in this.prefs_.exceptions) { + for (const type in this.prefs_.exceptions) { let exceptionList = this.prefs_.exceptions[type]; - for (var i = 0; i < exceptionList.length; ++i) { - var effectiveSetting = blanketSetting; + for (let i = 0; i < exceptionList.length; ++i) { + let effectiveSetting = blanketSetting; if (blanketSetting == settings.ContentSetting.DEFAULT) { effectiveSetting = this.prefs_.defaults[type].setting; exceptionList[i].source = settings.SiteSettingSource.DEFAULT; @@ -232,7 +232,7 @@ getDefaultValueForContentType(contentType) { this.methodCalled('getDefaultValueForContentType', contentType); - var pref = undefined; + let pref = undefined; if (contentType == settings.ContentSettingsTypes.ADS) { pref = this.prefs_.defaults.ads; } else if ( @@ -283,7 +283,7 @@ getExceptionList(contentType) { this.methodCalled('getExceptionList', contentType); - var pref = undefined; + let pref = undefined; if (contentType == settings.ContentSettingsTypes.ADS) pref = this.prefs_.exceptions.ads; else if (contentType == settings.ContentSettingsTypes.AUTOMATIC_DOWNLOADS) @@ -326,8 +326,8 @@ assert(pref != undefined, 'Pref is missing for ' + contentType); if (this.hasIncognito_) { - var incognitoElements = []; - for (var i = 0; i < pref.length; ++i) + const incognitoElements = []; + for (let i = 0; i < pref.length; ++i) incognitoElements.push(Object.assign({incognito: true}, pref[i])); pref = pref.concat(incognitoElements); } @@ -374,7 +374,7 @@ getOriginPermissions(origin, contentTypes) { this.methodCalled('getOriginPermissions', [origin, contentTypes]); - var exceptionList = []; + const exceptionList = []; contentTypes.forEach(function(contentType) { // Convert |contentType| to its corresponding pref name, if different. if (contentType == settings.ContentSettingsTypes.GEOLOCATION) { @@ -395,8 +395,8 @@ contentType = 'unsandboxed_plugins'; } - var setting; - var source; + let setting; + let source; this.prefs_.exceptions[contentType].some((originPrefs) => { if (originPrefs.origin == origin) { setting = originPrefs.setting;
diff --git a/chrome/test/data/webui/settings/test_util.js b/chrome/test/data/webui/settings/test_util.js index 46f85dad..0fac3a3 100644 --- a/chrome/test/data/webui/settings/test_util.js +++ b/chrome/test/data/webui/settings/test_util.js
@@ -18,7 +18,7 @@ return isDone() ? Promise.resolve() : new Promise(function(resolve) { new MutationObserver(function(mutations, observer) { - for (var mutation of mutations) { + for (const mutation of mutations) { assertEquals('attributes', mutation.type); if (mutation.attributeName == attributeName && isDone()) { observer.disconnect(); @@ -55,7 +55,7 @@ * @param {string} property */ function fakeDataBind(el1, el2, property) { - var forwardChange = function(el, event) { + const forwardChange = function(el, event) { if (event.detail.hasOwnProperty('path')) el.notifyPath(event.detail.path, event.detail.value); else
diff --git a/chrome/test/data/webui/settings/usb_devices_tests.js b/chrome/test/data/webui/settings/usb_devices_tests.js index beeaae4..1d0afb9 100644 --- a/chrome/test/data/webui/settings/usb_devices_tests.js +++ b/chrome/test/data/webui/settings/usb_devices_tests.js
@@ -8,19 +8,19 @@ * A dummy usb-devices element created before each test. * @type {UsbDevices} */ - var testElement; + let testElement; /** * The mock proxy object to use during test. * @type {TestSiteSettingsPrefsBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** * An example USB device entry list. * @type {!Array<UsbDeviceEntry>} */ - var deviceList = [ + const deviceList = [ { embeddingOrigin: 'device-1-embedding-origin', object: { @@ -72,7 +72,7 @@ test('empty devices list', function() { return initPage().then(function() { - var listItems = testElement.root.querySelectorAll('.list-item'); + const listItems = testElement.root.querySelectorAll('.list-item'); assertEquals(0, listItems.length); }); }); @@ -81,7 +81,7 @@ browserProxy.setUsbDevices(deviceList); return initPage().then(function() { - var listItems = testElement.root.querySelectorAll('.list-item'); + const listItems = testElement.root.querySelectorAll('.list-item'); assertEquals(deviceList.length, listItems.length); }); }); @@ -90,10 +90,10 @@ browserProxy.setUsbDevices(deviceList); return initPage().then(function() { - var menuButton = testElement.$$('button.icon-more-vert'); + const menuButton = testElement.$$('button.icon-more-vert'); assertTrue(!!menuButton); MockInteractions.tap(menuButton); - var dialog = testElement.$$('dialog[is=cr-action-menu]'); + const dialog = testElement.$$('dialog[is=cr-action-menu]'); assertTrue(dialog.open); }); }); @@ -108,9 +108,9 @@ * Test whether or not clicking remove-button sends the correct * parameters to the browserProxy.removeUsbDevice() function. */ - var menuButton = testElement.root.querySelectorAll( + const menuButton = testElement.root.querySelectorAll( 'button.icon-more-vert')[indexToRemove]; - var removeButton = testElement.$.removeButton; + const removeButton = testElement.$.removeButton; MockInteractions.tap(menuButton); MockInteractions.tap(removeButton); return browserProxy.whenCalled('removeUsbDevice').then(function(args) { @@ -122,7 +122,7 @@ assertEquals(deviceList[indexToRemove].embeddingOrigin, args[1]); assertEquals(deviceList[indexToRemove].object, args[2]); - var dialog = testElement.$$('dialog[is=cr-action-menu]'); + const dialog = testElement.$$('dialog[is=cr-action-menu]'); assertFalse(dialog.open); }); } @@ -130,7 +130,7 @@ test('try removing items using remove button', function() { browserProxy.setUsbDevices(deviceList); - var self = this; + const self = this; return initPage() .then(function() {
diff --git a/chrome/test/data/webui/settings/zoom_levels_tests.js b/chrome/test/data/webui/settings/zoom_levels_tests.js index 4aefcad..bf3d458 100644 --- a/chrome/test/data/webui/settings/zoom_levels_tests.js +++ b/chrome/test/data/webui/settings/zoom_levels_tests.js
@@ -8,19 +8,19 @@ * A zoom levels category created before each test. * @type {ZoomLevels} */ - var testElement; + let testElement; /** * The mock proxy object to use during test. * @type {TestSiteSettingsPrefsBrowserProxy} */ - var browserProxy = null; + let browserProxy = null; /** * An example zoom list. * @type {!Array<ZoomLevelEntry>} */ - var zoomList = [ + const zoomList = [ { origin: 'http://www.google.com', displayName: 'http://www.google.com', @@ -70,7 +70,7 @@ } test('empty zoom state', function() { - var list = testElement.$.list; + const list = testElement.$.list; assertTrue(!!list); assertEquals(0, list.items.length); assertEquals( @@ -83,14 +83,14 @@ return initPage() .then(function() { - var list = testElement.$.list; + const list = testElement.$.list; assertTrue(!!list); assertEquals(2, list.items.length); assertFalse(!!testElement.$$('#empty')); assertEquals( 2, testElement.shadowRoot.querySelectorAll('.list-item').length); - var removeButton = getRemoveButton(testElement.$.listContainer, 0); + const removeButton = getRemoveButton(testElement.$.listContainer, 0); assert(!!removeButton); MockInteractions.tap(removeButton); return browserProxy.whenCalled('removeZoomLevel');
diff --git a/chrome/test/vr/perf/latency/webvr_latency_test.py b/chrome/test/vr/perf/latency/webvr_latency_test.py index 0dfd877..33a2e14 100644 --- a/chrome/test/vr/perf/latency/webvr_latency_test.py +++ b/chrome/test/vr/perf/latency/webvr_latency_test.py
@@ -20,12 +20,6 @@ MOTOPHO_THREAD_TERMINATION_TIMEOUT = 2 MOTOPHO_THREAD_RETRIES = 4 DEFAULT_URLS = [ - # TODO(bsheedy): See about having versioned copies of the flicker app - # instead of using personal github. - # Purely a flicker app - no additional CPU/GPU load. - 'https://weableandbob.github.io/Motopho/' - 'flicker_apps/webvr/webvr-flicker-app-klaus.html?' - 'polyfill=0\&canvasClickPresents=1', # URLs that render 3D scenes in addition to the Motopho patch. # Heavy CPU load, moderate GPU load. 'https://webvr.info/samples/test-slow-render.html?'
diff --git a/chrome/utility/DEPS b/chrome/utility/DEPS index 6797a1f..2523034 100644 --- a/chrome/utility/DEPS +++ b/chrome/utility/DEPS
@@ -50,6 +50,7 @@ "+components/font_service/public/interfaces", "+mash/quick_launch/public", "+mash/quick_launch/quick_launch.h", + "+services/ui/common/image_cursors_set.h", "+services/ui/public", "+services/ui/service.h", ],
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc index af47855..ffaa2821 100644 --- a/chrome/utility/chrome_content_utility_client.cc +++ b/chrome/utility/chrome_content_utility_client.cc
@@ -62,7 +62,7 @@ #endif #endif -#if BUILDFLAG(ENABLE_MUS) +#if defined(OS_CHROMEOS) #include "chrome/utility/mash_service_factory.h" #endif @@ -144,6 +144,10 @@ (BUILDFLAG(ENABLE_BASIC_PRINTING) && defined(OS_WIN)) handlers_.push_back(base::MakeUnique<printing::PrintingHandler>()); #endif + +#if defined(OS_CHROMEOS) + mash_service_factory_ = std::make_unique<MashServiceFactory>(); +#endif } ChromeContentUtilityClient::~ChromeContentUtilityClient() = default; @@ -293,7 +297,8 @@ #endif // BUILDFLAG(ENABLE_EXTENSIONS) #if defined(OS_CHROMEOS) - RegisterOutOfProcessMashServices(services); + // TODO(jamescook): Figure out why we have to do this when not using --mash. + mash_service_factory_->RegisterOutOfProcessServices(services); #endif }
diff --git a/chrome/utility/chrome_content_utility_client.h b/chrome/utility/chrome_content_utility_client.h index c0132fe..b1967a0 100644 --- a/chrome/utility/chrome_content_utility_client.h +++ b/chrome/utility/chrome_content_utility_client.h
@@ -11,6 +11,7 @@ #include "base/macros.h" #include "content/public/utility/content_utility_client.h" +class MashServiceFactory; class UtilityMessageHandler; class ChromeContentUtilityClient : public content::ContentUtilityClient { @@ -42,6 +43,11 @@ // True if the utility process runs with elevated privileges. bool utility_process_running_elevated_; +#if defined(OS_CHROMEOS) + // Must be owned by utility main thread. + std::unique_ptr<MashServiceFactory> mash_service_factory_; +#endif + DISALLOW_COPY_AND_ASSIGN(ChromeContentUtilityClient); };
diff --git a/chrome/utility/mash_service_factory.cc b/chrome/utility/mash_service_factory.cc index f566bc98..ef39749 100644 --- a/chrome/utility/mash_service_factory.cc +++ b/chrome/utility/mash_service_factory.cc
@@ -16,6 +16,7 @@ #include "components/font_service/public/interfaces/constants.mojom.h" #include "mash/quick_launch/public/interfaces/constants.mojom.h" #include "mash/quick_launch/quick_launch.h" +#include "services/ui/common/image_cursors_set.h" #include "services/ui/public/interfaces/constants.mojom.h" #include "services/ui/service.h" @@ -32,25 +33,31 @@ services->emplace(name, service_info); } +// Runs on the UI service main thread. // NOTE: For --mus the UI service is created at the //chrome/browser layer, // not in //content. See ServiceManagerContext. std::unique_ptr<service_manager::Service> CreateUiService( - const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) { - ui::Service::InProcessConfig config; - config.resource_runner = task_runner; - // TODO(jamescook): Fix cursor loading. - config.should_host_viz = true; - return std::make_unique<ui::Service>(&config); + const scoped_refptr<base::SingleThreadTaskRunner>& resource_runner, + base::WeakPtr<ui::ImageCursorsSet> image_cursors_set_weak_ptr) { + ui::Service::InitParams params; + params.running_standalone = false; + params.resource_runner = resource_runner; + params.image_cursors_set_weak_ptr = image_cursors_set_weak_ptr; + params.should_host_viz = true; + return std::make_unique<ui::Service>(params); } +// Runs on the utility process main thread. void RegisterUiService( - content::ContentUtilityClient::StaticServiceMap* services) { + content::ContentUtilityClient::StaticServiceMap* services, + ui::ImageCursorsSet* cursors) { service_manager::EmbeddedServiceInfo service_info; service_info.use_own_thread = true; service_info.message_loop_type = base::MessageLoop::TYPE_UI; service_info.thread_priority = base::ThreadPriority::DISPLAY; - service_info.factory = base::BindRepeating( - &CreateUiService, base::ThreadTaskRunnerHandle::Get()); + service_info.factory = + base::BindRepeating(&CreateUiService, base::ThreadTaskRunnerHandle::Get(), + cursors->GetWeakPtr()); services->emplace(ui::mojom::kServiceName, service_info); } @@ -78,9 +85,14 @@ } // namespace -void RegisterOutOfProcessMashServices( +MashServiceFactory::MashServiceFactory() + : cursors_(std::make_unique<ui::ImageCursorsSet>()) {} + +MashServiceFactory::~MashServiceFactory() = default; + +void MashServiceFactory::RegisterOutOfProcessServices( content::ContentUtilityClient::StaticServiceMap* services) { - RegisterUiService(services); + RegisterUiService(services, cursors_.get()); RegisterMashService(services, mash::quick_launch::mojom::kServiceName, &CreateQuickLaunch); RegisterMashService(services, ash::mojom::kServiceName, &CreateAshService);
diff --git a/chrome/utility/mash_service_factory.h b/chrome/utility/mash_service_factory.h index d414da95..6cb915c5 100644 --- a/chrome/utility/mash_service_factory.h +++ b/chrome/utility/mash_service_factory.h
@@ -5,10 +5,29 @@ #ifndef CHROME_UTILITY_MASH_SERVICE_FACTORY_H_ #define CHROME_UTILITY_MASH_SERVICE_FACTORY_H_ +#include <memory> + #include "content/public/utility/content_utility_client.h" -// Registers the out-of-process services for --mash. -void RegisterOutOfProcessMashServices( - content::ContentUtilityClient::StaticServiceMap* services); +namespace ui { +class ImageCursorsSet; +} + +// Lives on the utility process main thread. +class MashServiceFactory { + public: + MashServiceFactory(); + ~MashServiceFactory(); + + // Registers out-of-process services for --mash. + void RegisterOutOfProcessServices( + content::ContentUtilityClient::StaticServiceMap* services); + + private: + // Must live on the utility main thread. + std::unique_ptr<ui::ImageCursorsSet> cursors_; + + DISALLOW_COPY_AND_ASSIGN(MashServiceFactory); +}; #endif // CHROME_UTILITY_MASH_SERVICE_FACTORY_H_
diff --git a/chrome_elf/nt_registry/nt_registry.cc b/chrome_elf/nt_registry/nt_registry.cc index 69b11c75..f716b56 100644 --- a/chrome_elf/nt_registry/nt_registry.cc +++ b/chrome_elf/nt_registry/nt_registry.cc
@@ -30,8 +30,8 @@ wchar_t g_kRegPathHKCU[nt::g_kRegMaxPathLen + 1] = L""; wchar_t g_current_user_sid_string[nt::g_kRegMaxPathLen + 1] = L""; -// Max number of tries for system API calls when STATUS_BUFFER_TOO_SMALL can be -// returned. +// Max number of tries for system API calls when STATUS_BUFFER_OVERFLOW or +// STATUS_BUFFER_TOO_SMALL can be returned. enum { kMaxTries = 5 }; // For testing only. @@ -808,16 +808,18 @@ // changes. NTSTATUS ntstatus = STATUS_UNSUCCESSFUL; int tries = 0; - DWORD size_needed = 1; - std::vector<BYTE> buffer; KEY_VALUE_FULL_INFORMATION* value_info = nullptr; + DWORD size_needed = sizeof(*value_info); + std::vector<BYTE> buffer(size_needed); do { buffer.resize(size_needed); value_info = reinterpret_cast<KEY_VALUE_FULL_INFORMATION*>(buffer.data()); ntstatus = g_nt_query_value_key(key, &value_uni, KeyValueFullInformation, value_info, size_needed, &size_needed); - } while (ntstatus == STATUS_BUFFER_TOO_SMALL && ++tries < kMaxTries); + } while ((ntstatus == STATUS_BUFFER_OVERFLOW || + ntstatus == STATUS_BUFFER_TOO_SMALL) && + ++tries < kMaxTries); if (!NT_SUCCESS(ntstatus)) return false; @@ -1113,16 +1115,18 @@ int tries = 0; // Start with sizeof the structure. It's very common for the variable sized // "Class" element to be of length 0. - DWORD size_needed = sizeof(KEY_FULL_INFORMATION); - std::vector<BYTE> buffer; KEY_FULL_INFORMATION* key_info = nullptr; + DWORD size_needed = sizeof(*key_info); + std::vector<BYTE> buffer(size_needed); do { buffer.resize(size_needed); key_info = reinterpret_cast<KEY_FULL_INFORMATION*>(buffer.data()); ntstatus = g_nt_query_key(key, KeyFullInformation, key_info, size_needed, &size_needed); - } while (ntstatus == STATUS_BUFFER_TOO_SMALL && ++tries < kMaxTries); + } while ((ntstatus == STATUS_BUFFER_OVERFLOW || + ntstatus == STATUS_BUFFER_TOO_SMALL) && + ++tries < kMaxTries); if (!NT_SUCCESS(ntstatus)) return false; @@ -1146,16 +1150,18 @@ // Start with sizeof the structure, plus 12 characters. It's very common for // key names to be < 12 characters (without being inefficient as an initial // allocation). - DWORD size_needed = sizeof(KEY_BASIC_INFORMATION) + (12 * sizeof(wchar_t)); - std::vector<BYTE> buffer; KEY_BASIC_INFORMATION* subkey_info = nullptr; + DWORD size_needed = sizeof(*subkey_info) + (12 * sizeof(wchar_t)); + std::vector<BYTE> buffer(size_needed); do { buffer.resize(size_needed); subkey_info = reinterpret_cast<KEY_BASIC_INFORMATION*>(buffer.data()); ntstatus = g_nt_enumerate_key(key, subkey_index, KeyBasicInformation, subkey_info, size_needed, &size_needed); - } while (ntstatus == STATUS_BUFFER_TOO_SMALL && ++tries < kMaxTries); + } while ((ntstatus == STATUS_BUFFER_OVERFLOW || + ntstatus == STATUS_BUFFER_TOO_SMALL) && + ++tries < kMaxTries); if (!NT_SUCCESS(ntstatus)) return false;
diff --git a/chromecast/base/metrics/grouped_histogram.cc b/chromecast/base/metrics/grouped_histogram.cc index dd8d097..b45dbef 100644 --- a/chromecast/base/metrics/grouped_histogram.cc +++ b/chromecast/base/metrics/grouped_histogram.cc
@@ -140,7 +140,6 @@ int32_t flags) { base::StringPiece name_piece(name); - DCHECK(base::StatisticsRecorder::IsActive()); DCHECK(base::Histogram::InspectConstructionArguments( name_piece, &minimum, &maximum, &bucket_count)); DCHECK(!base::StatisticsRecorder::FindHistogram(name_piece)) @@ -167,7 +166,6 @@ } // namespace void PreregisterAllGroupedHistograms() { - base::StatisticsRecorder::Initialize(); for (size_t i = 0; i < arraysize(kHistogramsToGroup); ++i) { PreregisterHistogram( kHistogramsToGroup[i].name,
diff --git a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashUploader.java b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashUploader.java index bca4d3f6..c9ed65d 100644 --- a/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashUploader.java +++ b/chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastCrashUploader.java
@@ -18,7 +18,10 @@ import java.io.SequenceInputStream; import java.net.HttpURLConnection; import java.net.URL; -import java.util.LinkedList; +import java.nio.charset.Charset; +import java.nio.charset.UnsupportedCharsetException; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import java.util.concurrent.ScheduledExecutorService; @@ -45,6 +48,8 @@ private final String mCrashReportUploadUrl; private final String mUuid; private final String mApplicationFeedback; + private final Runnable mQueueAllCrashDumpUploadsRunnable = + () -> queueAllCrashDumpUploads(false); public CastCrashUploader(ScheduledExecutorService executorService, String crashDumpPath, String uuid, String applicationFeedback, boolean uploadCrashToStaging) { @@ -59,25 +64,17 @@ } /** Sets up a periodic uploader, that checks for new dumps to upload every 20 minutes */ + @SuppressWarnings("FutureReturnValueIgnored") public void startPeriodicUpload() { - mExecutorService.scheduleWithFixedDelay( - new Runnable() { - @Override - public void run() { - queueAllCrashDumpUploads(false); - } - }, + mExecutorService.scheduleWithFixedDelay(mQueueAllCrashDumpUploadsRunnable, 0, // Do first run immediately 20, // Run once every 20 minutes TimeUnit.MINUTES); } + @SuppressWarnings("FutureReturnValueIgnored") public void uploadOnce() { - mExecutorService.schedule(new Runnable() { - public void run() { - queueAllCrashDumpUploads(false); - } - }, 0, TimeUnit.MINUTES); + mExecutorService.schedule(mQueueAllCrashDumpUploadsRunnable, 0, TimeUnit.MINUTES); } public void removeCrashDumps() { @@ -100,7 +97,7 @@ if (mCrashDumpPath == null) return; Log.i(TAG, "Checking for crash dumps"); - LinkedList<Future> tasks = new LinkedList<Future>(); + List<Future> tasks = new ArrayList<Future>(); File crashDumpDirectory = new File(mCrashDumpPath); final String log = getLogs(crashDumpDirectory); @@ -108,11 +105,7 @@ for (final File potentialDump : crashDumpDirectory.listFiles()) { String dumpName = potentialDump.getName(); if (dumpName.matches(DUMP_FILE_REGEX)) { - tasks.add(mExecutorService.submit(new Runnable() { - public void run() { - uploadCrashDump(potentialDump, log); - } - })); + tasks.add(mExecutorService.submit(() -> uploadCrashDump(potentialDump, log))); } } @@ -166,8 +159,8 @@ logHeader.append("Content-Type: text/plain\n\n"); logHeader.append(log); logHeader.append("\n"); - InputStream logHeaderStream = - new ByteArrayInputStream(logHeader.toString().getBytes()); + InputStream logHeaderStream = new ByteArrayInputStream( + logHeader.toString().getBytes(Charset.forName("UTF-8"))); // Upload: prepend the log file for uploading uploadCrashDumpStream = new SequenceInputStream(logHeaderStream, uploadCrashDumpStream); @@ -183,7 +176,8 @@ uuidBuilder.append(mUuid); uuidBuilder.append("\n"); uploadCrashDumpStream = new SequenceInputStream( - new ByteArrayInputStream(uuidBuilder.toString().getBytes()), + new ByteArrayInputStream( + uuidBuilder.toString().getBytes(Charset.forName("UTF-8"))), uploadCrashDumpStream); } else { Log.d(TAG, "No UUID"); @@ -199,8 +193,8 @@ feedbackHeader.append("Content-Type: text/plain\n\n"); feedbackHeader.append(mApplicationFeedback); feedbackHeader.append("\n"); - InputStream feedbackHeaderStream = - new ByteArrayInputStream(feedbackHeader.toString().getBytes()); + InputStream feedbackHeaderStream = new ByteArrayInputStream( + feedbackHeader.toString().getBytes(Charset.forName("UTF-8"))); // Upload: prepend the log file for uploading uploadCrashDumpStream = new SequenceInputStream(feedbackHeaderStream, uploadCrashDumpStream); @@ -241,6 +235,8 @@ } catch (FileNotFoundException fnfe) { // Android's HttpURLConnection implementation fires FNFE on some errors. Log.e(TAG, "Failed response: " + connection.getResponseCode(), fnfe); + } catch (UnsupportedCharsetException e) { + Log.wtf(TAG, "UTF-8 not supported"); } finally { connection.disconnect(); dumpFileStream.close(); @@ -279,9 +275,12 @@ * @throws IOException */ private String getFirstLine(InputStream inputStream) throws IOException { - try (InputStreamReader streamReader = new InputStreamReader(inputStream); + try (InputStreamReader streamReader = new InputStreamReader(inputStream, "UTF-8"); BufferedReader reader = new BufferedReader(streamReader)) { return reader.readLine(); + } catch (UnsupportedCharsetException e) { + Log.wtf(TAG, "UTF-8 not supported"); + return ""; } }
diff --git a/chromeos/BUILD.gn b/chromeos/BUILD.gn index 0339fee..2aeaf282 100644 --- a/chromeos/BUILD.gn +++ b/chromeos/BUILD.gn
@@ -32,6 +32,7 @@ "//base/third_party/dynamic_annotations", "//components/device_event_log", "//components/onc", + "//components/password_manager/core/browser:hash_password_manager", "//components/policy:cloud_policy_proto_generated_compile", "//components/policy/proto", "//components/pref_registry",
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM index 9cf63ba..07f0f12 100644 --- a/chromeos/CHROMEOS_LKGM +++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@ -10232.0.0 \ No newline at end of file +10289.0.0 \ No newline at end of file
diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc index 46602a3c..d712533e 100644 --- a/chromeos/chromeos_switches.cc +++ b/chromeos/chromeos_switches.cc
@@ -101,6 +101,9 @@ // Possible values: parallel|postpone. Default: parallel. const char kAshWebUIInit[] = "ash-webui-init"; +// Determines which Google Privacy CA to use for attestation. +const char kAttestationServer[] = "attestation-server"; + // If this flag is set, it indicates that this device is a "Cellular First" // device. Cellular First devices use cellular telephone data networks as // their primary means of connecting to the internet. @@ -120,18 +123,21 @@ const char kConservativeThreshold[] = "conservative"; +// Forces use of Chrome OS Gaia API v1. +const char kCrosGaiaApiV1[] = "cros-gaia-api-v1"; + // Forces CrOS region value. const char kCrosRegion[] = "cros-region"; // Control regions data load ("" is default). const char kCrosRegionsMode[] = "cros-regions-mode"; -// "Override" value for kCrosRegionsMode (region's data is read first). -const char kCrosRegionsModeOverride[] = "override"; - // "Hide" value for kCrosRegionsMode (VPD values are hidden). const char kCrosRegionsModeHide[] = "hide"; +// "Override" value for kCrosRegionsMode (region's data is read first). +const char kCrosRegionsModeOverride[] = "override"; + // Optional value for Data Saver prompt on cellular networks. const char kDataSaverPromptDemoMode[] = "demo"; @@ -163,9 +169,6 @@ // Disables ARC Opt-in verification process and ARC is enabled by default. const char kDisableArcOptInVerification[] = "disable-arc-opt-in-verification"; -// Disables wallpaper boot animation (except of OOBE case). -const char kDisableBootAnimation[] = "disable-boot-animation"; - // Disables bypass proxy for captive portal authorization. const char kDisableCaptivePortalBypassProxy[] = "disable-captive-portal-bypass-proxy"; @@ -188,6 +191,13 @@ // Disables notification when device is in end of life status. const char kDisableEolNotification[] = "disable-eol-notification"; +// Touchscreen-specific interactions of the Files app. +const char kDisableFileManagerTouchMode[] = "disable-file-manager-touch-mode"; + +// Disables fine grained time zone detection. +const char kDisableFineGrainedTimeZoneDetection[] = + "disable-fine-grained-time-zone-detection"; + // Disables GAIA services such as enrollment and OAuth session restore. Used by // 'fake' telemetry login. const char kDisableGaiaServices[] = "disable-gaia-services"; @@ -195,12 +205,21 @@ // Disables HID-detection OOBE screen. const char kDisableHIDDetectionOnOOBE[] = "disable-hid-detection-on-oobe"; +// Enables action handler apps (e.g. creating new notes) on lock screen. +const char kDisableLockScreenApps[] = "disable-lock-screen-apps"; + // Avoid doing expensive animations upon login. const char kDisableLoginAnimations[] = "disable-login-animations"; // Disables requests for an enterprise machine certificate during attestation. const char kDisableMachineCertRequest[] = "disable-machine-cert-request"; +// Disables material design Error screen. +const char kDisableMdErrorScreen[] = "disable-md-error-screen"; + +// Disables material design OOBE UI. +const char kDisableMdOobe[] = "disable-md-oobe"; + // Disables mtp write support. const char kDisableMtpWriteSupport[] = "disable-mtp-write-support"; @@ -211,6 +230,9 @@ const char kDisableNetworkPortalNotification[] = "disable-network-portal-notification"; +// Disables Settings based network configuration dialogs. +const char kDisableNetworkSettingsConfig[] = "disable-network-settings-config"; + // Disables the new Korean IME in chrome://settings/languages. const char kDisableNewKoreanIme[] = "disable-new-korean-ime"; @@ -223,6 +245,9 @@ const char kDisableOfficeEditingComponentApp[] = "disable-office-editing-component-extension"; +// Disables per-user timezone. +const char kDisablePerUserTimezone[] = "disable-per-user-timezone"; + // Disables suggestions while typing on a physical keyboard. const char kDisablePhysicalKeyboardAutocorrect[] = "disable-physical-keyboard-autocorrect"; @@ -230,6 +255,22 @@ // Disables rollback option on reset screen. const char kDisableRollbackOption[] = "disable-rollback-option"; +// Disables client certificate authentication on the sign-in frame on the Chrome +// OS sign-in profile. +// TODO(pmarko): Remove this flag in M-66 if no issues are found +// (https://crbug.com/723849). +const char kDisableSigninFrameClientCerts[] = + "disable-signin-frame-client-certs"; + +// Disables user selection of client certificate on the sign-in frame on the +// Chrome OS sign-in profile. +// TODO(pmarko): Remove this flag in M-65 when the +// DeviceLoginScreenAutoSelectCertificateForUrls policy is enabled on the server +// side (https://crbug.com/723849) and completely disable user selection of +// certificates on the sign-in frame. +const char kDisableSigninFrameClientCertUserSelection[] = + "disable-signin-frame-client-cert-user-selection"; + // Disables SystemTimezoneAutomaticDetection policy. const char kDisableSystemTimezoneAutomaticDetectionPolicy[] = "disable-system-timezone-automatic-detection"; @@ -240,6 +281,9 @@ // Disables wake on wifi features. const char kDisableWakeOnWifi[] = "disable-wake-on-wifi"; +// Disables zip archiver - unpacker. +const char kDisableZipArchiverUnpacker[] = "disable-zip-archiver-unpacker"; + // Enables the Android Wallpapers App as the default app on Chrome OS. const char kEnableAndroidWallpapersApp[] = "enable-android-wallpapers-app"; @@ -250,6 +294,9 @@ // Enables ARC OptIn flow in OOBE. const char kEnableArcOOBEOptIn[] = "enable-arc-oobe-optin"; +// Enables using a random url for captive portal detection. +const char kEnableCaptivePortalRandomUrl[] = "enable-captive-portal-random-url"; + // Enables the Cast Receiver. const char kEnableCastReceiver[] = "enable-cast-receiver"; @@ -274,31 +321,11 @@ const char kEnableExtensionAssetsSharing[] = "enable-extension-assets-sharing"; // Touchscreen-specific interactions of the Files app. -const char kDisableFileManagerTouchMode[] = "disable-file-manager-touch-mode"; const char kEnableFileManagerTouchMode[] = "enable-file-manager-touch-mode"; // Enables animated transitions during first-run tutorial. const char kEnableFirstRunUITransitions[] = "enable-first-run-ui-transitions"; -// Enables action handler apps (e.g. creating new notes) on lock screen. -const char kDisableLockScreenApps[] = "disable-lock-screen-apps"; - -// Overrides Tether with stub service. Provide integer arguments for the number -// of fake networks desired, e.g. 'tether-stub=2'. -const char kTetherStub[] = "tether-stub"; - -// Disables material design OOBE UI. -const char kDisableMdOobe[] = "disable-md-oobe"; - -// Disables material design Error screen. -const char kDisableMdErrorScreen[] = "disable-md-error-screen"; - -// Disables Settings based network configuration dialogs. -const char kDisableNetworkSettingsConfig[] = "disable-network-settings-config"; - -// Enables using a random url for captive portal detection. -const char kEnableCaptivePortalRandomUrl[] = "enable-captive-portal-random-url"; - // Enables notifications about captive portals in session. const char kEnableNetworkPortalNotification[] = "enable-network-portal-notification"; @@ -336,12 +363,13 @@ // Enables zip archiver - unpacker. const char kEnableZipArchiverUnpacker[] = "enable-zip-archiver-unpacker"; -// Disables zip archiver - unpacker. -const char kDisableZipArchiverUnpacker[] = "disable-zip-archiver-unpacker"; - // Disables ARC for managed accounts. const char kEnterpriseDisableArc[] = "enterprise-disable-arc"; +// Disable license type selection by user during enrollment. +const char kEnterpriseDisableLicenseTypeSelection[] = + "enterprise-disable-license-type-selection"; + // Whether to enable forced enterprise re-enrollment. const char kEnterpriseEnableForcedReEnrollment[] = "enterprise-enable-forced-re-enrollment"; @@ -367,10 +395,18 @@ // Forces first-run UI to be shown for every login. const char kForceFirstRunUI[] = "force-first-run-ui"; +// Force enables the Happiness Tracking System for the device. This ignores +// user profile check and time limits and shows the notification every time +// for any type of user. Should be used only for testing. +const char kForceHappinessTrackingSystem[] = "force-happiness-tracking-system"; + // Usually in browser tests the usual login manager bringup is skipped so that // tests can change how it's brought up. This flag disables that. const char kForceLoginManagerInTests[] = "force-login-manager-in-tests"; +// Force system compositor mode when set. +const char kForceSystemCompositorMode[] = "force-system-compositor-mode"; + // Screenshot testing: specifies the directory where the golden screenshots are // stored. const char kGoldenScreenshotsDir[] = "golden-screenshots-dir"; @@ -387,10 +423,8 @@ // JPEG file). const char kGuestWallpaperSmall[] = "guest-wallpaper-small"; -// Force enables the Happiness Tracking System for the device. This ignores -// user profile check and time limits and shows the notification every time -// for any type of user. Should be used only for testing. -const char kForceHappinessTrackingSystem[] = "force-happiness-tracking-system"; +// If true, the Chromebook has a keyboard with a diamond key. +const char kHasChromeOSDiamondKey[] = "has-chromeos-diamond-key"; // If set, the system is a Chromebook with a "standard Chrome OS keyboard", // which generally means one with a Search key in the standard Caps Lock @@ -399,9 +433,6 @@ // that only use external keyboards. const char kHasChromeOSKeyboard[] = "has-chromeos-keyboard"; -// If true, the Chromebook has a keyboard with a diamond key. -const char kHasChromeOSDiamondKey[] = "has-chromeos-diamond-key"; - // Defines user homedir. This defaults to primary user homedir. const char kHomedir[] = "homedir"; @@ -459,6 +490,9 @@ // Skips all other OOBE pages after user login. const char kOobeSkipPostLogin[] = "oobe-skip-postlogin"; +// Skip to login screen. +const char kOobeSkipToLogin[] = "oobe-skip-to-login"; + // Interval at which we check for total time on OOBE. const char kOobeTimerInterval[] = "oobe-timer-interval"; @@ -503,51 +537,19 @@ // Enables testing for auto update UI. const char kTestAutoUpdateUI[] = "test-auto-update-ui"; -// Determines which Google Privacy CA to use for attestation. -const char kAttestationServer[] = "attestation-server"; - -// Enables wake on wifi packet feature, which wakes the device on the receipt -// of network packets from whitelisted sources. -const char kWakeOnWifiPacket[] = "wake-on-wifi-packet"; - -// Force system compositor mode when set. -const char kForceSystemCompositorMode[] = "force-system-compositor-mode"; - // Enables testing for encryption migration UI. const char kTestEncryptionMigrationUI[] = "test-encryption-migration-ui"; -// Forces use of Chrome OS Gaia API v1. -const char kCrosGaiaApiV1[] = "cros-gaia-api-v1"; +// Overrides Tether with stub service. Provide integer arguments for the number +// of fake networks desired, e.g. 'tether-stub=2'. +const char kTetherStub[] = "tether-stub"; // List of locales supported by voice interaction. const char kVoiceInteractionLocales[] = "voice-interaction-supported-locales"; -// Disable license type selection by user during enrollment. -const char kEnterpriseDisableLicenseTypeSelection[] = - "enterprise-disable-license-type-selection"; - -// Disables per-user timezone. -const char kDisablePerUserTimezone[] = "disable-per-user-timezone"; - -// Disables fine grained time zone detection. -const char kDisableFineGrainedTimeZoneDetection[] = - "disable-fine-grained-time-zone-detection"; - -// Disables client certificate authentication on the sign-in frame on the Chrome -// OS sign-in profile. -// TODO(pmarko): Remove this flag in M-66 if no issues are found -// (crbug.com/723849). -const char kDisableSigninFrameClientCerts[] = - "disable-signin-frame-client-certs"; - -// Disables user selection of client certificate on the sign-in frame on the -// Chrome OS sign-in profile. -// TODO(pmarko): Remove this flag in M-65 when the -// DeviceLoginScreenAutoSelectCertificateForUrls policy is enabled on the server -// side (crbug.com/723849) and completely disable user selection of certificates -// on the sign-in frame. -const char kDisableSigninFrameClientCertUserSelection[] = - "disable-signin-frame-client-cert-user-selection"; +// Enables wake on wifi packet feature, which wakes the device on the receipt +// of network packets from whitelisted sources. +const char kWakeOnWifiPacket[] = "wake-on-wifi-packet"; bool WakeOnWifiEnabled() { return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi);
diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h index f13d39f..4e555ed 100644 --- a/chromeos/chromeos_switches.h +++ b/chromeos/chromeos_switches.h
@@ -30,14 +30,16 @@ CHROMEOS_EXPORT extern const char kAppOemManifestFile[]; CHROMEOS_EXPORT extern const char kArcAvailability[]; CHROMEOS_EXPORT extern const char kArcAvailable[]; -CHROMEOS_EXPORT extern const char kArcTransitionMigrationRequired[]; CHROMEOS_EXPORT extern const char kArcStartMode[]; +CHROMEOS_EXPORT extern const char kArcTransitionMigrationRequired[]; CHROMEOS_EXPORT extern const char kArtifactsDir[]; CHROMEOS_EXPORT extern const char kAshWebUIInit[]; +CHROMEOS_EXPORT extern const char kAttestationServer[]; CHROMEOS_EXPORT extern const char kCellularFirst[]; CHROMEOS_EXPORT extern const char kChildWallpaperLarge[]; CHROMEOS_EXPORT extern const char kChildWallpaperSmall[]; CHROMEOS_EXPORT extern const char kConservativeThreshold[]; +CHROMEOS_EXPORT extern const char kCrosGaiaApiV1[]; CHROMEOS_EXPORT extern const char kCrosRegion[]; CHROMEOS_EXPORT extern const char kCrosRegionsMode[]; CHROMEOS_EXPORT extern const char kCrosRegionsModeHide[]; @@ -51,7 +53,6 @@ CHROMEOS_EXPORT extern const char kDerelictIdleTimeout[]; CHROMEOS_EXPORT extern const char kDisableArcDataWipe[]; CHROMEOS_EXPORT extern const char kDisableArcOptInVerification[]; -CHROMEOS_EXPORT extern const char kDisableBootAnimation[]; CHROMEOS_EXPORT extern const char kDisableCaptivePortalBypassProxy[]; CHROMEOS_EXPORT extern const char kDisableCloudImport[]; CHROMEOS_EXPORT extern const char kDisableDataSaverPrompt[]; @@ -59,22 +60,32 @@ CHROMEOS_EXPORT extern const char kDisableDeviceDisabling[]; CHROMEOS_EXPORT extern const char kDisableEncryptionMigration[]; CHROMEOS_EXPORT extern const char kDisableEolNotification[]; +CHROMEOS_EXPORT extern const char kDisableFileManagerTouchMode[]; +CHROMEOS_EXPORT extern const char kDisableFineGrainedTimeZoneDetection[]; CHROMEOS_EXPORT extern const char kDisableGaiaServices[]; CHROMEOS_EXPORT extern const char kDisableHIDDetectionOnOOBE[]; +CHROMEOS_EXPORT extern const char kDisableLockScreenApps[]; CHROMEOS_EXPORT extern const char kDisableLoginAnimations[]; CHROMEOS_EXPORT extern const char kDisableMachineCertRequest[]; +CHROMEOS_EXPORT extern const char kDisableMdErrorScreen[]; +CHROMEOS_EXPORT extern const char kDisableMdOobe[]; CHROMEOS_EXPORT extern const char kDisableMtpWriteSupport[]; CHROMEOS_EXPORT extern const char kDisableMultiDisplayLayout[]; CHROMEOS_EXPORT extern const char kDisableNetworkPortalNotification[]; +CHROMEOS_EXPORT extern const char kDisableNetworkSettingsConfig[]; CHROMEOS_EXPORT extern const char kDisableNewKoreanIme[]; CHROMEOS_EXPORT extern const char kDisableNewZIPUnpacker[]; CHROMEOS_EXPORT extern const char kDisableOfficeEditingComponentApp[]; +CHROMEOS_EXPORT extern const char kDisablePerUserTimezone[]; CHROMEOS_EXPORT extern const char kDisablePhysicalKeyboardAutocorrect[]; CHROMEOS_EXPORT extern const char kDisableRollbackOption[]; +CHROMEOS_EXPORT extern const char kDisableSigninFrameClientCerts[]; +CHROMEOS_EXPORT extern const char kDisableSigninFrameClientCertUserSelection[]; CHROMEOS_EXPORT extern const char kDisableSystemTimezoneAutomaticDetectionPolicy[]; CHROMEOS_EXPORT extern const char kDisableVolumeAdjustSound[]; CHROMEOS_EXPORT extern const char kDisableWakeOnWifi[]; +CHROMEOS_EXPORT extern const char kDisableZipArchiverUnpacker[]; CHROMEOS_EXPORT extern const char kEnableAndroidWallpapersApp[]; CHROMEOS_EXPORT extern const char kEnableArc[]; CHROMEOS_EXPORT extern const char kEnableArcOOBEOptIn[]; @@ -86,41 +97,33 @@ CHROMEOS_EXPORT extern const char kEnableEncryptionMigration[]; CHROMEOS_EXPORT extern const char kEnableExperimentalAccessibilityFeatures[]; CHROMEOS_EXPORT extern const char kEnableExtensionAssetsSharing[]; +CHROMEOS_EXPORT extern const char kEnableFileManagerTouchMode[]; CHROMEOS_EXPORT extern const char kEnableFirstRunUITransitions[]; -CHROMEOS_EXPORT extern const char kDisableLockScreenApps[]; -CHROMEOS_EXPORT extern const char kTetherStub[]; -CHROMEOS_EXPORT extern const char kDisableMdOobe[]; -CHROMEOS_EXPORT extern const char kDisableMdErrorScreen[]; -CHROMEOS_EXPORT extern const char kDisableNetworkSettingsConfig[]; CHROMEOS_EXPORT extern const char kEnableNetworkPortalNotification[]; CHROMEOS_EXPORT extern const char kEnablePhysicalKeyboardAutocorrect[]; CHROMEOS_EXPORT extern const char kEnableRequestTabletSite[]; CHROMEOS_EXPORT extern const char kEnableScreenshotTestingWithMode[]; CHROMEOS_EXPORT extern const char kEnableTouchCalibrationSetting[]; CHROMEOS_EXPORT extern const char kEnableTouchpadThreeFingerClick[]; -CHROMEOS_EXPORT extern const char kEnableFileManagerTouchMode[]; -CHROMEOS_EXPORT extern const char kDisableFileManagerTouchMode[]; -CHROMEOS_EXPORT extern const char kDisableFineGrainedTimeZoneDetection[]; -CHROMEOS_EXPORT extern const char kDisableSigninFrameClientCerts[]; -CHROMEOS_EXPORT extern const char kDisableSigninFrameClientCertUserSelection[]; CHROMEOS_EXPORT extern const char kEnableVideoPlayerChromecastSupport[]; CHROMEOS_EXPORT extern const char kEnableVoiceInteraction[]; CHROMEOS_EXPORT extern const char kEnableZipArchiverPacker[]; CHROMEOS_EXPORT extern const char kEnableZipArchiverUnpacker[]; -CHROMEOS_EXPORT extern const char kDisableZipArchiverUnpacker[]; CHROMEOS_EXPORT extern const char kEnterpriseDisableArc[]; +CHROMEOS_EXPORT extern const char kEnterpriseDisableLicenseTypeSelection[]; CHROMEOS_EXPORT extern const char kEnterpriseEnableForcedReEnrollment[]; CHROMEOS_EXPORT extern const char kEnterpriseEnableZeroTouchEnrollment[]; CHROMEOS_EXPORT extern const char kEnterpriseEnrollmentInitialModulus[]; CHROMEOS_EXPORT extern const char kEnterpriseEnrollmentModulusLimit[]; CHROMEOS_EXPORT extern const char kFirstExecAfterBoot[]; CHROMEOS_EXPORT extern const char kForceFirstRunUI[]; +CHROMEOS_EXPORT extern const char kForceHappinessTrackingSystem[]; CHROMEOS_EXPORT extern const char kForceLoginManagerInTests[]; +CHROMEOS_EXPORT extern const char kForceSystemCompositorMode[]; CHROMEOS_EXPORT extern const char kGoldenScreenshotsDir[]; CHROMEOS_EXPORT extern const char kGuestSession[]; CHROMEOS_EXPORT extern const char kGuestWallpaperLarge[]; CHROMEOS_EXPORT extern const char kGuestWallpaperSmall[]; -CHROMEOS_EXPORT extern const char kForceHappinessTrackingSystem[]; CHROMEOS_EXPORT extern const char kHasChromeOSDiamondKey[]; CHROMEOS_EXPORT extern const char kHasChromeOSKeyboard[]; CHROMEOS_EXPORT extern const char kHomedir[]; @@ -137,6 +140,7 @@ CHROMEOS_EXPORT extern const char kOobeForceShowScreen[]; CHROMEOS_EXPORT extern const char kOobeGuestSession[]; CHROMEOS_EXPORT extern const char kOobeSkipPostLogin[]; +CHROMEOS_EXPORT extern const char kOobeSkipToLogin[]; CHROMEOS_EXPORT extern const char kOobeTimerInterval[]; CHROMEOS_EXPORT extern const char kShillStub[]; CHROMEOS_EXPORT extern const char kShowLoginDevOverlay[]; @@ -145,14 +149,10 @@ CHROMEOS_EXPORT extern const char kStubCrosSettings[]; CHROMEOS_EXPORT extern const char kSystemDevMode[]; CHROMEOS_EXPORT extern const char kTestAutoUpdateUI[]; -CHROMEOS_EXPORT extern const char kAttestationServer[]; -CHROMEOS_EXPORT extern const char kWakeOnWifiPacket[]; -CHROMEOS_EXPORT extern const char kForceSystemCompositorMode[]; CHROMEOS_EXPORT extern const char kTestEncryptionMigrationUI[]; -CHROMEOS_EXPORT extern const char kCrosGaiaApiV1[]; +CHROMEOS_EXPORT extern const char kTetherStub[]; CHROMEOS_EXPORT extern const char kVoiceInteractionLocales[]; -CHROMEOS_EXPORT extern const char kEnterpriseDisableLicenseTypeSelection[]; -CHROMEOS_EXPORT extern const char kDisablePerUserTimezone[]; +CHROMEOS_EXPORT extern const char kWakeOnWifiPacket[]; // Returns true if the system should wake in response to wifi traffic. CHROMEOS_EXPORT bool WakeOnWifiEnabled();
diff --git a/chromeos/cryptohome/cryptohome_util.cc b/chromeos/cryptohome/cryptohome_util.cc index cb8e972..46f0797 100644 --- a/chromeos/cryptohome/cryptohome_util.cc +++ b/chromeos/cryptohome/cryptohome_util.cc
@@ -6,13 +6,37 @@ #include <string> +#include "base/logging.h" #include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/dbus/cryptohome/key.pb.h" #include "chromeos/dbus/cryptohome/rpc.pb.h" +#include "components/device_event_log/device_event_log.h" #include "third_party/cros_system_api/dbus/service_constants.h" +// TODO(crbug.com/797848): Add unit tests for this file. + namespace cryptohome { +MountError BaseReplyToMountError(const base::Optional<BaseReply>& reply) { + if (!reply.has_value()) { + LOGIN_LOG(ERROR) << "MountEx failed with no reply."; + return MOUNT_ERROR_FATAL; + } + if (!reply->HasExtension(MountReply::reply)) { + LOGIN_LOG(ERROR) << "MountEx failed with no MountReply extension in reply."; + return MOUNT_ERROR_FATAL; + } + if (reply->has_error() && reply->error() != CRYPTOHOME_ERROR_NOT_SET) { + LOGIN_LOG(ERROR) << "MountEx failed (CryptohomeErrorCode): " + << reply->error(); + } + return CryptohomeErrorToMountError(reply->error()); +} + +const std::string& BaseReplyToMountHash(const BaseReply& reply) { + return reply.GetExtension(MountReply::reply).sanitized_username(); +} + AuthorizationRequest CreateAuthorizationRequest(const std::string& label, const std::string& secret) { cryptohome::AuthorizationRequest auth_request;
diff --git a/chromeos/cryptohome/cryptohome_util.h b/chromeos/cryptohome/cryptohome_util.h index 8659ae2..dba8e7d 100644 --- a/chromeos/cryptohome/cryptohome_util.h +++ b/chromeos/cryptohome/cryptohome_util.h
@@ -7,6 +7,7 @@ #include <string> +#include "base/optional.h" #include "chromeos/chromeos_export.h" #include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/dbus/cryptohome/key.pb.h" @@ -15,12 +16,23 @@ namespace cryptohome { +// Returns a MountError code from |reply|, returning MOUNT_ERROR_NONE +// if the reply is well-formed and there is no error. +CHROMEOS_EXPORT MountError +BaseReplyToMountError(const base::Optional<BaseReply>& reply); + +// Extracts the mount hash from |reply|. +// This method assumes |reply| is well-formed. To check if a reply +// is well-formed, callers can check if BaseReplyToMountError returns +// MOUNT_ERROR_NONE. +CHROMEOS_EXPORT const std::string& BaseReplyToMountHash(const BaseReply& reply); + // Creates an AuthorizationRequest from the given secret and label. -AuthorizationRequest CHROMEOS_EXPORT +CHROMEOS_EXPORT AuthorizationRequest CreateAuthorizationRequest(const std::string& label, const std::string& secret); // Converts the given KeyDefinition to a Key. -void CHROMEOS_EXPORT KeyDefinitionToKey(const KeyDefinition& key_def, Key* key); +CHROMEOS_EXPORT void KeyDefinitionToKey(const KeyDefinition& key_def, Key* key); // Converts CryptohomeErrorCode to MountError. CHROMEOS_EXPORT MountError
diff --git a/chromeos/cryptohome/homedir_methods.cc b/chromeos/cryptohome/homedir_methods.cc index d0e9147..1fa80faf 100644 --- a/chromeos/cryptohome/homedir_methods.cc +++ b/chromeos/cryptohome/homedir_methods.cc
@@ -52,16 +52,6 @@ weak_ptr_factory_.GetWeakPtr(), callback)); } - void MountEx(const Identification& id, - const AuthorizationRequest& auth, - const MountRequest& request, - const MountCallback& callback) override { - DBusThreadManager::Get()->GetCryptohomeClient()->MountEx( - id, auth, request, - base::BindOnce(&HomedirMethodsImpl::OnMountExCallback, - weak_ptr_factory_.GetWeakPtr(), callback)); - } - void AddKeyEx(const Identification& id, const AuthorizationRequest& auth, const AddKeyRequest& request, @@ -197,29 +187,6 @@ callback.Run(true, MOUNT_ERROR_NONE, key_definitions); } - void OnMountExCallback(const MountCallback& callback, - base::Optional<BaseReply> reply) { - if (!reply.has_value()) { - callback.Run(false, MOUNT_ERROR_FATAL, std::string()); - return; - } - if (reply->has_error() && reply->error() != CRYPTOHOME_ERROR_NOT_SET) { - LOGIN_LOG(ERROR) << "HomedirMethods MountEx error (CryptohomeErrorCode): " - << reply->error(); - callback.Run(false, CryptohomeErrorToMountError(reply->error()), - std::string()); - return; - } - if (!reply->HasExtension(MountReply::reply)) { - callback.Run(false, MOUNT_ERROR_FATAL, std::string()); - return; - } - - std::string mount_hash; - mount_hash = reply->GetExtension(MountReply::reply).sanitized_username(); - callback.Run(true, MOUNT_ERROR_NONE, mount_hash); - } - void OnGetAccountDiskUsageCallback( const GetAccountDiskUsageCallback& callback, base::Optional<BaseReply> reply) {
diff --git a/chromeos/cryptohome/homedir_methods.h b/chromeos/cryptohome/homedir_methods.h index a209b8b..2af3f4d 100644 --- a/chromeos/cryptohome/homedir_methods.h +++ b/chromeos/cryptohome/homedir_methods.h
@@ -31,9 +31,6 @@ bool success, MountError return_code, const std::vector<KeyDefinition>& key_definitions)> GetKeyDataCallback; - typedef base::Callback< - void(bool success, MountError return_code, const std::string& mount_hash)> - MountCallback; typedef base::Callback<void(bool success, int64_t size)> GetAccountDiskUsageCallback; @@ -55,17 +52,6 @@ const CheckKeyRequest& request, const Callback& callback) = 0; - // Asks cryptohomed to find the cryptohome for user identified by |id| and - // then mount it using |auth| to unlock the key. - // If the |create_keys| are not given and no cryptohome exists for |id|, - // the expected result is - // callback.Run(false, kCryptohomeMountErrorUserDoesNotExist, string()). - // Otherwise, the normal range of return codes is expected. - virtual void MountEx(const Identification& id, - const AuthorizationRequest& auth, - const MountRequest& request, - const MountCallback& callback) = 0; - // Asks cryptohomed to try to add another key for the user identified by |id| // using |auth| to unlock the key. // Key used in |auth| should have the PRIV_ADD privilege.
diff --git a/chromeos/cryptohome/mock_homedir_methods.cc b/chromeos/cryptohome/mock_homedir_methods.cc index 4bf1edc..f85643f 100644 --- a/chromeos/cryptohome/mock_homedir_methods.cc +++ b/chromeos/cryptohome/mock_homedir_methods.cc
@@ -27,8 +27,6 @@ ON_CALL(*this, CheckKeyEx(_, _, _, _)) .WillByDefault( WithArgs<3>(Invoke(this, &MockHomedirMethods::DoCallback))); - ON_CALL(*this, MountEx(_, _, _, _)).WillByDefault( - WithArgs<3>(Invoke(this, &MockHomedirMethods::DoMountCallback))); ON_CALL(*this, AddKeyEx(_, _, _, _)) .WillByDefault( WithArgs<3>(Invoke(this, &MockHomedirMethods::DoAddKeyCallback))); @@ -47,13 +45,6 @@ callback.Run(success_, return_code_, std::vector<KeyDefinition>()); } -void MockHomedirMethods::DoMountCallback(const MountCallback& callback) { - callback.Run( - success_, return_code_, MockAsyncMethodCaller::kFakeSanitizedUsername); - if (!on_mount_called_.is_null()) - on_mount_called_.Run(); -} - void MockHomedirMethods::DoAddKeyCallback(const Callback& callback) { callback.Run(success_, return_code_); if (!on_add_key_called_.is_null())
diff --git a/chromeos/cryptohome/mock_homedir_methods.h b/chromeos/cryptohome/mock_homedir_methods.h index b71797e..e7c4aa1 100644 --- a/chromeos/cryptohome/mock_homedir_methods.h +++ b/chromeos/cryptohome/mock_homedir_methods.h
@@ -32,11 +32,6 @@ const AuthorizationRequest& auth, const CheckKeyRequest& request, const Callback& callback)); - MOCK_METHOD4(MountEx, - void(const Identification& id, - const AuthorizationRequest& auth, - const MountRequest& request, - const MountCallback& callback)); MOCK_METHOD4(AddKeyEx, void(const Identification& id, const AuthorizationRequest& auth, @@ -60,9 +55,6 @@ void(const Identification& id, const GetAccountDiskUsageCallback& callback)); - void set_mount_callback(const base::Closure& callback) { - on_mount_called_ = callback; - } void set_add_key_callback(const base::Closure& callback) { on_add_key_called_ = callback; } @@ -70,13 +62,11 @@ private: void DoCallback(const Callback& callback); void DoGetDataCallback(const GetKeyDataCallback& callback); - void DoMountCallback(const MountCallback& callback); void DoAddKeyCallback(const Callback& callback); bool success_ = false; MountError return_code_ = MOUNT_ERROR_NONE; - base::Closure on_mount_called_; base::Closure on_add_key_called_; DISALLOW_COPY_AND_ASSIGN(MockHomedirMethods);
diff --git a/chromeos/dbus/cryptohome_client.h b/chromeos/dbus/cryptohome_client.h index ce68179..ff8ef9a 100644 --- a/chromeos/dbus/cryptohome_client.h +++ b/chromeos/dbus/cryptohome_client.h
@@ -79,7 +79,7 @@ // Callback for the methods initiate asynchronous operations. // On success (i.e. the asynchronous operation is started), an |async_id| - // is returned, so the user code can identify the corresponding singal + // is returned, so the user code can identify the corresponding signal // handler invocation later. using AsyncMethodCallback = DBusMethodCallback<int /* async_id */>; @@ -507,10 +507,10 @@ const cryptohome::CheckKeyRequest& request, DBusMethodCallback<cryptohome::BaseReply> callback) = 0; - // Asynchronously calls MountEx method. |callback| is called after method - // call, and with reply protobuf. - // MountEx attempts to mount home dir using given authorization, and can - // create new home dir if necessary values are specified in |request|. + // Asynchronously calls MountEx method. Afterward, |callback| is called with + // the reply. + // MountEx attempts to mount home dir using given authorization, + // and can create new home dir if necessary values are specified in |request|. virtual void MountEx(const cryptohome::Identification& cryptohome_id, const cryptohome::AuthorizationRequest& auth, const cryptohome::MountRequest& request,
diff --git a/chromeos/dbus/fake_cryptohome_client.cc b/chromeos/dbus/fake_cryptohome_client.cc index cf0af293..50567dd 100644 --- a/chromeos/dbus/fake_cryptohome_client.cc +++ b/chromeos/dbus/fake_cryptohome_client.cc
@@ -554,6 +554,8 @@ const cryptohome::AuthorizationRequest& auth, const cryptohome::MountRequest& request, DBusMethodCallback<cryptohome::BaseReply> callback) { + cryptohome::CryptohomeErrorCode error = cryptohome_error_; + last_mount_request_ = request; cryptohome::BaseReply reply; cryptohome::MountReply* mount = reply.MutableExtension(cryptohome::MountReply::reply); @@ -561,8 +563,9 @@ if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kTestEncryptionMigrationUI) && !request.to_migrate_from_ecryptfs()) { - reply.set_error(cryptohome::CRYPTOHOME_ERROR_MOUNT_OLD_ENCRYPTION); + error = cryptohome::CRYPTOHOME_ERROR_MOUNT_OLD_ENCRYPTION; } + reply.set_error(error); ReturnProtobufMethodCallback(reply, std::move(callback)); } @@ -617,6 +620,8 @@ const cryptohome::Identification& cryptohome_id, const cryptohome::MigrateToDircryptoRequest& request, VoidDBusMethodCallback callback) { + id_for_disk_migrated_to_dircrypto_ = cryptohome_id; + last_migrate_to_dircrypto_request_ = request; base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(std::move(callback), true)); dircrypto_migration_progress_ = 0;
diff --git a/chromeos/dbus/fake_cryptohome_client.h b/chromeos/dbus/fake_cryptohome_client.h index d3b376c..c4583426 100644 --- a/chromeos/dbus/fake_cryptohome_client.h +++ b/chromeos/dbus/fake_cryptohome_client.h
@@ -19,6 +19,7 @@ #include "base/timer/timer.h" #include "chromeos/cryptohome/cryptohome_parameters.h" #include "chromeos/dbus/cryptohome/key.pb.h" +#include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/dbus/cryptohome_client.h" namespace chromeos { @@ -28,6 +29,7 @@ FakeCryptohomeClient(); ~FakeCryptohomeClient() override; + // CryptohomeClient overrides void Init(dbus::Bus* bus) override; void AddObserver(Observer* observer) override; void RemoveObserver(Observer* observer) override; @@ -210,6 +212,8 @@ void NeedsDircryptoMigration(const cryptohome::Identification& cryptohome_id, DBusMethodCallback<bool> callback) override; + /////////// Test helpers //////////// + // Changes the behavior of WaitForServiceToBeAvailable(). This method runs // pending callbacks if is_available is true. void SetServiceIsAvailable(bool is_available); @@ -235,6 +239,11 @@ needs_dircrypto_migration_ = needs_migration; } + // Sets the CryptohomeError value to return. + void set_cryptohome_error(cryptohome::CryptohomeErrorCode error) { + cryptohome_error_ = error; + } + void set_tpm_attestation_is_enrolled(bool enrolled) { tpm_attestation_is_enrolled_ = enrolled; } @@ -267,6 +276,22 @@ uint64_t current, uint64_t total); + // MountEx getters. + bool to_migrate_from_ecryptfs() const { + return last_mount_request_.to_migrate_from_ecryptfs(); + } + bool hidden_mount() const { return last_mount_request_.hidden_mount(); } + bool public_mount() const { return last_mount_request_.public_mount(); } + + // MigrateToDircrypto getters. + const cryptohome::Identification& get_id_for_disk_migrated_to_dircrypto() + const { + return id_for_disk_migrated_to_dircrypto_; + } + bool minimal_migration() const { + return last_migrate_to_dircrypto_request_.minimal_migration(); + } + private: void ReturnProtobufMethodCallback( const cryptohome::BaseReply& reply, @@ -339,6 +364,15 @@ bool tpm_attestation_is_prepared_ = true; bool tpm_attestation_does_key_exist_should_succeed_ = true; + // MountEx fields. + cryptohome::CryptohomeErrorCode cryptohome_error_ = + cryptohome::CRYPTOHOME_ERROR_NOT_SET; + cryptohome::MountRequest last_mount_request_; + + // MigrateToDircrypto fields. + cryptohome::Identification id_for_disk_migrated_to_dircrypto_; + cryptohome::MigrateToDircryptoRequest last_migrate_to_dircrypto_request_; + base::WeakPtrFactory<FakeCryptohomeClient> weak_ptr_factory_; DISALLOW_COPY_AND_ASSIGN(FakeCryptohomeClient);
diff --git a/chromeos/dbus/fake_image_loader_client.cc b/chromeos/dbus/fake_image_loader_client.cc index 8ed20de3..144336a1 100644 --- a/chromeos/dbus/fake_image_loader_client.cc +++ b/chromeos/dbus/fake_image_loader_client.cc
@@ -26,7 +26,7 @@ void FakeImageLoaderClient::LoadComponentAtPath( const std::string& name, const base::FilePath& path, - DBusMethodCallback<std::string> callback) { + DBusMethodCallback<base::FilePath> callback) { std::move(callback).Run(base::nullopt); }
diff --git a/chromeos/dbus/fake_image_loader_client.h b/chromeos/dbus/fake_image_loader_client.h index c2cc00f..cb7f397 100644 --- a/chromeos/dbus/fake_image_loader_client.h +++ b/chromeos/dbus/fake_image_loader_client.h
@@ -28,9 +28,10 @@ DBusMethodCallback<bool> callback) override; void LoadComponent(const std::string& name, DBusMethodCallback<std::string> callback) override; - void LoadComponentAtPath(const std::string& name, - const base::FilePath& path, - DBusMethodCallback<std::string> callback) override; + void LoadComponentAtPath( + const std::string& name, + const base::FilePath& path, + DBusMethodCallback<base::FilePath> callback) override; void RemoveComponent(const std::string& name, DBusMethodCallback<bool> callback) override; void RequestComponentVersion(
diff --git a/chromeos/dbus/fake_smb_provider_client.cc b/chromeos/dbus/fake_smb_provider_client.cc index b1fa40a..a281219 100644 --- a/chromeos/dbus/fake_smb_provider_client.cc +++ b/chromeos/dbus/fake_smb_provider_client.cc
@@ -56,7 +56,8 @@ FROM_HERE, base::BindOnce(std::move(callback), smbprovider::ERROR_OK, 1)); } -void FakeSmbProviderClient::CloseFile(int32_t file_id, +void FakeSmbProviderClient::CloseFile(int32_t mount_id, + int32_t file_id, CloseFileCallback callback) { base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::BindOnce(std::move(callback), smbprovider::ERROR_OK));
diff --git a/chromeos/dbus/fake_smb_provider_client.h b/chromeos/dbus/fake_smb_provider_client.h index 5b03ee3..a23276f2 100644 --- a/chromeos/dbus/fake_smb_provider_client.h +++ b/chromeos/dbus/fake_smb_provider_client.h
@@ -31,7 +31,9 @@ const base::FilePath& file_path, bool writeable, OpenFileCallback callback) override; - void CloseFile(int32_t file_id, CloseFileCallback callback) override; + void CloseFile(int32_t mount_id, + int32_t file_id, + CloseFileCallback callback) override; private: DISALLOW_COPY_AND_ASSIGN(FakeSmbProviderClient);
diff --git a/chromeos/dbus/image_loader_client.cc b/chromeos/dbus/image_loader_client.cc index a23a300..e2bc2de 100644 --- a/chromeos/dbus/image_loader_client.cc +++ b/chromeos/dbus/image_loader_client.cc
@@ -51,16 +51,17 @@ std::move(callback))); } - void LoadComponentAtPath(const std::string& name, - const base::FilePath& path, - DBusMethodCallback<std::string> callback) override { + void LoadComponentAtPath( + const std::string& name, + const base::FilePath& path, + DBusMethodCallback<base::FilePath> callback) override { dbus::MethodCall method_call(imageloader::kImageLoaderServiceInterface, imageloader::kLoadComponentAtPath); dbus::MessageWriter writer(&method_call); writer.AppendString(name); writer.AppendString(path.value()); proxy_->CallMethod(&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, - base::BindOnce(&ImageLoaderClientImpl::OnStringMethod, + base::BindOnce(&ImageLoaderClientImpl::OnFilePathMethod, std::move(callback))); } @@ -139,6 +140,22 @@ std::move(callback).Run(std::move(result)); } + static void OnFilePathMethod(DBusMethodCallback<base::FilePath> callback, + dbus::Response* response) { + if (!response) { + std::move(callback).Run(base::nullopt); + return; + } + dbus::MessageReader reader(response); + std::string result; + if (!reader.PopString(&result)) { + std::move(callback).Run(base::nullopt); + LOG(ERROR) << "Invalid response: " << response->ToString(); + return; + } + std::move(callback).Run(base::FilePath(std::move(result))); + } + dbus::ObjectProxy* proxy_ = nullptr; DISALLOW_COPY_AND_ASSIGN(ImageLoaderClientImpl);
diff --git a/chromeos/dbus/image_loader_client.h b/chromeos/dbus/image_loader_client.h index 57210bf0..b5f3e9d 100644 --- a/chromeos/dbus/image_loader_client.h +++ b/chromeos/dbus/image_loader_client.h
@@ -39,7 +39,7 @@ virtual void LoadComponentAtPath( const std::string& name, const base::FilePath& path, - DBusMethodCallback<std::string> callback) = 0; + DBusMethodCallback<base::FilePath> callback) = 0; // Requests the currently registered version of the given component |name|. virtual void RequestComponentVersion(
diff --git a/chromeos/dbus/services/component_updater_service_provider.cc b/chromeos/dbus/services/component_updater_service_provider.cc index 8fe15e5..de8a0f84 100644 --- a/chromeos/dbus/services/component_updater_service_provider.cc +++ b/chromeos/dbus/services/component_updater_service_provider.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/bind.h" +#include "base/files/file_path.h" #include "dbus/bus.h" #include "dbus/message.h" #include "third_party/cros_system_api/dbus/service_constants.h" @@ -75,12 +76,12 @@ void ComponentUpdaterServiceProvider::OnLoadComponent( dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender, - const std::string& result) { + const base::FilePath& result) { if (!result.empty()) { std::unique_ptr<dbus::Response> response = dbus::Response::FromMethodCall(method_call); dbus::MessageWriter writer(response.get()); - writer.AppendString(result); + writer.AppendString(result.value()); response_sender.Run(std::move(response)); } else { std::unique_ptr<dbus::ErrorResponse> error_response =
diff --git a/chromeos/dbus/services/component_updater_service_provider.h b/chromeos/dbus/services/component_updater_service_provider.h index 2aacd281..7d82953 100644 --- a/chromeos/dbus/services/component_updater_service_provider.h +++ b/chromeos/dbus/services/component_updater_service_provider.h
@@ -9,6 +9,7 @@ #include <string> #include "base/compiler_specific.h" +#include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" @@ -53,7 +54,7 @@ virtual void LoadComponent( const std::string& name, - base::OnceCallback<void(const std::string&)> load_callback) = 0; + base::OnceCallback<void(const base::FilePath&)> load_callback) = 0; virtual bool UnloadComponent(const std::string& name) = 0; @@ -81,7 +82,7 @@ // Callback executed after component loading operation is done. void OnLoadComponent(dbus::MethodCall* method_call, dbus::ExportedObject::ResponseSender response_sender, - const std::string& result); + const base::FilePath& result); // Called on UI thread in response to a D-Bus request. void UnloadComponent(dbus::MethodCall* method_call,
diff --git a/chromeos/dbus/services/org.chromium.ComponentUpdaterService.conf b/chromeos/dbus/services/org.chromium.ComponentUpdaterService.conf index d0a3df0..aba0d9b0 100644 --- a/chromeos/dbus/services/org.chromium.ComponentUpdaterService.conf +++ b/chromeos/dbus/services/org.chromium.ComponentUpdaterService.conf
@@ -15,4 +15,10 @@ <allow send_destination="org.chromium.ComponentUpdaterService" send_interface="org.chromium.ComponentUpdaterService"/> </policy> + + <!-- modemfwd runs as modem-updater --> + <policy user="modem-updater"> + <allow send_destination="org.chromium.ComponentUpdaterService" + send_interface="org.chromium.ComponentUpdaterService"/> + </policy> </busconfig>
diff --git a/chromeos/dbus/smb_provider_client.cc b/chromeos/dbus/smb_provider_client.cc index efd86cc..1dd5fed 100644 --- a/chromeos/dbus/smb_provider_client.cc +++ b/chromeos/dbus/smb_provider_client.cc
@@ -102,8 +102,11 @@ &SmbProviderClientImpl::HandleOpenFileCallback, &callback); } - void CloseFile(int32_t file_id, CloseFileCallback callback) override { + void CloseFile(int32_t mount_id, + int32_t file_id, + CloseFileCallback callback) override { smbprovider::CloseFileOptions options; + options.set_mount_id(mount_id); options.set_file_id(file_id); CallMethod(smbprovider::kCloseFileMethod, options, &SmbProviderClientImpl::HandleCloseFileCallback, &callback);
diff --git a/chromeos/dbus/smb_provider_client.h b/chromeos/dbus/smb_provider_client.h index 71762178..8998d08 100644 --- a/chromeos/dbus/smb_provider_client.h +++ b/chromeos/dbus/smb_provider_client.h
@@ -73,9 +73,11 @@ bool writeable, OpenFileCallback callback) = 0; - // Calls CloseFile. This closes the file with handle |file_id|. Subsequent - // operations using file with this handle will fail. - virtual void CloseFile(int32_t file_id, CloseFileCallback callback) = 0; + // Calls CloseFile. This closes the file with mount |mount_id| and handle + // |file_id|. Subsequent operations using file with this handle will fail. + virtual void CloseFile(int32_t mount_id, + int32_t file_id, + CloseFileCallback callback) = 0; protected: // Create() should be used instead.
diff --git a/chromeos/login/DEPS b/chromeos/login/DEPS index cad44c8..333f545 100644 --- a/chromeos/login/DEPS +++ b/chromeos/login/DEPS
@@ -1,4 +1,5 @@ include_rules = [ + "+components/password_manager/core/browser/hash_password_manager.h", "+components/signin/core/account_id", "+components/user_manager", "+google_apis",
diff --git a/chromeos/login/auth/auth_attempt_state.cc b/chromeos/login/auth/auth_attempt_state.cc index cc46698d..07e4dd79 100644 --- a/chromeos/login/auth/auth_attempt_state.cc +++ b/chromeos/login/auth/auth_attempt_state.cc
@@ -19,7 +19,6 @@ : AuthFailure::NONE), is_first_time_user_(user_is_new), cryptohome_complete_(false), - cryptohome_outcome_(false), cryptohome_code_(cryptohome::MOUNT_ERROR_NONE), username_hash_obtained_(true), username_hash_valid_(true) { @@ -33,10 +32,8 @@ } void AuthAttemptState::RecordCryptohomeStatus( - bool cryptohome_outcome, cryptohome::MountError cryptohome_code) { cryptohome_complete_ = true; - cryptohome_outcome_ = cryptohome_outcome; cryptohome_code_ = cryptohome_code; } @@ -57,7 +54,6 @@ void AuthAttemptState::ResetCryptohomeStatus() { cryptohome_complete_ = false; - cryptohome_outcome_ = false; cryptohome_code_ = cryptohome::MOUNT_ERROR_NONE; } @@ -77,10 +73,6 @@ return cryptohome_complete_; } -bool AuthAttemptState::cryptohome_outcome() { - return cryptohome_outcome_; -} - cryptohome::MountError AuthAttemptState::cryptohome_code() { return cryptohome_code_; }
diff --git a/chromeos/login/auth/auth_attempt_state.h b/chromeos/login/auth/auth_attempt_state.h index 73ccced..e935097 100644 --- a/chromeos/login/auth/auth_attempt_state.h +++ b/chromeos/login/auth/auth_attempt_state.h
@@ -47,11 +47,10 @@ // requests (Mount/GetUsernameHash) are completed. void UsernameHashRequested(); - // Copy |cryptohome_code| and |cryptohome_outcome| into this object, - // so we can have a copy we're sure to own, and can make available - // on the UI thread. Must be called from the UI thread. - void RecordCryptohomeStatus(bool cryptohome_outcome, - cryptohome::MountError cryptohome_code); + // Copy |cryptohome_code| into this object, so we can have a copy we're sure + // to own, and can make available on the UI thread. + // Must be called from the UI thread. + void RecordCryptohomeStatus(cryptohome::MountError cryptohome_code); // Blow away locally stored cryptohome login status. // Must be called from the UI thread. @@ -62,7 +61,6 @@ virtual bool is_first_time_user(); virtual bool cryptohome_complete(); - virtual bool cryptohome_outcome(); virtual cryptohome::MountError cryptohome_code(); virtual bool username_hash_obtained(); @@ -87,7 +85,6 @@ // Status of our cryptohome op attempt. Can only have one in flight at a time. bool cryptohome_complete_; - bool cryptohome_outcome_; cryptohome::MountError cryptohome_code_; private:
diff --git a/chromeos/login/auth/cryptohome_authenticator.cc b/chromeos/login/auth/cryptohome_authenticator.cc index a5836fbf..e05f7b2 100644 --- a/chromeos/login/auth/cryptohome_authenticator.cc +++ b/chromeos/login/auth/cryptohome_authenticator.cc
@@ -92,7 +92,7 @@ scoped_refptr<CryptohomeAuthenticator> resolver, bool success, cryptohome::MountError return_code) { - attempt->RecordCryptohomeStatus(success, return_code); + attempt->RecordCryptohomeStatus(return_code); resolver->Resolve(); } @@ -125,17 +125,14 @@ scoped_refptr<CryptohomeAuthenticator> resolver) { chromeos::LoginEventRecorder::Get()->AddLoginTimeMarker("CryptohomeMount-End", false); - attempt->RecordCryptohomeStatus(false /* success */, - cryptohome::MOUNT_ERROR_KEY_FAILURE); + attempt->RecordCryptohomeStatus(cryptohome::MOUNT_ERROR_KEY_FAILURE); resolver->Resolve(); } // Callback invoked when cryptohome's MountEx() method has finished. void OnMount(const base::WeakPtr<AuthAttemptState>& attempt, scoped_refptr<CryptohomeAuthenticator> resolver, - bool success, - cryptohome::MountError return_code, - const std::string& mount_hash) { + base::Optional<cryptohome::BaseReply> reply) { const bool public_mount = attempt->user_context.GetUserType() == user_manager::USER_TYPE_KIOSK_APP || attempt->user_context.GetUserType() == @@ -144,9 +141,9 @@ chromeos::LoginEventRecorder::Get()->AddLoginTimeMarker( public_mount ? "CryptohomeMountPublic-End" : "CryptohomeMount-End", false); - attempt->RecordCryptohomeStatus(success, return_code); - if (success) - attempt->RecordUsernameHash(mount_hash); + attempt->RecordCryptohomeStatus(BaseReplyToMountError(reply)); + if (attempt->cryptohome_code() == cryptohome::MOUNT_ERROR_NONE) + attempt->RecordUsernameHash(BaseReplyToMountHash(reply.value())); else attempt->RecordUsernameHashFailed(); resolver->Resolve(); @@ -188,7 +185,7 @@ // a legacy key with no label while those created by Chrome OS M39 and newer // will have a key with the label kCryptohomeGAIAKeyLabel. auth_key->set_secret(key->GetSecret()); - cryptohome::HomedirMethods::GetInstance()->MountEx( + DBusThreadManager::Get()->GetCryptohomeClient()->MountEx( cryptohome::Identification(attempt->user_context.GetAccountId()), auth, mount, base::Bind(&OnMount, attempt, resolver)); } @@ -434,7 +431,7 @@ // is left empty. Authentication's key label is also set to an empty string, // which is a wildcard allowing any key to match to allow cryptohomes created // in a legacy way. (See comments in DoMount.) - cryptohome::HomedirMethods::GetInstance()->MountEx( + DBusThreadManager::Get()->GetCryptohomeClient()->MountEx( cryptohome::Identification(attempt->user_context.GetAccountId()), cryptohome::AuthorizationRequest(), mount, base::Bind(&OnMount, attempt, resolver)); @@ -925,7 +922,7 @@ AuthState state = CONTINUE; - if (current_state_->cryptohome_outcome() && + if (current_state_->cryptohome_code() == cryptohome::MOUNT_ERROR_NONE && current_state_->username_hash_valid()) { state = ResolveCryptohomeSuccessState(); } else {
diff --git a/chromeos/login/auth/extended_authenticator_impl.cc b/chromeos/login/auth/extended_authenticator_impl.cc index 375c6f6..dd9b490 100644 --- a/chromeos/login/auth/extended_authenticator_impl.cc +++ b/chromeos/login/auth/extended_authenticator_impl.cc
@@ -103,15 +103,10 @@ auth_key->mutable_data()->set_label(key.GetLabel()); } auth_key->set_secret(key.GetSecret()); - cryptohome::HomedirMethods::GetInstance()->MountEx( - id, - auth, - mount, - base::Bind(&ExtendedAuthenticatorImpl::OnMountComplete, - this, - "MountEx", - context, - success_callback)); + DBusThreadManager::Get()->GetCryptohomeClient()->MountEx( + id, auth, mount, + base::BindOnce(&ExtendedAuthenticatorImpl::OnMountComplete, this, + "MountEx", context, success_callback)); } void ExtendedAuthenticatorImpl::AddKey(const UserContext& context, @@ -189,12 +184,12 @@ const UserContext& user_context) { RecordStartMarker("MountEx"); const Key* const key = user_context.GetKey(); - cryptohome::HomedirMethods::GetInstance()->MountEx( + DBusThreadManager::Get()->GetCryptohomeClient()->MountEx( cryptohome::Identification(user_context.GetAccountId()), cryptohome::CreateAuthorizationRequest(key->GetLabel(), key->GetSecret()), cryptohome::MountRequest(), - base::Bind(&ExtendedAuthenticatorImpl::OnMountComplete, this, "MountEx", - user_context, success_callback)); + base::BindOnce(&ExtendedAuthenticatorImpl::OnMountComplete, this, + "MountEx", user_context, success_callback)); } void ExtendedAuthenticatorImpl::DoAuthenticateToCheck( @@ -270,17 +265,19 @@ const std::string& time_marker, const UserContext& user_context, const ResultCallback& success_callback, - bool success, - cryptohome::MountError return_code, - const std::string& mount_hash) { + base::Optional<cryptohome::BaseReply> reply) { + cryptohome::MountError return_code = cryptohome::BaseReplyToMountError(reply); RecordEndMarker(time_marker); - UserContext copy = user_context; - copy.SetUserIDHash(mount_hash); if (return_code == cryptohome::MOUNT_ERROR_NONE) { + const std::string& mount_hash = + cryptohome::BaseReplyToMountHash(reply.value()); if (!success_callback.is_null()) success_callback.Run(mount_hash); - if (old_consumer_) + if (old_consumer_) { + UserContext copy = user_context; + copy.SetUserIDHash(mount_hash); old_consumer_->OnAuthSuccess(copy); + } return; } AuthState state = FAILED_MOUNT; @@ -289,11 +286,12 @@ return_code == cryptohome::MOUNT_ERROR_TPM_NEEDS_REBOOT) { state = FAILED_TPM; } - if (return_code == cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST) { + if (return_code == cryptohome::MOUNT_ERROR_USER_DOES_NOT_EXIST) state = NO_MOUNT; - } + if (consumer_) consumer_->OnAuthenticationFailure(state); + if (old_consumer_) { AuthFailure failure(AuthFailure::COULD_NOT_MOUNT_CRYPTOHOME); old_consumer_->OnAuthFailure(failure);
diff --git a/chromeos/login/auth/extended_authenticator_impl.h b/chromeos/login/auth/extended_authenticator_impl.h index 99683f7a..7c086da 100644 --- a/chromeos/login/auth/extended_authenticator_impl.h +++ b/chromeos/login/auth/extended_authenticator_impl.h
@@ -11,7 +11,9 @@ #include "base/callback.h" #include "base/compiler_specific.h" #include "base/macros.h" +#include "base/optional.h" #include "chromeos/chromeos_export.h" +#include "chromeos/dbus/cryptohome/rpc.pb.h" #include "chromeos/login/auth/extended_authenticator.h" #include "third_party/cros_system_api/dbus/service_constants.h" @@ -78,9 +80,7 @@ void OnMountComplete(const std::string& time_marker, const UserContext& context, const ResultCallback& success_callback, - bool success, - cryptohome::MountError return_code, - const std::string& mount_hash); + base::Optional<cryptohome::BaseReply> reply); void OnOperationComplete(const std::string& time_marker, const UserContext& context, const base::Closure& success_callback,
diff --git a/chromeos/login/auth/test_attempt_state.cc b/chromeos/login/auth/test_attempt_state.cc index 4d263d7..9c02226 100644 --- a/chromeos/login/auth/test_attempt_state.cc +++ b/chromeos/login/auth/test_attempt_state.cc
@@ -5,6 +5,7 @@ #include "chromeos/login/auth/test_attempt_state.h" #include "components/user_manager/user_type.h" +#include "third_party/cros_system_api/dbus/service_constants.h" namespace chromeos { @@ -24,10 +25,8 @@ } void TestAttemptState::PresetCryptohomeStatus( - bool cryptohome_outcome, cryptohome::MountError cryptohome_code) { cryptohome_complete_ = true; - cryptohome_outcome_ = cryptohome_outcome; cryptohome_code_ = cryptohome_code; } @@ -47,10 +46,6 @@ return cryptohome_complete_; } -bool TestAttemptState::cryptohome_outcome() { - return cryptohome_outcome_; -} - cryptohome::MountError TestAttemptState::cryptohome_code() { return cryptohome_code_; }
diff --git a/chromeos/login/auth/test_attempt_state.h b/chromeos/login/auth/test_attempt_state.h index 287b003..9c65aa0 100644 --- a/chromeos/login/auth/test_attempt_state.h +++ b/chromeos/login/auth/test_attempt_state.h
@@ -26,15 +26,13 @@ void PresetOnlineLoginStatus(const AuthFailure& outcome); // Act as though an cryptohome login attempt completed already. - void PresetCryptohomeStatus(bool cryptohome_outcome, - cryptohome::MountError cryptohome_code); + void PresetCryptohomeStatus(cryptohome::MountError cryptohome_code); // To allow state to be queried on the main thread during tests. bool online_complete() override; const AuthFailure& online_outcome() override; bool is_first_time_user() override; bool cryptohome_complete() override; - bool cryptohome_outcome() override; cryptohome::MountError cryptohome_code() override; private:
diff --git a/chromeos/login/auth/user_context.cc b/chromeos/login/auth/user_context.cc index 344211e1..ae87767 100644 --- a/chromeos/login/auth/user_context.cc +++ b/chromeos/login/auth/user_context.cc
@@ -111,6 +111,11 @@ return gaps_cookie_; } +const base::Optional<password_manager::SyncPasswordData>& +UserContext::GetSyncPasswordData() const { + return sync_password_data_; +} + bool UserContext::HasCredentials() const { return (account_id_.is_valid() && !key_.GetSecret().empty()) || !auth_code_.empty(); @@ -176,6 +181,11 @@ gaps_cookie_ = gaps_cookie; } +void UserContext::SetSyncPasswordData( + const password_manager::SyncPasswordData& sync_password_data) { + sync_password_data_ = {sync_password_data}; +} + void UserContext::ClearSecrets() { key_.ClearSecret(); auth_code_.clear();
diff --git a/chromeos/login/auth/user_context.h b/chromeos/login/auth/user_context.h index ef5175d..fb873265 100644 --- a/chromeos/login/auth/user_context.h +++ b/chromeos/login/auth/user_context.h
@@ -7,8 +7,10 @@ #include <string> +#include "base/optional.h" #include "chromeos/chromeos_export.h" #include "chromeos/login/auth/key.h" +#include "components/password_manager/core/browser/hash_password_manager.h" #include "components/signin/core/account_id/account_id.h" #include "components/user_manager/user_type.h" @@ -63,6 +65,8 @@ const std::string& GetPublicSessionInputMethod() const; const std::string& GetDeviceId() const; const std::string& GetGAPSCookie() const; + const base::Optional<password_manager::SyncPasswordData>& + GetSyncPasswordData() const; bool HasCredentials() const; @@ -81,6 +85,8 @@ void SetPublicSessionInputMethod(const std::string& input_method); void SetDeviceId(const std::string& device_id); void SetGAPSCookie(const std::string& gaps_cookie); + void SetSyncPasswordData( + const password_manager::SyncPasswordData& sync_password_data); void ClearSecrets(); @@ -100,6 +106,9 @@ std::string public_session_input_method_; std::string device_id_; std::string gaps_cookie_; + + // For password reuse detection use. + base::Optional<password_manager::SyncPasswordData> sync_password_data_; }; } // namespace chromeos
diff --git a/chromeos/printing/ppd_provider.cc b/chromeos/printing/ppd_provider.cc index f59bdd8..f4bd2b0b 100644 --- a/chromeos/printing/ppd_provider.cc +++ b/chromeos/printing/ppd_provider.cc
@@ -45,6 +45,89 @@ namespace chromeos { namespace { +// Holds a metadata_v2 reverse-index response +struct ReverseIndexJSON { + // Canonical name of printer + std::string effective_make_and_model; + + // Name of printer manufacturer + std::string manufacturer; + + // Name of printer model + std::string model; + + // Restrictions for this manufacturer + PpdProvider::Restrictions restrictions; +}; + +// Holds a metadata_v2 manufacturers response +struct ManufacturersJSON { + // Name of printer manufacturer + std::string name; + + // Key for lookup of this manutacturer's printers (JSON file) + std::string reference; + + // Restrictions for this manufacturer + PpdProvider::Restrictions restrictions; +}; + +// Holds a metadata_v2 printers response +struct PrintersJSON { + // Name of printer + std::string name; + + // Canonical name of printer + std::string effective_make_and_model; + + // Restrictions for this printer + PpdProvider::Restrictions restrictions; +}; + +// Holds a metadata_v2 ppd-index response +struct PpdIndexJSON { + // Canonical name of printer + std::string effective_make_and_model; + + // Ppd filename + std::string ppd_filename; +}; + +// A queued request to download printer information for a manufacturer. +struct PrinterResolutionQueueEntry { + // Localized manufacturer name + std::string manufacturer; + + // URL we are going to pull from. + GURL url; + + // User callback on completion. + PpdProvider::ResolvePrintersCallback cb; +}; + +// A queued request to download reverse index information for a make and model +struct ReverseIndexQueueEntry { + // Canonical Printer Name + std::string effective_make_and_model; + + // URL we are going to pull from. + GURL url; + + // User callback on completion. + PpdProvider::ReverseLookupCallback cb; +}; + +// Holds manufacturer to printers relation +struct ManufacturerMetadata { + // Key used to look up the printer list on the server. This is initially + // populated. + std::string reference; + + // Map from localized printer name to canonical-make-and-model string for + // the given printer. Populated on demand. + std::unique_ptr<std::unordered_map<std::string, PrintersJSON>> printers; +}; + // Extract cupsFilter/cupsFilter2 filter names from a line from a ppd. // cupsFilter2 lines look like this: @@ -172,51 +255,55 @@ return base::ReadFileToString(path, file_contents); } -struct ManufacturerMetadata { - // Key used to look up the printer list on the server. This is initially - // populated. - std::string reference; +// Constructs and returns a printers' restrictions parsed from |dict|. +PpdProvider::Restrictions ComputeRestrictions(const base::Value& dict) { + DCHECK(dict.is_dict()); + PpdProvider::Restrictions restrictions; - // Map from localized printer name to canonical-make-and-model string for - // the given printer. Populated on demand. - std::unique_ptr<std::unordered_map<std::string, std::string>> printers; -}; + const base::Value* min_milestone = + dict.FindKeyOfType({"min_milestone"}, base::Value::Type::DOUBLE); + const base::Value* max_milestone = + dict.FindKeyOfType({"max_milestone"}, base::Value::Type::DOUBLE); -// A queued request to download printer information for a manufacturer. -struct PrinterResolutionQueueEntry { - // Localized manufacturer name - std::string manufacturer; + if (min_milestone) { + restrictions.min_milestone = + base::Version(base::NumberToString(min_milestone->GetDouble())); + } + if (max_milestone) { + restrictions.max_milestone = + base::Version(base::NumberToString(max_milestone->GetDouble())); + } - // URL we are going to pull from. - GURL url; + return restrictions; +} - // User callback on completion. - PpdProvider::ResolvePrintersCallback cb; -}; +// Returns true if this |printer| is restricted from the +// |current_version|. +bool IsPrinterRestricted(const PrintersJSON& printer, + const base::Version& current_version) { + const PpdProvider::Restrictions& restrictions = printer.restrictions; -// A queued request to download reverse index information for a make and model -struct ReverseIndexQueueEntry { - // Canonical Printer Name - std::string effective_make_and_model; + if (restrictions.min_milestone != base::Version("0.0") && + restrictions.min_milestone > current_version) { + return true; + } - // URL we are going to pull from. - GURL url; + if (restrictions.max_milestone != base::Version("0.0") && + restrictions.max_milestone < current_version) { + return true; + } - // User callback on completion. - PpdProvider::ReverseLookupCallback cb; -}; + return false; +} -// The string fields from a metadata_v2 printers response -struct ReverseIndexResponse { - // Canonical Printer Name - std::string effective_make_and_model; - - // Name of printer manufacturer - std::string manufacturer; - - // Name of printer model - std::string model; -}; +// Modifies |printers| by removing any restricted printers excluded from the +// current |version|, as judged by IsPrinterPermitted. +void FilterRestrictedPpdReferences(const base::Version& version, + std::vector<PrintersJSON>* printers) { + base::EraseIf(*printers, [&version](const PrintersJSON& printer) { + return IsPrinterRestricted(printer, version); + }); +} class PpdProviderImpl : public PpdProvider, public net::URLFetcherDelegate { public: @@ -236,6 +323,7 @@ const std::string& browser_locale, scoped_refptr<net::URLRequestContextGetter> url_context_getter, scoped_refptr<PpdCache> ppd_cache, + const base::Version& current_version, const PpdProvider::Options& options) : browser_locale_(browser_locale), url_context_getter_(url_context_getter), @@ -243,6 +331,7 @@ disk_task_runner_(base::CreateSequencedTaskRunnerWithTraits( {base::TaskPriority::USER_VISIBLE, base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})), + version_(current_version), options_(options), weak_factory_(this) {} @@ -279,15 +368,16 @@ // Have we successfully resolved next yet? bool resolved_next = false; if (!next.make_and_model.empty()) { - if (cached_ppd_index_.get() == nullptr) { - // Need to load the index before we can work on this resolution. - StartFetch(GetPpdIndexURL(), FT_PPD_INDEX); - return true; - } // Check the index for each make-and-model guess. for (const std::string& make_and_model : next.make_and_model) { - auto it = cached_ppd_index_->find(make_and_model); - if (it != cached_ppd_index_->end()) { + // Check if we need to load its ppd_index + int ppd_index_shard = IndexShard(make_and_model); + if (!base::ContainsKey(cached_ppd_idxs_, ppd_index_shard)) { + StartFetch(GetPpdIndexURL(ppd_index_shard), FT_PPD_INDEX); + return true; + } + if (base::ContainsKey(cached_ppd_idxs_[ppd_index_shard], + make_and_model)) { // Found a hit, satisfy this resolution. Printer::PpdReference ret; ret.effective_make_and_model = make_and_model; @@ -367,15 +457,17 @@ return; } DCHECK(!next.first.effective_make_and_model.empty()); - if (cached_ppd_index_.get() == nullptr) { + int ppd_index_shard = IndexShard(next.first.effective_make_and_model); + if (!base::ContainsKey(cached_ppd_idxs_, ppd_index_shard)) { // Have to have the ppd index before we can resolve by ppd server // key. - StartFetch(GetPpdIndexURL(), FT_PPD_INDEX); + StartFetch(GetPpdIndexURL(ppd_index_shard), FT_PPD_INDEX); return; } // Get the URL from the ppd index and start the fetch. - auto it = cached_ppd_index_->find(next.first.effective_make_and_model); - if (it != cached_ppd_index_->end()) { + auto& cached_ppd_index = cached_ppd_idxs_[ppd_index_shard]; + auto it = cached_ppd_index.find(next.first.effective_make_and_model); + if (it != cached_ppd_index.end()) { StartFetch(GetPpdURL(it->second), FT_PPD); return; } @@ -384,6 +476,7 @@ // thing if there is one. LOG(ERROR) << "PPD " << next.first.effective_make_and_model << " not found in server index"; + FinishPpdResolution(std::move(next.second), PpdProvider::INTERNAL_ERROR, std::string()); ppd_resolution_queue_.pop_front(); @@ -422,13 +515,20 @@ void ResolvePpdReference(const PrinterSearchData& search_data, const ResolvePpdReferenceCallback& cb) override { - ppd_reference_resolution_queue_.push_back({search_data, cb}); + // In v2 metadata, we work with lowercased effective_make_and_models. + PrinterSearchData lowercase_search_data(search_data); + for (auto& make_and_model : search_data.make_and_model) { + lowercase_search_data.make_and_model.push_back( + base::ToLowerASCII(make_and_model)); + } + + ppd_reference_resolution_queue_.push_back({lowercase_search_data, cb}); MaybeStartFetch(); } void ResolvePpd(const Printer::PpdReference& reference, ResolvePpdCallback cb) override { - // Do a sanity check here, so we can assumed |reference| is well-formed in + // Do a sanity check here, so we can assume |reference| is well-formed in // the rest of this class. if (!PpdReferenceIsWellFormed(reference)) { FinishPpdResolution(std::move(cb), PpdProvider::INTERNAL_ERROR, @@ -451,9 +551,7 @@ return; } - // In v2 metadata, all work will be done on a lowercase - // effective_make_and_model. We convert the string to lowercase here to - // maintain consistency across the file. + // In v2 metadata, we work with lowercased effective_make_and_models. std::string lowercase_effective_make_and_model = base::ToLowerASCII(effective_make_and_model); @@ -480,7 +578,7 @@ OnPrintersFetchComplete(); break; case FT_PPD_INDEX: - OnPpdIndexFetchComplete(); + OnPpdIndexFetchComplete(source->GetOriginalURL()); break; case FT_PPD: OnPpdFetchComplete(); @@ -501,26 +599,40 @@ private: // Return the URL used to look up the supported locales list. GURL GetLocalesURL() { - return GURL(options_.ppd_server_root + "/metadata/locales.json"); + return GURL(options_.ppd_server_root + "/metadata_v2/locales.json"); } GURL GetUsbURL(int vendor_id) { DCHECK_GT(vendor_id, 0); DCHECK_LE(vendor_id, 0xffff); - return GURL(base::StringPrintf("%s/metadata/usb-%04x.json", + return GURL(base::StringPrintf("%s/metadata_v2/usb-%04x.json", options_.ppd_server_root.c_str(), vendor_id)); } - // Return the URL used to get the index of ppd server key -> ppd. - GURL GetPpdIndexURL() { - return GURL(options_.ppd_server_root + "/metadata/index.json"); + // Return the URL used to get the |ppd_index_shard| index. + GURL GetPpdIndexURL(int ppd_index_shard) { + return GURL(base::StringPrintf("%s/metadata_v2/index-%02d.json", + options_.ppd_server_root.c_str(), + ppd_index_shard)); + } + + // Return the ppd index shard number from its |url|. + int GetShardFromUrl(const GURL& url) { + auto url_str = url.spec(); + if (url_str.empty()) { + return -1; + } + + // Strip shard number from 2 digits following 'index' + int idx_pos = url_str.find_first_of("0123456789", url_str.find("index-")); + return std::stoi(url_str.substr(idx_pos, 2)); } // Return the URL to get a localized manufacturers map. GURL GetManufacturersURL(const std::string& locale) { - return GURL(base::StringPrintf("%s/metadata/manufacturers-%s.json", + return GURL(base::StringPrintf("%s/metadata_v2/manufacturers-%s.json", options_.ppd_server_root.c_str(), locale.c_str())); } @@ -528,7 +640,7 @@ // Return the URL used to get a list of printers from the manufacturer |ref|. GURL GetPrintersURL(const std::string& ref) { return GURL(base::StringPrintf( - "%s/metadata/%s", options_.ppd_server_root.c_str(), ref.c_str())); + "%s/metadata_v2/%s", options_.ppd_server_root.c_str(), ref.c_str())); } // Return the URL used to get a ppd with the given filename. @@ -668,9 +780,9 @@ // calls. void OnManufacturersFetchComplete() { DCHECK_EQ(nullptr, cached_metadata_.get()); - std::vector<std::pair<std::string, std::string>> contents; + std::vector<ManufacturersJSON> contents; PpdProvider::CallbackResultCode code = - ValidateAndParseJSONResponse(&contents); + ValidateAndParseManufacturersJSON(&contents); if (code != PpdProvider::SUCCESS) { LOG(ERROR) << "Failed manufacturer parsing"; FailQueuedMetadataResolutions(code); @@ -680,9 +792,7 @@ std::unordered_map<std::string, ManufacturerMetadata>>(); for (const auto& entry : contents) { - ManufacturerMetadata value; - value.reference = entry.second; - (*cached_metadata_)[entry.first].reference = entry.second; + (*cached_metadata_)[entry.name].reference = entry.reference; } std::vector<std::string> manufacturer_list = GetManufacturerList(); @@ -700,9 +810,11 @@ void OnPrintersFetchComplete() { CHECK(cached_metadata_.get() != nullptr); DCHECK(!printers_resolution_queue_.empty()); - std::vector<std::pair<std::string, std::string>> contents; + std::vector<PrintersJSON> contents; + PpdProvider::CallbackResultCode code = - ValidateAndParseJSONResponse(&contents); + ValidateAndParsePrintersJSON(&contents); + if (code != PpdProvider::SUCCESS) { base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(printers_resolution_queue_.front().cb, code, @@ -723,11 +835,12 @@ auto& manufacturer_metadata = it->second; CHECK(manufacturer_metadata.printers.get() == nullptr); manufacturer_metadata.printers = - std::make_unique<std::unordered_map<std::string, std::string>>(); + std::make_unique<std::unordered_map<std::string, PrintersJSON>>(); for (const auto& entry : contents) { - manufacturer_metadata.printers->insert({entry.first, entry.second}); + manufacturer_metadata.printers->insert({entry.name, entry}); } + base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(printers_resolution_queue_.front().cb, @@ -737,24 +850,26 @@ printers_resolution_queue_.pop_front(); } - // Called when |fetcher_| should have just received the index mapping + // Called when |fetcher_| should have just received an index mapping // ppd server keys to ppd filenames. Use this to populate - // |cached_ppd_index_|. - void OnPpdIndexFetchComplete() { - std::vector<std::pair<std::string, std::string>> contents; + // |cached_ppd_idxs_|. + void OnPpdIndexFetchComplete(const GURL& url) { + std::vector<PpdIndexJSON> contents; PpdProvider::CallbackResultCode code = - ValidateAndParseJSONResponse(&contents); + ValidateAndParsePpdIndexJSON(&contents); if (code != PpdProvider::SUCCESS) { FailQueuedServerPpdResolutions(code); } else { - cached_ppd_index_ = - std::make_unique<std::unordered_map<std::string, std::string>>(); - // This should be a list of lists of 2-element strings, where the first - // element is the |effective_make_and_model| of the printer and the second - // element is the filename of the ppd in the ppds/ directory on the - // server. + int ppd_index_shard = GetShardFromUrl(url); + if (ppd_index_shard < 0) { + FailQueuedServerPpdResolutions(PpdProvider::INTERNAL_ERROR); + return; + } + + auto& cached_ppd_index = cached_ppd_idxs_[ppd_index_shard]; for (const auto& entry : contents) { - cached_ppd_index_->insert(entry); + cached_ppd_index.insert( + {entry.effective_make_and_model, entry.ppd_filename}); } } } @@ -788,7 +903,7 @@ // queue. void OnReverseIndexComplete() { DCHECK(!reverse_index_resolution_queue_.empty()); - std::vector<ReverseIndexResponse> contents; + std::vector<ReverseIndexJSON> contents; PpdProvider::CallbackResultCode code = ValidateAndParseReverseIndexJSON(&contents); const ReverseIndexQueueEntry& entry = @@ -798,12 +913,11 @@ LOG(ERROR) << "Request Failed or failed reverse index parsing"; PostReverseLookupFailure(code, entry.cb); } else { - auto found = - std::find_if(contents.begin(), contents.end(), - [&entry](const ReverseIndexResponse& rir) -> bool { - return rir.effective_make_and_model == - entry.effective_make_and_model; - }); + auto found = std::find_if(contents.begin(), contents.end(), + [&entry](const ReverseIndexJSON& rij) -> bool { + return rij.effective_make_and_model == + entry.effective_make_and_model; + }); if (found != contents.end()) { base::SequencedTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(entry.cb, PpdProvider::SUCCESS, @@ -1021,49 +1135,13 @@ return ret; } - // Many of our metadata fetches happens to be in the form of a JSON - // list-of-lists-of-2-strings. So this just attempts to parse a JSON reply to - // |fetcher| into the passed contents vector. A return code of SUCCESS means - // the JSON was formatted as expected and we've parsed it into |contents|. On - // error the contents of |contents| cleared. - PpdProvider::CallbackResultCode ValidateAndParseJSONResponse( - std::vector<std::pair<std::string, std::string>>* contents) { - contents->clear(); - std::string buffer; - auto tmp = ValidateAndGetResponseAsString(&buffer); - if (tmp != PpdProvider::SUCCESS) { - return tmp; - } - auto top_list = base::ListValue::From(base::JSONReader::Read(buffer)); - - if (top_list.get() == nullptr) { - // We got something malformed back. - return PpdProvider::INTERNAL_ERROR; - } - for (const auto& entry : *top_list) { - const base::ListValue* sub_list; - contents->push_back({}); - if (!entry.GetAsList(&sub_list) || sub_list->GetSize() != 2 || - !sub_list->GetString(0, &contents->back().first) || - !sub_list->GetString(1, &contents->back().second)) { - contents->clear(); - return PpdProvider::INTERNAL_ERROR; - } - } - return PpdProvider::SUCCESS; - } - - // For the metadata fetches that happens to be in the form of a JSON - // list-of-lists-of-3-strings and a dictionary of metadata (the data from a - // reverse index json response will be in this format). This method - // attempts to parse a JSON reply to |fetcher| into the passed contents - // vector. A return code of SUCCESS means the JSON was formatted as expected - // and we've parsed it into |contents|. On error the contents of |contents| is - // cleared. - PpdProvider::CallbackResultCode ValidateAndParseReverseIndexJSON( - std::vector<ReverseIndexResponse>* contents) { - DCHECK(contents != nullptr); - contents->clear(); + // Ensures that the fetched JSON is in the expected format, that is leading + // with exactly |num_strings| and followed by an optional dictionary. Returns + // PpdProvider::SUCCESS and saves JSON list in |top_list| if format is valid, + // returns PpdProvider::INTERNAL_ERROR otherwise. + PpdProvider::CallbackResultCode ParseAndValidateJSONFormat( + base::Value::ListStorage* top_list, + size_t num_strings) { std::string buffer; auto fetch_result = ValidateAndGetResponseAsString(&buffer); @@ -1071,35 +1149,170 @@ return fetch_result; } - auto top_list = base::ListValue::From(base::JSONReader::Read(buffer)); - if (top_list.get() == nullptr) { + auto ret_list = base::ListValue::From(base::JSONReader::Read(buffer)); + if (ret_list == nullptr) { return PpdProvider::INTERNAL_ERROR; } + *top_list = std::move(ret_list->GetList()); + + for (const auto& entry : *top_list) { + if (!entry.is_list()) { + return PpdProvider::INTERNAL_ERROR; + } + + // entry must start with |num_strings| strings + const base::Value::ListStorage& list = entry.GetList(); + if (list.size() < num_strings) { + return PpdProvider::INTERNAL_ERROR; + } + for (size_t i = 0; i < num_strings; ++i) { + if (!list[i].is_string()) { + return PpdProvider::INTERNAL_ERROR; + } + } + + // entry may optionally have a last arg that must be a dict + if (list.size() > num_strings && !list[num_strings].is_dict()) { + return PpdProvider::INTERNAL_ERROR; + } + + // entry may not have more than |num_strings| strings and one dict + if (list.size() > num_strings + 1) { + return PpdProvider::INTERNAL_ERROR; + } + } + + return PpdProvider::SUCCESS; + } + + // Attempts to parse a ReverseIndexJSON reply to |fetcher| into the passed + // contents. Returns PpdProvider::SUCCESS on valid JSON formatting and filled + // |contents|, clears |contents| otherwise. + PpdProvider::CallbackResultCode ValidateAndParseReverseIndexJSON( + std::vector<ReverseIndexJSON>* contents) { + DCHECK(contents != nullptr); + contents->clear(); + + base::Value::ListStorage top_list; + auto ret = ParseAndValidateJSONFormat(&top_list, 3); + if (ret != PpdProvider::SUCCESS) { + LOG(ERROR) << "Failed to parse ReverseIndex metadata"; + return ret; + } // Fetched data should be in the form {[effective_make_and_model], // [manufacturer], [model], [dictionary of metadata]} - for (const auto& entry : *top_list) { - if (!entry.is_list()) { - LOG(WARNING) << "Retrieved data in unexpected format. Data should be " - "in list format"; - return PpdProvider::INTERNAL_ERROR; - } - + for (const auto& entry : top_list) { const base::Value::ListStorage& list = entry.GetList(); - if (list.size() < 3 || !list[0].is_string() || !list[1].is_string() || - !list[2].is_string()) { - LOG(ERROR) << "Retrieved data in unexpected format. Expecting List of " - "3 or more strings"; - return PpdProvider::INTERNAL_ERROR; + ReverseIndexJSON rij_entry; + rij_entry.effective_make_and_model = list[0].GetString(); + rij_entry.manufacturer = list[1].GetString(); + rij_entry.model = list[2].GetString(); + + // Populate restrictions, if available + if (list.size() > 3) { + rij_entry.restrictions = ComputeRestrictions(list[3]); } - ReverseIndexResponse rir_entry; - rir_entry.effective_make_and_model = list[0].GetString(); - rir_entry.manufacturer = list[1].GetString(); - rir_entry.model = list[2].GetString(); + contents->push_back(rij_entry); + } + return PpdProvider::SUCCESS; + } - contents->push_back(rir_entry); + // Attempts to parse a ManufacturersJSON reply to |fetcher| into the passed + // contents. Returns PpdProvider::SUCCESS on valid JSON formatting and filled + // |contents|, clears |contents| otherwise. + PpdProvider::CallbackResultCode ValidateAndParseManufacturersJSON( + std::vector<ManufacturersJSON>* contents) { + DCHECK(contents != NULL); + contents->clear(); + + base::Value::ListStorage top_list; + auto ret = ParseAndValidateJSONFormat(&top_list, 2); + if (ret != PpdProvider::SUCCESS) { + LOG(ERROR) << "Failed to process Manufacturers metadata"; + return ret; + } + + // Fetched data should be in form [[name], [canonical name], + // {restrictions}] + for (const auto& entry : top_list) { + const base::Value::ListStorage& list = entry.GetList(); + ManufacturersJSON mj_entry; + mj_entry.name = list[0].GetString(); + mj_entry.reference = list[1].GetString(); + + // Populate restrictions, if available + if (list.size() > 2) { + mj_entry.restrictions = ComputeRestrictions(list[2]); + } + + contents->push_back(mj_entry); + } + + return PpdProvider::SUCCESS; + } + + // Attempts to parse a PrintersJSON reply to |fetcher| into the passed + // contents. Returns PpdProvider::SUCCESS on valid JSON formatting and filled + // |contents|, clears |contents| otherwise. + PpdProvider::CallbackResultCode ValidateAndParsePrintersJSON( + std::vector<PrintersJSON>* contents) { + DCHECK(contents != NULL); + contents->clear(); + + base::Value::ListStorage top_list; + auto ret = ParseAndValidateJSONFormat(&top_list, 2); + if (ret != PpdProvider::SUCCESS) { + LOG(ERROR) << "Failed to parse Printers metadata"; + return ret; + } + + // Fetched data should be in form [[name], [canonical name], + // {restrictions}] + for (const auto& entry : top_list) { + const base::Value::ListStorage& list = entry.GetList(); + PrintersJSON pj_entry; + pj_entry.name = list[0].GetString(); + pj_entry.effective_make_and_model = list[1].GetString(); + + // Populate restrictions, if available + if (list.size() > 2) { + pj_entry.restrictions = ComputeRestrictions(list[2]); + } + + contents->push_back(pj_entry); + } + + return PpdProvider::SUCCESS; + } + + // Attempts to parse a PpdIndexJSON reply to |fetcher| into the passed + // contents. Returns PpdProvider::SUCCESS on valid JSON formatting and filled + // |contents|, clears |contents| otherwise. + PpdProvider::CallbackResultCode ValidateAndParsePpdIndexJSON( + std::vector<PpdIndexJSON>* contents) { + DCHECK(contents != nullptr); + contents->clear(); + + base::Value::ListStorage top_list; + auto ret = ParseAndValidateJSONFormat(&top_list, 2); + if (ret != PpdProvider::SUCCESS) { + LOG(ERROR) << "Failed to parse PpdIndex metadata"; + return ret; + } + + // Fetched data should be in the form {[effective_make_and_model], + // [manufacturer], [model], [dictionary of metadata]} + for (const auto& entry : top_list) { + const base::Value::ListStorage& list = entry.GetList(); + + PpdIndexJSON pij_entry; + pij_entry.effective_make_and_model = list[0].GetString(); + pij_entry.ppd_filename = list[1].GetString(); + + contents->push_back(pij_entry); } return PpdProvider::SUCCESS; } @@ -1123,19 +1336,25 @@ ResolvedPrintersList GetManufacturerPrinterList( const ManufacturerMetadata& meta) const { CHECK(meta.printers.get() != nullptr); - ResolvedPrintersList ret; - ret.reserve(meta.printers->size()); + std::vector<PrintersJSON> printers; + printers.reserve(meta.printers->size()); for (const auto& entry : *meta.printers) { - Printer::PpdReference ppd_ref; - ppd_ref.effective_make_and_model = entry.second; - ret.push_back({entry.first, ppd_ref}); + printers.push_back(entry.second); } // TODO(justincarlson) -- this should be a localization-aware sort. - sort(ret.begin(), ret.end(), - [](const std::pair<std::string, Printer::PpdReference>& a, - const std::pair<std::string, Printer::PpdReference>& b) -> bool { - return a.first < b.first; + sort(printers.begin(), printers.end(), + [](const PrintersJSON& a, const PrintersJSON& b) -> bool { + return a.name < b.name; }); + FilterRestrictedPpdReferences(version_, &printers); + + ResolvedPrintersList ret; + ret.reserve(printers.size()); + for (const auto& printer : printers) { + Printer::PpdReference ppd_ref; + ppd_ref.effective_make_and_model = printer.effective_make_and_model; + ret.push_back({printer.name, ppd_ref}); + } return ret; } @@ -1166,12 +1385,12 @@ std::unique_ptr<std::unordered_map<std::string, ManufacturerMetadata>> cached_metadata_; - // Cached contents of the server index, which maps a - // PpdReference::effective_make_and_model to a url for the corresponding - // ppd. - // Null until we have fetched the index. - std::unique_ptr<std::unordered_map<std::string, std::string>> - cached_ppd_index_; + // Cached contents of the server indexs, which maps first a shard number to + // the corresponding index map of PpdReference::effective_make_and_models to a + // urls for the corresponding ppds. Starts as an empty map and filled lazily + // as we need to fill in more indexs. + std::unordered_map<int, std::unordered_map<std::string, std::string>> + cached_ppd_idxs_; // Queued ResolveManufacturers() calls. We will simultaneously resolve // all queued requests, so no need for a deque here. @@ -1181,6 +1400,7 @@ base::circular_deque<PrinterResolutionQueueEntry> printers_resolution_queue_; // Queued ResolvePpd() requests. + base::circular_deque<std::pair<Printer::PpdReference, ResolvePpdCallback>> ppd_resolution_queue_; @@ -1220,6 +1440,9 @@ // Where to run disk operations. scoped_refptr<base::SequencedTaskRunner> disk_task_runner_; + // Current version used to filter restricted ppds + base::Version version_; + // Construction-time options, immutable. const PpdProvider::Options options_; @@ -1241,8 +1464,9 @@ const std::string& browser_locale, scoped_refptr<net::URLRequestContextGetter> url_context_getter, scoped_refptr<PpdCache> ppd_cache, + const base::Version& current_version, const PpdProvider::Options& options) { return scoped_refptr<PpdProvider>(new PpdProviderImpl( - browser_locale, url_context_getter, ppd_cache, options)); + browser_locale, url_context_getter, ppd_cache, current_version, options)); } } // namespace chromeos
diff --git a/chromeos/printing/ppd_provider.h b/chromeos/printing/ppd_provider.h index b58cec1..6c465adf 100644 --- a/chromeos/printing/ppd_provider.h +++ b/chromeos/printing/ppd_provider.h
@@ -13,6 +13,7 @@ #include "base/callback.h" #include "base/files/file_path.h" +#include "base/version.h" #include "chromeos/chromeos_export.h" #include "chromeos/printing/printer_configuration.h" @@ -78,6 +79,23 @@ int usb_product_id = 0; }; + // Defines the limitations on when we show a particular PPD + struct Restrictions { + // Minimum milestone for ChromeOS build + base::Version min_milestone = base::Version("0.0"); + + // Maximum milestone for ChomeOS build + base::Version max_milestone = base::Version("0.0"); + }; + + struct ResolvedPpdReference { + // The name of the model of printer or printer line + std::string name; + + // Correct PpdReferece to be used with this printer + Printer::PpdReference ppd_ref; + }; + // Result of a ResolvePpd() call. // If the result code is SUCCESS, then: // string holds the contents of a PPD (that may or may not be gzipped). @@ -96,8 +114,7 @@ // A list of printer names paired with the PpdReference that should be used // for that printer. - using ResolvedPrintersList = - std::vector<std::pair<std::string, Printer::PpdReference>>; + using ResolvedPrintersList = std::vector<ResolvedPpdReference>; // Result of a ResolvePrinters() call. If the result code is SUCCESS, then // the vector contains a sorted list <model_name, PpdReference> tuples of all @@ -128,6 +145,7 @@ const std::string& browser_locale, scoped_refptr<net::URLRequestContextGetter> url_context_getter, scoped_refptr<PpdCache> cache, + const base::Version& current_version, const Options& options = Options()); // Get all manufacturers for which we have drivers. Keys of the map will be
diff --git a/chromeos/printing/ppd_provider_unittest.cc b/chromeos/printing/ppd_provider_unittest.cc index d16ddfd..43ad93d 100644 --- a/chromeos/printing/ppd_provider_unittest.cc +++ b/chromeos/printing/ppd_provider_unittest.cc
@@ -20,6 +20,7 @@ #include "base/test/test_message_loop.h" #include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h" +#include "base/version.h" #include "chromeos/chromeos_paths.h" #include "chromeos/printing/ppd_cache.h" #include "chromeos/printing/ppd_provider.h" @@ -80,7 +81,7 @@ return PpdProvider::Create(locale, request_context_getter_.get(), PpdCache::Create(ppd_cache_temp_dir_.GetPath()), - provider_options); + base::Version("40.8.6753.09"), provider_options); } // Create an interceptor that serves a small fileset of ppd server files. @@ -92,44 +93,72 @@ // Use brace initialization to express the desired server contents as "url", // "contents" pairs. std::vector<std::pair<std::string, std::string>> server_contents = { - {"metadata/locales.json", + {"metadata_v2/locales.json", R"(["en", "es-mx", "en-gb"])"}, - {"metadata/index.json", + {"metadata_v2/index-01.json", R"([ - ["printer_a_ref", "printer_a.ppd"], - ["printer_b_ref", "printer_b.ppd"], + ["printer_a_ref", "printer_a.ppd"] + ])"}, + {"metadata_v2/index-02.json", + R"([ + ["printer_b_ref", "printer_b.ppd"] + ])"}, + {"metadata_v2/index-03.json", + R"([ ["printer_c_ref", "printer_c.ppd"] ])"}, - {"metadata/usb-031f.json", + {"metadata_v2/index-04.json", + R"([ + ["printer_d_ref", "printer_d.ppd"] + ])"}, + {"metadata_v2/index-05.json", + R"([ + ["printer_e_ref", "printer_e.ppd"] + ])"}, + {"metadata_v2/index-13.json", + R"([ + ])"}, + {"metadata_v2/usb-031f.json", R"([ [1592, "Some canonical reference"], [6535, "Some other canonical reference"] ])"}, - {"metadata/manufacturers-en.json", + {"metadata_v2/manufacturers-en.json", R"([ ["manufacturer_a_en", "manufacturer_a.json"], ["manufacturer_b_en", "manufacturer_b.json"] ])"}, - {"metadata/manufacturers-en-gb.json", + {"metadata_v2/manufacturers-en-gb.json", R"([ ["manufacturer_a_en-gb", "manufacturer_a.json"], ["manufacturer_b_en-gb", "manufacturer_b.json"] ])"}, - {"metadata/manufacturers-es-mx.json", + {"metadata_v2/manufacturers-es-mx.json", R"([ ["manufacturer_a_es-mx", "manufacturer_a.json"], ["manufacturer_b_es-mx", "manufacturer_b.json"] ])"}, - {"metadata/manufacturer_a.json", + {"metadata_v2/manufacturer_a.json", R"([ ["printer_a", "printer_a_ref"], - ["printer_b", "printer_b_ref"] + ["printer_b", "printer_b_ref"], + ["printer_d", "printer_d_ref"] ])"}, - {"metadata/manufacturer_b.json", + {"metadata_v2/manufacturer_a.json", R"([ - ["printer_c", "printer_c_ref"] + ["printer_a", "printer_a_ref", + {"min_milestone":25.0000}], + ["printer_b", "printer_b_ref", + {"min_milestone":30.0000, "max_milestone":45.0000}], + ["printer_d", "printer_d_ref", + {"min_milestone":60.0000, "max_milestone":75.0000}] + ])"}, + {"metadata_v2/manufacturer_b.json", + R"([ + ["printer_c", "printer_c_ref"], + ["printer_e", "printer_e_ref"] ])"}, {"metadata_v2/reverse_index-en-01.json", R"([ @@ -138,9 +167,18 @@ {"metadata_v2/reverse_index-en-19.json", R"([ ])"}, + {"metadata_v2/manufacturer_b.json", + R"([ + ["printer_c", "printer_c_ref", + {"max_milestone":55.0000}], + ["printer_e", "printer_e_ref", + {"min_milestone":17.0000, "max_milestone":33.0000}] + ])"}, {"ppds/printer_a.ppd", kCupsFilterPpdContents}, {"ppds/printer_b.ppd", kCupsFilter2PpdContents}, {"ppds/printer_c.ppd", "c"}, + {"ppds/printer_d.ppd", "d"}, + {"ppds/printer_e.ppd", "e"}, {"user_supplied_ppd_directory/user_supplied.ppd", "u"}}; int next_file_num = 0; for (const auto& entry : server_contents) { @@ -434,6 +472,7 @@ provider->ResolvePrinters("manufacturer_b_en", base::Bind(&PpdProviderTest::CaptureResolvePrinters, base::Unretained(this))); + scoped_task_environment_.RunUntilIdle(); ASSERT_EQ(2UL, captured_resolve_printers_.size()); EXPECT_EQ(PpdProvider::SUCCESS, captured_resolve_printers_[0].first); @@ -444,18 +483,19 @@ // reference effective make and models of printer_a_ref and printer_b_ref. const auto& capture0 = captured_resolve_printers_[0].second; ASSERT_EQ(2UL, capture0.size()); - EXPECT_EQ("printer_a", capture0[0].first); - EXPECT_EQ("printer_a_ref", capture0[0].second.effective_make_and_model); + EXPECT_EQ("printer_a", capture0[0].name); + EXPECT_EQ("printer_a_ref", capture0[0].ppd_ref.effective_make_and_model); - EXPECT_EQ("printer_b", capture0[1].first); - EXPECT_EQ("printer_b_ref", capture0[1].second.effective_make_and_model); + EXPECT_EQ("printer_b", capture0[1].name); + EXPECT_EQ("printer_b_ref", capture0[1].ppd_ref.effective_make_and_model); // Second capture should get back printer_c with effective make and model of // printer_c_ref const auto& capture1 = captured_resolve_printers_[1].second; ASSERT_EQ(1UL, capture1.size()); - EXPECT_EQ("printer_c", capture1[0].first); - EXPECT_EQ("printer_c_ref", capture1[0].second.effective_make_and_model); + EXPECT_EQ("printer_c", capture1[0].name); + EXPECT_EQ("printer_c_ref", capture1[0].ppd_ref.effective_make_and_model); + // EXPECT_EQ(base::Version("55"), capture1[0].restrictions.max_milestone); } // Test that if we give a bad reference to ResolvePrinters(), we get an
diff --git a/components/arc/common/video_common.mojom b/components/arc/common/video_common.mojom index 88c99a1..968917c0 100644 --- a/components/arc/common/video_common.mojom +++ b/components/arc/common/video_common.mojom
@@ -64,6 +64,8 @@ // in "system/core/include/system/graphics.h" HAL_PIXEL_FORMAT_BGRA_8888 = 5, HAL_PIXEL_FORMAT_YCbCr_420_888 = 0x23, + HAL_PIXEL_FORMAT_YV12 = 0x32315659, + HAL_PIXEL_FORMAT_NV12 = 0x3231564e, }; // The offset and stride of a video frame plane. Both offset and stride must
diff --git a/components/arc/common/video_decode_accelerator.mojom b/components/arc/common/video_decode_accelerator.mojom index 674d3a6..005a41b 100644 --- a/components/arc/common/video_decode_accelerator.mojom +++ b/components/arc/common/video_decode_accelerator.mojom
@@ -36,7 +36,7 @@ }; // Format specification of the picture buffer request. -struct PictureBufferFormat { +struct PictureBufferFormatDeprecated { HalPixelFormat pixel_format; uint32 buffer_size; @@ -46,13 +46,46 @@ uint32 coded_height; }; +// Format specification of the picture buffer request. +struct PictureBufferFormat { + // minimal number of buffers required to process the video. + uint32 min_num_buffers; + Size coded_size; +}; + struct VideoDecodeAcceleratorConfig { VideoCodecProfile profile; bool secure_mode; }; +// The interface to access the hardware video decoding accelerator. To use +// the decoder, the client first calls Initialize() and waits for it to +// complete. Once done, the client can feed the decoder with input bit streams +// via Decode(). After decoder consumes the input buffer, the buffer will be +// released by VideoDecodeClient::NotifyEndOfBitstreamBuffer(). +// +// The decoder will also call VideoDecodeClient::ProvidePictureBuffers to +// ask for output buffers for decoding. The client must provide at least +// PictureBufferFormat::min_num_buffers of output buffers and tell the decoder +// the number by AssignPictureBuffers(). Those output buffers are imported +// one by one by ImportBufferForPicture(). Afterwards, the video decoder will +// writes the decoded output into those output buffers and notify the client +// via PictureReady() to indicate when a buffer is ready to be used. After +// client finish using the decoded buffer, it can return the buffer back to the +// decoder by ReusePictureBuffer(), allowing the buffer to be reused for +// decoding future frames. +// +// For secure playback, the client only holds the dummy buffers for both output +// and input. The protected buffers will be allocated in server side +// and never shared to the client. For input buffers, the client must call +// AllocateProtectedBuffer() to ask the server side to allocate buffers for +// storing decrypted input bit streams. For output buffers, the server will +// allocated the protected output buffers when ImportBufferForPicture() is +// called; this will tell the server to import and use the protected buffer +// instead of the dummy buffer. +// // Next MinVersion: 1 -// Next method ID: 8 +// Next method ID: 9 interface VideoDecodeAccelerator { [Extensible] enum Result { @@ -94,9 +127,22 @@ // Call VDA::ImportBufferForPicture with gfx::GpuMemoryBufferHandle // created from |handle_fd| and |planes|. // This should be preceded by a call to AssignPictureBuffers(). - ImportBufferForPicture@3(int32 picture_buffer_id, handle handle_fd, + ImportBufferForPictureDeprecated@3(int32 picture_buffer_id, handle handle_fd, array<VideoFramePlane> planes); + // Assigns a buffer to be used by the accelerator with specified + // |picture_buffer_id|. + // In secure mode, a new protected output buffer will be allocated for the + // given |picture_buffer_id|. The protected output buffer will then be + // imported and used instead of the buffer pointed by |handle_fd|. If there + // is any previously-allocated buffer with the same |picture_buffer_id|, + // it will be released. + // Call VDA::ImportBufferForPicture with |format| and a + // gfx::GpuMemoryBufferHandle created from |handle_fd| and |planes|. + // This should be preceded by a call to AssignPictureBuffers(). + ImportBufferForPicture@8(int32 picture_buffer_id, HalPixelFormat format, + handle handle_fd, array<VideoFramePlane> planes); + // Returns picture buffer with specified |picture_buffer_id| to be reused by // the accelerator. ReusePictureBuffer@4(int32 picture_buffer_id); @@ -112,11 +158,15 @@ Flush@6() => (Result result); }; -// Next MinVersion: 1 -// Next method ID: 4 +// Next MinVersion: 2 +// Next method ID: 5 interface VideoDecodeClient { // Callback to tell client how many and what size of buffers to provide. - ProvidePictureBuffers@0(PictureBufferFormat format); + ProvidePictureBuffersDeprecated@0(PictureBufferFormatDeprecated format); + + // Callback to tell client how many and what size of buffers to provide. + [MinVersion=1] + ProvidePictureBuffers@4(PictureBufferFormat format); // Called to notify the client that |picture| is ready to be displayed. // The calls to PictureReady() are in display order and Picture should
diff --git a/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc b/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc index cb3899b7..db59199 100644 --- a/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc +++ b/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc
@@ -184,13 +184,20 @@ output_pixel_format_ = format; pending_coded_size_ = dimensions; - mojom::PictureBufferFormatPtr pbf = mojom::PictureBufferFormat::New(); - pbf->pixel_format = pixel_format; - pbf->buffer_size = media::VideoFrame::AllocationSize(format, dimensions); - pbf->min_num_buffers = requested_num_of_buffers; - pbf->coded_width = dimensions.width(); - pbf->coded_height = dimensions.height(); - client_->ProvidePictureBuffers(std::move(pbf)); + if (client_.version() == 0) { + auto pbf = mojom::PictureBufferFormatDeprecated::New(); + pbf->pixel_format = pixel_format; + pbf->buffer_size = media::VideoFrame::AllocationSize(format, dimensions); + pbf->min_num_buffers = requested_num_of_buffers; + pbf->coded_width = dimensions.width(); + pbf->coded_height = dimensions.height(); + client_->ProvidePictureBuffersDeprecated(std::move(pbf)); + } else { + auto pbf = mojom::PictureBufferFormat::New(); + pbf->min_num_buffers = requested_num_of_buffers; + pbf->coded_size = dimensions; + client_->ProvidePictureBuffers(std::move(pbf)); + } } void GpuArcVideoDecodeAccelerator::DismissPictureBuffer( @@ -538,6 +545,16 @@ void GpuArcVideoDecodeAccelerator::ImportBufferForPicture( int32_t picture_buffer_id, + mojom::HalPixelFormat format, + mojo::ScopedHandle handle, + std::vector<VideoFramePlane> planes) { + // TODO(owenlin): Implement this function. + ImportBufferForPictureDeprecated(picture_buffer_id, std::move(handle), + std::move(planes)); +} + +void GpuArcVideoDecodeAccelerator::ImportBufferForPictureDeprecated( + int32_t picture_buffer_id, mojo::ScopedHandle handle, std::vector<VideoFramePlane> planes) { DVLOGF(3);
diff --git a/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.h b/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.h index 527e7f77..fdb33f1 100644 --- a/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.h +++ b/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.h
@@ -63,7 +63,12 @@ AllocateProtectedBufferCallback callback) override; void Decode(mojom::BitstreamBufferPtr bitstream_buffer) override; void AssignPictureBuffers(uint32_t count) override; + void ImportBufferForPictureDeprecated( + int32_t picture_buffer_id, + mojo::ScopedHandle handle, + std::vector<VideoFramePlane> planes) override; void ImportBufferForPicture(int32_t picture_buffer_id, + mojom::HalPixelFormat format, mojo::ScopedHandle handle, std::vector<VideoFramePlane> planes) override; void ReusePictureBuffer(int32_t picture_buffer_id) override;
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc index d2b003f..062ef9dc 100644 --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -1736,9 +1736,20 @@ if (!IsElementAutocompletable(*password_element)) return false; + // |current_username| is the username for credentials that are going to be + // autofilled. It is selected according to the algorithm: + // 1. If the page already contain a non-empty value in |username_element|, + // this is adopted and not overridden. + // 2. Default username from |fill_data| if the username field is + // autocompletable. + // 3. Empty if username field doesn't exist or if username field is empty and + // not autocompletable (no username case). base::string16 current_username; if (!username_element->IsNull()) { - current_username = username_element->Value().Utf16(); + if (!username_element->Value().IsEmpty()) + current_username = username_element->Value().Utf16(); + else if (IsElementAutocompletable(*username_element)) + current_username = fill_data.username_field.value; } // username and password will contain the match found if any. @@ -1751,9 +1762,6 @@ if (password.empty()) return false; - // TODO(tkent): Check maxlength and pattern for both username and password - // fields. - // Call OnFieldAutofilled before WebInputElement::SetAutofilled which may // cause frame closing. if (password_generation_agent_) @@ -1762,9 +1770,12 @@ // Input matches the username, fill in required values. if (!username_element->IsNull() && IsElementAutocompletable(*username_element)) { - // TODO(crbug.com/507714): Why not setSuggestedValue? - if (username_element->Value().Utf16() != username) - username_element->SetAutofillValue(blink::WebString::FromUTF16(username)); + // Fill username only when it's not empty and not set by the page. + if (!username.empty() && username_element->Value().IsEmpty()) { + username_element->SetSuggestedValue( + blink::WebString::FromUTF16(username)); + registration_callback.Run(username_element); + } UpdateFieldValueAndPropertiesMaskMap(*username_element, &username, FieldPropertiesFlags::AUTOFILLED, field_value_and_properties_map); @@ -1822,40 +1833,6 @@ if (!IsElementAutocompletable(password_element)) return false; - bool form_contains_fillable_username_field = - FillDataContainsFillableUsername(fill_data); - bool ambiguous_or_empty_names = - DoesFormContainAmbiguousOrEmptyNames(fill_data); - base::string16 username_field_name; - if (form_contains_fillable_username_field) - username_field_name = - FieldName(fill_data.username_field, ambiguous_or_empty_names); - - // If the form contains an autocompletable username field, try to set the - // username to the preferred name, but only if: - // (a) The fill-on-account-select flag is not set, and - // (b) The username element isn't prefilled - // - // If (a) is false, then just mark the username element as autofilled if the - // user is not in the "no highlighting" group and return so the fill step is - // skipped. - // - // If there is no autocompletable username field, and (a) is false, then the - // username element cannot be autofilled, but the user should still be able to - // select to fill the password element, so the password element must be marked - // as autofilled and the fill step should also be skipped if the user is not - // in the "no highlighting" group. - // - // In all other cases, do nothing. - bool form_has_fillable_username = !username_field_name.empty() && - IsElementAutocompletable(username_element); - - if (form_has_fillable_username && username_element.Value().IsEmpty()) { - // TODO(tkent): Check maxlength and pattern. - username_element.SetAutofillValue( - blink::WebString::FromUTF16(fill_data.username_field.value)); - } - bool exact_username_match = username_element.IsNull() || IsElementEditable(username_element); // Use the exact match for the editable username fields and allow prefix
diff --git a/components/autofill/content/renderer/password_autofill_agent.h b/components/autofill/content/renderer/password_autofill_agent.h index 5df0f36..4594db1 100644 --- a/components/autofill/content/renderer/password_autofill_agent.h +++ b/components/autofill/content/renderer/password_autofill_agent.h
@@ -283,11 +283,12 @@ ProvisionallySaveRestriction restriction); // This function attempts to fill |username_element| and |password_element| - // with values from |fill_data|. The |password_element| will only have the - // suggestedValue set, and will be registered for copying that to the real - // value through |registration_callback|. If a match is found, return true and - // |field_value_and_properties_map| will be modified with the autofilled - // credentials and |FieldPropertiesFlags::AUTOFILLED| flag. + // with values from |fill_data|. The |username_element| and |password_element| + // will only have the suggestedValue set, and will be registered for copying + // that to the real value through |registration_callback|. If a match is + // found, return true and |field_value_and_properties_map| will be modified + // with the autofilled credentials and |FieldPropertiesFlags::AUTOFILLED| + // flag. bool FillUserNameAndPassword( blink::WebInputElement* username_element, blink::WebInputElement* password_element,
diff --git a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc index fd622866..13096de 100644 --- a/components/autofill/core/browser/autocomplete_history_manager_unittest.cc +++ b/components/autofill/core/browser/autocomplete_history_manager_unittest.cc
@@ -195,9 +195,10 @@ : AutofillExternalDelegate(autofill_manager, autofill_driver) {} virtual ~MockAutofillExternalDelegate() {} - MOCK_METHOD2(OnSuggestionsReturned, + MOCK_METHOD3(OnSuggestionsReturned, void(int query_id, - const std::vector<Suggestion>& suggestions)); + const std::vector<Suggestion>& suggestions, + bool is_all_server_suggestions)); private: DISALLOW_COPY_AND_ASSIGN(MockAutofillExternalDelegate); @@ -232,7 +233,7 @@ autocomplete_history_manager.SetExternalDelegate(&external_delegate); // Should trigger a call to OnSuggestionsReturned, verified by the mock. - EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _)); + EXPECT_CALL(external_delegate, OnSuggestionsReturned(_, _, _)); autocomplete_history_manager.SendSuggestions(nullptr); } @@ -257,9 +258,9 @@ FormFieldData field; test::CreateTestFormField("Address", "address", "", "textarea", &field); - EXPECT_CALL(external_delegate, - OnSuggestionsReturned(0, - testing::Truly(IsEmptySuggestionVector))); + EXPECT_CALL( + external_delegate, + OnSuggestionsReturned(0, testing::Truly(IsEmptySuggestionVector), _)); autocomplete_history_manager.OnGetAutocompleteSuggestions( 0, field.name,
diff --git a/components/autofill/core/browser/autofill_external_delegate.cc b/components/autofill/core/browser/autofill_external_delegate.cc index 2c8d17a3..97b3ae2 100644 --- a/components/autofill/core/browser/autofill_external_delegate.cc +++ b/components/autofill/core/browser/autofill_external_delegate.cc
@@ -25,6 +25,7 @@ #include "components/autofill/core/browser/autofill_manager.h" #include "components/autofill/core/browser/autofill_metrics.h" #include "components/autofill/core/browser/popup_item_ids.h" +#include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_util.h" #include "components/strings/grit/components_strings.h" #include "ui/base/l10n/l10n_util.h" @@ -80,7 +81,8 @@ void AutofillExternalDelegate::OnSuggestionsReturned( int query_id, - const std::vector<Suggestion>& input_suggestions) { + const std::vector<Suggestion>& input_suggestions, + bool is_all_server_suggestions) { if (query_id != query_id_) return; @@ -122,7 +124,7 @@ } if (has_autofill_suggestions_) - ApplyAutofillOptions(&suggestions); + ApplyAutofillOptions(&suggestions, is_all_server_suggestions); // Append the credit card signin promo, if appropriate (there are no other // suggestions). @@ -336,7 +338,8 @@ } void AutofillExternalDelegate::ApplyAutofillOptions( - std::vector<Suggestion>* suggestions) { + std::vector<Suggestion>* suggestions, + bool is_all_server_suggestions) { // The form has been auto-filled, so give the user the chance to clear the // form. Append the 'Clear form' menu item. if (query_field_.is_autofilled) { @@ -351,11 +354,18 @@ suggestions->back().frontend_id = POPUP_ITEM_ID_CLEAR_FORM; } - // Append the 'Chrome Autofill options' menu item, or the menu item specified + // Append the 'Chrome Autofill settings' menu item, or the menu item specified // in the popup layout experiment. If we do not include // |POPUP_ITEM_ID_CLEAR_FORM|, include a hint for keyboard accessory. + // Menu item name will be 'Autofill settings' if experiment is enabled. suggestions->push_back(Suggestion(GetSettingsSuggestionValue())); suggestions->back().frontend_id = POPUP_ITEM_ID_AUTOFILL_OPTIONS; + if (is_all_server_suggestions && + base::FeatureList::IsEnabled( + features::kAutofillCreditCardDropdownGooglePayBranding)) { + suggestions->back().icon = base::ASCIIToUTF16("googlePay"); + } + #if defined(OS_ANDROID) if (IsKeyboardAccessoryEnabled()) { suggestions->back().icon = base::ASCIIToUTF16("settings"); @@ -411,9 +421,14 @@ if (IsKeyboardAccessoryEnabled()) { return l10n_util::GetStringUTF16(IDS_AUTOFILL_OPTIONS_CONTENT_DESCRIPTION); } - return l10n_util::GetStringUTF16(is_credit_card_popup_ ? - IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP : - IDS_AUTOFILL_OPTIONS_POPUP); + + if (base::FeatureList::IsEnabled( + features::kAutofillUseNewSettingsNameInDropdown)) + return l10n_util::GetStringUTF16(IDS_AUTOFILL_SETTINGS_POPUP); + + return l10n_util::GetStringUTF16(is_credit_card_popup_ + ? IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP + : IDS_AUTOFILL_OPTIONS_POPUP); } } // namespace autofill
diff --git a/components/autofill/core/browser/autofill_external_delegate.h b/components/autofill/core/browser/autofill_external_delegate.h index 4bc3364..d2669f6c 100644 --- a/components/autofill/core/browser/autofill_external_delegate.h +++ b/components/autofill/core/browser/autofill_external_delegate.h
@@ -70,9 +70,9 @@ // Records query results and correctly formats them before sending them off // to be displayed. Called when an Autofill query result is available. - virtual void OnSuggestionsReturned( - int query_id, - const std::vector<Suggestion>& suggestions); + virtual void OnSuggestionsReturned(int query_id, + const std::vector<Suggestion>& suggestions, + bool is_all_server_suggestions = false); // Set the data list value associated with the current field. void SetCurrentDataListValues( @@ -113,7 +113,10 @@ // Handle applying any Autofill option listings to the Autofill popup. // This function should only get called when there is at least one // multi-field suggestion in the list of suggestions. - void ApplyAutofillOptions(std::vector<Suggestion>* suggestions); + // |is_all_server_suggestions| should be true if |suggestions| are empty or + // all |suggestions| come from Google Payments. + void ApplyAutofillOptions(std::vector<Suggestion>* suggestions, + bool is_all_server_suggestions); // Insert the data list values at the start of the given list, including // any required separators. Will also go through |suggestions| and remove
diff --git a/components/autofill/core/browser/autofill_external_delegate_unittest.cc b/components/autofill/core/browser/autofill_external_delegate_unittest.cc index 5365852d..23e13d9 100644 --- a/components/autofill/core/browser/autofill_external_delegate_unittest.cc +++ b/components/autofill/core/browser/autofill_external_delegate_unittest.cc
@@ -12,8 +12,10 @@ #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "base/test/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "base/test/user_action_tester.h" #include "build/build_config.h" +#include "components/autofill/core/browser/autofill_experiments.h" #include "components/autofill/core/browser/autofill_manager.h" #include "components/autofill/core/browser/autofill_metrics.h" #include "components/autofill/core/browser/autofill_test_utils.h" @@ -22,14 +24,19 @@ #include "components/autofill/core/browser/test_autofill_client.h" #include "components/autofill/core/browser/test_autofill_driver.h" #include "components/autofill/core/browser/test_autofill_external_delegate.h" +#include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_switches.h" #include "components/autofill/core/common/form_data.h" #include "components/autofill/core/common/form_field_data.h" #include "components/autofill/core/common/password_form_fill_data.h" +#include "components/strings/grit/components_strings.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/gfx/geometry/rect.h" +using autofill::features::kAutofillCreditCardDropdownGooglePayBranding; +using autofill::features::kAutofillUseNewSettingsNameInDropdown; using base::ASCIIToUTF16; using testing::_; @@ -730,4 +737,135 @@ "Autofill.SuggestionAcceptedIndex.Autocomplete", 0, 1); } +TEST_F(AutofillExternalDelegateUnitTest, ShouldShowGooglePayIcon) { + // Turn on feature flag. + base::test::ScopedFeatureList scoped_feature_list_; + scoped_feature_list_.InitAndEnableFeature( + kAutofillCreditCardDropdownGooglePayBranding); + + IssueOnQuery(kQueryId); + + auto element_icons = testing::ElementsAre( +#if !defined(OS_ANDROID) + base::string16(), +#endif + base::string16(), base::ASCIIToUTF16("googlePay")); + EXPECT_CALL( + autofill_client_, + ShowAutofillPopup(_, _, SuggestionVectorIconsAre(element_icons), _)); + + std::vector<Suggestion> autofill_item; + autofill_item.push_back(Suggestion()); + autofill_item[0].frontend_id = kAutofillProfileId; + + // This should call ShowAutofillPopup. + external_delegate_->OnSuggestionsReturned(kQueryId, autofill_item, true); +} + +TEST_F(AutofillExternalDelegateUnitTest, + ShouldNotShowGooglePayIconIfSuggestionsContainLocalCards) { + // Turn on feature flag. + base::test::ScopedFeatureList scoped_feature_list_; + scoped_feature_list_.InitAndEnableFeature( + kAutofillCreditCardDropdownGooglePayBranding); + + IssueOnQuery(kQueryId); + + auto element_icons = testing::ElementsAre( +#if !defined(OS_ANDROID) + base::string16(), +#endif + base::string16(), + base::string16() /* Autofill setting item does not have icon. */); + EXPECT_CALL( + autofill_client_, + ShowAutofillPopup(_, _, SuggestionVectorIconsAre(element_icons), _)); + + std::vector<Suggestion> autofill_item; + autofill_item.push_back(Suggestion()); + autofill_item[0].frontend_id = kAutofillProfileId; + + // This should call ShowAutofillPopup. + external_delegate_->OnSuggestionsReturned(kQueryId, autofill_item, false); +} + +TEST_F(AutofillExternalDelegateUnitTest, + ShouldNotShowGooglePayIconIfExperimentOff) { + // Turn off feature flag. + base::test::ScopedFeatureList scoped_feature_list_; + scoped_feature_list_.InitAndDisableFeature( + kAutofillCreditCardDropdownGooglePayBranding); + + IssueOnQuery(kQueryId); + + auto element_icons = testing::ElementsAre( +#if !defined(OS_ANDROID) + base::string16(), +#endif + base::string16(), + base::string16() /* Autofill setting item does not have icon. */); + EXPECT_CALL( + autofill_client_, + ShowAutofillPopup(_, _, SuggestionVectorIconsAre(element_icons), _)); + + std::vector<Suggestion> autofill_item; + autofill_item.push_back(Suggestion()); + autofill_item[0].frontend_id = kAutofillProfileId; + + // This should call ShowAutofillPopup. + external_delegate_->OnSuggestionsReturned(kQueryId, autofill_item, true); +} + +TEST_F(AutofillExternalDelegateUnitTest, ShouldUseNewSettingName) { + // Turn on feature flag. + base::test::ScopedFeatureList scoped_feature_list_; + scoped_feature_list_.InitAndEnableFeature( + kAutofillUseNewSettingsNameInDropdown); + + IssueOnQuery(kQueryId); + + auto element_values = testing::ElementsAre( +#if !defined(OS_ANDROID) + base::string16(), +#endif + base::string16(), l10n_util::GetStringUTF16(IDS_AUTOFILL_SETTINGS_POPUP)); + EXPECT_CALL( + autofill_client_, + ShowAutofillPopup(_, _, SuggestionVectorValuesAre(element_values), _)); + + std::vector<Suggestion> autofill_item; + autofill_item.push_back(Suggestion()); + autofill_item[0].frontend_id = kAutofillProfileId; + + // This should call ShowAutofillPopup. + external_delegate_->OnSuggestionsReturned(kQueryId, autofill_item); +} + +TEST_F(AutofillExternalDelegateUnitTest, + ShouldNotUseNewSettingNameIfExperimentOff) { + // Turn off feature flag. + base::test::ScopedFeatureList scoped_feature_list_; + scoped_feature_list_.InitAndDisableFeature( + kAutofillUseNewSettingsNameInDropdown); + + IssueOnQuery(kQueryId); + + auto element_values = testing::ElementsAre( +#if !defined(OS_ANDROID) + base::string16(), +#endif + base::string16(), + l10n_util::GetStringUTF16(IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP)); + EXPECT_CALL( + autofill_client_, + ShowAutofillPopup(_, _, SuggestionVectorValuesAre(element_values), _)); + + std::vector<Suggestion> autofill_item; + autofill_item.push_back(Suggestion()); + autofill_item[0].frontend_id = kAutofillProfileId; + + // This should call ShowAutofillPopup. + external_delegate_->OnSuggestionsReturned(kQueryId, autofill_item); +} + } // namespace autofill
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index dfa7585..43f3088 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc
@@ -535,6 +535,9 @@ bool is_filling_credit_card = false; + // Flag to indicate whether all suggestions come from Google Payments. + bool is_all_server_suggestions = false; + // Log interactions of forms that are autofillable. if (got_autofillable_form) { if (autofill_field->Type().group() == CREDIT_CARD) { @@ -565,8 +568,10 @@ !field.should_autocomplete) { return; } + if (is_filling_credit_card) { - suggestions = GetCreditCardSuggestions(field, autofill_field->Type()); + suggestions = GetCreditCardSuggestions(field, autofill_field->Type(), + &is_all_server_suggestions); } else { suggestions = GetProfileSuggestions(*form_structure, field, *autofill_field); @@ -671,7 +676,8 @@ // Send Autofill suggestions (could be an empty list). autocomplete_history_manager_->CancelPendingQuery(); - external_delegate_->OnSuggestionsReturned(query_id, suggestions); + external_delegate_->OnSuggestionsReturned(query_id, suggestions, + is_all_server_suggestions); } bool AutofillManager::WillFillCreditCardNumber(const FormData& form, @@ -1547,7 +1553,8 @@ std::vector<Suggestion> AutofillManager::GetCreditCardSuggestions( const FormFieldData& field, - const AutofillType& type) const { + const AutofillType& type, + bool* is_all_server_suggestions) const { credit_card_form_event_logger_->OnDidPollSuggestions(field); // The field value is sanitized before attempting to match it to the user's @@ -1563,6 +1570,14 @@ break; } } + + // Check if all the suggestions are server cards (come from Google Payments). + *is_all_server_suggestions = true; + for (const CreditCard* credit_card : cards_to_suggest) { + if (credit_card->record_type() == CreditCard::LOCAL_CARD) + *is_all_server_suggestions = false; + } + for (size_t i = 0; i < suggestions.size(); i++) { suggestions[i].frontend_id = MakeFrontendID(suggestions[i].backend_id, std::string());
diff --git a/components/autofill/core/browser/autofill_manager.h b/components/autofill/core/browser/autofill_manager.h index 3129f8f..2241f29e 100644 --- a/components/autofill/core/browser/autofill_manager.h +++ b/components/autofill/core/browser/autofill_manager.h
@@ -403,9 +403,12 @@ // Returns a list of values from the stored credit cards that match |type| and // the value of |field| and returns the labels of the matching credit cards. + // |is_all_server_suggestions| will be set to true if there is no credit card + // suggestions or all suggestions come from Payments server. std::vector<Suggestion> GetCreditCardSuggestions( const FormFieldData& field, - const AutofillType& type) const; + const AutofillType& type, + bool* is_all_server_suggestions) const; // Parses the forms using heuristic matching and querying the Autofill server. void ParseForms(const std::vector<FormData>& forms);
diff --git a/components/autofill/core/browser/autofill_manager_unittest.cc b/components/autofill/core/browser/autofill_manager_unittest.cc index 4ba0cbf..1d6d3ff0 100644 --- a/components/autofill/core/browser/autofill_manager_unittest.cc +++ b/components/autofill/core/browser/autofill_manager_unittest.cc
@@ -327,7 +327,8 @@ AutofillDriver* autofill_driver) : AutofillExternalDelegate(autofill_manager, autofill_driver), on_query_seen_(false), - on_suggestions_returned_seen_(false) {} + on_suggestions_returned_seen_(false), + is_all_server_suggestions_(false) {} ~TestAutofillExternalDelegate() override {} void OnQuery(int query_id, @@ -338,12 +339,13 @@ on_suggestions_returned_seen_ = false; } - void OnSuggestionsReturned( - int query_id, - const std::vector<Suggestion>& suggestions) override { + void OnSuggestionsReturned(int query_id, + const std::vector<Suggestion>& suggestions, + bool is_all_server_suggestions) override { on_suggestions_returned_seen_ = true; query_id_ = query_id; suggestions_ = suggestions; + is_all_server_suggestions_ = is_all_server_suggestions; } void CheckSuggestions(int expected_page_id, @@ -406,6 +408,8 @@ ASSERT_EQ(expected_num_suggestions, suggestions_.size()); } + bool is_all_server_suggestions() const { return is_all_server_suggestions_; } + bool on_query_seen() const { return on_query_seen_; } bool on_suggestions_returned_seen() const { @@ -420,6 +424,9 @@ // call to OnQuery. bool on_suggestions_returned_seen_; + // Records whether the Autofill suggestions all come from Google Payments. + bool is_all_server_suggestions_; + // The query id of the most recent Autofill query. int query_id_; @@ -460,6 +467,54 @@ CreateTestCreditCards(); } + void CreateTestServerCreditCards() { + personal_data_.ClearCreditCards(); + + CreditCard masked_server_card; + test::SetCreditCardInfo(&masked_server_card, "Elvis Presley", + "4234567890123456", // Visa + "04", "2999", "1"); + masked_server_card.set_guid("00000000-0000-0000-0000-000000000007"); + masked_server_card.set_record_type(CreditCard::MASKED_SERVER_CARD); + personal_data_.AddCreditCard(masked_server_card); + + CreditCard full_server_card; + test::SetCreditCardInfo(&full_server_card, "Buddy Holly", + "5187654321098765", // Mastercard + "10", "2998", "1"); + full_server_card.set_guid("00000000-0000-0000-0000-000000000008"); + full_server_card.set_record_type(CreditCard::FULL_SERVER_CARD); + personal_data_.AddCreditCard(full_server_card); + } + + void CreateTestServerAndLocalCreditCards() { + personal_data_.ClearCreditCards(); + + CreditCard masked_server_card; + test::SetCreditCardInfo(&masked_server_card, "Elvis Presley", + "4234567890123456", // Visa + "04", "2999", "1"); + masked_server_card.set_guid("00000000-0000-0000-0000-000000000007"); + masked_server_card.set_record_type(CreditCard::MASKED_SERVER_CARD); + personal_data_.AddCreditCard(masked_server_card); + + CreditCard full_server_card; + test::SetCreditCardInfo(&full_server_card, "Buddy Holly", + "5187654321098765", // Mastercard + "10", "2998", "1"); + full_server_card.set_guid("00000000-0000-0000-0000-000000000008"); + full_server_card.set_record_type(CreditCard::FULL_SERVER_CARD); + personal_data_.AddCreditCard(full_server_card); + + CreditCard local_card; + test::SetCreditCardInfo(&local_card, "Elvis Presley", + "4234567890123456", // Visa + "04", "2999", "1"); + local_card.set_guid("00000000-0000-0000-0000-000000000009"); + local_card.set_record_type(CreditCard::LOCAL_CARD); + personal_data_.AddCreditCard(local_card); + } + void TearDown() override { // Order of destruction is important as AutofillManager relies on // PersonalDataManager to be around when it gets destroyed. @@ -5900,4 +5955,44 @@ histogram_tester.ExpectTotalCount("Autofill.FieldPrediction.CreditCard", 0); } +// Test that is_all_server_suggestions is true if there are only +// full_server_card and masked_server_card on file. +TEST_F(AutofillManagerTest, + GetCreditCardSuggestions_IsAllServerSuggestionsTrue) { + // Create server credit cards. + CreateTestServerCreditCards(); + + // Set up our form data. + FormData form; + CreateTestCreditCardFormData(&form, true, false); + std::vector<FormData> forms(1, form); + FormsSeen(forms); + + FormFieldData field = form.fields[1]; + GetAutofillSuggestions(form, field); + + // Test that we sent the right values to the external delegate. + ASSERT_TRUE(external_delegate_->is_all_server_suggestions()); +} + +// Test that is_all_server_suggestions is false if there is at least one +// local_card on file. +TEST_F(AutofillManagerTest, + GetCreditCardSuggestions_IsAllServerSuggestionsFalse) { + // Create server and local credit cards. + CreateTestServerAndLocalCreditCards(); + + // Set up our form data. + FormData form; + CreateTestCreditCardFormData(&form, true, false); + std::vector<FormData> forms(1, form); + FormsSeen(forms); + + FormFieldData field = form.fields[1]; + GetAutofillSuggestions(form, field); + + // Test that we sent the right values to the external delegate. + ASSERT_FALSE(external_delegate_->is_all_server_suggestions()); +} + } // namespace autofill
diff --git a/components/autofill/core/browser/autofill_save_card_infobar_delegate_mobile.cc b/components/autofill/core/browser/autofill_save_card_infobar_delegate_mobile.cc index 0857cc6..bc4d854b 100644 --- a/components/autofill/core/browser/autofill_save_card_infobar_delegate_mobile.cc +++ b/components/autofill/core/browser/autofill_save_card_infobar_delegate_mobile.cc
@@ -98,7 +98,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier AutofillSaveCardInfoBarDelegateMobile::GetIdentifier() const { - return AUTOFILL_CC_INFOBAR_DELEGATE; + return AUTOFILL_CC_INFOBAR_DELEGATE_MOBILE; } bool AutofillSaveCardInfoBarDelegateMobile::ShouldExpire(
diff --git a/components/autofill/core/browser/payments/full_card_request.cc b/components/autofill/core/browser/payments/full_card_request.cc index d2e7917..e72ee31 100644 --- a/components/autofill/core/browser/payments/full_card_request.cc +++ b/components/autofill/core/browser/payments/full_card_request.cc
@@ -114,10 +114,8 @@ } request_->user_response = response; - if (!request_->risk_data.empty()) { - real_pan_request_timestamp_ = AutofillClock::Now(); - payments_client_->UnmaskCard(*request_); - } + if (!request_->risk_data.empty()) + SendUnmaskCardRequest(); } void FullCardRequest::OnUnmaskPromptClosed() { @@ -129,10 +127,13 @@ void FullCardRequest::OnDidGetUnmaskRiskData(const std::string& risk_data) { request_->risk_data = risk_data; - if (!request_->user_response.cvc.empty()) { - real_pan_request_timestamp_ = AutofillClock::Now(); - payments_client_->UnmaskCard(*request_); - } + if (!request_->user_response.cvc.empty()) + SendUnmaskCardRequest(); +} + +void FullCardRequest::SendUnmaskCardRequest() { + real_pan_request_timestamp_ = AutofillClock::Now(); + payments_client_->UnmaskCard(*request_); } void FullCardRequest::OnDidGetRealPan(AutofillClient::PaymentsRpcResult result,
diff --git a/components/autofill/core/browser/payments/full_card_request.h b/components/autofill/core/browser/payments/full_card_request.h index 15b0b09d..3877904 100644 --- a/components/autofill/core/browser/payments/full_card_request.h +++ b/components/autofill/core/browser/payments/full_card_request.h
@@ -91,6 +91,10 @@ // Called by autofill client when the risk data has been loaded. void OnDidGetUnmaskRiskData(const std::string& risk_data); + // Makes final preparations for the unmask request and calls + // PaymentsClient::UnmaskCard(). + void SendUnmaskCardRequest(); + // Resets the state of the request. void Reset();
diff --git a/components/autofill/core/browser/personal_data_manager.cc b/components/autofill/core/browser/personal_data_manager.cc index 50ea40a..327f2cb 100644 --- a/components/autofill/core/browser/personal_data_manager.cc +++ b/components/autofill/core/browser/personal_data_manager.cc
@@ -993,33 +993,41 @@ // Don't show two suggestions if one is a subset of the other. std::vector<AutofillProfile*> unique_matched_profiles; std::vector<Suggestion> unique_suggestions; - ServerFieldTypeSet types(other_field_types.begin(), other_field_types.end()); - for (size_t i = 0; i < matched_profiles.size(); ++i) { - bool include = true; - AutofillProfile* profile_a = matched_profiles[i]; - for (size_t j = 0; j < matched_profiles.size(); ++j) { - AutofillProfile* profile_b = matched_profiles[j]; - // Check if profile A is a subset of profile B. If not, continue. - if (i == j || suggestions[i].value != suggestions[j].value || - !profile_a->IsSubsetOfForFieldSet(*profile_b, app_locale_, types)) { - continue; - } + // If there are many profiles, subset checking will take a long time(easily + // seconds). We will only do this if the profiles count is reasonable. + if (matched_profiles.size() <= 15) { + ServerFieldTypeSet types(other_field_types.begin(), + other_field_types.end()); + for (size_t i = 0; i < matched_profiles.size(); ++i) { + bool include = true; + AutofillProfile* profile_a = matched_profiles[i]; + for (size_t j = 0; j < matched_profiles.size(); ++j) { + AutofillProfile* profile_b = matched_profiles[j]; + // Check if profile A is a subset of profile B. If not, continue. + if (i == j || suggestions[i].value != suggestions[j].value || + !profile_a->IsSubsetOfForFieldSet(*profile_b, app_locale_, types)) { + continue; + } - // Check if profile B is also a subset of profile A. If so, the - // profiles are identical. Include the first one but not the second. - if (i < j && - profile_b->IsSubsetOfForFieldSet(*profile_a, app_locale_, types)) { - continue; - } + // Check if profile B is also a subset of profile A. If so, the + // profiles are identical. Include the first one but not the second. + if (i < j && + profile_b->IsSubsetOfForFieldSet(*profile_a, app_locale_, types)) { + continue; + } - // One-way subset. Don't include profile A. - include = false; - break; + // One-way subset. Don't include profile A. + include = false; + break; + } + if (include) { + unique_matched_profiles.push_back(matched_profiles[i]); + unique_suggestions.push_back(suggestions[i]); + } } - if (include) { - unique_matched_profiles.push_back(matched_profiles[i]); - unique_suggestions.push_back(suggestions[i]); - } + } else { + unique_matched_profiles = matched_profiles; + unique_suggestions = suggestions; } // Generate disambiguating labels based on the list of matches.
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc index b6a909f..c8601ef 100644 --- a/components/autofill/core/browser/personal_data_manager_unittest.cc +++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -1683,6 +1683,36 @@ EXPECT_EQ(base::ASCIIToUTF16("Hollywood, TX"), suggestions[1].label); } +TEST_F(PersonalDataManagerTest, + GetProfileSuggestions_NoSubsetsCheckingIfTooManyProfiles) { + AutofillProfile profile(base::GenerateGUID(), "https://www.example.com"); + test::SetProfileInfo(&profile, "Marion", "Mitchell", "Morrison", + "johnwayne@me.xyz", "Fox", + "123 Zoo St.\nSecond Line\nThird line", "unit 5", + "Hollywood", "CA", "91601", "US", "12345678910"); + + personal_data_->AddProfile(profile); + // 31 profiles in a total, expecting no subset removing. + for (int i = 0; i < 15; i++) { + AutofillProfile profile_no_state = profile; + profile_no_state.set_guid(base::GenerateGUID()); + profile_no_state.SetRawInfo(ADDRESS_HOME_STATE, base::string16()); + personal_data_->AddProfile(profile_no_state); + } + + ResetPersonalDataManager(USER_MODE_NORMAL); + + ASSERT_EQ(16U, personal_data_->GetProfiles().size()); + std::vector<ServerFieldType> types; + types.push_back(ADDRESS_HOME_CITY); + types.push_back(ADDRESS_HOME_STATE); + std::vector<Suggestion> suggestions = personal_data_->GetProfileSuggestions( + AutofillType(ADDRESS_HOME_STREET_ADDRESS), base::ASCIIToUTF16("123"), + false, types); + ASSERT_EQ(16U, suggestions.size()); + EXPECT_EQ(base::ASCIIToUTF16("Hollywood"), suggestions[0].label); +} + // Tests that GetProfileSuggestions orders its suggestions based on the frecency // formula. TEST_F(PersonalDataManagerTest, GetProfileSuggestions_Ranking) {
diff --git a/components/autofill/core/browser/region_combobox_model.cc b/components/autofill/core/browser/region_combobox_model.cc index 48a7d7a..f23bef9 100644 --- a/components/autofill/core/browser/region_combobox_model.cc +++ b/components/autofill/core/browser/region_combobox_model.cc
@@ -87,9 +87,9 @@ // Some countries expose a state field but have no region names available. if (regions.size() > 0) { failed_to_load_data_ = false; - regions_.push_back(std::make_pair("", "---")); + regions_.emplace_back("", "---"); for (auto* const region : regions) { - regions_.push_back(std::make_pair(region->key(), region->name())); + regions_.emplace_back(region->key(), region->name()); } } else { // TODO(mad): Maybe use a static list as is done for countries in
diff --git a/components/autofill/core/browser/region_combobox_model_unittest.cc b/components/autofill/core/browser/region_combobox_model_unittest.cc index 3c0aeb2..207e808 100644 --- a/components/autofill/core/browser/region_combobox_model_unittest.cc +++ b/components/autofill/core/browser/region_combobox_model_unittest.cc
@@ -32,8 +32,8 @@ model.LoadRegionData("", &test_region_data_loader, 0); std::vector<std::pair<std::string, std::string>> regions; - regions.push_back(std::make_pair(kQuebecCode, kQuebecName)); - regions.push_back(std::make_pair(kOntarioCode, kOntarioName)); + regions.emplace_back(kQuebecCode, kQuebecName); + regions.emplace_back(kOntarioCode, kOntarioName); test_region_data_loader.SendAsynchronousData(regions);
diff --git a/components/autofill/core/browser/suggestion_test_helpers.h b/components/autofill/core/browser/suggestion_test_helpers.h index 3ed85a13..a5262c05 100644 --- a/components/autofill/core/browser/suggestion_test_helpers.h +++ b/components/autofill/core/browser/suggestion_test_helpers.h
@@ -80,6 +80,15 @@ elts_are_matcher, &Suggestion::label)); } +// Like SuggestionVectorIdsAre above, but tests the icons. +template <class EltsAreMatcher> +inline testing::Matcher<const std::vector<Suggestion>&> +SuggestionVectorIconsAre(const EltsAreMatcher& elts_are_matcher) { + return testing::MakeMatcher( + new SuggestionVectorMembersAreMatcher<base::string16>(elts_are_matcher, + &Suggestion::icon)); +} + } // namespace autofill #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_SUGGESTION_TEST_HELPERS_H_
diff --git a/components/autofill/core/browser/test_autofill_manager.cc b/components/autofill/core/browser/test_autofill_manager.cc index 3291fecc..15646b4 100644 --- a/components/autofill/core/browser/test_autofill_manager.cc +++ b/components/autofill/core/browser/test_autofill_manager.cc
@@ -8,7 +8,10 @@ #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/field_types.h" #include "components/autofill/core/browser/payments/payments_client.h" +#include "components/autofill/core/browser/payments/test_payments_client.h" +#include "components/autofill/core/browser/test_form_data_importer.h" #include "components/autofill/core/browser/test_form_structure.h" +#include "components/autofill/core/browser/test_personal_data_manager.h" #include "testing/gtest/include/gtest/gtest.h" namespace autofill {
diff --git a/components/autofill/core/browser/test_autofill_manager.h b/components/autofill/core/browser/test_autofill_manager.h index 56519fd..e13db80f 100644 --- a/components/autofill/core/browser/test_autofill_manager.h +++ b/components/autofill/core/browser/test_autofill_manager.h
@@ -13,9 +13,6 @@ #include "base/optional.h" #include "base/run_loop.h" #include "components/autofill/core/browser/autofill_manager.h" -#include "components/autofill/core/browser/payments/test_payments_client.h" -#include "components/autofill/core/browser/test_form_data_importer.h" -#include "components/autofill/core/browser/test_personal_data_manager.h" using base::TimeTicks; @@ -25,9 +22,15 @@ namespace autofill { +namespace payments { +class TestPaymentsClient; +} // namespace payments + class AutofillClient; class AutofillDriver; class FormStructure; +class TestFormDataImporter; +class TestPersonalDataManager; class TestAutofillManager : public AutofillManager { public:
diff --git a/components/autofill/core/browser/test_credit_card_save_manager.cc b/components/autofill/core/browser/test_credit_card_save_manager.cc index 8a855e7e..c06d9507a 100644 --- a/components/autofill/core/browser/test_credit_card_save_manager.cc +++ b/components/autofill/core/browser/test_credit_card_save_manager.cc
@@ -4,6 +4,8 @@ #include "components/autofill/core/browser/test_credit_card_save_manager.h" +#include "components/autofill/core/browser/payments/test_payments_client.h" + namespace autofill { TestCreditCardSaveManager::TestCreditCardSaveManager(
diff --git a/components/autofill/core/browser/test_credit_card_save_manager.h b/components/autofill/core/browser/test_credit_card_save_manager.h index ac79087..b00211b 100644 --- a/components/autofill/core/browser/test_credit_card_save_manager.h +++ b/components/autofill/core/browser/test_credit_card_save_manager.h
@@ -8,10 +8,13 @@ #include <string> #include "components/autofill/core/browser/credit_card_save_manager.h" -#include "components/autofill/core/browser/payments/test_payments_client.h" namespace autofill { +namespace payments { +class TestPaymentsClient; +} // namespace payments + class AutofillClient; class AutofillDriver; class PersonalDataManager;
diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc index 068e7eb..103ea66 100644 --- a/components/autofill/core/common/autofill_features.cc +++ b/components/autofill/core/common/autofill_features.cc
@@ -12,6 +12,11 @@ const base::Feature kAutofillAddressNormalizer{ "AutofillAddressNormalizer", base::FEATURE_ENABLED_BY_DEFAULT}; +// Controls whether the Autofill credit card dropdown shows Google Pay icon. +const base::Feature kAutofillCreditCardDropdownGooglePayBranding{ + "AutofillCreditCardDropdownGooglePayBranding", + base::FEATURE_DISABLED_BY_DEFAULT}; + // Controls whether or not a minimum number of fields is required before // heuristic field type prediction is run for a form. const base::Feature kAutofillEnforceMinRequiredFieldsForHeuristics{ @@ -42,5 +47,9 @@ const base::Feature kAutofillShowTypePredictions{ "AutofillShowTypePredictions", base::FEATURE_DISABLED_BY_DEFAULT}; +// Controls whether to show new settings name in Autofill dropdown. +const base::Feature kAutofillUseNewSettingsNameInDropdown{ + "AutofillUseNewSettingsNameInDropdown", base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace features } // namespace autofill
diff --git a/components/autofill/core/common/autofill_features.h b/components/autofill/core/common/autofill_features.h index 4b080fbd..fe97c6e 100644 --- a/components/autofill/core/common/autofill_features.h +++ b/components/autofill/core/common/autofill_features.h
@@ -12,11 +12,13 @@ // All features in alphabetical order. extern const base::Feature kAutofillAddressNormalizer; +extern const base::Feature kAutofillCreditCardDropdownGooglePayBranding; extern const base::Feature kAutofillEnforceMinRequiredFieldsForHeuristics; extern const base::Feature kAutofillEnforceMinRequiredFieldsForQuery; extern const base::Feature kAutofillEnforceMinRequiredFieldsForUpload; extern const base::Feature kAutofillRestrictUnownedFieldsToFormlessCheckout; extern const base::Feature kAutofillShowTypePredictions; +extern const base::Feature kAutofillUseNewSettingsNameInDropdown; } // namespace features } // namespace autofill
diff --git a/components/autofill/ios/browser/resources/autofill_controller.js b/components/autofill/ios/browser/resources/autofill_controller.js index 1dc9f17..7d7ad03 100644 --- a/components/autofill/ios/browser/resources/autofill_controller.js +++ b/components/autofill/ios/browser/resources/autofill_controller.js
@@ -677,7 +677,15 @@ */ __gCrWeb.autofill['clearAutofilledFields'] = function(formName) { var form = __gCrWeb.common.getFormElementFromIdentifier(formName); - var controlElements = __gCrWeb.common.getFormControlElements(form); + var controlElements = []; + if (form) { + controlElements = __gCrWeb.common.getFormControlElements(form); + } else { + var fieldsets = []; + controlElements = + getUnownedAutofillableFormFieldElements_(document.all, fieldsets); + } + for (var i = 0; i < controlElements.length; ++i) { var element = controlElements[i]; if (!element.isAutofilled || element.disabled) @@ -689,7 +697,7 @@ } else if (__gCrWeb.autofill.isSelectElement(element)) { // Reset to the first index. // TODO(bondd): Store initial values and reset to the correct one here. - __gCrWeb.common.setInputElementValue(element.option[0].value, + __gCrWeb.common.setInputElementValue(element.options[0].value, element, true); } else if (__gCrWeb.autofill.isCheckableElement(element)) { // TODO(bondd): Handle checkable elements. They aren't properly supported
diff --git a/components/autofill_strings.grdp b/components/autofill_strings.grdp index f629e67..c9b5096 100644 --- a/components/autofill_strings.grdp +++ b/components/autofill_strings.grdp
@@ -128,24 +128,27 @@ Postal code </message> + <message name="IDS_AUTOFILL_SETTINGS_POPUP" desc="The text displayed in the Autofill popup to direct the user to the Autofill settings UI."> + Autofill settings + </message> <if expr="_google_chrome"> - <message name="IDS_AUTOFILL_OPTIONS_POPUP" desc="The text displayed in the Autofill popup to direct the user to the Autofill settings UI."> + <message name="IDS_AUTOFILL_OPTIONS_POPUP" desc="The text displayed in the Autofill popup to direct the user to the Autofill settings UI. (This string is going to be deprecated in favor of IDS_AUTOFILL_SETTINGS_POPUP.)"> Chrome Autofill settings... </message> </if> <if expr="not _google_chrome"> - <message name="IDS_AUTOFILL_OPTIONS_POPUP" desc="The label of the text displayed in the Autofill popup to direct the user to the Autofill settings UI."> + <message name="IDS_AUTOFILL_OPTIONS_POPUP" desc="The label of the text displayed in the Autofill popup to direct the user to the Autofill settings UI. (This string is going to be deprecated in favor of IDS_AUTOFILL_SETTINGS_POPUP.)"> Chromium Autofill settings... </message> </if> <if expr="_google_chrome"> - <message name="IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP" desc="The label of the text displayed in the Autofill Credit Card popup to direct the user to the Autofill settings UI."> + <message name="IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP" desc="The label of the text displayed in the Autofill Credit Card popup to direct the user to the Autofill settings UI. (This string is going to be deprecated in favor of IDS_AUTOFILL_SETTINGS_POPUP.)"> Chrome Autofill settings... </message> </if> <if expr="not _google_chrome"> - <message name="IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP" desc="The label of the text displayed in the Autofill Credit Card popup to direct the user to the Autofill settings UI."> + <message name="IDS_AUTOFILL_CREDIT_CARD_OPTIONS_POPUP" desc="The label of the text displayed in the Autofill Credit Card popup to direct the user to the Autofill settings UI. (This string is going to be deprecated in favor of IDS_AUTOFILL_SETTINGS_POPUP.)"> Chromium Autofill settings... </message> </if>
diff --git a/components/cast_channel/cast_message_util.cc b/components/cast_channel/cast_message_util.cc index ddf9720..3d64bb4 100644 --- a/components/cast_channel/cast_message_util.cc +++ b/components/cast_channel/cast_message_util.cc
@@ -6,21 +6,50 @@ #include <memory> +#include "base/json/json_reader.h" +#include "base/json/json_writer.h" #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" #include "components/cast_channel/cast_auth_util.h" #include "components/cast_channel/proto/cast_channel.pb.h" -namespace { -static const char kAuthNamespace[] = "urn:x-cast:com.google.cast.tp.deviceauth"; -// Sender and receiver IDs to use for platform messages. -static const char kPlatformSenderId[] = "sender-0"; -static const char kPlatformReceiverId[] = "receiver-0"; -} // namespace - namespace cast_channel { +namespace { +// Message namespaces. +constexpr char kAuthNamespace[] = "urn:x-cast:com.google.cast.tp.deviceauth"; +constexpr char kHeartbeatNamespace[] = + "urn:x-cast:com.google.cast.tp.heartbeat"; + +// Sender and receiver IDs to use for platform messages. +constexpr char kPlatformSenderId[] = "sender-0"; +constexpr char kPlatformReceiverId[] = "receiver-0"; + +// Text payload keys. +constexpr char kTypeNodeId[] = "type"; + +// Cast application protocol message types. +constexpr char kKeepAlivePingType[] = "PING"; +constexpr char kKeepAlivePongType[] = "PONG"; + +CastMessage CreateKeepAliveMessage(const char* keep_alive_type) { + CastMessage output; + output.set_protocol_version(CastMessage::CASTV2_1_0); + output.set_source_id(kPlatformSenderId); + output.set_destination_id(kPlatformReceiverId); + output.set_namespace_(kHeartbeatNamespace); + output.set_payload_type( + CastMessage::PayloadType::CastMessage_PayloadType_STRING); + + base::DictionaryValue type_dict; + type_dict.SetString(kTypeNodeId, keep_alive_type); + CHECK(base::JSONWriter::Write(type_dict, output.mutable_payload_utf8())); + return output; +} + +} // namespace + bool IsCastMessageValid(const CastMessage& message_proto) { if (message_proto.namespace_().empty() || message_proto.source_id().empty() || message_proto.destination_id().empty()) { @@ -32,6 +61,41 @@ message_proto.has_payload_binary()); } +CastMessageType ParseMessageType(const CastMessage& message) { + std::unique_ptr<base::Value> parsed_payload( + base::JSONReader::Read(message.payload_utf8())); + base::DictionaryValue* payload_as_dict; + if (!parsed_payload || !parsed_payload->GetAsDictionary(&payload_as_dict)) + return CastMessageType::kOther; + + const base::Value* type_string = + payload_as_dict->FindKeyOfType(kTypeNodeId, base::Value::Type::STRING); + if (!type_string) + return CastMessageType::kOther; + + const std::string& type = type_string->GetString(); + if (type == kKeepAlivePingType) + return CastMessageType::kPing; + if (type == kKeepAlivePongType) + return CastMessageType::kPong; + + DVLOG(1) << "Unknown message type: " << type; + return CastMessageType::kOther; +} + +const char* CastMessageTypeToString(CastMessageType message_type) { + switch (message_type) { + case CastMessageType::kPing: + return kKeepAlivePingType; + case CastMessageType::kPong: + return kKeepAlivePongType; + case CastMessageType::kOther: + return "unknown"; + } + NOTREACHED(); + return ""; +} + std::string CastMessageToString(const CastMessage& message_proto) { std::string out("{"); out += "namespace = " + message_proto.namespace_(); @@ -77,7 +141,7 @@ std::string auth_message_string; auth_message.SerializeToString(&auth_message_string); - message_proto->set_protocol_version(CastMessage_ProtocolVersion_CASTV2_1_0); + message_proto->set_protocol_version(CastMessage::CASTV2_1_0); message_proto->set_source_id(kPlatformSenderId); message_proto->set_destination_id(kPlatformReceiverId); message_proto->set_namespace_(kAuthNamespace); @@ -89,4 +153,12 @@ return message.namespace_() == kAuthNamespace; } +CastMessage CreateKeepAlivePingMessage() { + return CreateKeepAliveMessage(kKeepAlivePingType); +} + +CastMessage CreateKeepAlivePongMessage() { + return CreateKeepAliveMessage(kKeepAlivePongType); +} + } // namespace cast_channel
diff --git a/components/cast_channel/cast_message_util.h b/components/cast_channel/cast_message_util.h index db30a227..7fe9d261 100644 --- a/components/cast_channel/cast_message_util.h +++ b/components/cast_channel/cast_message_util.h
@@ -13,9 +13,20 @@ class CastMessage; class DeviceAuthMessage; +// Cast application protocol message types. +enum class CastMessageType { kOther, kPing, kPong }; + // Checks if the contents of |message_proto| are valid. bool IsCastMessageValid(const CastMessage& message_proto); +// Parses the JSON-encoded payload of |message| and returns the value in the +// "type" field or |kUnknown| if the parse fails or the field is not found. +// The result is only valid if |message| is a Cast application protocol message. +CastMessageType ParseMessageType(const CastMessage& message); + +// Returns a human readable string for |message_type|. +const char* CastMessageTypeToString(CastMessageType message_type); + // Returns a human readable string for |message_proto|. std::string CastMessageToString(const CastMessage& message_proto); @@ -30,6 +41,10 @@ // Returns whether the given message is an auth handshake message. bool IsAuthMessage(const CastMessage& message); +// Creates a keep-alive message of either type PING or PONG. +CastMessage CreateKeepAlivePingMessage(); +CastMessage CreateKeepAlivePongMessage(); + } // namespace cast_channel #endif // COMPONENTS_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_
diff --git a/components/cast_channel/keep_alive_delegate.cc b/components/cast_channel/keep_alive_delegate.cc index 72adf69c..cce0304 100644 --- a/components/cast_channel/keep_alive_delegate.cc +++ b/components/cast_channel/keep_alive_delegate.cc
@@ -7,9 +7,6 @@ #include <string> #include <utility> -#include "base/json/json_reader.h" -#include "base/json/json_writer.h" -#include "base/values.h" #include "components/cast_channel/cast_channel_enum.h" #include "components/cast_channel/cast_socket.h" #include "components/cast_channel/logger.h" @@ -17,57 +14,9 @@ #include "net/base/net_errors.h" namespace cast_channel { -namespace { - -const char kHeartbeatNamespace[] = "urn:x-cast:com.google.cast.tp.heartbeat"; -const char kPingSenderId[] = "chrome"; -const char kPingReceiverId[] = "receiver-0"; -const char kTypeNodeId[] = "type"; - -// Parses the JSON-encoded payload of |message| and returns the value in the -// "type" field or the empty string if the parse fails or the field is not -// found. -std::string ParseForPayloadType(const CastMessage& message) { - std::unique_ptr<base::Value> parsed_payload( - base::JSONReader::Read(message.payload_utf8())); - base::DictionaryValue* payload_as_dict; - if (!parsed_payload || !parsed_payload->GetAsDictionary(&payload_as_dict)) - return std::string(); - std::string type_string; - if (!payload_as_dict->GetString(kTypeNodeId, &type_string)) - return std::string(); - return type_string; -} - -} // namespace - -// static -const char KeepAliveDelegate::kHeartbeatPingType[] = "PING"; - -// static -const char KeepAliveDelegate::kHeartbeatPongType[] = "PONG"; using ::cast_channel::ChannelError; -// static -CastMessage KeepAliveDelegate::CreateKeepAliveMessage( - const char* message_type) { - CastMessage output; - output.set_protocol_version(CastMessage::CASTV2_1_0); - output.set_source_id(kPingSenderId); - output.set_destination_id(kPingReceiverId); - output.set_namespace_(kHeartbeatNamespace); - base::DictionaryValue type_dict; - type_dict.SetString(kTypeNodeId, message_type); - if (!base::JSONWriter::Write(type_dict, output.mutable_payload_utf8())) { - LOG(ERROR) << "Failed to serialize dictionary."; - return output; - } - output.set_payload_type( - CastMessage::PayloadType::CastMessage_PayloadType_STRING); - return output; -} - KeepAliveDelegate::KeepAliveDelegate( CastSocket* socket, scoped_refptr<Logger> logger, @@ -79,12 +28,12 @@ logger_(logger), inner_delegate_(std::move(inner_delegate)), liveness_timeout_(liveness_timeout), - ping_interval_(ping_interval) { + ping_interval_(ping_interval), + ping_message_(CreateKeepAlivePingMessage()), + pong_message_(CreateKeepAlivePongMessage()) { DCHECK(ping_interval_ < liveness_timeout_); DCHECK(inner_delegate_); DCHECK(socket_); - ping_message_ = CreateKeepAliveMessage(kHeartbeatPingType); - pong_message_ = CreateKeepAliveMessage(kHeartbeatPongType); } KeepAliveDelegate::~KeepAliveDelegate() {} @@ -100,9 +49,9 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); DCHECK(!started_); - VLOG(1) << "Starting keep-alive timers."; - VLOG(1) << "Ping timeout: " << ping_interval_; - VLOG(1) << "Liveness timeout: " << liveness_timeout_; + DVLOG(1) << "Starting keep-alive timers."; + DVLOG(1) << "Ping timeout: " << ping_interval_; + DVLOG(1) << "Liveness timeout: " << liveness_timeout_; // Use injected mock timers, if provided. if (!ping_timer_) { @@ -114,11 +63,13 @@ ping_timer_->Start( FROM_HERE, ping_interval_, - base::Bind(&KeepAliveDelegate::SendKeepAliveMessage, - base::Unretained(this), ping_message_, kHeartbeatPingType)); + base::BindRepeating(&KeepAliveDelegate::SendKeepAliveMessage, + base::Unretained(this), ping_message_, + CastMessageType::kPing)); liveness_timer_->Start( FROM_HERE, liveness_timeout_, - base::Bind(&KeepAliveDelegate::LivenessTimeout, base::Unretained(this))); + base::BindRepeating(&KeepAliveDelegate::LivenessTimeout, + base::Unretained(this))); started_ = true; inner_delegate_->Start(); @@ -131,9 +82,9 @@ } void KeepAliveDelegate::SendKeepAliveMessage(const CastMessage& message, - const char* message_type) { + CastMessageType message_type) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - VLOG(2) << "Sending " << message_type; + DVLOG(2) << "Sending " << CastMessageTypeToString(message_type); // TODO(https://crbug.com/656607): Add proper annotation. socket_->transport()->SendMessage( message, @@ -142,12 +93,14 @@ NO_TRAFFIC_ANNOTATION_BUG_656607); } -void KeepAliveDelegate::SendKeepAliveMessageComplete(const char* message_type, - int rv) { - VLOG(2) << "Sending " << message_type << " complete, rv=" << rv; +void KeepAliveDelegate::SendKeepAliveMessageComplete( + CastMessageType message_type, + int rv) { + DVLOG(2) << "Sending " << CastMessageTypeToString(message_type) + << " complete, rv=" << rv; if (rv != net::OK) { // An error occurred while sending the ping response. - VLOG(1) << "Error sending " << message_type; + DVLOG(1) << "Error sending " << CastMessageTypeToString(message_type); logger_->LogSocketEventWithRv(socket_->id(), ChannelEvent::PING_WRITE_ERROR, rv); OnError(ChannelError::CAST_SOCKET_ERROR); @@ -166,28 +119,28 @@ // CastTransport::Delegate interface. void KeepAliveDelegate::OnError(ChannelError error_state) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - VLOG(1) << "KeepAlive::OnError: " - << ::cast_channel::ChannelErrorToString(error_state); + DVLOG(1) << "KeepAlive::OnError: " + << ::cast_channel::ChannelErrorToString(error_state); inner_delegate_->OnError(error_state); Stop(); } void KeepAliveDelegate::OnMessage(const CastMessage& message) { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - VLOG(2) << "KeepAlive::OnMessage : " << message.payload_utf8(); + DVLOG(2) << "KeepAlive::OnMessage : " << message.payload_utf8(); if (started_) ResetTimers(); // PING and PONG messages are intercepted and handled by KeepAliveDelegate // here. All other messages are passed through to |inner_delegate_|. - const std::string payload_type = ParseForPayloadType(message); - if (payload_type == kHeartbeatPingType) { - VLOG(2) << "Received PING."; + CastMessageType payload_type = ParseMessageType(message); + if (payload_type == CastMessageType::kPing) { + DVLOG(2) << "Received PING."; if (started_) - SendKeepAliveMessage(pong_message_, kHeartbeatPongType); - } else if (payload_type == kHeartbeatPongType) { - VLOG(2) << "Received PONG."; + SendKeepAliveMessage(pong_message_, CastMessageType::kPong); + } else if (payload_type == CastMessageType::kPong) { + DVLOG(2) << "Received PONG."; } else { inner_delegate_->OnMessage(message); }
diff --git a/components/cast_channel/keep_alive_delegate.h b/components/cast_channel/keep_alive_delegate.h index 9840b60..943cbfd 100644 --- a/components/cast_channel/keep_alive_delegate.h +++ b/components/cast_channel/keep_alive_delegate.h
@@ -8,6 +8,7 @@ #include "base/macros.h" #include "base/threading/thread_checker.h" #include "base/timer/timer.h" +#include "components/cast_channel/cast_message_util.h" #include "components/cast_channel/cast_transport.h" #include "components/cast_channel/proto/cast_channel.pb.h" @@ -39,9 +40,6 @@ ~KeepAliveDelegate() override; - // Creates a keep-alive message (e.g. PING or PONG). - static CastMessage CreateKeepAliveMessage(const char* message_type); - void SetTimersForTest(std::unique_ptr<base::Timer> injected_ping_timer, std::unique_ptr<base::Timer> injected_liveness_timer); @@ -50,9 +48,6 @@ void OnError(ChannelError error_state) override; void OnMessage(const CastMessage& message) override; - static const char kHeartbeatPingType[]; - static const char kHeartbeatPongType[]; - private: // Restarts the ping/liveness timeout timers. Called when a message // is received from the remote end. @@ -60,10 +55,10 @@ // Sends a formatted PING or PONG message to the remote side. void SendKeepAliveMessage(const CastMessage& message, - const char* message_type); + CastMessageType message_type); // Callback for SendKeepAliveMessage. - void SendKeepAliveMessageComplete(const char* message_type, int rv); + void SendKeepAliveMessageComplete(CastMessageType message_type, int rv); // Called when the liveness timer expires, indicating that the remote // end has not responded within the |liveness_timeout_| interval. @@ -98,10 +93,10 @@ std::unique_ptr<base::Timer> liveness_timer_; // The PING message to send over the wire. - CastMessage ping_message_; + const CastMessage ping_message_; // The PONG message to send over the wire. - CastMessage pong_message_; + const CastMessage pong_message_; THREAD_CHECKER(thread_checker_);
diff --git a/components/cast_channel/keep_alive_delegate_unittest.cc b/components/cast_channel/keep_alive_delegate_unittest.cc index 3770af0..2845606 100644 --- a/components/cast_channel/keep_alive_delegate_unittest.cc +++ b/components/cast_channel/keep_alive_delegate_unittest.cc
@@ -6,6 +6,7 @@ #include <stdint.h> +#include "base/json/json_writer.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" @@ -13,6 +14,7 @@ #include "base/test/test_mock_time_task_runner.h" #include "base/time/tick_clock.h" #include "base/timer/mock_timer.h" +#include "base/values.h" #include "components/cast_channel/cast_test_util.h" #include "net/base/net_errors.h" #include "testing/gmock/include/gmock/gmock.h" @@ -27,6 +29,21 @@ const int64_t kTestPingTimeoutMillis = 1000; const int64_t kTestLivenessTimeoutMillis = 10000; +CastMessage CreateNonKeepAliveMessage(const std::string& message_type) { + CastMessage output; + output.set_protocol_version(CastMessage::CASTV2_1_0); + output.set_source_id("source"); + output.set_destination_id("receiver"); + output.set_namespace_("some.namespace"); + output.set_payload_type( + CastMessage::PayloadType::CastMessage_PayloadType_STRING); + + base::DictionaryValue type_dict; + type_dict.SetString("type", message_type); + CHECK(base::JSONWriter::Write(type_dict, output.mutable_payload_utf8())); + return output; +} + // Extends MockTimer with a mockable method ResetTriggered() which permits // test code to set GMock expectations for Timer::Reset(). class MockTimerWithMonitoredReset : public base::MockTimer { @@ -100,9 +117,7 @@ TEST_F(KeepAliveDelegateTest, TestPing) { EXPECT_CALL(*socket_.mock_transport(), - SendMessage(EqualsProto(KeepAliveDelegate::CreateKeepAliveMessage( - KeepAliveDelegate::kHeartbeatPingType)), - _, _)) + SendMessage(EqualsProto(CreateKeepAlivePingMessage()), _, _)) .WillOnce(PostCompletionCallbackTask<1>(net::OK)); EXPECT_CALL(*inner_delegate_, Start()); EXPECT_CALL(*ping_timer_, ResetTriggered()).Times(2); @@ -113,17 +128,14 @@ ping_timer_->Fire(); EXPECT_FALSE(ping_timer_->IsRunning()); - keep_alive_->OnMessage(KeepAliveDelegate::CreateKeepAliveMessage( - KeepAliveDelegate::kHeartbeatPongType)); + keep_alive_->OnMessage(CreateKeepAlivePongMessage()); RunPendingTasks(); EXPECT_TRUE(ping_timer_->IsRunning()); } TEST_F(KeepAliveDelegateTest, TestPingFailed) { EXPECT_CALL(*socket_.mock_transport(), - SendMessage(EqualsProto(KeepAliveDelegate::CreateKeepAliveMessage( - KeepAliveDelegate::kHeartbeatPingType)), - _, _)) + SendMessage(EqualsProto(CreateKeepAlivePingMessage()), _, _)) .WillOnce(PostCompletionCallbackTask<1>(net::ERR_CONNECTION_RESET)); EXPECT_CALL(*inner_delegate_, Start()); EXPECT_CALL(*inner_delegate_, OnError(ChannelError::CAST_SOCKET_ERROR)); @@ -143,9 +155,7 @@ TEST_F(KeepAliveDelegateTest, TestPingAndLivenessTimeout) { EXPECT_CALL(*socket_.mock_transport(), - SendMessage(EqualsProto(KeepAliveDelegate::CreateKeepAliveMessage( - KeepAliveDelegate::kHeartbeatPingType)), - _, _)) + SendMessage(EqualsProto(CreateKeepAlivePingMessage()), _, _)) .WillOnce(PostCompletionCallbackTask<1>(net::OK)); EXPECT_CALL(*inner_delegate_, OnError(ChannelError::PING_TIMEOUT)); EXPECT_CALL(*inner_delegate_, Start()); @@ -161,8 +171,7 @@ } TEST_F(KeepAliveDelegateTest, TestResetTimersAndPassthroughAllOtherTraffic) { - CastMessage other_message = - KeepAliveDelegate::CreateKeepAliveMessage("NEITHER_PING_NOR_PONG"); + CastMessage other_message = CreateNonKeepAliveMessage("someMessageType"); EXPECT_CALL(*inner_delegate_, OnMessage(EqualsProto(other_message))); EXPECT_CALL(*inner_delegate_, Start()); @@ -175,12 +184,10 @@ } TEST_F(KeepAliveDelegateTest, TestPassthroughMessagesAfterError) { - CastMessage message = - KeepAliveDelegate::CreateKeepAliveMessage("NEITHER_PING_NOR_PONG"); + CastMessage message = CreateNonKeepAliveMessage("someMessageType"); CastMessage message_after_error = - KeepAliveDelegate::CreateKeepAliveMessage("ANOTHER_NOT_PING_NOR_PONG"); - CastMessage late_ping_message = KeepAliveDelegate::CreateKeepAliveMessage( - KeepAliveDelegate::kHeartbeatPingType); + CreateNonKeepAliveMessage("someMessageType2"); + CastMessage late_ping_message = CreateKeepAlivePingMessage(); EXPECT_CALL(*inner_delegate_, Start()).Times(1); EXPECT_CALL(*ping_timer_, ResetTriggered()).Times(2); @@ -242,9 +249,7 @@ keep_alive_->Start(); EXPECT_CALL(*socket_.mock_transport(), - SendMessage(EqualsProto(KeepAliveDelegate::CreateKeepAliveMessage( - KeepAliveDelegate::kHeartbeatPingType)), - _, _)) + SendMessage(EqualsProto(CreateKeepAlivePingMessage()), _, _)) .WillOnce(PostCompletionCallbackTask<1>(net::OK)); // Forward 1s, at time 1, fire ping timer. mock_time_task_runner->FastForwardBy(
diff --git a/components/component_updater/component_updater_service.h b/components/component_updater/component_updater_service.h index 64322b53..fa94e890 100644 --- a/components/component_updater/component_updater_service.h +++ b/components/component_updater/component_updater_service.h
@@ -161,8 +161,9 @@ friend class ::PluginObserver; friend class SwReporterOnDemandFetcher; #if defined(OS_CHROMEOS) - friend class CrOSComponent; + friend class CrOSComponentManager; #endif // defined(OS_CHROMEOS) + friend class VrAssetsComponentInstallerTraits; // Triggers an update check for a component. |id| is a value // returned by GetCrxComponentID(). If an update for this component is already
diff --git a/components/crash/content/browser/crash_handler_host_linux.cc b/components/crash/content/browser/crash_handler_host_linux.cc index 99082012..706bf5c 100644 --- a/components/crash/content/browser/crash_handler_host_linux.cc +++ b/components/crash/content/browser/crash_handler_host_linux.cc
@@ -41,7 +41,7 @@ #include "third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h" #if defined(OS_ANDROID) && !defined(__LP64__) -#include <sys/linux-syscalls.h> +#include <sys/syscall.h> #define SYS_read __NR_read #endif
diff --git a/components/cronet/android/BUILD.gn b/components/cronet/android/BUILD.gn index 7909990..d7b2674 100644 --- a/components/cronet/android/BUILD.gn +++ b/components/cronet/android/BUILD.gn
@@ -595,38 +595,6 @@ ] } -android_assets("cronet_test_apk_assets") { - testonly = true - - # Need to use renaming_sources to maintain subdirectories. - renaming_sources = [ - "test/assets/test/cacheable.txt", - "test/assets/test/cacheable.txt.mock-http-headers", - "test/assets/test/content_length_mismatch.html", - "test/assets/test/content_length_mismatch.html.mock-http-headers", - "test/assets/test/gzipped.html", - "test/assets/test/gzipped.html.mock-http-headers", - "test/assets/test/multiredirect.html", - "test/assets/test/multiredirect.html.mock-http-headers", - "test/assets/test/notfound.html", - "test/assets/test/notfound.html.mock-http-headers", - "test/assets/test/quic_data/simple.txt", - "test/assets/test/redirect.html", - "test/assets/test/redirect.html.mock-http-headers", - "test/assets/test/redirect_invalid_scheme.html", - "test/assets/test/redirect_invalid_scheme.html.mock-http-headers", - "test/assets/test/set_cookie.html", - "test/assets/test/set_cookie.html.mock-http-headers", - "test/assets/test/secureproxychecksuccess.txt", - "test/assets/test/secureproxychecksuccess.txt.mock-http-headers", - "test/assets/test/success.txt", - "test/assets/test/success.txt.mock-http-headers", - ] - - # Maintain directory structure. - renaming_destinations = rebase_path(renaming_sources, "test/assets") -} - android_apk("cronet_test_apk") { testonly = true apk_name = "CronetTest" @@ -639,7 +607,6 @@ deps = [ ":cronet_combine_proguard_flags", - ":cronet_test_apk_assets", ":cronet_test_apk_resources", "//base:base_java", "//third_party/netty-tcnative:netty-tcnative-so", @@ -709,6 +676,9 @@ "//third_party/android_support_test_runner:runner_java", "//third_party/junit", ] + data = [ + "test/assets/test/", + ] } instrumentation_test_apk("cronet_test_instrumentation_apk") {
diff --git a/components/cronet/android/cronet_library_loader.cc b/components/cronet/android/cronet_library_loader.cc index b46507e6..5aa1acc 100644 --- a/components/cronet/android/cronet_library_loader.cc +++ b/components/cronet/android/cronet_library_loader.cc
@@ -17,7 +17,6 @@ #include "base/logging.h" #include "base/macros.h" #include "base/message_loop/message_loop.h" -#include "base/metrics/statistics_recorder.h" #include "base/task_scheduler/task_scheduler.h" #include "components/cronet/android/cronet_jni_registration.h" #include "components/cronet/version.h" @@ -46,9 +45,6 @@ bool NativeInit() { if (!base::android::OnJNIOnLoadInit()) return false; - // Initializes the statistics recorder system. This needs to be done before - // emitting histograms to prevent memory leaks (crbug.com/707836). - base::StatisticsRecorder::Initialize(); if (!base::TaskScheduler::GetInstance()) base::TaskScheduler::CreateAndStartWithDefaultParams("Cronet");
diff --git a/components/cronet/android/cronet_url_request_context_adapter.cc b/components/cronet/android/cronet_url_request_context_adapter.cc index 658f234..145f24d 100644 --- a/components/cronet/android/cronet_url_request_context_adapter.cc +++ b/components/cronet/android/cronet_url_request_context_adapter.cc
@@ -28,7 +28,6 @@ #include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_macros.h" -#include "base/metrics/statistics_recorder.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_restrictions.h" #include "base/threading/thread_task_runner_handle.h" @@ -894,7 +893,6 @@ JNI_CronetUrlRequestContext_GetHistogramDeltas( JNIEnv* env, const JavaParamRef<jclass>& jcaller) { - DCHECK(base::StatisticsRecorder::IsActive()); std::vector<uint8_t> data; if (!HistogramManager::GetInstance()->GetDeltas(&data)) return ScopedJavaLocalRef<jbyteArray>();
diff --git a/components/cronet/android/test/javaperftests/run.py b/components/cronet/android/test/javaperftests/run.py index 0e1382d..4d72854 100755 --- a/components/cronet/android/test/javaperftests/run.py +++ b/components/cronet/android/test/javaperftests/run.py
@@ -40,6 +40,7 @@ """ +import logging import json import os import posixpath @@ -61,6 +62,7 @@ REPOSITORY_ROOT, 'third_party', 'catapult', 'devil')) import android_rndis_forwarder +from chrome_telemetry_build import chromium_config from devil.android import device_utils from devil.android.sdk import intent import lighttpd_server @@ -68,7 +70,6 @@ from telemetry import android from telemetry import benchmark from telemetry import benchmark_runner -from telemetry import project_config from telemetry import story from telemetry.value import scalar from telemetry.web_perf import timeline_based_measurement @@ -233,7 +234,7 @@ '--certificate_file=%s' % QUIC_CERT, '--key_file=%s' % QUIC_KEY, '--port=%d' % QUIC_PORT] - print "Starting Quic Server", cmd + logging.info("Starting Quic Server: %s", cmd) self._process = subprocess.Popen(cmd) assert self._process != None # Wait for quic_server to start serving. @@ -247,7 +248,7 @@ # Push certificate to device. cert = open(QUIC_CERT, 'r').read() device_cert_path = posixpath.join( - device.GetExternalStoragePath(), CERT_PATH) + device.GetExternalStoragePath(), 'chromium_tests_root', CERT_PATH) device.RunShellCommand(['mkdir', '-p', device_cert_path], check_return=True) device.WriteFile(os.path.join(device_cert_path, QUIC_CERT_FILENAME), cert) @@ -330,21 +331,14 @@ # allow benchmark_runner to in turn open this file up and find the # CronetPerfTestBenchmark class to run the benchmark. top_level_dir = os.path.dirname(os.path.realpath(__file__)) - # The perf config file is required to continue using dependencies on the - # Chromium checkout in Telemetry. - perf_config_file = os.path.join(REPOSITORY_ROOT, 'tools', 'perf', 'core', - 'binary_dependencies.json') expectations_file = os.path.join(top_level_dir, 'expectations.config') - with open(perf_config_file, "w") as config_file: - config_file.write('{"config_type": "BaseConfig"}') - runner_config = project_config.ProjectConfig( + runner_config = chromium_config.ChromiumConfig( top_level_dir=top_level_dir, benchmark_dirs=[top_level_dir], - client_configs=[perf_config_file], - default_chrome_root=REPOSITORY_ROOT, expectations_file=expectations_file) sys.argv.insert(1, 'run') sys.argv.insert(2, 'run.CronetPerfTestBenchmark') + sys.argv.insert(3, '--browser=any') benchmark_runner.main(runner_config) # Shutdown. quic_server.ShutdownQuicServer()
diff --git a/components/cronet/android/test/src/org/chromium/net/TestFilesInstaller.java b/components/cronet/android/test/src/org/chromium/net/TestFilesInstaller.java index 84144f2d..3ffbe20 100644 --- a/components/cronet/android/test/src/org/chromium/net/TestFilesInstaller.java +++ b/components/cronet/android/test/src/org/chromium/net/TestFilesInstaller.java
@@ -5,100 +5,29 @@ package org.chromium.net; import android.content.Context; -import android.content.res.AssetManager; -import org.chromium.base.FileUtils; -import org.chromium.base.Log; -import org.chromium.base.PathUtils; - -import java.io.File; -import java.io.IOException; +import org.chromium.base.test.util.UrlUtils; /** * Helper class to install test files. */ public final class TestFilesInstaller { - private static final String TAG = TestFilesInstaller.class.getSimpleName(); // Name of the asset directory in which test files are stored. - private static final String TEST_FILE_ASSET_PATH = "test"; + private static final String TEST_FILE_ASSET_PATH = "components/cronet/android/test/assets/test"; /** * Installs test files if files have not been installed. */ public static void installIfNeeded(Context context) { - if (areFilesInstalled(context)) { - return; - } - try { - install(context, TEST_FILE_ASSET_PATH); - } catch (IOException e) { - // Make the test app crash and fail early. - throw new RuntimeException(e); - } + // Do nothing. + // NOTE(pauljensen): This hook is used (overridden) when tests are run in other + // configurations, so it should not be removed. } /** * Returns the installed path of the test files. */ public static String getInstalledPath(Context context) { - return PathUtils.getDataDirectory() + "/" + TEST_FILE_ASSET_PATH; - } - - /** - * Returns whether test files are installed. - */ - private static boolean areFilesInstalled(Context context) { - // Checking for file directory is fine even when new files are added, - // because the app will be re-installed and app data will be cleared. - File directory = new File(getInstalledPath(context)); - return directory.exists(); - } - - /** - * Installs test files that are included in {@code path}. - * @params context Application context - * @params path - */ - private static void install(Context context, String path) throws IOException { - AssetManager assetManager = context.getAssets(); - String files[] = assetManager.list(path); - Log.i(TAG, "Loading " + path + " ..."); - String root = PathUtils.getDataDirectory(); - if (files.length == 0) { - // The path is a file, so copy the file now. - copyTestFile(context, path, root + "/" + path); - } else { - // The path is a directory, so recursively handle its files, since - // the directory can contain subdirectories. - String fullPath = root + "/" + path; - File dir = new File(fullPath); - if (!dir.exists()) { - Log.i(TAG, "Creating directory " + fullPath + " ..."); - if (!dir.mkdir()) { - throw new IOException("Directory not created."); - } - } - for (int i = 0; i < files.length; i++) { - install(context, path + "/" + files[i]); - } - } - } - /** - * Copies a file from assets to the device's file system. - * @param context - * @param srcFilePath the source file path in assets. - * @param destFilePath the destination file path. - * @throws IllegalStateException if the destination file already exists. - */ - private static void copyTestFile(Context context, String srcFilePath, String destFilePath) - throws IOException { - File destFile = new File(destFilePath); - if (destFile.exists()) { - throw new IllegalStateException(srcFilePath + " already exists."); - } - - if (!FileUtils.extractAsset(context, srcFilePath, destFile)) { - throw new IOException("Could not extract asset " + srcFilePath + "."); - } + return UrlUtils.getIsolatedTestRoot() + "/" + TEST_FILE_ASSET_PATH; } }
diff --git a/components/cronet/histogram_manager_unittest.cc b/components/cronet/histogram_manager_unittest.cc index af599e70..91bed5fc 100644 --- a/components/cronet/histogram_manager_unittest.cc +++ b/components/cronet/histogram_manager_unittest.cc
@@ -9,7 +9,6 @@ #include <string> #include "base/metrics/histogram_macros.h" -#include "base/metrics/statistics_recorder.h" #include "testing/gtest/include/gtest/gtest.h" namespace cronet { @@ -18,7 +17,6 @@ using metrics::HistogramEventProto; TEST(HistogramManager, HistogramBucketFields) { - base::StatisticsRecorder::Initialize(); // Capture histograms at the start of the test to avoid later GetDeltas() // calls picking them up. std::vector<uint8_t> data_init;
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm index b6a07c0..62070e2e 100644 --- a/components/cronet/ios/cronet_environment.mm +++ b/components/cronet/ios/cronet_environment.mm
@@ -17,7 +17,6 @@ #include "base/mac/foundation_util.h" #include "base/macros.h" #include "base/message_loop/message_loop.h" -#include "base/metrics/statistics_recorder.h" #include "base/path_service.h" #include "base/single_thread_task_runner.h" #include "base/synchronization/waitable_event.h" @@ -437,7 +436,6 @@ } std::vector<uint8_t> CronetEnvironment::GetHistogramDeltas() { - DCHECK(base::StatisticsRecorder::IsActive()); std::vector<uint8_t> data; if (!HistogramManager::GetInstance()->GetDeltas(&data)) return std::vector<uint8_t>();
diff --git a/components/cronet/stale_host_resolver.cc b/components/cronet/stale_host_resolver.cc index 33c8d7a..9f95850 100644 --- a/components/cronet/stale_host_resolver.cc +++ b/components/cronet/stale_host_resolver.cc
@@ -404,6 +404,15 @@ return inner_resolver_->ResolveFromCache(info, addresses, net_log); } +int StaleHostResolver::ResolveStaleFromCache( + const RequestInfo& info, + net::AddressList* addresses, + net::HostCache::EntryStaleness* stale_info, + const net::NetLogWithSource& net_log) { + return inner_resolver_->ResolveStaleFromCache(info, addresses, stale_info, + net_log); +} + bool StaleHostResolver::HasCached( base::StringPiece hostname, net::HostCache::Entry::Source* source_out,
diff --git a/components/cronet/stale_host_resolver.h b/components/cronet/stale_host_resolver.h index 77d0305..5deffad 100644 --- a/components/cronet/stale_host_resolver.h +++ b/components/cronet/stale_host_resolver.h
@@ -70,6 +70,11 @@ int ResolveFromCache(const RequestInfo& info, net::AddressList* addresses, const net::NetLogWithSource& net_log) override; + int ResolveStaleFromCache( + const RequestInfo& info, + net::AddressList* addresses, + net::HostCache::EntryStaleness* stale_info, + const net::NetLogWithSource& source_net_log) override; void SetDnsClientEnabled(bool enabled) override; net::HostCache* GetHostCache() override; bool HasCached(base::StringPiece hostname,
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc index a929053..57aece8 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -159,7 +159,7 @@ NetworkPropertiesManager* manager) { DCHECK(thread_checker_.CalledOnValidThread()); network_properties_manager_ = manager; - DCHECK(network_properties_manager_); + network_properties_manager_->ResetWarmupURLFetchMetrics(); secure_proxy_checker_.reset( new SecureProxyChecker(basic_url_request_context_getter)); @@ -182,6 +182,9 @@ void DataReductionProxyConfig::OnNewClientConfigFetched() { DCHECK(thread_checker_.CalledOnValidThread()); ReloadConfig(); + // Call ResetWarmupURLFetchMetrics to reset the counts since the list of + // proxies may have changed. + network_properties_manager_->ResetWarmupURLFetchMetrics(); FetchWarmupProbeURL(); } @@ -394,6 +397,7 @@ base::Bind(&DataReductionProxyConfig::HandleSecureProxyCheckResponse, base::Unretained(this))); } + network_properties_manager_->ResetWarmupURLFetchMetrics(); FetchWarmupProbeURL(); } @@ -423,6 +427,7 @@ bool secure_proxies_allowed, bool insecure_proxies_allowed) { enabled_by_user_ = enabled; + network_properties_manager_->ResetWarmupURLFetchMetrics(); network_properties_manager_->SetIsSecureProxyDisallowedByCarrier( !secure_proxies_allowed); if (!insecure_proxies_allowed != @@ -690,14 +695,22 @@ warmup_url_fetch_in_flight_secure_proxy_ = warmup_config->first; warmup_url_fetch_in_flight_core_proxy_ = warmup_config->second; + size_t previous_attempt_counts = GetWarmupURLFetchAttemptCounts(); + network_properties_manager_->OnWarmupFetchInitiated( warmup_url_fetch_in_flight_secure_proxy_, warmup_url_fetch_in_flight_core_proxy_); RecordWarmupURLFetchAttemptEvent(WarmupURLFetchAttemptEvent::kFetchInitiated); - // TODO(tbansal): https://crbug.com/760294. Use exponential backoffs. - warmup_url_fetcher_->FetchWarmupURL(); + warmup_url_fetcher_->FetchWarmupURL(previous_attempt_counts); +} + +size_t DataReductionProxyConfig::GetWarmupURLFetchAttemptCounts() const { + DCHECK(thread_checker_.CalledOnValidThread()); + return network_properties_manager_->GetWarmupURLFetchAttemptCounts( + warmup_url_fetch_in_flight_secure_proxy_, + warmup_url_fetch_in_flight_core_proxy_); } bool DataReductionProxyConfig::enabled_by_user_and_reachable() const {
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h index 4f9117a4..5439b46b 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h
@@ -238,6 +238,10 @@ // Returns true if a warmup URL probe is in-flight. Virtualized for testing. virtual bool IsFetchInFlight() const; + // Returns the number of previous attempt counts for the proxy that is going + // to be probed. Virtualized for testing. + virtual size_t GetWarmupURLFetchAttemptCounts() const; + private: friend class MockDataReductionProxyConfig; friend class TestDataReductionProxyConfig;
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc index 9964c9a..b29512be 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.cc
@@ -157,6 +157,17 @@ fetch_in_flight_ = fetch_in_flight; } +size_t TestDataReductionProxyConfig::GetWarmupURLFetchAttemptCounts() const { + if (!previous_attempt_counts_) + return DataReductionProxyConfig::GetWarmupURLFetchAttemptCounts(); + return previous_attempt_counts_.value(); +} + +void TestDataReductionProxyConfig::SetWarmupURLFetchAttemptCounts( + base::Optional<size_t> previous_attempt_counts) { + previous_attempt_counts_ = previous_attempt_counts; +} + MockDataReductionProxyConfig::MockDataReductionProxyConfig( std::unique_ptr<DataReductionProxyConfigValues> config_values, scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h index 5790c1b..e3142c1 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_test_utils.h
@@ -118,6 +118,11 @@ void SetIsFetchInFlight(bool fetch_in_flight); + size_t GetWarmupURLFetchAttemptCounts() const override; + + void SetWarmupURLFetchAttemptCounts( + base::Optional<size_t> previous_attempt_counts); + using DataReductionProxyConfig::UpdateConfigForTesting; using DataReductionProxyConfig::HandleWarmupFetcherResponse; @@ -126,6 +131,8 @@ base::TickClock* tick_clock_; + base::Optional<size_t> previous_attempt_counts_; + base::Optional<bool> was_data_reduction_proxy_used_; base::Optional<int> proxy_index_;
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc index 444f7ef0..a1321eb 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config_unittest.cc
@@ -1164,6 +1164,7 @@ ResetSettings(); // Enable the proxy. + test_config()->SetWarmupURLFetchAttemptCounts(0); test_config()->UpdateConfigForTesting(true, true, true); test_config()->SetIsFetchInFlight(true); @@ -1299,6 +1300,7 @@ ResetSettings(); // Enable the proxy. + test_config()->SetWarmupURLFetchAttemptCounts(0); test_config()->UpdateConfigForTesting(true, true, true); test_config()->SetIsFetchInFlight(true); @@ -1353,6 +1355,7 @@ // A change in the connection type should reset the probe fetch attempt count, // and trigger fetching of the probe URL. + test_config()->SetCurrentNetworkID("wifi,test"); net::NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests( net::NetworkChangeNotifier::CONNECTION_WIFI); base::RunLoop().RunUntilIdle();
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator_unittest.cc index 0717a6d4..aff0df53 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator_unittest.cc
@@ -29,6 +29,7 @@ test_prefs.registry()->RegisterDictionaryPref(prefs::kNetworkProperties); manager_.reset(new NetworkPropertiesManager( &test_prefs, base::ThreadTaskRunnerHandle::Get())); + manager_->OnChangeInNetworkID("test"); test_context_ = DataReductionProxyTestContext::Builder().Build(); config_.reset(new DataReductionProxyConfigurator(
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_data.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_data.cc index 41c33ac..d9cc350 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_data.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_data.cc
@@ -5,24 +5,10 @@ #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h" #include "base/memory/ptr_util.h" -#include "base/values.h" #include "net/url_request/url_request.h" namespace data_reduction_proxy { -namespace { -const char* kUsedDataReductionProxyKey = "used_data_reduction_proxy"; -const char* kLofiRequestedKey = "lofi_requested"; -const char* kClientLofiRequestedKey = "client_lofi_requested"; -const char* kLitePageReceivedKey = "lite_page_received"; -const char* kLofiPolicyReceivedKey = "lofi_policy_received"; -const char* kLofiReceivedKey = "lofi_received"; -const char* kSessionKeyKey = "session_key"; -const char* kEffectiveConnectionTypeKey = "effective_connection_type"; -const char* kRequestURLKey = "request_url"; -const char* kPageIdKey = "page_id"; -} // namespace - const void* const kDataReductionProxyUserDataKey = &kDataReductionProxyUserDataKey; @@ -37,46 +23,6 @@ DataReductionProxyData::~DataReductionProxyData() {} -// Convert from/to a base::Value. -base::Value DataReductionProxyData::ToValue() { - base::Value value(base::Value::Type::DICTIONARY); - value.SetKey(kUsedDataReductionProxyKey, - base::Value(used_data_reduction_proxy_)); - value.SetKey(kLofiRequestedKey, base::Value(lofi_requested_)); - value.SetKey(kClientLofiRequestedKey, base::Value(client_lofi_requested_)); - value.SetKey(kLitePageReceivedKey, base::Value(lite_page_received_)); - value.SetKey(kLofiPolicyReceivedKey, base::Value(lofi_policy_received_)); - value.SetKey(kLofiReceivedKey, base::Value(lofi_received_)); - value.SetKey(kSessionKeyKey, base::Value(session_key_)); - value.SetKey(kEffectiveConnectionTypeKey, - base::Value(effective_connection_type_)); - value.SetKey(kRequestURLKey, - base::Value(request_url_.possibly_invalid_spec())); - // Store |page_id_| as a string because base::Value can't store a 64 bits - // integer. - if (page_id_) - value.SetKey(kPageIdKey, base::Value(std::to_string(page_id_.value()))); - - return value; -} - -DataReductionProxyData::DataReductionProxyData(const base::Value& value) - : used_data_reduction_proxy_( - value.FindKey(kUsedDataReductionProxyKey)->GetBool()), - lofi_requested_(value.FindKey(kLofiRequestedKey)->GetBool()), - client_lofi_requested_(value.FindKey(kClientLofiRequestedKey)->GetBool()), - lite_page_received_(value.FindKey(kLitePageReceivedKey)->GetBool()), - lofi_policy_received_(value.FindKey(kLofiPolicyReceivedKey)->GetBool()), - lofi_received_(value.FindKey(kLofiReceivedKey)->GetBool()), - session_key_(value.FindKey(kSessionKeyKey)->GetString()), - request_url_(GURL(value.FindKey(kRequestURLKey)->GetString())), - effective_connection_type_(net::EffectiveConnectionType( - value.FindKey(kEffectiveConnectionTypeKey)->GetInt())) { - const base::Value* page_id = value.FindKey(kPageIdKey); - if (page_id) - page_id_ = std::stoll(page_id->GetString()); -} - std::unique_ptr<DataReductionProxyData> DataReductionProxyData::DeepCopy() const { std::unique_ptr<DataReductionProxyData> copy(new DataReductionProxyData());
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h index 6123071..19e8d053 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h
@@ -16,10 +16,6 @@ #include "net/nqe/effective_connection_type.h" #include "url/gurl.h" -namespace base { -class Value; -} - namespace net { class URLRequest; } @@ -33,10 +29,6 @@ DataReductionProxyData(); ~DataReductionProxyData() override; - // Convert from/to a base::Value. - base::Value ToValue(); - explicit DataReductionProxyData(const base::Value& value); - // Whether the DataReductionProxy was used for this request or navigation. // Also true if the user is the holdback experiment, and the request would // otherwise be eligible to use the proxy.
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_data_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_data_unittest.cc index 0d4fa60..a7deafb 100644 --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_data_unittest.cc +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_data_unittest.cc
@@ -11,7 +11,6 @@ #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" -#include "base/values.h" #include "net/base/request_priority.h" #include "net/nqe/effective_connection_type.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" @@ -156,121 +155,6 @@ EXPECT_FALSE(data); } -TEST_F(DataReductionProxyDataTest, Serialization) { - // used_data_reduction_proxy. - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_used_data_reduction_proxy(true); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_FALSE(clone_a.used_data_reduction_proxy()); - EXPECT_TRUE(clone_b.used_data_reduction_proxy()); - } - - // lofi_requested - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_lofi_requested(true); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_FALSE(clone_a.lofi_requested()); - EXPECT_TRUE(clone_b.lofi_requested()); - } - - // client_lofi_requested - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_client_lofi_requested(true); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_FALSE(clone_a.client_lofi_requested()); - EXPECT_TRUE(clone_b.client_lofi_requested()); - } - - // lite_page_received - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_lite_page_received(true); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_FALSE(clone_a.lite_page_received()); - EXPECT_TRUE(clone_b.lite_page_received()); - } - - // lofi_policy_received - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_lofi_policy_received(true); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_FALSE(clone_a.lofi_policy_received()); - EXPECT_TRUE(clone_b.lofi_policy_received()); - } - - // lofi_received - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_lofi_received(true); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_FALSE(clone_a.lofi_received()); - EXPECT_TRUE(clone_b.lofi_received()); - } - - // session_key - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_session_key("the_session_key"); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_EQ("", clone_a.session_key()); - EXPECT_EQ("the_session_key", clone_b.session_key()); - } - - // request_url - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_request_url(GURL("http://example.com")); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_EQ(GURL(), clone_a.request_url()); - EXPECT_EQ(GURL("http://example.com"), clone_b.request_url()); - } - - // effective_connection_type - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_effective_connection_type(net::EFFECTIVE_CONNECTION_TYPE_4G); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN, - clone_a.effective_connection_type()); - EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_4G, - clone_b.effective_connection_type()); - } - - // page_id - { - DataReductionProxyData data; - DataReductionProxyData clone_a(data.ToValue()); - data.set_page_id(1ull << 60); - DataReductionProxyData clone_b(data.ToValue()); - - EXPECT_FALSE(clone_a.page_id()); - EXPECT_TRUE(clone_b.page_id()); - EXPECT_EQ(1ull << 60, clone_b.page_id().value()); - } -} - } // namespace } // namespace data_reduction_proxy
diff --git a/components/data_reduction_proxy/core/browser/network_properties_manager.cc b/components/data_reduction_proxy/core/browser/network_properties_manager.cc index 31a64d9..693b2e7b 100644 --- a/components/data_reduction_proxy/core/browser/network_properties_manager.cc +++ b/components/data_reduction_proxy/core/browser/network_properties_manager.cc
@@ -149,15 +149,7 @@ pref_manager_.reset(new PrefManager(pref_service)); pref_manager_weak_ptr_ = pref_manager_->GetWeakPtr(); - has_warmup_url_succeded_secure_core_ = false; - has_warmup_url_succeded_secure_non_core_ = false; - has_warmup_url_succeded_insecure_core_ = false; - has_warmup_url_succeded_insecure_non_core_ = false; - - warmup_url_fetch_attempt_counts_secure_core_ = 0; - warmup_url_fetch_attempt_counts_secure_non_core_ = 0; - warmup_url_fetch_attempt_counts_insecure_core_ = 0; - warmup_url_fetch_attempt_counts_insecure_non_core_ = 0; + ResetWarmupURLFetchMetrics(); DETACH_FROM_SEQUENCE(sequence_checker_); } @@ -186,16 +178,9 @@ void NetworkPropertiesManager::OnChangeInNetworkID( const std::string& network_id) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(!network_id.empty()); - has_warmup_url_succeded_secure_core_ = false; - has_warmup_url_succeded_secure_non_core_ = false; - has_warmup_url_succeded_insecure_core_ = false; - has_warmup_url_succeded_insecure_non_core_ = false; - - warmup_url_fetch_attempt_counts_secure_core_ = 0; - warmup_url_fetch_attempt_counts_secure_non_core_ = 0; - warmup_url_fetch_attempt_counts_insecure_core_ = 0; - warmup_url_fetch_attempt_counts_insecure_non_core_ = 0; + ResetWarmupURLFetchMetrics(); network_id_ = network_id; @@ -215,6 +200,20 @@ cached_entry_found); } +void NetworkPropertiesManager::ResetWarmupURLFetchMetrics() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + has_warmup_url_succeded_secure_core_ = false; + has_warmup_url_succeded_secure_non_core_ = false; + has_warmup_url_succeded_insecure_core_ = false; + has_warmup_url_succeded_insecure_non_core_ = false; + + warmup_url_fetch_attempt_counts_secure_core_ = 0; + warmup_url_fetch_attempt_counts_secure_non_core_ = 0; + warmup_url_fetch_attempt_counts_insecure_core_ = 0; + warmup_url_fetch_attempt_counts_insecure_non_core_ = 0; +} + void NetworkPropertiesManager::OnChangeInNetworkPropertyOnIOThread() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -382,4 +381,28 @@ } } +size_t NetworkPropertiesManager::GetWarmupURLFetchAttemptCounts( + bool secure_proxy, + bool is_core_proxy) const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + if (secure_proxy && is_core_proxy) { + DCHECK_GT(kMaxWarmupURLFetchAttempts, + warmup_url_fetch_attempt_counts_secure_core_); + return warmup_url_fetch_attempt_counts_secure_core_; + } else if (secure_proxy && !is_core_proxy) { + DCHECK_GT(kMaxWarmupURLFetchAttempts, + warmup_url_fetch_attempt_counts_secure_non_core_); + return warmup_url_fetch_attempt_counts_secure_non_core_; + } else if (!secure_proxy && is_core_proxy) { + DCHECK_GT(kMaxWarmupURLFetchAttempts, + warmup_url_fetch_attempt_counts_insecure_core_); + return warmup_url_fetch_attempt_counts_insecure_core_; + } else { + DCHECK_GT(kMaxWarmupURLFetchAttempts, + warmup_url_fetch_attempt_counts_insecure_non_core_); + return warmup_url_fetch_attempt_counts_insecure_non_core_; + } +} + } // namespace data_reduction_proxy \ No newline at end of file
diff --git a/components/data_reduction_proxy/core/browser/network_properties_manager.h b/components/data_reduction_proxy/core/browser/network_properties_manager.h index c920ec7..550272b 100644 --- a/components/data_reduction_proxy/core/browser/network_properties_manager.h +++ b/components/data_reduction_proxy/core/browser/network_properties_manager.h
@@ -85,6 +85,14 @@ // has been initiated. void OnWarmupFetchInitiated(bool secure_proxy, bool is_core_proxy); + // Returns the count of fetch attempts that have been made to the proxy with + // the specified properties. + size_t GetWarmupURLFetchAttemptCounts(bool secure_proxy, + bool is_core_proxy) const; + + // Resets the metrics related to the fetching of the warmup probe URL. + void ResetWarmupURLFetchMetrics(); + private: // Map from network IDs to network properties. typedef std::map<std::string, NetworkProperties> NetworkPropertiesContainer;
diff --git a/components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc b/components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc index 88c160c..8ff36c2 100644 --- a/components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc +++ b/components/data_reduction_proxy/core/browser/warmup_url_fetcher.cc
@@ -35,7 +35,32 @@ WarmupURLFetcher::~WarmupURLFetcher() {} -void WarmupURLFetcher::FetchWarmupURL() { +void WarmupURLFetcher::FetchWarmupURL(size_t previous_attempt_counts) { + DCHECK_GE(2u, previous_attempt_counts); + + // There can be at most one pending fetch at any time. + fetch_delay_timer_.Stop(); + + if (previous_attempt_counts == 0) { + FetchWarmupURLNow(); + return; + } + fetch_delay_timer_.Start(FROM_HERE, GetFetchWaitTime(previous_attempt_counts), + this, &WarmupURLFetcher::FetchWarmupURLNow); +} + +base::TimeDelta WarmupURLFetcher::GetFetchWaitTime( + size_t previous_attempt_counts) const { + DCHECK_LT(0u, previous_attempt_counts); + DCHECK_GE(2u, previous_attempt_counts); + + if (previous_attempt_counts == 1) + return base::TimeDelta::FromSeconds(30); + + return base::TimeDelta::FromSeconds(60); +} + +void WarmupURLFetcher::FetchWarmupURLNow() { UMA_HISTOGRAM_EXACT_LINEAR("DataReductionProxy.WarmupURL.FetchInitiated", 1, 2); net::NetworkTrafficAnnotationTag traffic_annotation =
diff --git a/components/data_reduction_proxy/core/browser/warmup_url_fetcher.h b/components/data_reduction_proxy/core/browser/warmup_url_fetcher.h index 86c06e48..e657988f 100644 --- a/components/data_reduction_proxy/core/browser/warmup_url_fetcher.h +++ b/components/data_reduction_proxy/core/browser/warmup_url_fetcher.h
@@ -10,6 +10,7 @@ #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/timer/timer.h" #include "net/url_request/url_fetcher_delegate.h" class GURL; @@ -39,7 +40,10 @@ ~WarmupURLFetcher() override; // Creates and starts a URLFetcher that fetches the warmup URL. - void FetchWarmupURL(); + // |previous_attempt_counts| is the count of fetch attempts that have been + // made to the proxy which is being probed. The fetching may happen after some + // delay depending on |previous_attempt_counts|. + void FetchWarmupURL(size_t previous_attempt_counts); // Returns true if a warmup URL fetch is currently in-flight. bool IsFetchInFlight() const; @@ -49,9 +53,22 @@ // query params to the warmup URL. void GetWarmupURLWithQueryParam(GURL* warmup_url_with_query_params) const; + // Returns the time for which the fetching of the warmup URL probe should be + // delayed. |previous_attempt_counts| is the count of fetch attempts that + // have been made to the proxy for which the delay is being computed. + // Virtualized for testing. + virtual base::TimeDelta GetFetchWaitTime( + size_t previous_attempt_counts) const; + private: + // Creates and immediately starts a URLFetcher that fetches the warmup URL. + void FetchWarmupURLNow(); + void OnURLFetchComplete(const net::URLFetcher* source) override; + // Timer used to delay the fetching of the warmup probe URL. + base::OneShotTimer fetch_delay_timer_; + scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; // The URLFetcher being used for fetching the warmup URL.
diff --git a/components/data_reduction_proxy/core/browser/warmup_url_fetcher_unittest.cc b/components/data_reduction_proxy/core/browser/warmup_url_fetcher_unittest.cc index 057d572..44eee2e9 100644 --- a/components/data_reduction_proxy/core/browser/warmup_url_fetcher_unittest.cc +++ b/components/data_reduction_proxy/core/browser/warmup_url_fetcher_unittest.cc
@@ -14,6 +14,7 @@ #include "base/run_loop.h" #include "base/test/histogram_tester.h" #include "base/test/scoped_feature_list.h" +#include "base/threading/platform_thread.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_features.h" #include "components/data_reduction_proxy/core/common/data_reduction_proxy_util.h" #include "net/http/http_status_code.h" @@ -53,6 +54,18 @@ features::kDataReductionProxyRobustConnection, params); } + base::TimeDelta GetFetchWaitTime( + size_t previous_attempt_counts) const override { + if (!fetch_wait_time_) + return WarmupURLFetcher::GetFetchWaitTime(previous_attempt_counts); + + return fetch_wait_time_.value(); + } + + void SetFetchWaitTime(base::Optional<base::TimeDelta> fetch_wait_time) { + fetch_wait_time_ = fetch_wait_time; + } + using WarmupURLFetcher::FetchWarmupURL; using WarmupURLFetcher::GetWarmupURLWithQueryParam; @@ -64,6 +77,7 @@ success_response_last_ = success_response; } + base::Optional<base::TimeDelta> fetch_wait_time_; size_t callback_received_count_ = 0; net::ProxyServer proxy_server_last_; bool success_response_last_ = false; @@ -132,7 +146,7 @@ WarmupURLFetcherTest warmup_url_fetcher(request_context_getter); EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); - warmup_url_fetcher.FetchWarmupURL(); + warmup_url_fetcher.FetchWarmupURL(0); EXPECT_TRUE(warmup_url_fetcher.IsFetchInFlight()); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); @@ -191,7 +205,7 @@ WarmupURLFetcherTest warmup_url_fetcher(request_context_getter); EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); - warmup_url_fetcher.FetchWarmupURL(); + warmup_url_fetcher.FetchWarmupURL(0); EXPECT_TRUE(warmup_url_fetcher.IsFetchInFlight()); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); @@ -247,7 +261,7 @@ std::move(test_request_context)); WarmupURLFetcherTest warmup_url_fetcher(request_context_getter); - warmup_url_fetcher.FetchWarmupURL(); + warmup_url_fetcher.FetchWarmupURL(0); base::RunLoop().RunUntilIdle(); histogram_tester.ExpectUniqueSample( @@ -297,7 +311,7 @@ WarmupURLFetcherTest warmup_url_fetcher(request_context_getter); EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); - warmup_url_fetcher.FetchWarmupURL(); + warmup_url_fetcher.FetchWarmupURL(0); EXPECT_TRUE(warmup_url_fetcher.IsFetchInFlight()); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); @@ -321,6 +335,67 @@ EXPECT_FALSE(warmup_url_fetcher.success_response_last()); } +TEST(WarmupURLFetcherTest, TestSuccessfulFetchWarmupURLWithDelay) { + base::test::ScopedFeatureList scoped_feature_list; + WarmupURLFetcherTest::InitExperiment(&scoped_feature_list); + + base::HistogramTester histogram_tester; + base::MessageLoopForIO message_loop; + const std::string config = "foobarbaz"; + std::vector<std::unique_ptr<net::SocketDataProvider>> socket_data_providers; + net::MockClientSocketFactory mock_socket_factory; + net::MockRead success_reads[3]; + success_reads[0] = net::MockRead( + "HTTP/1.1 204 OK\r\nVia: 1.1 Chrome-Compression-Proxy\r\n\r\n"); + success_reads[1] = net::MockRead(net::ASYNC, config.c_str(), config.length()); + success_reads[2] = net::MockRead(net::SYNCHRONOUS, net::OK); + + socket_data_providers.push_back( + (base::MakeUnique<net::StaticSocketDataProvider>( + success_reads, arraysize(success_reads), nullptr, 0))); + mock_socket_factory.AddSocketDataProvider(socket_data_providers.back().get()); + + std::unique_ptr<net::TestURLRequestContext> test_request_context( + new net::TestURLRequestContext(true)); + + test_request_context->set_client_socket_factory(&mock_socket_factory); + test_request_context->Init(); + scoped_refptr<net::URLRequestContextGetter> request_context_getter = + new net::TestURLRequestContextGetter(message_loop.task_runner(), + std::move(test_request_context)); + + WarmupURLFetcherTest warmup_url_fetcher(request_context_getter); + EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); + warmup_url_fetcher.SetFetchWaitTime(base::TimeDelta::FromMilliseconds(1)); + warmup_url_fetcher.FetchWarmupURL(1); + base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(2)); + EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); + base::RunLoop().RunUntilIdle(); + EXPECT_FALSE(warmup_url_fetcher.IsFetchInFlight()); + + histogram_tester.ExpectUniqueSample( + "DataReductionProxy.WarmupURL.FetchInitiated", 1, 1); + histogram_tester.ExpectUniqueSample( + "DataReductionProxy.WarmupURL.FetchSuccessful", 1, 1); + histogram_tester.ExpectUniqueSample("DataReductionProxy.WarmupURL.NetError", + net::OK, 1); + histogram_tester.ExpectUniqueSample( + "DataReductionProxy.WarmupURL.HttpResponseCode", net::HTTP_NO_CONTENT, 1); + histogram_tester.ExpectUniqueSample( + "DataReductionProxy.WarmupURL.HasViaHeader", 1, 1); + histogram_tester.ExpectUniqueSample( + "DataReductionProxy.WarmupURL.ProxySchemeUsed", + util::ConvertNetProxySchemeToProxyScheme(net::ProxyServer::SCHEME_DIRECT), + 1); + + EXPECT_EQ(1u, warmup_url_fetcher.callback_received_count()); + EXPECT_EQ(net::ProxyServer::SCHEME_DIRECT, + warmup_url_fetcher.proxy_server_last().scheme()); + // success_response_last() should be true since the response contains the via + // header. + EXPECT_TRUE(warmup_url_fetcher.success_response_last()); +} + } // namespace } // namespace data_reduction_proxy
diff --git a/components/download/content/factory/download_service_factory.cc b/components/download/content/factory/download_service_factory.cc index f72ada0f..cfa39be 100644 --- a/components/download/content/factory/download_service_factory.cc +++ b/components/download/content/factory/download_service_factory.cc
@@ -3,7 +3,6 @@ // found in the LICENSE file. #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "build/build_config.h" #include "components/download/content/factory/navigation_monitor_factory.h" #include "components/download/content/internal/download_driver_impl.h" @@ -36,40 +35,40 @@ const base::FilePath& storage_dir, const scoped_refptr<base::SequencedTaskRunner>& background_task_runner, std::unique_ptr<TaskScheduler> task_scheduler) { - auto client_set = base::MakeUnique<ClientSet>(std::move(clients)); + auto client_set = std::make_unique<ClientSet>(std::move(clients)); auto config = Configuration::CreateFromFinch(); auto files_storage_dir = storage_dir.Append(kFilesStorageDir); - auto driver = base::MakeUnique<DownloadDriverImpl>(download_manager); + auto driver = std::make_unique<DownloadDriverImpl>(download_manager); auto entry_db_storage_dir = storage_dir.Append(kEntryDBStorageDir); auto entry_db = - base::MakeUnique<leveldb_proto::ProtoDatabaseImpl<protodb::Entry>>( + std::make_unique<leveldb_proto::ProtoDatabaseImpl<protodb::Entry>>( background_task_runner); - auto store = base::MakeUnique<DownloadStore>(entry_db_storage_dir, + auto store = std::make_unique<DownloadStore>(entry_db_storage_dir, std::move(entry_db)); - auto model = base::MakeUnique<ModelImpl>(std::move(store)); + auto model = std::make_unique<ModelImpl>(std::move(store)); #if defined(OS_ANDROID) - auto battery_listener = base::MakeUnique<BatteryStatusListenerAndroid>( + auto battery_listener = std::make_unique<BatteryStatusListenerAndroid>( config->battery_query_interval); #else auto battery_listener = - base::MakeUnique<BatteryStatusListener>(config->battery_query_interval); + std::make_unique<BatteryStatusListener>(config->battery_query_interval); #endif - auto device_status_listener = base::MakeUnique<DeviceStatusListener>( + auto device_status_listener = std::make_unique<DeviceStatusListener>( config->network_startup_delay, config->network_change_delay, std::move(battery_listener)); NavigationMonitor* navigation_monitor = NavigationMonitorFactory::GetForBrowserContext( download_manager->GetBrowserContext()); - auto scheduler = base::MakeUnique<SchedulerImpl>( + auto scheduler = std::make_unique<SchedulerImpl>( task_scheduler.get(), config.get(), client_set.get()); - auto file_monitor = base::MakeUnique<FileMonitorImpl>( + auto file_monitor = std::make_unique<FileMonitorImpl>( files_storage_dir, background_task_runner, config->file_keep_alive_time); - auto logger = base::MakeUnique<LoggerImpl>(); - auto controller = base::MakeUnique<ControllerImpl>( + auto logger = std::make_unique<LoggerImpl>(); + auto controller = std::make_unique<ControllerImpl>( config.get(), logger.get(), std::move(client_set), std::move(driver), std::move(model), std::move(device_status_listener), navigation_monitor, std::move(scheduler), std::move(task_scheduler), std::move(file_monitor),
diff --git a/components/download/content/internal/download_driver_impl.cc b/components/download/content/internal/download_driver_impl.cc index e6d3f64a..5b22a39 100644 --- a/components/download/content/internal/download_driver_impl.cc +++ b/components/download/content/internal/download_driver_impl.cc
@@ -7,7 +7,6 @@ #include <set> #include <vector> -#include "base/memory/ptr_util.h" #include "base/metrics/histogram_functions.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/memory_usage_estimator.h" @@ -121,7 +120,7 @@ } notifier_ = - base::MakeUnique<AllDownloadItemNotifier>(download_manager_, this); + std::make_unique<AllDownloadItemNotifier>(download_manager_, this); } void DownloadDriverImpl::HardRecover() {
diff --git a/components/download/content/internal/download_driver_impl_unittest.cc b/components/download/content/internal/download_driver_impl_unittest.cc index c2581b7..438daad 100644 --- a/components/download/content/internal/download_driver_impl_unittest.cc +++ b/components/download/content/internal/download_driver_impl_unittest.cc
@@ -8,7 +8,6 @@ #include <string> #include "base/guid.h" -#include "base/memory/ptr_util.h" #include "base/test/test_simple_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "components/download/content/public/all_download_item_notifier.h" @@ -67,7 +66,7 @@ void SetUp() override { EXPECT_CALL(mock_client_, IsTrackingDownload(_)) .WillRepeatedly(Return(true)); - driver_ = base::MakeUnique<DownloadDriverImpl>(&mock_manager_); + driver_ = std::make_unique<DownloadDriverImpl>(&mock_manager_); } // TODO(xingliu): implements test download manager for embedders to test.
diff --git a/components/download/content/public/download_navigation_observer.cc b/components/download/content/public/download_navigation_observer.cc index e0636797..82e7fb9 100644 --- a/components/download/content/public/download_navigation_observer.cc +++ b/components/download/content/public/download_navigation_observer.cc
@@ -4,7 +4,7 @@ #include "components/download/content/public/download_navigation_observer.h" -#include "base/memory/ptr_util.h" +#include <memory> DEFINE_WEB_CONTENTS_USER_DATA_KEY(download::DownloadNavigationObserver); @@ -17,7 +17,7 @@ DCHECK(web_contents); if (!FromWebContents(web_contents)) { web_contents->SetUserData(UserDataKey(), - base::MakeUnique<DownloadNavigationObserver>( + std::make_unique<DownloadNavigationObserver>( web_contents, navigation_monitor)); } }
diff --git a/components/download/downloader/in_progress/in_progress_cache_impl_unittest.cc b/components/download/downloader/in_progress/in_progress_cache_impl_unittest.cc index e32519fc..4e9c4f1 100644 --- a/components/download/downloader/in_progress/in_progress_cache_impl_unittest.cc +++ b/components/download/downloader/in_progress/in_progress_cache_impl_unittest.cc
@@ -4,9 +4,10 @@ #include "components/download/downloader/in_progress/in_progress_cache_impl.h" +#include <memory> + #include "base/bind.h" #include "base/bind_helpers.h" -#include "base/memory/ptr_util.h" #include "base/run_loop.h" #include "base/task_runner.h" #include "base/task_scheduler/post_task.h" @@ -36,7 +37,7 @@ base::CreateSequencedTaskRunnerWithTraits( {base::MayBlock(), base::TaskPriority::BACKGROUND, base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}); - cache_ = base::MakeUnique<InProgressCacheImpl>(file_path, task_runner); + cache_ = std::make_unique<InProgressCacheImpl>(file_path, task_runner); } protected:
diff --git a/components/download/internal/client_set_unittest.cc b/components/download/internal/client_set_unittest.cc index 8c89f09..c128ae7 100644 --- a/components/download/internal/client_set_unittest.cc +++ b/components/download/internal/client_set_unittest.cc
@@ -6,7 +6,6 @@ #include <algorithm> -#include "base/memory/ptr_util.h" #include "components/download/public/clients.h" #include "components/download/public/test/empty_client.h" #include "testing/gtest/include/gtest/gtest.h" @@ -14,10 +13,10 @@ namespace download { TEST(DownloadServiceClientSetTest, TestGetClient) { - auto client = base::MakeUnique<test::EmptyClient>(); + auto client = std::make_unique<test::EmptyClient>(); Client* raw_client = client.get(); - auto client_map = base::MakeUnique<DownloadClientMap>(); + auto client_map = std::make_unique<DownloadClientMap>(); client_map->insert(std::make_pair(DownloadClient::TEST, std::move(client))); ClientSet clients(std::move(client_map)); @@ -26,9 +25,9 @@ } TEST(DownloadServiceClientSetTest, TestGetRegisteredClients) { - auto client = base::MakeUnique<test::EmptyClient>(); + auto client = std::make_unique<test::EmptyClient>(); - auto client_map = base::MakeUnique<DownloadClientMap>(); + auto client_map = std::make_unique<DownloadClientMap>(); client_map->insert(std::make_pair(DownloadClient::TEST, std::move(client))); ClientSet clients(std::move(client_map));
diff --git a/components/download/internal/controller_impl_unittest.cc b/components/download/internal/controller_impl_unittest.cc index acb80ea..8d8e907 100644 --- a/components/download/internal/controller_impl_unittest.cc +++ b/components/download/internal/controller_impl_unittest.cc
@@ -10,7 +10,6 @@ #include "base/bind.h" #include "base/guid.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_util.h" #include "base/test/histogram_tester.h" #include "base/test/test_simple_task_runner.h" @@ -145,10 +144,10 @@ ~DownloadServiceControllerImplTest() override = default; void SetUp() override { - auto client = base::MakeUnique<NiceMock<test::MockClient>>(); - auto driver = base::MakeUnique<test::TestDownloadDriver>(); - auto store = base::MakeUnique<test::TestStore>(); - config_ = base::MakeUnique<Configuration>(); + auto client = std::make_unique<NiceMock<test::MockClient>>(); + auto driver = std::make_unique<test::TestDownloadDriver>(); + auto store = std::make_unique<test::TestStore>(); + config_ = std::make_unique<Configuration>(); config_->max_retry_count = 1; config_->max_resumption_count = 4; config_->file_keep_alive_time = base::TimeDelta::FromMinutes(10); @@ -156,25 +155,25 @@ config_->max_concurrent_downloads = 5; config_->max_running_downloads = 5; - log_sink_ = base::MakeUnique<test::BlackHoleLogSink>(); + log_sink_ = std::make_unique<test::BlackHoleLogSink>(); client_ = client.get(); driver_ = driver.get(); store_ = store.get(); - auto clients = base::MakeUnique<DownloadClientMap>(); + auto clients = std::make_unique<DownloadClientMap>(); clients->insert(std::make_pair(DownloadClient::TEST, std::move(client))); clients->insert(std::make_pair(DownloadClient::TEST_2, - base::MakeUnique<test::EmptyClient>())); - auto client_set = base::MakeUnique<ClientSet>(std::move(clients)); - auto model = base::MakeUnique<ModelImpl>(std::move(store)); + std::make_unique<test::EmptyClient>())); + auto client_set = std::make_unique<ClientSet>(std::move(clients)); + auto model = std::make_unique<ModelImpl>(std::move(store)); auto device_status_listener = - base::MakeUnique<test::TestDeviceStatusListener>(); - auto scheduler = base::MakeUnique<NiceMock<MockScheduler>>(); - auto task_scheduler = base::MakeUnique<MockTaskScheduler>(); + std::make_unique<test::TestDeviceStatusListener>(); + auto scheduler = std::make_unique<NiceMock<MockScheduler>>(); + auto task_scheduler = std::make_unique<MockTaskScheduler>(); auto download_file_dir = base::FilePath(kDownloadDirPath); - auto file_monitor = base::MakeUnique<NiceMock<MockFileMonitor>>(); + auto file_monitor = std::make_unique<NiceMock<MockFileMonitor>>(); model_ = model.get(); device_status_listener_ = device_status_listener.get(); @@ -182,7 +181,7 @@ task_scheduler_ = task_scheduler.get(); file_monitor_ = file_monitor.get(); - controller_ = base::MakeUnique<ControllerImpl>( + controller_ = std::make_unique<ControllerImpl>( config_.get(), log_sink_.get(), std::move(client_set), std::move(driver), std::move(model), std::move(device_status_listener), &navigation_monitor, std::move(scheduler), std::move(task_scheduler), @@ -247,7 +246,7 @@ EXPECT_TRUE(store_->init_called()); EXPECT_EQ(controller_->GetState(), Controller::State::INITIALIZING); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); EXPECT_EQ(controller_->GetState(), Controller::State::INITIALIZING); @@ -279,7 +278,7 @@ EXPECT_CALL(*client_, OnServiceInitialized(false, _)).Times(1); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); EXPECT_EQ(controller_->GetState(), Controller::State::READY); @@ -299,7 +298,7 @@ InitializeController(); driver_->MakeReady(); - store_->TriggerInit(false, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(false, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); EXPECT_EQ(controller_->GetState(), Controller::State::RECOVERING); @@ -331,7 +330,7 @@ InitializeController(); driver_->MakeReady(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(false); EXPECT_EQ(controller_->GetState(), Controller::State::RECOVERING); @@ -363,7 +362,7 @@ InitializeController(); driver_->MakeReady(); - store_->TriggerInit(false, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(false, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); EXPECT_EQ(controller_->GetState(), Controller::State::RECOVERING); @@ -410,7 +409,7 @@ InitializeController(); driver_->MakeReady(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); task_runner_->RunUntilIdle(); @@ -435,7 +434,7 @@ driver_->AddTestData(dentries); InitializeController(); driver_->MakeReady(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); task_runner_->RunUntilIdle(); @@ -457,7 +456,7 @@ InitializeController(); driver_->MakeReady(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); controller_->OnStartScheduledTask(DownloadTaskType::CLEANUP_TASK, base::Bind(&NotifyTaskFinished)); @@ -474,7 +473,7 @@ InitializeController(); driver_->MakeReady(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); task_runner_->RunUntilIdle(); @@ -489,7 +488,7 @@ // Set up the Controller. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -521,7 +520,7 @@ // Set up the Controller. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -550,7 +549,7 @@ // Set up the Controller. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -573,7 +572,7 @@ // Set up the Controller. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -601,7 +600,7 @@ // Set up the Controller. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -623,7 +622,7 @@ // Set up the Controller. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -647,7 +646,7 @@ // Set up the Controller. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -687,7 +686,7 @@ // The default network status is disconnected so no entries will be polled // from the scheduler. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); @@ -730,7 +729,7 @@ DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::UNMETERED)); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); @@ -765,7 +764,7 @@ device_status_listener_->SetDeviceStatus( DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::UNMETERED)); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); @@ -792,7 +791,7 @@ device_status_listener_->SetDeviceStatus( DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::UNMETERED)); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); @@ -824,7 +823,7 @@ .Times(1); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); @@ -868,7 +867,7 @@ DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::UNMETERED)); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); @@ -918,7 +917,7 @@ config_->max_resumption_count = 4; InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -977,7 +976,7 @@ device_status_listener_->SetDeviceStatus( DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::UNMETERED)); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); @@ -1033,7 +1032,7 @@ driver_->AddTestData(std::vector<DriverEntry>{dentry1}); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); @@ -1067,7 +1066,7 @@ EXPECT_CALL(*client_, OnServiceInitialized(false, _)).Times(1); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); DriverEntry dentry_update; @@ -1112,7 +1111,7 @@ // Set up the Controller. InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -1230,7 +1229,7 @@ driver_->AddTestData(driver_entries); driver_->MakeReady(); store_->AutomaticallyTriggerAllFutureCallbacks(true); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); // Allow the initialization routines and persistent layers to do their thing. @@ -1328,7 +1327,7 @@ driver_->AddTestData(dentries); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -1373,7 +1372,7 @@ driver_->AddTestData(dentries); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -1452,7 +1451,7 @@ EXPECT_CALL(*client_, OnServiceInitialized(false, _)).Times(1); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -1505,7 +1504,7 @@ EXPECT_CALL(*client_, OnServiceInitialized(false, _)).Times(1); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); driver_->MakeReady(); task_runner_->RunUntilIdle(); @@ -1533,7 +1532,7 @@ device_status_listener_->SetDeviceStatus( DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::UNMETERED)); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); store_->AutomaticallyTriggerAllFutureCallbacks(true); @@ -1564,7 +1563,7 @@ device_status_listener_->SetDeviceStatus( DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::UNMETERED)); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); store_->AutomaticallyTriggerAllFutureCallbacks(true); @@ -1612,7 +1611,7 @@ DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::METERED)); driver_->AddTestData(dentries); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); store_->AutomaticallyTriggerAllFutureCallbacks(true); @@ -1689,7 +1688,7 @@ DeviceStatus(BatteryStatus::CHARGING, NetworkStatus::UNMETERED)); driver_->AddTestData(dentries); InitializeController(); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); file_monitor_->TriggerInit(true); store_->AutomaticallyTriggerAllFutureCallbacks(true); driver_->MakeReady();
diff --git a/components/download/internal/download_service_impl_unittest.cc b/components/download/internal/download_service_impl_unittest.cc index 17af31cd..b02db49 100644 --- a/components/download/internal/download_service_impl_unittest.cc +++ b/components/download/internal/download_service_impl_unittest.cc
@@ -7,7 +7,6 @@ #include <memory> #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/string_util.h" #include "base/test/histogram_tester.h" #include "base/test/test_simple_task_runner.h" @@ -35,11 +34,11 @@ ~DownloadServiceImplTest() override = default; void SetUp() override { - auto config = base::MakeUnique<Configuration>(); - auto logger = base::MakeUnique<test::EmptyLogger>(); - auto controller = base::MakeUnique<test::MockController>(); + auto config = std::make_unique<Configuration>(); + auto logger = std::make_unique<test::EmptyLogger>(); + auto controller = std::make_unique<test::MockController>(); controller_ = controller.get(); - service_ = base::MakeUnique<DownloadServiceImpl>( + service_ = std::make_unique<DownloadServiceImpl>( std::move(config), std::move(logger), std::move(controller)); }
diff --git a/components/download/internal/download_store.cc b/components/download/internal/download_store.cc index bf384ae6..b2398ef 100644 --- a/components/download/internal/download_store.cc +++ b/components/download/internal/download_store.cc
@@ -4,9 +4,10 @@ #include "components/download/internal/download_store.h" +#include <memory> + #include "base/bind.h" #include "base/callback_helpers.h" -#include "base/memory/ptr_util.h" #include "components/download/internal/entry.h" #include "components/download/internal/proto/entry.pb.h" #include "components/download/internal/proto_conversions.h" @@ -53,7 +54,7 @@ void DownloadStore::OnDatabaseInited(InitCallback callback, bool success) { if (!success) { - std::move(callback).Run(success, base::MakeUnique<std::vector<Entry>>()); + std::move(callback).Run(success, std::make_unique<std::vector<Entry>>()); return; } @@ -66,7 +67,7 @@ bool success, std::unique_ptr<ProtoEntryVector> protos) { if (!success) { - std::move(callback).Run(success, base::MakeUnique<std::vector<Entry>>()); + std::move(callback).Run(success, std::make_unique<std::vector<Entry>>()); return; } @@ -95,18 +96,18 @@ void DownloadStore::Update(const Entry& entry, StoreCallback callback) { DCHECK(IsInitialized()); - auto entries_to_save = base::MakeUnique<KeyProtoEntryVector>(); + auto entries_to_save = std::make_unique<KeyProtoEntryVector>(); protodb::Entry proto = ProtoConversions::EntryToProto(entry); entries_to_save->emplace_back(entry.guid, std::move(proto)); - db_->UpdateEntries(std::move(entries_to_save), base::MakeUnique<KeyVector>(), + db_->UpdateEntries(std::move(entries_to_save), std::make_unique<KeyVector>(), std::move(callback)); } void DownloadStore::Remove(const std::string& guid, StoreCallback callback) { DCHECK(IsInitialized()); - auto keys_to_remove = base::MakeUnique<KeyVector>(); + auto keys_to_remove = std::make_unique<KeyVector>(); keys_to_remove->push_back(guid); - db_->UpdateEntries(base::MakeUnique<KeyProtoEntryVector>(), + db_->UpdateEntries(std::make_unique<KeyProtoEntryVector>(), std::move(keys_to_remove), std::move(callback)); }
diff --git a/components/download/internal/download_store_unittest.cc b/components/download/internal/download_store_unittest.cc index 57b9997..40f61bb 100644 --- a/components/download/internal/download_store_unittest.cc +++ b/components/download/internal/download_store_unittest.cc
@@ -5,11 +5,11 @@ #include "components/download/internal/download_store.h" #include <algorithm> +#include <memory> #include "base/bind.h" #include "base/callback.h" #include "base/guid.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "components/download/internal/entry.h" #include "components/download/internal/proto/entry.pb.h" @@ -30,7 +30,7 @@ ~DownloadStoreTest() override = default; void CreateDatabase() { - auto db = base::MakeUnique<leveldb_proto::test::FakeDB<protodb::Entry>>( + auto db = std::make_unique<leveldb_proto::test::FakeDB<protodb::Entry>>( &db_entries_); db_ = db.get(); store_.reset(new DownloadStore( @@ -189,7 +189,7 @@ db_->UpdateCallback(true); // Query the database directly and check for the entry. - auto protos = base::MakeUnique<std::vector<protodb::Entry>>(); + auto protos = std::make_unique<std::vector<protodb::Entry>>(); db_->LoadEntries(base::Bind(&DownloadStoreTest::LoadCallback, base::Unretained(this), protos.get())); db_->LoadCallback(true); @@ -218,7 +218,7 @@ db_->UpdateCallback(true); // Query the database directly and check for the entry removed. - auto protos = base::MakeUnique<std::vector<protodb::Entry>>(); + auto protos = std::make_unique<std::vector<protodb::Entry>>(); db_->LoadEntries(base::Bind(&DownloadStoreTest::LoadCallback, base::Unretained(this), protos.get())); db_->LoadCallback(true); @@ -299,7 +299,7 @@ db_->UpdateCallback(true); // Query the database directly and check for the entry. - auto protos = base::MakeUnique<std::vector<protodb::Entry>>(); + auto protos = std::make_unique<std::vector<protodb::Entry>>(); db_->LoadEntries(base::Bind(&DownloadStoreTest::LoadCallback, base::Unretained(this), protos.get())); db_->LoadCallback(true);
diff --git a/components/download/internal/file_monitor_unittest.cc b/components/download/internal/file_monitor_unittest.cc index 1fb7be5..347d2d5 100644 --- a/components/download/internal/file_monitor_unittest.cc +++ b/components/download/internal/file_monitor_unittest.cc
@@ -9,7 +9,6 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/guid.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "base/test/test_simple_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -33,7 +32,7 @@ EXPECT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); download_dir_ = scoped_temp_dir_.GetPath(); base::TimeDelta keep_alive_time = base::TimeDelta::FromHours(12); - monitor_ = base::MakeUnique<FileMonitorImpl>(download_dir_, task_runner_, + monitor_ = std::make_unique<FileMonitorImpl>(download_dir_, task_runner_, keep_alive_time); } ~FileMonitorTest() override = default;
diff --git a/components/download/internal/model_impl.cc b/components/download/internal/model_impl.cc index 98e6696..2a36b25 100644 --- a/components/download/internal/model_impl.cc +++ b/components/download/internal/model_impl.cc
@@ -5,9 +5,9 @@ #include "components/download/internal/model_impl.h" #include <map> +#include <memory> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "base/trace_event/memory_usage_estimator.h" #include "components/download/internal/entry.h" #include "components/download/internal/stats.h" @@ -42,7 +42,7 @@ DCHECK(store_->IsInitialized()); DCHECK(entries_.find(entry.guid) == entries_.end()); - entries_.emplace(entry.guid, base::MakeUnique<Entry>(entry)); + entries_.emplace(entry.guid, std::make_unique<Entry>(entry)); store_->Update(entry, base::BindOnce(&ModelImpl::OnAddFinished, weak_ptr_factory_.GetWeakPtr(), @@ -102,7 +102,7 @@ std::map<Entry::State, uint32_t> entries_count; for (const auto& entry : *entries) { entries_count[entry.state]++; - entries_.emplace(entry.guid, base::MakeUnique<Entry>(entry)); + entries_.emplace(entry.guid, std::make_unique<Entry>(entry)); } stats::LogEntries(entries_count);
diff --git a/components/download/internal/model_impl_unittest.cc b/components/download/internal/model_impl_unittest.cc index 624715f7..3415869 100644 --- a/components/download/internal/model_impl_unittest.cc +++ b/components/download/internal/model_impl_unittest.cc
@@ -10,7 +10,6 @@ #include "base/bind.h" #include "base/guid.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/test/histogram_tester.h" #include "components/download/internal/entry.h" #include "components/download/internal/stats.h" @@ -35,9 +34,9 @@ ~DownloadServiceModelImplTest() override = default; void SetUp() override { - auto store = base::MakeUnique<test::TestStore>(); + auto store = std::make_unique<test::TestStore>(); store_ = store.get(); - model_ = base::MakeUnique<ModelImpl>(std::move(store)); + model_ = std::make_unique<ModelImpl>(std::move(store)); } protected: @@ -57,7 +56,7 @@ model_->Initialize(&client_); EXPECT_TRUE(store_->init_called()); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); } TEST_F(DownloadServiceModelImplTest, SuccessfulInitWithEntries) { @@ -71,7 +70,7 @@ model_->Initialize(&client_); EXPECT_TRUE(store_->init_called()); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid))); EXPECT_TRUE(test::CompareEntry(&entry2, model_->Get(entry2.guid))); @@ -94,7 +93,7 @@ model_->Initialize(&client_); EXPECT_TRUE(store_->init_called()); - store_->TriggerInit(false, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(false, std::make_unique<std::vector<Entry>>()); } TEST_F(DownloadServiceModelImplTest, HardRecoverGoodModel) { @@ -106,7 +105,7 @@ model_->Initialize(&client_); EXPECT_TRUE(store_->init_called()); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); EXPECT_CALL(client_, OnModelHardRecoverComplete(true)); @@ -120,7 +119,7 @@ model_->Initialize(&client_); EXPECT_TRUE(store_->init_called()); - store_->TriggerInit(false, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(false, std::make_unique<std::vector<Entry>>()); EXPECT_CALL(client_, OnModelHardRecoverComplete(true)); @@ -138,7 +137,7 @@ model_->Initialize(&client_); EXPECT_TRUE(store_->init_called()); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); EXPECT_CALL(client_, OnModelHardRecoverComplete(false)); @@ -152,7 +151,7 @@ model_->Initialize(&client_); EXPECT_TRUE(store_->init_called()); - store_->TriggerInit(false, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(false, std::make_unique<std::vector<Entry>>()); EXPECT_CALL(client_, OnModelHardRecoverComplete(false)); @@ -171,7 +170,7 @@ EXPECT_CALL(client_, OnItemAdded(false, entry2.client, entry2.guid)).Times(1); model_->Initialize(&client_); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); model_->Add(entry1); EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid))); @@ -205,7 +204,7 @@ .Times(1); model_->Initialize(&client_); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); std::vector<Entry*> entries_pointers = model_->PeekEntries(); // Update with a different object. @@ -243,7 +242,7 @@ .Times(1); model_->Initialize(&client_); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); model_->Remove(entry1.guid); EXPECT_EQ(entry1.guid, store_->LastRemovedEntry()); @@ -265,7 +264,7 @@ EXPECT_CALL(client_, OnModelReady(true)).Times(1); model_->Initialize(&client_); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); EXPECT_TRUE(test::CompareEntry(&entry, model_->Get(entry.guid))); EXPECT_EQ(nullptr, model_->Get(base::GenerateGUID())); @@ -280,7 +279,7 @@ EXPECT_CALL(client_, OnModelReady(true)).Times(1); model_->Initialize(&client_); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); std::vector<Entry*> expected_peek = {&entry1, &entry2}; @@ -296,7 +295,7 @@ EXPECT_CALL(client_, OnItemRemoved(true, entry.client, entry.guid)).Times(1); model_->Initialize(&client_); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>()); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>()); model_->Add(entry); EXPECT_TRUE(test::CompareEntry(&entry, model_->Get(entry.guid))); @@ -323,7 +322,7 @@ .Times(1); model_->Initialize(&client_); - store_->TriggerInit(true, base::MakeUnique<std::vector<Entry>>(entries)); + store_->TriggerInit(true, std::make_unique<std::vector<Entry>>(entries)); EXPECT_TRUE(test::CompareEntry(&entry1, model_->Get(entry1.guid))); model_->Update(entry2);
diff --git a/components/download/internal/navigation_monitor_impl_unittests.cc b/components/download/internal/navigation_monitor_impl_unittests.cc index d0c7e897..f007f5c 100644 --- a/components/download/internal/navigation_monitor_impl_unittests.cc +++ b/components/download/internal/navigation_monitor_impl_unittests.cc
@@ -6,7 +6,6 @@ #include "base/bind.h" #include "base/callback_helpers.h" -#include "base/memory/ptr_util.h" #include "base/memory/weak_ptr.h" #include "base/test/test_mock_time_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -61,8 +60,8 @@ ~NavigationMonitorImplTest() override = default; void SetUp() override { - navigation_monitor_ = base::MakeUnique<NavigationMonitorImpl>(); - observer_ = base::MakeUnique<TestNavigationMonitorObserver>( + navigation_monitor_ = std::make_unique<NavigationMonitorImpl>(); + observer_ = std::make_unique<TestNavigationMonitorObserver>( task_runner_, navigation_monitor_.get()); navigation_monitor_->Configure(base::TimeDelta::FromMilliseconds(20), base::TimeDelta::FromMilliseconds(200));
diff --git a/components/download/internal/proto_conversions.cc b/components/download/internal/proto_conversions.cc index ba4b5e4..3097474 100644 --- a/components/download/internal/proto_conversions.cc +++ b/components/download/internal/proto_conversions.cc
@@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include <utility> -#include "base/memory/ptr_util.h" #include "base/time/time.h" #include "components/download/internal/proto_conversions.h" #include "net/http/http_request_headers.h" @@ -312,7 +312,7 @@ std::unique_ptr<std::vector<Entry>> ProtoConversions::EntryVectorFromProto( std::unique_ptr<std::vector<protodb::Entry>> protos) { - auto entries = base::MakeUnique<std::vector<Entry>>(); + auto entries = std::make_unique<std::vector<Entry>>(); for (auto& proto : *protos) { entries->push_back(EntryFromProto(proto)); } @@ -323,7 +323,7 @@ std::unique_ptr<std::vector<protodb::Entry>> ProtoConversions::EntryVectorToProto( std::unique_ptr<std::vector<Entry>> entries) { - auto protos = base::MakeUnique<std::vector<protodb::Entry>>(); + auto protos = std::make_unique<std::vector<protodb::Entry>>(); for (auto& entry : *entries) { protos->push_back(EntryToProto(entry)); }
diff --git a/components/download/internal/proto_conversions_unittest.cc b/components/download/internal/proto_conversions_unittest.cc index 4ab2d3b..de3c6c31 100644 --- a/components/download/internal/proto_conversions_unittest.cc +++ b/components/download/internal/proto_conversions_unittest.cc
@@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include <utility> #include "base/guid.h" -#include "base/memory/ptr_util.h" #include "components/download/internal/entry.h" #include "components/download/internal/proto_conversions.h" #include "components/download/internal/test/entry_utils.h" @@ -149,7 +149,7 @@ base::Time::Now(), base::Time::Now(), base::Time::Now(), 1024u, 2, 8, 5)); auto actual = EntryVectorFromProto( - EntryVectorToProto(base::MakeUnique<std::vector<Entry>>(expected))); + EntryVectorToProto(std::make_unique<std::vector<Entry>>(expected))); EXPECT_TRUE(test::CompareEntryList(expected, *actual)); }
diff --git a/components/download/internal/scheduler/device_status_listener.cc b/components/download/internal/scheduler/device_status_listener.cc index 2133752..bc40f1b4 100644 --- a/components/download/internal/scheduler/device_status_listener.cc +++ b/components/download/internal/scheduler/device_status_listener.cc
@@ -4,7 +4,6 @@ #include "components/download/internal/scheduler/device_status_listener.h" -#include "base/memory/ptr_util.h" #include "base/power_monitor/power_monitor.h" #include "build/build_config.h" #include "components/download/internal/scheduler/network_status_listener.h" @@ -220,9 +219,9 @@ void DeviceStatusListener::BuildNetworkStatusListener() { #if defined(OS_ANDROID) - network_listener_ = base::MakeUnique<NetworkStatusListenerAndroid>(); + network_listener_ = std::make_unique<NetworkStatusListenerAndroid>(); #else - network_listener_ = base::MakeUnique<NetworkStatusListenerImpl>(); + network_listener_ = std::make_unique<NetworkStatusListenerImpl>(); #endif }
diff --git a/components/download/internal/scheduler/device_status_listener_unittest.cc b/components/download/internal/scheduler/device_status_listener_unittest.cc index 848ca69b..e0b6ce87 100644 --- a/components/download/internal/scheduler/device_status_listener_unittest.cc +++ b/components/download/internal/scheduler/device_status_listener_unittest.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/test/power_monitor_test_base.h" @@ -87,22 +86,22 @@ std::move(battery_listener)) {} void BuildNetworkStatusListener() override { - network_listener_ = base::MakeUnique<NetworkStatusListenerImpl>(); + network_listener_ = std::make_unique<NetworkStatusListenerImpl>(); } }; class DeviceStatusListenerTest : public testing::Test { public: void SetUp() override { - auto power_source = base::MakeUnique<base::PowerMonitorTestSource>(); + auto power_source = std::make_unique<base::PowerMonitorTestSource>(); power_source_ = power_source.get(); power_monitor_ = - base::MakeUnique<base::PowerMonitor>(std::move(power_source)); + std::make_unique<base::PowerMonitor>(std::move(power_source)); - auto battery_listener = base::MakeUnique<TestBatteryStatusListener>(); + auto battery_listener = std::make_unique<TestBatteryStatusListener>(); test_battery_listener_ = battery_listener.get(); listener_ = - base::MakeUnique<TestDeviceStatusListener>(std::move(battery_listener)); + std::make_unique<TestDeviceStatusListener>(std::move(battery_listener)); } void TearDown() override { listener_.reset(); }
diff --git a/components/download/internal/scheduler/scheduler_impl_unittest.cc b/components/download/internal/scheduler/scheduler_impl_unittest.cc index 982cdd6e..e564412 100644 --- a/components/download/internal/scheduler/scheduler_impl_unittest.cc +++ b/components/download/internal/scheduler/scheduler_impl_unittest.cc
@@ -6,7 +6,6 @@ #include <memory> -#include "base/memory/ptr_util.h" #include "base/strings/string_number_conversions.h" #include "components/download/internal/config.h" #include "components/download/internal/entry.h" @@ -40,7 +39,7 @@ void BuildScheduler(const std::vector<DownloadClient> clients) { scheduler_ = - base::MakeUnique<SchedulerImpl>(&task_scheduler_, &config_, clients); + std::make_unique<SchedulerImpl>(&task_scheduler_, &config_, clients); } void DestroyScheduler() { scheduler_.reset(); }
diff --git a/components/download/internal/test/noop_store.cc b/components/download/internal/test/noop_store.cc index 2f7a655..ff58e8e2 100644 --- a/components/download/internal/test/noop_store.cc +++ b/components/download/internal/test/noop_store.cc
@@ -4,6 +4,8 @@ #include "components/download/internal/test/noop_store.h" +#include <memory> + #include "base/bind.h" #include "base/threading/thread_task_runner_handle.h" #include "components/download/internal/entry.h" @@ -47,7 +49,7 @@ initialized_ = true; std::unique_ptr<std::vector<Entry>> entries = - base::MakeUnique<std::vector<Entry>>(); + std::make_unique<std::vector<Entry>>(); std::move(callback).Run(true /** success */, std::move(entries)); }
diff --git a/components/download/internal/test/test_device_status_listener.cc b/components/download/internal/test/test_device_status_listener.cc index 81c06fe6..5a6bc62 100644 --- a/components/download/internal/test/test_device_status_listener.cc +++ b/components/download/internal/test/test_device_status_listener.cc
@@ -4,6 +4,8 @@ #include "components/download/internal/test/test_device_status_listener.h" +#include <memory> + namespace download { namespace test { @@ -22,7 +24,7 @@ TestDeviceStatusListener::TestDeviceStatusListener() : DeviceStatusListener(base::TimeDelta(), /* startup_delay */ base::TimeDelta(), /* online_delay */ - base::MakeUnique<FakeBatteryStatusListener>()), + std::make_unique<FakeBatteryStatusListener>()), weak_ptr_factory_(this) {} TestDeviceStatusListener::~TestDeviceStatusListener() {
diff --git a/components/download/internal/test/test_store.cc b/components/download/internal/test/test_store.cc index eacc8be..8a2c3b8 100644 --- a/components/download/internal/test/test_store.cc +++ b/components/download/internal/test/test_store.cc
@@ -4,7 +4,8 @@ #include "components/download/internal/test/test_store.h" -#include "base/memory/ptr_util.h" +#include <memory> + #include "components/download/internal/entry.h" namespace download { @@ -24,7 +25,7 @@ if (automatic_callback_response_.has_value()) TriggerInit(automatic_callback_response_.value(), - base::MakeUnique<std::vector<Entry>>()); + std::make_unique<std::vector<Entry>>()); } void TestStore::HardRecover(StoreCallback callback) {
diff --git a/components/download/public/test/test_download_service.cc b/components/download/public/test/test_download_service.cc index 20d17c6..e143e38 100644 --- a/components/download/public/test/test_download_service.cc +++ b/components/download/public/test/test_download_service.cc
@@ -4,6 +4,8 @@ #include "components/download/public/test/test_download_service.h" +#include <memory> + #include "base/bind.h" #include "base/threading/thread_task_runner_handle.h" #include "components/download/public/client.h" @@ -40,8 +42,8 @@ } // namespace TestDownloadService::TestDownloadService() - : service_config_(base::MakeUnique<TestServiceConfig>()), - logger_(base::MakeUnique<EmptyLogger>()), + : service_config_(std::make_unique<TestServiceConfig>()), + logger_(std::make_unique<EmptyLogger>()), is_ready_(false), fail_at_start_(false), file_size_(123456789u),
diff --git a/components/exo/client_controlled_shell_surface_unittest.cc b/components/exo/client_controlled_shell_surface_unittest.cc index 7a1d2fe..95a90203 100644 --- a/components/exo/client_controlled_shell_surface_unittest.cc +++ b/components/exo/client_controlled_shell_surface_unittest.cc
@@ -7,7 +7,6 @@ #include "ash/public/cpp/window_properties.h" #include "ash/public/interfaces/window_pin_type.mojom.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/shell_test_api.h" #include "ash/system/tray/system_tray.h" #include "ash/wm/tablet_mode/tablet_mode_controller.h" @@ -132,7 +131,7 @@ shell_surface->SetSystemModal(true); surface->Commit(); - EXPECT_TRUE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_TRUE(shell_surface->GetWidget()->IsActive()); } @@ -147,7 +146,7 @@ surface->SetInputRegion(cc::Region()); surface->Commit(); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(shell_surface->GetWidget()->IsActive()); // Creating a surface without input region should not make it modal. @@ -162,31 +161,31 @@ surface->SetSubSurfacePosition(child.get(), gfx::Point(10, 10)); child->Commit(); surface->Commit(); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(shell_surface->GetWidget()->IsActive()); // Making the surface opaque shouldn't make it modal either. child->SetBlendMode(SkBlendMode::kSrc); child->Commit(); surface->Commit(); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(shell_surface->GetWidget()->IsActive()); // Setting input regions won't make it modal either. surface->SetInputRegion(gfx::Rect(10, 10, 100, 100)); surface->Commit(); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(shell_surface->GetWidget()->IsActive()); // Only SetSystemModal changes modality. shell_surface->SetSystemModal(true); - EXPECT_TRUE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_TRUE(shell_surface->GetWidget()->IsActive()); shell_surface->SetSystemModal(false); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_FALSE(shell_surface->GetWidget()->IsActive()); // If the non modal system window was active, @@ -194,11 +193,11 @@ EXPECT_TRUE(shell_surface->GetWidget()->IsActive()); shell_surface->SetSystemModal(true); - EXPECT_TRUE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_TRUE(shell_surface->GetWidget()->IsActive()); shell_surface->SetSystemModal(false); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_TRUE(shell_surface->GetWidget()->IsActive()); } @@ -222,12 +221,12 @@ // It is expected that modal window is shown. EXPECT_TRUE(shell_surface->GetWidget()); - EXPECT_TRUE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(ash::Shell::IsSystemModalWindowOpen()); // Now widget is created and setting modal state should be applied // immediately. shell_surface->SetSystemModal(false); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); } TEST_F(ClientControlledShellSurfaceTest, SurfaceShadow) {
diff --git a/components/exo/keyboard.cc b/components/exo/keyboard.cc index 5866b317..f5a9f9e 100644 --- a/components/exo/keyboard.cc +++ b/components/exo/keyboard.cc
@@ -184,7 +184,7 @@ } void Keyboard::RemoveObserver(KeyboardObserver* observer) { - observer_list_.HasObserver(observer); + observer_list_.RemoveObserver(observer); } void Keyboard::SetNeedKeyboardKeyAcks(bool need_acks) {
diff --git a/components/exo/keyboard_unittest.cc b/components/exo/keyboard_unittest.cc index ccf6f9173..7948ca0 100644 --- a/components/exo/keyboard_unittest.cc +++ b/components/exo/keyboard_unittest.cc
@@ -275,25 +275,23 @@ } TEST_F(KeyboardTest, KeyboardObserver) { - std::unique_ptr<Surface> surface(new Surface); - std::unique_ptr<ShellSurface> shell_surface(new ShellSurface(surface.get())); - gfx::Size buffer_size(10, 10); - std::unique_ptr<Buffer> buffer( - new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size))); - surface->Attach(buffer.get()); - surface->Commit(); - - aura::client::FocusClient* focus_client = - aura::client::GetFocusClient(ash::Shell::GetPrimaryRootWindow()); - focus_client->FocusWindow(nullptr); - MockKeyboardDelegate delegate; Seat seat; auto keyboard = std::make_unique<Keyboard>(&delegate, &seat); - MockKeyboardObserver observer; - keyboard->AddObserver(&observer); + MockKeyboardObserver observer1; + MockKeyboardObserver observer2; - EXPECT_CALL(observer, OnKeyboardDestroying(keyboard.get())); + keyboard->AddObserver(&observer1); + keyboard->AddObserver(&observer2); + EXPECT_TRUE(keyboard->HasObserver(&observer1)); + EXPECT_TRUE(keyboard->HasObserver(&observer2)); + + keyboard->RemoveObserver(&observer1); + EXPECT_FALSE(keyboard->HasObserver(&observer1)); + EXPECT_TRUE(keyboard->HasObserver(&observer2)); + + EXPECT_CALL(observer1, OnKeyboardDestroying(keyboard.get())).Times(0); + EXPECT_CALL(observer2, OnKeyboardDestroying(keyboard.get())); keyboard.reset(); }
diff --git a/components/exo/pointer_unittest.cc b/components/exo/pointer_unittest.cc index 67a896f..5b81adc 100644 --- a/components/exo/pointer_unittest.cc +++ b/components/exo/pointer_unittest.cc
@@ -6,7 +6,6 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/wm/window_positioning_utils.h" #include "components/exo/buffer.h" #include "components/exo/pointer_delegate.h" @@ -347,7 +346,7 @@ // Make the window modal. shell_surface2->SetSystemModal(true); - EXPECT_TRUE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_CALL(delegate, OnPointerFrame()).Times(testing::AnyNumber()); EXPECT_CALL(delegate, CanAcceptPointerEventsForSurface(surface.get())) @@ -434,7 +433,7 @@ // Make the window non-modal. shell_surface2->SetSystemModal(false); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); // Check if pointer events on non-modal window are registered. {
diff --git a/components/exo/touch_unittest.cc b/components/exo/touch_unittest.cc index 8d5cf6f..95411fad8 100644 --- a/components/exo/touch_unittest.cc +++ b/components/exo/touch_unittest.cc
@@ -6,7 +6,6 @@ #include "ash/public/cpp/shell_window_ids.h" #include "ash/shell.h" -#include "ash/shell_port.h" #include "ash/wm/window_positioner.h" #include "ash/wm/window_positioning_utils.h" #include "components/exo/buffer.h" @@ -230,7 +229,7 @@ // Make the window modal. modal.shell_surface()->SetSystemModal(true); - EXPECT_TRUE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_TRUE(ash::Shell::IsSystemModalWindowOpen()); EXPECT_CALL(delegate, OnTouchShape(testing::_, testing::_, testing::_)) .Times(testing::AnyNumber()); EXPECT_CALL(delegate, CanAcceptTouchEventsForSurface(window.surface())) @@ -270,7 +269,7 @@ // Make the window non-modal. modal.shell_surface()->SetSystemModal(false); - EXPECT_FALSE(ash::ShellPort::Get()->IsSystemModalWindowOpen()); + EXPECT_FALSE(ash::Shell::IsSystemModalWindowOpen()); // Check if touch events on non-modal window are registered. {
diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc index b9e87bd..1e7cd5b 100644 --- a/components/favicon/core/favicon_handler.cc +++ b/components/favicon/core/favicon_handler.cc
@@ -28,12 +28,7 @@ namespace favicon { namespace { -const int kNonTouchLargestIconSize = 192; - -// Size (along each axis) of a touch icon. This currently corresponds to -// the apple touch icon for iPad. -// TODO(crbug.com/736290): Consider changing this to 192x192 for Android. -const int kTouchIconSize = 144; +const int kLargestIconSize = 192; // Return true if |bitmap_result| is expired. bool IsExpired(const favicon_base::FaviconRawBitmapResult& bitmap_result) { @@ -96,12 +91,7 @@ } std::vector<int> GetDesiredPixelSizes( - FaviconDriverObserver::NotificationIconType handler_type, - bool candidates_from_web_manifest) { - // When reading icons from web manifests, prefer kNonTouchLargestIconSize. - if (candidates_from_web_manifest) - return std::vector<int>(1U, kNonTouchLargestIconSize); - + FaviconDriverObserver::NotificationIconType handler_type) { switch (handler_type) { case FaviconDriverObserver::NON_TOUCH_16_DIP: { std::vector<int> pixel_sizes; @@ -112,9 +102,8 @@ return pixel_sizes; } case FaviconDriverObserver::NON_TOUCH_LARGEST: - return std::vector<int>(1U, kNonTouchLargestIconSize); case FaviconDriverObserver::TOUCH_LARGEST: - return std::vector<int>(1U, kTouchIconSize); + return std::vector<int>(1U, kLargestIconSize); } NOTREACHED(); return std::vector<int>(); @@ -273,8 +262,7 @@ // The order of these conditions is important because we want the feature // state to be checked at the very end. if (!error_other_than_404_found_ && - notification_icon_type_ != favicon_base::IconType::kInvalid && - base::FeatureList::IsEnabled(kAllowDeletionOfFaviconMappings)) { + notification_icon_type_ != favicon_base::IconType::kInvalid) { if (!delegate_->IsOffTheRecord()) service_->DeleteFaviconMappings(page_urls_, notification_icon_type_); @@ -424,7 +412,7 @@ void FaviconHandler::OnGotFinalIconURLCandidates( const std::vector<FaviconURL>& candidates) { const std::vector<int> desired_pixel_sizes = - GetDesiredPixelSizes(handler_type_, !manifest_url_.is_empty()); + GetDesiredPixelSizes(handler_type_); std::vector<FaviconCandidate> sorted_candidates; for (const FaviconURL& candidate : candidates) { @@ -449,8 +437,7 @@ FaviconDriverObserver::NotificationIconType handler_type, bool candidates_from_web_manifest) { int max_size = 0; - for (int size : - GetDesiredPixelSizes(handler_type, candidates_from_web_manifest)) { + for (int size : GetDesiredPixelSizes(handler_type)) { max_size = std::max(max_size, size); } return max_size; @@ -507,10 +494,9 @@ gfx::ImageSkia image_skia; if (download_largest_icon_) { std::vector<size_t> best_indices; - SelectFaviconFrameIndices( - original_bitmap_sizes, - GetDesiredPixelSizes(handler_type_, !manifest_url_.is_empty()), - &best_indices, &score); + SelectFaviconFrameIndices(original_bitmap_sizes, + GetDesiredPixelSizes(handler_type_), + &best_indices, &score); DCHECK_EQ(1U, best_indices.size()); image_skia = gfx::ImageSkia::CreateFrom1xBitmap(bitmaps[best_indices.front()]);
diff --git a/components/favicon/core/favicon_handler_unittest.cc b/components/favicon/core/favicon_handler_unittest.cc index ad0e293..a1c2306 100644 --- a/components/favicon/core/favicon_handler_unittest.cc +++ b/components/favicon/core/favicon_handler_unittest.cc
@@ -684,22 +684,6 @@ RunHandlerWithSimpleFaviconCandidates({kIconURL}); } -// Test that favicon mappings are not deleted if the feature is disabled. -TEST_F(FaviconHandlerTest, DoDeleteFaviconMappingsIfFeatureDisabled) { - base::test::ScopedFeatureList override_features; - override_features.InitAndDisableFeature(kAllowDeletionOfFaviconMappings); - - const GURL kIconURL("http://www.google.com/favicon"); - - favicon_service_.fake()->Store(kPageURL, kIconURL, - CreateRawBitmapResult(kIconURL)); - - EXPECT_CALL(favicon_service_, DeleteFaviconMappings(_, _)).Times(0); - EXPECT_CALL(delegate_, OnFaviconDeleted(_, _)).Times(0); - - RunHandlerWithSimpleFaviconCandidates(URLVector()); -} - // Test that favicon mappings are deleted for a page in history, when all icons // listed in the page return a 404. TEST_F(FaviconHandlerTest, DeleteFaviconMappingsDueTo404) { @@ -1540,6 +1524,27 @@ kIconURLWithoutSize1, kIconURLWithoutSize2)); } +TEST_F(FaviconHandlerTest, TestSortTouchIconLargest) { + const GURL kIconURLWithoutSize("http://www.google.com/touchicon-nosize"); + const GURL kIconURL144x144("http://www.google.com/touchicon144x144"); + const GURL kIconURL192x192("http://www.google.com/touchicon192x192"); + + const std::vector<favicon::FaviconURL> kSourceIconURLs{ + FaviconURL(kIconURLWithoutSize, kTouchIcon, kEmptySizes), + FaviconURL(kIconURL144x144, kTouchIcon, + SizeVector(1U, gfx::Size(144, 144))), + FaviconURL(kIconURL192x192, kTouchIcon, + SizeVector(1U, gfx::Size(192, 192))), + }; + + std::unique_ptr<FaviconHandler> handler = RunHandlerWithCandidates( + FaviconDriverObserver::TOUCH_LARGEST, kSourceIconURLs); + + EXPECT_THAT( + handler->GetIconURLs(), + ElementsAre(kIconURL192x192, kIconURL144x144, kIconURLWithoutSize)); +} + TEST_F(FaviconHandlerTest, TestDownloadLargestFavicon) { // Names represent the bitmap sizes per icon. const GURL kIconURL1024_512("http://www.google.com/a");
diff --git a/components/favicon/core/features.cc b/components/favicon/core/features.cc index 3a636aee..8562a1e6 100644 --- a/components/favicon/core/features.cc +++ b/components/favicon/core/features.cc
@@ -11,7 +11,4 @@ const base::Feature kAllowPropagationOfFaviconCacheHits{ "kAllowPropagationOfFaviconCacheHits", base::FEATURE_ENABLED_BY_DEFAULT}; -const base::Feature kAllowDeletionOfFaviconMappings{ - "AllowDeletionOfFaviconMappings", base::FEATURE_ENABLED_BY_DEFAULT}; - } // namespace favicon
diff --git a/components/favicon/core/features.h b/components/favicon/core/features.h index 959211f..0f85d31c 100644 --- a/components/favicon/core/features.h +++ b/components/favicon/core/features.h
@@ -12,7 +12,6 @@ namespace favicon { extern const base::Feature kAllowPropagationOfFaviconCacheHits; -extern const base::Feature kAllowDeletionOfFaviconMappings; } // namespace favicon
diff --git a/components/feature_engagement/internal/availability_model_impl_unittest.cc b/components/feature_engagement/internal/availability_model_impl_unittest.cc index 6c19fee..40bcad5 100644 --- a/components/feature_engagement/internal/availability_model_impl_unittest.cc +++ b/components/feature_engagement/internal/availability_model_impl_unittest.cc
@@ -11,7 +11,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "components/feature_engagement/internal/persistent_availability_store.h" #include "testing/gtest/include/gtest/gtest.h" @@ -46,7 +45,7 @@ base::Unretained(this), success, std::move(store_content)); availability_model_ = - base::MakeUnique<AvailabilityModelImpl>(std::move(store_loader)); + std::make_unique<AvailabilityModelImpl>(std::move(store_loader)); } void OnInitialized(bool success) { success_ = success; } @@ -74,7 +73,7 @@ } // namespace TEST_F(AvailabilityModelImplTest, InitializationSuccess) { - SetUpModel(true, base::MakeUnique<std::map<std::string, uint32_t>>()); + SetUpModel(true, std::make_unique<std::map<std::string, uint32_t>>()); EXPECT_FALSE(availability_model_->IsReady()); availability_model_->Initialize(std::move(initialized_callback_), 14u); EXPECT_TRUE(availability_model_->IsReady()); @@ -84,7 +83,7 @@ } TEST_F(AvailabilityModelImplTest, InitializationFailed) { - SetUpModel(false, base::MakeUnique<std::map<std::string, uint32_t>>()); + SetUpModel(false, std::make_unique<std::map<std::string, uint32_t>>()); EXPECT_FALSE(availability_model_->IsReady()); availability_model_->Initialize(std::move(initialized_callback_), 14u); EXPECT_FALSE(availability_model_->IsReady()); @@ -94,7 +93,7 @@ } TEST_F(AvailabilityModelImplTest, SuccessfullyLoadThreeFeatures) { - auto availabilities = base::MakeUnique<std::map<std::string, uint32_t>>(); + auto availabilities = std::make_unique<std::map<std::string, uint32_t>>(); availabilities->insert(std::make_pair(kTestFeatureFoo.name, 100u)); availabilities->insert(std::make_pair(kTestFeatureBar.name, 200u)); availabilities->insert(std::make_pair(kTestFeatureNop.name, 300u)); @@ -111,7 +110,7 @@ } TEST_F(AvailabilityModelImplTest, FailToLoadThreeFeatures) { - auto availabilities = base::MakeUnique<std::map<std::string, uint32_t>>(); + auto availabilities = std::make_unique<std::map<std::string, uint32_t>>(); availabilities->insert(std::make_pair(kTestFeatureFoo.name, 100u)); availabilities->insert(std::make_pair(kTestFeatureBar.name, 200u)); availabilities->insert(std::make_pair(kTestFeatureNop.name, 300u));
diff --git a/components/feature_engagement/internal/event_model_impl_unittest.cc b/components/feature_engagement/internal/event_model_impl_unittest.cc index 818dd48..82226de 100644 --- a/components/feature_engagement/internal/event_model_impl_unittest.cc +++ b/components/feature_engagement/internal/event_model_impl_unittest.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/feature_list.h" -#include "base/memory/ptr_util.h" #include "base/test/test_simple_task_runner.h" #include "base/threading/thread_task_runner_handle.h" #include "components/feature_engagement/internal/editable_configuration.h" @@ -102,7 +101,7 @@ // Creates a TestInMemoryEventStore containing three hard coded events. std::unique_ptr<TestInMemoryEventStore> CreatePrefilledStore() { std::unique_ptr<std::vector<Event>> events = - base::MakeUnique<std::vector<Event>>(); + std::make_unique<std::vector<Event>>(); Event foo; foo.set_name("foo"); @@ -123,7 +122,7 @@ test::SetEventCountForDay(&qux, 3, 2); events->push_back(qux); - return base::MakeUnique<TestInMemoryEventStore>(std::move(events), true); + return std::make_unique<TestInMemoryEventStore>(std::move(events), true); } class EventModelImplTest : public ::testing::Test { @@ -138,7 +137,7 @@ std::unique_ptr<TestInMemoryEventStore> store = CreateStore(); store_ = store.get(); - auto storage_validator = base::MakeUnique<TestEventStorageValidator>(); + auto storage_validator = std::make_unique<TestEventStorageValidator>(); storage_validator_ = storage_validator.get(); model_.reset( @@ -175,8 +174,8 @@ LoadFailingEventModelImplTest() : EventModelImplTest() {} std::unique_ptr<TestInMemoryEventStore> CreateStore() override { - return base::MakeUnique<TestInMemoryEventStore>( - base::MakeUnique<std::vector<Event>>(), false); + return std::make_unique<TestInMemoryEventStore>( + std::make_unique<std::vector<Event>>(), false); } };
diff --git a/components/feature_engagement/internal/in_memory_event_store.cc b/components/feature_engagement/internal/in_memory_event_store.cc index a19b4107..140d6ea5 100644 --- a/components/feature_engagement/internal/in_memory_event_store.cc +++ b/components/feature_engagement/internal/in_memory_event_store.cc
@@ -4,11 +4,11 @@ #include "components/feature_engagement/internal/in_memory_event_store.h" +#include <memory> #include <vector> #include "base/bind.h" #include "base/feature_list.h" -#include "base/memory/ptr_util.h" #include "base/sequenced_task_runner.h" #include "base/single_thread_task_runner.h" #include "base/threading/thread_task_runner_handle.h" @@ -21,7 +21,7 @@ : EventStore(), events_(std::move(events)), ready_(false) {} InMemoryEventStore::InMemoryEventStore() - : InMemoryEventStore(base::MakeUnique<std::vector<Event>>()) {} + : InMemoryEventStore(std::make_unique<std::vector<Event>>()) {} InMemoryEventStore::~InMemoryEventStore() = default;
diff --git a/components/feature_engagement/internal/in_memory_event_store_unittest.cc b/components/feature_engagement/internal/in_memory_event_store_unittest.cc index e3c48510..930084f2 100644 --- a/components/feature_engagement/internal/in_memory_event_store_unittest.cc +++ b/components/feature_engagement/internal/in_memory_event_store_unittest.cc
@@ -10,7 +10,6 @@ #include "base/bind.h" #include "base/callback.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "testing/gtest/include/gtest/gtest.h" @@ -40,7 +39,7 @@ TEST_F(InMemoryEventStoreTest, LoadShouldProvideEventsAsCallback) { std::unique_ptr<std::vector<Event>> events = - base::MakeUnique<std::vector<Event>>(); + std::make_unique<std::vector<Event>>(); Event foo; Event bar; events->push_back(foo);
diff --git a/components/feature_engagement/internal/init_aware_event_model_unittest.cc b/components/feature_engagement/internal/init_aware_event_model_unittest.cc index b312958..2cfc488 100644 --- a/components/feature_engagement/internal/init_aware_event_model_unittest.cc +++ b/components/feature_engagement/internal/init_aware_event_model_unittest.cc
@@ -8,7 +8,6 @@ #include "base/bind.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "components/feature_engagement/internal/proto/event.pb.h" #include "components/feature_engagement/internal/test/event_util.h" @@ -50,9 +49,9 @@ ~InitAwareEventModelTest() override = default; void SetUp() override { - auto mocked_model = base::MakeUnique<MockEventModel>(); + auto mocked_model = std::make_unique<MockEventModel>(); mocked_model_ = mocked_model.get(); - model_ = base::MakeUnique<InitAwareEventModel>(std::move(mocked_model)); + model_ = std::make_unique<InitAwareEventModel>(std::move(mocked_model)); } protected:
diff --git a/components/feature_engagement/internal/persistent_availability_store.cc b/components/feature_engagement/internal/persistent_availability_store.cc index e4ff31a3..76ab5d73 100644 --- a/components/feature_engagement/internal/persistent_availability_store.cc +++ b/components/feature_engagement/internal/persistent_availability_store.cc
@@ -12,7 +12,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/feature_list.h" -#include "base/memory/ptr_util.h" #include "components/feature_engagement/internal/proto/availability.pb.h" #include "components/feature_engagement/internal/stats.h" #include "components/feature_engagement/public/feature_list.h" @@ -48,7 +47,7 @@ stats::RecordAvailabilityDbLoadEvent(success); if (!success) { std::move(on_loaded_callback) - .Run(false, base::MakeUnique<std::map<std::string, uint32_t>>()); + .Run(false, std::make_unique<std::map<std::string, uint32_t>>()); return; } @@ -61,8 +60,8 @@ // Find all availabilities from DB and find out what should be deleted. auto feature_availabilities = - base::MakeUnique<std::map<std::string, uint32_t>>(); - auto deletes = base::MakeUnique<std::vector<std::string>>(); + std::make_unique<std::map<std::string, uint32_t>>(); + auto deletes = std::make_unique<std::vector<std::string>>(); for (auto& availability : *availabilities) { // Check if in |feature_filter|. if (feature_mapping.find(availability.feature_name()) == @@ -86,7 +85,7 @@ } // Find features from |feature_filter| that are enabled, but not in DB yet. - auto additions = base::MakeUnique<KeyAvailabilityList>(); + auto additions = std::make_unique<KeyAvailabilityList>(); for (const base::Feature* feature : feature_filter) { // Check if already in DB. if (feature_availabilities->find(feature->name) != @@ -129,7 +128,7 @@ if (!success) { std::move(on_loaded_callback) - .Run(false, base::MakeUnique<std::map<std::string, uint32_t>>()); + .Run(false, std::make_unique<std::map<std::string, uint32_t>>()); return; }
diff --git a/components/feature_engagement/internal/persistent_availability_store_unittest.cc b/components/feature_engagement/internal/persistent_availability_store_unittest.cc index 8e204e9..85b21ac 100644 --- a/components/feature_engagement/internal/persistent_availability_store_unittest.cc +++ b/components/feature_engagement/internal/persistent_availability_store_unittest.cc
@@ -15,7 +15,6 @@ #include "base/bind.h" #include "base/callback.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "base/test/scoped_feature_list.h" #include "components/feature_engagement/internal/proto/availability.pb.h" @@ -56,7 +55,7 @@ // Creates a DB and stores off a pointer to it as a member. std::unique_ptr<leveldb_proto::test::FakeDB<Availability>> CreateDB() { - auto db = base::MakeUnique<leveldb_proto::test::FakeDB<Availability>>( + auto db = std::make_unique<leveldb_proto::test::FakeDB<Availability>>( &db_availabilities_); db_ = db.get(); return db;
diff --git a/components/feature_engagement/internal/persistent_event_store.cc b/components/feature_engagement/internal/persistent_event_store.cc index 8369c50..fea509b 100644 --- a/components/feature_engagement/internal/persistent_event_store.cc +++ b/components/feature_engagement/internal/persistent_event_store.cc
@@ -7,7 +7,6 @@ #include <vector> #include "base/bind.h" -#include "base/memory/ptr_util.h" #include "components/feature_engagement/internal/stats.h" namespace feature_engagement { @@ -50,20 +49,20 @@ void PersistentEventStore::WriteEvent(const Event& event) { DCHECK(IsReady()); - std::unique_ptr<KeyEventList> entries = base::MakeUnique<KeyEventList>(); + std::unique_ptr<KeyEventList> entries = std::make_unique<KeyEventList>(); entries->push_back(KeyEventPair(event.name(), event)); db_->UpdateEntries(std::move(entries), - base::MakeUnique<std::vector<std::string>>(), + std::make_unique<std::vector<std::string>>(), base::Bind(&NoopUpdateCallback)); } void PersistentEventStore::DeleteEvent(const std::string& event_name) { DCHECK(IsReady()); - auto deletes = base::MakeUnique<std::vector<std::string>>(); + auto deletes = std::make_unique<std::vector<std::string>>(); deletes->push_back(event_name); - db_->UpdateEntries(base::MakeUnique<KeyEventList>(), std::move(deletes), + db_->UpdateEntries(std::make_unique<KeyEventList>(), std::move(deletes), base::Bind(&NoopUpdateCallback)); } @@ -72,7 +71,7 @@ stats::RecordDbInitEvent(success, stats::StoreType::EVENTS_STORE); if (!success) { - callback.Run(false, base::MakeUnique<std::vector<Event>>()); + callback.Run(false, std::make_unique<std::vector<Event>>()); return; }
diff --git a/components/feature_engagement/internal/persistent_event_store_unittest.cc b/components/feature_engagement/internal/persistent_event_store_unittest.cc index 46e48cd..c2b11ac 100644 --- a/components/feature_engagement/internal/persistent_event_store_unittest.cc +++ b/components/feature_engagement/internal/persistent_event_store_unittest.cc
@@ -7,7 +7,6 @@ #include <map> #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" #include "base/test/histogram_tester.h" #include "components/feature_engagement/internal/proto/event.pb.h" @@ -52,7 +51,7 @@ DCHECK(!db_); DCHECK(!store_); - auto db = base::MakeUnique<leveldb_proto::test::FakeDB<Event>>(&db_events_); + auto db = std::make_unique<leveldb_proto::test::FakeDB<Event>>(&db_events_); db_ = db.get(); store_.reset(new PersistentEventStore(storage_dir_, std::move(db))); }
diff --git a/components/feature_engagement/internal/tracker_impl.cc b/components/feature_engagement/internal/tracker_impl.cc index 4d3d838..971c7b5 100644 --- a/components/feature_engagement/internal/tracker_impl.cc +++ b/components/feature_engagement/internal/tracker_impl.cc
@@ -11,7 +11,6 @@ #include "base/feature_list.h" #include "base/files/file_path.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/metrics/field_trial_params.h" #include "base/metrics/user_metrics.h" #include "base/threading/thread_task_runner_handle.h" @@ -54,7 +53,7 @@ DVLOG(2) << "Enabling demo mode. Chosen feature: " << chosen_feature_name; std::unique_ptr<EditableConfiguration> configuration = - base::MakeUnique<EditableConfiguration>(); + std::make_unique<EditableConfiguration>(); // Create valid configurations for all features to ensure that the // OnceConditionValidator acknowledges that thet meet conditions once. @@ -72,16 +71,16 @@ configuration->SetConfiguration(feature, feature_config); } - auto raw_event_model = base::MakeUnique<EventModelImpl>( - base::MakeUnique<InMemoryEventStore>(), - base::MakeUnique<NeverEventStorageValidator>()); + auto raw_event_model = std::make_unique<EventModelImpl>( + std::make_unique<InMemoryEventStore>(), + std::make_unique<NeverEventStorageValidator>()); - return base::MakeUnique<TrackerImpl>( - base::MakeUnique<InitAwareEventModel>(std::move(raw_event_model)), - base::MakeUnique<NeverAvailabilityModel>(), std::move(configuration), + return std::make_unique<TrackerImpl>( + std::make_unique<InitAwareEventModel>(std::move(raw_event_model)), + std::make_unique<NeverAvailabilityModel>(), std::move(configuration), std::make_unique<NoopDisplayLockController>(), - base::MakeUnique<OnceConditionValidator>(), - base::MakeUnique<SystemTimeProvider>()); + std::make_unique<OnceConditionValidator>(), + std::make_unique<SystemTimeProvider>()); } } // namespace @@ -98,39 +97,39 @@ return CreateDemoModeTracker().release(); std::unique_ptr<leveldb_proto::ProtoDatabase<Event>> event_db = - base::MakeUnique<leveldb_proto::ProtoDatabaseImpl<Event>>( + std::make_unique<leveldb_proto::ProtoDatabaseImpl<Event>>( background_task_runner); base::FilePath event_storage_dir = storage_dir.Append(kEventDBStorageDir); - auto event_store = base::MakeUnique<PersistentEventStore>( + auto event_store = std::make_unique<PersistentEventStore>( event_storage_dir, std::move(event_db)); - auto configuration = base::MakeUnique<ChromeVariationsConfiguration>(); + auto configuration = std::make_unique<ChromeVariationsConfiguration>(); configuration->ParseFeatureConfigs(GetAllFeatures()); auto event_storage_validator = - base::MakeUnique<FeatureConfigEventStorageValidator>(); + std::make_unique<FeatureConfigEventStorageValidator>(); event_storage_validator->InitializeFeatures(GetAllFeatures(), *configuration); - auto raw_event_model = base::MakeUnique<EventModelImpl>( + auto raw_event_model = std::make_unique<EventModelImpl>( std::move(event_store), std::move(event_storage_validator)); auto event_model = - base::MakeUnique<InitAwareEventModel>(std::move(raw_event_model)); + std::make_unique<InitAwareEventModel>(std::move(raw_event_model)); auto condition_validator = - base::MakeUnique<FeatureConfigConditionValidator>(); - auto time_provider = base::MakeUnique<SystemTimeProvider>(); + std::make_unique<FeatureConfigConditionValidator>(); + auto time_provider = std::make_unique<SystemTimeProvider>(); base::FilePath availability_storage_dir = storage_dir.Append(kAvailabilityDBStorageDir); auto availability_db = - base::MakeUnique<leveldb_proto::ProtoDatabaseImpl<Availability>>( + std::make_unique<leveldb_proto::ProtoDatabaseImpl<Availability>>( background_task_runner); auto availability_store_loader = base::BindOnce( &PersistentAvailabilityStore::LoadAndUpdateStore, availability_storage_dir, std::move(availability_db), GetAllFeatures()); - auto availability_model = base::MakeUnique<AvailabilityModelImpl>( + auto availability_model = std::make_unique<AvailabilityModelImpl>( std::move(availability_store_loader)); return new TrackerImpl(
diff --git a/components/feature_engagement/internal/tracker_impl_unittest.cc b/components/feature_engagement/internal/tracker_impl_unittest.cc index 07c4ade..2de8962 100644 --- a/components/feature_engagement/internal/tracker_impl_unittest.cc +++ b/components/feature_engagement/internal/tracker_impl_unittest.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/feature_list.h" -#include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/sequenced_task_runner.h" @@ -191,7 +190,7 @@ void SetUp() override { std::unique_ptr<EditableConfiguration> configuration = - base::MakeUnique<EditableConfiguration>(); + std::make_unique<EditableConfiguration>(); configuration_ = configuration.get(); RegisterFeatureConfig(configuration.get(), kTestFeatureFoo, @@ -206,11 +205,11 @@ std::unique_ptr<TestInMemoryEventStore> event_store = CreateEventStore(); event_store_ = event_store.get(); - auto event_model = base::MakeUnique<EventModelImpl>( + auto event_model = std::make_unique<EventModelImpl>( std::move(event_store), - base::MakeUnique<StoreEverythingEventStorageValidator>()); + std::make_unique<StoreEverythingEventStorageValidator>()); - auto availability_model = base::MakeUnique<TestAvailabilityModel>(); + auto availability_model = std::make_unique<TestAvailabilityModel>(); availability_model_ = availability_model.get(); availability_model_->SetIsReady(ShouldAvailabilityStoreBeReady()); @@ -221,8 +220,8 @@ tracker_.reset(new TrackerImpl( std::move(event_model), std::move(availability_model), std::move(configuration), std::move(display_lock_controller), - base::MakeUnique<OnceConditionValidator>(), - base::MakeUnique<TestTimeProvider>())); + std::make_unique<OnceConditionValidator>(), + std::make_unique<TestTimeProvider>())); } void VerifyEventTriggerEvents(const base::Feature& feature, uint32_t count) { @@ -410,7 +409,7 @@ protected: virtual std::unique_ptr<TestInMemoryEventStore> CreateEventStore() { // Returns a EventStore that will successfully initialize. - return base::MakeUnique<TestInMemoryEventStore>(true); + return std::make_unique<TestInMemoryEventStore>(true); } virtual bool ShouldAvailabilityStoreBeReady() { return true; } @@ -435,7 +434,7 @@ protected: std::unique_ptr<TestInMemoryEventStore> CreateEventStore() override { // Returns a EventStore that will fail to initialize. - return base::MakeUnique<TestInMemoryEventStore>(false); + return std::make_unique<TestInMemoryEventStore>(false); } private:
diff --git a/components/feature_engagement/test/test_tracker.cc b/components/feature_engagement/test/test_tracker.cc index 578b4a26..6c3608c0 100644 --- a/components/feature_engagement/test/test_tracker.cc +++ b/components/feature_engagement/test/test_tracker.cc
@@ -6,7 +6,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "base/threading/sequenced_task_runner_handle.h" #include "components/feature_engagement/internal/chrome_variations_configuration.h" #include "components/feature_engagement/internal/event_model_impl.h" @@ -25,24 +24,24 @@ // static std::unique_ptr<Tracker> CreateTestTracker() { - auto configuration = base::MakeUnique<ChromeVariationsConfiguration>(); + auto configuration = std::make_unique<ChromeVariationsConfiguration>(); configuration->ParseFeatureConfigs(GetAllFeatures()); auto storage_validator = - base::MakeUnique<FeatureConfigEventStorageValidator>(); + std::make_unique<FeatureConfigEventStorageValidator>(); storage_validator->InitializeFeatures(GetAllFeatures(), *configuration); - auto raw_event_model = base::MakeUnique<EventModelImpl>( - base::MakeUnique<InMemoryEventStore>(), std::move(storage_validator)); + auto raw_event_model = std::make_unique<EventModelImpl>( + std::make_unique<InMemoryEventStore>(), std::move(storage_validator)); auto event_model = - base::MakeUnique<InitAwareEventModel>(std::move(raw_event_model)); + std::make_unique<InitAwareEventModel>(std::move(raw_event_model)); - return base::MakeUnique<TrackerImpl>( - std::move(event_model), base::MakeUnique<NeverAvailabilityModel>(), + return std::make_unique<TrackerImpl>( + std::move(event_model), std::make_unique<NeverAvailabilityModel>(), std::move(configuration), std::make_unique<NoopDisplayLockController>(), - base::MakeUnique<FeatureConfigConditionValidator>(), - base::MakeUnique<SystemTimeProvider>()); + std::make_unique<FeatureConfigConditionValidator>(), + std::make_unique<SystemTimeProvider>()); } } // namespace feature_engagement
diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc index 0135a82..5f77753 100644 --- a/components/history/core/browser/history_backend.cc +++ b/components/history/core/browser/history_backend.cc
@@ -77,10 +77,6 @@ const base::Feature kAvoidStrippingRefFromFaviconPageUrls{ "AvoidStrippingRefFromFaviconPageUrls", base::FEATURE_DISABLED_BY_DEFAULT}; -// TODO(crbug.com/759631): Clean this up after impact is measured via Finch. -const base::Feature kPropagateFaviconsAcrossClientRedirects{ - "PropagateFaviconsAcrossClientRedirects", base::FEATURE_ENABLED_BY_DEFAULT}; - namespace { void RunUnlessCanceled( @@ -549,11 +545,7 @@ db_->UpdateVisitRow(visit_row); } - if (base::FeatureList::IsEnabled( - kPropagateFaviconsAcrossClientRedirects)) { - extended_redirect_chain = - GetCachedRecentRedirects(request.referrer); - } + extended_redirect_chain = GetCachedRecentRedirects(request.referrer); } } }
diff --git a/components/infobars/core/infobar_delegate.h b/components/infobars/core/infobar_delegate.h index 823dd3c..62860bb6 100644 --- a/components/infobars/core/infobar_delegate.h +++ b/components/infobars/core/infobar_delegate.h
@@ -60,26 +60,27 @@ UNKNOWN_INFOBAR, }; - // Unique identifier for every InfoBarDelegate subclass. - // KEEP IN SYNC WITH THE InfoBarIdentifier ENUM IN histograms.xml. + // Unique identifier for every InfoBarDelegate subclass. Use suffixes to mark + // infobars specific to particular OSes/platforms. + // KEEP IN SYNC WITH THE InfoBarIdentifier ENUM IN enums.xml. // NEW VALUES MUST BE APPENDED AND AVOID CHANGING ANY PRE-EXISTING VALUES. // A Java counterpart will be generated for this enum. // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.infobar enum InfoBarIdentifier { INVALID = -1, TEST_INFOBAR = 0, - APP_BANNER_INFOBAR_DELEGATE_ANDROID = 1, - APP_BANNER_INFOBAR_DELEGATE_DESKTOP = 2, + APP_BANNER_INFOBAR_DELEGATE = 1, + // Removed: APP_BANNER_INFOBAR_DELEGATE_DESKTOP = 2, // Removed: ANDROID_DOWNLOAD_MANAGER_DUPLICATE_INFOBAR_DELEGATE = 3, - CHROME_DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE = 4, + DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_ANDROID = 4, // Removed: DOWNLOAD_REQUEST_INFOBAR_DELEGATE_ANDROID = 5, // Removed: FULLSCREEN_INFOBAR_DELEGATE = 6, HUNG_PLUGIN_INFOBAR_DELEGATE = 7, - HUNG_RENDERER_INFOBAR_DELEGATE = 8, + HUNG_RENDERER_INFOBAR_DELEGATE_ANDROID = 8, // Removed: MEDIA_STREAM_INFOBAR_DELEGATE_ANDROID = 9, // Removed: MEDIA_THROTTLE_INFOBAR_DELEGATE = 10, // Removed: REQUEST_QUOTA_INFOBAR_DELEGATE = 11, - DEV_TOOLS_CONFIRM_INFOBAR_DELEGATE = 12, + DEV_TOOLS_INFOBAR_DELEGATE = 12, EXTENSION_DEV_TOOLS_INFOBAR_DELEGATE = 13, INCOGNITO_CONNECTABILITY_INFOBAR_DELEGATE = 14, THEME_INSTALLED_INFOBAR_DELEGATE = 15, @@ -93,44 +94,44 @@ // Removed: NOTIFICATION_PERMISSION_INFOBAR_DELEGATE = 23, // Removed: AUTO_SIGNIN_FIRST_RUN_INFOBAR_DELEGATE = 24, GENERATED_PASSWORD_SAVED_INFOBAR_DELEGATE_ANDROID = 25, - SAVE_PASSWORD_INFOBAR_DELEGATE = 26, + SAVE_PASSWORD_INFOBAR_DELEGATE_MOBILE = 26, PEPPER_BROKER_INFOBAR_DELEGATE = 27, - PERMISSION_UPDATE_INFOBAR_DELEGATE = 28, + PERMISSION_UPDATE_INFOBAR_DELEGATE_ANDROID = 28, // Removed: DURABLE_STORAGE_PERMISSION_INFOBAR_DELEGATE_ANDROID = 29, // Removed: NPAPI_REMOVAL_INFOBAR_DELEGATE = 30, OUTDATED_PLUGIN_INFOBAR_DELEGATE = 31, // Removed: PLUGIN_METRO_MODE_INFOBAR_DELEGATE = 32, RELOAD_PLUGIN_INFOBAR_DELEGATE = 33, - PLUGIN_OBSERVER = 34, + PLUGIN_OBSERVER_INFOBAR_DELEGATE = 34, // Removed: SSL_ADD_CERTIFICATE = 35, // Removed: SSL_ADD_CERTIFICATE_INFOBAR_DELEGATE = 36, - POPUP_BLOCKED_INFOBAR_DELEGATE = 37, - CHROME_SELECT_FILE_POLICY = 38, - KEYSTONE_PROMOTION_INFOBAR_DELEGATE = 39, + POPUP_BLOCKED_INFOBAR_DELEGATE_MOBILE = 37, + FILE_ACCESS_DISABLED_INFOBAR_DELEGATE = 38, + KEYSTONE_PROMOTION_INFOBAR_DELEGATE_MAC = 39, COLLECTED_COOKIES_INFOBAR_DELEGATE = 40, INSTALLATION_ERROR_INFOBAR_DELEGATE = 41, ALTERNATE_NAV_INFOBAR_DELEGATE = 42, - BAD_FLAGS_PROMPT = 43, + BAD_FLAGS_INFOBAR_DELEGATE = 43, DEFAULT_BROWSER_INFOBAR_DELEGATE = 44, GOOGLE_API_KEYS_INFOBAR_DELEGATE = 45, OBSOLETE_SYSTEM_INFOBAR_DELEGATE = 46, - SESSION_CRASHED_INFOBAR_DELEGATE = 47, + SESSION_CRASHED_INFOBAR_DELEGATE_MAC_IOS = 47, PAGE_INFO_INFOBAR_DELEGATE = 48, - AUTOFILL_CC_INFOBAR_DELEGATE = 49, - TRANSLATE_INFOBAR_DELEGATE = 50, - IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE = 51, + AUTOFILL_CC_INFOBAR_DELEGATE_MOBILE = 49, + TRANSLATE_INFOBAR_DELEGATE_NON_AURA = 50, + // Removed: IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE = 51, // Removed: NATIVE_APP_INSTALLER_INFOBAR_DELEGATE = 52, // Removed: NATIVE_APP_LAUNCHER_INFOBAR_DELEGATE = 53, // Removed: NATIVE_APP_OPEN_POLICY_INFOBAR_DELEGATE = 54, - RE_SIGN_IN_INFOBAR_DELEGATE = 55, - SHOW_PASSKIT_INFOBAR_ERROR_DELEGATE = 56, + RE_SIGN_IN_INFOBAR_DELEGATE_IOS = 55, + SHOW_PASSKIT_ERROR_INFOBAR_DELEGATE_IOS = 56, // Removed: READER_MODE_INFOBAR_DELEGATE_IOS = 57, - SYNC_ERROR_INFOBAR_DELEGATE = 58, + SYNC_ERROR_INFOBAR_DELEGATE_IOS = 58, UPGRADE_INFOBAR_DELEGATE_IOS = 59, - CHROME_WINDOW_ERROR = 60, - CONFIRM_DANGEROUS_DOWNLOAD = 61, + WINDOW_ERROR_INFOBAR_DELEGATE_ANDROID = 60, + DANGEROUS_DOWNLOAD_INFOBAR_DELEGATE_ANDROID = 61, // Removed: DESKTOP_SEARCH_REDIRECTION_INFOBAR_DELEGATE = 62, - UPDATE_PASSWORD_INFOBAR_DELEGATE = 63, + UPDATE_PASSWORD_INFOBAR_DELEGATE_MOBILE = 63, DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID = 64, AUTOFILL_CREDIT_CARD_FILLING_INFOBAR_DELEGATE_ANDROID = 65, ADS_BLOCKED_INFOBAR_DELEGATE_ANDROID = 66, @@ -138,8 +139,8 @@ DATA_REDUCTION_PROXY_PREVIEW_INFOBAR_DELEGATE = 68, SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID = 69, GROUPED_PERMISSION_INFOBAR_DELEGATE_ANDROID = 70, - OFFLINE_PAGE_INFOBAR_DELEGATE = 71, - SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_DELEGATE = 72, + OFFLINE_PAGE_INFOBAR_DELEGATE_ANDROID = 71, + SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_DELEGATE_ANDROID = 72, AUTOMATION_INFOBAR_DELEGATE = 73, VR_SERVICES_UPGRADE_ANDROID = 74, READER_MODE_INFOBAR_ANDROID = 75,
diff --git a/components/keyed_service/content/browser_context_keyed_service_factory.h b/components/keyed_service/content/browser_context_keyed_service_factory.h index a08bcf9e..cc1d708 100644 --- a/components/keyed_service/content/browser_context_keyed_service_factory.h +++ b/components/keyed_service/content/browser_context_keyed_service_factory.h
@@ -25,7 +25,7 @@ // // We do this because services depend on each other and we need to control // shutdown/destruction order. In each derived classes' constructors, the -// implementors must explicitly state which services are depended on. +// implementors must explicitly state on which services they depend. class KEYED_SERVICE_EXPORT BrowserContextKeyedServiceFactory : public KeyedServiceFactory { public:
diff --git a/components/navigation_interception/android/java/src/org/chromium/components/navigation_interception/NavigationParams.java b/components/navigation_interception/android/java/src/org/chromium/components/navigation_interception/NavigationParams.java index d6e14f9a..457c2a84 100644 --- a/components/navigation_interception/android/java/src/org/chromium/components/navigation_interception/NavigationParams.java +++ b/components/navigation_interception/android/java/src/org/chromium/components/navigation_interception/NavigationParams.java
@@ -34,6 +34,12 @@ public final boolean isExternalProtocol; /** + * If this navigation was triggered by an anchor with a download + * attribute, this is the (possibly empty) value of that attribute. + * */ + public final String suggestedFilename; + + /** * True if the navigation was originated from a navigation which had been * initiated by the user. */ @@ -44,7 +50,7 @@ public NavigationParams(String url, String referrer, boolean isPost, boolean hasUserGesture, int pageTransitionType, boolean isRedirect, boolean isExternalProtocol, - boolean isMainFrame, boolean hasUserGestureCarryover) { + boolean isMainFrame, String suggestedFilename, boolean hasUserGestureCarryover) { this.url = url; this.referrer = TextUtils.isEmpty(referrer) ? null : referrer; this.isPost = isPost; @@ -53,14 +59,17 @@ this.isRedirect = isRedirect; this.isExternalProtocol = isExternalProtocol; this.isMainFrame = isMainFrame; + this.suggestedFilename = suggestedFilename; this.hasUserGestureCarryover = hasUserGestureCarryover; } @CalledByNative public static NavigationParams create(String url, String referrer, boolean isPost, boolean hasUserGesture, int pageTransitionType, boolean isRedirect, - boolean isExternalProtocol, boolean isMainFrame, boolean hasUserGestureCarryover) { + boolean isExternalProtocol, boolean isMainFrame, String suggestedFilename, + boolean hasUserGestureCarryover) { return new NavigationParams(url, referrer, isPost, hasUserGesture, pageTransitionType, - isRedirect, isExternalProtocol, isMainFrame, hasUserGestureCarryover); + isRedirect, isExternalProtocol, isMainFrame, suggestedFilename, + hasUserGestureCarryover); } }
diff --git a/components/navigation_interception/intercept_navigation_throttle.cc b/components/navigation_interception/intercept_navigation_throttle.cc index 81acec4..b126c38 100644 --- a/components/navigation_interception/intercept_navigation_throttle.cc +++ b/components/navigation_interception/intercept_navigation_throttle.cc
@@ -52,7 +52,8 @@ navigation_handle()->HasUserGesture(), navigation_handle()->IsPost(), navigation_handle()->GetPageTransition(), is_redirect, navigation_handle()->IsExternalProtocol(), true, - navigation_handle()->GetBaseURLForDataURL()); + navigation_handle()->GetBaseURLForDataURL(), + navigation_handle()->GetSuggestedFilename()); bool should_ignore_navigation = should_ignore_callback_.Run( navigation_handle()->GetWebContents(), navigation_params); return should_ignore_navigation
diff --git a/components/navigation_interception/intercept_navigation_throttle_unittest.cc b/components/navigation_interception/intercept_navigation_throttle_unittest.cc index 0b3ed14..74faeede 100644 --- a/components/navigation_interception/intercept_navigation_throttle_unittest.cc +++ b/components/navigation_interception/intercept_navigation_throttle_unittest.cc
@@ -5,6 +5,7 @@ #include "components/navigation_interception/intercept_navigation_throttle.h" #include <memory> +#include <vector> #include "base/bind.h" #include "base/bind_helpers.h" @@ -13,9 +14,12 @@ #include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_throttle.h" #include "content/public/browser/web_contents.h" +#include "content/public/test/navigation_simulator.h" +#include "content/public/test/test_navigation_throttle_inserter.h" #include "content/public/test/test_renderer_host.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "url/gurl.h" using content::NavigationThrottle; using testing::_; @@ -59,33 +63,47 @@ InterceptNavigationThrottleTest() : mock_callback_receiver_(new MockInterceptCallbackReceiver()) {} - NavigationThrottle::ThrottleCheckResult - SimulateWillStart(const GURL& url, const GURL& sanitized_url, bool is_post) { - std::unique_ptr<content::NavigationHandle> test_handle = - content::NavigationHandle::CreateNavigationHandleForTesting(url, - main_rfh()); - test_handle->RegisterThrottleForTesting( - base::MakeUnique<InterceptNavigationThrottle>( - test_handle.get(), - base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, - base::Unretained(mock_callback_receiver_.get())))); - return test_handle->CallWillStartRequestForTesting( - is_post, content::Referrer(), false, ui::PAGE_TRANSITION_LINK, false); + std::unique_ptr<content::NavigationThrottle> CreateThrottle( + content::NavigationHandle* handle) { + return std::make_unique<InterceptNavigationThrottle>( + handle, base::BindRepeating( + &MockInterceptCallbackReceiver::ShouldIgnoreNavigation, + base::Unretained(mock_callback_receiver_.get()))); } - NavigationThrottle::ThrottleCheckResult Simulate302() { - std::unique_ptr<content::NavigationHandle> test_handle = - content::NavigationHandle::CreateNavigationHandleForTesting( - GURL(kTestUrl), main_rfh()); - test_handle->RegisterThrottleForTesting( - base::MakeUnique<InterceptNavigationThrottle>( - test_handle.get(), - base::Bind(&MockInterceptCallbackReceiver::ShouldIgnoreNavigation, - base::Unretained(mock_callback_receiver_.get())))); - test_handle->CallWillStartRequestForTesting( - true, content::Referrer(), false, ui::PAGE_TRANSITION_LINK, false); - return test_handle->CallWillRedirectRequestForTesting(GURL(kTestUrl), false, - GURL(), false); + std::unique_ptr<content::TestNavigationThrottleInserter> + CreateThrottleInserter() { + return std::make_unique<content::TestNavigationThrottleInserter>( + web_contents(), + base::BindRepeating(&InterceptNavigationThrottleTest::CreateThrottle, + base::Unretained(this))); + } + + NavigationThrottle::ThrottleCheckResult SimulateNavigation( + const GURL& url, + std::vector<GURL> redirect_chain, + bool is_post) { + auto throttle_inserter = CreateThrottleInserter(); + std::unique_ptr<content::NavigationSimulator> simulator = + content::NavigationSimulator::CreateRendererInitiated(url, main_rfh()); + auto failed = [](content::NavigationSimulator* sim) { + return sim->GetLastThrottleCheckResult().action() != + NavigationThrottle::PROCEED; + }; + + if (is_post) + simulator->SetMethod("POST"); + + simulator->Start(); + if (failed(simulator.get())) + return simulator->GetLastThrottleCheckResult(); + for (const GURL& url : redirect_chain) { + simulator->Redirect(url); + if (failed(simulator.get())) + return simulator->GetLastThrottleCheckResult(); + } + simulator->Commit(); + return simulator->GetLastThrottleCheckResult(); } std::unique_ptr<MockInterceptCallbackReceiver> mock_callback_receiver_; @@ -99,7 +117,7 @@ *mock_callback_receiver_, ShouldIgnoreNavigation(web_contents(), NavigationParamsUrlIsTest())); NavigationThrottle::ThrottleCheckResult result = - SimulateWillStart(GURL(kTestUrl), GURL(kTestUrl), false); + SimulateNavigation(GURL(kTestUrl), {}, false); EXPECT_EQ(NavigationThrottle::PROCEED, result); } @@ -112,7 +130,7 @@ *mock_callback_receiver_, ShouldIgnoreNavigation(web_contents(), NavigationParamsUrlIsTest())); NavigationThrottle::ThrottleCheckResult result = - SimulateWillStart(GURL(kTestUrl), GURL(kTestUrl), false); + SimulateNavigation(GURL(kTestUrl), {}, false); EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, result); } @@ -125,7 +143,7 @@ .WillOnce(Return(false)); NavigationThrottle::ThrottleCheckResult result = - SimulateWillStart(GURL(kTestUrl), GURL(kTestUrl), false); + SimulateNavigation(GURL(kTestUrl), {}, false); EXPECT_EQ(NavigationThrottle::PROCEED, result); } @@ -137,7 +155,7 @@ Property(&NavigationParams::is_post, Eq(true))))) .WillOnce(Return(false)); NavigationThrottle::ThrottleCheckResult result = - SimulateWillStart(GURL(kTestUrl), GURL(kTestUrl), true); + SimulateNavigation(GURL(kTestUrl), {}, true); EXPECT_EQ(NavigationThrottle::PROCEED, result); } @@ -154,9 +172,28 @@ _, AllOf(NavigationParamsUrlIsTest(), Property(&NavigationParams::is_post, Eq(false))))) .WillOnce(Return(false)); - NavigationThrottle::ThrottleCheckResult result = Simulate302(); + NavigationThrottle::ThrottleCheckResult result = + SimulateNavigation(GURL(kTestUrl), {GURL(kTestUrl)}, true); EXPECT_EQ(NavigationThrottle::PROCEED, result); } +// Ensure POST navigations are cancelled before the start. +TEST_F(InterceptNavigationThrottleTest, PostNavigationCancelledAtStart) { + EXPECT_CALL(*mock_callback_receiver_, + ShouldIgnoreNavigation( + _, AllOf(NavigationParamsUrlIsTest(), + Property(&NavigationParams::is_post, Eq(true))))) + .WillOnce(Return(true)); + + auto throttle_inserter = CreateThrottleInserter(); + std::unique_ptr<content::NavigationSimulator> simulator = + content::NavigationSimulator::CreateRendererInitiated(GURL(kTestUrl), + main_rfh()); + simulator->SetMethod("POST"); + simulator->Start(); + auto result = simulator->GetLastThrottleCheckResult(); + EXPECT_EQ(NavigationThrottle::CANCEL_AND_IGNORE, result); +} + } // namespace navigation_interception
diff --git a/components/navigation_interception/navigation_params.cc b/components/navigation_interception/navigation_params.cc index fe654e6..2a60e7c 100644 --- a/components/navigation_interception/navigation_params.cc +++ b/components/navigation_interception/navigation_params.cc
@@ -6,15 +6,17 @@ namespace navigation_interception { -NavigationParams::NavigationParams(const GURL& url, - const content::Referrer& referrer, - bool has_user_gesture, - bool is_post, - ui::PageTransition transition_type, - bool is_redirect, - bool is_external_protocol, - bool is_main_frame, - const GURL& base_url_for_data_url) +NavigationParams::NavigationParams( + const GURL& url, + const content::Referrer& referrer, + bool has_user_gesture, + bool is_post, + ui::PageTransition transition_type, + bool is_redirect, + bool is_external_protocol, + bool is_main_frame, + const GURL& base_url_for_data_url, + const base::Optional<std::string>& suggested_filename) : url_(url), referrer_(referrer), has_user_gesture_(has_user_gesture), @@ -23,7 +25,10 @@ is_redirect_(is_redirect), is_external_protocol_(is_external_protocol), is_main_frame_(is_main_frame), - base_url_for_data_url_(base_url_for_data_url) {} + base_url_for_data_url_(base_url_for_data_url), + suggested_filename_(suggested_filename) {} + +NavigationParams::~NavigationParams() = default; NavigationParams::NavigationParams(const NavigationParams&) = default;
diff --git a/components/navigation_interception/navigation_params.h b/components/navigation_interception/navigation_params.h index 20bc7f1..1630235 100644 --- a/components/navigation_interception/navigation_params.h +++ b/components/navigation_interception/navigation_params.h
@@ -5,9 +5,9 @@ #ifndef COMPONENTS_NAVIGATION_INTERCEPTION_NAVIGATION_PARAMS_H_ #define COMPONENTS_NAVIGATION_INTERCEPTION_NAVIGATION_PARAMS_H_ +#include "base/optional.h" #include "content/public/common/referrer.h" #include "ui/base/page_transition_types.h" -#include "ui/base/page_transition_types.h" #include "url/gurl.h" namespace navigation_interception { @@ -22,7 +22,9 @@ bool is_redirect, bool is_external_protocol, bool is_main_frame, - const GURL& base_url_for_data_url); + const GURL& base_url_for_data_url, + const base::Optional<std::string>& suggested_filename); + ~NavigationParams(); NavigationParams(const NavigationParams&); NavigationParams& operator=(const NavigationParams&) = delete; @@ -36,6 +38,9 @@ bool is_external_protocol() const { return is_external_protocol_; } bool is_main_frame() const { return is_main_frame_; } const GURL& base_url_for_data_url() const { return base_url_for_data_url_; } + const base::Optional<std::string>& suggested_filename() const { + return suggested_filename_; + } private: @@ -48,6 +53,7 @@ bool is_external_protocol_; bool is_main_frame_; GURL base_url_for_data_url_; + base::Optional<std::string> suggested_filename_; }; } // namespace navigation_interception
diff --git a/components/navigation_interception/navigation_params_android.cc b/components/navigation_interception/navigation_params_android.cc index a5d6dcf..cc449e49 100644 --- a/components/navigation_interception/navigation_params_android.cc +++ b/components/navigation_interception/navigation_params_android.cc
@@ -25,11 +25,17 @@ ScopedJavaLocalRef<jstring> jstring_referrer = ConvertUTF8ToJavaString(env, params.referrer().url.spec()); + ScopedJavaLocalRef<jstring> jstring_suggested_filename = nullptr; + if (params.suggested_filename().has_value()) { + jstring_suggested_filename = + ConvertUTF8ToJavaString(env, params.suggested_filename().value()); + } + return Java_NavigationParams_create( env, jstring_url, jstring_referrer, params.is_post(), params.has_user_gesture(), params.transition_type(), params.is_redirect(), params.is_external_protocol(), params.is_main_frame(), - has_user_gesture_carryover); + jstring_suggested_filename, has_user_gesture_carryover); } } // namespace navigation_interception
diff --git a/components/offline_pages/core/BUILD.gn b/components/offline_pages/core/BUILD.gn index a349d06..5bdb2d8 100644 --- a/components/offline_pages/core/BUILD.gn +++ b/components/offline_pages/core/BUILD.gn
@@ -10,6 +10,8 @@ sources = [ "archive_manager.cc", "archive_manager.h", + "archive_validator.cc", + "archive_validator.h", "client_id.cc", "client_id.h", "client_namespace_constants.cc", @@ -84,6 +86,7 @@ ":switches", "//base", "//components/keyed_service/core", + "//crypto", "//net", "//services/metrics/public/cpp:metrics_cpp", "//services/metrics/public/cpp:ukm_builders",
diff --git a/components/offline_pages/core/DEPS b/components/offline_pages/core/DEPS index bbd661af..52fe6296 100644 --- a/components/offline_pages/core/DEPS +++ b/components/offline_pages/core/DEPS
@@ -2,6 +2,7 @@ "+components/keyed_service", "+components/offline_items_collection", "+components/ukm", + "+crypto", "+services/metrics/public/cpp", "+sql", ]
diff --git a/components/offline_pages/core/archive_validator.cc b/components/offline_pages/core/archive_validator.cc new file mode 100644 index 0000000..b0ad3fc --- /dev/null +++ b/components/offline_pages/core/archive_validator.cc
@@ -0,0 +1,56 @@ +// Copyright 2018 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/offline_pages/core/archive_validator.h" + +#include <vector> + +#include "base/files/file.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "crypto/secure_hash.h" +#include "crypto/sha2.h" + +namespace offline_pages { + +// static +std::string ArchiveValidator::ComputeDigest(const base::FilePath& file_path) { + base::File file(file_path, base::File::FLAG_OPEN | base::File::FLAG_READ); + if (!file.IsValid()) + return std::string(); + + std::unique_ptr<crypto::SecureHash> secure_hash( + crypto::SecureHash::Create(crypto::SecureHash::SHA256)); + + const int kMaxBufferSize = 1024; + std::vector<char> buffer(kMaxBufferSize); + int bytes_read; + do { + bytes_read = file.ReadAtCurrentPos(buffer.data(), kMaxBufferSize); + if (bytes_read > 0) + secure_hash->Update(buffer.data(), bytes_read); + } while (bytes_read > 0); + if (bytes_read < 0) + return std::string(); + + std::string result_bytes(crypto::kSHA256Length, 0); + secure_hash->Finish(&result_bytes[0], result_bytes.size()); + return result_bytes; +} + +// static +bool ArchiveValidator::ValidateFile(const base::FilePath& file_path, + int64_t expected_file_size, + const std::string& expected_digest) { + int64_t actual_file_size; + if (!base::GetFileSize(file_path, &actual_file_size)) + return false; + if (expected_file_size != actual_file_size) + return false; + + std::string actual_digest = ComputeDigest(file_path); + return expected_digest == actual_digest; +} + +} // namespace offline_pages
diff --git a/components/offline_pages/core/archive_validator.h b/components/offline_pages/core/archive_validator.h new file mode 100644 index 0000000..e5cf2d0 --- /dev/null +++ b/components/offline_pages/core/archive_validator.h
@@ -0,0 +1,37 @@ +// Copyright 2018 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_OFFLINE_PAGES_CORE_ARCHIVE_VALIDATOR_H_ +#define COMPONENTS_OFFLINE_PAGES_CORE_ARCHIVE_VALIDATOR_H_ + +#include <string> + +#include "base/macros.h" + +namespace base { +class FilePath; +} + +namespace offline_pages { + +// Contains all helper functions to validate an archive file. +class ArchiveValidator { + public: + // Computes a SHA256 digest of the specified file. Empty string will be + // returned if the digest cannot be computed. + static std::string ComputeDigest(const base::FilePath& file_path); + + // Returns true if the specified file has |expected_file_size| and + // |expected_digest|. + static bool ValidateFile(const base::FilePath& file_path, + int64_t expected_file_size, + const std::string& expected_digest); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(ArchiveValidator); +}; + +} // namespace offline_pages + +#endif // COMPONENTS_OFFLINE_PAGES_CORE_ARCHIVE_VALIDATOR_H_
diff --git a/components/omnibox/browser/omnibox_client.cc b/components/omnibox/browser/omnibox_client.cc index a747c43..019b911 100644 --- a/components/omnibox/browser/omnibox_client.cc +++ b/components/omnibox/browser/omnibox_client.cc
@@ -81,3 +81,9 @@ OmniboxNavigationObserver* observer) { return false; } + +gfx::Image OmniboxClient::GetFaviconForPageUrl( + const GURL& page_url, + FaviconFetchedCallback on_favicon_fetched) { + return gfx::Image(); +} \ No newline at end of file
diff --git a/components/omnibox/browser/omnibox_client.h b/components/omnibox/browser/omnibox_client.h index 0868741..7efe508c 100644 --- a/components/omnibox/browser/omnibox_client.h +++ b/components/omnibox/browser/omnibox_client.h
@@ -20,10 +20,6 @@ struct AutocompleteMatch; struct OmniboxLog; -namespace base { -class CancelableTaskTracker; -} - namespace bookmarks { class BookmarkModel; } @@ -33,7 +29,8 @@ } typedef base::Callback<void(const SkBitmap& bitmap)> BitmapFetchedCallback; -typedef base::Callback<void(const gfx::Image& favicon)> FaviconFetchedCallback; +typedef base::OnceCallback<void(const gfx::Image& favicon)> + FaviconFetchedCallback; // Interface that allows the omnibox component to interact with its embedder // (e.g., getting information about the current page, retrieving objects @@ -124,13 +121,14 @@ const BitmapFetchedCallback& on_bitmap_fetched) { } - // Fetchs the favicon for |page_url|. If the embedder supports fetching - // favicons (not all embedders do), |on_favicon_fetched| will be be called - // once the favicon has been fetched. - virtual void GetFaviconForPageUrl( - base::CancelableTaskTracker* tracker, + // Fetches the favicon for |page_url| if the embedder supports fetching + // favicons (not all embedders do). Returns the favicon if it is synchronously + // available. Otherwise, this method returns an empty gfx::Image and + // |on_favicon_fetched| may or may not be called asynchronously later. + // |on_favicon_fetched| will never be run synchronously. + virtual gfx::Image GetFaviconForPageUrl( const GURL& page_url, - const FaviconFetchedCallback& on_favicon_fetched) {} + FaviconFetchedCallback on_favicon_fetched); // Called when the current autocomplete match has changed. virtual void OnCurrentMatchChanged(const AutocompleteMatch& match) {}
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc index 440fa98..90c78f21 100644 --- a/components/omnibox/browser/omnibox_field_trial.cc +++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -41,6 +41,11 @@ const base::Feature kOmniboxEntitySuggestions{ "OmniboxEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT}; +// Feature used to enable entity suggestion images and enhanced presentation +// showing more context and descriptive text about the entity. +const base::Feature kOmniboxRichEntitySuggestions{ + "OmniboxRichEntitySuggestions", base::FEATURE_DISABLED_BY_DEFAULT}; + // Feature used to force on the experiment of transmission of tail suggestions // from GWS to this client, currently testing for desktop. const base::Feature kOmniboxTailSuggestions{
diff --git a/components/omnibox/browser/omnibox_field_trial.h b/components/omnibox/browser/omnibox_field_trial.h index 6965048..80280bd 100644 --- a/components/omnibox/browser/omnibox_field_trial.h +++ b/components/omnibox/browser/omnibox_field_trial.h
@@ -35,6 +35,7 @@ namespace omnibox { extern const base::Feature kOmniboxEntitySuggestions; +extern const base::Feature kOmniboxRichEntitySuggestions; extern const base::Feature kOmniboxTailSuggestions; extern const base::Feature kOmniboxTabSwitchSuggestions; extern const base::Feature kEnableClipboardProvider;
diff --git a/components/omnibox/browser/omnibox_popup_model.cc b/components/omnibox/browser/omnibox_popup_model.cc index 077688f..2d44eb2 100644 --- a/components/omnibox/browser/omnibox_popup_model.cc +++ b/components/omnibox/browser/omnibox_popup_model.cc
@@ -26,16 +26,6 @@ #include "ui/gfx/vector_icon_types.h" #endif -namespace { - -size_t GetFaviconCacheSize() { - // Set cache size to twice the number of maximum results to avoid favicon - // refetches as the user types. Favicon fetches are uncached and can hit disk. - return 2 * AutocompleteResult::GetMaxMatches(); -} - -} // namespace - /////////////////////////////////////////////////////////////////////////////// // OmniboxPopupModel @@ -43,8 +33,7 @@ OmniboxPopupModel::OmniboxPopupModel(OmniboxPopupView* popup_view, OmniboxEditModel* edit_model) - : favicons_cache_(GetFaviconCacheSize()), - view_(popup_view), + : view_(popup_view), edit_model_(edit_model), selected_line_(kNoMatch), selected_line_state_(NORMAL), @@ -287,24 +276,13 @@ if (base::FeatureList::IsEnabled( omnibox::kUIExperimentShowSuggestionFavicons) && !AutocompleteMatch::IsSearchType(match.type)) { - const GURL& page_url = match.destination_url; - auto cache_iterator = favicons_cache_.Get(page_url); - if (cache_iterator != favicons_cache_.end() && - !cache_iterator->second.IsEmpty()) { - return cache_iterator->second; - } - - // We don't have the favicon in the cache. We kick off the request, but - // don't early return. We proceed to return the vector icon for the match - // type. If and when we ever get the favicon back, we send a notification. - // - // Note: We're relying on GetFaviconForPageUrl to call the callback - // asynchronously. If the callback is called synchronously, the fetched - // favicon may get clobbered by the vector icon once this method returns. - edit_model_->client()->GetFaviconForPageUrl( - &favicon_task_tracker_, match.destination_url, + gfx::Image favicon = edit_model_->client()->GetFaviconForPageUrl( + match.destination_url, base::Bind(&OmniboxPopupModel::OnFaviconFetched, weak_factory_.GetWeakPtr(), match.destination_url)); + + if (!favicon.IsEmpty()) + return favicon; } const auto& vector_icon_type = @@ -320,8 +298,6 @@ if (icon.IsEmpty()) return; - favicons_cache_.Put(page_url, icon); - // Notify all affected matches. for (size_t i = 0; i < result().size(); ++i) { auto& match = result().match_at(i);
diff --git a/components/omnibox/browser/omnibox_popup_model.h b/components/omnibox/browser/omnibox_popup_model.h index 504440a..5983435 100644 --- a/components/omnibox/browser/omnibox_popup_model.h +++ b/components/omnibox/browser/omnibox_popup_model.h
@@ -7,11 +7,9 @@ #include <stddef.h> -#include "base/containers/mru_cache.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "base/task/cancelable_task_tracker.h" #include "build/build_config.h" #include "components/omnibox/browser/autocomplete_controller.h" #include "components/omnibox/browser/autocomplete_result.h" @@ -21,6 +19,7 @@ class OmniboxPopupModelObserver; class OmniboxPopupView; +class GURL; namespace gfx { class Image; @@ -148,11 +147,6 @@ SkBitmap answer_bitmap_; - // We cache a very small number of favicons so we can synchronously deliver - // them to prevent flicker as the user types. - base::MRUCache<GURL, gfx::Image> favicons_cache_; - base::CancelableTaskTracker favicon_task_tracker_; - OmniboxPopupView* view_; OmniboxEditModel* edit_model_;
diff --git a/components/optimization_guide/proto/hints.proto b/components/optimization_guide/proto/hints.proto index 4041deaa..939918d 100644 --- a/components/optimization_guide/proto/hints.proto +++ b/components/optimization_guide/proto/hints.proto
@@ -47,7 +47,7 @@ // Note, this list may contain multiple hints that apply to a page. For // example, if there are hints for (HOST_SUFFIX,cnn.com) and // (HOST_SUFFIX,sports.cnn.com), these may both apply to sports.cnn.com/foo. - // It is expected for the client to match a page to the hint with the - // finest granularity. + // + // It is expected for the client to use the first match in this list. repeated Hint hints = 1; }
diff --git a/components/password_manager/core/browser/BUILD.gn b/components/password_manager/core/browser/BUILD.gn index ae73f91..5607f4fa 100644 --- a/components/password_manager/core/browser/BUILD.gn +++ b/components/password_manager/core/browser/BUILD.gn
@@ -160,11 +160,8 @@ "password_reuse_detector_consumer.cc", "password_reuse_detector_consumer.h", ] - - if (is_win || is_mac || (is_linux && !is_chromeos)) { + if (is_win || is_mac || is_linux || is_chromeos) { sources += [ - "hash_password_manager.cc", - "hash_password_manager.h", "password_store_signin_notifier.cc", "password_store_signin_notifier.h", ] @@ -176,6 +173,7 @@ "//components/sync", ] deps = [ + ":hash_password_manager", ":proto", "//base", "//base:i18n", @@ -193,7 +191,6 @@ "//components/url_formatter", "//components/variations", "//components/webdata/common", - "//crypto", "//google_apis", "//net", "//services/metrics/public/cpp:metrics_cpp", @@ -229,6 +226,20 @@ ] } +static_library("hash_password_manager") { + sources = [ + "hash_password_manager.cc", + "hash_password_manager.h", + ] + deps = [ + "//base:base", + "//components/os_crypt", + "//components/password_manager/core/common", + "//components/prefs", + "//crypto", + ] +} + static_library("test_support") { testonly = true sources = [ @@ -376,10 +387,13 @@ "password_reuse_detector_unittest.cc", ] } - if (is_win || is_mac || (is_linux && !is_chromeos)) { + + if (is_win || is_mac || is_linux || is_chromeos) { sources += [ "hash_password_manager_unittest.cc" ] } + deps = [ + ":hash_password_manager", ":test_support", ":unit_tests_bundle_data", "//base/test:test_support",
diff --git a/components/password_manager/core/browser/hash_password_manager.cc b/components/password_manager/core/browser/hash_password_manager.cc index cf3dc5f8..ebbcf2ee 100644 --- a/components/password_manager/core/browser/hash_password_manager.cc +++ b/components/password_manager/core/browser/hash_password_manager.cc
@@ -7,11 +7,11 @@ #include "base/base64.h" #include "base/strings/string_number_conversions.h" #include "components/os_crypt/os_crypt.h" -#include "components/password_manager/core/browser/password_manager_metrics_util.h" -#include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/prefs/pref_service.h" +#include "crypto/openssl_util.h" #include "crypto/random.h" +#include "third_party/boringssl/src/include/openssl/evp.h" namespace { constexpr size_t kSyncPasswordSaltLength = 16; @@ -20,6 +20,22 @@ namespace password_manager { +SyncPasswordData::SyncPasswordData(const base::string16& password, + bool force_update) + : length(password.size()), + salt(HashPasswordManager::CreateRandomSalt()), + hash(HashPasswordManager::CalculateSyncPasswordHash(password, salt)), + force_update(force_update) {} + +bool SyncPasswordData::MatchesPassword(const base::string16& password) { + if (password.size() != this->length) + return false; + return HashPasswordManager::CalculateSyncPasswordHash(password, this->salt) == + this->hash; +} + +HashPasswordManager::HashPasswordManager(PrefService* prefs) : prefs_(prefs) {} + bool HashPasswordManager::SavePasswordHash(const base::string16& password) { if (!prefs_) return false; @@ -28,21 +44,25 @@ RetrievePasswordHash(); // If it is the same password, no need to save password hash again. if (current_sync_password_data.has_value() && - password_manager_util::CalculateSyncPasswordHash( - password, current_sync_password_data->salt) == - current_sync_password_data->hash) { + current_sync_password_data->MatchesPassword(password)) { return true; } - std::string salt = CreateRandomSalt(); - std::string hash = base::NumberToString( - password_manager_util::CalculateSyncPasswordHash(password, salt)); - EncryptAndSaveToPrefs(prefs::kSyncPasswordHash, hash); + return SavePasswordHash(SyncPasswordData(password, true)); +} - // Password length and salt are stored together. - std::string length_salt = LengthAndSaltToString(salt, password.size()); - return EncryptAndSaveToPrefs(prefs::kSyncPasswordLengthAndHashSalt, - length_salt); +bool HashPasswordManager::SavePasswordHash( + const SyncPasswordData& sync_password_data) { + bool should_save = sync_password_data.force_update || + !prefs_->HasPrefPath(prefs::kSyncPasswordHash); + return should_save ? (EncryptAndSaveToPrefs( + prefs::kSyncPasswordHash, + base::NumberToString(sync_password_data.hash)) && + EncryptAndSaveToPrefs( + prefs::kSyncPasswordLengthAndHashSalt, + LengthAndSaltToString(sync_password_data.salt, + sync_password_data.length))) + : false; } void HashPasswordManager::ClearSavedPasswordHash() { @@ -66,16 +86,11 @@ return result; } -void HashPasswordManager::ReportIsSyncPasswordHashSavedMetric() { - if (!prefs_) - return; - auto hash_password_state = - prefs_->HasPrefPath(prefs::kSyncPasswordHash) - ? metrics_util::IsSyncPasswordHashSaved::SAVED - : metrics_util::IsSyncPasswordHashSaved::NOT_SAVED; - metrics_util::LogIsSyncPasswordHashSaved(hash_password_state); +bool HashPasswordManager::HasPasswordHash() { + return prefs_ ? prefs_->HasPrefPath(prefs::kSyncPasswordHash) : false; } +// static std::string HashPasswordManager::CreateRandomSalt() { char buffer[kSyncPasswordSaltLength]; crypto::RandBytes(buffer, kSyncPasswordSaltLength); @@ -85,6 +100,42 @@ return result; } +// static +uint64_t HashPasswordManager::CalculateSyncPasswordHash( + const base::StringPiece16& text, + const std::string& salt) { + crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); + constexpr size_t kBytesFromHash = 8; + constexpr uint64_t kScryptCost = 32; // It must be power of 2. + constexpr uint64_t kScryptBlockSize = 8; + constexpr uint64_t kScryptParallelization = 1; + constexpr size_t kScryptMaxMemory = 1024 * 1024; + + uint8_t hash[kBytesFromHash]; + base::StringPiece text_8bits(reinterpret_cast<const char*>(text.data()), + text.size() * 2); + const uint8_t* salt_ptr = reinterpret_cast<const uint8_t*>(salt.c_str()); + + int scrypt_ok = EVP_PBE_scrypt(text_8bits.data(), text_8bits.size(), salt_ptr, + salt.size(), kScryptCost, kScryptBlockSize, + kScryptParallelization, kScryptMaxMemory, hash, + kBytesFromHash); + + // EVP_PBE_scrypt can only fail due to memory allocation error (which aborts + // Chromium) or invalid parameters. In case of a failure a hash could leak + // information from the stack, so using CHECK is better than DCHECK. + CHECK(scrypt_ok); + + // Take 37 bits of |hash|. + uint64_t hash37 = ((static_cast<uint64_t>(hash[0]))) | + ((static_cast<uint64_t>(hash[1])) << 8) | + ((static_cast<uint64_t>(hash[2])) << 16) | + ((static_cast<uint64_t>(hash[3])) << 24) | + (((static_cast<uint64_t>(hash[4])) & 0x1F) << 32); + + return hash37; +} + std::string HashPasswordManager::LengthAndSaltToString(const std::string& salt, size_t password_length) { return base::NumberToString(password_length) + kSeparator + salt;
diff --git a/components/password_manager/core/browser/hash_password_manager.h b/components/password_manager/core/browser/hash_password_manager.h index 217f4d4..c1b2558 100644 --- a/components/password_manager/core/browser/hash_password_manager.h +++ b/components/password_manager/core/browser/hash_password_manager.h
@@ -14,9 +14,16 @@ namespace password_manager { struct SyncPasswordData { - uint64_t hash; - std::string salt; + SyncPasswordData() = default; + SyncPasswordData(const base::string16& password, bool force_update); + bool MatchesPassword(const base::string16& password); + size_t length; + std::string salt; + uint64_t hash; + // Signal that we need to update password hash, salt, and length in profile + // prefs. + bool force_update; }; // Responsible for saving, clearing, retrieving and encryption of a sync @@ -25,21 +32,29 @@ class HashPasswordManager { public: HashPasswordManager() = default; + explicit HashPasswordManager(PrefService* prefs); ~HashPasswordManager() = default; bool SavePasswordHash(const base::string16& password); + bool SavePasswordHash(const SyncPasswordData& sync_password_data); void ClearSavedPasswordHash(); // Returns empty if no hash is available. base::Optional<SyncPasswordData> RetrievePasswordHash(); - void ReportIsSyncPasswordHashSavedMetric(); + // Whether |prefs_| has |kSyncPasswordHash| pref path. + bool HasPasswordHash(); void set_prefs(PrefService* prefs) { prefs_ = prefs; } - private: - std::string CreateRandomSalt(); + static std::string CreateRandomSalt(); + // Calculates 37 bits hash for a sync password. The calculation is based on a + // slow hash function. The running time is ~10^{-4} seconds on Desktop. + static uint64_t CalculateSyncPasswordHash(const base::StringPiece16& text, + const std::string& salt); + + private: // Packs |salt| and |password_length| to a string. std::string LengthAndSaltToString(const std::string& salt, size_t password_length);
diff --git a/components/password_manager/core/browser/hash_password_manager_unittest.cc b/components/password_manager/core/browser/hash_password_manager_unittest.cc index 74559c5..5ff06f30 100644 --- a/components/password_manager/core/browser/hash_password_manager_unittest.cc +++ b/components/password_manager/core/browser/hash_password_manager_unittest.cc
@@ -6,7 +6,6 @@ #include "base/strings/utf_string_conversions.h" #include "components/os_crypt/os_crypt_mocker.h" -#include "components/password_manager/core/browser/password_manager_util.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/testing_pref_service.h" @@ -39,24 +38,34 @@ ASSERT_FALSE(prefs_.HasPrefPath(prefs::kSyncPasswordHash)); HashPasswordManager hash_password_manager; hash_password_manager.set_prefs(&prefs_); - hash_password_manager.SavePasswordHash(base::ASCIIToUTF16("sync_password")); + base::string16 password(base::UTF8ToUTF16("sync_password")); + + // Verify |SavePasswordHash(const base::string16&)| behavior. + hash_password_manager.SavePasswordHash(password); EXPECT_TRUE(prefs_.HasPrefPath(prefs::kSyncPasswordHash)); // Saves the same password again won't change password hash, length or salt. const std::string current_hash = prefs_.GetString(prefs::kSyncPasswordHash); const std::string current_length_and_salt = prefs_.GetString(prefs::kSyncPasswordLengthAndHashSalt); - hash_password_manager.SavePasswordHash(base::ASCIIToUTF16("sync_password")); + hash_password_manager.SavePasswordHash(password); EXPECT_EQ(current_hash, prefs_.GetString(prefs::kSyncPasswordHash)); EXPECT_EQ(current_length_and_salt, prefs_.GetString(prefs::kSyncPasswordLengthAndHashSalt)); + + // Verify |SavePasswordHash(const SyncPasswordData&)| behavior. + base::string16 new_password(base::UTF8ToUTF16("new_sync_password")); + SyncPasswordData sync_password_data(new_password, /*force_update=*/true); + EXPECT_TRUE(sync_password_data.MatchesPassword(new_password)); + hash_password_manager.SavePasswordHash(sync_password_data); + EXPECT_TRUE(prefs_.HasPrefPath(prefs::kSyncPasswordHash)); } TEST_F(HashPasswordManagerTest, Clearing) { ASSERT_FALSE(prefs_.HasPrefPath(prefs::kSyncPasswordHash)); HashPasswordManager hash_password_manager; hash_password_manager.set_prefs(&prefs_); - hash_password_manager.SavePasswordHash(base::ASCIIToUTF16("sync_password")); + hash_password_manager.SavePasswordHash(base::UTF8ToUTF16("sync_password")); hash_password_manager.ClearSavedPasswordHash(); EXPECT_FALSE(prefs_.HasPrefPath(prefs::kSyncPasswordHash)); } @@ -65,7 +74,7 @@ ASSERT_FALSE(prefs_.HasPrefPath(prefs::kSyncPasswordHash)); HashPasswordManager hash_password_manager; hash_password_manager.set_prefs(&prefs_); - hash_password_manager.SavePasswordHash(base::ASCIIToUTF16("sync_password")); + hash_password_manager.SavePasswordHash(base::UTF8ToUTF16("sync_password")); EXPECT_TRUE(prefs_.HasPrefPath(prefs::kSyncPasswordLengthAndHashSalt)); base::Optional<SyncPasswordData> sync_password_data = @@ -73,10 +82,32 @@ ASSERT_TRUE(sync_password_data); EXPECT_EQ(13u, sync_password_data->length); EXPECT_EQ(16u, sync_password_data->salt.size()); - uint64_t expected_hash = password_manager_util::CalculateSyncPasswordHash( - base::ASCIIToUTF16("sync_password"), sync_password_data->salt); + uint64_t expected_hash = HashPasswordManager::CalculateSyncPasswordHash( + base::UTF8ToUTF16("sync_password"), sync_password_data->salt); EXPECT_EQ(expected_hash, sync_password_data->hash); } +TEST_F(HashPasswordManagerTest, CalculateSyncPasswordHash) { + const char* kPlainText[] = {"", "password", "password", "secret"}; + const char* kSalt[] = {"", "salt", "123", "456"}; + + constexpr uint64_t kExpectedHash[] = { + UINT64_C(0x1c610a7950), UINT64_C(0x1927dc525e), UINT64_C(0xf72f81aa6), + UINT64_C(0x3645af77f), + }; + + static_assert(arraysize(kPlainText) == arraysize(kSalt), + "Arrays must have the same size"); + static_assert(arraysize(kPlainText) == arraysize(kExpectedHash), + "Arrays must have the same size"); + + for (size_t i = 0; i < arraysize(kPlainText); ++i) { + SCOPED_TRACE(i); + base::string16 text = base::UTF8ToUTF16(kPlainText[i]); + EXPECT_EQ(kExpectedHash[i], + HashPasswordManager::CalculateSyncPasswordHash(text, kSalt[i])); + } +} + } // namespace } // namespace password_manager
diff --git a/components/password_manager/core/browser/mock_password_store.h b/components/password_manager/core/browser/mock_password_store.h index 18a9cc62..11603b98 100644 --- a/components/password_manager/core/browser/mock_password_store.h +++ b/components/password_manager/core/browser/mock_password_store.h
@@ -76,11 +76,9 @@ void(const base::string16&, const std::string&, PasswordReuseDetectorConsumer*)); -#if !defined(OS_CHROMEOS) MOCK_METHOD1(SaveSyncPasswordHash, void(const base::string16&)); MOCK_METHOD0(ClearSyncPasswordHash, void()); #endif -#endif PasswordStoreSync* GetSyncInterface() { return this; }
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 6130700..91aac72 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -32,6 +32,7 @@ #include "components/password_manager/core/browser/password_manager_metrics_recorder.h" #include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/browser/password_manager_util.h" +#include "components/password_manager/core/browser/password_reuse_defines.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/password_manager/core/common/password_manager_pref_names.h" #include "components/pref_registry/pref_registry_syncable.h" @@ -824,8 +825,7 @@ DCHECK(provisional_save_manager_->submitted_form()); if (!client_->GetStoreResultFilter()->ShouldSave( *provisional_save_manager_->submitted_form())) { -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) // When |username_value| is empty, it's not clear whether the submitted // credentials are really sync credentials. Don't save sync password hash // in that case.
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.cc b/components/password_manager/core/browser/password_manager_metrics_util.cc index 8ddf90c..9a2eda5 100644 --- a/components/password_manager/core/browser/password_manager_metrics_util.cc +++ b/components/password_manager/core/browser/password_manager_metrics_util.cc
@@ -212,8 +212,7 @@ SubmittedFormFrame::SUBMITTED_FORM_FRAME_COUNT); } -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) void LogSyncPasswordHashChange(SyncPasswordHashChange event) { UMA_HISTOGRAM_ENUMERATION( "PasswordManager.SyncPasswordHashChange", event,
diff --git a/components/password_manager/core/browser/password_manager_metrics_util.h b/components/password_manager/core/browser/password_manager_metrics_util.h index 1155dcb..d14384c 100644 --- a/components/password_manager/core/browser/password_manager_metrics_util.h +++ b/components/password_manager/core/browser/password_manager_metrics_util.h
@@ -10,6 +10,7 @@ #include <string> #include "components/autofill/core/common/password_form.h" +#include "components/password_manager/core/browser/password_reuse_defines.h" #include "components/password_manager/core/common/credential_manager_types.h" namespace password_manager { @@ -227,8 +228,7 @@ kCredentialManagementAPI }; -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) enum class SyncPasswordHashChange { SAVED_ON_CHROME_SIGNIN, SAVED_IN_CONTENT_AREA, @@ -361,8 +361,7 @@ // Log a frame of a submitted password form. void LogSubmittedFormFrame(SubmittedFormFrame frame); -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) // Log a save sync password change event. void LogSyncPasswordHashChange(SyncPasswordHashChange event);
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc index b2d6c5bc..f9d40aa 100644 --- a/components/password_manager/core/browser/password_manager_unittest.cc +++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -21,6 +21,7 @@ #include "components/password_manager/core/browser/mock_password_store.h" #include "components/password_manager/core/browser/password_autofill_manager.h" #include "components/password_manager/core/browser/password_manager_driver.h" +#include "components/password_manager/core/browser/password_reuse_defines.h" #include "components/password_manager/core/browser/password_store.h" #include "components/password_manager/core/browser/statistics_table.h" #include "components/password_manager/core/browser/stub_credentials_filter.h" @@ -757,8 +758,7 @@ // User should not be prompted and password should not be saved. EXPECT_CALL(client_, PromptUserToSaveOrUpdatePasswordPtr(_)).Times(0); EXPECT_CALL(*store_, AddLogin(_)).Times(0); -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) EXPECT_CALL(*store_, SaveSyncPasswordHash(form.password_value)); #endif // Prefs are needed for failure logging about sync credentials. @@ -836,8 +836,7 @@ EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); EXPECT_CALL(client_, GetPrefs()).WillRepeatedly(Return(nullptr)); -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) EXPECT_CALL(*store_, SaveSyncPasswordHash(form.password_value)); #endif manager()->ProvisionallySavePassword(form, nullptr); @@ -873,8 +872,7 @@ EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); EXPECT_CALL(client_, GetPrefs()).WillRepeatedly(Return(nullptr)); -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) EXPECT_CALL(*store_, SaveSyncPasswordHash(ASCIIToUTF16("n3w passw0rd"))); #endif manager()->ProvisionallySavePassword(updated_form, nullptr); @@ -1928,8 +1926,7 @@ manager()->OnPasswordFormsRendered(&driver_, observed, true); } -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) // Check that no sync password hash is saved when no username is available, // because we it's not clear whether the submitted credentials are sync // credentials. @@ -2202,8 +2199,7 @@ EXPECT_CALL(client_, IsSavingAndFillingEnabledForCurrentPage()) .WillRepeatedly(Return(true)); EXPECT_CALL(client_, GetPrefs()).WillRepeatedly(Return(nullptr)); -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) EXPECT_CALL(*store_, SaveSyncPasswordHash(form.new_password_value)); #endif client_.FilterAllResultsForSaving();
diff --git a/components/password_manager/core/browser/password_manager_util.cc b/components/password_manager/core/browser/password_manager_util.cc index 837afe8..3cccd72 100644 --- a/components/password_manager/core/browser/password_manager_util.cc +++ b/components/password_manager/core/browser/password_manager_util.cc
@@ -16,8 +16,6 @@ #include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/sync/driver/sync_service.h" -#include "crypto/openssl_util.h" -#include "third_party/boringssl/src/include/openssl/evp.h" namespace password_manager_util { @@ -90,40 +88,6 @@ return log_manager && log_manager->IsLoggingActive(); } -uint64_t CalculateSyncPasswordHash(const base::StringPiece16& text, - const std::string& salt) { - crypto::OpenSSLErrStackTracer err_tracer(FROM_HERE); - constexpr size_t kBytesFromHash = 8; - constexpr uint64_t kScryptCost = 32; // It must be power of 2. - constexpr uint64_t kScryptBlockSize = 8; - constexpr uint64_t kScryptParallelization = 1; - constexpr size_t kScryptMaxMemory = 1024 * 1024; - - uint8_t hash[kBytesFromHash]; - base::StringPiece text_8bits(reinterpret_cast<const char*>(text.data()), - text.size() * 2); - const uint8_t* salt_ptr = reinterpret_cast<const uint8_t*>(salt.c_str()); - - int scrypt_ok = EVP_PBE_scrypt(text_8bits.data(), text_8bits.size(), salt_ptr, - salt.size(), kScryptCost, kScryptBlockSize, - kScryptParallelization, kScryptMaxMemory, hash, - kBytesFromHash); - - // EVP_PBE_scrypt can only fail due to memory allocation error (which aborts - // Chromium) or invalid parameters. In case of a failure a hash could leak - // information from the stack, so using CHECK is better than DCHECK. - CHECK(scrypt_ok); - - // Take 37 bits of |hash|. - uint64_t hash37 = ((static_cast<uint64_t>(hash[0]))) | - ((static_cast<uint64_t>(hash[1])) << 8) | - ((static_cast<uint64_t>(hash[2])) << 16) | - ((static_cast<uint64_t>(hash[3])) << 24) | - (((static_cast<uint64_t>(hash[4])) & 0x1F) << 32); - - return hash37; -} - bool ManualPasswordGenerationEnabled(syncer::SyncService* sync_service) { if (!(base::FeatureList::IsEnabled( password_manager::features::kEnableManualPasswordGeneration) &&
diff --git a/components/password_manager/core/browser/password_manager_util.h b/components/password_manager/core/browser/password_manager_util.h index 2e0a1e3c..1fa020d 100644 --- a/components/password_manager/core/browser/password_manager_util.h +++ b/components/password_manager/core/browser/password_manager_util.h
@@ -54,11 +54,6 @@ // and required to always return non-null. bool IsLoggingActive(const password_manager::PasswordManagerClient* client); -// Calculates 37 bits hash for a sync password. The calculation is based on a -// slow hash function. The running time is ~10^{-4} seconds on Desktop. -uint64_t CalculateSyncPasswordHash(const base::StringPiece16& text, - const std::string& salt); - // True iff the manual password generation is enabled and the user is sync user // without custom passphrase. bool ManualPasswordGenerationEnabled(syncer::SyncService* sync_service);
diff --git a/components/password_manager/core/browser/password_manager_util_unittest.cc b/components/password_manager/core/browser/password_manager_util_unittest.cc index 481284b..8382700 100644 --- a/components/password_manager/core/browser/password_manager_util_unittest.cc +++ b/components/password_manager/core/browser/password_manager_util_unittest.cc
@@ -59,25 +59,3 @@ EXPECT_THAT(forms, UnorderedPasswordFormElementsAre(&expected_forms)); } - -TEST(PasswordManagerUtil, CalculateSyncPasswordHash) { - const char* kPlainText[] = {"", "password", "password", "secret"}; - const char* kSalt[] = {"", "salt", "123", "456"}; - - constexpr uint64_t kExpectedHash[] = { - UINT64_C(0x1c610a7950), UINT64_C(0x1927dc525e), UINT64_C(0xf72f81aa6), - UINT64_C(0x3645af77f), - }; - - static_assert(arraysize(kPlainText) == arraysize(kSalt), - "Arrays must have the same size"); - static_assert(arraysize(kPlainText) == arraysize(kExpectedHash), - "Arrays must have the same size"); - - for (size_t i = 0; i < arraysize(kPlainText); ++i) { - SCOPED_TRACE(i); - base::string16 text = base::UTF8ToUTF16(kPlainText[i]); - EXPECT_EQ(kExpectedHash[i], - password_manager_util::CalculateSyncPasswordHash(text, kSalt[i])); - } -}
diff --git a/components/password_manager/core/browser/password_reuse_defines.h b/components/password_manager/core/browser/password_reuse_defines.h index 99c8f73..a45e9ff6 100644 --- a/components/password_manager/core/browser/password_reuse_defines.h +++ b/components/password_manager/core/browser/password_reuse_defines.h
@@ -6,7 +6,7 @@ #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_REUSE_DEFINES_H_ #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) + defined(OS_LINUX) || defined(OS_CHROMEOS) // Enable the detection when the sync password is typed not on the sync domain. #define SYNC_PASSWORD_REUSE_DETECTION_ENABLED #endif
diff --git a/components/password_manager/core/browser/password_reuse_detector.cc b/components/password_manager/core/browser/password_reuse_detector.cc index cd7b8f8..cf8cbb9 100644 --- a/components/password_manager/core/browser/password_reuse_detector.cc +++ b/components/password_manager/core/browser/password_reuse_detector.cc
@@ -8,7 +8,7 @@ #include <utility> #include "components/autofill/core/common/password_form.h" -#include "components/password_manager/core/browser/password_manager_util.h" +#include "components/password_manager/core/browser/hash_password_manager.h" #include "components/password_manager/core/browser/password_reuse_detector_consumer.h" #include "components/password_manager/core/browser/psl_matching_helper.h" #include "google_apis/gaia/gaia_auth_util.h" @@ -103,7 +103,7 @@ size_t offset = input.size() - sync_password_data_->length; base::string16 reuse_candidate = input.substr(offset); - if (password_manager_util::CalculateSyncPasswordHash( + if (HashPasswordManager::CalculateSyncPasswordHash( reuse_candidate, sync_password_data_->salt) == sync_password_data_->hash) { return reuse_candidate.size();
diff --git a/components/password_manager/core/browser/password_reuse_detector_unittest.cc b/components/password_manager/core/browser/password_reuse_detector_unittest.cc index 93bb2454..760f35a 100644 --- a/components/password_manager/core/browser/password_reuse_detector_unittest.cc +++ b/components/password_manager/core/browser/password_reuse_detector_unittest.cc
@@ -13,7 +13,6 @@ #include "components/autofill/core/common/password_form.h" #include "components/password_manager/core/browser/hash_password_manager.h" #include "components/password_manager/core/browser/password_manager_test_utils.h" -#include "components/password_manager/core/browser/password_manager_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -80,7 +79,7 @@ SyncPasswordData sync_password_data; sync_password_data.salt = "1234567890123456"; sync_password_data.length = sync_password.size(); - sync_password_data.hash = password_manager_util::CalculateSyncPasswordHash( + sync_password_data.hash = HashPasswordManager::CalculateSyncPasswordHash( base::ASCIIToUTF16(sync_password), sync_password_data.salt); return sync_password_data; }
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc index 9432109..a04fb42a 100644 --- a/components/password_manager/core/browser/password_store.cc +++ b/components/password_manager/core/browser/password_store.cc
@@ -19,12 +19,14 @@ #include "build/build_config.h" #include "components/autofill/core/common/password_form.h" #include "components/password_manager/core/browser/android_affiliation/affiliated_match_helper.h" +#include "components/password_manager/core/browser/password_manager_metrics_util.h" #include "components/password_manager/core/browser/password_manager_util.h" +#include "components/password_manager/core/browser/password_reuse_defines.h" #include "components/password_manager/core/browser/password_store_consumer.h" #include "components/password_manager/core/browser/password_syncable_service.h" #include "components/password_manager/core/browser/statistics_table.h" -#if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) #include "components/password_manager/core/browser/password_store_signin_notifier.h" #endif @@ -63,7 +65,7 @@ } // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) PasswordStore::CheckReuseRequest::CheckReuseRequest( PasswordReuseDetectorConsumer* consumer) : origin_task_runner_(base::SequencedTaskRunnerHandle::Get()), @@ -273,10 +275,14 @@ base::TimeDelta::FromSeconds(30)); } -#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) || \ - (defined(OS_LINUX) && !defined(OS_CHROMEOS)) - if (!sync_username.empty()) - hash_password_manager_.ReportIsSyncPasswordHashSavedMetric(); +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) + if (!sync_username.empty()) { + auto hash_password_state = + hash_password_manager_.HasPasswordHash() + ? metrics_util::IsSyncPasswordHashSaved::SAVED + : metrics_util::IsSyncPasswordHashSaved::NOT_SAVED; + metrics_util::LogIsSyncPasswordHashSaved(hash_password_state); + } #endif } @@ -335,7 +341,7 @@ } // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) void PasswordStore::CheckReuse(const base::string16& input, const std::string& domain, PasswordReuseDetectorConsumer* consumer) { @@ -355,6 +361,13 @@ std::move(sync_password_data))); } +void PasswordStore::SaveSyncPasswordHash( + const SyncPasswordData& sync_password_data) { + hash_password_manager_.SavePasswordHash(sync_password_data); + ScheduleTask(base::BindRepeating(&PasswordStore::SaveSyncPasswordHashImpl, + this, sync_password_data)); +} + void PasswordStore::ClearSyncPasswordHash() { hash_password_manager_.ClearSavedPasswordHash(); ScheduleTask(base::Bind(&PasswordStore::ClearSyncPasswordHashImpl, this)); @@ -386,7 +399,7 @@ syncable_service_.reset(new PasswordSyncableService(this)); syncable_service_->InjectStartSyncFlare(flare); // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) reuse_detector_ = new PasswordReuseDetector; GetAutofillableLoginsImpl( std::make_unique<GetLoginsRequest>(reuse_detector_)); @@ -449,7 +462,7 @@ if (syncable_service_) syncable_service_->ActOnPasswordStoreChanges(changes); // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) if (reuse_detector_) reuse_detector_->OnLoginsChanged(changes); #endif @@ -457,7 +470,7 @@ } // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) void PasswordStore::CheckReuseImpl(std::unique_ptr<CheckReuseRequest> request, const base::string16& input, const std::string& domain) { @@ -789,7 +802,7 @@ DCHECK(background_task_runner_->RunsTasksInCurrentSequence()); syncable_service_.reset(); // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) delete reuse_detector_; reuse_detector_ = nullptr; #endif
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h index be44eba..859c03ca 100644 --- a/components/password_manager/core/browser/password_store.h +++ b/components/password_manager/core/browser/password_store.h
@@ -24,7 +24,7 @@ #include "components/sync/model/syncable_service.h" // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) #include "components/password_manager/core/browser/hash_password_manager.h" #include "components/password_manager/core/browser/password_reuse_detector.h" #include "components/password_manager/core/browser/password_reuse_detector_consumer.h" @@ -248,7 +248,7 @@ base::WeakPtr<syncer::SyncableService> GetPasswordSyncableService(); // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) // Checks that some suffix of |input| equals to a password saved on another // registry controlled domain than |domain|. // If such suffix is found, |consumer|->OnReuseFound() is called on the same @@ -258,10 +258,12 @@ const std::string& domain, PasswordReuseDetectorConsumer* consumer); -#if !defined(OS_CHROMEOS) // Saves a hash of |password| for password reuse checking. virtual void SaveSyncPasswordHash(const base::string16& password); + // Saves |sync_password_data| for password reuse checking. + virtual void SaveSyncPasswordHash(const SyncPasswordData& sync_password_data); + // Clears the saved sync password hash. virtual void ClearSyncPasswordHash(); @@ -269,7 +271,6 @@ void SetPasswordStoreSigninNotifier( std::unique_ptr<PasswordStoreSigninNotifier> notifier); #endif -#endif protected: friend class base::RefCountedThreadSafe<PasswordStore>; @@ -307,7 +308,7 @@ }; // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) // Represents a single CheckReuse() request. Implements functionality to // listen to reuse events and propagate them to |consumer| on the sequence on // which CheckReuseRequest is created. @@ -434,7 +435,7 @@ void NotifyLoginsChanged(const PasswordStoreChangeList& changes) override; // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) // Synchronous implementation of CheckReuse(). void CheckReuseImpl(std::unique_ptr<CheckReuseRequest> request, const base::string16& input, @@ -601,13 +602,11 @@ std::unique_ptr<PasswordSyncableService> syncable_service_; std::unique_ptr<AffiliatedMatchHelper> affiliated_match_helper_; // TODO(crbug.com/706392): Fix password reuse detection for Android. -#if !defined(OS_ANDROID) && !defined(OS_IOS) +#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) // PasswordReuseDetector can be only destroyed on the background sequence. It // can't be owned by PasswordStore because PasswordStore can be destroyed on // the UI thread and DestroyOnBackgroundThread isn't guaranteed to be called. PasswordReuseDetector* reuse_detector_ = nullptr; -#endif -#if defined(SYNC_PASSWORD_REUSE_DETECTION_ENABLED) std::unique_ptr<PasswordStoreSigninNotifier> notifier_; HashPasswordManager hash_password_manager_; #endif
diff --git a/components/password_manager/core/common/password_manager_features.cc b/components/password_manager/core/common/password_manager_features.cc index db3d0856..278c59af 100644 --- a/components/password_manager/core/common/password_manager_features.cc +++ b/components/password_manager/core/common/password_manager_features.cc
@@ -14,7 +14,7 @@ // application will also be considered matches for, and be filled into // corresponding Web applications. const base::Feature kAffiliationBasedMatching = { - "affiliation-based-matching", base::FEATURE_ENABLED_BY_DEFAULT}; + "AffiliationBasedMatching", base::FEATURE_ENABLED_BY_DEFAULT}; // Use HTML based username detector. const base::Feature kEnableHtmlBasedUsernameDetector = { @@ -74,7 +74,7 @@ "protect-sync-credential-on-reauth", base::FEATURE_DISABLED_BY_DEFAULT}; // Controls the ability to export passwords from Chrome's settings page. -const base::Feature kPasswordExport = {"password-export", +const base::Feature kPasswordExport = {"PasswordExport", base::FEATURE_DISABLED_BY_DEFAULT}; // Controls the ability to import passwords from Chrome's settings page.
diff --git a/components/password_manager/sync/browser/sync_username_test_base.cc b/components/password_manager/sync/browser/sync_username_test_base.cc index dd779b0..922acd94 100644 --- a/components/password_manager/sync/browser/sync_username_test_base.cc +++ b/components/password_manager/sync/browser/sync_username_test_base.cc
@@ -38,7 +38,7 @@ } void SyncUsernameTestBase::FakeSignout() { - signin_manager_.clear_authenticated_user(); + signin_manager_.ClearAuthenticatedAccountId(); prefs_.SetString(prefs::kGoogleServicesAccountId, std::string()); }
diff --git a/components/password_manager/sync/browser/sync_username_test_base.h b/components/password_manager/sync/browser/sync_username_test_base.h index 77972b54..4717409 100644 --- a/components/password_manager/sync/browser/sync_username_test_base.h +++ b/components/password_manager/sync/browser/sync_username_test_base.h
@@ -63,9 +63,11 @@ public: FakeSigninManagerBase(SigninClient* client, AccountTrackerService* account_tracker_service) - : SigninManagerBase(client, account_tracker_service) {} + : SigninManagerBase(client, + account_tracker_service, + nullptr /* signin_error_controller */) {} - using SigninManagerBase::clear_authenticated_user; + using SigninManagerBase::ClearAuthenticatedAccountId; }; sync_preferences::TestingPrefServiceSyncable prefs_;
diff --git a/components/payments/mojom/BUILD.gn b/components/payments/mojom/BUILD.gn index 3ad1d93..91a3dba 100644 --- a/components/payments/mojom/BUILD.gn +++ b/components/payments/mojom/BUILD.gn
@@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/config/android/rules.gni") + java_group("mojom_java") { # This is a temporary empty target. It is needed to enable prerequisite # downstream changes to be landed without breaking the Android build. It will
diff --git a/components/previews/content/previews_optimization_guide.cc b/components/previews/content/previews_optimization_guide.cc index 3aa60653..d745063 100644 --- a/components/previews/content/previews_optimization_guide.cc +++ b/components/previews/content/previews_optimization_guide.cc
@@ -48,6 +48,9 @@ PreviewsOptimizationGuide::Hints::CreateFromConfig( const optimization_guide::proto::Configuration& config) { std::unique_ptr<Hints> hints(new Hints()); + // The condition set ID is a simple increasing counter that matches the + // order of hints in the config (where earlier hints in the config take + // precendence over later hints in the config if there are multiple matches). url_matcher::URLMatcherConditionSet::ID id = 0; url_matcher::URLMatcherConditionFactory* condition_factory = hints->url_matcher_.condition_factory(); @@ -75,18 +78,19 @@ // Create whitelist condition set out of the optimizations that are // whitelisted for the host suffix. + std::set<PreviewsType> whitelisted_optimizations; for (const auto optimization : hint.whitelisted_optimizations()) { if (optimization.optimization_type() == optimization_guide::proto::NOSCRIPT) { - url_matcher::URLMatcherCondition condition = - condition_factory->CreateHostSuffixCondition(hint.key()); - all_conditions.push_back(new url_matcher::URLMatcherConditionSet( - id, std::set<url_matcher::URLMatcherCondition>{condition})); - hints->whitelist_[id] = std::set<PreviewsType>{PreviewsType::NOSCRIPT}; - id++; - break; + whitelisted_optimizations.insert(PreviewsType::NOSCRIPT); } } + url_matcher::URLMatcherCondition condition = + condition_factory->CreateHostSuffixCondition(hint.key()); + all_conditions.push_back(new url_matcher::URLMatcherConditionSet( + id, std::set<url_matcher::URLMatcherCondition>{condition})); + hints->whitelist_[id] = whitelisted_optimizations; + id++; } hints->url_matcher_.AddConditionSets(all_conditions); return hints; @@ -96,18 +100,21 @@ PreviewsType type) { std::set<url_matcher::URLMatcherConditionSet::ID> matches = url_matcher_.MatchURL(url); - for (const auto& match : matches) { - const auto whitelist_iter = whitelist_.find(match); - if (whitelist_iter == whitelist_.end()) { - continue; - } - const auto& whitelisted_previews = whitelist_iter->second; - std::set<PreviewsType>::iterator found = whitelisted_previews.find(type); - // TODO(crbug.com/783237): Make sure this checks for granularity of matched - // condition when more than one host suffix is matched. - return found != whitelisted_previews.end(); + + // Only consider the first match in iteration order as it takes precendence + // if there are multiple matches. + const auto& first_match = matches.begin(); + if (first_match == matches.end()) { + return false; } - return false; + + const auto whitelist_iter = whitelist_.find(*first_match); + if (whitelist_iter == whitelist_.end()) { + return false; + } + + const auto& whitelisted_previews = whitelist_iter->second; + return whitelisted_previews.find(type) != whitelisted_previews.end(); } PreviewsOptimizationGuide::PreviewsOptimizationGuide(
diff --git a/components/previews/content/previews_optimization_guide_unittest.cc b/components/previews/content/previews_optimization_guide_unittest.cc index 3e62a75e..186ccdaa9 100644 --- a/components/previews/content/previews_optimization_guide_unittest.cc +++ b/components/previews/content/previews_optimization_guide_unittest.cc
@@ -212,6 +212,63 @@ }); } +TEST_F(PreviewsOptimizationGuideTest, IsWhitelistedWithMultipleHintMatches) { + optimization_guide::proto::Configuration config; + + // Whitelist NoScript for indoor.sports.yahoo.com: + optimization_guide::proto::Hint* hint1 = config.add_hints(); + hint1->set_key("indoor.sports.yahoo.com"); + hint1->set_key_representation(optimization_guide::proto::HOST_SUFFIX); + optimization_guide::proto::Optimization* optimization1 = + hint1->add_whitelisted_optimizations(); + optimization1->set_optimization_type(optimization_guide::proto::NOSCRIPT); + + // No optimizations for sports.yahoo.com: + optimization_guide::proto::Hint* hint2 = config.add_hints(); + hint2->set_key("sports.yahoo.com"); + hint2->set_key_representation(optimization_guide::proto::HOST_SUFFIX); + + // Whitelist NoScript for base domain yahoo.com: + optimization_guide::proto::Hint* hint3 = config.add_hints(); + hint3->set_key("yahoo.com"); + hint3->set_key_representation(optimization_guide::proto::HOST_SUFFIX); + optimization_guide::proto::Optimization* optimization3 = + hint3->add_whitelisted_optimizations(); + optimization3->set_optimization_type(optimization_guide::proto::NOSCRIPT); + + // No optimizations for mail.yahoo.com: + optimization_guide::proto::Hint* hint4 = config.add_hints(); + hint4->set_key("mail.yahoo.com"); + hint4->set_key_representation(optimization_guide::proto::HOST_SUFFIX); + + ProcessHints(config); + RunUntilIdle(); + + std::unique_ptr<net::URLRequest> request1 = + CreateRequestWithURL(GURL("https://yahoo.com")); + EXPECT_TRUE(guide()->IsWhitelisted(*request1, PreviewsType::NOSCRIPT)); + + std::unique_ptr<net::URLRequest> request2 = + CreateRequestWithURL(GURL("https://sports.yahoo.com")); + // Uses "sports.yahoo.com" match before "yahoo.com" match. + EXPECT_FALSE(guide()->IsWhitelisted(*request2, PreviewsType::NOSCRIPT)); + + std::unique_ptr<net::URLRequest> request3 = + CreateRequestWithURL(GURL("https://mail.yahoo.com")); + // Uses "yahoo.com" match before "mail.yahoo.com" match. + EXPECT_TRUE(guide()->IsWhitelisted(*request3, PreviewsType::NOSCRIPT)); + + std::unique_ptr<net::URLRequest> request4 = + CreateRequestWithURL(GURL("https://indoor.sports.yahoo.com")); + // Uses "indoor.sports.yahoo.com" match before "sports.yahoo.com" match. + EXPECT_TRUE(guide()->IsWhitelisted(*request4, PreviewsType::NOSCRIPT)); + + std::unique_ptr<net::URLRequest> request5 = + CreateRequestWithURL(GURL("https://outdoor.sports.yahoo.com")); + // Uses "sports.yahoo.com" match before "yahoo.com" match. + EXPECT_FALSE(guide()->IsWhitelisted(*request5, PreviewsType::NOSCRIPT)); +} + TEST_F(PreviewsOptimizationGuideTest, RemoveObserverCalledAtDestruction) { EXPECT_FALSE(optimization_guide_service()->RemoveObserverCalled());
diff --git a/components/previews/core/previews_experiments.cc b/components/previews/core/previews_experiments.cc index dffb9c6e..e160412 100644 --- a/components/previews/core/previews_experiments.cc +++ b/components/previews/core/previews_experiments.cc
@@ -107,9 +107,9 @@ } base::TimeDelta HostIndifferentBlackListPerHostDuration() { - return base::TimeDelta::FromDays(GetParamValueAsInt( - kClientSidePreviewsFieldTrial, - "host_indifferent_black_list_duration_in_days", 365 * 100)); + return base::TimeDelta::FromDays( + GetParamValueAsInt(kClientSidePreviewsFieldTrial, + "host_indifferent_black_list_duration_in_days", 30)); } base::TimeDelta SingleOptOutDuration() {
diff --git a/components/previews/core/previews_experiments_unittest.cc b/components/previews/core/previews_experiments_unittest.cc index cb9630b..1ee40c0 100644 --- a/components/previews/core/previews_experiments_unittest.cc +++ b/components/previews/core/previews_experiments_unittest.cc
@@ -51,7 +51,7 @@ EXPECT_EQ(2, params::PerHostBlackListOptOutThreshold()); EXPECT_EQ(6, params::HostIndifferentBlackListOptOutThreshold()); EXPECT_EQ(base::TimeDelta::FromDays(30), params::PerHostBlackListDuration()); - EXPECT_EQ(base::TimeDelta::FromDays(365 * 100), + EXPECT_EQ(base::TimeDelta::FromDays(30), params::HostIndifferentBlackListPerHostDuration()); EXPECT_EQ(base::TimeDelta::FromSeconds(60 * 5), params::SingleOptOutDuration());
diff --git a/components/previews/core/previews_user_data.cc b/components/previews/core/previews_user_data.cc index d1374b8..37cb2e83 100644 --- a/components/previews/core/previews_user_data.cc +++ b/components/previews/core/previews_user_data.cc
@@ -5,39 +5,17 @@ #include "components/previews/core/previews_user_data.h" #include "base/memory/ptr_util.h" -#include "base/values.h" #include "net/url_request/url_request.h" namespace previews { -namespace { const void* const kPreviewsUserDataKey = &kPreviewsUserDataKey; -const char* kPageIdKey = "page_id"; -const char* kCommittedPreviewsTypeKey = "committed_previews_type"; -} // namespace PreviewsUserData::PreviewsUserData(uint64_t page_id) : page_id_(page_id), committed_previews_type_(PreviewsType::NONE) {} PreviewsUserData::~PreviewsUserData() {} -base::Value PreviewsUserData::ToValue() { - base::Value value(base::Value::Type::DICTIONARY); - - // Store |page_id_| as a string because base::Value can't store a 64 bits - // integer. - value.SetKey(kPageIdKey, base::Value(std::to_string(page_id_))); - value.SetKey(kCommittedPreviewsTypeKey, - base::Value((int)committed_previews_type_)); - - return value; -} - -PreviewsUserData::PreviewsUserData(const base::Value& value) - : page_id_(std::stoll(value.FindKey(kPageIdKey)->GetString())), - committed_previews_type_( - (PreviewsType)value.FindKey(kCommittedPreviewsTypeKey)->GetInt()) {} - std::unique_ptr<PreviewsUserData> PreviewsUserData::DeepCopy() const { std::unique_ptr<PreviewsUserData> copy(new PreviewsUserData(page_id_)); copy->SetCommittedPreviewsType(committed_previews_type_);
diff --git a/components/previews/core/previews_user_data.h b/components/previews/core/previews_user_data.h index bd8aa66..a1fdc83 100644 --- a/components/previews/core/previews_user_data.h +++ b/components/previews/core/previews_user_data.h
@@ -11,10 +11,6 @@ #include "base/supports_user_data.h" #include "components/previews/core/previews_experiments.h" -namespace base { -class Value; -} - namespace net { class URLRequest; } @@ -27,10 +23,6 @@ PreviewsUserData(uint64_t page_id); ~PreviewsUserData() override; - // Convert from/to a base::Value. - base::Value ToValue(); - explicit PreviewsUserData(const base::Value& value); - // Makes a deep copy. std::unique_ptr<PreviewsUserData> DeepCopy() const;
diff --git a/components/previews/core/previews_user_data_unittest.cc b/components/previews/core/previews_user_data_unittest.cc index 6bfb7cda..2301929 100644 --- a/components/previews/core/previews_user_data_unittest.cc +++ b/components/previews/core/previews_user_data_unittest.cc
@@ -10,7 +10,6 @@ #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" -#include "base/values.h" #include "net/base/request_priority.h" #include "net/nqe/effective_connection_type.h" #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" @@ -61,29 +60,6 @@ EXPECT_EQ(id, data->DeepCopy()->page_id()); } -TEST_F(PreviewsUserDataTest, Serialization) { - // page_id - { - PreviewsUserData data(1ull << 60); - PreviewsUserData clone(data.ToValue()); - - EXPECT_EQ(1ull << 60, data.page_id()); - EXPECT_EQ(1ull << 60, clone.page_id()); - } - - // page_id - { - PreviewsUserData data(0ull); - PreviewsUserData clone_a(data.ToValue()); - data.SetCommittedPreviewsType(PreviewsType::OFFLINE); - PreviewsUserData clone_b(data.ToValue()); - - EXPECT_FALSE(clone_a.HasCommittedPreviewsType()); - EXPECT_TRUE(clone_b.HasCommittedPreviewsType()); - EXPECT_EQ(PreviewsType::OFFLINE, clone_b.GetCommittedPreviewsType()); - } -} - } // namespace } // namespace previews
diff --git a/components/resources/autofill_scaled_resources.grdp b/components/resources/autofill_scaled_resources.grdp index f4c1b62..43690fe 100644 --- a/components/resources/autofill_scaled_resources.grdp +++ b/components/resources/autofill_scaled_resources.grdp
@@ -10,6 +10,7 @@ <structure type="chrome_scaled_image" name="IDR_AUTOFILL_CC_MIR" file="autofill/mir.png" /> <structure type="chrome_scaled_image" name="IDR_AUTOFILL_CC_UNIONPAY" file="autofill/unionpay.png" /> <structure type="chrome_scaled_image" name="IDR_AUTOFILL_CC_VISA" file="autofill/visa.png" /> + <structure type="chrome_scaled_image" name="IDR_AUTOFILL_GOOGLE_PAY" file="autofill/googlepay.png" /> <!-- These are not used on desktop, only Android, so use a placeholder file. TODO(rouslan): Remove non-keyboard-accessory icon when keyboard
diff --git a/components/resources/default_100_percent/autofill/googlepay.png b/components/resources/default_100_percent/autofill/googlepay.png new file mode 100644 index 0000000..4be53902 --- /dev/null +++ b/components/resources/default_100_percent/autofill/googlepay.png Binary files differ
diff --git a/components/resources/default_200_percent/autofill/googlepay.png b/components/resources/default_200_percent/autofill/googlepay.png new file mode 100644 index 0000000..1a2c438 --- /dev/null +++ b/components/resources/default_200_percent/autofill/googlepay.png Binary files differ
diff --git a/components/resources/default_300_percent/autofill/googlepay.png b/components/resources/default_300_percent/autofill/googlepay.png new file mode 100644 index 0000000..add38f1 --- /dev/null +++ b/components/resources/default_300_percent/autofill/googlepay.png Binary files differ
diff --git a/components/safe_browsing/browser/base_parallel_resource_throttle.cc b/components/safe_browsing/browser/base_parallel_resource_throttle.cc index 6fc6a12..23e0d34 100644 --- a/components/safe_browsing/browser/base_parallel_resource_throttle.cc +++ b/components/safe_browsing/browser/base_parallel_resource_throttle.cc
@@ -124,7 +124,7 @@ resource_request.url = request_->url(); resource_request.method = request_->method(); - url_loader_throttle_holder_->throttle()->WillStartRequest(resource_request, + url_loader_throttle_holder_->throttle()->WillStartRequest(&resource_request, defer); DCHECK(!*defer); throttle_in_band_ = false; @@ -139,8 +139,11 @@ return; } - url_loader_throttle_holder_->throttle()->WillRedirectRequest(redirect_info, - defer); + // The safe browsing URLLoaderThrottle doesn't use ResourceResponse, so pass + // in an empty struct to avoid changing ResourceThrottle signature. + content::ResourceResponseHead resource_response; + url_loader_throttle_holder_->throttle()->WillRedirectRequest( + redirect_info, resource_response, defer); DCHECK(!*defer); throttle_in_band_ = false; }
diff --git a/components/safe_browsing/browser/browser_url_loader_throttle.cc b/components/safe_browsing/browser/browser_url_loader_throttle.cc index bd523d2..a81ab89 100644 --- a/components/safe_browsing/browser/browser_url_loader_throttle.cc +++ b/components/safe_browsing/browser/browser_url_loader_throttle.cc
@@ -45,27 +45,28 @@ } void BrowserURLLoaderThrottle::WillStartRequest( - const content::ResourceRequest& request, + content::ResourceRequest* request, bool* defer) { DCHECK_EQ(0u, pending_checks_); DCHECK(!blocked_); DCHECK(!url_checker_); - original_url_ = request.url; + original_url_ = request->url; pending_checks_++; url_checker_ = base::MakeUnique<SafeBrowsingUrlCheckerImpl>( - request.headers, request.load_flags, request.resource_type, - request.has_user_gesture, std::move(url_checker_delegate_), + request->headers, request->load_flags, request->resource_type, + request->has_user_gesture, std::move(url_checker_delegate_), web_contents_getter_); url_checker_->CheckUrl( - request.url, request.method, + request->url, request->method, base::BindOnce(&BrowserURLLoaderThrottle::OnCheckUrlResult, base::Unretained(this))); } void BrowserURLLoaderThrottle::WillRedirectRequest( const net::RedirectInfo& redirect_info, + const content::ResourceResponseHead& response_head, bool* defer) { if (blocked_) { // OnCheckUrlResult() has set |blocked_| to true and called
diff --git a/components/safe_browsing/browser/browser_url_loader_throttle.h b/components/safe_browsing/browser/browser_url_loader_throttle.h index 2e9d200..8d31786 100644 --- a/components/safe_browsing/browser/browser_url_loader_throttle.h +++ b/components/safe_browsing/browser/browser_url_loader_throttle.h
@@ -36,9 +36,10 @@ ~BrowserURLLoaderThrottle() override; // content::URLLoaderThrottle implementation. - void WillStartRequest(const content::ResourceRequest& request, + void WillStartRequest(content::ResourceRequest* request, bool* defer) override; void WillRedirectRequest(const net::RedirectInfo& redirect_info, + const content::ResourceResponseHead& response_head, bool* defer) override; void WillProcessResponse(const GURL& response_url, const content::ResourceResponseHead& response_head,
diff --git a/components/safe_browsing/db/v4_store.cc b/components/safe_browsing/db/v4_store.cc index 8e264bf..ad4fbb3f 100644 --- a/components/safe_browsing/db/v4_store.cc +++ b/components/safe_browsing/db/v4_store.cc
@@ -494,9 +494,12 @@ for (const auto& iterator_pair : iterator_map) { PrefixSize prefix_size = iterator_pair.first; + CHECK_GE(prefix_size, 4u); // Convert to DCHECK after fixing 787460. HashPrefixes::const_iterator start = iterator_pair.second; - CHECK(hash_prefix_map.end() != hash_prefix_map.find(prefix_size)); + CHECK(hash_prefix_map.end() != + hash_prefix_map.find( + prefix_size)); // Convert to DCHECK after fixing 787460. const HashPrefixes& hash_prefixes = hash_prefix_map.at(prefix_size); PrefixSize distance = std::distance(start, hash_prefixes.end()); @@ -600,12 +603,14 @@ // Update the iterator map, which means that we have merged one hash // prefix of size |next_smallest_prefix_size| from the old store. - old_iterator_map[next_smallest_prefix_size] += next_smallest_prefix_size; + old_iterator_map.at(next_smallest_prefix_size) += + next_smallest_prefix_size; if (!raw_removals || removals_iter == raw_removals->end() || *removals_iter != total_picked_from_old) { // Append the smallest hash to the appropriate list. - hash_prefix_map_[next_smallest_prefix_size] += next_smallest_prefix_old; + hash_prefix_map_.at(next_smallest_prefix_size) += + next_smallest_prefix_old; if (calculate_checksum) { checksum_ctx->Update(next_smallest_prefix_old.data(), @@ -625,7 +630,7 @@ next_smallest_prefix_size = next_smallest_prefix_additions.size(); // Append the smallest hash to the appropriate list. - hash_prefix_map_[next_smallest_prefix_size] += + hash_prefix_map_.at(next_smallest_prefix_size) += next_smallest_prefix_additions; if (calculate_checksum) { @@ -635,7 +640,7 @@ // Update the iterator map, which means that we have merged one hash // prefix of size |next_smallest_prefix_size| from the update. - additions_iterator_map[next_smallest_prefix_size] += + additions_iterator_map.at(next_smallest_prefix_size) += next_smallest_prefix_size; // Find the next smallest unmerged element in the additions map. @@ -821,6 +826,7 @@ IteratorMap iterator_map; HashPrefix next_smallest_prefix; InitializeIteratorMap(hash_prefix_map_, &iterator_map); + CHECK_EQ(hash_prefix_map_.size(), iterator_map.size()); bool has_unmerged = GetNextSmallestUnmergedPrefix( hash_prefix_map_, iterator_map, &next_smallest_prefix); @@ -832,7 +838,7 @@ // Update the iterator map, which means that we have read one hash // prefix of size |next_smallest_prefix_size| from hash_prefix_map_. - iterator_map[next_smallest_prefix_size] += next_smallest_prefix_size; + iterator_map.at(next_smallest_prefix_size) += next_smallest_prefix_size; checksum_ctx->Update(next_smallest_prefix.data(), next_smallest_prefix_size);
diff --git a/components/safe_browsing/features.cc b/components/safe_browsing/features.cc index 50108df..eaf0c20 100644 --- a/components/safe_browsing/features.cc +++ b/components/safe_browsing/features.cc
@@ -54,6 +54,9 @@ const base::Feature kDispatchSafetyNetCheckOffThread{ "DispatchSafetyNetCheckOffThread", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kAppendRecentNavigationEvents{ + "AppendRecentNavigationEvents", base::FEATURE_DISABLED_BY_DEFAULT}; + namespace { // List of experimental features. Boolean value for each list member should be // set to true if the experiment is currently running at a probability other @@ -65,6 +68,7 @@ } kExperimentalFeatures[]{ {&kAdSamplerCollectButDontSendFeature, false}, {&kAdSamplerTriggerFeature, false}, + {&kAppendRecentNavigationEvents, true}, {&kGaiaPasswordReuseReporting, true}, {&kGoogleBrandedPhishingWarning, true}, {&kParallelUrlCheck, true},
diff --git a/components/safe_browsing/features.h b/components/safe_browsing/features.h index 49efb603..cf03c74 100644 --- a/components/safe_browsing/features.h +++ b/components/safe_browsing/features.h
@@ -44,6 +44,10 @@ // only. extern const base::Feature kDispatchSafetyNetCheckOffThread; +// Controls whether to add recent navigation events to referrer chain for SBER +// users if referrer chain is incomplete. +extern const base::Feature kAppendRecentNavigationEvents; + base::ListValue GetFeatureStatusList(); #endif // COMPONENTS_SAFE_BROWSING_FEATURES_H_
diff --git a/components/safe_browsing/renderer/renderer_url_loader_throttle.cc b/components/safe_browsing/renderer/renderer_url_loader_throttle.cc index 315c9aa1..4116c54 100644 --- a/components/safe_browsing/renderer/renderer_url_loader_throttle.cc +++ b/components/safe_browsing/renderer/renderer_url_loader_throttle.cc
@@ -36,7 +36,7 @@ } void RendererURLLoaderThrottle::WillStartRequest( - const content::ResourceRequest& request, + content::ResourceRequest* request, bool* defer) { DCHECK_EQ(0u, pending_checks_); DCHECK(!blocked_); @@ -49,16 +49,16 @@ safe_browsing_ = safe_browsing_ptr_.get(); } - original_url_ = request.url; + original_url_ = request->url; pending_checks_++; // Use a weak pointer to self because |safe_browsing_| may not be owned by // this object. net::HttpRequestHeaders headers; - headers.CopyFrom(request.headers); + headers.CopyFrom(request->headers); safe_browsing_->CreateCheckerAndCheck( - render_frame_id_, mojo::MakeRequest(&url_checker_), request.url, - request.method, headers, request.load_flags, request.resource_type, - request.has_user_gesture, + render_frame_id_, mojo::MakeRequest(&url_checker_), request->url, + request->method, headers, request->load_flags, request->resource_type, + request->has_user_gesture, base::BindOnce(&RendererURLLoaderThrottle::OnCheckUrlResult, weak_factory_.GetWeakPtr())); safe_browsing_ = nullptr; @@ -69,6 +69,7 @@ void RendererURLLoaderThrottle::WillRedirectRequest( const net::RedirectInfo& redirect_info, + const content::ResourceResponseHead& response_head, bool* defer) { // If |blocked_| is true, the resource load has been canceled and there // shouldn't be such a notification.
diff --git a/components/safe_browsing/renderer/renderer_url_loader_throttle.h b/components/safe_browsing/renderer/renderer_url_loader_throttle.h index 63cd196..41137a73 100644 --- a/components/safe_browsing/renderer/renderer_url_loader_throttle.h +++ b/components/safe_browsing/renderer/renderer_url_loader_throttle.h
@@ -32,9 +32,10 @@ private: // content::URLLoaderThrottle implementation. void DetachFromCurrentSequence() override; - void WillStartRequest(const content::ResourceRequest& request, + void WillStartRequest(content::ResourceRequest* request, bool* defer) override; void WillRedirectRequest(const net::RedirectInfo& redirect_info, + const content::ResourceResponseHead& response_head, bool* defer) override; void WillProcessResponse(const GURL& response_url, const content::ResourceResponseHead& response_head,
diff --git a/components/safe_browsing/triggers/ad_sampler_trigger.cc b/components/safe_browsing/triggers/ad_sampler_trigger.cc index c73dadc..ba8237b 100644 --- a/components/safe_browsing/triggers/ad_sampler_trigger.cc +++ b/components/safe_browsing/triggers/ad_sampler_trigger.cc
@@ -50,9 +50,10 @@ base::GetFieldTrialParamValueByFeature( kAdSamplerTriggerFeature, kAdSamplerFrequencyDenominatorParam); int result; - return base::StringToInt(sampler_frequency_denominator, &result) - ? result - : kSamplerFrequencyDisabled; + if (!base::StringToInt(sampler_frequency_denominator, &result)) + return kSamplerFrequencyDisabled; + + return result; } bool DetectGoogleAd(content::RenderFrameHost* render_frame_host,
diff --git a/components/signin/core/browser/fake_signin_manager.cc b/components/signin/core/browser/fake_signin_manager.cc index a54e41e..9a21214 100644 --- a/components/signin/core/browser/fake_signin_manager.cc +++ b/components/signin/core/browser/fake_signin_manager.cc
@@ -12,8 +12,11 @@ FakeSigninManagerBase::FakeSigninManagerBase( SigninClient* client, - AccountTrackerService* account_tracker_service) - : SigninManagerBase(client, account_tracker_service) {} + AccountTrackerService* account_tracker_service, + SigninErrorController* signin_error_controller) + : SigninManagerBase(client, + account_tracker_service, + signin_error_controller) {} FakeSigninManagerBase::~FakeSigninManagerBase() {} @@ -27,11 +30,13 @@ SigninClient* client, ProfileOAuth2TokenService* token_service, AccountTrackerService* account_tracker_service, - GaiaCookieManagerService* cookie_manager_service) + GaiaCookieManagerService* cookie_manager_service, + SigninErrorController* signin_error_controller) : SigninManager(client, token_service, account_tracker_service, - cookie_manager_service), + cookie_manager_service, + signin_error_controller), token_service_(token_service) {} FakeSigninManager::~FakeSigninManager() {}
diff --git a/components/signin/core/browser/fake_signin_manager.h b/components/signin/core/browser/fake_signin_manager.h index b6ede8c58..26cc7f8 100644 --- a/components/signin/core/browser/fake_signin_manager.h +++ b/components/signin/core/browser/fake_signin_manager.h
@@ -17,8 +17,10 @@ class FakeSigninManagerBase : public SigninManagerBase { public: - FakeSigninManagerBase(SigninClient* client, - AccountTrackerService* account_tracker_service); + FakeSigninManagerBase( + SigninClient* client, + AccountTrackerService* account_tracker_service, + SigninErrorController* signin_error_controller = nullptr); ~FakeSigninManagerBase() override; void SignIn(const std::string& account_id); @@ -33,7 +35,9 @@ FakeSigninManager(SigninClient* client, ProfileOAuth2TokenService* token_service, AccountTrackerService* account_tracker_service, - GaiaCookieManagerService* cookie_manager_service); + GaiaCookieManagerService* cookie_manager_service, + SigninErrorController* signin_error_controller = nullptr); + ~FakeSigninManager() override; void set_auth_in_progress(const std::string& account_id) {
diff --git a/components/signin/core/browser/signin_error_controller.cc b/components/signin/core/browser/signin_error_controller.cc index 4b56f347..c9d53d0f 100644 --- a/components/signin/core/browser/signin_error_controller.cc +++ b/components/signin/core/browser/signin_error_controller.cc
@@ -19,14 +19,14 @@ SigninErrorController::AuthStatusProvider::~AuthStatusProvider() { } -SigninErrorController::SigninErrorController() - : auth_error_(GoogleServiceAuthError::AuthErrorNone()) { -} +SigninErrorController::SigninErrorController(AccountMode mode) + : account_mode_(mode), + auth_error_(GoogleServiceAuthError::AuthErrorNone()) {} SigninErrorController::~SigninErrorController() { DCHECK(provider_set_.empty()) - << "All AuthStatusProviders should be unregistered before" - << " SigninErrorController::Shutdown() is called"; + << "All AuthStatusProviders should be unregistered before " + << "SigninErrorController is destroyed"; } void SigninErrorController::AddProvider(const AuthStatusProvider* provider) { @@ -55,6 +55,14 @@ // error we find. for (AuthStatusProviderSet::const_iterator it = provider_set_.begin(); it != provider_set_.end(); ++it) { + std::string account_id = (*it)->GetAccountId(); + + // In PRIMARY_ACCOUNT mode, ignore all secondary accounts. + if (account_mode_ == AccountMode::PRIMARY_ACCOUNT && + (account_id != primary_account_id_)) { + continue; + } + GoogleServiceAuthError error = (*it)->GetAuthStatus(); // Ignore the states we don't want to elevate to the user. @@ -63,8 +71,6 @@ continue; } - std::string account_id = (*it)->GetAccountId(); - // Prioritize this error if it matches the previous |auth_error_|. if (error.state() == prev_state && account_id == prev_account_id) { auth_error_ = error; @@ -101,6 +107,12 @@ auth_error_.state() != GoogleServiceAuthError::CONNECTION_FAILED; } +void SigninErrorController::SetPrimaryAccountID(const std::string& account_id) { + primary_account_id_ = account_id; + if (account_mode_ == AccountMode::PRIMARY_ACCOUNT) + AuthStatusChanged(); // Recompute the error state. +} + void SigninErrorController::AddObserver(Observer* observer) { observer_list_.AddObserver(observer); }
diff --git a/components/signin/core/browser/signin_error_controller.h b/components/signin/core/browser/signin_error_controller.h index 1f1182fb..4e4f8ee 100644 --- a/components/signin/core/browser/signin_error_controller.h +++ b/components/signin/core/browser/signin_error_controller.h
@@ -18,6 +18,16 @@ // invoke AuthStatusChanged() when their authentication state may have changed. class SigninErrorController : public KeyedService { public: + enum class AccountMode { + // Signin error controller monitors all the accounts. When multiple accounts + // are in error state, only one of the errors is reported. + ANY_ACCOUNT, + + // Only errors on the primary account are reported. Other accounts are + // ignored. + PRIMARY_ACCOUNT + }; + class AuthStatusProvider { public: AuthStatusProvider(); @@ -39,7 +49,7 @@ virtual void OnErrorChanged() = 0; }; - SigninErrorController(); + explicit SigninErrorController(AccountMode mode); ~SigninErrorController() override; // Adds a provider which the SigninErrorController object will start querying @@ -56,6 +66,9 @@ // True if there exists an error worth elevating to the user. bool HasError() const; + // Sets the primary account id. Only used in the PRIMARY_ACCOUNT account mode. + void SetPrimaryAccountID(const std::string& account_id); + void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); @@ -63,8 +76,12 @@ const GoogleServiceAuthError& auth_error() const { return auth_error_; } private: + const AccountMode account_mode_; std::set<const AuthStatusProvider*> provider_set_; + // The primary account ID. Only used in the PRIMARY_ACCOUNT account mode. + std::string primary_account_id_; + // The account that generated the last auth error. std::string error_account_id_;
diff --git a/components/signin/core/browser/signin_error_controller_unittest.cc b/components/signin/core/browser/signin_error_controller_unittest.cc index f8822d39..62bec6a8 100644 --- a/components/signin/core/browser/signin_error_controller_unittest.cc +++ b/components/signin/core/browser/signin_error_controller_unittest.cc
@@ -16,89 +16,88 @@ static const char kTestAccountId[] = "testuser@test.com"; static const char kOtherTestAccountId[] = "otheruser@test.com"; -class SigninErrorControllerTest : public testing::Test { - public: - void SetUp() override { - error_controller_.reset(new SigninErrorController()); - } - - std::unique_ptr<SigninErrorController> error_controller_; -}; - -TEST_F(SigninErrorControllerTest, NoErrorAuthStatusProviders) { +TEST(SigninErrorControllerTest, NoErrorAuthStatusProviders) { + SigninErrorController error_controller( + SigninErrorController::AccountMode::ANY_ACCOUNT); std::unique_ptr<FakeAuthStatusProvider> provider; // No providers. - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); // Add a provider. - provider.reset(new FakeAuthStatusProvider(error_controller_.get())); - ASSERT_FALSE(error_controller_->HasError()); + provider.reset(new FakeAuthStatusProvider(&error_controller)); + ASSERT_FALSE(error_controller.HasError()); // Remove the provider. provider.reset(); - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); } -TEST_F(SigninErrorControllerTest, ErrorAuthStatusProvider) { +TEST(SigninErrorControllerTest, ErrorAuthStatusProvider) { + SigninErrorController error_controller( + SigninErrorController::AccountMode::ANY_ACCOUNT); std::unique_ptr<FakeAuthStatusProvider> provider; std::unique_ptr<FakeAuthStatusProvider> error_provider; - provider.reset(new FakeAuthStatusProvider(error_controller_.get())); - ASSERT_FALSE(error_controller_->HasError()); + provider.reset(new FakeAuthStatusProvider(&error_controller)); + ASSERT_FALSE(error_controller.HasError()); - error_provider.reset(new FakeAuthStatusProvider(error_controller_.get())); + error_provider.reset(new FakeAuthStatusProvider(&error_controller)); error_provider->SetAuthError( kTestAccountId, GoogleServiceAuthError( GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); - ASSERT_TRUE(error_controller_->HasError()); + ASSERT_TRUE(error_controller.HasError()); error_provider.reset(); - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); provider.reset(); // All providers should be removed now. - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); } -TEST_F(SigninErrorControllerTest, AuthStatusProviderErrorTransition) { +TEST(SigninErrorControllerTest, AuthStatusProviderErrorTransition) { + SigninErrorController error_controller( + SigninErrorController::AccountMode::ANY_ACCOUNT); std::unique_ptr<FakeAuthStatusProvider> provider0( - new FakeAuthStatusProvider(error_controller_.get())); + new FakeAuthStatusProvider(&error_controller)); std::unique_ptr<FakeAuthStatusProvider> provider1( - new FakeAuthStatusProvider(error_controller_.get())); + new FakeAuthStatusProvider(&error_controller)); - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); provider0->SetAuthError( kTestAccountId, GoogleServiceAuthError( GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); - ASSERT_TRUE(error_controller_->HasError()); + ASSERT_TRUE(error_controller.HasError()); provider1->SetAuthError( kTestAccountId, GoogleServiceAuthError(GoogleServiceAuthError::ACCOUNT_DISABLED)); - ASSERT_TRUE(error_controller_->HasError()); + ASSERT_TRUE(error_controller.HasError()); // Now resolve the auth errors - the menu item should go away. provider0->SetAuthError(kTestAccountId, GoogleServiceAuthError::AuthErrorNone()); - ASSERT_TRUE(error_controller_->HasError()); + ASSERT_TRUE(error_controller.HasError()); provider1->SetAuthError(kTestAccountId, GoogleServiceAuthError::AuthErrorNone()); - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); provider0.reset(); provider1.reset(); - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); } -TEST_F(SigninErrorControllerTest, AuthStatusProviderAccountTransition) { +TEST(SigninErrorControllerTest, AuthStatusProviderAccountTransitionAnyAccount) { + SigninErrorController error_controller( + SigninErrorController::AccountMode::ANY_ACCOUNT); std::unique_ptr<FakeAuthStatusProvider> provider0( - new FakeAuthStatusProvider(error_controller_.get())); + new FakeAuthStatusProvider(&error_controller)); std::unique_ptr<FakeAuthStatusProvider> provider1( - new FakeAuthStatusProvider(error_controller_.get())); + new FakeAuthStatusProvider(&error_controller)); - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); provider0->SetAuthError( kTestAccountId, @@ -107,9 +106,8 @@ provider1->SetAuthError( kOtherTestAccountId, GoogleServiceAuthError(GoogleServiceAuthError::NONE)); - ASSERT_TRUE(error_controller_->HasError()); - ASSERT_STREQ(kTestAccountId, - error_controller_->error_account_id().c_str()); + ASSERT_TRUE(error_controller.HasError()); + ASSERT_STREQ(kTestAccountId, error_controller.error_account_id().c_str()); // Swap providers reporting errors. provider1->set_error_without_status_change( @@ -117,26 +115,70 @@ GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); provider0->set_error_without_status_change( GoogleServiceAuthError(GoogleServiceAuthError::NONE)); - error_controller_->AuthStatusChanged(); - ASSERT_TRUE(error_controller_->HasError()); + error_controller.AuthStatusChanged(); + ASSERT_TRUE(error_controller.HasError()); ASSERT_STREQ(kOtherTestAccountId, - error_controller_->error_account_id().c_str()); + error_controller.error_account_id().c_str()); // Now resolve the auth errors - the menu item should go away. provider0->set_error_without_status_change( GoogleServiceAuthError::AuthErrorNone()); provider1->set_error_without_status_change( GoogleServiceAuthError::AuthErrorNone()); - error_controller_->AuthStatusChanged(); - ASSERT_FALSE(error_controller_->HasError()); + error_controller.AuthStatusChanged(); + ASSERT_FALSE(error_controller.HasError()); provider0.reset(); provider1.reset(); - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); +} + +TEST(SigninErrorControllerTest, + AuthStatusProviderAccountTransitionPrimaryAccount) { + SigninErrorController error_controller( + SigninErrorController::AccountMode::PRIMARY_ACCOUNT); + std::unique_ptr<FakeAuthStatusProvider> provider0( + new FakeAuthStatusProvider(&error_controller)); + std::unique_ptr<FakeAuthStatusProvider> provider1( + new FakeAuthStatusProvider(&error_controller)); + + ASSERT_FALSE(error_controller.HasError()); + + provider0->SetAuthError( + kTestAccountId, + GoogleServiceAuthError(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); + provider1->SetAuthError(kOtherTestAccountId, + GoogleServiceAuthError(GoogleServiceAuthError::NONE)); + ASSERT_FALSE(error_controller.HasError()); // No primary account. + error_controller.SetPrimaryAccountID(kOtherTestAccountId); + ASSERT_FALSE(error_controller.HasError()); // Error on secondary. + error_controller.SetPrimaryAccountID(kTestAccountId); + ASSERT_TRUE(error_controller.HasError()); + ASSERT_STREQ(kTestAccountId, error_controller.error_account_id().c_str()); + + // Change the primary account. + provider1->SetAuthError( + kOtherTestAccountId, + GoogleServiceAuthError(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); + ASSERT_TRUE(error_controller.HasError()); + ASSERT_STREQ(kTestAccountId, error_controller.error_account_id().c_str()); + error_controller.SetPrimaryAccountID(kOtherTestAccountId); + ASSERT_TRUE(error_controller.HasError()); + ASSERT_STREQ(kOtherTestAccountId, + error_controller.error_account_id().c_str()); + + // Signout. + error_controller.SetPrimaryAccountID(""); + ASSERT_FALSE(error_controller.HasError()); + + provider0.reset(); + provider1.reset(); } // Verify that SigninErrorController handles errors properly. -TEST_F(SigninErrorControllerTest, AuthStatusEnumerateAllErrors) { +TEST(SigninErrorControllerTest, AuthStatusEnumerateAllErrors) { + SigninErrorController error_controller( + SigninErrorController::AccountMode::ANY_ACCOUNT); typedef struct { GoogleServiceAuthError::State error_state; bool is_error; @@ -164,32 +206,31 @@ for (size_t i = 0; i < arraysize(table); ++i) { if (GoogleServiceAuthError::IsDeprecated(table[i].error_state)) continue; - FakeAuthStatusProvider provider(error_controller_.get()); + FakeAuthStatusProvider provider(&error_controller); provider.SetAuthError(kTestAccountId, GoogleServiceAuthError(table[i].error_state)); - EXPECT_EQ(error_controller_->HasError(), table[i].is_error); + EXPECT_EQ(error_controller.HasError(), table[i].is_error); if (table[i].is_error) { - EXPECT_EQ(table[i].error_state, - error_controller_->auth_error().state()); - EXPECT_STREQ(kTestAccountId, - error_controller_->error_account_id().c_str()); + EXPECT_EQ(table[i].error_state, error_controller.auth_error().state()); + EXPECT_STREQ(kTestAccountId, error_controller.error_account_id().c_str()); } else { EXPECT_EQ(GoogleServiceAuthError::NONE, - error_controller_->auth_error().state()); - EXPECT_STREQ("", - error_controller_->error_account_id().c_str()); + error_controller.auth_error().state()); + EXPECT_STREQ("", error_controller.error_account_id().c_str()); } } } // Verify that existing error is not replaced by new error. -TEST_F(SigninErrorControllerTest, AuthStatusChange) { +TEST(SigninErrorControllerTest, AuthStatusChange) { + SigninErrorController error_controller( + SigninErrorController::AccountMode::ANY_ACCOUNT); std::unique_ptr<FakeAuthStatusProvider> fake_provider0( - new FakeAuthStatusProvider(error_controller_.get())); + new FakeAuthStatusProvider(&error_controller)); std::unique_ptr<FakeAuthStatusProvider> fake_provider1( - new FakeAuthStatusProvider(error_controller_.get())); + new FakeAuthStatusProvider(&error_controller)); // If there are multiple providers in the provider set... // @@ -222,18 +263,18 @@ GoogleServiceAuthError( GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS)); ASSERT_EQ(GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS, - error_controller_->auth_error().state()); + error_controller.auth_error().state()); ASSERT_STREQ(kOtherTestAccountId, - error_controller_->error_account_id().c_str()); + error_controller.error_account_id().c_str()); // Change the 1st provider's error. provider1->SetAuthError( kOtherTestAccountId, GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_ERROR)); ASSERT_EQ(GoogleServiceAuthError::SERVICE_ERROR, - error_controller_->auth_error().state()); + error_controller.auth_error().state()); ASSERT_STREQ(kOtherTestAccountId, - error_controller_->error_account_id().c_str()); + error_controller.error_account_id().c_str()); // Set the 0th provider's error -- nothing should change. provider0->SetAuthError( @@ -241,9 +282,9 @@ GoogleServiceAuthError( GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE)); ASSERT_EQ(GoogleServiceAuthError::SERVICE_ERROR, - error_controller_->auth_error().state()); + error_controller.auth_error().state()); ASSERT_STREQ(kOtherTestAccountId, - error_controller_->error_account_id().c_str()); + error_controller.error_account_id().c_str()); // Clear the 1st provider's error, so the 0th provider's error is used. provider1->SetAuthError( @@ -251,11 +292,10 @@ GoogleServiceAuthError( GoogleServiceAuthError::NONE)); ASSERT_EQ(GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE, - error_controller_->auth_error().state()); - ASSERT_STREQ(kTestAccountId, - error_controller_->error_account_id().c_str()); + error_controller.auth_error().state()); + ASSERT_STREQ(kTestAccountId, error_controller.error_account_id().c_str()); fake_provider0.reset(); fake_provider1.reset(); - ASSERT_FALSE(error_controller_->HasError()); + ASSERT_FALSE(error_controller.HasError()); }
diff --git a/components/signin/core/browser/signin_manager.cc b/components/signin/core/browser/signin_manager.cc index fd1da996..ac36972 100644 --- a/components/signin/core/browser/signin_manager.cc +++ b/components/signin/core/browser/signin_manager.cc
@@ -31,8 +31,11 @@ SigninManager::SigninManager(SigninClient* client, ProfileOAuth2TokenService* token_service, AccountTrackerService* account_tracker_service, - GaiaCookieManagerService* cookie_manager_service) - : SigninManagerBase(client, account_tracker_service), + GaiaCookieManagerService* cookie_manager_service, + SigninErrorController* signin_error_controller) + : SigninManagerBase(client, + account_tracker_service, + signin_error_controller), prohibit_signout_(false), type_(SIGNIN_TYPE_NONE), client_(client), @@ -218,7 +221,7 @@ const base::Time signin_time = base::Time::FromInternalValue( client_->GetPrefs()->GetInt64(prefs::kSignedInTime)); - clear_authenticated_user(); + ClearAuthenticatedAccountId(); client_->GetPrefs()->ClearPref(prefs::kGoogleServicesHostedDomain); client_->GetPrefs()->ClearPref(prefs::kGoogleServicesAccountId); client_->GetPrefs()->ClearPref(prefs::kGoogleServicesUserAccountId);
diff --git a/components/signin/core/browser/signin_manager.h b/components/signin/core/browser/signin_manager.h index 0168ee16..8408e0a 100644 --- a/components/signin/core/browser/signin_manager.h +++ b/components/signin/core/browser/signin_manager.h
@@ -45,6 +45,7 @@ class PrefService; class ProfileOAuth2TokenService; class SigninClient; +class SigninErrorController; class SigninManager : public SigninManagerBase, public AccountTrackerService::Observer, @@ -66,7 +67,8 @@ SigninManager(SigninClient* client, ProfileOAuth2TokenService* token_service, AccountTrackerService* account_tracker_service, - GaiaCookieManagerService* cookie_manager_service); + GaiaCookieManagerService* cookie_manager_service, + SigninErrorController* signin_error_controller); ~SigninManager() override; // Returns true if the username is allowed based on the policy string.
diff --git a/components/signin/core/browser/signin_manager_base.cc b/components/signin/core/browser/signin_manager_base.cc index efcf90a..1be1a23 100644 --- a/components/signin/core/browser/signin_manager_base.cc +++ b/components/signin/core/browser/signin_manager_base.cc
@@ -18,6 +18,7 @@ #include "components/signin/core/browser/account_info.h" #include "components/signin/core/browser/account_tracker_service.h" #include "components/signin/core/browser/signin_client.h" +#include "components/signin/core/browser/signin_error_controller.h" #include "components/signin/core/browser/signin_pref_names.h" #include "components/signin/core/browser/signin_switches.h" #include "google_apis/gaia/gaia_auth_util.h" @@ -28,9 +29,11 @@ SigninManagerBase::SigninManagerBase( SigninClient* client, - AccountTrackerService* account_tracker_service) + AccountTrackerService* account_tracker_service, + SigninErrorController* signin_error_controller) : client_(client), account_tracker_service_(account_tracker_service), + signin_error_controller_(signin_error_controller), initialized_(false), weak_pointer_factory_(this) { DCHECK(client_); @@ -221,6 +224,15 @@ // Commit authenticated account info immediately so that it does not get lost // if Chrome crashes before the next commit interval. client_->GetPrefs()->CommitPendingWrite(); + + if (signin_error_controller_) + signin_error_controller_->SetPrimaryAccountID(authenticated_account_id_); +} + +void SigninManagerBase::ClearAuthenticatedAccountId() { + authenticated_account_id_.clear(); + if (signin_error_controller_) + signin_error_controller_->SetPrimaryAccountID(std::string()); } bool SigninManagerBase::IsAuthenticated() const {
diff --git a/components/signin/core/browser/signin_manager_base.h b/components/signin/core/browser/signin_manager_base.h index 374123a..a14e609 100644 --- a/components/signin/core/browser/signin_manager_base.h +++ b/components/signin/core/browser/signin_manager_base.h
@@ -42,6 +42,7 @@ class PrefRegistrySimple; class PrefService; class SigninClient; +class SigninErrorController; namespace password_manager { class PasswordStoreSigninNotifierImpl; @@ -103,7 +104,8 @@ }; SigninManagerBase(SigninClient* client, - AccountTrackerService* account_tracker_service); + AccountTrackerService* account_tracker_service, + SigninErrorController* signin_error_controller); ~SigninManagerBase() override; // Registers per-profile prefs. @@ -187,12 +189,15 @@ // method is a no-op. // It is forbidden to call this method if the user is already authenticated // with a different account (this method will DCHECK in that case). + // |account_id| must not be empty. To log the user out, use + // ClearAuthenticatedAccountId() instead. void SetAuthenticatedAccountId(const std::string& account_id); - // Used by subclass to clear the authenticated user instead of using - // SetAuthenticatedAccountId, which enforces special preconditions due - // to the fact that it is part of the public API and called by clients. - void clear_authenticated_user() { authenticated_account_id_.clear(); } + // Clears the authenticated user's account id. + // This method is not public because SigninManagerBase does not allow signing + // out by default. Subclasses implementing a sign-out functionality need to + // call this. + void ClearAuthenticatedAccountId(); // List of observers to notify on signin events. // Makes sure list is empty on destruction. @@ -209,6 +214,7 @@ SigninClient* client_; AccountTrackerService* account_tracker_service_; + SigninErrorController* signin_error_controller_; bool initialized_; // Account id after successful authentication.
diff --git a/components/signin/core/browser/signin_manager_unittest.cc b/components/signin/core/browser/signin_manager_unittest.cc index 4a4e033..6d0f668 100644 --- a/components/signin/core/browser/signin_manager_unittest.cc +++ b/components/signin/core/browser/signin_manager_unittest.cc
@@ -132,7 +132,7 @@ DCHECK(!manager_); manager_ = std::make_unique<SigninManager>( &test_signin_client_, &token_service_, &account_tracker_, - &cookie_manager_service_); + &cookie_manager_service_, nullptr /* signin_error_controller */); manager_->Initialize(&local_state_); manager_->AddObserver(&test_observer_); }
diff --git a/components/signin/ios/browser/profile_oauth2_token_service_ios_delegate_unittest.mm b/components/signin/ios/browser/profile_oauth2_token_service_ios_delegate_unittest.mm index c91c48b..b6a26c0 100644 --- a/components/signin/ios/browser/profile_oauth2_token_service_ios_delegate_unittest.mm +++ b/components/signin/ios/browser/profile_oauth2_token_service_ios_delegate_unittest.mm
@@ -11,6 +11,7 @@ #include "components/prefs/testing_pref_service.h" #include "components/signin/core/browser/account_tracker_service.h" #include "components/signin/core/browser/profile_oauth2_token_service.h" +#include "components/signin/core/browser/signin_error_controller.h" #include "components/signin/core/browser/signin_pref_names.h" #include "components/signin/core/browser/test_signin_client.h" #include "components/signin/ios/browser/fake_profile_oauth2_token_service_ios_provider.h" @@ -35,6 +36,8 @@ ProfileOAuth2TokenServiceIOSDelegateTest() : factory_(NULL), client_(&prefs_), + signin_error_controller_( + SigninErrorController::AccountMode::ANY_ACCOUNT), token_available_count_(0), token_revoked_count_(0), tokens_loaded_count_(0),
diff --git a/components/spellcheck/browser/spellcheck_host_metrics_unittest.cc b/components/spellcheck/browser/spellcheck_host_metrics_unittest.cc index adace85..64338f6 100644 --- a/components/spellcheck/browser/spellcheck_host_metrics_unittest.cc +++ b/components/spellcheck/browser/spellcheck_host_metrics_unittest.cc
@@ -11,7 +11,6 @@ #include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_samples.h" -#include "base/metrics/statistics_recorder.h" #include "base/strings/utf_string_conversions.h" #include "base/test/histogram_tester.h" #include "build/build_config.h" @@ -22,10 +21,6 @@ SpellcheckHostMetricsTest() { } - static void SetUpTestCase() { - base::StatisticsRecorder::Initialize(); - } - void SetUp() override { metrics_.reset(new SpellCheckHostMetrics); } SpellCheckHostMetrics* metrics() { return metrics_.get(); } @@ -63,10 +58,6 @@ TEST_F(SpellcheckHostMetricsTest, MAYBE_CustomWordStats) { SpellCheckHostMetrics::RecordCustomWordCountStats(123); - // Determine if test failures are due the statistics recorder not being - // available or because the histogram just isn't there: crbug.com/230534. - EXPECT_TRUE(base::StatisticsRecorder::IsActive()); - base::HistogramTester histogram_tester; SpellCheckHostMetrics::RecordCustomWordCountStats(23);
diff --git a/components/suggestions/suggestions_service_impl_unittest.cc b/components/suggestions/suggestions_service_impl_unittest.cc index 6509959..43c4322 100644 --- a/components/suggestions/suggestions_service_impl_unittest.cc +++ b/components/suggestions/suggestions_service_impl_unittest.cc
@@ -135,11 +135,12 @@ MOCK_METHOD1(FilterSuggestions, void(SuggestionsProfile*)); }; -class SuggestionsServiceTest : public testing::Test { +class SuggestionsServiceTest : public testing::Test, + public OAuth2TokenService::DiagnosticsObserver { protected: SuggestionsServiceTest() - : task_runner_(new base::TestMockTimeTaskRunner()), - task_runner_handle_(task_runner_), + : task_runner_(new base::TestMockTimeTaskRunner( + base::TestMockTimeTaskRunner::Type::kBoundToThread)), signin_client_(&pref_service_), signin_manager_(&signin_client_, &account_tracker_), request_context_( @@ -153,9 +154,12 @@ signin_manager_.SignIn(kAccountId); token_service_.UpdateCredentials(kAccountId, "refresh_token"); token_service_.set_auto_post_fetch_response_on_message_loop(true); + token_service_.AddDiagnosticsObserver(this); } - ~SuggestionsServiceTest() override {} + ~SuggestionsServiceTest() override { + token_service_.RemoveDiagnosticsObserver(this); + } void SetUp() override { EXPECT_CALL(*sync_service(), CanSyncStart()) @@ -225,9 +229,21 @@ return suggestions_service_.get(); } + void set_on_access_token_request_callback(base::OnceClosure callback) { + on_access_token_request_callback_ = std::move(callback); + } + private: + // OAuth2TokenService::DiagnosticsObserver: + void OnAccessTokenRequested( + const std::string& account_id, + const std::string& consumer_id, + const OAuth2TokenService::ScopeSet& scopes) override { + if (on_access_token_request_callback_) + std::move(on_access_token_request_callback_).Run(); + } + scoped_refptr<base::TestMockTimeTaskRunner> task_runner_; - base::ThreadTaskRunnerHandle task_runner_handle_; TestingPrefServiceSyncable pref_service_; AccountTrackerService account_tracker_; TestSigninClient signin_client_; @@ -240,6 +256,7 @@ MockImageManager* mock_thumbnail_manager_; MockBlacklistStore* mock_blacklist_store_; TestSuggestionsStore* test_suggestions_store_; + base::OnceClosure on_access_token_request_callback_; std::unique_ptr<SuggestionsServiceImpl> suggestions_service_; @@ -406,8 +423,13 @@ EXPECT_CALL(*blacklist_store(), GetTimeUntilReadyForUpload(_)) .WillOnce(Return(false)); + base::RunLoop run_loop; + set_on_access_token_request_callback(run_loop.QuitClosure()); + suggestions_service()->FetchSuggestionsData(); + run_loop.Run(); + token_service()->IssueErrorForAllPendingRequests(GoogleServiceAuthError( GoogleServiceAuthError::State::INVALID_GAIA_CREDENTIALS));
diff --git a/components/sync/base/data_type_histogram_unittest.cc b/components/sync/base/data_type_histogram_unittest.cc index a7fb661..fc0d4ba 100644 --- a/components/sync/base/data_type_histogram_unittest.cc +++ b/components/sync/base/data_type_histogram_unittest.cc
@@ -4,16 +4,12 @@ #include "components/sync/base/data_type_histogram.h" -#include "base/metrics/statistics_recorder.h" #include "testing/gtest/include/gtest/gtest.h" namespace syncer { namespace { -class DataTypeHistogramTest : public testing::Test { - public: - void SetUp() override { base::StatisticsRecorder::Initialize(); } -}; +class DataTypeHistogramTest : public testing::Test {}; // Create a histogram of type LOCAL_HISTOGRAM_COUNTS for each model type. // Nothing should break.
diff --git a/components/sync/engine_impl/model_type_worker_unittest.cc b/components/sync/engine_impl/model_type_worker_unittest.cc index 5233e89..7e6cb7f 100644 --- a/components/sync/engine_impl/model_type_worker_unittest.cc +++ b/components/sync/engine_impl/model_type_worker_unittest.cc
@@ -759,6 +759,33 @@ EXPECT_FALSE(tag1_entity.specifics().preference().has_value()); } +// Test commit of encrypted tombstone. +TEST_F(ModelTypeWorkerTest, EncryptedDelete) { + NormalInitialize(); + + EXPECT_EQ(0U, processor()->GetNumUpdateResponses()); + + // Init the Cryptographer, it'll cause the EKN to be pushed. + AddPendingKey(); + DecryptPendingKey(); + ASSERT_EQ(1U, processor()->GetNumUpdateResponses()); + EXPECT_EQ(GetLocalCryptographerKeyName(), + processor()->GetNthUpdateState(0).encryption_key_name()); + + // Normal commit request stuff. + processor()->SetCommitRequest(GenerateDeleteRequest(kTag1)); + DoSuccessfulCommit(); + ASSERT_EQ(1U, server()->GetNumCommitMessages()); + EXPECT_EQ(1, server()->GetNthCommitMessage(0).commit().entries_size()); + ASSERT_TRUE(server()->HasCommitEntity(kHash1)); + const SyncEntity& tag1_entity = server()->GetLastCommittedEntity(kHash1); + + EXPECT_FALSE(tag1_entity.specifics().has_encrypted()); + + // The title should be overwritten. + EXPECT_EQ(tag1_entity.name(), "encrypted"); +} + // Test that updates are not delivered to the processor when encryption is // required but unavailable. TEST_F(ModelTypeWorkerTest, EncryptionBlocksUpdates) {
diff --git a/components/sync/engine_impl/non_blocking_type_commit_contribution.cc b/components/sync/engine_impl/non_blocking_type_commit_contribution.cc index 0ac2c3b5..3543257 100644 --- a/components/sync/engine_impl/non_blocking_type_commit_contribution.cc +++ b/components/sync/engine_impl/non_blocking_type_commit_contribution.cc
@@ -191,11 +191,13 @@ // Encrypt the specifics and hide the title if necessary. if (cryptographer_) { - sync_pb::EntitySpecifics encrypted_specifics; - bool result = cryptographer_->Encrypt( - commit_proto->specifics(), encrypted_specifics.mutable_encrypted()); - DCHECK(result); - commit_proto->mutable_specifics()->CopyFrom(encrypted_specifics); + if (commit_proto->has_specifics()) { + sync_pb::EntitySpecifics encrypted_specifics; + bool result = cryptographer_->Encrypt( + commit_proto->specifics(), encrypted_specifics.mutable_encrypted()); + DCHECK(result); + commit_proto->mutable_specifics()->CopyFrom(encrypted_specifics); + } commit_proto->set_name("encrypted"); }
diff --git a/components/sync/mojo/syncer.typemap b/components/sync/mojo/syncer.typemap index 0c8f01e..ea8b356 100644 --- a/components/sync/mojo/syncer.typemap +++ b/components/sync/mojo/syncer.typemap
@@ -5,4 +5,7 @@ mojom = "//components/sync/mojo/syncer.mojom" public_headers = [ "//components/sync/model/string_ordinal.h" ] traits_headers = [ "//components/sync/mojo/syncer_struct_traits.h" ] +deps = [ + "//components/sync:sync", +] type_mappings = [ "syncer.mojom.StringOrdinal=syncer::StringOrdinal" ]
diff --git a/components/test/components_test_suite.cc b/components/test/components_test_suite.cc index e76118ee..78f7e37d 100644 --- a/components/test/components_test_suite.cc +++ b/components/test/components_test_suite.cc
@@ -11,7 +11,6 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/ptr_util.h" -#include "base/metrics/statistics_recorder.h" #include "base/path_service.h" #include "base/test/launcher/unit_test_launcher.h" #include "base/test/test_suite.h" @@ -48,11 +47,6 @@ mojo::edk::Init(); - // Initialize the histograms subsystem, so that any histograms hit in tests - // are correctly registered with the statistics recorder and can be queried - // by tests. - base::StatisticsRecorder::Initialize(); - #if !defined(OS_IOS) gl::GLSurfaceTestSupport::InitializeOneOff();
diff --git a/components/test/data/autofill/credit_card_upload_form_address_and_cc.html b/components/test/data/autofill/credit_card_upload_form_address_and_cc.html index 8c988d3..e3a8e92 100644 --- a/components/test/data/autofill/credit_card_upload_form_address_and_cc.html +++ b/components/test/data/autofill/credit_card_upload_form_address_and_cc.html
@@ -30,12 +30,19 @@ <button id="fill_form" type="button">Fill entire form with default (MasterCard) values</button> <button id="fill_form_amex" type="button">Fill entire form, but with AMEX CC values</button> <button id="fill_invalid_cvc" type="button">Fill the CVC field with an invalid value</button> + <button id="fill_card_only" type="button">Fill the credit card number and expiration fields only</button> <button id="clear_cvc" type="button">Clear the CVC field</button> <button id="clear_name" type="button">Clear the name fields</button> <button id="clear_address" type="button">Clear the address fields</button> <button id="submit" type="submit">Submit</button> </form> <script type="text/javascript"> + function getNextYear() { + var nextYear = new Date(); + nextYear.setFullYear(nextYear.getFullYear() + 1); + return nextYear.getFullYear(); + } + document.getElementById("fill_form").addEventListener( "click", function() { @@ -48,7 +55,7 @@ document.getElementsByName("name_cc")[0].value = "John Smith"; document.getElementsByName("cc_number")[0].value = "5454545454545454"; document.getElementsByName("cc_month_exp")[0].value = "12"; - document.getElementsByName("cc_year_exp")[0].value = "2023"; + document.getElementsByName("cc_year_exp")[0].value = getNextYear(); document.getElementsByName("cc_cvc")[0].value = "123"; }); @@ -66,6 +73,14 @@ document.getElementsByName("cc_cvc")[0].value = "12345"; }); + document.getElementById("fill_card_only").addEventListener( + "click", + function() { + document.getElementsByName("cc_number")[0].value = "5454545454545454"; + document.getElementsByName("cc_month_exp")[0].value = "12"; + document.getElementsByName("cc_year_exp")[0].value = getNextYear(); + }); + document.getElementById("clear_cvc").addEventListener( "click", function() {
diff --git a/components/translate/core/browser/translate_browser_metrics_unittest.cc b/components/translate/core/browser/translate_browser_metrics_unittest.cc index ce5ce186..5f12436 100644 --- a/components/translate/core/browser/translate_browser_metrics_unittest.cc +++ b/components/translate/core/browser/translate_browser_metrics_unittest.cc
@@ -22,8 +22,6 @@ class MetricsRecorder { public: explicit MetricsRecorder(const char* key) : key_(key) { - StatisticsRecorder::Initialize(); - HistogramBase* histogram = StatisticsRecorder::FindHistogram(key_); if (histogram) base_samples_ = histogram->SnapshotSamples();
diff --git a/components/translate/core/browser/translate_infobar_delegate.cc b/components/translate/core/browser/translate_infobar_delegate.cc index 6cad2028..0d38d200 100644 --- a/components/translate/core/browser/translate_infobar_delegate.cc +++ b/components/translate/core/browser/translate_infobar_delegate.cc
@@ -56,7 +56,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier TranslateInfoBarDelegate::GetIdentifier() const { - return TRANSLATE_INFOBAR_DELEGATE; + return TRANSLATE_INFOBAR_DELEGATE_NON_AURA; } // static
diff --git a/components/translate/core/browser/translate_prefs.cc b/components/translate/core/browser/translate_prefs.cc index 13df37c..bb834b0 100644 --- a/components/translate/core/browser/translate_prefs.cc +++ b/components/translate/core/browser/translate_prefs.cc
@@ -284,7 +284,11 @@ void TranslatePrefs::RearrangeLanguage( const std::string& language, const TranslatePrefs::RearrangeSpecifier where, + const int offset, const std::vector<std::string>& enabled_languages) { + // Negative offset is not supported. + DCHECK(!(offset < 1 && (where == kUp || where == kDown))); + std::vector<std::string> languages; GetLanguageList(&languages); @@ -309,28 +313,39 @@ // first position. int a, r, b; + // In this block we need to skip languages that are not enabled, unless we're + // moving to the top of the list. switch (where) { case kUp: - a = original_position - 1; + a = original_position; r = original_position; b = original_position + 1; - while (a >= 0 && enabled.find(languages[a]) == enabled.end()) { + for (int steps = offset; steps > 0; --steps) { --a; + while (a >= 0 && enabled.find(languages[a]) == enabled.end()) { + --a; + } } - if (a < 0) { - return; + // Skip ahead of any non-enabled language that may be before the new + // destination. + { + int prev = a - 1; + while (prev >= 0 && enabled.find(languages[prev]) == enabled.end()) { + --a; + --prev; + } } break; case kDown: a = original_position; r = original_position + 1; - b = r; - while (b < length && enabled.find(languages[b]) == enabled.end()) { + b = original_position; + for (int steps = offset; steps > 0; --steps) { ++b; - } - if (b >= length) { - return; + while (b < length && enabled.find(languages[b]) == enabled.end()) { + ++b; + } } ++b; break; @@ -352,13 +367,18 @@ return; } - // All cases can be achieved with a single rotation. - std::vector<std::string>::iterator first = languages.begin() + a; - std::vector<std::string>::iterator it = languages.begin() + r; - std::vector<std::string>::iterator last = languages.begin() + b; - std::rotate(first, it, last); + // Sanity checks before performing the rotation. + a = std::max(0, a); + b = std::min(length, b); + if (r > a && r < b) { + // All cases can be achieved with a single rotation. + std::vector<std::string>::iterator first = languages.begin() + a; + std::vector<std::string>::iterator it = languages.begin() + r; + std::vector<std::string>::iterator last = languages.begin() + b; + std::rotate(first, it, last); - UpdateLanguageList(languages); + UpdateLanguageList(languages); + } } // static
diff --git a/components/translate/core/browser/translate_prefs.h b/components/translate/core/browser/translate_prefs.h index 7c763ba..23a2b4f6 100644 --- a/components/translate/core/browser/translate_prefs.h +++ b/components/translate/core/browser/translate_prefs.h
@@ -122,9 +122,9 @@ kNone, // Move the language to the very top of the list. kTop, - // Move the language up by one position. + // Move the language up towards the front of the list. kUp, - // Move the language down by one position. + // Move the language down towards the back of the list. kDown }; @@ -165,13 +165,16 @@ void RemoveFromLanguageList(const std::string& language); // Rearranges the given language inside the language list. - // The target position is specified as a RearrangeSpecifier. + // The direction of the move is specified as a RearrangeSpecifier. + // |offset| is ignored unless the RearrangeSpecifier is kUp or kDown: in + // which case it needs to be positive for any change to be made. // The param |enabled_languages| is a list of languages that are enabled in // the current UI. This is required because the full language list contains // some languages that might not be enabled in the current UI and we need to // skip those languages while rearranging the list. void RearrangeLanguage(const std::string& language, RearrangeSpecifier where, + const int offset, const std::vector<std::string>& enabled_languages); // Returns the list of TranslateLanguageInfo for all languages that are
diff --git a/components/translate/core/browser/translate_prefs_unittest.cc b/components/translate/core/browser/translate_prefs_unittest.cc index 71e52cf..5c750e1 100644 --- a/components/translate/core/browser/translate_prefs_unittest.cc +++ b/components/translate/core/browser/translate_prefs_unittest.cc
@@ -786,6 +786,7 @@ TEST_F(TranslatePrefsTest, MoveLanguageToTheTop) { std::vector<std::string> languages; std::string enabled; + const int offset = 0; // ignored // First we test all cases that result in no change. // The method needs to handle them gracefully and simply do no-op. @@ -793,37 +794,40 @@ // Empty language list. languages = {}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en-US", TranslatePrefs::kTop, {"en-US"}); + translate_prefs_->RearrangeLanguage("en-US", TranslatePrefs::kTop, offset, + {"en-US"}); ExpectLanguagePrefs(""); // Search for empty string. languages = {"en"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("", TranslatePrefs::kTop, {"en"}); + translate_prefs_->RearrangeLanguage("", TranslatePrefs::kTop, offset, {"en"}); ExpectLanguagePrefs("en"); // List of enabled languages is empty. languages = {"en"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kTop, {}); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kTop, offset, {}); ExpectLanguagePrefs("en"); // Everything empty. languages = {""}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("", TranslatePrefs::kTop, {}); + translate_prefs_->RearrangeLanguage("", TranslatePrefs::kTop, offset, {}); ExpectLanguagePrefs(""); // Only one element in the list. languages = {"en"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kTop, {"en-US"}); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kTop, offset, + {"en-US"}); ExpectLanguagePrefs("en"); // Element is already at the top. languages = {"en", "fr"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kTop, {"en", "fr"}); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kTop, offset, + {"en", "fr"}); ExpectLanguagePrefs("en,fr"); // Below we test cases that result in a valid rearrangement of the list. @@ -832,33 +836,35 @@ // top of the list: we still need to push it to the top. languages = {"en", "fr", "it", "es"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kTop, {"it", "es"}); + translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kTop, offset, + {"it", "es"}); ExpectLanguagePrefs("it,en,fr,es"); // Swap two languages. languages = {"en", "fr"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kTop, {"en", "fr"}); + translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kTop, offset, + {"en", "fr"}); ExpectLanguagePrefs("fr,en"); // Language in the middle. languages = {"en", "fr", "it", "es"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kTop, + translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kTop, offset, {"en", "fr", "it", "es"}); ExpectLanguagePrefs("it,en,fr,es"); // Language at the bottom. languages = {"en", "fr", "it", "es"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("es", TranslatePrefs::kTop, + translate_prefs_->RearrangeLanguage("es", TranslatePrefs::kTop, offset, {"en", "fr", "it", "es"}); ExpectLanguagePrefs("es,en,fr,it"); // Skip languages that are not enabled. languages = {"en", "fr", "it", "es", "zh"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("zh", TranslatePrefs::kTop, + translate_prefs_->RearrangeLanguage("zh", TranslatePrefs::kTop, offset, {"en", "fr", "zh"}); ExpectLanguagePrefs("zh,en,fr,it,es"); } @@ -867,162 +873,277 @@ std::vector<std::string> languages; std::string enabled; + //--------------------------------------------------------------------------- // First we test all cases that result in no change. // The method needs to handle them gracefully and simply do no-op. // Empty language list. languages = {}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en-US", TranslatePrefs::kUp, {"en-US"}); - ExpectLanguagePrefs(""); - - // Search for empty string. - languages = {"en"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("", TranslatePrefs::kUp, {"en"}); - ExpectLanguagePrefs("en"); - - // List of enabled languages is empty. - languages = {"en"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kUp, {}); - ExpectLanguagePrefs("en"); - - // Everything empty. - languages = {""}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("", TranslatePrefs::kUp, {}); - ExpectLanguagePrefs(""); - - // Only one element in the list. - languages = {"en"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kUp, {"en"}); - ExpectLanguagePrefs("en"); - - // Element is already at the top. - languages = {"en", "fr"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kUp, {"en", "fr"}); - ExpectLanguagePrefs("en,fr"); - - // The language is already at the top of the enabled languages. - languages = {"en", "fr", "it", "es"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kUp, {"it", "es"}); - ExpectLanguagePrefs("en,fr,it,es"); - - // Below we test cases that result in a valid rearrangement of the list. - - // Swap two languages. - languages = {"en", "fr"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kUp, {"en", "fr"}); - ExpectLanguagePrefs("fr,en"); - - // Language in the middle. - languages = {"en", "fr", "it", "es"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kUp, - {"en", "fr", "it", "es"}); - ExpectLanguagePrefs("en,it,fr,es"); - - // Language at the bottom. - languages = {"en", "fr", "it", "es"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("es", TranslatePrefs::kUp, - {"en", "fr", "it", "es"}); - ExpectLanguagePrefs("en,fr,es,it"); - - // Skip languages that are not enabled. - languages = {"en", "fr", "it", "es", "zh"}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("zh", TranslatePrefs::kUp, - {"en", "fr", "zh"}); - ExpectLanguagePrefs("en,zh,fr,it,es"); -} - -TEST_F(TranslatePrefsTest, MoveLanguageDown) { - std::vector<std::string> languages; - std::string enabled; - - // First we test all cases that result in no change. - // The method needs to handle them gracefully and simply do no-op. - - // Empty language list. - languages = {}; - translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en-US", TranslatePrefs::kDown, + translate_prefs_->RearrangeLanguage("en-US", TranslatePrefs::kUp, 1, {"en-US"}); ExpectLanguagePrefs(""); // Search for empty string. languages = {"en"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("", TranslatePrefs::kDown, {"en"}); + translate_prefs_->RearrangeLanguage("", TranslatePrefs::kUp, 1, {"en"}); ExpectLanguagePrefs("en"); // List of enabled languages is empty. languages = {"en"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, {}); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kUp, 1, {}); ExpectLanguagePrefs("en"); // Everything empty. languages = {""}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("", TranslatePrefs::kDown, {}); + translate_prefs_->RearrangeLanguage("", TranslatePrefs::kUp, 1, {}); ExpectLanguagePrefs(""); // Only one element in the list. languages = {"en"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, {"en"}); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kUp, 1, {"en"}); ExpectLanguagePrefs("en"); - // Element is already at the bottom. + // Element is already at the top. languages = {"en", "fr"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kDown, + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kUp, 1, {"en", "fr"}); ExpectLanguagePrefs("en,fr"); - // The language is already at the bottom of the enabled languages. + // The language is at the top of the enabled languages. languages = {"en", "fr", "it", "es"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kDown, - {"fr", "it"}); - ExpectLanguagePrefs("en,fr,it,es"); + translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kUp, 1, + {"it", "es"}); + ExpectLanguagePrefs("it,en,fr,es"); + //--------------------------------------------------------------------------- // Below we test cases that result in a valid rearrangement of the list. + // First we move by 1 position only. // Swap two languages. languages = {"en", "fr"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, + translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kUp, 1, {"en", "fr"}); ExpectLanguagePrefs("fr,en"); // Language in the middle. languages = {"en", "fr", "it", "es"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kDown, + translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kUp, 1, + {"en", "fr", "it", "es"}); + ExpectLanguagePrefs("en,it,fr,es"); + + // Language at the bottom. + languages = {"en", "fr", "it", "es"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("es", TranslatePrefs::kUp, 1, + {"en", "fr", "it", "es"}); + ExpectLanguagePrefs("en,fr,es,it"); + + // Skip languages that are not enabled. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("zh", TranslatePrefs::kUp, 1, + {"en", "fr", "zh"}); + ExpectLanguagePrefs("en,zh,fr,it,es"); + + //--------------------------------------------------------------------------- + // Move by more than 1 position. + + // Move all the way to the top. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("es", TranslatePrefs::kUp, 3, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("es,en,fr,it,zh"); + + // Move to the middle of the list. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("es", TranslatePrefs::kUp, 2, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("en,es,fr,it,zh"); + + // Move up the last language. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("zh", TranslatePrefs::kUp, 3, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("en,zh,fr,it,es"); + + // Skip languages that are not enabled. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("zh", TranslatePrefs::kUp, 2, + {"en", "fr", "es", "zh"}); + ExpectLanguagePrefs("en,zh,fr,it,es"); + + // Skip languages that are not enabled. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("zh", TranslatePrefs::kUp, 2, + {"en", "fr", "it", "zh"}); + ExpectLanguagePrefs("en,zh,fr,it,es"); + + // Skip languages that are not enabled. + languages = {"en", "fr", "it", "es", "zh", "de", "pt"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("de", TranslatePrefs::kUp, 3, + {"it", "es", "zh", "de", "pt"}); + ExpectLanguagePrefs("de,en,fr,it,es,zh,pt"); + + // If offset is too large, we effectively move to the top. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("es", TranslatePrefs::kUp, 7, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("es,en,fr,it,zh"); +} + +TEST_F(TranslatePrefsTest, MoveLanguageDown) { + std::vector<std::string> languages; + std::string enabled; + + //--------------------------------------------------------------------------- + // First we test all cases that result in no change. + // The method needs to handle them gracefully and simply do no-op. + + // Empty language list. + languages = {}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("en-US", TranslatePrefs::kDown, 1, + {"en-US"}); + ExpectLanguagePrefs(""); + + // Search for empty string. + languages = {"en"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("", TranslatePrefs::kDown, 1, {"en"}); + ExpectLanguagePrefs("en"); + + // List of enabled languages is empty. + languages = {"en"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, 1, {}); + ExpectLanguagePrefs("en"); + + // Everything empty. + languages = {""}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("", TranslatePrefs::kDown, 1, {}); + ExpectLanguagePrefs(""); + + // Only one element in the list. + languages = {"en"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, 1, {"en"}); + ExpectLanguagePrefs("en"); + + // Element is already at the bottom. + languages = {"en", "fr"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kDown, 1, + {"en", "fr"}); + ExpectLanguagePrefs("en,fr"); + + // The language is at the bottom of the enabled languages: we move it to the + // very bottom of the list. + languages = {"en", "fr", "it", "es"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("it", TranslatePrefs::kDown, 1, + {"fr", "it"}); + ExpectLanguagePrefs("en,fr,es,it"); + + //--------------------------------------------------------------------------- + // Below we test cases that result in a valid rearrangement of the list. + // First we move by 1 position only. + + // Swap two languages. + languages = {"en", "fr"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, 1, + {"en", "fr"}); + ExpectLanguagePrefs("fr,en"); + + // Language in the middle. + languages = {"en", "fr", "it", "es"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kDown, 1, {"en", "fr", "it", "es"}); ExpectLanguagePrefs("en,it,fr,es"); // Language at the top. languages = {"en", "fr", "it", "es"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, 1, {"en", "fr", "it", "es"}); ExpectLanguagePrefs("fr,en,it,es"); // Skip languages that are not enabled. languages = {"en", "fr", "it", "es", "zh"}; translate_prefs_->UpdateLanguageList(languages); - translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, 1, {"en", "es", "zh"}); ExpectLanguagePrefs("fr,it,es,en,zh"); + + //--------------------------------------------------------------------------- + // Move by more than 1 position. + + // Move all the way to the bottom. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kDown, 3, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("en,it,es,zh,fr"); + + // Move to the middle of the list. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kDown, 2, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("en,it,es,fr,zh"); + + // Move down the first language. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, 3, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("fr,it,es,en,zh"); + + // Skip languages that are not enabled. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, 2, + {"en", "fr", "es", "zh"}); + ExpectLanguagePrefs("fr,it,es,en,zh"); + + // Skip languages that are not enabled. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("en", TranslatePrefs::kDown, 2, + {"en", "it", "es", "zh"}); + ExpectLanguagePrefs("fr,it,es,en,zh"); + + // Skip languages that are not enabled. + languages = {"en", "fr", "it", "es", "zh", "de", "pt"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kDown, 3, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("en,it,es,zh,fr,de,pt"); + + // If offset is too large, we effectively move to the bottom. + languages = {"en", "fr", "it", "es", "zh"}; + translate_prefs_->UpdateLanguageList(languages); + translate_prefs_->RearrangeLanguage("fr", TranslatePrefs::kDown, 6, + {"en", "fr", "it", "es", "zh"}); + ExpectLanguagePrefs("en,it,es,zh,fr"); } } // namespace translate
diff --git a/components/translate/core/common/translate_metrics_unittest.cc b/components/translate/core/common/translate_metrics_unittest.cc index 0119030..dc33c69 100644 --- a/components/translate/core/common/translate_metrics_unittest.cc +++ b/components/translate/core/common/translate_metrics_unittest.cc
@@ -30,8 +30,6 @@ class MetricsRecorder { public: explicit MetricsRecorder(const char* key) : key_(key) { - StatisticsRecorder::Initialize(); - HistogramBase* histogram = StatisticsRecorder::FindHistogram(key_); if (histogram) base_samples_ = histogram->SnapshotSamples();
diff --git a/components/update_client/component.cc b/components/update_client/component.cc index 28d7ee1..e6fb571 100644 --- a/components/update_client/component.cc +++ b/components/update_client/component.cc
@@ -13,7 +13,6 @@ #include "base/files/scoped_temp_dir.h" #include "base/location.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" #include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" @@ -169,7 +168,7 @@ Component::Component(const UpdateContext& update_context, const std::string& id) : id_(id), - state_(base::MakeUnique<StateNew>(this)), + state_(std::make_unique<StateNew>(this)), update_context_(update_context) {} Component::~Component() {} @@ -253,7 +252,7 @@ next_version_ = base::Version("0"); extra_code1_ = reason; - state_ = base::MakeUnique<StateUninstalled>(this); + state_ = std::make_unique<StateUninstalled>(this); } void Component::UpdateCheckComplete() { @@ -328,7 +327,7 @@ auto& component = State::component(); - TransitionState(base::MakeUnique<StateChecking>(&component)); + TransitionState(std::make_unique<StateChecking>(&component)); } Component::StateChecking::StateChecking(Component* component) @@ -361,20 +360,20 @@ auto& component = State::component(); if (!component.update_check_error_) { if (component.status_ == "ok") { - TransitionState(base::MakeUnique<StateCanUpdate>(&component)); + TransitionState(std::make_unique<StateCanUpdate>(&component)); return; } if (component.status_ == "noupdate") { if (component.action_run_.empty()) - TransitionState(base::MakeUnique<StateUpToDate>(&component)); + TransitionState(std::make_unique<StateUpToDate>(&component)); else - TransitionState(base::MakeUnique<StateRun>(&component)); + TransitionState(std::make_unique<StateRun>(&component)); return; } } - TransitionState(base::MakeUnique<StateUpdateError>(&component)); + TransitionState(std::make_unique<StateUpdateError>(&component)); } Component::StateUpdateError::StateUpdateError(Component* component) @@ -417,7 +416,7 @@ component.error_category_ = static_cast<int>(ErrorCategory::kServiceError); component.error_code_ = static_cast<int>(ServiceError::UPDATE_DISABLED); component.extra_code1_ = 0; - TransitionState(base::MakeUnique<StateUpdateError>(&component)); + TransitionState(std::make_unique<StateUpdateError>(&component)); return; } @@ -425,9 +424,9 @@ component.update_begin_ = base::TimeTicks::Now(); if (CanTryDiffUpdate()) - TransitionState(base::MakeUnique<StateDownloadingDiff>(&component)); + TransitionState(std::make_unique<StateDownloadingDiff>(&component)); else - TransitionState(base::MakeUnique<StateDownloading>(&component)); + TransitionState(std::make_unique<StateDownloading>(&component)); } // Returns true if a differential update is available, it has not failed yet, @@ -502,7 +501,8 @@ auto& component = Component::State::component(); for (const auto& metrics : crx_downloader_->download_metrics()) - component.AppendEvent(BuildDownloadCompleteEventElement(metrics)); + component.AppendEvent( + BuildDownloadCompleteEventElement(component, metrics)); crx_downloader_.reset(); @@ -512,13 +512,13 @@ static_cast<int>(ErrorCategory::kNetworkError); component.diff_error_code_ = download_result.error; - TransitionState(base::MakeUnique<StateDownloading>(&component)); + TransitionState(std::make_unique<StateDownloading>(&component)); return; } component.crx_path_ = download_result.response; - TransitionState(base::MakeUnique<StateUpdatingDiff>(&component)); + TransitionState(std::make_unique<StateUpdatingDiff>(&component)); } Component::StateDownloading::StateDownloading(Component* component) @@ -569,7 +569,8 @@ auto& component = Component::State::component(); for (const auto& metrics : crx_downloader_->download_metrics()) - component.AppendEvent(BuildDownloadCompleteEventElement(metrics)); + component.AppendEvent( + BuildDownloadCompleteEventElement(component, metrics)); crx_downloader_.reset(); @@ -578,13 +579,13 @@ component.error_category_ = static_cast<int>(ErrorCategory::kNetworkError); component.error_code_ = download_result.error; - TransitionState(base::MakeUnique<StateUpdateError>(&component)); + TransitionState(std::make_unique<StateUpdateError>(&component)); return; } component.crx_path_ = download_result.response; - TransitionState(base::MakeUnique<StateUpdating>(&component)); + TransitionState(std::make_unique<StateUpdating>(&component)); } Component::StateUpdatingDiff::StateUpdatingDiff(Component* component) @@ -631,7 +632,7 @@ component.diff_extra_code1_ = extra_code1; if (component.diff_error_code_ != 0) { - TransitionState(base::MakeUnique<StateDownloading>(&component)); + TransitionState(std::make_unique<StateDownloading>(&component)); return; } @@ -646,9 +647,9 @@ DCHECK_EQ(0, component.extra_code1_); if (component.action_run_.empty()) - TransitionState(base::MakeUnique<StateUpdated>(&component)); + TransitionState(std::make_unique<StateUpdated>(&component)); else - TransitionState(base::MakeUnique<StateRun>(&component)); + TransitionState(std::make_unique<StateRun>(&component)); } Component::StateUpdating::StateUpdating(Component* component) @@ -694,7 +695,7 @@ component.extra_code1_ = extra_code1; if (component.error_code_ != 0) { - TransitionState(base::MakeUnique<StateUpdateError>(&component)); + TransitionState(std::make_unique<StateUpdateError>(&component)); return; } @@ -704,9 +705,9 @@ DCHECK_EQ(0, component.extra_code1_); if (component.action_run_.empty()) - TransitionState(base::MakeUnique<StateUpdated>(&component)); + TransitionState(std::make_unique<StateUpdated>(&component)); else - TransitionState(base::MakeUnique<StateRun>(&component)); + TransitionState(std::make_unique<StateRun>(&component)); } Component::StateUpdated::StateUpdated(Component* component) @@ -760,7 +761,7 @@ DCHECK(thread_checker_.CalledOnValidThread()); const auto& component = State::component(); - action_runner_ = base::MakeUnique<ActionRunner>(component); + action_runner_ = std::make_unique<ActionRunner>(component); action_runner_->Run( base::BindOnce(&StateRun::ActionRunComplete, base::Unretained(this))); } @@ -776,11 +777,11 @@ BuildActionRunEventElement(succeeded, error_code, extra_code1)); switch (component.previous_state_) { case ComponentState::kChecking: - TransitionState(base::MakeUnique<StateUpToDate>(&component)); + TransitionState(std::make_unique<StateUpToDate>(&component)); return; case ComponentState::kUpdating: case ComponentState::kUpdatingDiff: - TransitionState(base::MakeUnique<StateUpdated>(&component)); + TransitionState(std::make_unique<StateUpdated>(&component)); return; default: break;
diff --git a/components/update_client/crx_downloader.cc b/components/update_client/crx_downloader.cc index a73bfc5..02d898c3 100644 --- a/components/update_client/crx_downloader.cc +++ b/components/update_client/crx_downloader.cc
@@ -11,7 +11,6 @@ #include "base/files/file_util.h" #include "base/location.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/task_scheduler/post_task.h" #include "base/task_scheduler/task_traits.h" #include "base/threading/thread_task_runner_handle.h" @@ -44,11 +43,11 @@ bool is_background_download, net::URLRequestContextGetter* context_getter) { std::unique_ptr<CrxDownloader> url_fetcher_downloader = - base::MakeUnique<UrlFetcherDownloader>(nullptr, context_getter); + std::make_unique<UrlFetcherDownloader>(nullptr, context_getter); #if defined(OS_WIN) if (is_background_download) { - return base::MakeUnique<BackgroundDownloader>( + return std::make_unique<BackgroundDownloader>( std::move(url_fetcher_downloader)); } #endif
diff --git a/components/update_client/ping_manager.cc b/components/update_client/ping_manager.cc index 3b148dc3..f974cd4 100644 --- a/components/update_client/ping_manager.cc +++ b/components/update_client/ping_manager.cc
@@ -15,7 +15,6 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "components/update_client/configurator.h" #include "components/update_client/protocol_builder.h" #include "components/update_client/request_sender.h" @@ -76,7 +75,7 @@ if (urls.empty()) return false; - request_sender_ = base::MakeUnique<RequestSender>(config_); + request_sender_ = std::make_unique<RequestSender>(config_); request_sender_->Send(false, BuildEventPingRequest(*config_, component), urls, base::BindOnce(&PingSender::OnRequestSenderComplete, base::Unretained(this))); @@ -95,7 +94,7 @@ bool PingManager::SendPing(const Component& component) { DCHECK(thread_checker_.CalledOnValidThread()); - auto ping_sender = base::MakeUnique<PingSender>(config_); + auto ping_sender = std::make_unique<PingSender>(config_); if (!ping_sender->SendPing(component)) return false;
diff --git a/components/update_client/ping_manager_unittest.cc b/components/update_client/ping_manager_unittest.cc index b883d376..f7ce932 100644 --- a/components/update_client/ping_manager_unittest.cc +++ b/components/update_client/ping_manager_unittest.cc
@@ -8,7 +8,6 @@ #include <string> #include <vector> -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" @@ -51,7 +50,7 @@ void PingManagerTest::SetUp() { config_ = base::MakeRefCounted<TestConfigurator>(); - ping_manager_ = base::MakeUnique<PingManager>(config_); + ping_manager_ = std::make_unique<PingManager>(config_); } void PingManagerTest::TearDown() { @@ -64,7 +63,7 @@ } std::unique_ptr<UpdateContext> PingManagerTest::MakeFakeUpdateContext() const { - return base::MakeUnique<UpdateContext>( + return std::make_unique<UpdateContext>( config_, false, std::vector<std::string>(), UpdateClient::CrxDataCallback(), UpdateEngine::NotifyObserversCallback(), UpdateEngine::Callback(), nullptr); @@ -83,7 +82,7 @@ { Component component(*update_context, "abc"); - component.state_ = base::MakeUnique<Component::StateUpdated>(&component); + component.state_ = std::make_unique<Component::StateUpdated>(&component); component.previous_version_ = base::Version("1.0"); component.next_version_ = base::Version("2.0"); component.AppendEvent(BuildUpdateCompleteEventElement(component)); @@ -94,8 +93,9 @@ EXPECT_EQ(1, interceptor->GetCount()) << interceptor->GetRequestsAsString(); EXPECT_NE(string::npos, interceptor->GetRequests()[0].find( - "<app appid=\"abc\" version=\"1.0\" nextversion=\"2.0\">" - "<event eventtype=\"3\" eventresult=\"1\"/></app>")) + "<app appid=\"abc\">" + "<event eventtype=\"3\" eventresult=\"1\" " + "previousversion=\"1.0\" nextversion=\"2.0\"/></app>")) << interceptor->GetRequestsAsString(); interceptor->Reset(); } @@ -104,7 +104,7 @@ // Test eventresult="0" is sent for failed updates. Component component(*update_context, "abc"); component.state_ = - base::MakeUnique<Component::StateUpdateError>(&component); + std::make_unique<Component::StateUpdateError>(&component); component.previous_version_ = base::Version("1.0"); component.next_version_ = base::Version("2.0"); component.AppendEvent(BuildUpdateCompleteEventElement(component)); @@ -115,8 +115,9 @@ EXPECT_EQ(1, interceptor->GetCount()) << interceptor->GetRequestsAsString(); EXPECT_NE(string::npos, interceptor->GetRequests()[0].find( - "<app appid=\"abc\" version=\"1.0\" nextversion=\"2.0\">" - "<event eventtype=\"3\" eventresult=\"0\"/></app>")) + "<app appid=\"abc\">" + "<event eventtype=\"3\" eventresult=\"0\" " + "previousversion=\"1.0\" nextversion=\"2.0\"/></app>")) << interceptor->GetRequestsAsString(); interceptor->Reset(); } @@ -125,7 +126,7 @@ // Test the error values and the fingerprints. Component component(*update_context, "abc"); component.state_ = - base::MakeUnique<Component::StateUpdateError>(&component); + std::make_unique<Component::StateUpdateError>(&component); component.previous_version_ = base::Version("1.0"); component.next_version_ = base::Version("2.0"); component.previous_fp_ = "prev fp"; @@ -145,12 +146,13 @@ EXPECT_EQ(1, interceptor->GetCount()) << interceptor->GetRequestsAsString(); EXPECT_NE(string::npos, interceptor->GetRequests()[0].find( - "<app appid=\"abc\" version=\"1.0\" nextversion=\"2.0\">" + "<app appid=\"abc\">" "<event eventtype=\"3\" eventresult=\"0\" errorcat=\"1\" " "errorcode=\"2\" extracode1=\"-1\" diffresult=\"0\" " "differrorcat=\"10\" " "differrorcode=\"20\" diffextracode1=\"-10\" " - "previousfp=\"prev fp\" nextfp=\"next fp\"/></app>")) + "previousfp=\"prev fp\" nextfp=\"next fp\" " + "previousversion=\"1.0\" nextversion=\"2.0\"/></app>")) << interceptor->GetRequestsAsString(); interceptor->Reset(); } @@ -159,7 +161,7 @@ // Test an invalid |next_version| is not serialized. Component component(*update_context, "abc"); component.state_ = - base::MakeUnique<Component::StateUpdateError>(&component); + std::make_unique<Component::StateUpdateError>(&component); component.previous_version_ = base::Version("1.0"); component.AppendEvent(BuildUpdateCompleteEventElement(component)); @@ -170,8 +172,28 @@ EXPECT_EQ(1, interceptor->GetCount()) << interceptor->GetRequestsAsString(); EXPECT_NE(string::npos, interceptor->GetRequests()[0].find( - "<app appid=\"abc\" version=\"1.0\">" - "<event eventtype=\"3\" eventresult=\"0\"/></app>")) + "<app appid=\"abc\"><event eventtype=\"3\" eventresult=\"0\" " + "previousversion=\"1.0\"/></app>")) + << interceptor->GetRequestsAsString(); + interceptor->Reset(); + } + + { + // Test a valid |previouversion| and |next_version| = base::Version("0") + // are serialized correctly under <event...> for uninstall. + Component component(*update_context, "abc"); + component.Uninstall(base::Version("1.2.3.4"), 0); + component.AppendEvent(BuildUninstalledEventElement(component)); + + ping_manager_->SendPing(component); + base::RunLoop().RunUntilIdle(); + + EXPECT_EQ(1, interceptor->GetCount()) << interceptor->GetRequestsAsString(); + EXPECT_NE(string::npos, + interceptor->GetRequests()[0].find( + "<app appid=\"abc\">" + "<event eventtype=\"4\" eventresult=\"1\" " + "previousversion=\"1.2.3.4\" nextversion=\"0\"/></app>")) << interceptor->GetRequestsAsString(); interceptor->Reset(); } @@ -179,7 +201,7 @@ { // Test the download metrics. Component component(*update_context, "abc"); - component.state_ = base::MakeUnique<Component::StateUpdated>(&component); + component.state_ = std::make_unique<Component::StateUpdated>(&component); component.previous_version_ = base::Version("1.0"); component.next_version_ = base::Version("2.0"); component.AppendEvent(BuildUpdateCompleteEventElement(component)); @@ -191,7 +213,8 @@ download_metrics.downloaded_bytes = 123; download_metrics.total_bytes = 456; download_metrics.download_time_ms = 987; - component.AppendEvent(BuildDownloadCompleteEventElement(download_metrics)); + component.AppendEvent( + BuildDownloadCompleteEventElement(component, download_metrics)); download_metrics = CrxDownloader::DownloadMetrics(); download_metrics.url = GURL("http://host2/path2"); @@ -200,7 +223,8 @@ download_metrics.downloaded_bytes = 1230; download_metrics.total_bytes = 4560; download_metrics.download_time_ms = 9870; - component.AppendEvent(BuildDownloadCompleteEventElement(download_metrics)); + component.AppendEvent( + BuildDownloadCompleteEventElement(component, download_metrics)); ping_manager_->SendPing(component); base::RunLoop().RunUntilIdle(); @@ -209,14 +233,17 @@ EXPECT_NE( string::npos, interceptor->GetRequests()[0].find( - "<app appid=\"abc\" version=\"1.0\" nextversion=\"2.0\">" - "<event eventtype=\"3\" eventresult=\"1\"/>" + "<app appid=\"abc\">" + "<event eventtype=\"3\" eventresult=\"1\" previousversion=\"1.0\" " + "nextversion=\"2.0\"/>" "<event eventtype=\"14\" eventresult=\"0\" downloader=\"direct\" " "errorcode=\"-1\" url=\"http://host1/path1\" downloaded=\"123\" " - "total=\"456\" download_time_ms=\"987\"/>" + "total=\"456\" download_time_ms=\"987\" previousversion=\"1.0\" " + "nextversion=\"2.0\"/>" "<event eventtype=\"14\" eventresult=\"1\" downloader=\"bits\" " "url=\"http://host2/path2\" downloaded=\"1230\" total=\"4560\" " - "download_time_ms=\"9870\"/></app>")) + "download_time_ms=\"9870\" previousversion=\"1.0\" " + "nextversion=\"2.0\"/></app>")) << interceptor->GetRequestsAsString(); interceptor->Reset(); }
diff --git a/components/update_client/protocol_builder.cc b/components/update_client/protocol_builder.cc index 7c0e3850..b7e98e8 100644 --- a/components/update_client/protocol_builder.cc +++ b/components/update_client/protocol_builder.cc
@@ -84,9 +84,23 @@ } } +// Returns a formatted string of previousversion and nextversion in an event. +std::string EventVersions(const Component& component) { + std::string event_versions; + base::StringAppendF(&event_versions, " previousversion=\"%s\"", + component.previous_version().GetString().c_str()); + const base::Version& next_version = component.next_version(); + if (next_version.IsValid()) { + base::StringAppendF(&event_versions, " nextversion=\"%s\"", + next_version.GetString().c_str()); + } + return event_versions; +} + } // namespace std::string BuildDownloadCompleteEventElement( + const Component& component, const CrxDownloader::DownloadMetrics& metrics) { using base::StringAppendF; @@ -113,6 +127,7 @@ StringAppendF(&event, " download_time_ms=\"%s\"", base::NumberToString(metrics.download_time_ms).c_str()); } + base::StrAppend(&event, {EventVersions(component)}); StringAppendF(&event, "/>"); return event; } @@ -150,6 +165,7 @@ component.previous_fp().c_str()); if (!component.next_fp().empty()) StringAppendF(&event, " nextfp=\"%s\"", component.next_fp().c_str()); + base::StrAppend(&event, {EventVersions(component)}); StringAppendF(&event, "/>"); return event; } @@ -161,8 +177,10 @@ std::string event; StringAppendF(&event, "<event eventtype=\"4\" eventresult=\"1\""); - if (component.extra_code1()) + if (component.extra_code1()) { StringAppendF(&event, " extracode1=\"%d\"", component.extra_code1()); + } + base::StrAppend(&event, {EventVersions(component)}); StringAppendF(&event, "/>"); return event; } @@ -381,19 +399,8 @@ component.state() == ComponentState::kUpdated || component.state() == ComponentState::kUninstalled); - // |next_version| is an optional argument for some ping types. This member - // is set by the value returned in the update check response. However, some - // of the pings are sent as a result of actions where the response did not - // include a manifest, neither a version. std::string app = - base::StringPrintf("<app appid=\"%s\"", component.id().c_str()); - base::StringAppendF(&app, " version=\"%s\"", - component.previous_version().GetString().c_str()); - if (component.next_version().IsValid()) { - base::StrAppend( - &app, {" nextversion=\"", component.next_version().GetString(), "\""}); - } - app.push_back('>'); + base::StringPrintf("<app appid=\"%s\">", component.id().c_str()); base::StrAppend(&app, component.events()); app.append("</app>");
diff --git a/components/update_client/protocol_builder.h b/components/update_client/protocol_builder.h index 7c6422eb..969126e 100644 --- a/components/update_client/protocol_builder.h +++ b/components/update_client/protocol_builder.h
@@ -69,6 +69,7 @@ // Returns a string representing a download complete event corresponding to // one download metrics instance. The event type for this ping event is 14. std::string BuildDownloadCompleteEventElement( + const Component& component, const CrxDownloader::DownloadMetrics& metrics); std::string BuildActionRunEventElement(bool succeeded,
diff --git a/components/update_client/protocol_builder_unittest.cc b/components/update_client/protocol_builder_unittest.cc index 075e2f6..cc2a665f 100644 --- a/components/update_client/protocol_builder_unittest.cc +++ b/components/update_client/protocol_builder_unittest.cc
@@ -5,7 +5,6 @@ #include <string> #include "base/files/file_path.h" -#include "base/memory/ptr_util.h" #include "base/path_service.h" #include "build/build_config.h" #include "components/update_client/protocol_builder.h" @@ -53,7 +52,7 @@ attributes["updatepolicy"] = "-1"; request = BuildProtocolRequest( "", "", "", "", "", "", "", "", - base::MakeUnique<UpdaterState::Attributes>(attributes)); + std::make_unique<UpdaterState::Attributes>(attributes)); EXPECT_NE(std::string::npos, request.find(" domainjoined=\"1\"")); const std::string updater_element = "<updater autoupdatecheckenabled=\"0\" "
diff --git a/components/update_client/protocol_parser.cc b/components/update_client/protocol_parser.cc index 4fd3c99..95902f6 100644 --- a/components/update_client/protocol_parser.cc +++ b/components/update_client/protocol_parser.cc
@@ -9,7 +9,6 @@ #include <algorithm> #include <memory> -#include "base/memory/ptr_util.h" #include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -94,7 +93,7 @@ for (xmlAttr* attr = node->properties; attr != nullptr; attr = attr->next) { if (!xmlStrcmp(attr->name, name) && attr->children && attr->children->content) { - return base::MakeUnique<std::string>( + return std::make_unique<std::string>( reinterpret_cast<const char*>(attr->children->content)); } }
diff --git a/components/update_client/request_sender_unittest.cc b/components/update_client/request_sender_unittest.cc index 4ed3d25..8310e7b 100644 --- a/components/update_client/request_sender_unittest.cc +++ b/components/update_client/request_sender_unittest.cc
@@ -8,7 +8,6 @@ #include <utility> #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/path_service.h" #include "base/run_loop.h" @@ -87,7 +86,7 @@ void RequestSenderTest::SetUp() { config_ = base::MakeRefCounted<TestConfigurator>(); interceptor_factory_ = - base::MakeUnique<InterceptorFactory>(base::ThreadTaskRunnerHandle::Get()); + std::make_unique<InterceptorFactory>(base::ThreadTaskRunnerHandle::Get()); post_interceptor_1_ = interceptor_factory_->CreateInterceptorForPath(kUrlPath1); post_interceptor_2_ = @@ -139,7 +138,7 @@ new PartialMatch("test"), test_file("updatecheck_reply_1.xml"))); const std::vector<GURL> urls = {GURL(kUrl1), GURL(kUrl2)}; - request_sender_ = base::MakeUnique<RequestSender>(config_); + request_sender_ = std::make_unique<RequestSender>(config_); request_sender_->Send( false, "test", urls, base::BindOnce(&RequestSenderTest::RequestSenderComplete, @@ -177,7 +176,7 @@ EXPECT_TRUE(post_interceptor_2_->ExpectRequest(new PartialMatch("test"))); const std::vector<GURL> urls = {GURL(kUrl1), GURL(kUrl2)}; - request_sender_ = base::MakeUnique<RequestSender>(config_); + request_sender_ = std::make_unique<RequestSender>(config_); request_sender_->Send( false, "test", urls, base::BindOnce(&RequestSenderTest::RequestSenderComplete, @@ -206,7 +205,7 @@ post_interceptor_2_->ExpectRequest(new PartialMatch("test"), 403)); const std::vector<GURL> urls = {GURL(kUrl1), GURL(kUrl2)}; - request_sender_ = base::MakeUnique<RequestSender>(config_); + request_sender_ = std::make_unique<RequestSender>(config_); request_sender_->Send( false, "test", urls, base::BindOnce(&RequestSenderTest::RequestSenderComplete, @@ -230,7 +229,7 @@ // Tests that the request fails when no urls are provided. TEST_F(RequestSenderTest, RequestSendFailedNoUrls) { std::vector<GURL> urls; - request_sender_ = base::MakeUnique<RequestSender>(config_); + request_sender_ = std::make_unique<RequestSender>(config_); request_sender_->Send( false, "test", urls, base::BindOnce(&RequestSenderTest::RequestSenderComplete, @@ -246,7 +245,7 @@ new PartialMatch("test"), test_file("updatecheck_reply_1.xml"))); const std::vector<GURL> urls = {GURL(kUrl1)}; - request_sender_ = base::MakeUnique<RequestSender>(config_); + request_sender_ = std::make_unique<RequestSender>(config_); request_sender_->Send( true, "test", urls, base::BindOnce(&RequestSenderTest::RequestSenderComplete,
diff --git a/components/update_client/update_checker.cc b/components/update_client/update_checker.cc index fbac4bbf..8f9de17 100644 --- a/components/update_client/update_checker.cc +++ b/components/update_client/update_checker.cc
@@ -16,7 +16,6 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/strings/stringprintf.h" #include "base/task_scheduler/post_task.h" #include "base/threading/thread_checker.h" @@ -133,7 +132,7 @@ if (IsEncryptionRequired(components)) RemoveUnsecureUrls(&urls); - request_sender_ = base::MakeUnique<RequestSender>(config_); + request_sender_ = std::make_unique<RequestSender>(config_); request_sender_->Send( config_->EnabledCupSigning(), BuildUpdateCheckRequest(*config_, ids_checked_, components, metadata_, @@ -224,7 +223,7 @@ std::unique_ptr<UpdateChecker> UpdateChecker::Create( const scoped_refptr<Configurator>& config, PersistedData* persistent) { - return base::MakeUnique<UpdateCheckerImpl>(config, persistent); + return std::make_unique<UpdateCheckerImpl>(config, persistent); } } // namespace update_client
diff --git a/components/update_client/update_client.cc b/components/update_client/update_client.cc index e50b0c33..8ea68cbc 100644 --- a/components/update_client/update_client.cc +++ b/components/update_client/update_client.cc
@@ -16,7 +16,6 @@ #include "base/location.h" #include "base/logging.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/observer_list.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_checker.h" @@ -69,7 +68,7 @@ : is_stopped_(false), config_(config), ping_manager_(std::move(ping_manager)), - update_engine_(base::MakeUnique<UpdateEngine>( + update_engine_(std::make_unique<UpdateEngine>( config, update_checker_factory, crx_downloader_factory, @@ -243,7 +242,7 @@ scoped_refptr<UpdateClient> UpdateClientFactory( const scoped_refptr<Configurator>& config) { return base::MakeRefCounted<UpdateClientImpl>( - config, base::MakeUnique<PingManager>(config), &UpdateChecker::Create, + config, std::make_unique<PingManager>(config), &UpdateChecker::Create, &CrxDownloader::Create); }
diff --git a/components/update_client/update_client_unittest.cc b/components/update_client/update_client_unittest.cc index 05434bc2..3c23319 100644 --- a/components/update_client/update_client_unittest.cc +++ b/components/update_client/update_client_unittest.cc
@@ -11,7 +11,6 @@ #include "base/files/file_util.h" #include "base/location.h" #include "base/macros.h" -#include "base/memory/ptr_util.h" #include "base/memory/ref_counted.h" #include "base/path_service.h" #include "base/run_loop.h" @@ -177,7 +176,7 @@ scoped_refptr<update_client::TestConfigurator> config_ = base::MakeRefCounted<TestConfigurator>(); std::unique_ptr<TestingPrefServiceSimple> pref_ = - base::MakeUnique<TestingPrefServiceSimple>(); + std::make_unique<TestingPrefServiceSimple>(); std::unique_ptr<update_client::PersistedData> metadata_; DISALLOW_COPY_AND_ASSIGN(UpdateClientTest); @@ -187,7 +186,7 @@ UpdateClientTest::UpdateClientTest() { PersistedData::RegisterPrefs(pref_->registry()); - metadata_ = base::MakeUnique<PersistedData>(pref_.get(), nullptr); + metadata_ = std::make_unique<PersistedData>(pref_.get(), nullptr); } UpdateClientTest::~UpdateClientTest() { @@ -237,7 +236,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -270,7 +269,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -288,7 +287,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -347,7 +346,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -429,7 +428,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -482,7 +481,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -557,7 +556,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -661,7 +660,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -739,7 +738,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -825,7 +824,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -926,7 +925,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -1001,7 +1000,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -1091,7 +1090,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -1208,7 +1207,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -1289,7 +1288,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -1417,7 +1416,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -1476,7 +1475,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -1529,7 +1528,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -1603,7 +1602,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -1722,7 +1721,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -1815,7 +1814,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -1904,7 +1903,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -1937,7 +1936,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -1954,10 +1953,10 @@ }; std::unique_ptr<PingManager> ping_manager = - base::MakeUnique<FakePingManager>(config()); + std::make_unique<FakePingManager>(config()); scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -2015,7 +2014,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -2080,7 +2079,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -2137,7 +2136,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -2206,7 +2205,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -2240,7 +2239,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -2257,10 +2256,10 @@ }; std::unique_ptr<FakePingManager> ping_manager = - base::MakeUnique<FakePingManager>(config()); + std::make_unique<FakePingManager>(config()); scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -2310,7 +2309,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -2325,7 +2324,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -2336,7 +2335,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManagerImpl>(config()), + config(), std::make_unique<FakePingManagerImpl>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); const std::vector<std::string> empty_id_list; @@ -2392,19 +2391,19 @@ const auto ping_data = FakePingManagerImpl::ping_data(); EXPECT_EQ(1u, ping_data.size()); EXPECT_EQ("jebgalgnebhfojomionfpkfelancnnkf", ping_data[0].id); - EXPECT_EQ(base::Version("1.0"), ping_data[0].previous_version); - EXPECT_EQ(base::Version("0.0"), ping_data[0].next_version); + EXPECT_EQ(base::Version("1.2.3.4"), ping_data[0].previous_version); + EXPECT_EQ(base::Version("0"), ping_data[0].next_version); EXPECT_EQ(10, ping_data[0].extra_code1); } }; scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); update_client->SendUninstallPing( - "jebgalgnebhfojomionfpkfelancnnkf", base::Version("1.0"), 10, + "jebgalgnebhfojomionfpkfelancnnkf", base::Version("1.2.3.4"), 10, base::BindOnce(&CompletionCallbackFake::Callback, quit_closure())); RunThreads(); @@ -2457,7 +2456,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -2499,7 +2498,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -2517,7 +2516,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -2630,7 +2629,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -2736,7 +2735,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -2800,7 +2799,7 @@ config()->SetEnabledComponentUpdates(false); scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -2876,7 +2875,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -2900,7 +2899,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -2918,7 +2917,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); MockObserver observer; @@ -2956,7 +2955,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -3021,7 +3020,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -3068,20 +3067,23 @@ "<event eventtype=\"14\" eventresult=\"1\" downloader=\"unknown\" " "url=\"http://localhost/download/" "runaction_test_win.crx3\" downloaded=\"1843\" " - "total=\"1843\" download_time_ms=\"1000\"/>", + "total=\"1843\" download_time_ms=\"1000\" previousversion=\"0.0\" " + "nextversion=\"1.0\"/>", events[0].c_str()); EXPECT_STREQ( "<event eventtype=\"42\" eventresult=\"1\" " "errorcode=\"1877345072\"/>", events[1].c_str()); - EXPECT_STREQ("<event eventtype=\"3\" eventresult=\"1\"/>", - events[2].c_str()); + EXPECT_STREQ( + "<event eventtype=\"3\" eventresult=\"1\" previousversion=\"0.0\" " + "nextversion=\"1.0\"/>", + events[2].c_str()); } }; scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); // The action is a program which returns 1877345072 as a hardcoded value. @@ -3114,7 +3116,7 @@ static std::unique_ptr<UpdateChecker> Create( const scoped_refptr<Configurator>& config, PersistedData* metadata) { - return base::MakeUnique<FakeUpdateChecker>(); + return std::make_unique<FakeUpdateChecker>(); } void CheckForUpdates(const std::vector<std::string>& ids_to_check, @@ -3160,7 +3162,7 @@ static std::unique_ptr<CrxDownloader> Create( bool is_background_download, net::URLRequestContextGetter* context_getter) { - return base::MakeUnique<FakeCrxDownloader>(); + return std::make_unique<FakeCrxDownloader>(); } FakeCrxDownloader() : CrxDownloader(nullptr) {} @@ -3219,7 +3221,7 @@ scoped_refptr<UpdateClient> update_client = base::MakeRefCounted<UpdateClientImpl>( - config(), base::MakeUnique<FakePingManager>(config()), + config(), std::make_unique<FakePingManager>(config()), &FakeUpdateChecker::Create, &FakeCrxDownloader::Create); // The action is a program which returns 1877345072 as a hardcoded value.
diff --git a/components/update_client/update_engine.cc b/components/update_client/update_engine.cc index 4bb2d3a..e30cedd 100644 --- a/components/update_client/update_engine.cc +++ b/components/update_client/update_engine.cc
@@ -11,7 +11,6 @@ #include "base/bind_helpers.h" #include "base/location.h" #include "base/logging.h" -#include "base/memory/ptr_util.h" #include "base/stl_util.h" #include "base/threading/thread_task_runner_handle.h" #include "components/prefs/pref_service.h" @@ -43,7 +42,7 @@ crx_downloader_factory(crx_downloader_factory) { for (const auto& id : ids) components.insert( - std::make_pair(id, base::MakeUnique<Component>(*this, id))); + std::make_pair(id, std::make_unique<Component>(*this, id))); } UpdateContext::~UpdateContext() {} @@ -79,7 +78,7 @@ return; } - const auto result = update_contexts_.insert(base::MakeUnique<UpdateContext>( + const auto result = update_contexts_.insert(std::make_unique<UpdateContext>( config_, is_foreground, ids, std::move(crx_data_callback), notify_observers_callback_, std::move(callback), crx_downloader_factory_)); @@ -345,7 +344,7 @@ Callback callback) { DCHECK(thread_checker_.CalledOnValidThread()); - const auto result = update_contexts_.insert(base::MakeUnique<UpdateContext>( + const auto result = update_contexts_.insert(std::make_unique<UpdateContext>( config_, false, std::vector<std::string>{id}, UpdateClient::CrxDataCallback(), UpdateEngine::NotifyObserversCallback(), std::move(callback), nullptr));
diff --git a/components/update_client/updater_state.cc b/components/update_client/updater_state.cc index 0359881..b810253 100644 --- a/components/update_client/updater_state.cc +++ b/components/update_client/updater_state.cc
@@ -7,7 +7,6 @@ #include <utility> -#include "base/memory/ptr_util.h" #include "base/strings/string16.h" #include "base/strings/string_number_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -30,7 +29,7 @@ #if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS)) UpdaterState updater_state(is_machine); updater_state.ReadState(); - return base::MakeUnique<Attributes>(updater_state.BuildAttributes()); + return std::make_unique<Attributes>(updater_state.BuildAttributes()); #else return nullptr; #endif // OS_WIN or Mac
diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc index cfe5477..035009c 100644 --- a/components/variations/service/variations_service.cc +++ b/components/variations/service/variations_service.cc
@@ -61,7 +61,7 @@ namespace { const base::Feature kHttpRetryFeature{"VariationsHttpRetry", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; // Constants used for encrypting the if-none-match header if we are retrieving a // seed over http.
diff --git a/components/viz/common/BUILD.gn b/components/viz/common/BUILD.gn index b7e972d..b1f1c51 100644 --- a/components/viz/common/BUILD.gn +++ b/components/viz/common/BUILD.gn
@@ -103,8 +103,6 @@ "quads/tile_draw_quad.h", "quads/yuv_video_draw_quad.cc", "quads/yuv_video_draw_quad.h", - "resources/buffer_to_texture_target_map.cc", - "resources/buffer_to_texture_target_map.h", "resources/platform_color.h", "resources/release_callback.h", "resources/resource.cc", @@ -164,9 +162,11 @@ "//mojo/public/cpp/bindings", "//skia", "//third_party/libyuv", + "//ui/gfx", "//ui/gfx:color_space", "//ui/gfx:geometry_skia", "//ui/gfx/geometry", + "//ui/gl", "//ui/latency", ] @@ -193,7 +193,6 @@ "gpu/context_cache_controller_unittest.cc", "quads/draw_quad_unittest.cc", "quads/render_pass_unittest.cc", - "resources/buffer_to_texture_target_map_unittest.cc", "resources/platform_color_unittest.cc", "surfaces/surface_sequence_generator_unittest.cc", "yuv_readback_unittest.cc",
diff --git a/components/viz/common/resources/buffer_to_texture_target_map.cc b/components/viz/common/resources/buffer_to_texture_target_map.cc deleted file mode 100644 index 4717763..0000000 --- a/components/viz/common/resources/buffer_to_texture_target_map.cc +++ /dev/null
@@ -1,49 +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. -#include "components/viz/common/resources/buffer_to_texture_target_map.h" - -#include <vector> - -#include "base/strings/string_number_conversions.h" -#include "base/strings/string_split.h" - -namespace viz { - -BufferUsageAndFormatList StringToBufferUsageAndFormatList( - const std::string& str) { - BufferUsageAndFormatList usage_format_list; - std::vector<std::string> entries = - base::SplitString(str, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - for (const auto& entry : entries) { - std::vector<std::string> fields = base::SplitString( - entry, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); - CHECK_EQ(fields.size(), 2u); - uint32_t usage = 0; - uint32_t format = 0; - bool succeeded = base::StringToUint(fields[0], &usage) && - base::StringToUint(fields[1], &format); - CHECK(succeeded); - CHECK_LE(usage, static_cast<uint32_t>(gfx::BufferUsage::LAST)); - CHECK_LE(format, static_cast<uint32_t>(gfx::BufferFormat::LAST)); - usage_format_list.push_back( - std::make_pair(static_cast<gfx::BufferUsage>(usage), - static_cast<gfx::BufferFormat>(format))); - } - return usage_format_list; -} - -std::string BufferUsageAndFormatListToString( - const BufferUsageAndFormatList& usage_format_list) { - std::string str; - for (const auto& entry : usage_format_list) { - if (!str.empty()) - str += ";"; - str += base::UintToString(static_cast<uint32_t>(entry.first)); - str += ","; - str += base::UintToString(static_cast<uint32_t>(entry.second)); - } - return str; -} - -} // namespace viz
diff --git a/components/viz/common/resources/buffer_to_texture_target_map.h b/components/viz/common/resources/buffer_to_texture_target_map.h deleted file mode 100644 index 9bf00e71..0000000 --- a/components/viz/common/resources/buffer_to_texture_target_map.h +++ /dev/null
@@ -1,34 +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. - -#ifndef COMPONENTS_VIZ_COMMON_RESOURCES_BUFFER_TO_TEXTURE_TARGET_MAP_H_ -#define COMPONENTS_VIZ_COMMON_RESOURCES_BUFFER_TO_TEXTURE_TARGET_MAP_H_ - -#include <map> -#include <string> -#include <vector> - -#include "components/viz/common/viz_common_export.h" -#include "ui/gfx/buffer_types.h" - -namespace viz { -// A pair containing GPU Memory Buffer usage and format. -using BufferUsageAndFormat = std::pair<gfx::BufferUsage, gfx::BufferFormat>; -using BufferUsageAndFormatList = std::vector<BufferUsageAndFormat>; - -// Converts a serialized list of BufferUsageAndFormat back to the runtime -// format. Serialization takes the form: -// "usage,format;usage,format;...;usage,format" -VIZ_COMMON_EXPORT BufferUsageAndFormatList -StringToBufferUsageAndFormatList(const std::string& str); - -// Converts a vector of BufferUsageAndFormat to a string representation of the -// format: -// "usage,format;usage,format;...;usage,format" -VIZ_COMMON_EXPORT std::string BufferUsageAndFormatListToString( - const BufferUsageAndFormatList& usage_and_format); - -} // namespace viz - -#endif // COMPONENTS_VIZ_COMMON_RESOURCES_BUFFER_TO_TEXTURE_TARGET_MAP_H_
diff --git a/components/viz/common/resources/buffer_to_texture_target_map_unittest.cc b/components/viz/common/resources/buffer_to_texture_target_map_unittest.cc deleted file mode 100644 index 79f3805..0000000 --- a/components/viz/common/resources/buffer_to_texture_target_map_unittest.cc +++ /dev/null
@@ -1,35 +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. - -#include "components/viz/common/resources/buffer_to_texture_target_map.h" - -#include "testing/gtest/include/gtest/gtest.h" -#include "ui/gfx/buffer_types.h" - -namespace viz { -namespace { - -// Ensures that a list populated with various values can be serialized to/from -// string successfully. -TEST(BuffferUsageAndFormatList, SerializeRoundTrip) { - BufferUsageAndFormatList test_list; - for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); - ++usage_idx) { - gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); - for (int format_idx = 0; - format_idx <= static_cast<int>(gfx::BufferFormat::LAST); - ++format_idx) { - gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); - test_list.push_back(std::make_pair(usage, format)); - } - } - - std::string serialized_list = BufferUsageAndFormatListToString(test_list); - BufferUsageAndFormatList deserialized_list = - StringToBufferUsageAndFormatList(serialized_list); - EXPECT_EQ(test_list, deserialized_list); -} - -} // namespace -} // namespace viz
diff --git a/components/viz/common/resources/resource_settings.h b/components/viz/common/resources/resource_settings.h index ec544006..2854205 100644 --- a/components/viz/common/resources/resource_settings.h +++ b/components/viz/common/resources/resource_settings.h
@@ -5,7 +5,8 @@ #ifndef COMPONENTS_VIZ_COMMON_RESOURCES_RESOURCE_SETTINGS_H_ #define COMPONENTS_VIZ_COMMON_RESOURCES_RESOURCE_SETTINGS_H_ -#include "components/viz/common/resources/buffer_to_texture_target_map.h" +#include <stddef.h> + #include "components/viz/common/viz_common_export.h" namespace viz { @@ -24,9 +25,6 @@ bool high_bit_for_testing = false; // TODO(riju): Remove after r16 is used without the flag. crbug.com/759456 bool use_r16_texture = false; - // A list of buffer usage/format for which a per platform specific texture - // target should be used, instead of TEXTURE_2D. - BufferUsageAndFormatList texture_target_exception_list; }; } // namespace viz
diff --git a/components/viz/common/switches.cc b/components/viz/common/switches.cc index ebe7c77f..647c05f5 100644 --- a/components/viz/common/switches.cc +++ b/components/viz/common/switches.cc
@@ -13,9 +13,16 @@ constexpr uint32_t kDefaultNumberOfFramesToDeadline = 4; } -// Disable surface lifetime management using surface references. This enables -// adding surface sequences and disables adding temporary references. -const char kDisableSurfaceReferences[] = "disable-surface-references"; +// The default number of the BeginFrames to wait to activate a surface with +// dependencies. +const char kDeadlineToSynchronizeSurfaces[] = + "deadline-to-synchronize-surfaces"; + +// Enable surface lifetime management using surface references. This disables +// adding surface sequences and enables adding temporary references. This flag +// is only checked on Android, other platforms always have surface references +// enabled. +const char kEnableSurfaceReferences[] = "enable-surface-references"; // Enables multi-client Surface synchronization. In practice, this indicates // that LayerTreeHost expects to be given a valid viz::LocalSurfaceId provided @@ -26,11 +33,6 @@ // in the viz process instead of the browser process. const char kEnableViz[] = "enable-viz"; -// The default number of the BeginFrames to wait to activate a surface with -// dependencies. -const char kDeadlineToSynchronizeSurfaces[] = - "deadline-to-synchronize-surfaces"; - uint32_t GetDeadlineToSynchronizeSurfaces() { std::string deadline_to_synchronize_surfaces_string = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
diff --git a/components/viz/common/switches.h b/components/viz/common/switches.h index 8c9e6ddd..4961d9c 100644 --- a/components/viz/common/switches.h +++ b/components/viz/common/switches.h
@@ -13,10 +13,10 @@ namespace switches { // Keep list in alphabetical order. -VIZ_COMMON_EXPORT extern const char kDisableSurfaceReferences[]; +VIZ_COMMON_EXPORT extern const char kDeadlineToSynchronizeSurfaces[]; +VIZ_COMMON_EXPORT extern const char kEnableSurfaceReferences[]; VIZ_COMMON_EXPORT extern const char kEnableSurfaceSynchronization[]; VIZ_COMMON_EXPORT extern const char kEnableViz[]; -VIZ_COMMON_EXPORT extern const char kDeadlineToSynchronizeSurfaces[]; VIZ_COMMON_EXPORT uint32_t GetDeadlineToSynchronizeSurfaces();
diff --git a/components/viz/host/host_frame_sink_manager.cc b/components/viz/host/host_frame_sink_manager.cc index d723de4..4917a0d 100644 --- a/components/viz/host/host_frame_sink_manager.cc +++ b/components/viz/host/host_frame_sink_manager.cc
@@ -202,6 +202,16 @@ frame_sink_manager_->AssignTemporaryReference(surface_id, frame_sink_id); } +void HostFrameSinkManager::AddVideoDetectorObserver( + mojom::VideoDetectorObserverPtr observer) { + frame_sink_manager_->AddVideoDetectorObserver(std::move(observer)); +} + +void HostFrameSinkManager::CreateVideoCapturer( + mojom::FrameSinkVideoCapturerRequest request) { + frame_sink_manager_->CreateVideoCapturer(std::move(request)); +} + std::unique_ptr<CompositorFrameSinkSupport> HostFrameSinkManager::CreateCompositorFrameSinkSupport( mojom::CompositorFrameSinkClient* client, @@ -383,9 +393,4 @@ HostFrameSinkManager::FrameSinkData& HostFrameSinkManager::FrameSinkData:: operator=(FrameSinkData&& other) = default; -void HostFrameSinkManager::AddVideoDetectorObserver( - mojom::VideoDetectorObserverPtr observer) { - frame_sink_manager_->AddVideoDetectorObserver(std::move(observer)); -} - } // namespace viz
diff --git a/components/viz/host/host_frame_sink_manager.h b/components/viz/host/host_frame_sink_manager.h index 3fe0750..6e3c6dd 100644 --- a/components/viz/host/host_frame_sink_manager.h +++ b/components/viz/host/host_frame_sink_manager.h
@@ -127,6 +127,9 @@ // Asks viz to send updates regarding video activity to |observer|. void AddVideoDetectorObserver(mojom::VideoDetectorObserverPtr observer); + // Creates a FrameSinkVideoCapturer instance. + void CreateVideoCapturer(mojom::FrameSinkVideoCapturerRequest request); + // CompositorFrameSinkSupportManager: std::unique_ptr<CompositorFrameSinkSupport> CreateCompositorFrameSinkSupport( mojom::CompositorFrameSinkClient* client,
diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc index 661fec9..8c46467 100644 --- a/components/viz/host/renderer_settings_creation.cc +++ b/components/viz/host/renderer_settings_creation.cc
@@ -35,16 +35,11 @@ } // namespace -ResourceSettings CreateResourceSettings( - const BufferUsageAndFormatList& texture_target_exception_list) { - ResourceSettings resource_settings; - resource_settings.texture_target_exception_list = - texture_target_exception_list; - return resource_settings; +ResourceSettings CreateResourceSettings() { + return ResourceSettings(); } -RendererSettings CreateRendererSettings( - const BufferUsageAndFormatList& texture_target_exception_list) { +RendererSettings CreateRendererSettings() { RendererSettings renderer_settings; base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); renderer_settings.partial_swap_enabled = @@ -61,8 +56,6 @@ command_line->HasSwitch(switches::kShowOverdrawFeedback); renderer_settings.enable_draw_occlusion = command_line->HasSwitch(switches::kEnableDrawOcclusion); - renderer_settings.resource_settings = - CreateResourceSettings(texture_target_exception_list); renderer_settings.disallow_non_exact_resource_reuse = command_line->HasSwitch(switches::kDisallowNonExactResourceReuse); renderer_settings.allow_antialiasing =
diff --git a/components/viz/host/renderer_settings_creation.h b/components/viz/host/renderer_settings_creation.h index 231ab940..53390ea 100644 --- a/components/viz/host/renderer_settings_creation.h +++ b/components/viz/host/renderer_settings_creation.h
@@ -7,7 +7,6 @@ #include <stdint.h> -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "components/viz/host/viz_host_export.h" namespace viz { @@ -17,13 +16,8 @@ namespace viz { -// |image_targets| is a map from every supported pair of GPU memory buffer -// usage/format to its GL texture target. -VIZ_HOST_EXPORT ResourceSettings CreateResourceSettings( - const BufferUsageAndFormatList& texture_target_exception_list); - -VIZ_HOST_EXPORT RendererSettings CreateRendererSettings( - const BufferUsageAndFormatList& texture_target_exception_list); +VIZ_HOST_EXPORT ResourceSettings CreateResourceSettings(); +VIZ_HOST_EXPORT RendererSettings CreateRendererSettings(); } // namespace viz
diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn index 296f2a0d..2fdf522 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn
@@ -120,7 +120,6 @@ "frame_sinks/video_capture/frame_sink_video_capturer_impl.cc", "frame_sinks/video_capture/frame_sink_video_capturer_impl.h", "frame_sinks/video_capture/frame_sink_video_capturer_manager.h", - "frame_sinks/video_capture/frame_sink_video_consumer.h", "frame_sinks/video_capture/in_flight_frame_delivery.cc", "frame_sinks/video_capture/in_flight_frame_delivery.h", "frame_sinks/video_capture/interprocess_frame_pool.cc", @@ -162,6 +161,7 @@ "//cc/paint", "//components/crash/core/common:crash_key", "//components/viz/common", + "//gpu/ipc:gl_in_process_context", # Note that dependency on //gpu/ipc/client is for GpuMemoryBufferImpl. This # dependency should not be in public_deps. @@ -183,7 +183,6 @@ "//cc", "//cc/debug", "//gpu/command_buffer/client:gles2_interface", - "//gpu/ipc:command_buffer", "//services/viz/privileged/interfaces/compositing", "//services/viz/public/interfaces", "//ui/gfx", @@ -309,6 +308,7 @@ "//gpu/command_buffer/client", "//gpu/command_buffer/client:gles2_implementation", "//gpu/ipc:gl_in_process_context", + "//gpu/ipc/service", "//media", "//media/capture:capture_lib", "//services/ui/public/interfaces", @@ -319,6 +319,7 @@ "//third_party/libyuv", "//ui/display/types", "//ui/gfx:test_support", + "//ui/gl", ] if (use_ozone) {
diff --git a/components/viz/service/display/display.cc b/components/viz/service/display/display.cc index dabec1d..f42c38c7 100644 --- a/components/viz/service/display/display.cc +++ b/components/viz/service/display/display.cc
@@ -38,14 +38,12 @@ Display::Display( SharedBitmapManager* bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const RendererSettings& settings, const FrameSinkId& frame_sink_id, std::unique_ptr<OutputSurface> output_surface, std::unique_ptr<DisplayScheduler> scheduler, scoped_refptr<base::SingleThreadTaskRunner> current_task_runner) : bitmap_manager_(bitmap_manager), - gpu_memory_buffer_manager_(gpu_memory_buffer_manager), settings_(settings), frame_sink_id_(frame_sink_id), output_surface_(std::move(output_surface)), @@ -207,7 +205,7 @@ void Display::InitializeRenderer() { resource_provider_ = std::make_unique<cc::DisplayResourceProvider>( output_surface_->context_provider(), bitmap_manager_, - gpu_memory_buffer_manager_, settings_.resource_settings); + settings_.resource_settings); if (output_surface_->context_provider()) { if (!settings_.use_skia_renderer) { @@ -647,19 +645,26 @@ continue; } - // If the |quad| is not shown on the screen, i.e., covered by the occluded - // region, then remove |quad| from the compositor frame. if (occlusion_in_quad_content_space.Contains(quad->visible_rect)) { - // Case 1: for simple transforms (scale or translation), the occlusion - // region is defined in the quad content space. + // Case 1: for simple transforms (scale or translation), define the + // occlusion region in the quad content space. If the |quad| is not + // shown on the screen, then remove |quad| from the compositor frame. quad = pass->quad_list.EraseAndInvalidateAllPointers(quad); + } else if (occlusion_in_quad_content_space.Intersects( + quad->visible_rect)) { + // Case 2: for simple transforms, if the quad is partially shown on + // screen and the region formed by (occlusion region - visible_rect) is + // a rect, then update visible_rect to the resulting rect. + quad->visible_rect.Subtract(occlusion_in_quad_content_space); + ++quad; } else if (occlusion_in_quad_content_space.IsEmpty() && occlusion_in_target_space.Contains( cc::MathUtil::MapEnclosingClippedRect( transform, quad->visible_rect))) { - // Case 2: for non-simple transforms, the occlusion region is defined in - // the target space. + // Case 3: for non simple transforms, define the occlusion region in + // target space. If the |quad| is not shown on the screen, then remove + // |quad| from the compositor frame. quad = pass->quad_list.EraseAndInvalidateAllPointers(quad); } else { ++quad;
diff --git a/components/viz/service/display/display.h b/components/viz/service/display/display.h index 2bb63f9..a948579b 100644 --- a/components/viz/service/display/display.h +++ b/components/viz/service/display/display.h
@@ -30,10 +30,6 @@ class RendererSettings; } // namespace cc -namespace gpu { -class GpuMemoryBufferManager; -} - namespace gfx { class Size; } @@ -64,7 +60,6 @@ // The |current_task_runner| may be null if the Display is on a thread without // a MessageLoop. Display(SharedBitmapManager* bitmap_manager, - gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, const RendererSettings& settings, const FrameSinkId& frame_sink_id, std::unique_ptr<OutputSurface> output_surface, @@ -128,7 +123,6 @@ void OnContextLost() override; SharedBitmapManager* const bitmap_manager_; - gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; const RendererSettings settings_; DisplayClient* client_ = nullptr;
diff --git a/components/viz/service/display/display_perftest.cc b/components/viz/service/display/display_perftest.cc index 1536d07..afdd443 100644 --- a/components/viz/service/display/display_perftest.cc +++ b/components/viz/service/display/display_perftest.cc
@@ -54,9 +54,8 @@ output_surface = cc::FakeOutputSurface::Create3d(std::move(provider)); auto display = std::make_unique<Display>( - &bitmap_manager_, nullptr /* gpu_memory_buffer_manager */, - RendererSettings(), frame_sink_id, std::move(output_surface), - std::move(scheduler), task_runner_.get()); + &bitmap_manager_, RendererSettings(), frame_sink_id, + std::move(output_surface), std::move(scheduler), task_runner_.get()); return display; }
diff --git a/components/viz/service/display/display_unittest.cc b/components/viz/service/display/display_unittest.cc index 74051f7..75e61a0b 100644 --- a/components/viz/service/display/display_unittest.cc +++ b/components/viz/service/display/display_unittest.cc
@@ -136,9 +136,8 @@ std::unique_ptr<DisplayScheduler> scheduler, std::unique_ptr<OutputSurface> output_surface) { auto display = std::make_unique<Display>( - &shared_bitmap_manager_, nullptr /* gpu_memory_buffer_manager */, - settings, frame_sink_id, std::move(output_surface), - std::move(scheduler), task_runner_); + &shared_bitmap_manager_, settings, frame_sink_id, + std::move(output_surface), std::move(scheduler), task_runner_); display->SetVisible(true); return display; } @@ -689,7 +688,7 @@ TearDownDisplay(); } -// Check if draw occlusion does not remove any draw quads when no quads is being +// Check if draw occlusion does not remove any DrawQuads when no quad is being // covered completely. TEST_F(DisplayTest, DrawOcclusionWithNonCoveringDrawQuad) { SetUpDisplay(RendererSettings(), cc::TestWebGraphicsContext3D::Create()); @@ -703,6 +702,8 @@ gfx::Rect rect3(25, 25, 50, 100); gfx::Rect rect4(150, 0, 50, 50); gfx::Rect rect5(0, 0, 120, 120); + gfx::Rect rect6(25, 0, 50, 160); + gfx::Rect rect7(0, 20, 100, 100); bool is_clipped = false; bool are_contents_opaque = true; @@ -723,12 +724,13 @@ quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // This is a base case, the quad list of compositor frame contains only one - // quad, so quad_list still has size 1 after removing overdraw. + // This is a base case, the compositor frame contains only one + // DrawQuad, so the size of quad_list remains unchanged after calling + // RemoveOverdrawQuads. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } SharedQuadState* shared_quad_state2 = frame.render_pass_list.front()->CreateAndAppendSharedQuadState(); @@ -753,21 +755,27 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // Since |quad1| and |quad2| are partially overlapped, no quad can be - // removed. + // Since |quad| (defined by rect1 (0, 0, 100x100)) cannot cover |quad2| + // (define by rect2 (50, 50, 100x100)), the |quad_list| size remains the + // same after calling RemoveOverdrawQuads. The visible region of |quad2| on + // screen is rect2 - rect1 U rect2 = (100, 50, 50x50 U 50, 100, 100x50), + // which cannot be represented by a smaller rect (its visible_rect stays + // the same). EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } - // +----+ - // |+--+| - // +----+ - // +--+ + // +------+ +------+ + // | | | | + // | +--+ | show on screen | | + // +------+ => +------+ + // | | | | + // +--+ +--+ { shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, rect1, is_clipped, are_contents_opaque, opacity, @@ -782,15 +790,54 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // Since |quad1| and |quad2| are partially overlapped, no quad can be - // removed. + // Since |quad| (defined by rect1 (0, 0, 100x100)) cannot cover |quad2| + // (define by rect3 (25, 25, 50x100)), the |quad_list| size remains the same + // after calling RemoveOverdrawQuads. The visible region of |quad2| on + // screen is rect3 - rect1 U rect3 = (25, 100, 50x25), which updates its + // visible_rect accordingly. EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); - EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(25, 100, 50, 25).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + } + + // +--+ +--+ + // +----+ +----+ + // || || shown on screen | | + // +----+ +----+ + // +--+ +--+ + { + shared_quad_state->SetAll(gfx::Transform(), rect7, rect7, rect7, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + + shared_quad_state2->SetAll(gfx::Transform(), rect6, rect6, rect6, + is_clipped, are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + + quad->SetNew(shared_quad_state, rect7, rect7, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state2, rect6, rect6, SK_ColorBLACK, false); + + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + + // Since |quad| (defined by rect7 (0, 20, 100x100)) cannot cover |quad2| + // (define by rect6 (25, 0, 50x160)), the |quad_list| size remains the same + // after calling RemoveOverdrawQuads. The visible region of |quad2| on + // screen is rect6 - rect7 = (25, 0, 50x20 U 25, 120, 50x40), which + // cannot be represented by a smaller rect (its visible_rect stays the + // same). + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect7.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect6.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } // +----+ +--+ @@ -810,14 +857,18 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // Since |quad1| and |quad2| are disjoined, no quad can be removed. + + // Since |quad| (defined by rect1 (0, 0, 100x100)) cannot cover |quad2| + // (define by rect4 (150, 0, 50x50)), the |quad_list| size remains the same + // after calling RemoveOverdrawQuads. The visible region of |quad2| on + // screen is rect4 (150, 0, 50x50), its visible_rect stays the same. EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect4.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } // +-----++ @@ -838,22 +889,26 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |quad2| extends |quad1|, so |quad1| cannot occlude |quad2|. 2 quads - // remains in the quad_list. + + // Since |quad| (defined by rect1 (0, 0, 100x100)) cannot cover |quad2| + // (define by rect5 (0, 0, 120x120)), the |quad_list| size remains the same + // after calling RemoveOverdrawQuads. The visible region of |quad2| on + // screen is rect5 - rect1 = (100, 0, 20x100 U 0, 100, 100x20), + // which cannot be represented by a smaller rect (its visible_rect stays the + // same). EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect5.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); } -// Check if draw occlusion removes draw quads when quads are being covered -// completely. +// Check if draw occlusion removes DrawQuads that are not shown on screen. TEST_F(DisplayTest, CompositorFrameWithOverlapDrawQuad) { SetUpDisplay(RendererSettings(), cc::TestWebGraphicsContext3D::Create()); @@ -893,12 +948,11 @@ quad2->SetNew(shared_quad_state2, rect1, rect1, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |quad2| is completely overlapped with |quad1|, so |quad2| is removed from - // the |quad_list| and the list size becomes 1. + // |quad2| overlaps |quad1|, so |quad2| is removed from the |quad_list|. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } // +-----+ @@ -919,12 +973,12 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |quad2| is in the middle of |quad1| and is completely covered, so |quad2| - // is removed from the |quad_list| and the list size becomes 1. + // |quad2| is hiding behind |quad1|, so |quad2| is removed from the + // |quad_list|. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } // +-----+ @@ -945,12 +999,12 @@ quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |quad2| is aligns with |quad1| and is completely covered, so |quad2| is - // removed from the |quad_list| and the list size becomes 1. + // |quad2| is behind |quad1| and aligns with the edge of |quad1|, so |quad2| + // is removed from the |quad_list|. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } // +-----++ @@ -974,11 +1028,11 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); // |quad2| is covered by |quad 1|, so |quad2| is removed from the - // |quad_list| and the list size becomes 1. + // |quad_list|. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); } @@ -990,18 +1044,23 @@ StubDisplayClient client; display_->Initialize(&client, manager_.surface_manager()); - // Rect 2, 3, 4 are contained in rect 1 only after applying the scale matrix. - // They are repetition of the test case above. + // Rect 2, 3, 4 are contained in rect 1 only after applying the half scale + // matrix. They are repetition of CompositorFrameWithOverlapDrawQuad. CompositorFrame frame = MakeDefaultCompositorFrame(); gfx::Rect rect1(0, 0, 100, 100); - gfx::Rect rect2(25, 25, 100, 100); - gfx::Rect rect3(50, 50, 100, 50); + gfx::Rect rect2(50, 50, 100, 100); + gfx::Rect rect3(100, 100, 100, 50); gfx::Rect rect4(0, 0, 120, 120); - // Rect 5, 6, 7 are not contained by rect 1 after applying the scale matrix. + // Rect 5, 6, 7, 8, 9, 10 are not contained by rect 1 after applying the + // double scale matrix. They are repetition of + // DrawOcclusionWithNonCoveringDrawQuad. gfx::Rect rect5(25, 25, 60, 60); - gfx::Rect rect6(0, 50, 25, 70); - gfx::Rect rect7(0, 0, 60, 60); + gfx::Rect rect6(12, 12, 25, 50); + gfx::Rect rect7(75, 0, 25, 25); + gfx::Rect rect8(0, 0, 60, 60); + gfx::Rect rect9(12, 0, 25, 80); + gfx::Rect rect10(0, 10, 50, 50); gfx::Transform half_scale; half_scale.Scale3d(0.5, 0.5, 0.5); @@ -1031,12 +1090,13 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect2| becomes (12, 12, 50x50) after applying scale transformer, |quad2| - // is now covered by |quad1|. So the size of |quad_list| becomes 1. + // |rect2| becomes (12, 12, 50x50) after applying half scale transform, + // |quad2| is now covered by |quad|. So the size of |quad_list| is reduced + // by 1. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1053,12 +1113,13 @@ quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect3| becomes (25, 25, 50x25) after applying scale transformer, - // |quad3| is now covered by |quad1|. So the size of |quad_list| becomes 1. + // |rect3| becomes (25, 25, 50x25) after applying half scale transform, + // |quad2| is now covered by |quad|. So the size of |quad_list| is reduced + // by 1. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1077,12 +1138,29 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect4| becomes (0, 0, 60x60) after applying scale transformer, |quad4| - // is now covered by |quad1|. So the size of |quad_list| becomes 1. + // |rect4| becomes (0, 0, 60x60) after applying half scale transform, + // |quad2| is now covered by |quad1|. So the size of |quad_list| is reduced + // by 1. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); + } + + { + shared_quad_state->SetAll(double_scale, rect1, rect1, rect1, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + + quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); + EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // The compositor frame contains only one quad, so |quad_list| remains 1 + // after calling RemoveOverdrawQuads. + EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); } { @@ -1101,15 +1179,18 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect5| becomes (50, 50, 120x120) after applying scale transformer, - // |rect5| is not covered by |rect1|. So the size of |quad_list| is still 2. + // |quad2| (defined by |rect5|) becomes (50, 50, 120x120) after + // applying double scale transform, it is not covered by |quad| (defined by + // |rect1| (0, 0, 100x100)). So the size of |quad_list| is the same. + // Since visible region of |rect5| is not a rect, quad2::visible_rect stays + // the same. EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect5.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1126,15 +1207,19 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect6| becomes (0, 100, 50x140) after applying scale transformer, - // |rect6| is not covered by |rect1|. So the size of |quad_list| is still 2. + // |quad2| (defined by |rect6|) becomes (24, 24, 50x100) after + // applying double scale transform, it is not covered by |quad| (defined by + // |rect1| (0, 0, 100x100)). So the size of |quad_list| is the same. + // Since visible region of |rect5| is (12, 50, 25x12), quad2::visible_rect + // updates accordingly. EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); - EXPECT_EQ(rect6.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(12, 50, 25, 12).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); } { @@ -1151,15 +1236,74 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect7| becomes (0, 0, 120x120) after applying scale transformer, - // |rect7| is not covered by |rect1|. So the size of |quad_list| is still 2. + // |quad2| (defined by |rect7|) becomes (150, 0, 50x50) after + // applying double scale transform, it is not covered by |quad| (defined by + // |rect1| (0, 0, 100x100)). So the size of |quad_list| is the same. + // Since visible region of |rect7| is not a rect, quad2::visible_rect stays + // the same. EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect7.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); + } + + { + shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, rect1, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + + shared_quad_state2->SetAll(double_scale, rect8, rect8, rect8, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + + quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state2, rect8, rect8, SK_ColorBLACK, false); + + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // |quad2| (defined by |rect8|) becomes (0, 0, 120x120) after + // applying double scale transform, it is not covered by |quad1| (defined by + // |rect1| (0, 0, 100x100)). So the size of |quad_list| is the same. + // Since visible region of |rect8| is not a rect, quad2::visible_rect stays + // the same. + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect8.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + } + + { + shared_quad_state->SetAll(double_scale, rect10, rect10, rect10, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + + shared_quad_state2->SetAll(double_scale, rect9, rect9, rect9, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + + quad->SetNew(shared_quad_state, rect10, rect10, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state2, rect9, rect9, SK_ColorBLACK, false); + + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // |quad2| (defined by |rect9|) becomes (24, 0, 50x160) after + // applying double scale transform, it is not covered by |quad| (defined by + // |rect10| (0, 20, 100x100)). So the size of |quad_list| is the same. + // Since visible region of |rect9| is not a rect, quad2::visible_rect stays + // the same + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect10.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect9.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); } TearDownDisplay(); } @@ -1213,10 +1357,10 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1234,7 +1378,7 @@ // This test verifies that the draw occlusion algorithm does not break when // the scale of the transform is very close to zero. |epsilon_scale| // transform has the scale set to 10^-8. the quad is considering to be empty - // after the transform, so it fails to intersects the occlusion rect. + // after the transform, so it fails to intersect the occlusion rect. // |quad2| is not removed from draw occlusion. EXPECT_TRUE(epsilon_scale.GetInverse(&inverted)); EXPECT_TRUE(cc::MathUtil::MapEnclosedRectWith2dAxisAlignedTransform( @@ -1243,10 +1387,10 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1270,7 +1414,7 @@ EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); @@ -1313,9 +1457,9 @@ quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // Since the x-axis is negated, |quad2| is not under occlusion rect after - // transforming as shown in the figure below, so no quad is removed. - // After transforming: + // Since the x-axis is negated, |quad2| after applying transform does not + // intersect with |quad| any more, so no quad is removed. + // In target space: // | // q2 +----|----+ occlusion rect // | | | @@ -1325,10 +1469,10 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1345,9 +1489,9 @@ quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // Since the y-axis is negated, |quad2| is not under occlusion rect after - // transforming as shown in the figure below, so no quads removed. - // After transforming: + // Since the y-axis is negated, |quad2| after applying transform does not + // intersect with |quad| any more, so no quad is removed. + // In target space: // | // |----+ occlusion rect // | | @@ -1357,10 +1501,10 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1377,9 +1521,9 @@ quad2->SetNew(shared_quad_state2, rect, rect, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // Since z-axis is missing in a 2d plane, negate z-axis cause |q2| to stay - // where it was before. - // After transforming: + // Since z-axis is missing in a 2d plane, negating the z-axis does not cause + // |q2| to move at all. So |quad2| overlaps with |quad| in target space. + // In target space: // | // |----+ occlusion rect // | | q2 @@ -1389,13 +1533,13 @@ EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); } -// Check if draw occlusion works well with rotation transformer. +// Check if draw occlusion works well with rotation transform. // // +-----+ +----+ // | | rotation (by 45 on y-axis) -> | | same height @@ -1411,6 +1555,9 @@ gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect2(75, 75, 10, 10); + // rect 3 intersects with rect 1 initially + gfx::Rect rect3(50, 50, 25, 100); + gfx::Transform rotate; rotate.RotateAboutYAxis(45); bool is_clipped = false; @@ -1425,8 +1572,7 @@ auto* quad2 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); { - // rect 1 becomes (0, 0, 71x100) after rotation around y-axis, so rect 2 is - // outside of rect 1 after rotation. + // Apply rotation transform on |rect1| only. shared_quad_state->SetAll(rotate, rect1, rect1, rect1, is_clipped, are_contents_opaque, opacity, SkBlendMode::kSrcOver, 0); @@ -1437,20 +1583,20 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect1| becomes (0, 0, 70x100) after rotation by 45 degree around y-axis, - // so |rect2| is not covered by |rect1|. + // In target space, |quad| becomes (0, 0, 71x100) (after applying rotation + // transform) and |quad2| becomes (75, 75 10x10). So |quad2| does not + // intersect with |quad|. No changes in quads. EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { - // Rotational transformer is applied to both rect 1 and rect 2. So rect 2 is - // covered by rect 1 after rotation in this case. + // Apply rotation transform on |rect1| and |rect2|. shared_quad_state->SetAll(rotate, rect1, rect1, rect1, is_clipped, are_contents_opaque, opacity, SkBlendMode::kSrcOver, 0); @@ -1461,13 +1607,64 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect1| and |rect2| become (0, 0, 70x100) and (53, 75, 8x10) after - // rotation by 45 degree around y-axis, so |rect2| is covered by |rect1|. - // |quad_list| is reduced by 1. + // In target space, |quad| becomes (0, 0, 70x100) and |quad2| becomes + // (53, 75 8x10) (after applying rotation transform). So |quad2| is behind + // |quad|. |quad2| is removed from |quad_list|. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); + } + + { + quad2 = frame.render_pass_list.front() + ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); + shared_quad_state->SetAll(rotate, rect1, rect1, rect1, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + shared_quad_state2->SetAll(gfx::Transform(), rect3, rect3, rect3, + is_clipped, are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // In target space, |quad| becomes (0, 0, 71x100) (after applying rotation + // transform) and |quad2| becomes (50, 50, 25x100). So |quad2| does not + // intersect with |quad|. No changes in quads. + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + } + + { + // Since we only support updating |visible_rect| of DrawQuad with scale + // or translation transform and rotation transform applies to quads, + // |visible_rect| of |quad2| should not be changed. + shared_quad_state->SetAll(rotate, rect1, rect1, rect1, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + shared_quad_state2->SetAll(rotate, rect3, rect3, rect3, is_clipped, + are_contents_opaque, opacity, + SkBlendMode::kSrcOver, 0); + quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // Since both |quad| and |quad2| went through the same transform and |rect1| + // does not cover |rect3| initially, |quad| does not cover |quad2| in target + // space. + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); } TearDownDisplay(); } @@ -1511,17 +1708,17 @@ quad2->SetNew(shared_quad_state2, rect1, rect1, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // The transformer after applying rotation and perspective does not perserve - // 2d axis, so it is hard to find an enclosed rect in the region. The - // |rect1| cannot be used as occlusion rect to occlude |rect2|. The - // |quad_list| size remains unchanged. + // The transform used on |quad| is a combination of rotation and + // perspective matrix, so it does not preserve 2d axis. Since it takes too + // long to define a enclosed rect to describe the occlusion region, + // occlusion region is not defined and no changes in quads. EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1535,19 +1732,19 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect2| after applying rotation and perspective does not perserve 2d - // axis, but it's possible to find a enclosing rect of |rect2| and the - // resulting rect is occluded by |rect1|. The |quad_list| size is reduced by - // 1 after calling draw occlusion. + // The transform used on |quad2| is a combination of rotation and + // perspective matrix, so it does not preserve 2d axis. it's easy to find + // an enclosing rect to describe |quad2|. |quad2| is hiding behind |quad|, + // so it's removed from |quad_list|. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); } -// Check if draw occlusion works with transparent draw quads. +// Check if draw occlusion works with transparent DrawQuads. TEST_F(DisplayTest, CompositorFrameWithOpacityChange) { SetUpDisplay(RendererSettings(), cc::TestWebGraphicsContext3D::Create()); @@ -1586,10 +1783,10 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1607,7 +1804,7 @@ EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); @@ -1651,10 +1848,10 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -1672,7 +1869,7 @@ EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); @@ -1684,10 +1881,11 @@ StubDisplayClient client; display_->Initialize(&client, manager_.surface_manager()); - // rect 2 is outside rect 1 initially. + // rect 2 and 3 are outside rect 1 initially. CompositorFrame frame = MakeDefaultCompositorFrame(); gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect2(120, 120, 10, 10); + gfx::Rect rect3(100, 100, 100, 20); bool is_clipped = false; bool opaque_content = true; @@ -1704,13 +1902,13 @@ auto* quad2 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); { - // with transformer is identity matrix, then rect 1 and rect 2 look like: + // // +----+ // | | - // | | (move the bigger rect (0, 0) -> (50, 50)) +-----+ - // +----+ => | +-+ | - // +-+ | +-+ | - // +-+ +-----+ + // | | + // +----+ + // +-+ + // +-+ shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, rect1, is_clipped, transparent_content, opacity, SkBlendMode::kSrcOver, 0); @@ -1726,13 +1924,20 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { + // quad content space: target space: + // +----+ + // | | translation transform + // | | (move the bigger rect (0, 0) -> (50, 50)) +-----+ + // +----+ => | +-+ | + // +-+ | +-+ | + // +-+ +-----+ shared_quad_state->SetAll(translate_up, rect1, rect1, rect1, is_clipped, opaque_content, opacity, SkBlendMode::kSrcOver, 0); @@ -1743,14 +1948,49 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // Move |rect1| over |rect2| by applying translate to the transformer. - // |rect2| will be covered by |rect1|, so |quad_list| becomes 1. + // Move |quad| defind by |rect1| over |quad2| defind by |rect2| by applying + // translation transform. |quad2| will be covered by |quad|, so |quad_list| + // size is reduced by 1. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } + { + // After applying translation transform on rect1: + // before after + // +----+ + // | | + // | | (move the bigger rect (0, 0) -> (50, 50)) +----+ + // +----+ => | +---+ + // +---+ | +---+ + // +---+ +----+ + quad2 = frame.render_pass_list.front() + ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); + shared_quad_state->SetAll(translate_up, rect1, rect1, rect1, is_clipped, + opaque_content, opacity, SkBlendMode::kSrcOver, + 0); + shared_quad_state2->SetAll(gfx::Transform(), rect3, rect3, rect3, + is_clipped, opaque_content, opacity, + SkBlendMode::kSrcOver, 0); + quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // Move |quad| defind by |rect1| over |quad2| defind by |rect3| by applying + // translation transform. In target space, |quad| is (50, 50, 100x100) and + // |quad2| is (100, 100, 100x20). So the visible region of |quad2| is + // (150, 100, 50x20). + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(150, 100, 50, 20).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + } TearDownDisplay(); } @@ -1766,6 +2006,10 @@ gfx::Rect rect2(100, 0, 60, 60); gfx::Rect rect3(10, 10, 120, 30); + // rect 4 and 5 intersect with the combined rect of 1 and 2. + gfx::Rect rect4(10, 10, 180, 30); + gfx::Rect rect5(10, 10, 120, 100); + bool is_clipped = false; bool opaque_content = true; float opacity = 1.f; @@ -1808,12 +2052,71 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } + { + // rect1 & rect2 rect 4 added + // +----+----+ +----+----+-+ + // | | | |____|____|_| + // | |----+ => | |----+ + // +----+ +----+ + // + quad3 = frame.render_pass_list.front() + ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); + shared_quad_state3->SetAll(gfx::Transform(), rect4, rect4, rect4, + is_clipped, opaque_content, opacity, + SkBlendMode::kSrcOver, 0); + quad3->SetNew(shared_quad_state3, rect4, rect4, SK_ColorBLACK, false); + EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // The occlusion rect, which is enlarged horizontally after visiting |rect1| + // and |rect2|, is (0, 0, 160x60). Since visible region of rect 4 is + // (160, 10, 30x30), |visible_rect| of |quad3| is updated. + EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(160, 10, 30, 30).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(2) + ->visible_rect.ToString()); + } + + { + // rect1 & rect2 rect 5 added + // +----+----+ +----+----+ + // | | | | +--|--+ | + // | |----+ => | | |--|-+ + // +----+ +-|--+ | + // +-----+ + shared_quad_state3->SetAll(gfx::Transform(), rect5, rect5, rect5, + is_clipped, opaque_content, opacity, + SkBlendMode::kSrcOver, 0); + quad3->SetNew(shared_quad_state3, rect5, rect5, SK_ColorBLACK, false); + EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // The occlusion rect, which is enlarged horizontally after visiting |rect1| + // and |rect2|, is (0, 0, 160x60). Since visible region of rect 5 is + // (10, 60, 120x50), |visible_rect| of |quad3| is updated. + EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(10, 60, 120, 50).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(2) + ->visible_rect.ToString()); + } TearDownDisplay(); } @@ -1850,8 +2153,8 @@ auto* quad3 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); { - // rect1 and rect2 are from first render pass and rect 3 is from the second - // render pass. + // rect1 and rect2 are from first RenderPass and rect 3 is from the second + // RenderPass. // rect1 & rect2 rect 3 added // +----+----+ +----+----+ // | | | |____|___|| @@ -1878,15 +2181,15 @@ // But |rect3| so |rect3| is to be removed from |quad_list|. EXPECT_EQ(2u, frame.render_pass_list.at(1)->quad_list.size()); EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); - EXPECT_EQ( - rect1.ToString(), - frame.render_pass_list.at(1)->quad_list.ElementAt(0)->rect.ToString()); - EXPECT_EQ( - rect2.ToString(), - frame.render_pass_list.at(1)->quad_list.ElementAt(1)->rect.ToString()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.at(1) + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect2.ToString(), frame.render_pass_list.at(1) + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); } @@ -1921,41 +2224,39 @@ ->quad_list.AllocateAndConstruct<RenderPassDrawQuad>(); { - { - // rect1 is a draw quad from SQS1 and which is also the render pass rect - // from SQS2. renderpassdrawquad should not be occluded. - // rect1 - // +----+ - // | | - // | | - // +----+ - // + // rect1 is a DrawQuad from SQS1 and which is also the RenderPass rect + // from SQS2. The RenderPassDrawQuad should not be occluded. + // rect1 + // +----+ + // | | + // | | + // +----+ + // - shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, rect1, - is_clipped, opaque_content, opacity, - SkBlendMode::kSrcOver, 0); - shared_quad_state2->SetAll(gfx::Transform(), rect1, rect1, rect1, - is_clipped, opaque_content, opacity, - SkBlendMode::kSrcOver, 0); - quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); - quad1->SetNew(shared_quad_state2, rect1, rect1, render_pass_id, - mask_resource_id, gfx::RectF(), gfx::Size(), - gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false); - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); - EXPECT_EQ(1u, frame.render_pass_list.at(1)->quad_list.size()); - display_->RemoveOverdrawQuads(&frame); - // |rect1| and |rect2| shares the same region where |rect1| is a draw - // quad and |rect2| render pass. |rect2| will be not removed from the - // |quad_list|. - EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); - EXPECT_EQ(1u, frame.render_pass_list.at(1)->quad_list.size()); - EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(0) - ->rect.ToString()); - EXPECT_EQ(rect1.ToString(), frame.render_pass_list.at(1) - ->quad_list.ElementAt(0) - ->rect.ToString()); - } + shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, rect1, is_clipped, + opaque_content, opacity, SkBlendMode::kSrcOver, + 0); + shared_quad_state2->SetAll(gfx::Transform(), rect1, rect1, rect1, + is_clipped, opaque_content, opacity, + SkBlendMode::kSrcOver, 0); + quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); + quad1->SetNew(shared_quad_state2, rect1, rect1, render_pass_id, + mask_resource_id, gfx::RectF(), gfx::Size(), + gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false); + EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, frame.render_pass_list.at(1)->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // |rect1| and |rect2| shares the same region where |rect1| is a draw + // quad and |rect2| RenderPass. |rect2| will be not removed from the + // |quad_list|. + EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(1u, frame.render_pass_list.at(1)->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.at(1) + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); } TearDownDisplay(); @@ -1971,6 +2272,7 @@ gfx::Rect rect1(0, 0, 100, 100); gfx::Rect rect2(50, 50, 25, 25); gfx::Rect clip_rect(0, 0, 60, 60); + gfx::Rect rect3(50, 50, 20, 10); bool clipped = true; bool non_clipped = false; @@ -1985,13 +2287,12 @@ auto* quad2 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); { - // rect1 and rect2 are from first render pass and rect 3 is from the second - // render pass. - // rect1(non-clip) & rect2 rect1(clip) & rect2 - // +------+ +----+ - // | | | | - // | +-+| => +----+ +-+ - // +------+ +-+ + // rect1 & rect2 + // +------+ + // | | + // | +-+| + // | | || + // +------+ // shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, rect1, non_clipped, opaque_content, opacity, @@ -2003,15 +2304,21 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect1| covers |rect2| as shown in the image1.So the size of |quad_list| - // remains unchanged. + // |rect1| covers |rect2| as shown in the figure above, So the size of + // |quad_list| is reduced by 1. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } { + // rect1 & rect2 clip_rect & rect2 + // +------+ +----+ + // | | | | + // | +-+| => +----+ +-+ + // +------+ +-+ + // quad2 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, clip_rect, @@ -2024,21 +2331,52 @@ quad2->SetNew(shared_quad_state2, rect2, rect2, SK_ColorBLACK, false); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |rect1| covers |rect2| as shown in the image1. However, the clip_rect of - // |rect1| does not cover |rect2|. So the size of |quad_list| is reduced by - // 1. + // In the target space, a clip is applied on |quad| (defined by |clip_rect|, + // (0, 0, 60x60) |quad| and |quad2| (50, 50, 25x25) don't intersect in the + // target space. So no change is applied to quads. EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); + } + + { + // rect1(non-clip) & rect2 rect1(clip) & rect3 + // +------+ +---+ + // | +-+| | +|+ + // | +-+| => +--+++ + // +------+ + // + shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, clip_rect, + clipped, opaque_content, opacity, + SkBlendMode::kSrcOver, 0); + shared_quad_state2->SetAll(gfx::Transform(), rect3, rect3, rect3, + non_clipped, opaque_content, opacity, + SkBlendMode::kSrcOver, 0); + quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state2, rect3, rect3, SK_ColorBLACK, false); + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // In the target space, a clip is applied on |quad| (defined by |rect3|, + // (50, 50, 20x10)). |quad| intersects with |quad2| in the target space. The + // visible region of |quad2| is (60, 50, 10x10). So |quad2| is updated + // accordingly. + EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(60, 50, 10, 10).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); } TearDownDisplay(); } -// Check if draw occlusion works with copy requests in root render pass only. +// Check if draw occlusion works with copy requests in root RenderPass only. TEST_F(DisplayTest, CompositorFrameWithCopyRequest) { SetUpDisplay(RendererSettings(), cc::TestWebGraphicsContext3D::Create()); @@ -2073,14 +2411,14 @@ CopyOutputRequest::CreateStubForTesting()); EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // root render pass contains |rect1|, |rect2| and copy_request (where + // root RenderPass contains |rect1|, |rect2| and copy_request (where // |rect2| is in |rect1|). Since our current implementation only supports - // occlustion with copy_request on root render pass, |quad_list| reduces its + // occlusion with copy_request on root RenderPass, |quad_list| reduces its // size by 1 after calling remove overdraw. EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); } @@ -2122,7 +2460,7 @@ auto* D2 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); { - // Render pass r1 and r2 are intersecting to each other; however, the opaque + // RenderPass r1 and r2 are intersecting to each other; however, the opaque // regions D1 and D2 on R1 and R2 are not intersecting. // +-------+---+--------+ // |_D1_| | |_D2_| | @@ -2157,21 +2495,21 @@ EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(2) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect4.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(3) - ->rect.ToString()); + ->visible_rect.ToString()); } { - // Render pass R2 is contained in R1, but the opaque region of the two - // render passes are separated. + // RenderPass R2 is contained in R1, but the opaque region of the two + // RenderPasses are separated. // +-------+-----------+ // |_D2_| | |_D1_| // | | | @@ -2205,20 +2543,20 @@ EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect5.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(2) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect6.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(3) - ->rect.ToString()); + ->visible_rect.ToString()); } { - // Render pass R2 is contained in R1, and opaque region of R2 in R1 as well. + // RenderPass R2 is contained in R1, and opaque region of R2 in R1 as well. // +-+---------+-------+ // |-+ | | | // |-----+ | | @@ -2252,13 +2590,13 @@ EXPECT_EQ(3u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect5.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(2) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); } @@ -2270,18 +2608,30 @@ display_->Initialize(&client, manager_.surface_manager()); CompositorFrame frame = MakeDefaultCompositorFrame(); - gfx::Rect rect(0, 0, 100, 100); - gfx::Rect rect1(0, 0, 50, 50); - gfx::Rect rect2(50, 0, 50, 50); - gfx::Rect rect3(0, 50, 50, 50); - gfx::Rect rect4(50, 50, 50, 50); - gfx::Rect rect5(0, 0, 60, 40); + gfx::Rect rect1(0, 0, 100, 100); + gfx::Rect rect1_1(0, 0, 50, 50); + gfx::Rect rect1_2(50, 0, 50, 50); + gfx::Rect rect1_3(0, 50, 50, 50); + gfx::Rect rect1_4(50, 50, 50, 50); + gfx::Rect rect_in_rect1(0, 0, 60, 40); + gfx::Rect rect_intersects_rect1(80, 0, 50, 30); + + gfx::Rect rect2(20, 0, 100, 100); + gfx::Rect rect2_1(20, 0, 50, 50); + gfx::Rect rect2_2(70, 0, 50, 50); + gfx::Rect rect2_3(20, 50, 50, 50); + gfx::Rect rect2_4(70, 50, 50, 50); + gfx::Rect rect3(0, 0, 140, 60); + gfx::Rect rect3_1(0, 0, 70, 30); + gfx::Rect rect3_2(70, 0, 70, 30); bool is_clipped = false; bool opaque_content = true; float opacity = 1.f; SharedQuadState* shared_quad_state = frame.render_pass_list.front()->CreateAndAppendSharedQuadState(); + SharedQuadState* shared_quad_state2 = + frame.render_pass_list.front()->CreateAndAppendSharedQuadState(); auto* quad1 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); auto* quad2 = frame.render_pass_list.front() @@ -2290,47 +2640,138 @@ ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); auto* quad4 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); - SharedQuadState* shared_quad_state2 = - frame.render_pass_list.front()->CreateAndAppendSharedQuadState(); auto* quad5 = frame.render_pass_list.front() ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); { - // A Shared quad states contains 4 draw quads and it covers another draw + // A Shared quad states contains 4 drawquads and it covers another draw // quad from different shared quad state. // +--+--+ // +--|+ | // +--+--+ // | | | // +--+--+ - shared_quad_state->SetAll(gfx::Transform(), rect, rect, rect, is_clipped, + shared_quad_state->SetAll(gfx::Transform(), rect1, rect1, rect1, is_clipped, opaque_content, opacity, SkBlendMode::kSrcOver, 0); - shared_quad_state2->SetAll(gfx::Transform(), rect5, rect5, rect5, - is_clipped, opaque_content, opacity, - SkBlendMode::kSrcOver, 0); - quad1->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false); - quad2->SetNew(shared_quad_state, rect2, rect2, SK_ColorBLACK, false); - quad3->SetNew(shared_quad_state, rect3, rect3, SK_ColorBLACK, false); - quad4->SetNew(shared_quad_state, rect4, rect4, SK_ColorBLACK, false); - quad5->SetNew(shared_quad_state2, rect5, rect5, SK_ColorBLACK, false); + shared_quad_state2->SetAll(gfx::Transform(), rect_in_rect1, rect_in_rect1, + rect_in_rect1, is_clipped, opaque_content, + opacity, SkBlendMode::kSrcOver, 0); + quad1->SetNew(shared_quad_state, rect1_1, rect1_1, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state, rect1_2, rect1_2, SK_ColorBLACK, false); + quad3->SetNew(shared_quad_state, rect1_3, rect1_3, SK_ColorBLACK, false); + quad4->SetNew(shared_quad_state, rect1_4, rect1_4, SK_ColorBLACK, false); + quad5->SetNew(shared_quad_state2, rect_in_rect1, rect_in_rect1, + SK_ColorBLACK, false); EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); display_->RemoveOverdrawQuads(&frame); - // |visible_rect| of |shared_quad_state| is formed by 4 draw quads and it - // coved the visible region of |shared_quad_state2|. + // |visible_rect| of |shared_quad_state| is formed by 4 DrawQuads and it + // covers the visible region of |shared_quad_state2|. EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size()); - EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(0) - ->rect.ToString()); - EXPECT_EQ(rect2.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(1) - ->rect.ToString()); - EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(2) - ->rect.ToString()); - EXPECT_EQ(rect4.ToString(), frame.render_pass_list.front() - ->quad_list.ElementAt(3) - ->rect.ToString()); + EXPECT_EQ(rect1_1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect1_2.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + EXPECT_EQ(rect1_3.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(2) + ->visible_rect.ToString()); + EXPECT_EQ(rect1_4.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(3) + ->visible_rect.ToString()); + } + + { + // A Shared quad states that contains 4 drawquads that intersect with + // another shared quad state that contains 1 drawquad. + // +--+-++--+ + // | | +|--+ + // +--+--+ + // | | | + // +--+--+ + quad5 = frame.render_pass_list.front() + ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); + shared_quad_state2->SetAll(gfx::Transform(), rect_intersects_rect1, + rect_intersects_rect1, rect_intersects_rect1, + is_clipped, opaque_content, opacity, + SkBlendMode::kSrcOver, 0); + quad5->SetNew(shared_quad_state2, rect_intersects_rect1, + rect_intersects_rect1, SK_ColorBLACK, false); + EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // |visible_rect| of |shared_quad_state| is formed by 4 DrawQuads and it + // partially covers the visible region of |shared_quad_state2|. The + // |visible_rect| of |quad5| is updated. + EXPECT_EQ(5u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect1_1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect1_2.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + EXPECT_EQ(rect1_3.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(2) + ->visible_rect.ToString()); + EXPECT_EQ(rect1_4.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(3) + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(100, 0, 30, 30).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(4) + ->visible_rect.ToString()); + } + + { + // A Shared quad states that contains 4 DrawQuads that intersects with + // another shared quad state that contains 2 DrawQuads. + // +-+--+--+-+ + // +-|--|--|-+ + // +--+--+ + // | | | + // +--+--+ + + auto* quad6 = frame.render_pass_list.front() + ->quad_list.AllocateAndConstruct<SolidColorDrawQuad>(); + shared_quad_state->SetAll(gfx::Transform(), rect2, rect2, rect2, is_clipped, + opaque_content, opacity, SkBlendMode::kSrcOver, + 0); + shared_quad_state2->SetAll(gfx::Transform(), rect3, rect3, rect3, + is_clipped, opaque_content, opacity, + SkBlendMode::kSrcOver, 0); + quad1->SetNew(shared_quad_state, rect2_1, rect2_1, SK_ColorBLACK, false); + quad2->SetNew(shared_quad_state, rect2_2, rect2_2, SK_ColorBLACK, false); + quad3->SetNew(shared_quad_state, rect2_3, rect2_3, SK_ColorBLACK, false); + quad4->SetNew(shared_quad_state, rect2_4, rect2_4, SK_ColorBLACK, false); + quad5->SetNew(shared_quad_state2, rect3_1, rect3_1, SK_ColorBLACK, false); + quad6->SetNew(shared_quad_state2, rect3_2, rect3_2, SK_ColorBLACK, false); + EXPECT_EQ(6u, frame.render_pass_list.front()->quad_list.size()); + display_->RemoveOverdrawQuads(&frame); + // |visible_rect| of |shared_quad_state| is formed by 4 DrawQuads and it + // partially covers the visible region of |shared_quad_state2|. So the + // |visible_rect| of DrawQuads in |share_quad_state2| are updated to the + // region shown on screen. + EXPECT_EQ(6u, frame.render_pass_list.front()->quad_list.size()); + EXPECT_EQ(rect2_1.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(0) + ->visible_rect.ToString()); + EXPECT_EQ(rect2_2.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(1) + ->visible_rect.ToString()); + EXPECT_EQ(rect2_3.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(2) + ->visible_rect.ToString()); + EXPECT_EQ(rect2_4.ToString(), frame.render_pass_list.front() + ->quad_list.ElementAt(3) + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(0, 0, 20, 30).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(4) + ->visible_rect.ToString()); + EXPECT_EQ(gfx::Rect(120, 0, 20, 30).ToString(), + frame.render_pass_list.front() + ->quad_list.ElementAt(5) + ->visible_rect.ToString()); } TearDownDisplay(); } @@ -2401,10 +2842,10 @@ EXPECT_EQ(2u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); EXPECT_EQ(rect3.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(1) - ->rect.ToString()); + ->visible_rect.ToString()); } { @@ -2432,7 +2873,7 @@ EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size()); EXPECT_EQ(rect1.ToString(), frame.render_pass_list.front() ->quad_list.ElementAt(0) - ->rect.ToString()); + ->visible_rect.ToString()); } TearDownDisplay(); }
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc index 67d1e4c..e31cf7ef 100644 --- a/components/viz/service/display/gl_renderer.cc +++ b/components/viz/service/display/gl_renderer.cc
@@ -32,7 +32,6 @@ #include "cc/debug/debug_colors.h" #include "cc/paint/render_surface_filters.h" #include "cc/raster/scoped_gpu_raster.h" -#include "cc/resources/resource.h" #include "components/viz/common/display/renderer_settings.h" #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/gpu/context_provider.h" @@ -43,8 +42,9 @@ #include "components/viz/common/quads/stream_video_draw_quad.h" #include "components/viz/common/quads/texture_draw_quad.h" #include "components/viz/common/resources/platform_color.h" -#include "components/viz/common/resources/resource.h" #include "components/viz/common/resources/resource_fence.h" +#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/resource_id.h" #include "components/viz/service/display/draw_polygon.h" #include "components/viz/service/display/dynamic_geometry_binding.h" #include "components/viz/service/display/layer_quad.h" @@ -189,10 +189,18 @@ DCHECK(!background_texture); } - // Required Inputs. + // Required inputs below. const RenderPassDrawQuad* quad = nullptr; - const cc::Resource* bypass_quad_texture = nullptr; + + // Either |contents_texture| or |bypass_quad_texture| is populated. The + // |contents_texture| will be valid if non-null, and when null the + // bypass_quad_texture will be valid instead. ScopedRenderPassTexture* contents_texture = nullptr; + struct { + ResourceId resource_id = 0; + gfx::Size size; + } bypass_quad_texture; + const gfx::QuadF* clip_region = nullptr; bool flip_texture = false; gfx::Transform window_matrix; @@ -1093,15 +1101,12 @@ params.tex_coord_rect = quad->tex_coord_rect; if (bypass != render_pass_bypass_quads_.end()) { TileDrawQuad* tile_quad = &bypass->second; - // RGBA_8888 and the gfx::ColorSpace() here are arbitrary and unused. - cc::Resource tile_resource(tile_quad->resource_id(), - tile_quad->texture_size, - ResourceFormat::RGBA_8888, gfx::ColorSpace()); // The projection matrix used by GLRenderer has a flip. As tile texture // inputs are oriented opposite to framebuffer outputs, don't flip via // texture coords and let the projection matrix naturallyd o it. params.flip_texture = false; - params.bypass_quad_texture = &tile_resource; + params.bypass_quad_texture.resource_id = tile_quad->resource_id(); + params.bypass_quad_texture.size = tile_quad->texture_size; DrawRenderPassQuadInternal(¶ms); } else { auto contents_texture_it = render_pass_textures_.find(quad->render_pass_id); @@ -1284,7 +1289,7 @@ DCHECK(!params->filters->IsEmpty()); gfx::Size size = params->contents_texture ? params->contents_texture->size() - : params->bypass_quad_texture->size(); + : params->bypass_quad_texture.size; auto paint_filter = cc::RenderSurfaceFilters::BuildImageFilter( *params->filters, gfx::SizeF(size)); auto filter = paint_filter ? paint_filter->cached_sk_filter_ : nullptr; @@ -1329,7 +1334,7 @@ } else { cc::DisplayResourceProvider::ScopedReadLockGL prefilter_bypass_quad_texture_lock( - resource_provider_, params->bypass_quad_texture->id()); + resource_provider_, params->bypass_quad_texture.resource_id); params->contents_and_bypass_color_space = prefilter_bypass_quad_texture_lock.color_space(); params->filter_image = ApplyImageFilter( @@ -1387,7 +1392,8 @@ } else { params->bypass_quad_resource_lock = std::make_unique<cc::DisplayResourceProvider::ScopedSamplerGL>( - resource_provider_, params->bypass_quad_texture->id(), GL_LINEAR); + resource_provider_, params->bypass_quad_texture.resource_id, + GL_LINEAR); DCHECK_EQ(static_cast<GLenum>(GL_TEXTURE_2D), params->bypass_quad_resource_lock->target()); params->contents_and_bypass_color_space = @@ -1445,7 +1451,7 @@ } else if (params->contents_texture) { texture_size = params->contents_texture->size(); } else { - texture_size = params->bypass_quad_texture->size(); + texture_size = params->bypass_quad_texture.size; } tex_rect.Scale(1.0f / texture_size.width(), 1.0f / texture_size.height()); @@ -3538,7 +3544,6 @@ auto result = std::make_unique<OverlayTexture>(); result->texture = ScopedGpuMemoryBufferTexture( output_surface_->context_provider(), - settings_->resource_settings.texture_target_exception_list, gfx::Size(width, height), color_space); result->render_pass_id = render_pass_id; return result;
diff --git a/components/viz/service/display/scoped_gpu_memory_buffer_texture.cc b/components/viz/service/display/scoped_gpu_memory_buffer_texture.cc index 26cc3c57..73b06aac 100644 --- a/components/viz/service/display/scoped_gpu_memory_buffer_texture.cc +++ b/components/viz/service/display/scoped_gpu_memory_buffer_texture.cc
@@ -18,7 +18,6 @@ ScopedGpuMemoryBufferTexture::ScopedGpuMemoryBufferTexture( ContextProvider* context_provider, - const BufferUsageAndFormatList& formats, const gfx::Size& size, const gfx::ColorSpace& color_space) : context_provider_(context_provider), @@ -38,9 +37,7 @@ ResourceFormat format = RGBA_8888; gfx::BufferFormat buffer_format = BufferFormat(format); - target_ = GL_TEXTURE_2D; - if (base::ContainsValue(formats, std::make_pair(usage, buffer_format))) - target_ = gpu::GetPlatformSpecificTextureTarget(); + target_ = gpu::GetBufferTextureTarget(usage, buffer_format, caps); gl->BindTexture(target_, gl_id_); gl->TexParameteri(target_, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
diff --git a/components/viz/service/display/scoped_gpu_memory_buffer_texture.h b/components/viz/service/display/scoped_gpu_memory_buffer_texture.h index ce7549c..a0a87ae 100644 --- a/components/viz/service/display/scoped_gpu_memory_buffer_texture.h +++ b/components/viz/service/display/scoped_gpu_memory_buffer_texture.h
@@ -6,7 +6,6 @@ #define COMPONENTS_VIZ_SERVICE_DISPLAY_SCOPED_GPU_MEMORY_BUFFER_TEXTURE_H_ #include "base/macros.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "components/viz/service/viz_service_export.h" #include "ui/gfx/color_space.h" #include "ui/gfx/geometry/size.h" @@ -19,7 +18,6 @@ class VIZ_SERVICE_EXPORT ScopedGpuMemoryBufferTexture { public: explicit ScopedGpuMemoryBufferTexture(ContextProvider* context_provider, - const BufferUsageAndFormatList& formats, const gfx::Size& size, const gfx::ColorSpace& color_space);
diff --git a/components/viz/service/display/skia_renderer.cc b/components/viz/service/display/skia_renderer.cc index ee33324a..3a8d4273 100644 --- a/components/viz/service/display/skia_renderer.cc +++ b/components/viz/service/display/skia_renderer.cc
@@ -86,6 +86,9 @@ } SkiaRenderer::~SkiaRenderer() { +#if BUILDFLAG(ENABLE_VULKAN) + return; +#endif gpu::gles2::GLES2Interface* gl = output_surface_->context_provider()->ContextGL(); for (auto& pair : render_pass_backings_) { @@ -759,6 +762,10 @@ const RenderPassList& render_passes_in_draw_order, const base::flat_map<RenderPassId, RenderPassRequirements>& render_passes_in_frame) { +#if BUILDFLAG(ENABLE_VULKAN) + NOTIMPLEMENTED(); + return; +#endif std::vector<RenderPassId> passes_to_delete; for (const auto& pair : render_pass_backings_) { auto render_pass_it = render_passes_in_frame.find(pair.first);
diff --git a/components/viz/service/display/software_renderer_unittest.cc b/components/viz/service/display/software_renderer_unittest.cc index cfc8803..1ba2f6fe 100644 --- a/components/viz/service/display/software_renderer_unittest.cc +++ b/components/viz/service/display/software_renderer_unittest.cc
@@ -16,6 +16,7 @@ #include "cc/test/geometry_test_utils.h" #include "cc/test/pixel_test_utils.h" #include "cc/test/render_pass_test_utils.h" +#include "cc/test/resource_provider_test_utils.h" #include "cc/test/test_shared_bitmap_manager.h" #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/copy_output_result.h" @@ -50,12 +51,20 @@ &settings_, output_surface_.get(), resource_provider()); renderer_->Initialize(); renderer_->SetVisible(true); + + child_resource_provider_ = + cc::FakeResourceProvider::CreateLayerTreeResourceProvider( + nullptr, shared_bitmap_manager_.get()); } cc::DisplayResourceProvider* resource_provider() const { return resource_provider_.get(); } + cc::LayerTreeResourceProvider* child_resource_provider() const { + return child_resource_provider_.get(); + } + SoftwareRenderer* renderer() const { return renderer_.get(); } std::unique_ptr<SkBitmap> DrawAndCopyOutput(RenderPassList* list, @@ -90,6 +99,7 @@ std::unique_ptr<cc::FakeOutputSurface> output_surface_; std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_; std::unique_ptr<cc::DisplayResourceProvider> resource_provider_; + std::unique_ptr<cc::LayerTreeResourceProvider> child_resource_provider_; std::unique_ptr<SoftwareRenderer> renderer_; }; @@ -147,10 +157,10 @@ bool needs_blending = false; InitializeRenderer(std::make_unique<SoftwareOutputDevice>()); - ResourceId resource_yellow = - resource_provider()->CreateBitmapResource(outer_size, gfx::ColorSpace()); - ResourceId resource_cyan = - resource_provider()->CreateBitmapResource(inner_size, gfx::ColorSpace()); + ResourceId resource_yellow = child_resource_provider()->CreateBitmapResource( + outer_size, gfx::ColorSpace()); + ResourceId resource_cyan = child_resource_provider()->CreateBitmapResource( + inner_size, gfx::ColorSpace()); SkBitmap yellow_tile; yellow_tile.allocN32Pixels(outer_size.width(), outer_size.height()); @@ -160,12 +170,20 @@ cyan_tile.allocN32Pixels(inner_size.width(), inner_size.height()); cyan_tile.eraseColor(SK_ColorCYAN); - resource_provider()->CopyToResource( + child_resource_provider()->CopyToResource( resource_yellow, static_cast<uint8_t*>(yellow_tile.getPixels()), outer_size); - resource_provider()->CopyToResource( + child_resource_provider()->CopyToResource( resource_cyan, static_cast<uint8_t*>(cyan_tile.getPixels()), inner_size); + // Transfer resources to the parent, and get the resource map. + cc::ResourceProvider::ResourceIdMap resource_map = + SendResourceAndGetChildToParentMap({resource_yellow, resource_cyan}, + resource_provider(), + child_resource_provider()); + ResourceId mapped_resource_yellow = resource_map[resource_yellow]; + ResourceId mapped_resource_cyan = resource_map[resource_cyan]; + gfx::Rect root_rect = outer_rect; int root_render_pass_id = 1; @@ -179,11 +197,11 @@ 0); auto* inner_quad = root_render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); inner_quad->SetNew(shared_quad_state, inner_rect, inner_rect, needs_blending, - resource_cyan, gfx::RectF(gfx::SizeF(inner_size)), + mapped_resource_cyan, gfx::RectF(gfx::SizeF(inner_size)), inner_size, false, false, false); auto* outer_quad = root_render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); outer_quad->SetNew(shared_quad_state, outer_rect, outer_rect, needs_blending, - resource_yellow, gfx::RectF(gfx::SizeF(outer_size)), + mapped_resource_yellow, gfx::RectF(gfx::SizeF(outer_size)), outer_size, false, false, false); RenderPassList list; @@ -211,8 +229,8 @@ visible_rect.Inset(1, 2, 3, 4); InitializeRenderer(std::make_unique<SoftwareOutputDevice>()); - ResourceId resource_cyan = - resource_provider()->CreateBitmapResource(tile_size, gfx::ColorSpace()); + ResourceId resource_cyan = child_resource_provider()->CreateBitmapResource( + tile_size, gfx::ColorSpace()); SkBitmap cyan_tile; // The lowest five rows are yellow. cyan_tile.allocN32Pixels(tile_size.width(), tile_size.height()); @@ -221,11 +239,16 @@ tile_rect.width(), tile_rect.bottom()), SK_ColorYELLOW); - resource_provider()->CopyToResource( + child_resource_provider()->CopyToResource( resource_cyan, static_cast<uint8_t*>(cyan_tile.getPixels()), tile_size); - gfx::Rect root_rect(tile_size); + // Transfer resources to the parent, and get the resource map. + cc::ResourceProvider::ResourceIdMap resource_map = + SendResourceAndGetChildToParentMap({resource_cyan}, resource_provider(), + child_resource_provider()); + ResourceId mapped_resource_cyan = resource_map[resource_cyan]; + gfx::Rect root_rect(tile_size); int root_render_pass_id = 1; std::unique_ptr<RenderPass> root_render_pass = RenderPass::Create(); root_render_pass->SetNew(root_render_pass_id, root_rect, root_rect, @@ -236,8 +259,8 @@ false, true, 1.0, SkBlendMode::kSrcOver, 0); auto* quad = root_render_pass->CreateAndAppendDrawQuad<TileDrawQuad>(); quad->SetNew(shared_quad_state, tile_rect, tile_rect, needs_blending, - resource_cyan, gfx::RectF(gfx::SizeF(tile_size)), tile_size, - false, false, false); + mapped_resource_cyan, gfx::RectF(gfx::SizeF(tile_size)), + tile_size, false, false, false); quad->visible_rect = visible_rect; RenderPassList list;
diff --git a/components/viz/service/display_embedder/gpu_display_provider.cc b/components/viz/service/display_embedder/gpu_display_provider.cc index ffb3d87..a3921672 100644 --- a/components/viz/service/display_embedder/gpu_display_provider.cc +++ b/components/viz/service/display_embedder/gpu_display_provider.cc
@@ -153,9 +153,8 @@ *out_begin_frame_source = std::move(synthetic_begin_frame_source); return std::make_unique<Display>( - ServerSharedBitmapManager::current(), gpu_memory_buffer_manager_.get(), - renderer_settings, frame_sink_id, std::move(output_surface), - std::move(scheduler), task_runner_); + ServerSharedBitmapManager::current(), renderer_settings, frame_sink_id, + std::move(output_surface), std::move(scheduler), task_runner_); } std::unique_ptr<SoftwareOutputDevice>
diff --git a/components/viz/service/frame_sinks/direct_layer_tree_frame_sink_unittest.cc b/components/viz/service/frame_sinks/direct_layer_tree_frame_sink_unittest.cc index ece69fa..576f31b 100644 --- a/components/viz/service/frame_sinks/direct_layer_tree_frame_sink_unittest.cc +++ b/components/viz/service/frame_sinks/direct_layer_tree_frame_sink_unittest.cc
@@ -78,9 +78,8 @@ begin_frame_source_.get(), task_runner_.get(), max_frames_pending); display_ = std::make_unique<Display>( - &bitmap_manager_, &gpu_memory_buffer_manager_, RendererSettings(), - kArbitraryFrameSinkId, std::move(display_output_surface), - std::move(scheduler), task_runner_); + &bitmap_manager_, RendererSettings(), kArbitraryFrameSinkId, + std::move(display_output_surface), std::move(scheduler), task_runner_); layer_tree_frame_sink_ = std::make_unique<TestDirectLayerTreeFrameSink>( kArbitraryFrameSinkId, &support_manager_, &frame_sink_manager_, display_.get(), nullptr /* display_client */, context_provider_,
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc index e74ba98f..cbd2f04 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.cc +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.cc
@@ -15,6 +15,7 @@ #include "components/viz/service/frame_sinks/primary_begin_frame_source.h" #include "components/viz/service/frame_sinks/root_compositor_frame_sink_impl.h" #include "components/viz/service/frame_sinks/video_capture/capturable_frame_sink.h" +#include "components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.h" #if DCHECK_IS_ON() #include <sstream> @@ -59,6 +60,7 @@ FrameSinkManagerImpl::~FrameSinkManagerImpl() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + video_capturers_.clear(); // All FrameSinks should be unregistered prior to FrameSinkManager // destruction. compositor_frame_sinks_.clear(); @@ -222,6 +224,19 @@ surface_manager_.DropTemporaryReference(surface_id); } +void FrameSinkManagerImpl::AddVideoDetectorObserver( + mojom::VideoDetectorObserverPtr observer) { + if (!video_detector_) + video_detector_ = std::make_unique<VideoDetector>(&surface_manager_); + video_detector_->AddObserver(std::move(observer)); +} + +void FrameSinkManagerImpl::CreateVideoCapturer( + mojom::FrameSinkVideoCapturerRequest request) { + video_capturers_.emplace( + std::make_unique<FrameSinkVideoCapturerImpl>(this, std::move(request))); +} + void FrameSinkManagerImpl::RegisterCompositorFrameSinkSupport( const FrameSinkId& frame_sink_id, CompositorFrameSinkSupport* support) { @@ -231,6 +246,11 @@ DCHECK(!entry.support); entry.support = support; + for (auto& capturer : video_capturers_) { + if (capturer->requested_target() == frame_sink_id) + capturer->SetResolvedTarget(entry.support); + } + auto it = frame_sink_source_map_.find(frame_sink_id); if (it != frame_sink_source_map_.end() && it->second.source) support->SetBeginFrameSource(it->second.source); @@ -239,6 +259,12 @@ void FrameSinkManagerImpl::UnregisterCompositorFrameSinkSupport( const FrameSinkId& frame_sink_id) { DCHECK_EQ(compositor_frame_sinks_.count(frame_sink_id), 1u); + + for (auto& capturer : video_capturers_) { + if (capturer->requested_target() == frame_sink_id) + capturer->OnTargetWillGoAway(); + } + compositor_frame_sinks_.erase(frame_sink_id); } @@ -334,6 +360,11 @@ return it->second.support; } +void FrameSinkManagerImpl::OnCapturerConnectionLost( + FrameSinkVideoCapturerImpl* capturer) { + video_capturers_.erase(capturer); +} + bool FrameSinkManagerImpl::ChildContains( const FrameSinkId& child_frame_sink_id, const FrameSinkId& search_frame_sink_id) const { @@ -434,13 +465,6 @@ } } -void FrameSinkManagerImpl::AddVideoDetectorObserver( - mojom::VideoDetectorObserverPtr observer) { - if (!video_detector_) - video_detector_ = std::make_unique<VideoDetector>(&surface_manager_); - video_detector_->AddObserver(std::move(observer)); -} - VideoDetector* FrameSinkManagerImpl::CreateVideoDetectorForTesting( std::unique_ptr<base::TickClock> tick_clock, scoped_refptr<base::SequencedTaskRunner> task_runner) {
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.h b/components/viz/service/frame_sinks/frame_sink_manager_impl.h index 9368542..7d2f50a 100644 --- a/components/viz/service/frame_sinks/frame_sink_manager_impl.h +++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.h
@@ -12,11 +12,13 @@ #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" +#include "base/containers/unique_ptr_comparator.h" #include "base/logging.h" #include "base/macros.h" #include "base/threading/thread_checker.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "components/viz/service/frame_sinks/primary_begin_frame_source.h" +#include "components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_manager.h" #include "components/viz/service/frame_sinks/video_detector.h" #include "components/viz/service/hit_test/hit_test_manager.h" #include "components/viz/service/surfaces/surface_manager.h" @@ -25,6 +27,7 @@ #include "gpu/ipc/common/surface_handle.h" #include "mojo/public/cpp/bindings/binding.h" #include "services/viz/privileged/interfaces/compositing/frame_sink_manager.mojom.h" +#include "services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom.h" #include "services/viz/public/interfaces/compositing/video_detector_observer.mojom.h" namespace viz { @@ -35,8 +38,10 @@ // FrameSinkManagerImpl manages BeginFrame hierarchy. This is the implementation // detail for FrameSinkManagerImpl. -class VIZ_SERVICE_EXPORT FrameSinkManagerImpl : public SurfaceObserver, - public mojom::FrameSinkManager { +class VIZ_SERVICE_EXPORT FrameSinkManagerImpl + : public SurfaceObserver, + public FrameSinkVideoCapturerManager, + public mojom::FrameSinkManager { public: FrameSinkManagerImpl(SurfaceManager::LifetimeType lifetime_type = SurfaceManager::LifetimeType::REFERENCES, @@ -83,6 +88,8 @@ void DropTemporaryReference(const SurfaceId& surface_id) override; void AddVideoDetectorObserver( mojom::VideoDetectorObserverPtr observer) override; + void CreateVideoCapturer( + mojom::FrameSinkVideoCapturerRequest request) override; // CompositorFrameSinkSupport, hierarchy, and BeginFrameSource can be // registered and unregistered in any order with respect to each other. @@ -203,10 +210,10 @@ void RecursivelyDetachBeginFrameSource(const FrameSinkId& frame_sink_id, BeginFrameSource* source); - // TODO(crbug.com/754872): To be used by FrameSinkVideoCapturerImpl in - // an upcoming change. + // FrameSinkVideoCapturerManager implementation: CapturableFrameSink* FindCapturableFrameSink( - const FrameSinkId& frame_sink_id); + const FrameSinkId& frame_sink_id) override; + void OnCapturerConnectionLost(FrameSinkVideoCapturerImpl* capturer) override; // Returns true if |child framesink| is or has |search_frame_sink_id| as a // child. @@ -235,6 +242,10 @@ HitTestManager hit_test_manager_; + base::flat_set<std::unique_ptr<FrameSinkVideoCapturerImpl>, + base::UniquePtrComparator> + video_capturers_; + THREAD_CHECKER(thread_checker_); // |video_detector_| is instantiated lazily in order to avoid overhead on
diff --git a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.cc b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.cc index c49f902..0cb1e8f 100644 --- a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.cc +++ b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.cc
@@ -4,16 +4,21 @@ #include "components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.h" +#include <algorithm> + #include "base/bind.h" +#include "base/bind_helpers.h" +#include "base/time/default_tick_clock.h" #include "base/trace_event/trace_event.h" #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/copy_output_result.h" #include "components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_manager.h" -#include "components/viz/service/frame_sinks/video_capture/frame_sink_video_consumer.h" #include "media/base/limits.h" #include "media/base/video_util.h" +#include "media/capture/mojo/video_capture_types.mojom.h" +#include "media/mojo/common/mojo_shared_buffer_video_frame.h" +#include "mojo/public/cpp/bindings/strong_binding.h" #include "ui/gfx/color_space.h" -#include "ui/gfx/geometry/rect.h" #include "ui/gfx/geometry/size.h" using media::VideoCaptureOracle; @@ -43,15 +48,29 @@ // static constexpr media::ColorSpace FrameSinkVideoCapturerImpl::kDefaultColorSpace; +// static +constexpr base::TimeDelta + FrameSinkVideoCapturerImpl::kRefreshFrameRetryInterval; + FrameSinkVideoCapturerImpl::FrameSinkVideoCapturerImpl( - FrameSinkVideoCapturerManager* frame_sink_manager) + FrameSinkVideoCapturerManager* frame_sink_manager, + mojom::FrameSinkVideoCapturerRequest request) : frame_sink_manager_(frame_sink_manager), + binding_(this), copy_request_source_(base::UnguessableToken::Create()), + clock_(base::DefaultTickClock::GetInstance()), oracle_(true /* enable_auto_throttling */), frame_pool_(kDesignLimitMaxFrames), feedback_weak_factory_(&oracle_), capture_weak_factory_(this) { DCHECK(frame_sink_manager_); + + if (request.is_pending()) { + binding_.Bind(std::move(request)); + binding_.set_connection_error_handler( + base::BindOnce(&FrameSinkVideoCapturerManager::OnCapturerConnectionLost, + base::Unretained(frame_sink_manager_), this)); + } } FrameSinkVideoCapturerImpl::~FrameSinkVideoCapturerImpl() { @@ -183,11 +202,16 @@ } void FrameSinkVideoCapturerImpl::Start( - std::unique_ptr<FrameSinkVideoConsumer> consumer) { + mojom::FrameSinkVideoConsumerPtr consumer) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(consumer); Stop(); consumer_ = std::move(consumer); + // In the future, if the connection to the consumer is lost before a call to + // Stop(), make that call on its behalf. + consumer_.set_connection_error_handler(base::BindOnce( + &FrameSinkVideoCapturerImpl::Stop, base::Unretained(this))); MaybeCaptureFrame(VideoCaptureOracle::kActiveRefreshRequest, gfx::Rect(oracle_.source_size()), clock_->NowTicks()); } @@ -195,6 +219,8 @@ void FrameSinkVideoCapturerImpl::Stop() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + refresh_frame_retry_timer_.Stop(); + // Cancel any captures in-flight and any captured frames pending delivery. capture_weak_factory_.InvalidateWeakPtrs(); oracle_.CancelAllCaptures(); @@ -255,10 +281,31 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Consult the oracle to determine whether this frame should be captured. - if (!oracle_.ObserveEventAndDecideCapture(event, damage_rect, event_time)) { + if (oracle_.ObserveEventAndDecideCapture(event, damage_rect, event_time)) { + // Regardless of the type of |event|, there is no longer a need for the + // refresh frame retry timer to fire. The following is a no-op, if the timer + // was not running. + refresh_frame_retry_timer_.Stop(); + } else { TRACE_EVENT_INSTANT1("gpu.capture", "FpsRateLimited", TRACE_EVENT_SCOPE_THREAD, "trigger", VideoCaptureOracle::EventAsString(event)); + + // If the oracle rejected a "refresh frame" request, schedule a later retry. + if (event == VideoCaptureOracle::kPassiveRefreshRequest || + event == VideoCaptureOracle::kActiveRefreshRequest) { + refresh_frame_retry_timer_.Start( + FROM_HERE, + std::max(kRefreshFrameRetryInterval, oracle_.min_capture_period()), + base::BindRepeating( + [](FrameSinkVideoCapturerImpl* self, + VideoCaptureOracle::Event event) { + self->MaybeCaptureFrame(event, + gfx::Rect(self->oracle_.source_size()), + self->clock_->NowTicks()); + }, + this, event)); + } return; } @@ -325,7 +372,6 @@ metadata->SetTimeTicks(VideoFrameMetadata::CAPTURE_BEGIN_TIME, clock_->NowTicks()); // See TODO in SetFormat(). For now, always assume Rec. 709. - frame->set_color_space(gfx::ColorSpace::CreateREC709()); metadata->SetInteger(VideoFrameMetadata::COLOR_SPACE, media::COLOR_SPACE_HD_REC709); metadata->SetTimeDelta(VideoFrameMetadata::FRAME_DURATION, @@ -345,19 +391,22 @@ const gfx::Size& source_size = oracle_.source_size(); if (!resolved_target_ || source_size.IsEmpty()) { media::FillYUV(frame.get(), 0x00, 0x80, 0x80); - DidCaptureFrame(frame_number, oracle_frame_number, std::move(frame)); + DidCaptureFrame(frame_number, oracle_frame_number, std::move(frame), + gfx::Rect()); return; } + const gfx::Rect content_rect = + media::ComputeLetterboxRegionForI420(frame->visible_rect(), source_size); + // For passive refresh requests, just deliver the resurrected frame. if (event == VideoCaptureOracle::kPassiveRefreshRequest) { - DidCaptureFrame(frame_number, oracle_frame_number, std::move(frame)); + DidCaptureFrame(frame_number, oracle_frame_number, std::move(frame), + content_rect); return; } // Request a copy of the next frame from the frame sink. - const gfx::Rect content_rect = - media::ComputeLetterboxRegionForI420(frame->visible_rect(), source_size); std::unique_ptr<CopyOutputRequest> request(new CopyOutputRequest( CopyOutputRequest::ResultFormat::I420_PLANES, base::BindOnce(&FrameSinkVideoCapturerImpl::DidCopyFrame, @@ -391,7 +440,7 @@ DCHECK(result); // Stop() should have canceled any outstanding copy requests. So, by reaching - // this point, there should be a |consumer_| present. + // this point, |consumer_| should be bound. DCHECK(consumer_); // Populate the VideoFrame from the CopyOutputResult. @@ -418,13 +467,15 @@ frame = nullptr; } - DidCaptureFrame(frame_number, oracle_frame_number, std::move(frame)); + DidCaptureFrame(frame_number, oracle_frame_number, std::move(frame), + content_rect); } void FrameSinkVideoCapturerImpl::DidCaptureFrame( int64_t frame_number, OracleFrameNumber oracle_frame_number, - scoped_refptr<VideoFrame> frame) { + scoped_refptr<VideoFrame> frame, + const gfx::Rect& content_rect) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_GE(frame_number, next_delivery_frame_number_); @@ -435,10 +486,12 @@ // Ensure frames are delivered in-order by using a min-heap, and only // deliver the next frame(s) in-sequence when they are found at the top. - delivery_queue_.emplace(frame_number, oracle_frame_number, std::move(frame)); + delivery_queue_.emplace(frame_number, oracle_frame_number, std::move(frame), + content_rect); while (delivery_queue_.top().frame_number == next_delivery_frame_number_) { - MaybeDeliverFrame(delivery_queue_.top().oracle_frame_number, - std::move(delivery_queue_.top().frame)); + auto& next = delivery_queue_.top(); + MaybeDeliverFrame(next.oracle_frame_number, std::move(next.frame), + next.content_rect); ++next_delivery_frame_number_; delivery_queue_.pop(); if (delivery_queue_.empty()) { @@ -449,7 +502,8 @@ void FrameSinkVideoCapturerImpl::MaybeDeliverFrame( OracleFrameNumber oracle_frame_number, - scoped_refptr<VideoFrame> frame) { + scoped_refptr<VideoFrame> frame, + const gfx::Rect& content_rect) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // The Oracle has the final say in whether frame delivery will proceed. It @@ -477,22 +531,56 @@ } frame->set_timestamp(media_ticks - *first_frame_media_ticks_); - // Construct a new InFlightFrameDelivery instance, to provide the done signal - // for this frame and deliver the frame to the consumer. + // Clone a handle to the shared memory backing the populated video frame, to + // send to the consumer. The handle is READ_WRITE because the consumer is free + // to modify the content further (so long as it undoes its changes before the + // InFlightFrameDelivery::Done() call). + DCHECK_EQ(frame->storage_type(), + media::VideoFrame::STORAGE_MOJO_SHARED_BUFFER); + auto* const mojo_frame = + static_cast<media::MojoSharedBufferVideoFrame*>(frame.get()); + mojo::ScopedSharedBufferHandle buffer = mojo_frame->Handle().Clone( + mojo::SharedBufferHandle::AccessMode::READ_WRITE); + const uint32_t buffer_size = static_cast<uint32_t>(mojo_frame->MappedSize()); + + // Assemble frame layout, format, and metadata into a mojo struct to send to + // the consumer. + media::mojom::VideoFrameInfoPtr info = media::mojom::VideoFrameInfo::New(); + info->timestamp = frame->timestamp(); + info->metadata = frame->metadata()->CopyInternalValues(); + info->pixel_format = frame->format(); + info->storage_type = media::VideoPixelStorage::CPU; + info->coded_size = frame->coded_size(); + info->visible_rect = frame->visible_rect(); const gfx::Rect update_rect = frame->visible_rect(); - auto delivery = std::make_unique<InFlightFrameDelivery>( - frame_pool_.HoldFrameForDelivery(frame.get()), - base::BindOnce(&VideoCaptureOracle::RecordConsumerFeedback, - feedback_weak_factory_.GetWeakPtr(), oracle_frame_number)); - consumer_->OnFrameCaptured(std::move(frame), update_rect, - std::move(delivery)); + + // Create an InFlightFrameDelivery for this frame, owned by its mojo binding. + // It responds to the consumer's Done() notification by returning the video + // frame to the |frame_pool_|. It responds to the optional ProvideFeedback() + // by forwarding the measurement to the |oracle_|. + mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks; + mojo::MakeStrongBinding( + std::make_unique<InFlightFrameDelivery>( + frame_pool_.HoldFrameForDelivery(frame.get()), + base::BindOnce(&VideoCaptureOracle::RecordConsumerFeedback, + feedback_weak_factory_.GetWeakPtr(), + oracle_frame_number)), + mojo::MakeRequest(&callbacks)); + + // Send the frame to the consumer. + consumer_->OnFrameCaptured(std::move(buffer), buffer_size, std::move(info), + update_rect, content_rect, std::move(callbacks)); } FrameSinkVideoCapturerImpl::CapturedFrame::CapturedFrame( int64_t fn, OracleFrameNumber ofn, - scoped_refptr<VideoFrame> fr) - : frame_number(fn), oracle_frame_number(ofn), frame(std::move(fr)) {} + scoped_refptr<VideoFrame> fr, + const gfx::Rect& cr) + : frame_number(fn), + oracle_frame_number(ofn), + frame(std::move(fr)), + content_rect(cr) {} FrameSinkVideoCapturerImpl::CapturedFrame::CapturedFrame( const CapturedFrame& other) = default;
diff --git a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.h b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.h index ee95cec..ec1981b 100644 --- a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.h +++ b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl.h
@@ -14,8 +14,9 @@ #include "base/memory/weak_ptr.h" #include "base/optional.h" #include "base/sequence_checker.h" -#include "base/time/default_tick_clock.h" +#include "base/time/tick_clock.h" #include "base/time/time.h" +#include "base/timer/timer.h" #include "base/unguessable_token.h" #include "components/viz/common/frame_sinks/begin_frame_args.h" #include "components/viz/common/surfaces/frame_sink_id.h" @@ -25,33 +26,50 @@ #include "components/viz/service/viz_service_export.h" #include "media/base/video_frame.h" #include "media/capture/content/video_capture_oracle.h" +#include "mojo/public/cpp/bindings/binding.h" +#include "services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom.h" +#include "ui/gfx/geometry/rect.h" namespace gfx { -class Rect; class Size; } // namespace gfx namespace viz { class FrameSinkVideoCapturerManager; -class FrameSinkVideoConsumer; class CopyOutputResult; -// Captures the frames of a CompositorFrameSink's surface as a video stream. +// Captures the frames of a CompositorFrameSink's surface as a video stream. See +// mojom for usage details. // -// The capturer works with FrameSinkVideoCapturerManager to resolve the capture -// target, a CapturableFrameSink, from a given FrameSinkId. Once the -// target is resolved, this capturer attaches to it to receive events of -// interest regarding the frame flow, display timiming, and changes to the frame -// sink's surface. For some subset of frames, decided by +// FrameSinkVideoCapturerImpl is owned by FrameSinkManagerImpl. An instance is +// destroyed either: 1) just after the Mojo binding has closed; or 2) when the +// FrameSinkManagerImpl is shutting down. +// +// The capturer also works with FrameSinkManagerImpl to resolve the capture +// target, a CapturableFrameSink, from a given FrameSinkId. Since there is a +// possible race between when the capturer learns of a new FrameSinkId and when +// FrameSinkManagerImpl learns of it (e.g., because Mojo method invocations can +// be out-of-order), the capturer allows for the possibility that a requested +// target will resolve at a later point. In this case, it is the responsibility +// of FrameSinkManagerImpl to call SetResolvedTarget() once the target becomes +// known to it. +// +// Once the target is resolved, this capturer attaches to it to receive events +// of interest regarding the frame flow, display timiming, and changes to the +// frame sink's surface. For some subset of frames, decided by // media::VideoCaptureOracle, this capturer will make a CopyOutputRequest on the -// surface. +// surface. Successful CopyOutputResults are then copied into pooled shared +// memory for efficient transport to the consumer. class VIZ_SERVICE_EXPORT FrameSinkVideoCapturerImpl final - : public CapturableFrameSink::Client { + : public CapturableFrameSink::Client, + public mojom::FrameSinkVideoCapturer { public: - // |frame_sink_manager| must outlive this instance. - explicit FrameSinkVideoCapturerImpl( - FrameSinkVideoCapturerManager* frame_sink_manager); + // |frame_sink_manager| must outlive this instance. Binds this instance to the + // Mojo message pipe endpoint in |request|, but |request| may be empty for + // unit testing. + FrameSinkVideoCapturerImpl(FrameSinkVideoCapturerManager* frame_sink_manager, + mojom::FrameSinkVideoCapturerRequest request); ~FrameSinkVideoCapturerImpl() final; @@ -72,16 +90,17 @@ // frame sink manager. void OnTargetWillGoAway(); - // TODO(crbug.com/754872): mojom::FrameSinkVideoCapturer implementation: - void SetFormat(media::VideoPixelFormat format, media::ColorSpace color_space); - void SetMinCapturePeriod(base::TimeDelta min_capture_period); + // mojom::FrameSinkVideoCapturer implementation: + void SetFormat(media::VideoPixelFormat format, + media::ColorSpace color_space) final; + void SetMinCapturePeriod(base::TimeDelta min_capture_period) final; void SetResolutionConstraints(const gfx::Size& min_size, const gfx::Size& max_size, - bool use_fixed_aspect_ratio); - void ChangeTarget(const FrameSinkId& frame_sink_id); - void Start(std::unique_ptr<FrameSinkVideoConsumer> consumer); - void Stop(); - void RequestRefreshFrame(); + bool use_fixed_aspect_ratio) final; + void ChangeTarget(const FrameSinkId& frame_sink_id) final; + void Start(mojom::FrameSinkVideoConsumerPtr consumer) final; + void Stop() final; + void RequestRefreshFrame() final; // Default configuration. static constexpr media::VideoPixelFormat kDefaultPixelFormat = @@ -105,6 +124,10 @@ // exceeding 60% of the design limit is considered "red line" operation. static constexpr float kTargetPipelineUtilization = 0.6f; + // The amount of time to wait before retrying a refresh frame request. + static constexpr base::TimeDelta kRefreshFrameRetryInterval = + base::TimeDelta::FromMicroseconds(base::Time::kMicrosecondsPerSecond / 4); + private: friend class FrameSinkVideoCapturerTest; @@ -138,18 +161,23 @@ // completed, but unsuccessful capture. void DidCaptureFrame(int64_t frame_number, OracleFrameNumber oracle_frame_number, - scoped_refptr<media::VideoFrame> frame); + scoped_refptr<media::VideoFrame> frame, + const gfx::Rect& content_rect); // Delivers a |frame| to the consumer, if the VideoCaptureOracle allows // it. |frame| can be null to indicate a completed, but unsuccessful capture. // In this case, some state will be updated, but nothing will be sent to the // consumer. void MaybeDeliverFrame(OracleFrameNumber oracle_frame_number, - scoped_refptr<media::VideoFrame> frame); + scoped_refptr<media::VideoFrame> frame, + const gfx::Rect& content_rect); // Owner/Manager of this instance. FrameSinkVideoCapturerManager* const frame_sink_manager_; + // Mojo binding for this instance. + mojo::Binding<mojom::FrameSinkVideoCapturer> binding_; + // Represents this instance as an issuer of CopyOutputRequests. The Surface // uses this to auto-cancel stale requests (i.e., prior requests that did not // execute). Also, the implementations that execute CopyOutputRequests use @@ -158,8 +186,7 @@ // Use the default base::TimeTicks clock; but allow unit tests to provide a // replacement. - base::DefaultTickClock default_tick_clock_; - base::TickClock* clock_ = &default_tick_clock_; + base::TickClock* clock_; // Current image format. media::VideoPixelFormat pixel_format_ = kDefaultPixelFormat; @@ -179,7 +206,7 @@ // The current video frame consumer. This is set when Start() is called and // cleared when Stop() is called. - std::unique_ptr<FrameSinkVideoConsumer> consumer_; + mojom::FrameSinkVideoConsumerPtr consumer_; // A cache of recently-recorded future frame display times, according to the // BeginFrameArgs passed to OnBeginFrame() calls. This array is a ring buffer @@ -197,6 +224,11 @@ int64_t next_capture_frame_number_ = 0; int64_t next_delivery_frame_number_ = 0; + // When the oracle rejects a "refresh frame" request, this timer is set to + // auto-retry the refresh at a later point. This ensures refresh frame + // requests eventually result in a frame being delivered to the consumer. + base::OneShotTimer refresh_frame_retry_timer_; + // Provides a pool of VideoFrames that can be efficiently delivered across // processes. The size of this pool is used to limit the maximum number of // frames in-flight at any one time. @@ -208,9 +240,11 @@ int64_t frame_number; OracleFrameNumber oracle_frame_number; scoped_refptr<media::VideoFrame> frame; + gfx::Rect content_rect; CapturedFrame(int64_t frame_number, OracleFrameNumber oracle_frame_number, - scoped_refptr<media::VideoFrame> frame); + scoped_refptr<media::VideoFrame> frame, + const gfx::Rect& content_rect); CapturedFrame(const CapturedFrame& other); ~CapturedFrame(); bool operator<(const CapturedFrame& other) const;
diff --git a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl_unittest.cc b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl_unittest.cc index 9364978..0cdbcf0 100644 --- a/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl_unittest.cc +++ b/components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_impl_unittest.cc
@@ -7,15 +7,17 @@ #include "base/bind.h" #include "base/callback.h" #include "base/optional.h" +#include "base/run_loop.h" #include "base/test/simple_test_tick_clock.h" +#include "base/test/test_simple_task_runner.h" #include "base/time/time.h" #include "components/viz/common/frame_sinks/begin_frame_args.h" #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/copy_output_result.h" #include "components/viz/service/frame_sinks/video_capture/frame_sink_video_capturer_manager.h" -#include "components/viz/service/frame_sinks/video_capture/frame_sink_video_consumer.h" #include "media/base/limits.h" #include "media/base/video_util.h" +#include "services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -59,6 +61,12 @@ uint8_t v; }; +// Forces any pending Mojo method calls between the capturer and consumer to be +// made. +void PropagateMojoTasks() { + base::RunLoop().RunUntilIdle(); +} + class MockFrameSinkManager : public FrameSinkVideoCapturerManager { public: MOCK_METHOD1(FindCapturableFrameSink, @@ -67,12 +75,14 @@ void(FrameSinkVideoCapturerImpl* capturer)); }; -class MockConsumer : public FrameSinkVideoConsumer { +class MockConsumer : public mojom::FrameSinkVideoConsumer { public: + MockConsumer() : binding_(this) {} + MOCK_METHOD3(OnFrameCapturedMock, void(scoped_refptr<VideoFrame> frame, const gfx::Rect& update_rect, - InFlightFrameDelivery* delivery)); + mojom::FrameSinkVideoConsumerFrameCallbacks* callbacks)); MOCK_METHOD1(OnTargetLost, void(const FrameSinkId& frame_sink_id)); MOCK_METHOD0(OnStopped, void()); @@ -80,21 +90,55 @@ scoped_refptr<VideoFrame> TakeFrame(int i) { return std::move(frames_[i]); } - void SendDoneNotification(int i) { std::move(done_callbacks_[i]).Run(); } - - private: - void OnFrameCaptured(scoped_refptr<VideoFrame> frame, - const gfx::Rect& update_rect, - std::unique_ptr<InFlightFrameDelivery> delivery) final { - ASSERT_TRUE(frame.get()); - EXPECT_EQ(gfx::Rect(kCaptureSize), update_rect); - ASSERT_TRUE(delivery.get()); - OnFrameCapturedMock(frame, update_rect, delivery.get()); - frames_.push_back(std::move(frame)); - done_callbacks_.push_back( - base::BindOnce(&InFlightFrameDelivery::Done, base::Passed(&delivery))); + void SendDoneNotification(int i) { + std::move(done_callbacks_[i]).Run(); + PropagateMojoTasks(); } + mojom::FrameSinkVideoConsumerPtr BindVideoConsumer() { + mojom::FrameSinkVideoConsumerPtr ptr; + binding_.Bind(mojo::MakeRequest(&ptr)); + return ptr; + } + + private: + void OnFrameCaptured( + mojo::ScopedSharedBufferHandle buffer, + uint32_t buffer_size, + media::mojom::VideoFrameInfoPtr info, + const gfx::Rect& update_rect, + const gfx::Rect& content_rect, + mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks) final { + ASSERT_TRUE(buffer.is_valid()); + const auto required_bytes_to_hold_planes = + static_cast<uint32_t>(info->coded_size.GetArea() * 3 / 2); + ASSERT_LE(required_bytes_to_hold_planes, buffer_size); + ASSERT_TRUE(info); + EXPECT_EQ(gfx::Rect(kCaptureSize), update_rect); + ASSERT_TRUE(callbacks.get()); + + // Map the shared memory buffer and re-constitute a VideoFrame instance + // around it for analysis by OnFrameCapturedMock(). + mojo::ScopedSharedBufferMapping mapping = buffer->Map(buffer_size); + ASSERT_TRUE(mapping); + scoped_refptr<media::VideoFrame> frame = + media::VideoFrame::WrapExternalData( + info->pixel_format, info->coded_size, info->visible_rect, + info->visible_rect.size(), static_cast<uint8_t*>(mapping.get()), + buffer_size, info->timestamp); + ASSERT_TRUE(frame); + frame->metadata()->MergeInternalValuesFrom(*info->metadata); + frame->AddDestructionObserver(base::BindOnce( + [](mojo::ScopedSharedBufferMapping mapping) {}, std::move(mapping))); + OnFrameCapturedMock(frame, update_rect, callbacks.get()); + + frames_.push_back(std::move(frame)); + done_callbacks_.push_back( + base::BindOnce(&mojom::FrameSinkVideoConsumerFrameCallbacks::Done, + base::Passed(&callbacks))); + } + + mojo::Binding<mojom::FrameSinkVideoConsumer> binding_; std::vector<scoped_refptr<VideoFrame>> frames_; std::vector<base::OnceClosure> done_callbacks_; }; @@ -177,6 +221,7 @@ void SendCopyOutputResult(int offset) { auto it = results_.begin() + offset; std::move(*it).Run(); + PropagateMojoTasks(); } private: @@ -227,7 +272,10 @@ class FrameSinkVideoCapturerTest : public testing::Test { public: - FrameSinkVideoCapturerTest() : capturer_(&frame_sink_manager_) {} + FrameSinkVideoCapturerTest() + : retry_timer_task_runner_(new base::TestSimpleTaskRunner()), + capturer_(&frame_sink_manager_, + mojom::FrameSinkVideoCapturerRequest()) {} void SetUp() override { // Override the capturer's TickClock with the one controlled by the tests. @@ -235,6 +283,10 @@ clock_.SetNowTicks(start_time_); capturer_.clock_ = &clock_; + // Point the retry timer at this test's manually-controlled task runner. + capturer_.refresh_frame_retry_timer_.SetTaskRunner( + retry_timer_task_runner_); + // Before setting the format, ensure the defaults are in-place. Then, for // these tests, set a specific format and color space. ASSERT_EQ(FrameSinkVideoCapturerImpl::kDefaultPixelFormat, @@ -255,6 +307,18 @@ capturer_.SetResolutionConstraints(kCaptureSize, kCaptureSize, false); } + void TearDown() override { retry_timer_task_runner_->ClearPendingTasks(); } + + void StartCapture(MockConsumer* consumer) { + capturer_.Start(consumer->BindVideoConsumer()); + PropagateMojoTasks(); + } + + void StopCapture() { + capturer_.Stop(); + PropagateMojoTasks(); + } + void AdvanceClockToNextVsync() { const auto num_vsyncs_elapsed = (clock_.NowTicks() - start_time_) / kVsyncInterval; @@ -279,9 +343,25 @@ capturer_.OnFrameDamaged(ack, kSourceSize, gfx::Rect(kSourceSize)); } + void NotifyTargetWentAway() { + capturer_.OnTargetWillGoAway(); + PropagateMojoTasks(); + } + + bool IsRefreshRetryTimerRunning() { + return capturer_.refresh_frame_retry_timer_.IsRunning(); + } + + void FireRefreshRetryTimer() { + ASSERT_TRUE(IsRefreshRetryTimerRunning()); + ASSERT_TRUE(retry_timer_task_runner_->HasPendingTask()); + retry_timer_task_runner_->RunPendingTasks(); + } + protected: base::TimeTicks start_time_; base::SimpleTestTickClock clock_; + scoped_refptr<base::TestSimpleTaskRunner> retry_timer_task_runner_; MockFrameSinkManager frame_sink_manager_; FakeCapturableFrameSink frame_sink_; FrameSinkVideoCapturerImpl capturer_; @@ -324,16 +404,16 @@ EXPECT_CALL(frame_sink_manager_, FindCapturableFrameSink(kFrameSinkId)) .WillOnce(Return(&frame_sink_)); - auto consumer = std::make_unique<NiceMock<MockConsumer>>(); - EXPECT_CALL(*consumer, OnTargetLost(kPriorFrameSinkId)).Times(1); - capturer_.Start(std::move(consumer)); + NiceMock<MockConsumer> consumer; + EXPECT_CALL(consumer, OnTargetLost(kPriorFrameSinkId)).Times(1); + StartCapture(&consumer); capturer_.ChangeTarget(kPriorFrameSinkId); EXPECT_EQ(kPriorFrameSinkId, capturer_.requested_target()); EXPECT_EQ(&capturer_, prior_frame_sink.attached_client()); EXPECT_EQ(nullptr, frame_sink_.attached_client()); - capturer_.OnTargetWillGoAway(); + NotifyTargetWentAway(); EXPECT_EQ(nullptr, prior_frame_sink.attached_client()); EXPECT_EQ(nullptr, frame_sink_.attached_client()); @@ -342,7 +422,7 @@ EXPECT_EQ(nullptr, prior_frame_sink.attached_client()); EXPECT_EQ(&capturer_, frame_sink_.attached_client()); - capturer_.Stop(); + StopCapture(); } // Tests that an initial black frame is sent, in the case where a target is not @@ -351,18 +431,22 @@ EXPECT_CALL(frame_sink_manager_, FindCapturableFrameSink(kFrameSinkId)) .WillRepeatedly(Return(&frame_sink_)); - auto consumer = std::make_unique<MockConsumer>(); + MockConsumer consumer; EXPECT_CALL( - *consumer, + consumer, OnFrameCapturedMock(IsLetterboxedFrame(YUVColor{0x00, 0x80, 0x80}), _, _)) .Times(1); - EXPECT_CALL(*consumer, OnTargetLost(kFrameSinkId)).Times(0); - EXPECT_CALL(*consumer, OnStopped()).Times(1); + EXPECT_CALL(consumer, OnTargetLost(kFrameSinkId)).Times(0); + EXPECT_CALL(consumer, OnStopped()).Times(1); - capturer_.Start(std::move(consumer)); + StartCapture(&consumer); // A copy request was not necessary. EXPECT_EQ(0, frame_sink_.num_copy_results()); - capturer_.Stop(); + // The initial black frame is the initial refresh frame. Since that was + // supposed to have been sent, the timer should not be running to retry + // later. + EXPECT_FALSE(IsRefreshRetryTimerRunning()); + StopCapture(); } // An end-to-end pipeline test where compositor updates trigger the capturer to @@ -375,29 +459,26 @@ capturer_.ChangeTarget(kFrameSinkId); - MockConsumer* consumer; - { - auto mock_consumer = std::make_unique<MockConsumer>(); - consumer = mock_consumer.get(); - capturer_.Start(std::move(mock_consumer)); - } + MockConsumer consumer; const int num_refresh_frames = 1; const int num_update_frames = 3 * FrameSinkVideoCapturerImpl::kDesignLimitMaxFrames; - EXPECT_CALL(*consumer, OnFrameCapturedMock(_, _, _)) + EXPECT_CALL(consumer, OnFrameCapturedMock(_, _, _)) .Times(num_refresh_frames + num_update_frames); - EXPECT_CALL(*consumer, OnTargetLost(_)).Times(0); - EXPECT_CALL(*consumer, OnStopped()).Times(1); + EXPECT_CALL(consumer, OnTargetLost(_)).Times(0); + EXPECT_CALL(consumer, OnStopped()).Times(1); + StartCapture(&consumer); // To start, the capturer will make a copy request for the initial refresh // frame. Simulate a copy result and expect to see the refresh frame delivered // to the consumer. ASSERT_EQ(num_refresh_frames, frame_sink_.num_copy_results()); + EXPECT_FALSE(IsRefreshRetryTimerRunning()); frame_sink_.SendCopyOutputResult(0); - ASSERT_EQ(num_refresh_frames, consumer->num_frames_received()); - EXPECT_THAT(consumer->TakeFrame(0), + ASSERT_EQ(num_refresh_frames, consumer.num_frames_received()); + EXPECT_THAT(consumer.TakeFrame(0), IsLetterboxedFrame(YUVColor{0x80, 0x80, 0x80})); - consumer->SendDoneNotification(0); + consumer.SendDoneNotification(0); // Drive the capturer pipeline for a series of frame composites. base::TimeDelta last_timestamp; @@ -427,15 +508,14 @@ clock_.Advance(kVsyncInterval / 4); const base::TimeTicks expected_capture_end_time = clock_.NowTicks(); frame_sink_.SendCopyOutputResult(i); - ASSERT_EQ(i + 1, consumer->num_frames_received()); + ASSERT_EQ(i + 1, consumer.num_frames_received()); // Verify the frame is the right size, has the right content, and has // required metadata set. - const scoped_refptr<VideoFrame> frame = consumer->TakeFrame(i); + const scoped_refptr<VideoFrame> frame = consumer.TakeFrame(i); EXPECT_THAT(frame, IsLetterboxedFrame(color)); EXPECT_EQ(kCaptureSize, frame->coded_size()); EXPECT_EQ(gfx::Rect(kCaptureSize), frame->visible_rect()); - EXPECT_EQ(gfx::ColorSpace::CreateREC709(), frame->ColorSpace()); EXPECT_LT(last_timestamp, frame->timestamp()); last_timestamp = frame->timestamp(); const VideoFrameMetadata* metadata = frame->metadata(); @@ -464,14 +544,14 @@ EXPECT_EQ(expected_reference_time, reference_time); // Notify the capturer that the consumer is done with the frame. - consumer->SendDoneNotification(i); + consumer.SendDoneNotification(i); if (HasFailure()) { break; } } - capturer_.Stop(); + StopCapture(); } // Tests that frame capturing halts when too many frames are in-flight, whether @@ -483,12 +563,8 @@ capturer_.ChangeTarget(kFrameSinkId); - MockConsumer* consumer; - { - auto mock_consumer = std::make_unique<NiceMock<MockConsumer>>(); - consumer = mock_consumer.get(); - capturer_.Start(std::move(mock_consumer)); - } + NiceMock<MockConsumer> consumer; + StartCapture(&consumer); // Saturate the pipeline with CopyOutputRequests that have not yet executed. const int num_refresh_frames = 1; @@ -512,7 +588,7 @@ // compositor update, no new copy requests should be issued because the first // frame is still in the middle of being delivered/consumed. frame_sink_.SendCopyOutputResult(0); - ASSERT_EQ(1, consumer->num_frames_received()); + ASSERT_EQ(1, consumer.num_frames_received()); const int second_uncaptured_frame = num_frames; AdvanceClockToNextVsync(); NotifyBeginFrame(second_uncaptured_frame); @@ -522,8 +598,8 @@ // Notify the capturer that the first frame has been consumed. Then, with // another compositor update, the capturer should issue another new copy // request. - EXPECT_TRUE(consumer->TakeFrame(0)); - consumer->SendDoneNotification(0); + EXPECT_TRUE(consumer.TakeFrame(0)); + consumer.SendDoneNotification(0); const int first_capture_resumed_frame = second_uncaptured_frame + 1; AdvanceClockToNextVsync(); NotifyBeginFrame(first_capture_resumed_frame); @@ -546,7 +622,7 @@ SCOPED_TRACE(testing::Message() << "frame #" << i); frame_sink_.SendCopyOutputResult(i); } - ASSERT_EQ(frame_sink_.num_copy_results(), consumer->num_frames_received()); + ASSERT_EQ(frame_sink_.num_copy_results(), consumer.num_frames_received()); const int fourth_uncaptured_frame = third_uncaptured_frame + 1; AdvanceClockToNextVsync(); NotifyBeginFrame(fourth_uncaptured_frame); @@ -555,10 +631,10 @@ // Notify the capturer that all frames have been consumed. Finally, with // another compositor update, capture should resume. - for (int i = 1; i < consumer->num_frames_received(); ++i) { + for (int i = 1; i < consumer.num_frames_received(); ++i) { SCOPED_TRACE(testing::Message() << "frame #" << i); - EXPECT_TRUE(consumer->TakeFrame(i)); - consumer->SendDoneNotification(i); + EXPECT_TRUE(consumer.TakeFrame(i)); + consumer.SendDoneNotification(i); } const int second_capture_resumed_frame = fourth_uncaptured_frame + 1; AdvanceClockToNextVsync(); @@ -567,9 +643,9 @@ ++num_frames; ASSERT_EQ(num_frames, frame_sink_.num_copy_results()); frame_sink_.SendCopyOutputResult(frame_sink_.num_copy_results() - 1); - ASSERT_EQ(frame_sink_.num_copy_results(), consumer->num_frames_received()); + ASSERT_EQ(frame_sink_.num_copy_results(), consumer.num_frames_received()); - capturer_.Stop(); + StopCapture(); } // Tests that copy requests completed out-of-order are accounted for by the @@ -583,12 +659,8 @@ capturer_.ChangeTarget(kFrameSinkId); - MockConsumer* consumer; - { - auto mock_consumer = std::make_unique<NiceMock<MockConsumer>>(); - consumer = mock_consumer.get(); - capturer_.Start(std::move(mock_consumer)); - } + NiceMock<MockConsumer> consumer; + StartCapture(&consumer); // Issue five CopyOutputRequests (1 refresh frame plus 4 compositor // updates). Each composited frame has its content region set to a different @@ -611,22 +683,22 @@ // delivered until they can all be delivered in-order, and that the content of // each video frame is correct. frame_sink_.SendCopyOutputResult(0); - ASSERT_EQ(1, consumer->num_frames_received()); - EXPECT_THAT(consumer->TakeFrame(0), IsLetterboxedFrame(colors[0])); + ASSERT_EQ(1, consumer.num_frames_received()); + EXPECT_THAT(consumer.TakeFrame(0), IsLetterboxedFrame(colors[0])); frame_sink_.SendCopyOutputResult(2); - ASSERT_EQ(1, consumer->num_frames_received()); // Waiting for frame 1. + ASSERT_EQ(1, consumer.num_frames_received()); // Waiting for frame 1. frame_sink_.SendCopyOutputResult(3); - ASSERT_EQ(1, consumer->num_frames_received()); // Still waiting for frame 1. + ASSERT_EQ(1, consumer.num_frames_received()); // Still waiting for frame 1. frame_sink_.SendCopyOutputResult(1); - ASSERT_EQ(4, consumer->num_frames_received()); // Sent frames 1, 2, and 3. - EXPECT_THAT(consumer->TakeFrame(1), IsLetterboxedFrame(colors[1])); - EXPECT_THAT(consumer->TakeFrame(2), IsLetterboxedFrame(colors[2])); - EXPECT_THAT(consumer->TakeFrame(3), IsLetterboxedFrame(colors[3])); + ASSERT_EQ(4, consumer.num_frames_received()); // Sent frames 1, 2, and 3. + EXPECT_THAT(consumer.TakeFrame(1), IsLetterboxedFrame(colors[1])); + EXPECT_THAT(consumer.TakeFrame(2), IsLetterboxedFrame(colors[2])); + EXPECT_THAT(consumer.TakeFrame(3), IsLetterboxedFrame(colors[3])); frame_sink_.SendCopyOutputResult(4); - ASSERT_EQ(5, consumer->num_frames_received()); - EXPECT_THAT(consumer->TakeFrame(4), IsLetterboxedFrame(colors[4])); + ASSERT_EQ(5, consumer.num_frames_received()); + EXPECT_THAT(consumer.TakeFrame(4), IsLetterboxedFrame(colors[4])); - capturer_.Stop(); + StopCapture(); } // Tests that in-flight copy requests are canceled when the capturer is @@ -641,15 +713,11 @@ capturer_.ChangeTarget(kFrameSinkId); // Start capturing to the first consumer. - MockConsumer* consumer; - { - auto mock_consumer = std::make_unique<MockConsumer>(); - consumer = mock_consumer.get(); - capturer_.Start(std::move(mock_consumer)); - } - EXPECT_CALL(*consumer, OnFrameCapturedMock(_, _, _)).Times(2); - EXPECT_CALL(*consumer, OnTargetLost(_)).Times(0); - EXPECT_CALL(*consumer, OnStopped()).Times(1); + MockConsumer consumer; + EXPECT_CALL(consumer, OnFrameCapturedMock(_, _, _)).Times(2); + EXPECT_CALL(consumer, OnTargetLost(_)).Times(0); + EXPECT_CALL(consumer, OnStopped()).Times(1); + StartCapture(&consumer); // Issue three additional CopyOutputRequests. With the initial refresh frame, // the total should be four. @@ -669,45 +737,39 @@ for (int i = 0; i < num_completed_captures; ++i) { SCOPED_TRACE(testing::Message() << "frame #" << i); frame_sink_.SendCopyOutputResult(i); - ASSERT_EQ(i + 1, consumer->num_frames_received()); - EXPECT_THAT(consumer->TakeFrame(i), IsLetterboxedFrame(color1)); + ASSERT_EQ(i + 1, consumer.num_frames_received()); + EXPECT_THAT(consumer.TakeFrame(i), IsLetterboxedFrame(color1)); } // Stopping capture should cancel the remaning copy requests. - capturer_.Stop(); + StopCapture(); // Change the content color and start capturing to the second consumer. const YUVColor color2 = {0xdd, 0xee, 0xff}; frame_sink_.SetCopyOutputColor(color2); - MockConsumer* consumer2; - { - auto mock_consumer2 = std::make_unique<MockConsumer>(); - consumer2 = mock_consumer2.get(); - capturer_.Start(std::move(mock_consumer2)); - } + MockConsumer consumer2; const int num_captures_for_second_consumer = 3; - EXPECT_CALL(*consumer2, OnFrameCapturedMock(_, _, _)) + EXPECT_CALL(consumer2, OnFrameCapturedMock(_, _, _)) .Times(num_captures_for_second_consumer); - EXPECT_CALL(*consumer2, OnTargetLost(_)).Times(0); - EXPECT_CALL(*consumer2, OnStopped()).Times(1); + EXPECT_CALL(consumer2, OnTargetLost(_)).Times(0); + EXPECT_CALL(consumer2, OnStopped()).Times(1); + StartCapture(&consumer2); // Complete the copy requests for the first consumer. Expect that they have no // effect on the second consumer. for (int i = num_completed_captures; i < num_copy_requests; ++i) { frame_sink_.SendCopyOutputResult(i); - ASSERT_EQ(0, consumer2->num_frames_received()); + ASSERT_EQ(0, consumer2.num_frames_received()); } num_completed_captures = 0; // Note: Because the clock hasn't advanced while switching consumers, the // capturer won't send a refresh frame. This is because the VideoCaptureOracle - // thinks the frame rate would be too fast. - // - // TODO(crbug.com/785072): Revisit this because the capturer should always - // guarantee an initial video frame is sent to the consumer within a - // reasonable time period. In practice, it does; but if things happen too - // quickly, it might not. + // thinks the frame rate would be too fast. However, the refresh frame retry + // timer should be running. It will be canceled when the next composite- + // triggered capture occurs (in the loop below). num_refresh_frames = 0; + EXPECT_TRUE(IsRefreshRetryTimerRunning()); // From here, any new copy requests should be executed with video frames // delivered to the consumer containing |color2|. @@ -717,14 +779,77 @@ NotifyFrameDamaged(num_copy_requests); ++num_copy_requests; ASSERT_EQ(num_copy_requests, frame_sink_.num_copy_results()); + ASSERT_FALSE(IsRefreshRetryTimerRunning()); frame_sink_.SendCopyOutputResult(frame_sink_.num_copy_results() - 1); ++num_completed_captures; - ASSERT_EQ(num_completed_captures, consumer2->num_frames_received()); - EXPECT_THAT(consumer2->TakeFrame(consumer2->num_frames_received() - 1), + ASSERT_EQ(num_completed_captures, consumer2.num_frames_received()); + EXPECT_THAT(consumer2.TakeFrame(consumer2.num_frames_received() - 1), IsLetterboxedFrame(color2)); } - capturer_.Stop(); + StopCapture(); +} + +// Tests that refresh requests ultimately result in a frame being delivered to +// the consumer. +TEST_F(FrameSinkVideoCapturerTest, EventuallySendsARefreshFrame) { + frame_sink_.SetCopyOutputColor(YUVColor{0x80, 0x80, 0x80}); + EXPECT_CALL(frame_sink_manager_, FindCapturableFrameSink(kFrameSinkId)) + .WillRepeatedly(Return(&frame_sink_)); + + capturer_.ChangeTarget(kFrameSinkId); + + MockConsumer consumer; + const int num_refresh_frames = 2; // Initial, plus later refresh. + const int num_update_frames = 3; + EXPECT_CALL(consumer, OnFrameCapturedMock(_, _, _)) + .Times(num_refresh_frames + num_update_frames); + EXPECT_CALL(consumer, OnTargetLost(_)).Times(0); + EXPECT_CALL(consumer, OnStopped()).Times(1); + StartCapture(&consumer); + + // To start, the capturer will make a copy request for the initial refresh + // frame. Simulate a copy result and expect to see the refresh frame delivered + // to the consumer. The capturer should not have started the retry timer for + // this initial refresh frame. + ASSERT_EQ(1, frame_sink_.num_copy_results()); + EXPECT_FALSE(IsRefreshRetryTimerRunning()); + frame_sink_.SendCopyOutputResult(0); + ASSERT_EQ(1, consumer.num_frames_received()); + consumer.SendDoneNotification(0); + + // Drive the capturer pipeline for a series of frame composites. + int num_frames = 1 + num_update_frames; + for (int i = 1; i < num_frames; ++i) { + AdvanceClockToNextVsync(); + NotifyBeginFrame(i); + NotifyFrameDamaged(i); + ASSERT_EQ(i + 1, frame_sink_.num_copy_results()); + frame_sink_.SendCopyOutputResult(i); + ASSERT_EQ(i + 1, consumer.num_frames_received()); + consumer.SendDoneNotification(i); + } + + // Without advancing the clock, request a refresh frame. The oracle will + // reject the request, and the retry timer will be started. + capturer_.RequestRefreshFrame(); + ASSERT_EQ(num_frames, frame_sink_.num_copy_results()); + EXPECT_TRUE(IsRefreshRetryTimerRunning()); + + // Simulate the elapse of time and the firing of the refresh retry timer. The + // oracle should allow this later retry request and deliver a refresh frame. + clock_.Advance(FrameSinkVideoCapturerImpl::kRefreshFrameRetryInterval); + FireRefreshRetryTimer(); + if (frame_sink_.num_copy_results() == num_frames + 1) { + frame_sink_.SendCopyOutputResult(num_frames); + } else { + // No copy request was made, because the implementation successfully + // resurrected the buffer from the prior capture. + } + ASSERT_EQ(num_frames, consumer.num_frames_received()); + EXPECT_FALSE(IsRefreshRetryTimerRunning()); + + StopCapture(); } } // namespace viz
diff --git a/components/viz/service/frame_sinks/video_capture/frame_sink_video_consumer.h b/components/viz/service/frame_sinks/video_capture/frame_sink_video_consumer.h deleted file mode 100644 index 180de660..0000000 --- a/components/viz/service/frame_sinks/video_capture/frame_sink_video_consumer.h +++ /dev/null
@@ -1,48 +0,0 @@ -// Copyright 2017 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_VIZ_SERVICE_FRAME_SINKS_VIDEO_CAPTURE_FRAME_SINK_VIDEO_CONSUMER_H_ -#define COMPONENTS_VIZ_SERVICE_FRAME_SINKS_VIDEO_CAPTURE_FRAME_SINK_VIDEO_CONSUMER_H_ - -#include <memory> - -#include "base/memory/ref_counted.h" - -namespace gfx { -class Rect; -} // namespace gfx - -namespace media { -class VideoFrame; -} // namespace media - -namespace viz { - -class FrameSinkId; -class InFlightFrameDelivery; - -// TODO(crbug.com/754872): This is a temporary placeholder; to be replaced with -// a mojo-IDL-generated interface. -class FrameSinkVideoConsumer { - public: - virtual ~FrameSinkVideoConsumer() = default; - - // Called to deliver each frame. - virtual void OnFrameCaptured( - scoped_refptr<media::VideoFrame> frame, - const gfx::Rect& update_rect, - std::unique_ptr<InFlightFrameDelivery> delivery) = 0; - - // Indicates the video capture target (a frame sink) has gone away. A consumer - // should use this to determine whether to change to a different target or - // shutdown. - virtual void OnTargetLost(const FrameSinkId& frame_sink_id) = 0; - - // Indicates that OnFrameCaptured() will not be called again. - virtual void OnStopped() = 0; -}; - -} // namespace viz - -#endif // COMPONENTS_VIZ_SERVICE_FRAME_SINKS_VIDEO_CAPTURE_FRAME_SINK_VIDEO_CONSUMER_H_
diff --git a/components/viz/service/frame_sinks/video_capture/in_flight_frame_delivery.h b/components/viz/service/frame_sinks/video_capture/in_flight_frame_delivery.h index 847d2a24..0e7ff88 100644 --- a/components/viz/service/frame_sinks/video_capture/in_flight_frame_delivery.h +++ b/components/viz/service/frame_sinks/video_capture/in_flight_frame_delivery.h
@@ -8,25 +8,24 @@ #include "base/callback.h" #include "base/macros.h" #include "components/viz/service/viz_service_export.h" +#include "services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom.h" namespace viz { // Represents an in-flight frame delivery to the consumer. Its main purpose is // to proxy callbacks from the consumer back to the relevant capturer // components owned and operated by FrameSinkVideoCapturerImpl. -// -// TODO(crbug.com/754872): This will extend a mojo-generated interface in an -// upcoming change. -class VIZ_SERVICE_EXPORT InFlightFrameDelivery { +class VIZ_SERVICE_EXPORT InFlightFrameDelivery + : public mojom::FrameSinkVideoConsumerFrameCallbacks { public: InFlightFrameDelivery(base::OnceClosure post_delivery_callback, base::OnceCallback<void(double)> feedback_callback); - virtual ~InFlightFrameDelivery(); + ~InFlightFrameDelivery() final; - // TODO(crbug.com/754872): mojom::FrameSinkVideoFrameCallbacks implementation: - void Done(); - void ProvideFeedback(double utilization); + // mojom::FrameSinkVideoConsumerFrameCallbacks implementation: + void Done() final; + void ProvideFeedback(double utilization) final; private: base::OnceClosure post_delivery_callback_;
diff --git a/components/viz/service/gl/gpu_service_impl.cc b/components/viz/service/gl/gpu_service_impl.cc index f042c958..b169325 100644 --- a/components/viz/service/gl/gpu_service_impl.cc +++ b/components/viz/service/gl/gpu_service_impl.cc
@@ -27,7 +27,6 @@ #include "gpu/config/gpu_util.h" #include "gpu/ipc/common/gpu_memory_buffer_support.h" #include "gpu/ipc/common/memory_stats.h" -#include "gpu/ipc/gpu_in_process_thread_service.h" #include "gpu/ipc/service/gpu_channel.h" #include "gpu/ipc/service/gpu_channel_manager.h" #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
diff --git a/components/viz/service/main/BUILD.gn b/components/viz/service/main/BUILD.gn index 79f8996..3c29166 100644 --- a/components/viz/service/main/BUILD.gn +++ b/components/viz/service/main/BUILD.gn
@@ -18,7 +18,7 @@ deps = [ "//cc", "//components/viz/service", - "//gpu/ipc:command_buffer", + "//gpu/ipc:gl_in_process_context", "//gpu/ipc/common", "//gpu/ipc/common:gpu_preferences_util", "//gpu/ipc/service",
diff --git a/components/viz/test/test_frame_sink_manager.h b/components/viz/test/test_frame_sink_manager.h index 25eb40af..79c2d484 100644 --- a/components/viz/test/test_frame_sink_manager.h +++ b/components/viz/test/test_frame_sink_manager.h
@@ -49,6 +49,8 @@ void DropTemporaryReference(const SurfaceId& surface_id) override {} void AddVideoDetectorObserver( mojom::VideoDetectorObserverPtr observer) override {} + void CreateVideoCapturer( + mojom::FrameSinkVideoCapturerRequest request) override {} mojo::Binding<mojom::FrameSinkManager> binding_; mojom::FrameSinkManagerClientPtr client_;
diff --git a/components/viz/test/test_layer_tree_frame_sink.cc b/components/viz/test/test_layer_tree_frame_sink.cc index 14064fc..68283199 100644 --- a/components/viz/test/test_layer_tree_frame_sink.cc +++ b/components/viz/test/test_layer_tree_frame_sink.cc
@@ -96,8 +96,8 @@ } display_ = std::make_unique<Display>( - shared_bitmap_manager(), gpu_memory_buffer_manager(), renderer_settings_, - frame_sink_id_, std::move(display_output_surface), std::move(scheduler), + shared_bitmap_manager(), renderer_settings_, frame_sink_id_, + std::move(display_output_surface), std::move(scheduler), compositor_task_runner_); constexpr bool is_root = false;
diff --git a/content/app/BUILD.gn b/content/app/BUILD.gn index 499a0d2b..d77f1ad 100644 --- a/content/app/BUILD.gn +++ b/content/app/BUILD.gn
@@ -124,7 +124,10 @@ "android/library_loader_hooks.cc", "android/library_loader_hooks.h", ] - deps += [ "//mojo/android:libsystem_java" ] + deps += [ + "//mojo/android:libsystem_java", + "//ui/gl", + ] } else { sources += [ "content_main.cc" ] }
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index d7856938..090857e 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc
@@ -29,7 +29,6 @@ #include "base/macros.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram_base.h" -#include "base/metrics/statistics_recorder.h" #include "base/path_service.h" #include "base/process/launch.h" #include "base/process/memory.h" @@ -462,6 +461,14 @@ Shutdown(); } + int TerminateForFatalInitializationError() { + if (delegate_) + return delegate_->TerminateForFatalInitializationError(); + + CHECK(false); + return 0; + } + int Initialize(const ContentMainParams& params) override { ui_task_ = params.ui_task; @@ -620,17 +627,18 @@ int icudata_fd = g_fds->MaybeGet(kAndroidICUDataDescriptor); if (icudata_fd != -1) { auto icudata_region = g_fds->GetRegion(kAndroidICUDataDescriptor); - CHECK(base::i18n::InitializeICUWithFileDescriptor(icudata_fd, - icudata_region)); + if (!base::i18n::InitializeICUWithFileDescriptor(icudata_fd, + icudata_region)) + return TerminateForFatalInitializationError(); } else { - CHECK(base::i18n::InitializeICU()); + if (!base::i18n::InitializeICU()) + return TerminateForFatalInitializationError(); } #else - CHECK(base::i18n::InitializeICU()); + if (!base::i18n::InitializeICU()) + return TerminateForFatalInitializationError(); #endif // OS_ANDROID && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE) - base::StatisticsRecorder::Initialize(); - InitializeV8IfNeeded(command_line, process_type); #if !defined(OFFICIAL_BUILD) @@ -655,9 +663,10 @@ delegate_->PreSandboxStartup(); #if defined(OS_WIN) - CHECK(InitializeSandbox( - service_manager::SandboxTypeFromCommandLine(command_line), - params.sandbox_info)); + if (!InitializeSandbox( + service_manager::SandboxTypeFromCommandLine(command_line), + params.sandbox_info)) + return TerminateForFatalInitializationError(); #elif defined(OS_MACOSX) // Do not initialize the sandbox at this point if the V2 // sandbox is enabled for the process type. @@ -670,7 +679,8 @@ // On OS X the renderer sandbox needs to be initialized later in the // startup sequence in RendererMainPlatformDelegate::EnableSandbox(). } else { - CHECK(InitializeSandbox()); + if (!InitializeSandbox()) + return TerminateForFatalInitializationError(); } #endif
diff --git a/content/app/strings/content_strings.grd b/content/app/strings/content_strings.grd index 6c96f6c6..f8f5134 100644 --- a/content/app/strings/content_strings.grd +++ b/content/app/strings/content_strings.grd
@@ -794,9 +794,6 @@ <message name="IDS_MEDIA_OVERFLOW_MENU_EXIT_FULLSCREEN" desc="Media controls overflow menu item label for a button to exit fullscreen."> Exit fullscreen </message> - <message name="IDS_MEDIA_OVERFLOW_MENU_STOP_CAST" desc="Media controls overflow menu item label for a button to stop casting."> - Stop casting - </message> <message name="IDS_MEDIA_OVERFLOW_MENU_MUTE" desc="Media controls overflow menu item label for a mute button."> Mute </message>
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn index 8ed5261..cd5af16 100644 --- a/content/browser/BUILD.gn +++ b/content/browser/BUILD.gn
@@ -1448,6 +1448,8 @@ "sandbox_ipc_linux.h", "sandbox_parameters_mac.h", "sandbox_parameters_mac.mm", + "scoped_active_url.cc", + "scoped_active_url.h", "screen_orientation/screen_orientation_provider.cc", "screen_orientation/screen_orientation_provider.h", "service_manager/common_browser_interfaces.cc", @@ -2112,6 +2114,7 @@ "//media/capture/content/android", "//media/capture/video/android", "//ui/android", + "//ui/compositor", ] defines += [ "APPCACHE_USE_SIMPLE_CACHE", @@ -2150,33 +2153,12 @@ "speech/speech_recognizer_impl.h", # Most webauth code is non-Android - "webauth/attestation_object.cc", - "webauth/attestation_object.h", - "webauth/attestation_statement.cc", - "webauth/attestation_statement.h", - "webauth/attested_credential_data.cc", - "webauth/attested_credential_data.h", - "webauth/authenticator_data.cc", - "webauth/authenticator_data.h", "webauth/authenticator_impl.cc", "webauth/authenticator_impl.h", - "webauth/authenticator_utils.cc", - "webauth/authenticator_utils.h", "webauth/collected_client_data.cc", "webauth/collected_client_data.h", - "webauth/ec_public_key.cc", - "webauth/ec_public_key.h", - "webauth/fido_attestation_statement.cc", - "webauth/fido_attestation_statement.h", - "webauth/public_key.cc", - "webauth/public_key.h", - "webauth/register_response_data.cc", - "webauth/register_response_data.h", ] - deps += [ - "//components/cbor", - "//third_party/flac", - ] + deps += [ "//third_party/flac" ] } if (is_mac) {
diff --git a/content/browser/android/overscroll_controller_android_unittest.cc b/content/browser/android/overscroll_controller_android_unittest.cc index 21b2012a..7b54a161 100644 --- a/content/browser/android/overscroll_controller_android_unittest.cc +++ b/content/browser/android/overscroll_controller_android_unittest.cc
@@ -33,6 +33,7 @@ class MockCompositor : public WindowAndroidCompositor { public: + virtual ~MockCompositor() {} void AttachLayerForReadback(scoped_refptr<cc::Layer>) override {} void RequestCopyOfOutputOnRootLayer( std::unique_ptr<viz::CopyOutputRequest>) override {} @@ -41,6 +42,11 @@ MOCK_METHOD0(GetFrameSinkId, viz::FrameSinkId()); void AddChildFrameSink(const viz::FrameSinkId& frame_sink_id) override {} void RemoveChildFrameSink(const viz::FrameSinkId& frame_sink_id) override {} + std::unique_ptr<ui::CompositorLock> GetCompositorLock( + ui::CompositorLockClient* client, + base::TimeDelta timeout) override { + return nullptr; + } }; class MockGlowClient : public OverscrollGlowClient {
diff --git a/content/browser/bad_message.h b/content/browser/bad_message.h index cc3a0206..4d08e3f 100644 --- a/content/browser/bad_message.h +++ b/content/browser/bad_message.h
@@ -217,6 +217,8 @@ AIRH_UNEXPECTED_BITSTREAM = 190, ARH_UNEXPECTED_BITSTREAM = 191, RDH_NULL_CLIENT = 192, + RVH_WEB_UI_BINDINGS_MISMATCH = 193, + WCI_NEW_WIDGET_PROCESS_MISMATCH = 194, // Please add new elements here. The naming convention is abbreviated class // name (e.g. RenderFrameHost becomes RFH) plus a unique description of the
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 451e7d2..80790c3 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc
@@ -1510,13 +1510,9 @@ transport_factory->ConnectHostFrameSinkManager(); ImageTransportFactory::SetFactory(std::move(transport_factory)); } else { - // TODO(crbug.com/676384): Remove flag along with surface sequences. - auto surface_lifetime_type = - parsed_command_line_.HasSwitch(switches::kDisableSurfaceReferences) - ? viz::SurfaceManager::LifetimeType::SEQUENCES - : viz::SurfaceManager::LifetimeType::REFERENCES; frame_sink_manager_impl_ = std::make_unique<viz::FrameSinkManagerImpl>( - surface_lifetime_type, switches::GetDeadlineToSynchronizeSurfaces()); + viz::SurfaceManager::LifetimeType::REFERENCES, + switches::GetDeadlineToSynchronizeSurfaces()); surface_utils::ConnectWithLocalFrameSinkManager( host_frame_sink_manager_.get(), frame_sink_manager_impl_.get());
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc index 8d4aca9..f959968f 100644 --- a/content/browser/browser_main_runner.cc +++ b/content/browser/browser_main_runner.cc
@@ -8,11 +8,11 @@ #include "base/command_line.h" #include "base/debug/debugger.h" #include "base/debug/leak_annotations.h" +#include "base/lazy_instance.h" #include "base/logging.h" #include "base/macros.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_macros.h" -#include "base/metrics/statistics_recorder.h" #include "base/run_loop.h" #include "base/time/time.h" #include "base/trace_event/heap_profiler_allocation_context_tracker.h" @@ -80,8 +80,6 @@ if (parameters.command_line.HasSwitch(switches::kBrowserStartupDialog)) WaitForDebugger("Browser"); - base::StatisticsRecorder::Initialize(); - notification_service_.reset(new NotificationServiceImpl); #if defined(OS_WIN)
diff --git a/content/browser/browser_side_navigation_browsertest.cc b/content/browser/browser_side_navigation_browsertest.cc index 702c5d91..9416f4c51 100644 --- a/content/browser/browser_side_navigation_browsertest.cc +++ b/content/browser/browser_side_navigation_browsertest.cc
@@ -348,8 +348,7 @@ // Revoke the access to the file and submit the form. The renderer process // should be terminated. - RenderProcessHostWatcher process_exit_observer( - rfh->GetProcess(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter process_kill_waiter(rfh->GetProcess()); ChildProcessSecurityPolicyImpl* security_policy = ChildProcessSecurityPolicyImpl::GetInstance(); security_policy->RevokeAllPermissionsForFile(rfh->GetProcess()->GetID(), @@ -366,7 +365,7 @@ "document.getElementById('file-form').submit();", &result)); EXPECT_TRUE(result); - process_exit_observer.Wait(); + EXPECT_EQ(bad_message::RFH_ILLEGAL_UPLOAD_PARAMS, process_kill_waiter.Wait()); } // Test case to verify that redirects to data: URLs are properly disallowed, @@ -476,12 +475,11 @@ // Receiving the invalid IPC message should lead to renderer process // termination. - RenderProcessHostWatcher process_exit_observer( - rfh->GetProcess(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); - + RenderProcessHostKillWaiter process_kill_waiter(rfh->GetProcess()); rfh->frame_host_binding_for_testing().impl()->BeginNavigation( common_params, std::move(begin_params)); - process_exit_observer.Wait(); + EXPECT_EQ(bad_message::RFH_BASE_URL_FOR_DATA_URL_SPECIFIED, + process_kill_waiter.Wait()); EXPECT_FALSE(ChildProcessSecurityPolicyImpl::GetInstance()->CanReadFile( rfh->GetProcess()->GetID(), file_path)); @@ -780,4 +778,27 @@ } } +// Data URLs can have a reference fragment like any other URLs. This test makes +// sure it is taken into account. +IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest, + DataURLWithReferenceFragment) { + GURL url("data:text/html,body#foo"); + EXPECT_TRUE(NavigateToURL(shell(), url)); + + std::string body; + EXPECT_TRUE(ExecuteScriptAndExtractString( + shell(), + "window.domAutomationController.send(document.body.textContent);", + &body)); + // TODO(arthursonzogni): This is wrong. The correct value for |body| is + // "body", not "body#foo". See https://crbug.com/123004. + EXPECT_EQ("body#foo", body); + + std::string reference_fragment; + EXPECT_TRUE(ExecuteScriptAndExtractString( + shell(), "window.domAutomationController.send(location.hash);", + &reference_fragment)); + EXPECT_EQ("#foo", reference_fragment); +} + } // namespace content
diff --git a/content/browser/child_process_launcher_helper.cc b/content/browser/child_process_launcher_helper.cc index b2c150c4..d5471c5 100644 --- a/content/browser/child_process_launcher_helper.cc +++ b/content/browser/child_process_launcher_helper.cc
@@ -100,14 +100,15 @@ bool is_synchronous_launch = true; int launch_result = LAUNCH_RESULT_FAILURE; base::LaunchOptions options; - BeforeLaunchOnLauncherThread(*files_to_register, &options); - Process process = LaunchProcessOnLauncherThread(options, - std::move(files_to_register), - &is_synchronous_launch, - &launch_result); + Process process; + if (BeforeLaunchOnLauncherThread(*files_to_register, &options)) { + process = + LaunchProcessOnLauncherThread(options, std::move(files_to_register), + &is_synchronous_launch, &launch_result); - AfterLaunchOnLauncherThread(process, options); + AfterLaunchOnLauncherThread(process, options); + } if (is_synchronous_launch) { PostLaunchOnLauncherThread(std::move(process), launch_result);
diff --git a/content/browser/child_process_launcher_helper.h b/content/browser/child_process_launcher_helper.h index 887af8e..deb6d68 100644 --- a/content/browser/child_process_launcher_helper.h +++ b/content/browser/child_process_launcher_helper.h
@@ -108,8 +108,11 @@ // Platform specific. std::unique_ptr<FileMappedForLaunch> GetFilesToMap(); - // Platform specific. - void BeforeLaunchOnLauncherThread( + // Platform specific, returns success or failure. If failure is returned, + // LaunchOnLauncherThread will not call LaunchProcessOnLauncherThread and + // AfterLaunchOnLauncherThread, and the launch_result will be reported as + // LAUNCH_RESULT_FAILURE. + bool BeforeLaunchOnLauncherThread( const FileMappedForLaunch& files_to_register, base::LaunchOptions* options);
diff --git a/content/browser/child_process_launcher_helper_android.cc b/content/browser/child_process_launcher_helper_android.cc index d25fe75..345bc4dd 100644 --- a/content/browser/child_process_launcher_helper_android.cc +++ b/content/browser/child_process_launcher_helper_android.cc
@@ -84,9 +84,11 @@ return files_to_register; } -void ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( +bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( const PosixFileDescriptorInfo& files_to_register, - base::LaunchOptions* options) {} + base::LaunchOptions* options) { + return true; +} ChildProcessLauncherHelper::Process ChildProcessLauncherHelper::LaunchProcessOnLauncherThread(
diff --git a/content/browser/child_process_launcher_helper_fuchsia.cc b/content/browser/child_process_launcher_helper_fuchsia.cc index 33acb2c..6d5e6ca 100644 --- a/content/browser/child_process_launcher_helper_fuchsia.cc +++ b/content/browser/child_process_launcher_helper_fuchsia.cc
@@ -69,7 +69,7 @@ return std::unique_ptr<FileMappedForLaunch>(); } -void ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( +bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( const PosixFileDescriptorInfo& files_to_register, base::LaunchOptions* options) { DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); @@ -78,6 +78,8 @@ mojo_client_handle(), command_line(), &options->handles_to_transfer); UpdateLaunchOptionsForSandbox(delegate_->GetSandboxType(), options); + + return true; } ChildProcessLauncherHelper::Process
diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc index 1de3bfc..ffd7cc3 100644 --- a/content/browser/child_process_launcher_helper_linux.cc +++ b/content/browser/child_process_launcher_helper_linux.cc
@@ -41,7 +41,7 @@ GetProcessType(), command_line()); } -void ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( +bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( const PosixFileDescriptorInfo& files_to_register, base::LaunchOptions* options) { // Convert FD mapping to FileHandleMappingVector @@ -57,6 +57,8 @@ } options->environ = delegate_->GetEnvironment(); + + return true; } ChildProcessLauncherHelper::Process
diff --git a/content/browser/child_process_launcher_helper_mac.cc b/content/browser/child_process_launcher_helper_mac.cc index 5bf86c11..44ac3507 100644 --- a/content/browser/child_process_launcher_helper_mac.cc +++ b/content/browser/child_process_launcher_helper_mac.cc
@@ -21,6 +21,7 @@ #include "content/public/common/sandboxed_process_launcher_delegate.h" #include "mojo/edk/embedder/scoped_platform_handle.h" #include "sandbox/mac/seatbelt_exec.h" +#include "services/service_manager/sandbox/mac/cdm.sb.h" #include "services/service_manager/sandbox/mac/common_v2.sb.h" #include "services/service_manager/sandbox/mac/ppapi_v2.sb.h" #include "services/service_manager/sandbox/mac/renderer_v2.sb.h" @@ -50,7 +51,7 @@ command_line()); } -void ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( +bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( const FileMappedForLaunch& files_to_register, base::LaunchOptions* options) { // Convert FD mapping to FileHandleMappingVector. @@ -65,9 +66,17 @@ bool no_sandbox = command_line_->HasSwitch(switches::kNoSandbox) || service_manager::IsUnsandboxedSandboxType(sandbox_type); - bool v2_process = sandbox_type == service_manager::SANDBOX_TYPE_PPAPI || - sandbox_type == service_manager::SANDBOX_TYPE_RENDERER || - sandbox_type == service_manager::SANDBOX_TYPE_UTILITY; + bool v2_process = false; + switch (sandbox_type) { + case service_manager::SANDBOX_TYPE_CDM: + case service_manager::SANDBOX_TYPE_PPAPI: + case service_manager::SANDBOX_TYPE_RENDERER: + case service_manager::SANDBOX_TYPE_UTILITY: + v2_process = true; + break; + default: + break; + } bool use_v2 = v2_process && base::FeatureList::IsEnabled(features::kMacV2Sandbox); @@ -77,12 +86,21 @@ std::string profile = std::string(service_manager::kSeatbeltPolicyString_common_v2); - if (sandbox_type == service_manager::SANDBOX_TYPE_PPAPI) { - profile += service_manager::kSeatbeltPolicyString_ppapi_v2; - } else if (sandbox_type == service_manager::SANDBOX_TYPE_RENDERER) { - profile += service_manager::kSeatbeltPolicyString_renderer_v2; - } else if (sandbox_type == service_manager::SANDBOX_TYPE_UTILITY) { - profile += service_manager::kSeatbeltPolicyString_utility; + switch (sandbox_type) { + case service_manager::SANDBOX_TYPE_CDM: + profile += service_manager::kSeatbeltPolicyString_cdm; + break; + case service_manager::SANDBOX_TYPE_PPAPI: + profile += service_manager::kSeatbeltPolicyString_ppapi_v2; + break; + case service_manager::SANDBOX_TYPE_RENDERER: + profile += service_manager::kSeatbeltPolicyString_renderer_v2; + break; + case service_manager::SANDBOX_TYPE_UTILITY: + profile += service_manager::kSeatbeltPolicyString_utility; + break; + default: + NOTREACHED(); } // Disable os logging to com.apple.diagnosticd which is a performance @@ -98,9 +116,15 @@ } else if (sandbox_type == service_manager::SANDBOX_TYPE_UTILITY) { SetupUtilitySandboxParameters(seatbelt_exec_client_.get(), *command_line_.get()); + } else if (sandbox_type == service_manager::SANDBOX_TYPE_CDM) { + SetupCDMSandboxParameters(seatbelt_exec_client_.get()); } int pipe = seatbelt_exec_client_->SendProfileAndGetFD(); + if (pipe < 0) { + LOG(ERROR) << "pipe for sending sandbox profile is an invalid FD"; + return false; + } base::FilePath helper_executable; CHECK(PathService::Get(content::CHILD_PROCESS_EXE, &helper_executable)); @@ -126,6 +150,8 @@ // Make sure the MachBroker is running, and inform it to expect a check-in // from the new process. broker->EnsureRunning(); + + return true; } ChildProcessLauncherHelper::Process
diff --git a/content/browser/child_process_launcher_helper_win.cc b/content/browser/child_process_launcher_helper_win.cc index 3bbe1f4..b9183469 100644 --- a/content/browser/child_process_launcher_helper_win.cc +++ b/content/browser/child_process_launcher_helper_win.cc
@@ -43,10 +43,11 @@ return std::unique_ptr<FileMappedForLaunch>(); } -void ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( +bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread( const FileMappedForLaunch& files_to_register, base::LaunchOptions* options) { DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); + return true; } ChildProcessLauncherHelper::Process
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc index e27f75b..edb5adcf 100644 --- a/content/browser/compositor/gpu_process_transport_factory.cc +++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -199,8 +199,7 @@ viz::CompositingModeReporterImpl* compositing_mode_reporter, scoped_refptr<base::SingleThreadTaskRunner> resize_task_runner) : frame_sink_id_allocator_(kDefaultClientId), - renderer_settings_(viz::CreateRendererSettings( - CreateBufferUsageAndFormatExceptionList())), + renderer_settings_(viz::CreateRendererSettings()), resize_task_runner_(std::move(resize_task_runner)), task_graph_runner_(new cc::SingleThreadTaskGraphRunner), gpu_channel_factory_(gpu_channel_factory), @@ -625,10 +624,9 @@ // The Display owns and uses the |display_output_surface| created above. data->display = std::make_unique<viz::Display>( - viz::ServerSharedBitmapManager::current(), GetGpuMemoryBufferManager(), - renderer_settings_, compositor->frame_sink_id(), - std::move(display_output_surface), std::move(scheduler), - compositor->task_runner()); + viz::ServerSharedBitmapManager::current(), renderer_settings_, + compositor->frame_sink_id(), std::move(display_output_surface), + std::move(scheduler), compositor->task_runner()); data->display_client = std::make_unique<InProcessDisplayClient>(compositor->widget()); GetFrameSinkManager()->RegisterBeginFrameSource(begin_frame_source,
diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc index 75ee4ab..d9cb981 100644 --- a/content/browser/compositor/viz_process_transport_factory.cc +++ b/content/browser/compositor/viz_process_transport_factory.cc
@@ -93,8 +93,7 @@ forwarding_mode_reporter_(forwarding_mode_reporter), frame_sink_id_allocator_(kBrowserClientId), task_graph_runner_(std::make_unique<cc::SingleThreadTaskGraphRunner>()), - renderer_settings_(viz::CreateRendererSettings( - CreateBufferUsageAndFormatExceptionList())), + renderer_settings_(viz::CreateRendererSettings()), compositing_mode_watcher_binding_(this), weak_ptr_factory_(this) { DCHECK(gpu_channel_establish_factory_);
diff --git a/content/browser/cross_site_transfer_browsertest.cc b/content/browser/cross_site_transfer_browsertest.cc index 96b2a9f9..c7ff817 100644 --- a/content/browser/cross_site_transfer_browsertest.cc +++ b/content/browser/cross_site_transfer_browsertest.cc
@@ -564,16 +564,14 @@ target_contents->GetMainFrame()->GetProcess()->GetID(), file_path)); // Submit the form and wait until the malicious renderer gets killed. - RenderProcessHostWatcher process_exit_observer( - form_contents->GetMainFrame()->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter( + form_contents->GetMainFrame()->GetProcess()); EXPECT_TRUE(ExecuteScript( form_contents, "setTimeout(\n" " function() { document.getElementById('file-form').submit(); },\n" " 0);")); - process_exit_observer.Wait(); - EXPECT_FALSE(process_exit_observer.did_exit_normally()); + EXPECT_EQ(bad_message::RFPH_ILLEGAL_UPLOAD_PARAMS, kill_waiter.Wait()); // The target frame should still be at the original location - the malicious // navigation should have been stopped.
diff --git a/content/browser/device_sensors/device_sensor_browsertest.cc b/content/browser/device_sensors/device_sensor_browsertest.cc index 54171a1..bb4b9cc 100644 --- a/content/browser/device_sensors/device_sensor_browsertest.cc +++ b/content/browser/device_sensors/device_sensor_browsertest.cc
@@ -420,7 +420,7 @@ // Disabled due to flakiness: https://crbug.com/783891 IN_PROC_BROWSER_TEST_F(DeviceSensorBrowserTest, - DISABLED_MotionOnlySomeSensorsAreAvailableTest) { + MotionOnlySomeSensorsAreAvailableTest) { // The test page registers an event handler for motion events and // expects to get an event with only the gyroscope and linear acceleration // sensor values, because no accelerometer values can be provided.
diff --git a/content/browser/devtools/devtools_agent_host_impl.cc b/content/browser/devtools/devtools_agent_host_impl.cc index 0416602..acc46f7ee 100644 --- a/content/browser/devtools/devtools_agent_host_impl.cc +++ b/content/browser/devtools/devtools_agent_host_impl.cc
@@ -150,16 +150,18 @@ int cert_error, const GURL& request_url, CertErrorCallback callback) { - DevToolsAgentHost* agent_host = + scoped_refptr<DevToolsAgentHost> agent_host = DevToolsAgentHost::GetOrCreateFor(web_contents).get(); - if (NotifyCertificateError(agent_host, cert_error, request_url, callback)) { + if (NotifyCertificateError(agent_host.get(), cert_error, request_url, + callback)) { // Only allow a single agent host to handle the error. callback.Reset(); } - for (scoped_refptr<DevToolsAgentHost> agent_host : GetBrowserAgentHosts()) { - if (NotifyCertificateError(agent_host.get(), cert_error, request_url, - callback)) { + for (scoped_refptr<DevToolsAgentHost> browser_agent_host : + GetBrowserAgentHosts()) { + if (NotifyCertificateError(browser_agent_host.get(), cert_error, + request_url, callback)) { // Only allow a single agent host to handle the error. callback.Reset(); }
diff --git a/content/browser/devtools/devtools_url_interceptor_request_job.cc b/content/browser/devtools/devtools_url_interceptor_request_job.cc index 2083531..3e905ba 100644 --- a/content/browser/devtools/devtools_url_interceptor_request_job.cc +++ b/content/browser/devtools/devtools_url_interceptor_request_job.cc
@@ -71,7 +71,7 @@ devtools_interceptor_request_job_; // NOT OWNED. DevToolsURLRequestInterceptor* const interceptor_; - bool fetch_in_progress_; + bool was_cancelled_; }; DevToolsURLInterceptorRequestJob::SubRequest::SubRequest( @@ -80,7 +80,7 @@ DevToolsURLRequestInterceptor* interceptor) : devtools_interceptor_request_job_(devtools_interceptor_request_job), interceptor_(interceptor), - fetch_in_progress_(true) { + was_cancelled_(false) { DCHECK_CURRENTLY_ON(BrowserThread::IO); net::NetworkTrafficAnnotationTag traffic_annotation = net::DefineNetworkTrafficAnnotation("devtools_interceptor", R"( @@ -155,16 +155,15 @@ DevToolsURLInterceptorRequestJob::SubRequest::~SubRequest() { DCHECK_CURRENTLY_ON(BrowserThread::IO); - fetch_in_progress_ = false; interceptor_->UnregisterSubRequest(request_.get()); } void DevToolsURLInterceptorRequestJob::SubRequest::Cancel() { DCHECK_CURRENTLY_ON(BrowserThread::IO); - if (!fetch_in_progress_) + if (was_cancelled_) return; - fetch_in_progress_ = false; + was_cancelled_ = true; request_->Cancel(); } @@ -204,7 +203,7 @@ DCHECK_NE(bytes_read, net::ERR_IO_PENDING); // OnReadCompleted may get called while canceling the subrequest, in that // event theres no need to call ReadRawDataComplete. - if (fetch_in_progress_) + if (!was_cancelled_) devtools_interceptor_request_job_->ReadRawDataComplete(bytes_read); } @@ -243,8 +242,8 @@ void FetchResponseBody(); private: - void OnDataChunkRead(int result); - bool ShouldContinueRead(); + // |this| may be deleted if this method returns false. + bool ProcessChunkRead(int result); void ReadIntoBuffer(); scoped_refptr<net::GrowableIOBuffer> response_buffer_; @@ -288,17 +287,11 @@ // OnReadComplete may be called while request is being cancelled, in this // event the result should be |net::ERR_ABORTED| which should complete any // |pending_body_requests_|. - OnDataChunkRead(result); - if (ShouldContinueRead()) + if (ProcessChunkRead(result)) ReadIntoBuffer(); } -bool DevToolsURLInterceptorRequestJob::InterceptedRequest:: - ShouldContinueRead() { - return fetch_in_progress_ && read_response_result_ == net::ERR_IO_PENDING; -} - -void DevToolsURLInterceptorRequestJob::InterceptedRequest::OnDataChunkRead( +bool DevToolsURLInterceptorRequestJob::InterceptedRequest::ProcessChunkRead( int result) { DCHECK_CURRENTLY_ON(BrowserThread::IO); DCHECK_NE(result, net::ERR_IO_PENDING); @@ -320,8 +313,9 @@ if (read_response_result_ != net::ERR_IO_PENDING) { devtools_interceptor_request_job_->OnInterceptedRequestResponseReady( *response_buffer_.get(), read_response_result_); - return; + return false; } + return true; } int DevToolsURLInterceptorRequestJob::InterceptedRequest::Read( @@ -346,7 +340,7 @@ } return; } - if (!fetch_in_progress_) { + if (was_cancelled_) { // Cannot request body on cancelled request. devtools_interceptor_request_job_->OnInterceptedRequestResponseReady( *response_buffer_.get(), net::ERR_ABORTED); @@ -360,16 +354,14 @@ void DevToolsURLInterceptorRequestJob::InterceptedRequest::ReadIntoBuffer() { // OnReadCompleted may get called while canceling the subrequest, in that // event we cannot call URLRequest::Read(). - DCHECK(fetch_in_progress_); - while (ShouldContinueRead()) { + DCHECK(!was_cancelled_); + int result; + do { if (response_buffer_->RemainingCapacity() == 0) response_buffer_->SetCapacity(response_buffer_->capacity() * 2); - int result = request_->Read(response_buffer_.get(), - response_buffer_->RemainingCapacity()); - if (result == net::ERR_IO_PENDING) - return; - OnDataChunkRead(result); - } + result = request_->Read(response_buffer_.get(), + response_buffer_->RemainingCapacity()); + } while (result != net::ERR_IO_PENDING && ProcessChunkRead(result)); } class DevToolsURLInterceptorRequestJob::MockResponseDetails {
diff --git a/content/browser/devtools/protocol/storage_handler.cc b/content/browser/devtools/protocol/storage_handler.cc index 32b8b5e..9e8d8d2 100644 --- a/content/browser/devtools/protocol/storage_handler.cc +++ b/content/browser/devtools/protocol/storage_handler.cc
@@ -57,11 +57,11 @@ std::unique_ptr<Array<Storage::UsageForType>> usageList = Array<Storage::UsageForType>::create(); - for (const auto& usage : usage_breakdown) { + for (const auto& specific_usage : usage_breakdown) { std::unique_ptr<Storage::UsageForType> entry = Storage::UsageForType::Create() - .SetStorageType(GetTypeName(usage.first)) - .SetUsage(usage.second) + .SetStorageType(GetTypeName(specific_usage.first)) + .SetUsage(specific_usage.second) .Build(); usageList->addItem(std::move(entry)); }
diff --git a/content/browser/devtools/protocol/tracing_handler.cc b/content/browser/devtools/protocol/tracing_handler.cc index 1fe34afc..e6026e1 100644 --- a/content/browser/devtools/protocol/tracing_handler.cc +++ b/content/browser/devtools/protocol/tracing_handler.cc
@@ -71,8 +71,8 @@ const base::ListValue* list = nullptr; if (value.GetAsList(&list)) { std::unique_ptr<base::ListValue> out_list(new base::ListValue()); - for (const auto& value : *list) - out_list->Append(ConvertDictKeyStyle(value)); + for (const auto& key : *list) + out_list->Append(ConvertDictKeyStyle(key)); return std::move(out_list); }
diff --git a/content/browser/dom_storage/dom_storage_area_unittest.cc b/content/browser/dom_storage/dom_storage_area_unittest.cc index b96f5cc..0bca1469 100644 --- a/content/browser/dom_storage/dom_storage_area_unittest.cc +++ b/content/browser/dom_storage/dom_storage_area_unittest.cc
@@ -241,8 +241,8 @@ base::ScopedTempDir temp_dir; const std::string kNamespaceId = "id1"; ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); - scoped_refptr<SessionStorageDatabase> db = - new SessionStorageDatabase(temp_dir.GetPath()); + scoped_refptr<SessionStorageDatabase> db = new SessionStorageDatabase( + temp_dir.GetPath(), base::ThreadTaskRunnerHandle::Get()); scoped_refptr<DOMStorageArea> area(new DOMStorageArea( 1, kNamespaceId, nullptr, kOrigin, db.get(), new MockDOMStorageTaskRunner(base::ThreadTaskRunnerHandle::Get().get())));
diff --git a/content/browser/dom_storage/dom_storage_context_impl.cc b/content/browser/dom_storage/dom_storage_context_impl.cc index adc1d1a..6187347 100644 --- a/content/browser/dom_storage/dom_storage_context_impl.cc +++ b/content/browser/dom_storage/dom_storage_context_impl.cc
@@ -461,7 +461,8 @@ DCHECK(namespaces_.empty()); if (!sessionstorage_directory_.empty()) { session_storage_database_ = new SessionStorageDatabase( - sessionstorage_directory_); + sessionstorage_directory_, task_runner_->GetSequencedTaskRunner( + DOMStorageTaskRunner::COMMIT_SEQUENCE)); } }
diff --git a/content/browser/dom_storage/session_storage_database.cc b/content/browser/dom_storage/session_storage_database.cc index 914e727..c27a11f 100644 --- a/content/browser/dom_storage/session_storage_database.cc +++ b/content/browser/dom_storage/session_storage_database.cc
@@ -100,16 +100,21 @@ SessionStorageDatabase* session_storage_database_; }; - -SessionStorageDatabase::SessionStorageDatabase(const base::FilePath& file_path) - : file_path_(file_path), +SessionStorageDatabase::SessionStorageDatabase( + const base::FilePath& file_path, + scoped_refptr<base::SequencedTaskRunner> commit_task_runner) + : RefCountedDeleteOnSequence<SessionStorageDatabase>( + std::move(commit_task_runner)), + file_path_(file_path), db_error_(false), is_inconsistent_(false), invalid_db_deleted_(false), operation_count_(0) { + DETACH_FROM_SEQUENCE(sequence_checker_); } SessionStorageDatabase::~SessionStorageDatabase() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); } void SessionStorageDatabase::ReadAreaValues( @@ -163,6 +168,7 @@ const GURL& origin, bool clear_all_first, const DOMStorageValuesMap& changes) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Even if |changes| is empty, we need to write the appropriate placeholders // in the database, so that it can be later shallow-copied successfully. if (!LazyOpen(true)) @@ -230,6 +236,7 @@ // | namespace-2- | dummy | // | namespace-2-origin1 | 1 (mapid) << references the same map + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!LazyOpen(true)) return false; DBOperation operation(this); @@ -257,6 +264,7 @@ bool SessionStorageDatabase::DeleteArea(const std::string& namespace_id, const GURL& origin) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!LazyOpen(false)) { // No need to create the database if it doesn't exist. return true; @@ -270,6 +278,7 @@ } bool SessionStorageDatabase::DeleteNamespace(const std::string& namespace_id) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); { // The caller should have called other methods to open the DB before this // function. Otherwise, DB stores nothing interesting related to the
diff --git a/content/browser/dom_storage/session_storage_database.h b/content/browser/dom_storage/session_storage_database.h index a7ea8ae..2141bc00 100644 --- a/content/browser/dom_storage/session_storage_database.h +++ b/content/browser/dom_storage/session_storage_database.h
@@ -17,6 +17,9 @@ #include "base/gtest_prod_util.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "base/memory/ref_counted_delete_on_sequence.h" +#include "base/sequence_checker.h" +#include "base/sequenced_task_runner.h" #include "base/synchronization/lock.h" #include "content/common/content_export.h" #include "content/common/dom_storage/dom_storage_types.h" @@ -42,13 +45,18 @@ // origins. All DOMStorageAreas for session storage share the same // SessionStorageDatabase. -// Only one thread is allowed to call the public functions other than -// ReadAreaValues and ReadNamespacesAndOrigins. Other threads are allowed to -// call ReadAreaValues and ReadNamespacesAndOrigins. -class CONTENT_EXPORT SessionStorageDatabase : - public base::RefCountedThreadSafe<SessionStorageDatabase> { +// This class is not thread safe. Read-only methods (ReadAreaValues, +// ReadNamespacesAndOrigins, and OnMemoryDump) may be called on any thread. +// Methods that modify the database must be called on the same thread. +class CONTENT_EXPORT SessionStorageDatabase + : public base::RefCountedDeleteOnSequence<SessionStorageDatabase> { public: - explicit SessionStorageDatabase(const base::FilePath& file_path); + // |file_path| is the path to the directory where the database will be + // created. |commit_task_runner| is the runner on which methods which modify + // the database must be run and where this object will be deleted. + SessionStorageDatabase( + const base::FilePath& file_path, + scoped_refptr<base::SequencedTaskRunner> commit_task_runner); // Reads the (key, value) pairs for |namespace_id| and |origin|. |result| is // assumed to be empty and any duplicate keys will be overwritten. If the @@ -90,10 +98,11 @@ void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd); private: - friend class base::RefCountedThreadSafe<SessionStorageDatabase>; class DBOperation; friend class SessionStorageDatabase::DBOperation; friend class SessionStorageDatabaseTest; + friend class base::RefCountedDeleteOnSequence<SessionStorageDatabase>; + friend class base::DeleteHelper<SessionStorageDatabase>; FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaParamTest, ShallowCopyWithBacking); ~SessionStorageDatabase(); @@ -224,6 +233,9 @@ // delete an inconsistent database at the right moment. int operation_count_; + // Used to check methods that run on the commit sequence. + SEQUENCE_CHECKER(sequence_checker_); + DISALLOW_COPY_AND_ASSIGN(SessionStorageDatabase); };
diff --git a/content/browser/dom_storage/session_storage_database_unittest.cc b/content/browser/dom_storage/session_storage_database_unittest.cc index 1f67c8d..3f06a7b 100644 --- a/content/browser/dom_storage/session_storage_database_unittest.cc +++ b/content/browser/dom_storage/session_storage_database_unittest.cc
@@ -19,6 +19,8 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_task_environment.h" +#include "base/threading/thread_task_runner_handle.h" #include "content/common/dom_storage/dom_storage_types.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/leveldatabase/src/include/leveldb/db.h" @@ -63,6 +65,7 @@ const GURL& origin) const; int64_t GetMapRefCount(const std::string& map_id) const; + base::test::ScopedTaskEnvironment scoped_task_environment_; base::ScopedTempDir temp_dir_; scoped_refptr<SessionStorageDatabase> db_; @@ -106,7 +109,8 @@ } void SessionStorageDatabaseTest::ResetDatabase() { - db_ = new SessionStorageDatabase(temp_dir_.GetPath()); + db_ = new SessionStorageDatabase(temp_dir_.GetPath(), + base::ThreadTaskRunnerHandle::Get()); ASSERT_TRUE(db_->LazyOpen(true)); }
diff --git a/content/browser/frame_host/data_url_navigation_throttle.cc b/content/browser/frame_host/data_url_navigation_throttle.cc index 0fd3d9a..4e1e7112 100644 --- a/content/browser/frame_host/data_url_navigation_throttle.cc +++ b/content/browser/frame_host/data_url_navigation_throttle.cc
@@ -50,6 +50,11 @@ if (handle->IsDownload()) return PROCEED; + // We treat <a download href="data:.."> as a navigation, but it will always + // result in a download, not a top-level navigation, so not blocking it here. + if (handle->GetSuggestedFilename().has_value()) + return PROCEED; + RenderFrameHost* top_frame = handle->frame_tree_node()->frame_tree()->root()->current_frame_host(); top_frame->AddMessageToConsole(
diff --git a/content/browser/frame_host/form_submission_throttle_browsertest.cc b/content/browser/frame_host/form_submission_throttle_browsertest.cc index 0f876a37..e966ff52 100644 --- a/content/browser/frame_host/form_submission_throttle_browsertest.cc +++ b/content/browser/frame_host/form_submission_throttle_browsertest.cc
@@ -93,7 +93,8 @@ 0, // pending_nav_entry_id false, // started_from_context_menu CSPDisposition::CHECK, // should_check_main_world_csp - true); // is_form_submission + true, // is_form_submission + base::nullopt); // suggested_filename // Test the expectations with a FormSubmissionThrottle. std::unique_ptr<NavigationThrottle> throttle = @@ -131,7 +132,8 @@ 0, // pending_nav_entry_id false, // started_from_context_menu CSPDisposition::DO_NOT_CHECK, // should_check_main_world_csp - true); // is_form_submission + true, // is_form_submission + base::nullopt); // suggested_filename // Test that the navigation is allowed because "should_by_pass_main_world_csp" // is true, even if it is a form submission and the policy is
diff --git a/content/browser/frame_host/interstitial_page_navigator_impl.cc b/content/browser/frame_host/interstitial_page_navigator_impl.cc index e9cba3a..f4f1d1d8 100644 --- a/content/browser/frame_host/interstitial_page_navigator_impl.cc +++ b/content/browser/frame_host/interstitial_page_navigator_impl.cc
@@ -41,14 +41,20 @@ DCHECK(!render_frame_host->navigation_handle()); render_frame_host->SetNavigationHandle(NavigationHandleImpl::Create( url, redirect_chain, render_frame_host->frame_tree_node(), - false, /* is_renderer_initiated */ - false, /* is_same_document */ - navigation_start, /* navigation_state */ - 0, /* pending_nav_entry_id */ - false, /* started_in_context_menu */ - CSPDisposition::CHECK, /* should_check_main_world_csp */ - false /* is_form_submission */ - )); + false, /* is_renderer_initiated */ + false, /* is_same_document */ + navigation_start, /* navigation_state */ + 0, /* pending_nav_entry_id */ + false, /* started_in_context_menu */ + CSPDisposition::CHECK, /* should_check_main_world_csp */ + false, /* is_form_submission */ + base::nullopt, /* suggested_filename */ + std::string(), /* method */ + nullptr, /* resource_request_body */ + content::Referrer(), false, /* has_user_gesture */ + ui::PAGE_TRANSITION_LINK, false, /* is_external_protocol */ + REQUEST_CONTEXT_TYPE_UNSPECIFIED, + blink::WebMixedContentContextType::kBlockable)); } void InterstitialPageNavigatorImpl::DidNavigate(
diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc index 3be2bdc..2bcb7df 100644 --- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc
@@ -7905,4 +7905,23 @@ html_content); } +// Data URLs can have a reference fragment like any other URLs. In this test, +// there are two navigations with the same data URL, but with a different +// reference. The second navigation must be classified as "same-document". +IN_PROC_BROWSER_TEST_F(ContentBrowserTest, DataURLSameDocumentNavigation) { + GURL url_first("data:text/html,body#foo"); + GURL url_second("data:text/html,body#bar"); + EXPECT_TRUE(url_first.EqualsIgnoringRef(url_second)); + + EXPECT_TRUE(NavigateToURL(shell(), url_first)); + + FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents()) + ->GetFrameTree() + ->root(); + FrameNavigateParamsCapturer capturer(root); + shell()->LoadURL(url_second); + capturer.Wait(); + EXPECT_TRUE(capturer.is_same_document()); +} + } // namespace content
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc index 9dbf316f..be221a33 100644 --- a/content/browser/frame_host/navigation_handle_impl.cc +++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -70,12 +70,23 @@ int pending_nav_entry_id, bool started_from_context_menu, CSPDisposition should_check_main_world_csp, - bool is_form_submission) { + bool is_form_submission, + const base::Optional<std::string>& suggested_filename, + const std::string& method, + scoped_refptr<content::ResourceRequestBody> resource_request_body, + const Referrer& sanitized_referrer, + bool has_user_gesture, + ui::PageTransition transition, + bool is_external_protocol, + RequestContextType request_context_type, + blink::WebMixedContentContextType mixed_content_context_type) { return std::unique_ptr<NavigationHandleImpl>(new NavigationHandleImpl( url, redirect_chain, frame_tree_node, is_renderer_initiated, is_same_document, navigation_start, pending_nav_entry_id, started_from_context_menu, should_check_main_world_csp, - is_form_submission)); + is_form_submission, suggested_filename, method, resource_request_body, + sanitized_referrer, has_user_gesture, transition, is_external_protocol, + request_context_type, mixed_content_context_type)); } NavigationHandleImpl::NavigationHandleImpl( @@ -88,11 +99,20 @@ int pending_nav_entry_id, bool started_from_context_menu, CSPDisposition should_check_main_world_csp, - bool is_form_submission) + bool is_form_submission, + const base::Optional<std::string>& suggested_filename, + const std::string& method, + scoped_refptr<content::ResourceRequestBody> resource_request_body, + const Referrer& sanitized_referrer, + bool has_user_gesture, + ui::PageTransition transition, + bool is_external_protocol, + RequestContextType request_context_type, + blink::WebMixedContentContextType mixed_content_context_type) : url_(url), - has_user_gesture_(false), - transition_(ui::PAGE_TRANSITION_LINK), - is_external_protocol_(false), + has_user_gesture_(has_user_gesture), + transition_(transition), + is_external_protocol_(is_external_protocol), net_error_code_(net::OK), render_frame_host_(nullptr), is_renderer_initiated_(is_renderer_initiated), @@ -103,15 +123,15 @@ subframe_entry_committed_(false), connection_info_(net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN), original_url_(url), + method_(method), state_(INITIAL), is_transferring_(false), frame_tree_node_(frame_tree_node), next_index_(0), navigation_start_(navigation_start), pending_nav_entry_id_(pending_nav_entry_id), - request_context_type_(REQUEST_CONTEXT_TYPE_UNSPECIFIED), - mixed_content_context_type_( - blink::WebMixedContentContextType::kBlockable), + request_context_type_(request_context_type), + mixed_content_context_type_(mixed_content_context_type), navigation_id_(CreateUniqueHandleID()), should_replace_current_entry_(false), redirect_chain_(redirect_chain), @@ -124,6 +144,7 @@ should_check_main_world_csp_(should_check_main_world_csp), is_form_submission_(is_form_submission), expected_render_process_host_id_(ChildProcessHost::kInvalidUniqueID), + suggested_filename_(suggested_filename), weak_factory_(this) { TRACE_EVENT_ASYNC_BEGIN2("navigation", "NavigationHandle", this, "frame_tree_node", @@ -141,6 +162,23 @@ starting_site_instance_ = frame_tree_node_->current_frame_host()->GetSiteInstance(); + if (method != "POST") + DCHECK(!resource_request_body); + + // Update the navigation parameters. + if (method_ == "POST") + resource_request_body_ = resource_request_body; + + // Mirrors the logic in RenderFrameImpl::SendDidCommitProvisionalLoad. + if (transition_ & ui::PAGE_TRANSITION_CLIENT_REDIRECT) { + // If the page contained a client redirect (meta refresh, + // document.location), set the referrer appropriately. + sanitized_referrer_ = + Referrer(redirect_chain_[0], sanitized_referrer.policy); + } else { + sanitized_referrer_ = sanitized_referrer; + } + // Try to match this with a pending NavigationEntry if possible. Note that // the NavigationController itself may be gone if this is a navigation inside // an interstitial and the interstitial is asynchronously deleting itself due @@ -258,39 +296,27 @@ } bool NavigationHandleImpl::IsPost() { - CHECK_NE(INITIAL, state_) - << "This accessor should not be called before the request is started."; return method_ == "POST"; } const scoped_refptr<ResourceRequestBody>& NavigationHandleImpl::GetResourceRequestBody() { - CHECK_NE(INITIAL, state_) - << "This accessor should not be called before the request is started."; return resource_request_body_; } const Referrer& NavigationHandleImpl::GetReferrer() { - CHECK_NE(INITIAL, state_) - << "This accessor should not be called before the request is started."; return sanitized_referrer_; } bool NavigationHandleImpl::HasUserGesture() { - CHECK_NE(INITIAL, state_) - << "This accessor should not be called before the request is started."; return has_user_gesture_; } ui::PageTransition NavigationHandleImpl::GetPageTransition() { - CHECK_NE(INITIAL, state_) - << "This accessor should not be called before the request is started."; return transition_; } bool NavigationHandleImpl::IsExternalProtocol() { - CHECK_NE(INITIAL, state_) - << "This accessor should not be called before the request is started."; return is_external_protocol_; } @@ -379,29 +405,9 @@ } NavigationThrottle::ThrottleCheckResult -NavigationHandleImpl::CallWillStartRequestForTesting( - bool is_post, - const Referrer& sanitized_referrer, - bool has_user_gesture, - ui::PageTransition transition, - bool is_external_protocol) { +NavigationHandleImpl::CallWillStartRequestForTesting() { NavigationThrottle::ThrottleCheckResult result = NavigationThrottle::DEFER; - - scoped_refptr<ResourceRequestBody> resource_request_body; - std::string method = "GET"; - if (is_post) { - method = "POST"; - - std::string body = "test=body"; - resource_request_body = new ResourceRequestBody(); - resource_request_body->AppendBytes(body.data(), body.size()); - } - - WillStartRequest(method, resource_request_body, sanitized_referrer, - has_user_gesture, transition, is_external_protocol, - REQUEST_CONTEXT_TYPE_LOCATION, - blink::WebMixedContentContextType::kBlockable, - base::Bind(&UpdateThrottleCheckResult, &result)); + WillStartRequest(base::Bind(&UpdateThrottleCheckResult, &result)); // Reset the callback to ensure it will not be called later. complete_callback_.Reset(); @@ -505,8 +511,8 @@ return base_url_for_data_url_; } -const base::Value& NavigationHandleImpl::GetNavigationData() { - return navigation_data_; +NavigationData* NavigationHandleImpl::GetNavigationData() { + return navigation_data_.get(); } void NavigationHandleImpl::SetOnDeferCallbackForTesting( @@ -523,6 +529,11 @@ return is_download_; } +const base::Optional<std::string>& +NavigationHandleImpl::GetSuggestedFilename() { + return suggested_filename_; +} + void NavigationHandleImpl::InitServiceWorkerHandle( ServiceWorkerContextWrapper* service_worker_context) { service_worker_handle_.reset( @@ -535,14 +546,6 @@ } void NavigationHandleImpl::WillStartRequest( - const std::string& method, - scoped_refptr<content::ResourceRequestBody> resource_request_body, - const Referrer& sanitized_referrer, - bool has_user_gesture, - ui::PageTransition transition, - bool is_external_protocol, - RequestContextType request_context_type, - blink::WebMixedContentContextType mixed_content_context_type, const ThrottleChecksFinishedCallback& callback) { TRACE_EVENT_ASYNC_STEP_INTO0("navigation", "NavigationHandle", this, "WillStartRequest"); @@ -553,27 +556,6 @@ return; } - if (method != "POST") - DCHECK(!resource_request_body); - - // Update the navigation parameters. - method_ = method; - if (method_ == "POST") - resource_request_body_ = resource_request_body; - has_user_gesture_ = has_user_gesture; - transition_ = transition; - // Mirrors the logic in RenderFrameImpl::SendDidCommitProvisionalLoad. - if (transition_ & ui::PAGE_TRANSITION_CLIENT_REDIRECT) { - // If the page contained a client redirect (meta refresh, - // document.location), set the referrer appropriately. - sanitized_referrer_ = - Referrer(redirect_chain_[0], sanitized_referrer.policy); - } else { - sanitized_referrer_ = sanitized_referrer; - } - is_external_protocol_ = is_external_protocol; - request_context_type_ = request_context_type; - mixed_content_context_type_ = mixed_content_context_type; state_ = WILL_SEND_REQUEST; complete_callback_ = callback;
diff --git a/content/browser/frame_host/navigation_handle_impl.h b/content/browser/frame_host/navigation_handle_impl.h index fb95634..6df084f 100644 --- a/content/browser/frame_host/navigation_handle_impl.h +++ b/content/browser/frame_host/navigation_handle_impl.h
@@ -18,11 +18,11 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/optional.h" -#include "base/values.h" #include "content/browser/frame_host/frame_tree_node.h" #include "content/browser/frame_host/render_frame_host_impl.h" #include "content/common/content_export.h" #include "content/public/browser/global_request_id.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/navigation_throttle.h" #include "content/public/browser/navigation_type.h" #include "content/public/browser/restore_type.h" @@ -66,7 +66,20 @@ int pending_nav_entry_id, bool started_from_context_menu, CSPDisposition should_check_main_world_csp, - bool is_form_submission); + bool is_form_submission, + const base::Optional<std::string>& suggested_filename, + const std::string& method = std::string(), + scoped_refptr<content::ResourceRequestBody> resource_request_body = + nullptr, + const Referrer& sanitized_referrer = content::Referrer(), + bool has_user_gesture = false, + ui::PageTransition transition = ui::PAGE_TRANSITION_LINK, + bool is_external_protocol = false, + RequestContextType request_context_type = + REQUEST_CONTEXT_TYPE_UNSPECIFIED, + blink::WebMixedContentContextType mixed_content_context_type = + blink::WebMixedContentContextType::kBlockable); + ~NavigationHandleImpl() override; // Used to track the state the navigation is currently in. @@ -119,12 +132,8 @@ const net::SSLInfo& GetSSLInfo() override; void RegisterThrottleForTesting( std::unique_ptr<NavigationThrottle> navigation_throttle) override; - NavigationThrottle::ThrottleCheckResult CallWillStartRequestForTesting( - bool is_post, - const Referrer& sanitized_referrer, - bool has_user_gesture, - ui::PageTransition transition, - bool is_external_protocol) override; + NavigationThrottle::ThrottleCheckResult CallWillStartRequestForTesting() + override; NavigationThrottle::ThrottleCheckResult CallWillRedirectRequestForTesting( const GURL& new_url, bool new_method_is_post, @@ -145,6 +154,7 @@ const GURL& GetBaseURLForDataURL() override; const GlobalRequestID& GetGlobalRequestID() override; bool IsDownload() override; + const base::Optional<std::string>& GetSuggestedFilename() override; // Resume and CancelDeferredNavigation must only be called by the // NavigationThrottle that is currently deferring the navigation. @@ -154,7 +164,7 @@ void CancelDeferredNavigation(NavigationThrottle* cancelling_throttle, NavigationThrottle::ThrottleCheckResult result); - const base::Value& GetNavigationData() override; + NavigationData* GetNavigationData() override; // Used in tests. State state_for_testing() const { return state_; } @@ -226,16 +236,7 @@ // Called when the URLRequest will start in the network stack. |callback| // will be called when all throttle checks have completed. This will allow // the caller to cancel the navigation or let it proceed. - void WillStartRequest( - const std::string& method, - scoped_refptr<content::ResourceRequestBody> resource_request_body, - const Referrer& sanitized_referrer, - bool has_user_gesture, - ui::PageTransition transition, - bool is_external_protocol, - RequestContextType request_context_type, - blink::WebMixedContentContextType mixed_content_context_type, - const ThrottleChecksFinishedCallback& callback); + void WillStartRequest(const ThrottleChecksFinishedCallback& callback); // Updates the state of the navigation handle after encountering a server // redirect. @@ -318,7 +319,7 @@ // Called during commit. Takes ownership of the embedder's NavigationData // instance. This NavigationData may have been cloned prior to being added // here. - void set_navigation_data(base::Value navigation_data) { + void set_navigation_data(std::unique_ptr<NavigationData> navigation_data) { navigation_data_ = std::move(navigation_data); } @@ -365,16 +366,26 @@ private: friend class NavigationHandleImplTest; - NavigationHandleImpl(const GURL& url, - const std::vector<GURL>& redirect_chain, - FrameTreeNode* frame_tree_node, - bool is_renderer_initiated, - bool is_same_document, - const base::TimeTicks& navigation_start, - int pending_nav_entry_id, - bool started_from_context_menu, - CSPDisposition should_check_main_world_csp, - bool is_form_submission); + NavigationHandleImpl( + const GURL& url, + const std::vector<GURL>& redirect_chain, + FrameTreeNode* frame_tree_node, + bool is_renderer_initiated, + bool is_same_document, + const base::TimeTicks& navigation_start, + int pending_nav_entry_id, + bool started_from_context_menu, + CSPDisposition should_check_main_world_csp, + bool is_form_submission, + const base::Optional<std::string>& suggested_filename, + const std::string& method, + scoped_refptr<content::ResourceRequestBody> resource_request_body, + const Referrer& sanitized_referrer, + bool has_user_gesture, + ui::PageTransition transition, + bool is_external_protocol, + RequestContextType request_context_type, + blink::WebMixedContentContextType mixed_content_context_type); NavigationThrottle::ThrottleCheckResult CheckWillStartRequest(); NavigationThrottle::ThrottleCheckResult CheckWillRedirectRequest(); @@ -499,7 +510,7 @@ std::unique_ptr<AppCacheNavigationHandle> appcache_handle_; // Embedder data from the IO thread tied to this navigation. - base::Value navigation_data_; + std::unique_ptr<NavigationData> navigation_data_; // Embedder data from the UI thread tied to this navigation. std::unique_ptr<NavigationUIData> navigation_ui_data_; @@ -558,6 +569,11 @@ // NavigationThrottles. base::Closure on_defer_callback_for_testing_; + // If this navigation was triggered by an anchor element with a download + // attribute, the |suggested_filename_| contains the attribute's (possibly + // empty) value. + base::Optional<std::string> suggested_filename_; + base::WeakPtrFactory<NavigationHandleImpl> weak_factory_; DISALLOW_COPY_AND_ASSIGN(NavigationHandleImpl);
diff --git a/content/browser/frame_host/navigation_handle_impl_unittest.cc b/content/browser/frame_host/navigation_handle_impl_unittest.cc index db70600..7fce862 100644 --- a/content/browser/frame_host/navigation_handle_impl_unittest.cc +++ b/content/browser/frame_host/navigation_handle_impl_unittest.cc
@@ -84,8 +84,6 @@ void SetUp() override { RenderViewHostImplTestHarness::SetUp(); CreateNavigationHandle(); - EXPECT_EQ(REQUEST_CONTEXT_TYPE_UNSPECIFIED, - test_handle_->request_context_type_); contents()->GetMainFrame()->InitializeRenderFrameIfNeeded(); } @@ -113,9 +111,6 @@ // It's safe to use base::Unretained since the NavigationHandle is owned by // the NavigationHandleImplTest. test_handle_->WillStartRequest( - "GET", nullptr, Referrer(), false, ui::PAGE_TRANSITION_LINK, false, - REQUEST_CONTEXT_TYPE_LOCATION, - blink::WebMixedContentContextType::kBlockable, base::Bind(&NavigationHandleImplTest::UpdateThrottleCheckResult, base::Unretained(this))); } @@ -262,7 +257,15 @@ base::TimeTicks::Now(), 0, false, // started_from_context_menu CSPDisposition::CHECK, // should_check_main_world_csp - false); // is_form_submission + false, // is_form_submission + base::nullopt, // suggested_filename + "GET", + nullptr, // resource_request_body + Referrer(), + false, // has_user_gesture + ui::PAGE_TRANSITION_LINK, + false, // is_external_protocol + REQUEST_CONTEXT_TYPE_LOCATION); } private:
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc index d14556e..5ab0508 100644 --- a/content/browser/frame_host/navigation_request.cc +++ b/content/browser/frame_host/navigation_request.cc
@@ -9,7 +9,6 @@ #include "base/memory/ptr_util.h" #include "base/optional.h" #include "base/strings/string_util.h" -#include "base/values.h" #include "build/build_config.h" #include "content/browser/appcache/appcache_navigation_handle.h" #include "content/browser/appcache/chrome_appcache_service.h" @@ -36,6 +35,7 @@ #include "content/public/browser/content_browser_client.h" #include "content/public/browser/global_request_id.h" #include "content/public/browser/navigation_controller.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/navigation_ui_data.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/storage_partition.h" @@ -498,15 +498,7 @@ // the NavigationHandle where the callback will be stored. // TODO(clamy): pass the method to the NavigationHandle instead of a // boolean. - bool is_external_protocol = - !GetContentClient()->browser()->IsHandledURL(common_params_.url); navigation_handle_->WillStartRequest( - common_params_.method, common_params_.post_data, - Referrer::SanitizeForRequest(common_params_.url, - common_params_.referrer), - common_params_.has_user_gesture, common_params_.transition, - is_external_protocol, begin_params_->request_context_type, - begin_params_->mixed_content_context_type, base::Bind(&NavigationRequest::OnStartChecksComplete, base::Unretained(this))); return; @@ -546,16 +538,24 @@ redirect_chain.push_back(begin_params_->client_side_redirect_url); redirect_chain.push_back(common_params_.url); + bool is_external_protocol = + !GetContentClient()->browser()->IsHandledURL(common_params_.url); std::unique_ptr<NavigationHandleImpl> navigation_handle = - NavigationHandleImpl::Create(common_params_.url, redirect_chain, - frame_tree_node_, !browser_initiated_, - FrameMsg_Navigate_Type::IsSameDocument( - common_params_.navigation_type), - common_params_.navigation_start, - nav_entry_id_, - common_params_.started_from_context_menu, - common_params_.should_check_main_world_csp, - begin_params_->is_form_submission); + NavigationHandleImpl::Create( + common_params_.url, redirect_chain, frame_tree_node_, + !browser_initiated_, + FrameMsg_Navigate_Type::IsSameDocument( + common_params_.navigation_type), + common_params_.navigation_start, nav_entry_id_, + common_params_.started_from_context_menu, + common_params_.should_check_main_world_csp, + begin_params_->is_form_submission, begin_params_->suggested_filename, + common_params_.method, common_params_.post_data, + Referrer::SanitizeForRequest(common_params_.url, + common_params_.referrer), + common_params_.has_user_gesture, common_params_.transition, + is_external_protocol, begin_params_->request_context_type, + begin_params_->mixed_content_context_type); if (!frame_tree_node->navigation_request()) { // A callback could have cancelled this request synchronously in which case @@ -736,7 +736,7 @@ mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints, std::unique_ptr<StreamHandle> body, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream, @@ -776,7 +776,8 @@ : kAppCacheNoHostId; // Update the previews state of the request. - common_params_.previews_state = response->head.previews_state; + common_params_.previews_state = + static_cast<PreviewsState>(response->head.previews_state); // Select an appropriate renderer to commit the navigation. RenderFrameHostImpl* render_frame_host = nullptr; @@ -805,7 +806,7 @@ } } - if (!navigation_data.is_none()) + if (navigation_data) navigation_handle_->set_navigation_data(std::move(navigation_data)); // Store the response and the StreamHandle until checks have been processed.
diff --git a/content/browser/frame_host/navigation_request.h b/content/browser/frame_host/navigation_request.h index df5f88b..e9cba4a2 100644 --- a/content/browser/frame_host/navigation_request.h +++ b/content/browser/frame_host/navigation_request.h
@@ -22,10 +22,6 @@ #include "content/public/browser/navigation_throttle.h" #include "content/public/common/previews_state.h" -namespace base { -class Value; -} - namespace content { class FrameNavigationEntry; @@ -33,6 +29,7 @@ class NavigationControllerImpl; class NavigationHandleImpl; class NavigationURLLoader; +class NavigationData; class ResourceRequestBody; class SiteInstanceImpl; class StreamHandle; @@ -229,7 +226,7 @@ mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints, std::unique_ptr<StreamHandle> body, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream,
diff --git a/content/browser/frame_host/navigator_impl_unittest.cc b/content/browser/frame_host/navigator_impl_unittest.cc index 5841e72..67f268d 100644 --- a/content/browser/frame_host/navigator_impl_unittest.cc +++ b/content/browser/frame_host/navigator_impl_unittest.cc
@@ -7,7 +7,6 @@ #include "base/feature_list.h" #include "base/macros.h" #include "base/time/time.h" -#include "base/values.h" #include "build/build_config.h" #include "content/browser/frame_host/navigation_controller_impl.h" #include "content/browser/frame_host/navigation_entry_impl.h" @@ -21,6 +20,7 @@ #include "content/common/frame.mojom.h" #include "content/common/frame_messages.h" #include "content/common/navigation_params.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/stream_handle.h" #include "content/public/common/content_features.h" #include "content/public/common/url_constants.h" @@ -123,7 +123,7 @@ // Have the current RenderFrameHost commit the navigation. scoped_refptr<ResourceResponse> response(new ResourceResponse); GetLoaderForNavigationRequest(request)->CallOnResponseStarted( - response, MakeEmptyStream(), base::Value() /* navigation_data */); + response, MakeEmptyStream(), nullptr); EXPECT_TRUE(main_test_rfh()->GetProcess()->did_frame_commit_navigation()); EXPECT_TRUE(main_test_rfh()->is_loading()); EXPECT_FALSE(node->navigation_request()); @@ -390,8 +390,7 @@ response->head.headers = new net::HttpResponseHeaders( std::string(kNoContentHeaders, arraysize(kNoContentHeaders))); GetLoaderForNavigationRequest(main_request) - ->CallOnResponseStarted(response, MakeEmptyStream(), - base::Value() /* navigation_data */); + ->CallOnResponseStarted(response, MakeEmptyStream(), nullptr); // There should be no pending nor speculative RenderFrameHost; the navigation // was aborted. @@ -416,8 +415,7 @@ response->head.headers = new net::HttpResponseHeaders( std::string(kResetContentHeaders, arraysize(kResetContentHeaders))); GetLoaderForNavigationRequest(main_request) - ->CallOnResponseStarted(response, MakeEmptyStream(), - base::Value() /* navigation_data */); + ->CallOnResponseStarted(response, MakeEmptyStream(), nullptr); // There should be no pending nor speculative RenderFrameHost; the navigation // was aborted. @@ -450,8 +448,7 @@ scoped_refptr<ResourceResponse> response(new ResourceResponse); GetLoaderForNavigationRequest(main_request) - ->CallOnResponseStarted(response, MakeEmptyStream(), - base::Value() /* navigation_data */); + ->CallOnResponseStarted(response, MakeEmptyStream(), nullptr); EXPECT_EQ(speculative_rfh, GetSpeculativeRenderFrameHost(node)); EXPECT_TRUE(speculative_rfh->GetProcess()->did_frame_commit_navigation()); EXPECT_FALSE(main_test_rfh()->GetProcess()->did_frame_commit_navigation()); @@ -494,8 +491,7 @@ // Have the RenderFrameHost commit the navigation. scoped_refptr<ResourceResponse> response(new ResourceResponse); GetLoaderForNavigationRequest(main_request) - ->CallOnResponseStarted(response, MakeEmptyStream(), - base::Value() /* navigation_data */); + ->CallOnResponseStarted(response, MakeEmptyStream(), nullptr); TestRenderFrameHost* final_speculative_rfh = GetSpeculativeRenderFrameHost(node); EXPECT_TRUE(final_speculative_rfh); @@ -567,7 +563,7 @@ // Have the RenderFrameHost commit the navigation. scoped_refptr<ResourceResponse> response(new ResourceResponse); GetLoaderForNavigationRequest(request2)->CallOnResponseStarted( - response, MakeEmptyStream(), base::Value() /* navigation_data */); + response, MakeEmptyStream(), nullptr); EXPECT_TRUE(speculative_rfh->GetProcess()->did_frame_commit_navigation()); EXPECT_FALSE(main_test_rfh()->GetProcess()->did_frame_commit_navigation()); @@ -759,7 +755,7 @@ // Have the RenderFrameHost commit the navigation. scoped_refptr<ResourceResponse> response(new ResourceResponse); GetLoaderForNavigationRequest(request2)->CallOnResponseStarted( - response, MakeEmptyStream(), base::Value() /* navigation_data */); + response, MakeEmptyStream(), nullptr); EXPECT_TRUE(speculative_rfh->GetProcess()->did_frame_commit_navigation()); EXPECT_FALSE(main_test_rfh()->GetProcess()->did_frame_commit_navigation()); @@ -905,8 +901,7 @@ // OnResponseStarted. scoped_refptr<ResourceResponse> response(new ResourceResponse); GetLoaderForNavigationRequest(node->navigation_request()) - ->CallOnResponseStarted(response, MakeEmptyStream(), - base::Value() /* navigation_data */); + ->CallOnResponseStarted(response, MakeEmptyStream(), nullptr); EXPECT_EQ(speculative_rfh, GetSpeculativeRenderFrameHost(node)); EXPECT_TRUE(speculative_rfh->GetProcess()->did_frame_commit_navigation()); EXPECT_EQ(site_instance_id, speculative_rfh->GetSiteInstance()->GetId()); @@ -965,8 +960,7 @@ // OnResponseStarted. scoped_refptr<ResourceResponse> response(new ResourceResponse); GetLoaderForNavigationRequest(main_request) - ->CallOnResponseStarted(response, MakeEmptyStream(), - base::Value() /* navigation_data */); + ->CallOnResponseStarted(response, MakeEmptyStream(), nullptr); speculative_rfh = GetSpeculativeRenderFrameHost(node); ASSERT_TRUE(speculative_rfh); EXPECT_TRUE(speculative_rfh->GetProcess()->did_frame_commit_navigation());
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index ceddb61..5523379 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -73,6 +73,7 @@ #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/renderer_host/render_widget_host_view_child_frame.h" #include "content/browser/renderer_interface_binders.h" +#include "content/browser/scoped_active_url.h" #include "content/browser/shared_worker/shared_worker_connector_impl.h" #include "content/browser/shared_worker/shared_worker_service_impl.h" #include "content/browser/storage_partition_impl.h" @@ -845,6 +846,12 @@ if (!render_frame_created_) return false; + // Crash reports trigerred by IPC messages for this frame should be associated + // with its URL. + // TODO(lukasza): Also call SetActiveURL for mojo messages dispatched to + // either the FrameHost interface or to interfaces bound by this frame. + ScopedActiveURL scoped_active_url(this); + // This message map is for handling internal IPC messages which should not // be dispatched to other objects. bool handled = true; @@ -1511,6 +1518,13 @@ validated_params, service_manager::mojom::InterfaceProviderRequest interface_provider_request) { + // DidCommitProvisionalLoad IPC should be associated with the URL being + // committed (not with the *last* committed URL that most other IPCs are + // associated with). + ScopedActiveURL scoped_active_url( + validated_params->url, + frame_tree_node()->frame_tree()->root()->current_origin()); + ScopedCommitStateResetter commit_state_resetter(this); RenderProcessHost* process = GetProcess(); @@ -1620,6 +1634,7 @@ // Verify that the origin passed from the renderer process is valid and can // be allowed to commit in this RenderFrameHost. if (!CanCommitOrigin(validated_params->origin, validated_params->url)) { + DEBUG_ALIAS_FOR_ORIGIN(origin_debug_alias, validated_params->origin); bad_message::ReceivedBadMessage(GetProcess(), bad_message::RFH_INVALID_ORIGIN_ON_COMMIT); return; @@ -4322,7 +4337,8 @@ pending_nav_entry_id, false, // started_from_context_menu CSPDisposition::CHECK, // should_check_main_world_csp - false); // is_form_submission + false, // is_form_submission + base::nullopt); // suggested_filename } // Determine if the current NavigationHandle can be used. @@ -4377,7 +4393,8 @@ entry_id_for_data_nav, false, // started_from_context_menu CSPDisposition::CHECK, // should_check_main_world_csp - false); // is_form_submission + false, // is_form_submission + base::nullopt); // suggested_filename } void RenderFrameHostImpl::BeforeUnloadTimeout() {
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index 0e6c69c..075b6397 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1044,10 +1044,10 @@ if (render_frame_host != render_frame_host_.get()) return; - EnsureRenderFrameHostVisibilityConsistent(); - - // TODO(jam): uncomment this when the method is shared. Not adding the call - // now to make merge to 63 easier. + EnsureRenderFrameHostVisibilityConsistent(); + + // TODO(jam): uncomment this when the method is shared. Not adding the call + // now to make merge to 63 easier. // EnsureRenderFrameHostPageFocusConsistent(); // TODO(nasko): This is a very ugly hack. The Chrome extensions process
diff --git a/content/browser/frame_host/render_frame_host_manager_browsertest.cc b/content/browser/frame_host/render_frame_host_manager_browsertest.cc index bbbb46bf..514ae9d 100644 --- a/content/browser/frame_host/render_frame_host_manager_browsertest.cc +++ b/content/browser/frame_host/render_frame_host_manager_browsertest.cc
@@ -1171,7 +1171,7 @@ // Ensure that the original renderer process exited cleanly without crashing. exit_observer.Wait(); - EXPECT_EQ(true, exit_observer.did_exit_normally()); + EXPECT_TRUE(exit_observer.did_exit_normally()); } // Test that opening a new window in the same SiteInstance and then navigating
diff --git a/content/browser/frame_host/render_frame_message_filter_browsertest.cc b/content/browser/frame_host/render_frame_message_filter_browsertest.cc index f743a84..0ace08b4 100644 --- a/content/browser/frame_host/render_frame_message_filter_browsertest.cc +++ b/content/browser/frame_host/render_frame_message_filter_browsertest.cc
@@ -200,24 +200,27 @@ EXPECT_NE(iframe->GetProcess(), main_frame->GetProcess()); - RenderProcessHostWatcher iframe_killed( - iframe->GetProcess(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); - // Try to get cross-site cookies from the subframe's process and wait for it // to be killed. - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO) - ->PostTask(FROM_HERE, - base::BindOnce( - [](RenderFrameHost* frame) { - GetFilterForProcess(frame->GetProcess()) - ->GetCookies( - frame->GetRoutingID(), GURL("http://127.0.0.1/"), - GURL("http://127.0.0.1/"), - base::BindOnce([](const std::string&) {})); - }, - iframe)); + { + RenderProcessHostKillWaiter iframe_kill_waiter(iframe->GetProcess()); - iframe_killed.Wait(); + BrowserThread::GetTaskRunnerForThread(BrowserThread::IO) + ->PostTask(FROM_HERE, + base::BindOnce( + [](RenderFrameHost* frame) { + GetFilterForProcess(frame->GetProcess()) + ->GetCookies( + frame->GetRoutingID(), + GURL("http://127.0.0.1/"), + GURL("http://127.0.0.1/"), + base::BindOnce([](const std::string&) {})); + }, + iframe)); + + EXPECT_EQ(bad_message::RFMF_GET_COOKIES_BAD_ORIGIN, + iframe_kill_waiter.Wait()); + } EXPECT_EQ( " Site A ------------ proxies for B\n" @@ -228,23 +231,25 @@ // Now set a cross-site cookie from the main frame's process and wait for it // to be killed. - RenderProcessHostWatcher main_frame_killed( - tab->GetMainFrame()->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + { + RenderProcessHostKillWaiter main_frame_kill_waiter( + tab->GetMainFrame()->GetProcess()); - BrowserThread::GetTaskRunnerForThread(BrowserThread::IO) - ->PostTask(FROM_HERE, base::BindOnce( - [](RenderFrameHost* frame) { - GetFilterForProcess(frame->GetProcess()) - ->SetCookie( - frame->GetRoutingID(), - GURL("https://baz.com/"), - GURL("https://baz.com/"), "pwn=ed", - base::BindOnce(&base::DoNothing)); - }, - main_frame)); + BrowserThread::GetTaskRunnerForThread(BrowserThread::IO) + ->PostTask(FROM_HERE, base::BindOnce( + [](RenderFrameHost* frame) { + GetFilterForProcess(frame->GetProcess()) + ->SetCookie( + frame->GetRoutingID(), + GURL("https://baz.com/"), + GURL("https://baz.com/"), "pwn=ed", + base::BindOnce(&base::DoNothing)); + }, + main_frame)); - main_frame_killed.Wait(); + EXPECT_EQ(bad_message::RFMF_SET_COOKIE_BAD_ORIGIN, + main_frame_kill_waiter.Wait()); + } EXPECT_EQ( " Site A\n" @@ -260,28 +265,20 @@ NavigateToURL(shell(), web_url); RenderFrameHost* web_rfh = shell()->web_contents()->GetMainFrame(); - base::HistogramTester uma; - ASSERT_TRUE(web_rfh->IsRenderFrameLive()); - RenderProcessHostWatcher web_process_killed( - web_rfh->GetProcess(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter(web_rfh->GetProcess()); IPC::IpcSecurityTestUtil::PwnMessageReceived( web_rfh->GetProcess()->GetChannel(), FrameHostMsg_RenderProcessGone( web_rfh->GetRoutingID(), base::TERMINATION_STATUS_NORMAL_TERMINATION, 0)); - EXPECT_THAT(uma.GetAllSamples("Stability.BadMessageTerminated.Content"), - testing::ElementsAre(base::Bucket( - bad_message::RFMF_RENDERER_FAKED_ITS_OWN_DEATH, 1))); - // If the message had gone through, we'd have marked the RFH as dead but // left the RPH and its connection alive, and the Wait below would hang. - web_process_killed.Wait(); + EXPECT_EQ(bad_message::RFMF_RENDERER_FAKED_ITS_OWN_DEATH, kill_waiter.Wait()); ASSERT_FALSE(web_rfh->GetProcess()->HasConnection()); ASSERT_FALSE(web_rfh->IsRenderFrameLive()); - ASSERT_FALSE(web_process_killed.did_exit_normally()); } } // namespace content
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc index 42684015..ee5e772 100644 --- a/content/browser/frame_host/render_frame_proxy_host.cc +++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -5,6 +5,7 @@ #include "content/browser/frame_host/render_frame_proxy_host.h" #include <utility> +#include <vector> #include "base/callback.h" #include "base/lazy_instance.h" @@ -18,6 +19,7 @@ #include "content/browser/renderer_host/render_view_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/renderer_host/render_widget_host_view_child_frame.h" +#include "content/browser/scoped_active_url.h" #include "content/browser/site_instance_impl.h" #include "content/common/frame_messages.h" #include "content/common/frame_owner_properties.h" @@ -131,6 +133,10 @@ } bool RenderFrameProxyHost::OnMessageReceived(const IPC::Message& msg) { + // Crash reports trigerred by IPC messages for this proxy should be associated + // with the URL of the current RenderFrameHost that is being proxied. + ScopedActiveURL scoped_active_url(this); + if (cross_process_frame_connector_.get() && cross_process_frame_connector_->OnMessageReceived(msg)) return true;
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc index 0d8594f3..4479fa5 100644 --- a/content/browser/gpu/compositor_util.cc +++ b/content/browser/gpu/compositor_util.cc
@@ -366,8 +366,9 @@ return GpuDataManagerImpl::GetInstance()->GetDriverBugWorkarounds(); } -viz::BufferUsageAndFormatList CreateBufferUsageAndFormatExceptionList() { - viz::BufferUsageAndFormatList usage_format_list; +std::vector<gfx::BufferUsageAndFormat> +CreateBufferUsageAndFormatExceptionList() { + std::vector<gfx::BufferUsageAndFormat> usage_format_list; for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); ++usage_idx) { gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); @@ -376,7 +377,7 @@ ++format_idx) { gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); if (gpu::GetImageNeedsPlatformSpecificTextureTarget(format, usage)) - usage_format_list.push_back(std::make_pair(usage, format)); + usage_format_list.push_back(gfx::BufferUsageAndFormat(usage, format)); } } return usage_format_list;
diff --git a/content/browser/gpu/compositor_util.h b/content/browser/gpu/compositor_util.h index 0949255..d31715e 100644 --- a/content/browser/gpu/compositor_util.h +++ b/content/browser/gpu/compositor_util.h
@@ -6,10 +6,11 @@ #define CONTENT_BROWSER_GPU_COMPOSITOR_UTIL_H_ #include <memory> +#include <vector> #include "base/values.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "content/common/content_export.h" +#include "ui/gfx/buffer_types.h" namespace content { @@ -48,7 +49,7 @@ // Populate a list of buffer usage/format for which a per platform specific // texture target must be used instead of GL_TEXTURE_2D. -CONTENT_EXPORT viz::BufferUsageAndFormatList +CONTENT_EXPORT std::vector<gfx::BufferUsageAndFormat> CreateBufferUsageAndFormatExceptionList(); } // namespace content
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index 687c819..d32f70de 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -25,6 +25,7 @@ #include "build/build_config.h" #include "cc/base/switches.h" #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" +#include "content/browser/gpu/compositor_util.h" #include "content/browser/gpu/gpu_process_host.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/gpu_data_manager_observer.h" @@ -45,7 +46,6 @@ #include "gpu/ipc/common/gpu_preferences_util.h" #include "gpu/ipc/common/memory_stats.h" #include "gpu/ipc/host/shader_disk_cache.h" -#include "gpu/ipc/service/switches.h" #include "media/media_features.h" #include "ui/base/ui_base_switches.h" #include "ui/gfx/switches.h" @@ -654,7 +654,6 @@ UpdateGpuPreferences(&gpu_prefs); command_line->AppendSwitchASCII(switches::kGpuPreferences, gpu::GpuPreferencesToSwitchValue(gpu_prefs)); - std::string use_gl = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kUseGL); @@ -745,6 +744,9 @@ gpu_preferences->gpu_program_cache_size = gpu::ShaderDiskCache::CacheSizeBytes(); + + gpu_preferences->texture_target_exception_list = + CreateBufferUsageAndFormatExceptionList(); } void GpuDataManagerImplPrivate::DisableHardwareAcceleration() {
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc index ef47c091..faa294805 100644 --- a/content/browser/gpu/gpu_internals_ui.cc +++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -45,6 +45,7 @@ #include "third_party/skia/include/core/SkMilestone.h" #include "ui/display/display.h" #include "ui/display/screen.h" +#include "ui/gfx/buffer_format_util.h" #include "ui/gl/gpu_switching_manager.h" #if defined(OS_WIN) @@ -263,51 +264,6 @@ return info; } -const char* BufferFormatToString(gfx::BufferFormat format) { - switch (format) { - case gfx::BufferFormat::ATC: - return "ATC"; - case gfx::BufferFormat::ATCIA: - return "ATCIA"; - case gfx::BufferFormat::DXT1: - return "DXT1"; - case gfx::BufferFormat::DXT5: - return "DXT5"; - case gfx::BufferFormat::ETC1: - return "ETC1"; - case gfx::BufferFormat::R_8: - return "R_8"; - case gfx::BufferFormat::R_16: - return "R_16"; - case gfx::BufferFormat::RG_88: - return "RG_88"; - case gfx::BufferFormat::BGR_565: - return "BGR_565"; - case gfx::BufferFormat::RGBA_4444: - return "RGBA_4444"; - case gfx::BufferFormat::RGBX_8888: - return "RGBX_8888"; - case gfx::BufferFormat::RGBA_8888: - return "RGBA_8888"; - case gfx::BufferFormat::BGRX_8888: - return "BGRX_8888"; - case gfx::BufferFormat::BGRX_1010102: - return "BGRX_1010102"; - case gfx::BufferFormat::BGRA_8888: - return "BGRA_8888"; - case gfx::BufferFormat::RGBA_F16: - return "RGBA_F16"; - case gfx::BufferFormat::YVU_420: - return "YVU_420"; - case gfx::BufferFormat::YUV_420_BIPLANAR: - return "YUV_420_BIPLANAR"; - case gfx::BufferFormat::UYVY_422: - return "UYVY_422"; - } - NOTREACHED(); - return nullptr; -} - const char* BufferUsageToString(gfx::BufferUsage usage) { switch (usage) { case gfx::BufferUsage::GPU_READ: @@ -365,7 +321,7 @@ native_usage_support = base::StringPrintf("Software only"); gpu_memory_buffer_info->Append(NewDescriptionValuePair( - BufferFormatToString(static_cast<gfx::BufferFormat>(format)), + gfx::BufferFormatToString(static_cast<gfx::BufferFormat>(format)), native_usage_support)); } return gpu_memory_buffer_info;
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 35845eb4..046b3de 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc
@@ -57,7 +57,6 @@ #include "gpu/config/gpu_driver_bug_list.h" #include "gpu/config/gpu_driver_bug_workaround_type.h" #include "gpu/ipc/host/shader_disk_cache.h" -#include "gpu/ipc/service/switches.h" #include "media/base/media_switches.h" #include "media/media_features.h" #include "mojo/edk/embedder/embedder.h"
diff --git a/content/browser/isolated_origin_browsertest.cc b/content/browser/isolated_origin_browsertest.cc index acb1b5b..b9c3c94 100644 --- a/content/browser/isolated_origin_browsertest.cc +++ b/content/browser/isolated_origin_browsertest.cc
@@ -1041,15 +1041,14 @@ embedded_test_server()->GetURL("isolated.foo.com", "/title1.html")); EXPECT_TRUE(NavigateToURL(shell(), isolated_url)); - content::RenderProcessHostWatcher crash_observer( - shell()->web_contents()->GetMainFrame()->GetProcess(), - content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + content::RenderProcessHostKillWaiter kill_waiter( + shell()->web_contents()->GetMainFrame()->GetProcess()); // Use ignore_result here, since on Android the renderer process is // terminated, but ExecuteScript still returns true. It properly returns // false on all other platforms. ignore_result(ExecuteScript(shell()->web_contents()->GetMainFrame(), "localStorage.length;")); - crash_observer.Wait(); + EXPECT_EQ(bad_message::RPH_MOJO_PROCESS_ERROR, kill_waiter.Wait()); } class IsolatedOriginFieldTrialTest : public ContentBrowserTest {
diff --git a/content/browser/loader/cross_site_document_resource_handler.cc b/content/browser/loader/cross_site_document_resource_handler.cc index ca0fcc4..4de83368e 100644 --- a/content/browser/loader/cross_site_document_resource_handler.cc +++ b/content/browser/loader/cross_site_document_resource_handler.cc
@@ -9,6 +9,8 @@ #include <string> #include <utility> +#include "base/bind.h" +#include "base/bind_helpers.h" #include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_piece.h" @@ -18,12 +20,16 @@ #include "content/browser/loader/resource_request_info_impl.h" #include "content/browser/site_instance_impl.h" #include "content/browser/site_isolation_policy.h" +#include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/resource_context.h" +#include "content/public/browser/web_contents.h" #include "content/public/common/content_client.h" #include "net/base/io_buffer.h" #include "net/base/mime_sniffer.h" #include "net/url_request/url_request.h" +#include "services/metrics/public/cpp/ukm_builders.h" +#include "services/metrics/public/cpp/ukm_recorder.h" namespace content { @@ -62,6 +68,94 @@ } // namespace +// static +void CrossSiteDocumentResourceHandler::LogBlockedResponseOnUIThread( + ResourceRequestInfo::WebContentsGetter web_contents_getter, + bool needed_sniffing, + CrossSiteDocumentMimeType canonical_mime_type, + ResourceType resource_type, + int http_response_code) { + DCHECK_CURRENTLY_ON(BrowserThread::UI); + + WebContents* web_contents = web_contents_getter.Run(); + if (!web_contents) + return; + + ukm::UkmRecorder* recorder = ukm::UkmRecorder::Get(); + ukm::SourceId source_id = ukm::UkmRecorder::GetNewSourceID(); + recorder->UpdateSourceURL(source_id, web_contents->GetLastCommittedURL()); + ukm::builders::SiteIsolation_XSD_Browser_Blocked(source_id) + .SetContentResourceType(resource_type) + .SetCanonicalMimeType(canonical_mime_type) + .SetHttpResponseCode(http_response_code) + .SetNeededSniffing(needed_sniffing) + .Record(recorder); +} + +// static +void CrossSiteDocumentResourceHandler::LogBlockedResponse( + ResourceRequestInfoImpl* resource_request_info, + bool needed_sniffing, + bool found_parser_breaker, + CrossSiteDocumentMimeType canonical_mime_type, + int http_response_code) { + LogCrossSiteDocumentAction( + needed_sniffing + ? CrossSiteDocumentResourceHandler::Action::kBlockedAfterSniffing + : CrossSiteDocumentResourceHandler::Action::kBlockedWithoutSniffing); + + ResourceType resource_type = resource_request_info->GetResourceType(); + UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked", resource_type, + content::RESOURCE_TYPE_LAST_TYPE); + if (found_parser_breaker) { + UMA_HISTOGRAM_ENUMERATION( + "SiteIsolation.XSD.Browser.BlockedForParserBreaker", resource_type, + content::RESOURCE_TYPE_LAST_TYPE); + } + switch (canonical_mime_type) { + case CROSS_SITE_DOCUMENT_MIME_TYPE_HTML: + UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.HTML", + resource_type, + content::RESOURCE_TYPE_LAST_TYPE); + break; + case CROSS_SITE_DOCUMENT_MIME_TYPE_XML: + UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.XML", + resource_type, + content::RESOURCE_TYPE_LAST_TYPE); + break; + case CROSS_SITE_DOCUMENT_MIME_TYPE_JSON: + UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.JSON", + resource_type, + content::RESOURCE_TYPE_LAST_TYPE); + break; + case CROSS_SITE_DOCUMENT_MIME_TYPE_PLAIN: + UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.Plain", + resource_type, + content::RESOURCE_TYPE_LAST_TYPE); + break; + case CROSS_SITE_DOCUMENT_MIME_TYPE_OTHERS: + UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.Others", + resource_type, + content::RESOURCE_TYPE_LAST_TYPE); + break; + default: + NOTREACHED(); + } + + // The last committed URL is only available on the UI thread - we need to hop + // onto the UI thread to log an UKM event. Note that this is racey - by the + // time the posted task runs, the WebContents could have been closed and/or + // navigated to another URL. This is understood and acceptable - this should + // be rare enough to not matter for the collected UKM data. + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, + base::BindOnce( + &CrossSiteDocumentResourceHandler::LogBlockedResponseOnUIThread, + base::Passed(resource_request_info->GetWebContentsGetterForRequest()), + needed_sniffing, canonical_mime_type, resource_type, + http_response_code)); +} + // ResourceController that runs a closure on Resume(), and forwards failures // back to CrossSiteDocumentHandler. The closure can optionally be run as // a PostTask. @@ -134,6 +228,8 @@ ResourceResponse* response, std::unique_ptr<ResourceController> controller) { has_response_started_ = true; + http_response_code_ = + response->head.headers ? response->head.headers->response_code() : 0; LogCrossSiteDocumentAction( CrossSiteDocumentResourceHandler::Action::kResponseStarted); @@ -320,49 +416,9 @@ : "null", "url", request()->url().spec()); - LogCrossSiteDocumentAction( - needs_sniffing_ - ? CrossSiteDocumentResourceHandler::Action::kBlockedAfterSniffing - : CrossSiteDocumentResourceHandler::Action:: - kBlockedWithoutSniffing); - ResourceType resource_type = info->GetResourceType(); - UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked", - resource_type, - content::RESOURCE_TYPE_LAST_TYPE); - if (found_parser_breaker) { - UMA_HISTOGRAM_ENUMERATION( - "SiteIsolation.XSD.Browser.BlockedForParserBreaker", resource_type, - content::RESOURCE_TYPE_LAST_TYPE); - } - switch (canonical_mime_type_) { - case CROSS_SITE_DOCUMENT_MIME_TYPE_HTML: - UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.HTML", - resource_type, - content::RESOURCE_TYPE_LAST_TYPE); - break; - case CROSS_SITE_DOCUMENT_MIME_TYPE_XML: - UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.XML", - resource_type, - content::RESOURCE_TYPE_LAST_TYPE); - break; - case CROSS_SITE_DOCUMENT_MIME_TYPE_JSON: - UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.JSON", - resource_type, - content::RESOURCE_TYPE_LAST_TYPE); - break; - case CROSS_SITE_DOCUMENT_MIME_TYPE_PLAIN: - UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.Plain", - resource_type, - content::RESOURCE_TYPE_LAST_TYPE); - break; - case CROSS_SITE_DOCUMENT_MIME_TYPE_OTHERS: - UMA_HISTOGRAM_ENUMERATION("SiteIsolation.XSD.Browser.Blocked.Others", - resource_type, - content::RESOURCE_TYPE_LAST_TYPE); - break; - default: - NOTREACHED(); - } + LogBlockedResponse(GetRequestInfo(), needs_sniffing_, + found_parser_breaker, canonical_mime_type_, + http_response_code_); } else { // Choose not block this response. Pass the contents of |local_buffer_| // onto the next handler. Note that the size of the two buffers is the
diff --git a/content/browser/loader/cross_site_document_resource_handler.h b/content/browser/loader/cross_site_document_resource_handler.h index 1164c503..0c84a85 100644 --- a/content/browser/loader/cross_site_document_resource_handler.h +++ b/content/browser/loader/cross_site_document_resource_handler.h
@@ -11,7 +11,9 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "content/browser/loader/layered_resource_handler.h" +#include "content/browser/loader/resource_request_info_impl.h" #include "content/common/cross_site_document_classifier.h" +#include "content/public/browser/resource_request_info.h" #include "content/public/common/resource_type.h" namespace net { @@ -100,6 +102,19 @@ // Called by the OnWillReadController. void ResumeOnWillRead(scoped_refptr<net::IOBuffer>* buf, int* buf_size); + // Helpers for UMA and UKM logging. + static void LogBlockedResponseOnUIThread( + ResourceRequestInfo::WebContentsGetter web_contents_getter, + bool needed_sniffing, + CrossSiteDocumentMimeType canonical_mime_type, + ResourceType resource_type, + int http_response_code); + static void LogBlockedResponse(ResourceRequestInfoImpl* resource_request_info, + bool needed_sniffing, + bool found_parser_breaker, + CrossSiteDocumentMimeType canonical_mime_type, + int http_response_code); + // WeakPtrFactory for |next_handler_|. base::WeakPtrFactory<ResourceHandler> weak_next_handler_; @@ -154,6 +169,10 @@ // completed, and thus it is safe to cancel or detach on the next read. bool blocked_read_completed_ = false; + // The HTTP response code (e.g. 200 or 404) received in response to this + // resource request. + int http_response_code_ = 0; + base::WeakPtrFactory<CrossSiteDocumentResourceHandler> weak_this_; DISALLOW_COPY_AND_ASSIGN(CrossSiteDocumentResourceHandler);
diff --git a/content/browser/loader/mojo_async_resource_handler.cc b/content/browser/loader/mojo_async_resource_handler.cc index 05d5bb7..5f9070b 100644 --- a/content/browser/loader/mojo_async_resource_handler.cc +++ b/content/browser/loader/mojo_async_resource_handler.cc
@@ -384,8 +384,12 @@ void MojoAsyncResourceHandler::SetPriority(net::RequestPriority priority, int32_t intra_priority_value) { - ResourceDispatcherHostImpl::Get()->scheduler()->ReprioritizeRequest( - request(), priority, intra_priority_value); + auto* scheduler = ResourceDispatcherHostImpl::Get()->scheduler(); + if (intra_priority_value == -1) { + scheduler->ReprioritizeRequest(request(), priority); + } else { + scheduler->ReprioritizeRequest(request(), priority, intra_priority_value); + } } void MojoAsyncResourceHandler::PauseReadingBodyFromNet() {
diff --git a/content/browser/loader/mojo_async_resource_handler_unittest.cc b/content/browser/loader/mojo_async_resource_handler_unittest.cc index 166c443..1dff2e2 100644 --- a/content/browser/loader/mojo_async_resource_handler_unittest.cc +++ b/content/browser/loader/mojo_async_resource_handler_unittest.cc
@@ -19,13 +19,13 @@ #include "base/run_loop.h" #include "base/test/gtest_util.h" #include "base/test/test_simple_task_runner.h" -#include "base/values.h" #include "content/browser/loader/mock_resource_loader.h" #include "content/browser/loader/resource_controller.h" #include "content/browser/loader/resource_dispatcher_host_impl.h" #include "content/browser/loader/resource_request_info_impl.h" #include "content/browser/loader/resource_scheduler.h" #include "content/public/browser/appcache_service.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/resource_context.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" #include "content/public/browser/resource_throttle.h" @@ -183,9 +183,9 @@ return PREVIEWS_UNSPECIFIED; } - base::Value GetNavigationData(net::URLRequest* request) override { + NavigationData* GetNavigationData(net::URLRequest* request) const override { ADD_FAILURE() << "GetNavigationData should not be called."; - return base::Value(); + return nullptr; } std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
diff --git a/content/browser/loader/navigation_resource_handler.cc b/content/browser/loader/navigation_resource_handler.cc index fbcb3c8..054ada49 100644 --- a/content/browser/loader/navigation_resource_handler.cc +++ b/content/browser/loader/navigation_resource_handler.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/logging.h" #include "base/optional.h" -#include "base/values.h" #include "content/browser/loader/navigation_url_loader_impl_core.h" #include "content/browser/loader/resource_controller.h" #include "content/browser/loader/resource_loader.h" @@ -17,6 +16,7 @@ #include "content/browser/resource_context_impl.h" #include "content/browser/streams/stream.h" #include "content/browser/streams/stream_context.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" #include "content/public/browser/stream_handle.h" #include "content/public/common/resource_response.h" @@ -115,17 +115,21 @@ response->head.encoded_data_length = request()->raw_header_size(); - base::Value navigation_data; + std::unique_ptr<NavigationData> cloned_data; if (resource_dispatcher_host_delegate_) { // Ask the embedder for a NavigationData instance. - navigation_data = + NavigationData* navigation_data = resource_dispatcher_host_delegate_->GetNavigationData(request()); + + // Clone the embedder's NavigationData before moving it to the UI thread. + if (navigation_data) + cloned_data = navigation_data->Clone(); } - core_->NotifyResponseStarted( - response, std::move(stream_handle_), request()->ssl_info(), - std::move(navigation_data), info->GetGlobalRequestID(), - info->IsDownload(), info->is_stream()); + core_->NotifyResponseStarted(response, std::move(stream_handle_), + request()->ssl_info(), std::move(cloned_data), + info->GetGlobalRequestID(), info->IsDownload(), + info->is_stream()); HoldController(std::move(controller)); response_ = response; }
diff --git a/content/browser/loader/navigation_url_loader_delegate.h b/content/browser/loader/navigation_url_loader_delegate.h index 99c42a8..49013ca 100644 --- a/content/browser/loader/navigation_url_loader_delegate.h +++ b/content/browser/loader/navigation_url_loader_delegate.h
@@ -13,10 +13,6 @@ #include "content/common/content_export.h" #include "content/public/common/url_loader.mojom.h" -namespace base { -class Value; -} - namespace net { struct RedirectInfo; class SSLInfo; @@ -24,6 +20,7 @@ namespace content { +class NavigationData; class StreamHandle; struct GlobalRequestID; struct ResourceResponse; @@ -53,7 +50,7 @@ mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints, std::unique_ptr<StreamHandle> body_stream, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream,
diff --git a/content/browser/loader/navigation_url_loader_impl.cc b/content/browser/loader/navigation_url_loader_impl.cc index 63307a2..d61951d 100644 --- a/content/browser/loader/navigation_url_loader_impl.cc +++ b/content/browser/loader/navigation_url_loader_impl.cc
@@ -10,7 +10,6 @@ #include "base/location.h" #include "base/optional.h" #include "base/trace_event/trace_event.h" -#include "base/values.h" #include "content/browser/appcache/appcache_navigation_handle.h" #include "content/browser/appcache/appcache_navigation_handle_core.h" #include "content/browser/frame_host/navigation_request_info.h" @@ -21,6 +20,7 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/global_request_id.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/navigation_ui_data.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/stream_handle.h" @@ -99,7 +99,7 @@ const scoped_refptr<ResourceResponse>& response, std::unique_ptr<StreamHandle> body, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream) {
diff --git a/content/browser/loader/navigation_url_loader_impl.h b/content/browser/loader/navigation_url_loader_impl.h index 36236d6d..5a53fd2 100644 --- a/content/browser/loader/navigation_url_loader_impl.h +++ b/content/browser/loader/navigation_url_loader_impl.h
@@ -14,10 +14,6 @@ #include "base/time/time.h" #include "content/browser/loader/navigation_url_loader.h" -namespace base { -class Value; -} - namespace net { struct RedirectInfo; class SSLInfo; @@ -27,6 +23,7 @@ class AppCacheNavigationHandle; class NavigationURLLoaderImplCore; +class NavigationData; class ServiceWorkerNavigationHandle; class StreamHandle; struct GlobalRequestID; @@ -59,7 +56,7 @@ void NotifyResponseStarted(const scoped_refptr<ResourceResponse>& response, std::unique_ptr<StreamHandle> body, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream);
diff --git a/content/browser/loader/navigation_url_loader_impl_core.cc b/content/browser/loader/navigation_url_loader_impl_core.cc index a252da6..6a7d05c8 100644 --- a/content/browser/loader/navigation_url_loader_impl_core.cc +++ b/content/browser/loader/navigation_url_loader_impl_core.cc
@@ -7,7 +7,6 @@ #include "base/bind.h" #include "base/location.h" #include "base/time/time.h" -#include "base/values.h" #include "content/browser/frame_host/navigation_request_info.h" #include "content/browser/loader/navigation_resource_handler.h" #include "content/browser/loader/resource_dispatcher_host_impl.h" @@ -15,6 +14,7 @@ #include "content/common/navigation_params.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/global_request_id.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/navigation_ui_data.h" #include "content/public/browser/ssl_status.h" #include "content/public/browser/stream_handle.h" @@ -118,7 +118,7 @@ ResourceResponse* response, std::unique_ptr<StreamHandle> body, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream) { @@ -140,7 +140,7 @@ BrowserThread::UI, FROM_HERE, base::BindOnce(&NavigationURLLoaderImpl::NotifyResponseStarted, loader_, response->DeepCopy(), base::Passed(&body), ssl_info, - std::move(navigation_data), request_id, is_download, + base::Passed(&navigation_data), request_id, is_download, is_stream)); }
diff --git a/content/browser/loader/navigation_url_loader_impl_core.h b/content/browser/loader/navigation_url_loader_impl_core.h index 5ba81dd..64fa6b0 100644 --- a/content/browser/loader/navigation_url_loader_impl_core.h +++ b/content/browser/loader/navigation_url_loader_impl_core.h
@@ -12,10 +12,6 @@ #include "base/memory/weak_ptr.h" #include "content/browser/loader/navigation_url_loader_impl.h" -namespace base { -class Value; -} - namespace net { class URLRequestContextGetter; struct RedirectInfo; @@ -29,6 +25,7 @@ class AppCacheNavigationHandleCore; class NavigationResourceHandler; +class NavigationData; class ResourceContext; class ServiceWorkerNavigationHandleCore; class StreamHandle; @@ -79,7 +76,7 @@ void NotifyResponseStarted(ResourceResponse* response, std::unique_ptr<StreamHandle> body, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream);
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc index e50e455..d3f8d1a 100644 --- a/content/browser/loader/navigation_url_loader_network_service.cc +++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -10,7 +10,6 @@ #include "base/metrics/histogram_macros.h" #include "base/task_scheduler/post_task.h" #include "base/trace_event/trace_event.h" -#include "base/values.h" #include "content/browser/appcache/appcache_navigation_handle.h" #include "content/browser/appcache/appcache_request_handler.h" #include "content/browser/blob_storage/chrome_blob_storage_context.h" @@ -36,6 +35,7 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/content_browser_client.h" #include "content/public/browser/global_request_id.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/navigation_ui_data.h" #include "content/public/browser/ssl_status.h" #include "content/public/browser/stream_handle.h" @@ -237,11 +237,11 @@ base::Unretained(service_worker_navigation_handle_core), base::Unretained(appcache_handle_core)); + ResourceRequest resource_request; url_loader_ = ThrottlingURLLoader::CreateLoaderAndStart( std::move(create_url_loader), std::vector<std::unique_ptr<content::URLLoaderThrottle>>(), - /* routing_id = */ -1, - ResourceRequest(), // not used + /* routing_id = */ -1, &resource_request, /* client = */ this, kNavigationUrlLoaderTrafficAnnotation, base::ThreadTaskRunnerHandle::Get()); } @@ -250,6 +250,7 @@ ServiceWorkerNavigationHandleCore* service_worker_navigation_handle_core, AppCacheNavigationHandleCore* appcache_handle_core, std::unique_ptr<NavigationRequestInfo> request_info, + std::unique_ptr<NavigationUIData> navigation_ui_data, mojom::URLLoaderFactoryPtrInfo factory_for_webui, int frame_tree_node_id, std::unique_ptr<service_manager::Connector> connector) { @@ -260,6 +261,7 @@ started_ = true; web_contents_getter_ = base::Bind(&GetWebContentsFromFrameTreeNodeID, frame_tree_node_id); + navigation_ui_data_ = std::move(navigation_ui_data); const ResourceType resource_type = request_info->is_main_frame ? RESOURCE_TYPE_MAIN_FRAME : RESOURCE_TYPE_SUB_FRAME; @@ -276,9 +278,9 @@ url_loader_ = ThrottlingURLLoader::CreateLoaderAndStart( webui_factory_ptr_.get(), GetContentClient()->browser()->CreateURLLoaderThrottles( - web_contents_getter_), + web_contents_getter_, navigation_ui_data_.get()), 0 /* routing_id */, 0 /* request_id? */, mojom::kURLLoadOptionNone, - *resource_request_, this, kNavigationUrlLoaderTrafficAnnotation, + resource_request_.get(), this, kNavigationUrlLoaderTrafficAnnotation, base::ThreadTaskRunnerHandle::Get()); return; } @@ -344,8 +346,8 @@ url_loader_ = ThrottlingURLLoader::CreateLoaderAndStart( std::move(start_loader_callback), GetContentClient()->browser()->CreateURLLoaderThrottles( - web_contents_getter_), - frame_tree_node_id_, *resource_request_, this, + web_contents_getter_, navigation_ui_data_.get()), + frame_tree_node_id_, resource_request_.get(), this, kNavigationUrlLoaderTrafficAnnotation, base::ThreadTaskRunnerHandle::Get()); @@ -419,9 +421,9 @@ url_loader_ = ThrottlingURLLoader::CreateLoaderAndStart( factory, GetContentClient()->browser()->CreateURLLoaderThrottles( - web_contents_getter_), - frame_tree_node_id_, 0 /* request_id? */, options, *resource_request_, - this, kNavigationUrlLoaderTrafficAnnotation, + web_contents_getter_, navigation_ui_data_.get()), + frame_tree_node_id_, 0 /* request_id? */, options, + resource_request_.get(), this, kNavigationUrlLoaderTrafficAnnotation, base::ThreadTaskRunnerHandle::Get()); } @@ -608,6 +610,7 @@ int redirect_limit_ = net::URLRequest::kMaxRedirects; ResourceContext* resource_context_; base::Callback<WebContents*()> web_contents_getter_; + std::unique_ptr<NavigationUIData> navigation_ui_data_; scoped_refptr<URLLoaderFactoryGetter> default_url_loader_factory_getter_; mojom::URLLoaderFactoryPtr webui_factory_ptr_; @@ -782,6 +785,7 @@ base::Unretained(service_worker_navigation_handle_core), base::Unretained(appcache_handle_core), base::Passed(std::move(request_info)), + base::Passed(std::move(navigation_ui_data)), base::Passed(std::move(factory_for_webui)), frame_tree_node_id, base::Passed(ServiceManagerConnection::GetForProcess() @@ -842,7 +846,7 @@ delegate_->OnResponseStarted( std::move(response), std::move(url_loader_client_endpoints), nullptr, - std::move(ssl_info), base::Value() /* navigation_data */, + std::move(ssl_info), std::unique_ptr<NavigationData>(), GlobalRequestID(-1, g_next_request_id), is_download, false /* is_stream */, request_controller_->TakeSubresourceLoaderParams());
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index 36c4ff74..6fa19390 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1041,7 +1041,7 @@ bool allow_download = false; bool do_not_prompt_for_login = false; bool report_raw_headers = false; - int load_flags = BuildLoadFlagsForRequest(request_data, is_sync_load); + int load_flags = BuildLoadFlagsForRequest(request_data); bool is_navigation_stream_request = IsBrowserSideNavigationEnabled() && IsResourceTypeFrame(request_data.resource_type);
diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc index 71331e2a..ac57777 100644 --- a/content/browser/loader/resource_loader.cc +++ b/content/browser/loader/resource_loader.cc
@@ -27,6 +27,7 @@ #include "content/browser/ssl/ssl_manager.h" #include "content/common/loader_util.h" #include "content/public/browser/resource_dispatcher_host_login_delegate.h" +#include "content/public/common/appcache_info.h" #include "content/public/common/browser_side_navigation_policy.h" #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" @@ -71,8 +72,10 @@ response->head.socket_address = response_info.socket_address; const content::ResourceRequestInfo* request_info = content::ResourceRequestInfo::ForRequest(request); - if (request_info) - response->head.previews_state = request_info->GetPreviewsState(); + if (request_info) { + response->head.previews_state = + static_cast<int>(request_info->GetPreviewsState()); + } if (info->ShouldReportRawHeaders()) { response->head.raw_request_response_info = BuildRawRequestResponseInfo( *request, raw_request_headers, raw_response_headers); @@ -95,6 +98,7 @@ ServiceWorkerResponseInfo::ForRequest(request); if (service_worker_info) service_worker_info->GetExtraResponseInfo(&response->head); + response->head.appcache_id = kAppCacheNoCacheId; AppCacheInterceptor::GetExtraResponseInfo( request, &response->head.appcache_id, &response->head.appcache_manifest_url);
diff --git a/content/browser/locks/lock_manager.cc b/content/browser/locks/lock_manager.cc index d02e108..c4fdf7d 100644 --- a/content/browser/locks/lock_manager.cc +++ b/content/browser/locks/lock_manager.cc
@@ -7,11 +7,14 @@ #include <algorithm> #include <memory> #include <utility> +#include <vector> #include "base/stl_util.h" #include "content/public/browser/browser_thread.h" #include "mojo/public/cpp/bindings/strong_binding.h" +using blink::mojom::LockMode; + namespace content { namespace { @@ -135,6 +138,31 @@ ProcessRequests(origin); } +void LockManager::QueryState(QueryStateCallback callback) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + const url::Origin& origin = bindings_.dispatch_context(); + if (!base::ContainsKey(origins_, origin)) + return; + OriginState& state = origins_[origin]; + + std::vector<blink::mojom::LockInfoPtr> pending; + pending.reserve(state.requested.size()); + for (const auto& id_lock_pair : state.requested) { + pending.emplace_back(base::in_place, id_lock_pair.second->name, + id_lock_pair.second->mode); + } + + std::vector<blink::mojom::LockInfoPtr> held; + held.reserve(state.held.size()); + for (const auto& id_lock_pair : state.held) { + held.emplace_back(base::in_place, id_lock_pair.second->name, + id_lock_pair.second->mode); + } + + std::move(callback).Run(std::move(pending), std::move(held)); +} + bool LockManager::IsGrantable(const url::Origin& origin, const std::string& name, LockMode mode) {
diff --git a/content/browser/locks/lock_manager.h b/content/browser/locks/lock_manager.h index 2e5cc7ed..5e8df5b 100644 --- a/content/browser/locks/lock_manager.h +++ b/content/browser/locks/lock_manager.h
@@ -33,13 +33,16 @@ // Request a lock. When the lock is acquired, |callback| will be invoked with // a LockHandle. void RequestLock(const std::string& name, - LockMode mode, + blink::mojom::LockMode mode, WaitMode wait, blink::mojom::LockRequestPtr request) override; // Called by a LockHandle's implementation when destructed. void ReleaseLock(const url::Origin& origin, int64_t id); + // Called to request a snapshot of the current lock state for an origin. + void QueryState(QueryStateCallback callback) override; + protected: friend class base::RefCountedThreadSafe<LockManager>; ~LockManager() override; @@ -53,8 +56,9 @@ OriginState(); ~OriginState(); - bool IsGrantable(const std::string& name, LockMode mode) const; - void MergeLockState(const std::string& name, LockMode mode); + bool IsGrantable(const std::string& name, + blink::mojom::LockMode mode) const; + void MergeLockState(const std::string& name, blink::mojom::LockMode mode); std::map<int64_t, std::unique_ptr<Lock>> requested; std::map<int64_t, std::unique_ptr<Lock>> held; @@ -67,7 +71,7 @@ bool IsGrantable(const url::Origin& origin, const std::string& name, - LockMode mode); + blink::mojom::LockMode mode); // Called when a lock is requested and optionally when a lock is released, // to process outstanding requests within the origin.
diff --git a/content/browser/media/capture/aura_window_capture_machine.cc b/content/browser/media/capture/aura_window_capture_machine.cc index 4f8e8f5..045314e 100644 --- a/content/browser/media/capture/aura_window_capture_machine.cc +++ b/content/browser/media/capture/aura_window_capture_machine.cc
@@ -348,11 +348,12 @@ if (scaler) yuv_readback_pipeline_->SetScaler(nullptr); } else if (!scaler || !scaler->IsSameScaleRatio(scale_from, scale_to)) { - std::unique_ptr<viz::GLHelper::ScalerInterface> scaler = + std::unique_ptr<viz::GLHelper::ScalerInterface> fast_scaler = gl_helper->CreateScaler(viz::GLHelper::SCALER_QUALITY_FAST, scale_from, scale_to, false, false, false); - DCHECK(scaler); // Arguments to CreateScaler() should never be invalid. - yuv_readback_pipeline_->SetScaler(std::move(scaler)); + DCHECK( + fast_scaler); // Arguments to CreateScaler() should never be invalid. + yuv_readback_pipeline_->SetScaler(std::move(fast_scaler)); } yuv_readback_pipeline_->ReadbackYUV(
diff --git a/content/browser/media/media_interface_proxy.cc b/content/browser/media/media_interface_proxy.cc index 9a04a8f..1db9bcf 100644 --- a/content/browser/media/media_interface_proxy.cc +++ b/content/browser/media/media_interface_proxy.cc
@@ -174,12 +174,14 @@ } void MediaInterfaceProxy::CreateCdmProxy( + const std::string& cdm_guid, media::mojom::CdmProxyRequest request) { NOTREACHED() << "The CdmProxy should only be created by a CDM."; } service_manager::mojom::InterfaceProviderPtr -MediaInterfaceProxy::GetFrameServices(const std::string& cdm_file_system_id) { +MediaInterfaceProxy::GetFrameServices(const std::string& cdm_guid, + const std::string& cdm_file_system_id) { // Register frame services. service_manager::mojom::InterfaceProviderPtr interfaces; @@ -205,8 +207,9 @@ &CdmStorageImpl::Create, render_frame_host_, cdm_file_system_id)); } - provider->registry()->AddInterface(base::BindRepeating( - &MediaInterfaceProxy::CreateCdmProxyInternal, base::Unretained(this))); + provider->registry()->AddInterface( + base::BindRepeating(&MediaInterfaceProxy::CreateCdmProxyInternal, + base::Unretained(this), cdm_guid)); #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) #endif // BUILDFLAG(ENABLE_MOJO_CDM) @@ -239,8 +242,9 @@ ServiceManagerConnection::GetForProcess()->GetConnector(); connector->BindInterface(media::mojom::kMediaServiceName, &media_service); - media_service->CreateInterfaceFactory(MakeRequest(&interface_factory_ptr_), - GetFrameServices(std::string())); + media_service->CreateInterfaceFactory( + MakeRequest(&interface_factory_ptr_), + GetFrameServices(std::string(), std::string())); interface_factory_ptr_.set_connection_error_handler( base::BindOnce(&MediaInterfaceProxy::OnMediaServiceConnectionError, @@ -345,8 +349,9 @@ #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) InterfaceFactoryPtr interface_factory_ptr; - cdm_service->CreateInterfaceFactory(MakeRequest(&interface_factory_ptr), - GetFrameServices(cdm_file_system_id)); + cdm_service->CreateInterfaceFactory( + MakeRequest(&interface_factory_ptr), + GetFrameServices(cdm_guid, cdm_file_system_id)); interface_factory_ptr.set_connection_error_handler( base::BindOnce(&MediaInterfaceProxy::OnCdmServiceConnectionError, base::Unretained(this), cdm_guid)); @@ -369,13 +374,14 @@ #if BUILDFLAG(ENABLE_LIBRARY_CDMS) void MediaInterfaceProxy::CreateCdmProxyInternal( + const std::string& cdm_guid, media::mojom::CdmProxyRequest request) { DVLOG(1) << __func__; DCHECK(thread_checker_.CalledOnValidThread()); InterfaceFactory* factory = GetMediaInterfaceFactory(); if (factory) - factory->CreateCdmProxy(std::move(request)); + factory->CreateCdmProxy(cdm_guid, std::move(request)); } #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
diff --git a/content/browser/media/media_interface_proxy.h b/content/browser/media/media_interface_proxy.h index 3ee6e43..2a0b5b5 100644 --- a/content/browser/media/media_interface_proxy.h +++ b/content/browser/media/media_interface_proxy.h
@@ -48,7 +48,8 @@ media::mojom::RendererRequest request) final; void CreateCdm(const std::string& key_system, media::mojom::ContentDecryptionModuleRequest request) final; - void CreateCdmProxy(media::mojom::CdmProxyRequest request) final; + void CreateCdmProxy(const std::string& cdm_guid, + media::mojom::CdmProxyRequest request) final; private: using InterfaceFactoryPtr = media::mojom::InterfaceFactoryPtr; @@ -57,6 +58,7 @@ // mojo media (or CDM) service running remotely. |cdm_file_system_id| is // used to register the appropriate CdmStorage interface needed by the CDM. service_manager::mojom::InterfaceProviderPtr GetFrameServices( + const std::string& cdm_guid, const std::string& cdm_file_system_id); // Gets the MediaService |interface_factory_ptr_|. Returns null if unexpected @@ -92,7 +94,8 @@ // Creates a CdmProxy for the CDM in CdmService. Not implemented in // CreateCdmProxy() because we don't want any client to be able to create // a CdmProxy. - void CreateCdmProxyInternal(media::mojom::CdmProxyRequest request); + void CreateCdmProxyInternal(const std::string& cdm_guid, + media::mojom::CdmProxyRequest request); #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) // Safe to hold a raw pointer since |this| is owned by RenderFrameHostImpl.
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc index a8b7afa..de8c3b83 100644 --- a/content/browser/media/media_internals.cc +++ b/content/browser/media/media_internals.cc
@@ -430,11 +430,7 @@ case media::MediaLogEvent::Type::WEBMEDIAPLAYER_DESTROYED: { // Upon player destruction report UMA data; if the player is not torn down // before process exit, it will be logged during OnProcessTerminated(). - auto it = player_info_map.find(event.id); - if (it == player_info_map.end()) - break; - - ReportUMAForPipelineStatus(it->second); + ReportUMAForPipelineStatus(player_info); player_info_map.erase(it); } default:
diff --git a/content/browser/network_service_browsertest.cc b/content/browser/network_service_browsertest.cc index 2e51cf1c..72014d5 100644 --- a/content/browser/network_service_browsertest.cc +++ b/content/browser/network_service_browsertest.cc
@@ -5,6 +5,8 @@ #include "base/memory/ref_counted_memory.h" #include "base/test/scoped_feature_list.h" #include "build/build_config.h" +#include "content/browser/storage_partition_impl.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/url_data_source.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" @@ -17,6 +19,7 @@ #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" #include "content/shell/browser/shell.h" +#include "net/dns/mock_host_resolver.h" namespace content { @@ -153,6 +156,38 @@ ASSERT_TRUE(CheckCanLoadHttp()); } +class NetworkServiceInProcessBrowserTest : public ContentBrowserTest { + public: + NetworkServiceInProcessBrowserTest() { + std::vector<base::Feature> features; + features.push_back(features::kNetworkService); + features.push_back(features::kNetworkServiceInProcess); + scoped_feature_list_.InitWithFeatures(features, + std::vector<base::Feature>()); + } + + void SetUpOnMainThread() override { + host_resolver()->AddRule("*", "127.0.0.1"); + EXPECT_TRUE(embedded_test_server()->Start()); + } + + private: + base::test::ScopedFeatureList scoped_feature_list_; + + DISALLOW_COPY_AND_ASSIGN(NetworkServiceInProcessBrowserTest); +}; + +// Verifies that in-process network service works. +IN_PROC_BROWSER_TEST_F(NetworkServiceInProcessBrowserTest, Basic) { + GURL test_url = embedded_test_server()->GetURL("foo.com", "/echo"); + StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( + BrowserContext::GetDefaultStoragePartition( + shell()->web_contents()->GetBrowserContext())); + NavigateToURL(shell(), test_url); + ASSERT_EQ(net::OK, + LoadBasicRequest(partition->GetNetworkContext(), test_url)); +} + } // namespace } // namespace content
diff --git a/content/browser/renderer_host/DEPS b/content/browser/renderer_host/DEPS index 535dcfd..eb2fa51 100644 --- a/content/browser/renderer_host/DEPS +++ b/content/browser/renderer_host/DEPS
@@ -56,13 +56,4 @@ "render_widget_host_input_event_router.cc": [ "+content/browser/frame_host/render_widget_host_view_guest.h", ], - # TODO(crbug.com/797362): The dependency is required to find the correct - # target from a FrameSinkId. This should be removed from here, and instead - # provided through a delegate interface that is implemented in web_contents. - "render_widget_targeter.cc": [ - "+content/browser/frame_host/frame_tree_node.h", - "+content/browser/frame_host/render_frame_host_impl.h", - "+content/browser/frame_host/render_frame_host_manager.h", - "+content/browser/frame_host/render_frame_proxy_host.h", - ], }
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.h b/content/browser/renderer_host/browser_compositor_view_mac.h index 94b898df..4967dd5 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.h +++ b/content/browser/renderer_host/browser_compositor_view_mac.h
@@ -25,7 +25,7 @@ class BrowserCompositorMacClient { public: - virtual SkColor BrowserCompositorMacGetGutterColor(SkColor color) const = 0; + virtual SkColor BrowserCompositorMacGetGutterColor() const = 0; virtual void BrowserCompositorMacOnBeginFrame() = 0; virtual void OnFrameTokenChanged(uint32_t frame_token) = 0; }; @@ -102,7 +102,7 @@ // DelegatedFrameHostClient implementation. ui::Layer* DelegatedFrameHostGetLayer() const override; bool DelegatedFrameHostIsVisible() const override; - SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override; + SkColor DelegatedFrameHostGetGutterColor() const override; gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override; bool DelegatedFrameCanCreateResizeLock() const override; viz::LocalSurfaceId GetLocalSurfaceId() const override;
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm index dc7eb8d..33118a49 100644 --- a/content/browser/renderer_host/browser_compositor_view_mac.mm +++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -507,9 +507,8 @@ return state_ == HasAttachedCompositor; } -SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor( - SkColor color) const { - return client_->BrowserCompositorMacGetGutterColor(color); +SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor() const { + return client_->BrowserCompositorMacGetGutterColor(); } gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const {
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index 439d41c..0222a788 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -97,10 +97,10 @@ struct CompositorDependencies { CompositorDependencies() : frame_sink_id_allocator(kDefaultClientId) { - // TODO(kylechar): Switch this back to kDisableSurfaceReferences. + // TODO(crbug.com/676384): Remove flag along with surface sequences. auto surface_lifetime_type = base::CommandLine::ForCurrentProcess()->HasSwitch( - "enable-surface-references") + switches::kEnableSurfaceReferences) ? viz::SurfaceManager::LifetimeType::REFERENCES : viz::SurfaceManager::LifetimeType::SEQUENCES; @@ -484,6 +484,7 @@ needs_animate_(false), pending_frames_(0U), layer_tree_frame_sink_request_pending_(false), + lock_manager_(base::ThreadTaskRunnerHandle::Get(), this), weak_factory_(this) { GetHostFrameSinkManager()->RegisterFrameSinkId(frame_sink_id_, this); #if DCHECK_IS_ON() @@ -588,8 +589,6 @@ settings.initial_debug_state.show_fps_counter = command_line->HasSwitch(cc::switches::kUIShowFPSCounter); settings.single_thread_proxy_scheduler = true; - settings.resource_settings.texture_target_exception_list = - CreateBufferUsageAndFormatExceptionList(); animation_host_ = cc::AnimationHost::CreateMainInstance(); @@ -650,10 +649,6 @@ root_window_->GetLayer()->SetBounds(size); } -void CompositorImpl::SetDeferCommits(bool defer_commits) { - host_->SetDeferCommits(defer_commits); -} - void CompositorImpl::SetRequiresAlphaChannel(bool flag) { requires_alpha_channel_ = flag; } @@ -832,9 +827,9 @@ const bool should_register_begin_frame_source = !display_; display_ = std::make_unique<viz::Display>( - viz::ServerSharedBitmapManager::current(), gpu_memory_buffer_manager, - renderer_settings, frame_sink_id_, std::move(display_output_surface), - std::move(scheduler), task_runner); + viz::ServerSharedBitmapManager::current(), renderer_settings, + frame_sink_id_, std::move(display_output_surface), std::move(scheduler), + task_runner); auto layer_tree_frame_sink = vulkan_context_provider @@ -963,4 +958,15 @@ return !readback_layer_tree_->children().empty(); } +std::unique_ptr<ui::CompositorLock> CompositorImpl::GetCompositorLock( + ui::CompositorLockClient* client, + base::TimeDelta timeout) { + return lock_manager_.GetCompositorLock(client, timeout); +} + +void CompositorImpl::OnCompositorLockStateChanged(bool locked) { + if (host_) + host_->SetDeferCommits(locked); +} + } // namespace content
diff --git a/content/browser/renderer_host/compositor_impl_android.h b/content/browser/renderer_host/compositor_impl_android.h index 80fabcb..a98ff376 100644 --- a/content/browser/renderer_host/compositor_impl_android.h +++ b/content/browser/renderer_host/compositor_impl_android.h
@@ -28,6 +28,7 @@ #include "ui/android/resources/resource_manager_impl.h" #include "ui/android/resources/ui_resource_provider.h" #include "ui/android/window_android_compositor.h" +#include "ui/compositor/compositor_lock.h" #include "ui/display/display_observer.h" struct ANativeWindow; @@ -57,6 +58,7 @@ : public Compositor, public cc::LayerTreeHostClient, public cc::LayerTreeHostSingleThreadClient, + public ui::CompositorLockManagerClient, public ui::UIResourceProvider, public ui::WindowAndroidCompositor, public viz::HostFrameSinkClient, @@ -82,7 +84,6 @@ void SetSurface(jobject surface) override; void SetBackgroundColor(int color) override; void SetWindowBounds(const gfx::Size& size) override; - void SetDeferCommits(bool defer_commits) override; void SetRequiresAlphaChannel(bool flag) override; void SetNeedsComposite() override; ui::UIResourceProvider& GetUIResourceProvider() override; @@ -124,6 +125,9 @@ viz::FrameSinkId GetFrameSinkId() override; void AddChildFrameSink(const viz::FrameSinkId& frame_sink_id) override; void RemoveChildFrameSink(const viz::FrameSinkId& frame_sink_id) override; + std::unique_ptr<ui::CompositorLock> GetCompositorLock( + ui::CompositorLockClient* client, + base::TimeDelta timeout) override; // viz::HostFrameSinkClient implementation. void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override; @@ -133,6 +137,9 @@ void OnDisplayMetricsChanged(const display::Display& display, uint32_t changed_metrics) override; + // ui::CompositorLockManagerClient implementation. + void OnCompositorLockStateChanged(bool locked) override; + void SetVisible(bool visible); void CreateLayerTreeHost(); @@ -195,6 +202,7 @@ bool has_layer_tree_frame_sink_ = false; std::unordered_set<viz::FrameSinkId, viz::FrameSinkIdHash> pending_child_frame_sink_ids_; + ui::CompositorLockManager lock_manager_; base::WeakPtrFactory<CompositorImpl> weak_factory_; DISALLOW_COPY_AND_ASSIGN(CompositorImpl);
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc index 88c140b..a3c087c 100644 --- a/content/browser/renderer_host/delegated_frame_host.cc +++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -54,7 +54,6 @@ enable_surface_synchronization_(enable_surface_synchronization), enable_viz_(enable_viz), tick_clock_(base::DefaultTickClock::GetInstance()), - background_color_(SK_ColorRED), frame_evictor_(std::make_unique<viz::FrameEvictor>(this)), weak_ptr_factory_(this) { ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); @@ -199,26 +198,6 @@ return frame_sink_id_; } -viz::SurfaceId DelegatedFrameHost::SurfaceIdAtPoint( - viz::SurfaceHittestDelegate* delegate, - const gfx::PointF& point, - gfx::PointF* transformed_point, - bool* out_query_renderer) { - *transformed_point = point; - viz::SurfaceId surface_id(frame_sink_id_, local_surface_id_); - if (!surface_id.is_valid() || enable_viz_) - return surface_id; - viz::SurfaceHittest hittest(delegate, - GetFrameSinkManager()->surface_manager()); - gfx::Transform target_transform; - viz::SurfaceId target_local_surface_id = - hittest.GetTargetSurfaceAtPoint(surface_id, gfx::ToFlooredPoint(point), - &target_transform, out_query_renderer); - if (target_local_surface_id.is_valid()) - target_transform.TransformPoint(transformed_point); - return target_local_surface_id; -} - bool DelegatedFrameHost::TransformPointToLocalCoordSpace( const gfx::PointF& point, const viz::SurfaceId& original_surface, @@ -313,7 +292,8 @@ viz::SurfaceId surface_id(frame_sink_id_, client_->GetLocalSurfaceId()); client_->DelegatedFrameHostGetLayer()->SetShowPrimarySurface( - surface_id, current_frame_size_in_dip_, GetSurfaceReferenceFactory()); + surface_id, current_frame_size_in_dip_, GetGutterColor(), + GetSurfaceReferenceFactory()); if (compositor_) compositor_->OnChildResizing(); // Input throttling and guttering are handled differently when surface @@ -338,7 +318,7 @@ // In fullscreen mode resizing is uncommon, so it makes more sense to // make the initial switch to fullscreen mode look better by using black as // the gutter color. - return client_->DelegatedFrameHostGetGutterColor(background_color_); + return client_->DelegatedFrameHostGetGutterColor(); } void DelegatedFrameHost::UpdateGutters() { @@ -508,8 +488,6 @@ root_pass->damage_rect = gfx::Rect(frame_size); } - background_color_ = frame.metadata.root_background_color; - if (frame_size.IsEmpty()) { DCHECK(frame.resource_list.empty()); EvictDelegatedFrame(); @@ -584,7 +562,8 @@ } } else { client_->DelegatedFrameHostGetLayer()->SetShowPrimarySurface( - surface_info.id(), frame_size_in_dip, GetSurfaceReferenceFactory()); + surface_info.id(), frame_size_in_dip, GetGutterColor(), + GetSurfaceReferenceFactory()); } client_->DelegatedFrameHostGetLayer()->SetFallbackSurfaceId(
diff --git a/content/browser/renderer_host/delegated_frame_host.h b/content/browser/renderer_host/delegated_frame_host.h index 8e5b197..e8fac50 100644 --- a/content/browser/renderer_host/delegated_frame_host.h +++ b/content/browser/renderer_host/delegated_frame_host.h
@@ -61,9 +61,8 @@ virtual ui::Layer* DelegatedFrameHostGetLayer() const = 0; virtual bool DelegatedFrameHostIsVisible() const = 0; - // Returns the color that the resize gutters should be drawn with. Takes the - // suggested color from the current page background. - virtual SkColor DelegatedFrameHostGetGutterColor(SkColor color) const = 0; + // Returns the color that the resize gutters should be drawn with. + virtual SkColor DelegatedFrameHostGetGutterColor() const = 0; virtual gfx::Size DelegatedFrameHostDesiredSizeInDIP() const = 0; virtual bool DelegatedFrameCanCreateResizeLock() const = 0; @@ -164,12 +163,6 @@ void EndFrameSubscription(); bool HasFrameSubscriber() const { return !!frame_subscriber_; } viz::FrameSinkId GetFrameSinkId(); - // Returns a null SurfaceId if this DelegatedFrameHost has not yet created - // a compositor Surface. - viz::SurfaceId SurfaceIdAtPoint(viz::SurfaceHittestDelegate* delegate, - const gfx::PointF& point, - gfx::PointF* transformed_point, - bool* out_query_renderer); // Given the SurfaceID of a Surface that is contained within this class' // Surface, find the relative transform between the Surfaces and apply it @@ -191,8 +184,7 @@ void SetNeedsBeginFrames(bool needs_begin_frames); void DidNotProduceFrame(const viz::BeginFrameAck& ack); - // Exposed for tests. - viz::SurfaceId SurfaceIdForTesting() const { + viz::SurfaceId GetCurrentSurfaceId() const { return viz::SurfaceId(frame_sink_id_, local_surface_id_); } viz::CompositorFrameSinkSupport* GetCompositorFrameSinkSupportForTesting() {
diff --git a/content/browser/renderer_host/delegated_frame_host_client_aura.cc b/content/browser/renderer_host/delegated_frame_host_client_aura.cc index 4c1905e..cbb2d2d 100644 --- a/content/browser/renderer_host/delegated_frame_host_client_aura.cc +++ b/content/browser/renderer_host/delegated_frame_host_client_aura.cc
@@ -28,8 +28,7 @@ return !render_widget_host_view_->host_->is_hidden(); } -SkColor DelegatedFrameHostClientAura::DelegatedFrameHostGetGutterColor( - SkColor color) const { +SkColor DelegatedFrameHostClientAura::DelegatedFrameHostGetGutterColor() const { // When making an element on the page fullscreen the element's background // may not match the page's, so use black as the gutter color to avoid // flashes of brighter colors during the transition. @@ -38,7 +37,7 @@ ->IsFullscreenForCurrentTab()) { return SK_ColorBLACK; } - return color; + return render_widget_host_view_->background_color_; } gfx::Size DelegatedFrameHostClientAura::DelegatedFrameHostDesiredSizeInDIP()
diff --git a/content/browser/renderer_host/delegated_frame_host_client_aura.h b/content/browser/renderer_host/delegated_frame_host_client_aura.h index 6f5590be..0f919f7 100644 --- a/content/browser/renderer_host/delegated_frame_host_client_aura.h +++ b/content/browser/renderer_host/delegated_frame_host_client_aura.h
@@ -31,7 +31,7 @@ // DelegatedFrameHostClient implementation. ui::Layer* DelegatedFrameHostGetLayer() const override; bool DelegatedFrameHostIsVisible() const override; - SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override; + SkColor DelegatedFrameHostGetGutterColor() const override; gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override; bool DelegatedFrameCanCreateResizeLock() const override; std::unique_ptr<CompositorResizeLock> DelegatedFrameHostCreateResizeLock()
diff --git a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc index f451534b..3abbe83aa 100644 --- a/content/browser/renderer_host/input/synthetic_gesture_target_base.cc +++ b/content/browser/renderer_host/input/synthetic_gesture_target_base.cc
@@ -96,7 +96,7 @@ // We assume that platforms supporting touch have their own implementation of // SyntheticGestureTarget to route the events through their respective input // stack. - CHECK(false) << "Touch events not supported for this browser."; + LOG(ERROR) << "Touch events not supported for this browser."; } void SyntheticGestureTargetBase::DispatchWebMouseWheelEventToPlatform(
diff --git a/content/browser/renderer_host/media/audio_input_sync_writer.cc b/content/browser/renderer_host/media/audio_input_sync_writer.cc index 681680b..8571509 100644 --- a/content/browser/renderer_host/media/audio_input_sync_writer.cc +++ b/content/browser/renderer_host/media/audio_input_sync_writer.cc
@@ -279,10 +279,10 @@ LOG(WARNING) << error_message; AddToNativeLog(error_message); if (write_error_count_ == 50) { - const std::string error_message = + const std::string cap_error_message = "AISW: Log cap reached, suppressing further fifo overflow logs."; - LOG(WARNING) << error_message; - AddToNativeLog(error_message); + LOG(WARNING) << cap_error_message; + AddToNativeLog(cap_error_message); } } return false;
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc index caa17e6e..4f610b9f 100644 --- a/content/browser/renderer_host/media/media_stream_manager.cc +++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -305,8 +305,7 @@ void SetState(MediaStreamType stream_type, MediaRequestState new_state) { if (stream_type == NUM_MEDIA_TYPES) { for (int i = MEDIA_NO_SERVICE + 1; i < NUM_MEDIA_TYPES; ++i) { - const MediaStreamType stream_type = static_cast<MediaStreamType>(i); - state_[stream_type] = new_state; + state_[static_cast<MediaStreamType>(i)] = new_state; } } else { state_[stream_type] = new_state;
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc index 59616a01..36eed1a 100644 --- a/content/browser/renderer_host/media/video_capture_manager.cc +++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -375,10 +375,14 @@ VideoCaptureControllerEventHandler* client_handler, const DoneCB& done_cb) { DCHECK_CURRENTLY_ON(BrowserThread::IO); - std::ostringstream string_stream; - string_stream << "ConnectClient: session_id = " << session_id << ", request: " - << media::VideoCaptureFormat::ToString(params.requested_format); - EmitLogMessage(string_stream.str(), 1); + { + std::ostringstream string_stream; + string_stream << "ConnectClient: session_id = " << session_id + << ", request: " + << media::VideoCaptureFormat::ToString( + params.requested_format); + EmitLogMessage(string_stream.str(), 1); + } VideoCaptureController* controller = GetOrCreateController(session_id, params);
diff --git a/content/browser/renderer_host/overscroll_controller.cc b/content/browser/renderer_host/overscroll_controller.cc index 0c0a0211..6339033 100644 --- a/content/browser/renderer_host/overscroll_controller.cc +++ b/content/browser/renderer_host/overscroll_controller.cc
@@ -148,6 +148,14 @@ event.GetType() == blink::WebInputEvent::kGestureFlingStart); } +void OverscrollController::OnDidOverscroll( + const ui::DidOverscrollParams& params) { + // TODO(sunyunjia): We should also decide whether to trigger overscroll, + // update scroll_state_ here. See https://crbug.com/799467. + if (delegate_) + delegate_->OnOverscrollBehaviorUpdate(params.overscroll_behavior); +} + void OverscrollController::ReceivedEventACK(const blink::WebInputEvent& event, bool processed) { if (!ShouldProcessEvent(event))
diff --git a/content/browser/renderer_host/overscroll_controller.h b/content/browser/renderer_host/overscroll_controller.h index 64fdf23..48bf658e 100644 --- a/content/browser/renderer_host/overscroll_controller.h +++ b/content/browser/renderer_host/overscroll_controller.h
@@ -10,6 +10,7 @@ #include "content/common/content_export.h" #include "third_party/WebKit/public/platform/WebGestureEvent.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" +#include "ui/events/blink/did_overscroll_params.h" namespace content { @@ -50,6 +51,11 @@ // further processing should cease. bool WillHandleEvent(const blink::WebInputEvent& event); + // This is called whenever an overscroll event is generated on the renderer + // side. This is called before ReceivedEventAck. The params contains an + // OverscrollBehavior that can prevent overscroll navigation. + void OnDidOverscroll(const ui::DidOverscrollParams& params); + // This must be called when the ACK for any event comes in. This updates the // overscroll gesture status as appropriate. // Virtual for testing.
diff --git a/content/browser/renderer_host/overscroll_controller_delegate.h b/content/browser/renderer_host/overscroll_controller_delegate.h index 0ae76ba..3b8e09e 100644 --- a/content/browser/renderer_host/overscroll_controller_delegate.h +++ b/content/browser/renderer_host/overscroll_controller_delegate.h
@@ -26,6 +26,12 @@ // delegate. virtual gfx::Size GetDisplaySize() const = 0; + // This is called whenever an overscroll event is generated on the renderer + // side, and is called before OnOverscrollUpdate. The params contains an + // OverscrollBehavior that can prevent overscroll navigation. + virtual void OnOverscrollBehaviorUpdate( + cc::OverscrollBehavior overscroll_behavior) = 0; + // This is called for each update in the overscroll amount. Returns true if // the delegate consumed the event. virtual bool OnOverscrollUpdate(float delta_x, float delta_y) = 0;
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 1000205..2aead998 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -58,7 +58,6 @@ #include "cc/base/switches.h" #include "components/metrics/single_sample_metrics.h" #include "components/tracing/common/tracing_switches.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "components/viz/common/switches.h" #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h" #include "content/browser/appcache/appcache_dispatcher_host.h" @@ -2460,11 +2459,6 @@ if (IsCompositorImageAnimationEnabled()) command_line->AppendSwitch(switches::kEnableCompositorImageAnimations); - command_line->AppendSwitchASCII( - switches::kContentImageTextureTarget, - viz::BufferUsageAndFormatListToString( - CreateBufferUsageAndFormatExceptionList())); - // Appending disable-gpu-feature switches due to software rendering list. GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); DCHECK(gpu_data_manager); @@ -2677,7 +2671,7 @@ cc::switches::kBrowserControlsHideThreshold, cc::switches::kBrowserControlsShowThreshold, cc::switches::kRunAllCompositorStagesBeforeDraw, - switches::kDisableSurfaceReferences, + switches::kEnableSurfaceReferences, switches::kEnableSurfaceSynchronization, switches::kEnableViz, @@ -2831,7 +2825,9 @@ bool RenderProcessHostImpl::FastShutdownIfPossible(size_t page_count, bool skip_unload_handlers) { - if (page_count && GetActiveViewCount() != page_count) + // Do not shut down the process if there are active or pending views other + // than the ones we're shutting down. + if (page_count && page_count != (GetActiveViewCount() + pending_views_)) return false; if (run_renderer_in_process())
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc index f3e0d62..88480cc 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -43,6 +43,7 @@ #include "content/browser/renderer_host/render_view_host_delegate_view.h" #include "content/browser/renderer_host/render_widget_host_delegate.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" +#include "content/browser/scoped_active_url.h" #include "content/common/browser_plugin/browser_plugin_messages.h" #include "content/common/content_switches_internal.h" #include "content/common/frame_messages.h" @@ -657,13 +658,10 @@ // It could lie and send the corresponding IPC messages anyway, but we will // not act on them if enabled_bindings_ doesn't agree. If we get here without // WebUI bindings, kill the renderer process. - if (GetMainFrame()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI) { + if (GetMainFrame()->GetEnabledBindings() & BINDINGS_POLICY_WEB_UI) Send(new ViewMsg_SetWebUIProperty(GetRoutingID(), name, value)); - } else { - RecordAction( - base::UserMetricsAction("BindingsMismatchTerminate_RVH_WebUI")); - GetProcess()->Shutdown(content::RESULT_CODE_KILLED, false); - } + else + ReceivedBadMessage(GetProcess(), bad_message::RVH_WEB_UI_BINDINGS_MISMATCH); } void RenderViewHostImpl::RenderWidgetGotFocus() { @@ -733,6 +731,10 @@ } } + // Crash reports trigerred by the IPC messages below should be associated + // with URL of the main frame. + ScopedActiveURL scoped_active_url(this); + if (delegate_->OnMessageReceived(this, msg)) return true;
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index bba9a45..e2a3b86 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -19,6 +19,7 @@ #include "base/location.h" #include "base/macros.h" #include "base/memory/ptr_util.h" +#include "base/memory/shared_memory.h" #include "base/message_loop/message_loop.h" #include "base/metrics/field_trial.h" #include "base/metrics/histogram_macros.h" @@ -2210,24 +2211,22 @@ void RenderWidgetHostImpl::OnShowDisambiguationPopup( const gfx::Rect& rect_pixels, const gfx::Size& size, - const viz::SharedBitmapId& id) { + base::SharedMemoryHandle handle) { DCHECK(!rect_pixels.IsEmpty()); DCHECK(!size.IsEmpty()); - std::unique_ptr<viz::SharedBitmap> bitmap = - viz::ServerSharedBitmapManager::current()->GetSharedBitmapFromId(size, - id); - if (!bitmap) { + SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); + size_t shm_size = info.computeMinByteSize(); + + base::SharedMemory shm(handle, false /* read_only */); + if (shm_size == 0 || !shm.Map(shm_size)) { bad_message::ReceivedBadMessage(GetProcess(), bad_message::RWH_SHARED_BITMAP); return; } - DCHECK(bitmap->pixels()); - - SkImageInfo info = SkImageInfo::MakeN32Premul(size.width(), size.height()); SkBitmap zoomed_bitmap; - zoomed_bitmap.installPixels(info, bitmap->pixels(), info.minRowBytes()); + zoomed_bitmap.installPixels(info, shm.memory(), info.minRowBytes()); // Note that |rect| is in coordinates of pixels relative to the window origin. // Aura-based systems will want to convert this to DIPs. @@ -2235,9 +2234,7 @@ view_->ShowDisambiguationPopup(rect_pixels, zoomed_bitmap); // It is assumed that the disambiguation popup will make a copy of the - // provided zoomed image, so we delete this one. - zoomed_bitmap.setPixels(nullptr); - Send(new ViewMsg_ReleaseDisambiguationPopupBitmap(GetRoutingID(), id)); + // provided zoomed image, so we delete |zoomed_bitmap| and free shared memory. } void RenderWidgetHostImpl::SetIgnoreInputEvents(bool ignore_input_events) {
diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h index 8e50a95..433ef3e0 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h
@@ -19,6 +19,7 @@ #include "base/containers/queue.h" #include "base/gtest_prod_util.h" #include "base/macros.h" +#include "base/memory/shared_memory_handle.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/process/kill.h" @@ -26,7 +27,6 @@ #include "base/time/time.h" #include "base/timer/elapsed_timer.h" #include "build/build_config.h" -#include "components/viz/common/quads/shared_bitmap.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "components/viz/service/display_embedder/shared_bitmap_allocation_notifier_impl.h" #include "content/browser/renderer_host/event_with_latency_info.h" @@ -723,7 +723,7 @@ void OnUnlockMouse(); void OnShowDisambiguationPopup(const gfx::Rect& rect_pixels, const gfx::Size& size, - const viz::SharedBitmapId& id); + base::SharedMemoryHandle handle); void OnSelectionBoundsChanged( const ViewHostMsg_SelectionBounds_Params& params); void OnSetNeedsBeginFrames(bool needs_begin_frames);
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.cc b/content/browser/renderer_host/render_widget_host_input_event_router.cc index 4c22f678..18390f9 100644 --- a/content/browser/renderer_host/render_widget_host_input_event_router.cc +++ b/content/browser/renderer_host/render_widget_host_input_event_router.cc
@@ -237,6 +237,43 @@ return {target, false, transformed_point}; } +RenderWidgetHostViewBase* +RenderWidgetHostInputEventRouter::FindMouseWheelEventTarget( + RenderWidgetHostViewBase* root_view, + const blink::WebMouseWheelEvent& event, + gfx::PointF* transformed_point) const { + RenderWidgetHostViewBase* target = nullptr; + if (root_view->IsMouseLocked()) { + target = root_view->GetRenderWidgetHostImpl() + ->delegate() + ->GetMouseLockWidget() + ->GetView(); + if (!root_view->TransformPointToCoordSpaceForView( + event.PositionInWidget(), target, transformed_point)) { + return nullptr; + } + } else if (root_view->wheel_scroll_latching_enabled()) { + if (event.phase == blink::WebMouseWheelEvent::kPhaseBegan) { + auto result = FindViewAtLocation( + root_view, event.PositionInWidget(), event.PositionInScreen(), + viz::EventSource::MOUSE, transformed_point); + // TODO(crbug.com/796656): Do not ignore |result.should_query_view|. + target = result.view; + } else if (wheel_target_.target) { + target = wheel_target_.target; + *transformed_point = event.PositionInWidget() + wheel_target_.delta; + } + } else { // !root_view->IsMouseLocked() && + // !root_view->wheel_scroll_latching_enabled() + auto result = FindViewAtLocation( + root_view, event.PositionInWidget(), event.PositionInScreen(), + viz::EventSource::MOUSE, transformed_point); + // TODO(crbug.com/796656): Do not ignore |result.should_query_view|. + target = result.view; + } + return target; +} + RenderWidgetTargetResult RenderWidgetHostInputEventRouter::FindViewAtLocation( RenderWidgetHostViewBase* root_view, const gfx::PointF& point, @@ -290,14 +327,8 @@ &delegate, point, transformed_point, &query_renderer); } - // TODO(kenrb): There should be a better way to handle hit tests to surfaces - // that are no longer valid for hit testing. See https://crbug.com/790044. - auto iter = owner_map_.find(frame_sink_id); - // If the point hit a Surface whose namspace is no longer in the map, then - // it likely means the RenderWidgetHostView has been destroyed but its - // parent frame has not sent a new compositor frame since that happened. - return {(iter == owner_map_.end()) ? root_view : iter->second, query_renderer, - *transformed_point}; + auto* view = FindViewFromFrameSinkId(frame_sink_id); + return {view ? view : root_view, query_renderer, *transformed_point}; } void RenderWidgetHostInputEventRouter::RouteMouseEvent( @@ -336,57 +367,30 @@ RenderWidgetHostViewBase* root_view, blink::WebMouseWheelEvent* event, const ui::LatencyInfo& latency) { - RenderWidgetHostViewBase* target = nullptr; gfx::PointF transformed_point; + RenderWidgetHostViewBase* const target = + FindMouseWheelEventTarget(root_view, *event, &transformed_point); - if (root_view->IsMouseLocked()) { - target = root_view->GetRenderWidgetHostImpl() - ->delegate() - ->GetMouseLockWidget() - ->GetView(); - if (!root_view->TransformPointToCoordSpaceForView( - event->PositionInWidget(), target, &transformed_point)) { - root_view->WheelEventAck(*event, - INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS); - return; - } - } else if (root_view->wheel_scroll_latching_enabled()) { + if (root_view->wheel_scroll_latching_enabled()) { if (event->phase == blink::WebMouseWheelEvent::kPhaseBegan) { - auto result = FindViewAtLocation( - root_view, event->PositionInWidget(), event->PositionInScreen(), - viz::EventSource::MOUSE, &transformed_point); - // TOOD(crbug.com/796656): Do not ignore |result.should_query_view|. - wheel_target_.target = result.view; + wheel_target_.target = target; wheel_target_.delta = transformed_point - event->PositionInWidget(); - target = wheel_target_.target; - } else { - if (wheel_target_.target) { - target = wheel_target_.target; - transformed_point = event->PositionInWidget() + wheel_target_.delta; - } else if ((event->phase == blink::WebMouseWheelEvent::kPhaseEnded || - event->momentum_phase == - blink::WebMouseWheelEvent::kPhaseEnded) && - bubbling_gesture_scroll_target_.target) { - // Send a GSE to the bubbling target and cancel scroll bubbling since - // the wheel target view is destroyed and the wheel end event won't get - // processed. - blink::WebGestureEvent fake_scroll_update = - DummyGestureScrollUpdate(event->TimeStampSeconds()); - fake_scroll_update.source_device = blink::kWebGestureDeviceTouchpad; - SendGestureScrollEnd(bubbling_gesture_scroll_target_.target, - fake_scroll_update); - bubbling_gesture_scroll_target_.target = nullptr; - first_bubbling_scroll_target_.target = nullptr; - } + } else if (!wheel_target_.target && + (event->phase == blink::WebMouseWheelEvent::kPhaseEnded || + event->momentum_phase == + blink::WebMouseWheelEvent::kPhaseEnded) && + bubbling_gesture_scroll_target_.target) { + // Send a GSE to the bubbling target and cancel scroll bubbling since + // the wheel target view is destroyed and the wheel end event won't get + // processed. + blink::WebGestureEvent fake_scroll_update = + DummyGestureScrollUpdate(event->TimeStampSeconds()); + fake_scroll_update.source_device = blink::kWebGestureDeviceTouchpad; + SendGestureScrollEnd(bubbling_gesture_scroll_target_.target, + fake_scroll_update); + bubbling_gesture_scroll_target_.target = nullptr; + first_bubbling_scroll_target_.target = nullptr; } - - } else { // !root_view->IsMouseLocked() && - // !root_view->wheel_scroll_latching_enabled() - auto result = FindViewAtLocation( - root_view, event->PositionInWidget(), event->PositionInScreen(), - viz::EventSource::MOUSE, &transformed_point); - // TOOD(crbug.com/796656): Do not ignore |result.should_query_view|. - target = result.view; } if (!target) { @@ -496,7 +500,7 @@ auto result = FindViewAtLocation( root_view, original_point, original_point_in_screen, viz::EventSource::TOUCH, &transformed_point); - // TOOD(crbug.com/796656): Do not ignore |result.should_query_view|. + // TODO(crbug.com/796656): Do not ignore |result.should_query_view|. touch_target_.target = result.view; // TODO(wjmaclean): Instead of just computing a delta, we should extract @@ -1019,7 +1023,7 @@ auto result = FindViewAtLocation(root_view, original_point, original_point_in_screen, viz::EventSource::TOUCH, &transformed_point); - // TOOD(crbug.com/796656): Do not ignore |result.should_query_view|. + // TODO(crbug.com/796656): Do not ignore |result.should_query_view|. touchscreen_gesture_target_.target = result.view; touchscreen_gesture_target_.delta = transformed_point - original_point; } else if (is_gesture_start) { @@ -1062,7 +1066,7 @@ auto result = FindViewAtLocation(root_view, original_point, original_point_in_screen, viz::EventSource::TOUCH, &transformed_point); - // TOOD(crbug.com/796656): Do not ignore |result.should_query_view|. + // TODO(crbug.com/796656): Do not ignore |result.should_query_view|. touchpad_gesture_target_.target = result.view; // TODO(mohsen): Instead of just computing a delta, we should extract the // complete transform. We assume it doesn't change for the duration of the @@ -1130,4 +1134,16 @@ NOTREACHED(); } +RenderWidgetHostViewBase* +RenderWidgetHostInputEventRouter::FindViewFromFrameSinkId( + const viz::FrameSinkId& frame_sink_id) const { + // TODO(kenrb): There should be a better way to handle hit tests to surfaces + // that are no longer valid for hit testing. See https://crbug.com/790044. + auto iter = owner_map_.find(frame_sink_id); + // If the point hit a Surface whose namspace is no longer in the map, then + // it likely means the RenderWidgetHostView has been destroyed but its + // parent frame has not sent a new compositor frame since that happened. + return iter == owner_map_.end() ? nullptr : iter->second; +} + } // namespace content
diff --git a/content/browser/renderer_host/render_widget_host_input_event_router.h b/content/browser/renderer_host/render_widget_host_input_event_router.h index 38544508..14173e7 100644 --- a/content/browser/renderer_host/render_widget_host_input_event_router.h +++ b/content/browser/renderer_host/render_widget_host_input_event_router.h
@@ -171,6 +171,10 @@ RenderWidgetTargetResult FindMouseEventTarget( RenderWidgetHostViewBase* root_view, const blink::WebMouseEvent& event) const; + RenderWidgetHostViewBase* FindMouseWheelEventTarget( + RenderWidgetHostViewBase* root_view, + const blink::WebMouseWheelEvent& event, + gfx::PointF* transformed_point) const; // |mouse_event| is in the coord-space of |target|. void DispatchMouseEvent(RenderWidgetHostViewBase* root_view, @@ -186,6 +190,8 @@ RenderWidgetHostViewBase* target, const blink::WebInputEvent& event, const ui::LatencyInfo& latency) override; + RenderWidgetHostViewBase* FindViewFromFrameSinkId( + const viz::FrameSinkId& frame_sink_id) const override; FrameSinkIdOwnerMap owner_map_; TargetMap touchscreen_gesture_target_map_;
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index 55131ef..256be1a 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -845,47 +845,11 @@ ClearBeginFrameRequest(PERSISTENT_BEGIN_FRAME); } -viz::SurfaceId RenderWidgetHostViewAndroid::SurfaceIdForTesting() const { +viz::SurfaceId RenderWidgetHostViewAndroid::GetCurrentSurfaceId() const { return delegated_frame_host_ ? delegated_frame_host_->SurfaceId() : viz::SurfaceId(); } -viz::FrameSinkId RenderWidgetHostViewAndroid::FrameSinkIdAtPoint( - viz::SurfaceHittestDelegate* delegate, - const gfx::PointF& point, - gfx::PointF* transformed_point, - bool* out_query_renderer) { - if (!delegated_frame_host_) - return viz::FrameSinkId(); - - float scale_factor = view_.GetDipScale(); - DCHECK_GT(scale_factor, 0); - // The surface hittest happens in device pixels, so we need to convert the - // |point| from DIPs to pixels before hittesting. - gfx::PointF point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point); - - viz::SurfaceId surface_id = delegated_frame_host_->SurfaceId(); - if (surface_id.is_valid()) { - viz::SurfaceHittest hittest(delegate, - GetFrameSinkManager()->surface_manager()); - gfx::Transform target_transform; - surface_id = hittest.GetTargetSurfaceAtPoint( - surface_id, gfx::ToFlooredPoint(point_in_pixels), &target_transform, - out_query_renderer); - *transformed_point = point_in_pixels; - if (surface_id.is_valid()) - target_transform.TransformPoint(transformed_point); - *transformed_point = - gfx::ConvertPointToDIP(scale_factor, *transformed_point); - } - - // It is possible that the renderer has not yet produced a surface, in which - // case we return our current namespace. - if (!surface_id.is_valid()) - return GetFrameSinkId(); - return surface_id.frame_sink_id(); -} - bool RenderWidgetHostViewAndroid::TransformPointToLocalCoordSpace( const gfx::PointF& point, const viz::SurfaceId& original_surface,
diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h index bd18984..ca51f02 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.h +++ b/content/browser/renderer_host/render_widget_host_view_android.h
@@ -172,13 +172,10 @@ void SetNeedsBeginFrames(bool needs_begin_frames) override; RenderWidgetHostImpl* GetRenderWidgetHostImpl() const override; viz::FrameSinkId GetFrameSinkId() override; - viz::FrameSinkId FrameSinkIdAtPoint(viz::SurfaceHittestDelegate* delegate, - const gfx::PointF& point, - gfx::PointF* transformed_point, - bool* out_query_renderer) override; bool TransformPointToLocalCoordSpace(const gfx::PointF& point, const viz::SurfaceId& original_surface, gfx::PointF* transformed_point) override; + viz::SurfaceId GetCurrentSurfaceId() const override; bool TransformPointToCoordSpaceForView( const gfx::PointF& point, RenderWidgetHostViewBase* target_view, @@ -316,9 +313,6 @@ ImeAdapterAndroid* ime_adapter_for_testing() { return ime_adapter_android_; } - // Exposed for tests. - viz::SurfaceId SurfaceIdForTesting() const override; - ui::TouchSelectionControllerClient* GetSelectionControllerClientManagerForTesting(); void SetSelectionControllerClientForTesting(
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index d41e3e9..ec92b0a2 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -89,6 +89,7 @@ #include "ui/compositor/dip_util.h" #include "ui/display/screen.h" #include "ui/events/blink/blink_event_util.h" +#include "ui/events/blink/did_overscroll_params.h" #include "ui/events/blink/web_input_event.h" #include "ui/events/event.h" #include "ui/events/event_utils.h" @@ -1040,6 +1041,12 @@ } } +void RenderWidgetHostViewAura::DidOverscroll( + const ui::DidOverscrollParams& params) { + if (overscroll_controller_) + overscroll_controller_->OnDidOverscroll(params); +} + void RenderWidgetHostViewAura::GestureEventAck( const blink::WebGestureEvent& event, InputEventAckState ack_result) { @@ -1640,36 +1647,6 @@ event_handler_->OnMouseEvent(event); } -viz::FrameSinkId RenderWidgetHostViewAura::FrameSinkIdAtPoint( - viz::SurfaceHittestDelegate* delegate, - const gfx::PointF& point, - gfx::PointF* transformed_point, - bool* out_query_renderer) { - DCHECK(device_scale_factor_ != 0.0f); - - // TODO: this shouldn't be used with aura-mus, so that the null check so - // go away and become a DCHECK. - if (!delegated_frame_host_) { - *transformed_point = point; - return GetFrameSinkId(); - } - - // The surface hittest happens in device pixels, so we need to convert the - // |point| from DIPs to pixels before hittesting. - gfx::PointF point_in_pixels = - gfx::ConvertPointToPixel(device_scale_factor_, point); - viz::SurfaceId id = delegated_frame_host_->SurfaceIdAtPoint( - delegate, point_in_pixels, transformed_point, out_query_renderer); - *transformed_point = - gfx::ConvertPointToDIP(device_scale_factor_, *transformed_point); - - // It is possible that the renderer has not yet produced a surface, in which - // case we return our current FrameSinkId. - if (!id.is_valid()) - return GetFrameSinkId(); - return id.frame_sink_id(); -} - bool RenderWidgetHostViewAura::TransformPointToLocalCoordSpace( const gfx::PointF& point, const viz::SurfaceId& original_surface, @@ -1711,6 +1688,11 @@ return viz::FrameSinkId(); } +viz::SurfaceId RenderWidgetHostViewAura::GetCurrentSurfaceId() const { + return delegated_frame_host_ ? delegated_frame_host_->GetCurrentSurfaceId() + : viz::SurfaceId(); +} + void RenderWidgetHostViewAura::FocusedNodeChanged( bool editable, const gfx::Rect& node_bounds_in_screen) { @@ -2352,11 +2334,6 @@ return window_->GetLocalSurfaceId(); } -viz::SurfaceId RenderWidgetHostViewAura::SurfaceIdForTesting() const { - return delegated_frame_host_ ? delegated_frame_host_->SurfaceIdForTesting() - : viz::SurfaceId(); -} - void RenderWidgetHostViewAura::OnUpdateTextInputStateCalled( TextInputManager* text_input_manager, RenderWidgetHostViewBase* updated_view,
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h index 96c481b..7a5d45b 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.h +++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -157,6 +157,7 @@ InputEventAckState ack_result) override; void GestureEventAck(const blink::WebGestureEvent& event, InputEventAckState ack_result) override; + void DidOverscroll(const ui::DidOverscrollParams& params) override; void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, InputEventAckState ack_result) override; std::unique_ptr<SyntheticGestureTarget> CreateSyntheticGestureTarget() @@ -186,10 +187,6 @@ RenderWidgetHostImpl* GetRenderWidgetHostImpl() const override; viz::FrameSinkId GetFrameSinkId() override; viz::LocalSurfaceId GetLocalSurfaceId() const override; - viz::FrameSinkId FrameSinkIdAtPoint(viz::SurfaceHittestDelegate* delegate, - const gfx::PointF& point, - gfx::PointF* transformed_point, - bool* out_query_renderer) override; bool TransformPointToLocalCoordSpace(const gfx::PointF& point, const viz::SurfaceId& original_surface, gfx::PointF* transformed_point) override; @@ -198,6 +195,7 @@ RenderWidgetHostViewBase* target_view, gfx::PointF* transformed_point) override; viz::FrameSinkId GetRootFrameSinkId() override; + viz::SurfaceId GetCurrentSurfaceId() const override; void FocusedNodeChanged(bool is_editable_node, const gfx::Rect& node_bounds_in_screen) override; @@ -325,9 +323,6 @@ void SetSelectionControllerClientForTest( std::unique_ptr<TouchSelectionControllerClientAura> client); - // Exposed for tests. - viz::SurfaceId SurfaceIdForTesting() const override; - // RenderWidgetHostViewEventHandler::Delegate: gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const override; void ForwardKeyboardEventWithLatencyInfo(const NativeWebKeyboardEvent& event,
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index 65eea82..1c04e9f 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -160,7 +160,7 @@ ->GetContextFactoryPrivate() ->GetFrameSinkManager() ->surface_manager() - ->GetSurfaceForId(view->SurfaceIdForTesting()) + ->GetSurfaceForId(view->GetCurrentSurfaceId()) ->GetActiveFrameIndex(); } @@ -169,7 +169,7 @@ ->GetContextFactoryPrivate() ->GetFrameSinkManager() ->surface_manager() - ->GetSurfaceForId(view->SurfaceIdForTesting()) + ->GetSurfaceForId(view->GetCurrentSurfaceId()) ->GetActiveFrame() .render_pass_list.back() ->damage_rect; @@ -388,7 +388,7 @@ } viz::SurfaceId surface_id() const { - return GetDelegatedFrameHost()->SurfaceIdForTesting(); + return GetDelegatedFrameHost()->GetCurrentSurfaceId(); } bool HasPrimarySurface() const { @@ -2619,6 +2619,31 @@ ASSERT_EQ(0u, parent_layer->children().size()); } +TEST_F(RenderWidgetHostViewAuraTest, BackgroundColorMatchesCompositorFrame) { + gfx::Size frame_size(100, 100); + viz::LocalSurfaceId local_surface_id = + parent_local_surface_id_allocator_.GenerateId(); + + // Prevent the DelegatedFrameHost from skipping frames. + view_->DisableResizeLock(); + + view_->InitAsChild(nullptr); + aura::client::ParentWindowWithContext( + view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), + gfx::Rect()); + view_->SetSize(frame_size); + view_->Show(); + viz::CompositorFrame frame = + MakeDelegatedFrame(1.f, frame_size, gfx::Rect(frame_size)); + frame.metadata.root_background_color = SK_ColorRED; + view_->SubmitCompositorFrame(local_surface_id, std::move(frame), nullptr); + + ui::Layer* parent_layer = view_->GetNativeView()->layer(); + + EXPECT_EQ(gfx::Rect(0, 0, 100, 100), parent_layer->bounds()); + EXPECT_EQ(SK_ColorRED, parent_layer->background_color()); +} + // Resizing is disabled due to flakiness. Commit might come before // DrawWaiterForTest looks for compositor frame. crbug.com/759653 TEST_F(RenderWidgetHostViewAuraTest, DISABLED_Resize) { @@ -3683,7 +3708,7 @@ kArbitraryLocalSurfaceId, MakeDelegatedFrame(1.f, view_rect_.size(), view_rect_), nullptr); viz::SurfaceId surface_id = - view_->GetDelegatedFrameHost()->SurfaceIdForTesting(); + view_->GetDelegatedFrameHost()->GetCurrentSurfaceId(); if (surface_id.is_valid()) view_->GetDelegatedFrameHost()->OnAggregatedSurfaceDamage( surface_id.local_surface_id(), view_rect_);
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index 180e4cc..dc20cdd2 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -8,7 +8,10 @@ #include "base/logging.h" #include "base/unguessable_token.h" #include "build/build_config.h" +#include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" +#include "components/viz/service/surfaces/surface_hittest.h" #include "content/browser/accessibility/browser_accessibility_manager.h" +#include "content/browser/compositor/surface_utils.h" #include "content/browser/gpu/gpu_data_manager_impl.h" #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" #include "content/browser/renderer_host/render_process_host_impl.h" @@ -24,6 +27,7 @@ #include "ui/base/ui_base_types.h" #include "ui/display/screen.h" #include "ui/events/event.h" +#include "ui/gfx/geometry/dip_util.h" #include "ui/gfx/geometry/point_conversions.h" #include "ui/gfx/geometry/size_conversions.h" #include "ui/gfx/geometry/size_f.h" @@ -439,8 +443,33 @@ const gfx::PointF& point, gfx::PointF* transformed_point, bool* out_query_renderer) { - NOTREACHED(); - return viz::FrameSinkId(); + float device_scale_factor = ui::GetScaleFactorForNativeView(GetNativeView()); + DCHECK(device_scale_factor != 0.0f); + + // The surface hittest happens in device pixels, so we need to convert the + // |point| from DIPs to pixels before hittesting. + gfx::PointF point_in_pixels = + gfx::ConvertPointToPixel(device_scale_factor, point); + viz::SurfaceId surface_id = GetCurrentSurfaceId(); + if (!surface_id.is_valid()) { + return viz::FrameSinkId(); + } + viz::SurfaceHittest hittest(delegate, + GetFrameSinkManager()->surface_manager()); + gfx::Transform target_transform; + viz::SurfaceId target_local_surface_id = hittest.GetTargetSurfaceAtPoint( + surface_id, gfx::ToFlooredPoint(point_in_pixels), &target_transform, + out_query_renderer); + *transformed_point = point_in_pixels; + if (target_local_surface_id.is_valid()) { + target_transform.TransformPoint(transformed_point); + } + *transformed_point = + gfx::ConvertPointToDIP(device_scale_factor, *transformed_point); + // It is possible that the renderer has not yet produced a surface, in which + // case we return our current FrameSinkId. + auto frame_sink_id = target_local_surface_id.frame_sink_id(); + return frame_sink_id.is_valid() ? frame_sink_id : GetFrameSinkId(); } void RenderWidgetHostViewBase::ProcessMouseEvent( @@ -584,10 +613,6 @@ } #endif -viz::SurfaceId RenderWidgetHostViewBase::SurfaceIdForTesting() const { - return viz::SurfaceId(); -} - #if defined(USE_AURA) void RenderWidgetHostViewBase::OnDidScheduleEmbed( int routing_id,
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h index a73be9d..1115afb 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -365,6 +365,10 @@ // Obtains the root window FrameSinkId. virtual viz::FrameSinkId GetRootFrameSinkId(); + // Returns the SurfaceId currently in use by the renderer to submit compositor + // frames. + virtual viz::SurfaceId GetCurrentSurfaceId() const = 0; + //---------------------------------------------------------------------------- // The following methods are related to IME. // TODO(ekaramad): Most of the IME methods should not stay virtual after IME @@ -503,9 +507,6 @@ void OnChildFrameDestroyed(int routing_id); #endif - // Exposed for testing. - virtual viz::SurfaceId SurfaceIdForTesting() const; - protected: // Interface class only, do not construct. RenderWidgetHostViewBase();
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/content/browser/renderer_host/render_widget_host_view_child_frame.cc index abecc15..e752b4d 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.cc +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -735,6 +735,10 @@ RenderWidgetHostViewBase::ProcessGestureEvent(event, latency); } +viz::SurfaceId RenderWidgetHostViewChildFrame::GetCurrentSurfaceId() const { + return viz::SurfaceId(frame_sink_id_, last_received_local_surface_id_); +} + gfx::PointF RenderWidgetHostViewChildFrame::TransformPointToRootCoordSpaceF( const gfx::PointF& point) { if (!frame_connector_ || !last_received_local_surface_id_.is_valid()) @@ -991,10 +995,6 @@ has_frame_ = false; } -viz::SurfaceId RenderWidgetHostViewChildFrame::SurfaceIdForTesting() const { - return viz::SurfaceId(frame_sink_id_, last_received_local_surface_id_); -} - void RenderWidgetHostViewChildFrame::CreateCompositorFrameSinkSupport() { if (switches::IsMusHostingViz() || enable_viz_) return;
diff --git a/content/browser/renderer_host/render_widget_host_view_child_frame.h b/content/browser/renderer_host/render_widget_host_view_child_frame.h index 6fccebd..6f1ed4a 100644 --- a/content/browser/renderer_host/render_widget_host_view_child_frame.h +++ b/content/browser/renderer_host/render_widget_host_view_child_frame.h
@@ -143,6 +143,7 @@ void PreProcessTouchEvent(const blink::WebTouchEvent& event) override; void ProcessGestureEvent(const blink::WebGestureEvent& event, const ui::LatencyInfo& latency) override; + viz::SurfaceId GetCurrentSurfaceId() const override; gfx::PointF TransformPointToRootCoordSpaceF( const gfx::PointF& point) override; bool TransformPointToLocalCoordSpace(const gfx::PointF& point, @@ -195,8 +196,6 @@ void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override; void OnFrameTokenChanged(uint32_t frame_token) override; - // Exposed for tests. - viz::SurfaceId SurfaceIdForTesting() const override; FrameConnectorDelegate* FrameConnectorForTesting() const { return frame_connector_; }
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h index 624e5345..ab148ff 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -356,10 +356,6 @@ RenderWidgetHostImpl* GetRenderWidgetHostImpl() const override; viz::FrameSinkId GetFrameSinkId() override; viz::LocalSurfaceId GetLocalSurfaceId() const override; - viz::FrameSinkId FrameSinkIdAtPoint(viz::SurfaceHittestDelegate* delegate, - const gfx::PointF& point, - gfx::PointF* transformed_point, - bool* out_query_renderer) override; // Returns true when we can do SurfaceHitTesting for the event type. bool ShouldRouteEvent(const blink::WebInputEvent& event) const; // This method checks |event| to see if a GesturePinch event can be routed @@ -378,6 +374,7 @@ RenderWidgetHostViewBase* target_view, gfx::PointF* transformed_point) override; viz::FrameSinkId GetRootFrameSinkId() override; + viz::SurfaceId GetCurrentSurfaceId() const override; // TextInputManager::Observer implementation. void OnUpdateTextInputStateCalled(TextInputManager* text_input_manager, @@ -492,7 +489,7 @@ void PauseForPendingResizeOrRepaintsAndDraw(); // BrowserCompositorMacClient implementation. - SkColor BrowserCompositorMacGetGutterColor(SkColor color) const override; + SkColor BrowserCompositorMacGetGutterColor() const override; void BrowserCompositorMacOnBeginFrame() override; void OnFrameTokenChanged(uint32_t frame_token) override; @@ -502,9 +499,6 @@ base::TimeTicks* timebase, base::TimeDelta* interval) const override; void AcceleratedWidgetSwapCompleted() override; - // Exposed for testing. - viz::SurfaceId SurfaceIdForTesting() const override; - void SetShowingContextMenu(bool showing) override; // Helper method to obtain ui::TextInputType for the active widget from the
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 3dba408..ad35d3e 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -380,8 +380,7 @@ //////////////////////////////////////////////////////////////////////////////// // BrowserCompositorMacClient, public: -SkColor RenderWidgetHostViewMac::BrowserCompositorMacGetGutterColor( - SkColor color) const { +SkColor RenderWidgetHostViewMac::BrowserCompositorMacGetGutterColor() const { // When making an element on the page fullscreen the element's background // may not match the page's, so use black as the gutter color to avoid // flashes of brighter colors during the transition. @@ -389,7 +388,7 @@ render_widget_host_->delegate()->IsFullscreenForCurrentTab()) { return SK_ColorBLACK; } - return color; + return last_frame_root_background_color_; } void RenderWidgetHostViewMac::BrowserCompositorMacOnBeginFrame() { @@ -534,10 +533,6 @@ allow_pause_for_resize_or_repaint_ = allow; } -viz::SurfaceId RenderWidgetHostViewMac::SurfaceIdForTesting() const { - return browser_compositor_->GetDelegatedFrameHost()->SurfaceIdForTesting(); -} - ui::TextInputType RenderWidgetHostViewMac::GetTextInputType() { if (!GetActiveWidget()) return ui::TEXT_INPUT_TYPE_NONE; @@ -1531,27 +1526,6 @@ return browser_compositor_->GetDelegatedFrameHost()->GetFrameSinkId(); } -viz::FrameSinkId RenderWidgetHostViewMac::FrameSinkIdAtPoint( - viz::SurfaceHittestDelegate* delegate, - const gfx::PointF& point, - gfx::PointF* transformed_point, - bool* out_query_renderer) { - // The surface hittest happens in device pixels, so we need to convert the - // |point| from DIPs to pixels before hittesting. - float scale_factor = ui::GetScaleFactorForNativeView(cocoa_view_); - gfx::PointF point_in_pixels = gfx::ConvertPointToPixel(scale_factor, point); - viz::SurfaceId id = - browser_compositor_->GetDelegatedFrameHost()->SurfaceIdAtPoint( - delegate, point_in_pixels, transformed_point, out_query_renderer); - *transformed_point = gfx::ConvertPointToDIP(scale_factor, *transformed_point); - - // It is possible that the renderer has not yet produced a surface, in which - // case we return our current namespace. - if (!id.is_valid()) - return GetFrameSinkId(); - return id.frame_sink_id(); -} - bool RenderWidgetHostViewMac::ShouldRouteEvent( const WebInputEvent& event) const { // See also RenderWidgetHostViewAura::ShouldRouteEvent. @@ -1610,6 +1584,10 @@ return browser_compositor_->GetRootFrameSinkId(); } +viz::SurfaceId RenderWidgetHostViewMac::GetCurrentSurfaceId() const { + return browser_compositor_->GetDelegatedFrameHost()->GetCurrentSurfaceId(); +} + bool RenderWidgetHostViewMac::Send(IPC::Message* message) { if (render_widget_host_) return render_widget_host_->Send(message);
diff --git a/content/browser/renderer_host/render_widget_targeter.cc b/content/browser/renderer_host/render_widget_targeter.cc index 81efe59..b6cee9d 100644 --- a/content/browser/renderer_host/render_widget_targeter.cc +++ b/content/browser/renderer_host/render_widget_targeter.cc
@@ -4,10 +4,6 @@ #include "content/browser/renderer_host/render_widget_targeter.h" -#include "content/browser/frame_host/frame_tree_node.h" -#include "content/browser/frame_host/render_frame_host_impl.h" -#include "content/browser/frame_host/render_frame_host_manager.h" -#include "content/browser/frame_host/render_frame_proxy_host.h" #include "content/browser/renderer_host/render_widget_host_impl.h" #include "content/browser/renderer_host/render_widget_host_view_base.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" @@ -165,24 +161,9 @@ const base::Optional<gfx::PointF>& target_location, const viz::FrameSinkId& frame_sink_id) { request_in_flight_ = false; - auto* frame_proxy_host = RenderFrameProxyHost::FromID( - frame_sink_id.client_id(), frame_sink_id.sink_id()); - if (!frame_proxy_host || !root_view || !target) { - auto* frame_host = RenderFrameHostImpl::FromID(frame_sink_id.client_id(), - frame_sink_id.sink_id()); - if (frame_host) { - FoundTarget(root_view.get(), target.get(), event, latency, - target_location); - } - FlushEventQueue(); - return; - } - - auto* view = - static_cast<RenderWidgetHostViewBase*>(frame_proxy_host->frame_tree_node() - ->render_manager() - ->current_frame_host() - ->GetView()); + auto* view = delegate_->FindViewFromFrameSinkId(frame_sink_id); + if (!view) + view = target.get(); // If a client was asked to find a target, then it is necessary to keep // asking the clients until a client claims an event for itself. if (view == target.get()) {
diff --git a/content/browser/renderer_host/render_widget_targeter.h b/content/browser/renderer_host/render_widget_targeter.h index 38364f46..5b9c1f47 100644 --- a/content/browser/renderer_host/render_widget_targeter.h +++ b/content/browser/renderer_host/render_widget_targeter.h
@@ -55,6 +55,9 @@ RenderWidgetHostViewBase* target, const blink::WebInputEvent& event, const ui::LatencyInfo& latency) = 0; + + virtual RenderWidgetHostViewBase* FindViewFromFrameSinkId( + const viz::FrameSinkId& frame_sink_id) const = 0; }; // The delegate must outlive this targeter.
diff --git a/content/browser/sandbox_parameters_mac.h b/content/browser/sandbox_parameters_mac.h index 9ebb16f..e4f256c7 100644 --- a/content/browser/sandbox_parameters_mac.h +++ b/content/browser/sandbox_parameters_mac.h
@@ -20,6 +20,8 @@ // as the user's home directory. void SetupCommonSandboxParameters(sandbox::SeatbeltExecClient* client); +void SetupCDMSandboxParameters(sandbox::SeatbeltExecClient* client); + void SetupUtilitySandboxParameters(sandbox::SeatbeltExecClient* client, const base::CommandLine& command_line);
diff --git a/content/browser/sandbox_parameters_mac.mm b/content/browser/sandbox_parameters_mac.mm index 2adc63a..c60a332 100644 --- a/content/browser/sandbox_parameters_mac.mm +++ b/content/browser/sandbox_parameters_mac.mm
@@ -91,6 +91,18 @@ service_manager::SandboxMac::kSandboxHomedirAsLiteral, homedir)); } +void SetupCDMSandboxParameters(sandbox::SeatbeltExecClient* client) { + SetupCommonSandboxParameters(client); + + base::FilePath bundle_path = service_manager::SandboxMac::GetCanonicalPath( + base::mac::FrameworkBundlePath().DirName()); + CHECK(!bundle_path.empty()); + + CHECK(client->SetParameter( + service_manager::SandboxMac::kSandboxBundleVersionPath, + bundle_path.value())); +} + void SetupUtilitySandboxParameters(sandbox::SeatbeltExecClient* client, const base::CommandLine& command_line) { SetupCommonSandboxParameters(client);
diff --git a/content/browser/scoped_active_url.cc b/content/browser/scoped_active_url.cc new file mode 100644 index 0000000..cd841c0 --- /dev/null +++ b/content/browser/scoped_active_url.cc
@@ -0,0 +1,43 @@ +// Copyright 2018 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/scoped_active_url.h" + +#include "content/browser/frame_host/frame_tree.h" +#include "content/browser/frame_host/frame_tree_node.h" +#include "content/browser/frame_host/render_frame_host_impl.h" +#include "content/browser/frame_host/render_frame_proxy_host.h" +#include "content/browser/renderer_host/render_view_host_delegate.h" +#include "content/public/browser/render_frame_host.h" +#include "content/public/browser/render_view_host.h" +#include "content/public/common/content_client.h" +#include "url/gurl.h" +#include "url/origin.h" + +namespace content { + +ScopedActiveURL::ScopedActiveURL(const GURL& active_url, + const url::Origin& top_origin) { + GetContentClient()->SetActiveURL(active_url, top_origin.Serialize()); +} + +ScopedActiveURL::ScopedActiveURL(RenderFrameHost* frame) + : ScopedActiveURL( + static_cast<RenderFrameHostImpl*>(frame)->frame_tree_node()) {} + +ScopedActiveURL::ScopedActiveURL(RenderFrameProxyHost* proxy) + : ScopedActiveURL(proxy->frame_tree_node()) {} + +ScopedActiveURL::ScopedActiveURL(RenderViewHost* view) + : ScopedActiveURL(view->GetDelegate()->GetFrameTree()->root()) {} + +ScopedActiveURL::ScopedActiveURL(FrameTreeNode* node) + : ScopedActiveURL(node->current_url(), + node->frame_tree()->root()->current_origin()) {} + +ScopedActiveURL::~ScopedActiveURL() { + GetContentClient()->SetActiveURL(GURL(), ""); +} + +} // namespace content
diff --git a/content/browser/scoped_active_url.h b/content/browser/scoped_active_url.h new file mode 100644 index 0000000..58f649a --- /dev/null +++ b/content/browser/scoped_active_url.h
@@ -0,0 +1,55 @@ +// Copyright 2018 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_SCOPED_ACTIVE_URL_H_ +#define CONTENT_BROWSER_SCOPED_ACTIVE_URL_H_ + +#include "base/macros.h" + +class GURL; + +namespace url { +class Origin; +} // namespace url + +namespace content { + +class FrameTreeNode; +class RenderFrameHost; +class RenderFrameProxyHost; +class RenderViewHost; + +// ScopedActiveURL calls ContentClient::SetActiveURL when constructed +// and calls it again with empty arguments when destructed. +class ScopedActiveURL { + public: + // Calls ContentClient::SetActiveURL with |active_url| and |top_origin| (to + // set the crash keys). + ScopedActiveURL(const GURL& active_url, const url::Origin& top_origin); + + // Convenience constructor, calculating |active_url| and |top_origin| based on + // |frame|'s last committed origin and main frame. + explicit ScopedActiveURL(RenderFrameHost* frame); + + // Convenience constructor, calculating |active_url| and |top_origin| based on + // |proxy|'s last committed origin and main frame. + explicit ScopedActiveURL(RenderFrameProxyHost* proxy); + + // Convenience constructor, calculating |active_url| and |top_origin| based on + // the frame tree node of |view|'s main frame. + explicit ScopedActiveURL(RenderViewHost* view); + + // Calls ContentClient::SetActiveURL with empty arguments (to reset the crash + // keys). + ~ScopedActiveURL(); + + private: + explicit ScopedActiveURL(FrameTreeNode* node); + + DISALLOW_COPY_AND_ASSIGN(ScopedActiveURL); +}; + +} // namespace content + +#endif // CONTENT_BROWSER_SCOPED_ACTIVE_URL_H_
diff --git a/content/browser/security_exploit_browsertest.cc b/content/browser/security_exploit_browsertest.cc index f09d54c..1b344ffd 100644 --- a/content/browser/security_exploit_browsertest.cc +++ b/content/browser/security_exploit_browsertest.cc
@@ -224,14 +224,13 @@ ResourceRequest request(CreateXHRRequest(blocking_url)); // Use the same request id twice. - RenderProcessHostWatcher process_killed( - rfh->GetProcess(), RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter(rfh->GetProcess()); CreateLoaderAndStart(rfh->GetProcess(), rfh->GetRoutingID(), kRequestIdNotPreviouslyUsed, request); CreateLoaderAndStart(rfh->GetProcess(), rfh->GetRoutingID(), kRequestIdNotPreviouslyUsed, request); - process_killed.Wait(); + EXPECT_EQ(bad_message::RDH_INVALID_REQUEST_ID, kill_waiter.Wait()); } protected: @@ -248,9 +247,7 @@ RenderFrameHost* compromised_renderer = shell()->web_contents()->GetMainFrame(); - RenderProcessHostWatcher terminated( - shell()->web_contents(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter(compromised_renderer->GetProcess()); FileChooserParams params; params.default_file_name = path; @@ -260,7 +257,7 @@ IpcSecurityTestUtil::PwnMessageReceived( compromised_renderer->GetProcess()->GetChannel(), evil); - terminated.Wait(); + EXPECT_EQ(bad_message::RFH_FILE_CHOOSER_PATH, kill_waiter.Wait()); } // Ensure that we kill the renderer process if we try to give it WebUI @@ -272,12 +269,11 @@ EXPECT_EQ(base::ASCIIToUTF16("OK"), shell()->web_contents()->GetTitle()); EXPECT_EQ(0, shell()->web_contents()->GetMainFrame()->GetEnabledBindings()); - RenderProcessHostWatcher terminated( - shell()->web_contents(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); - shell()->web_contents()->GetRenderViewHost()->SetWebUIProperty( - "toolkit", "views"); - terminated.Wait(); + RenderViewHost* compromised_renderer = + shell()->web_contents()->GetRenderViewHost(); + RenderProcessHostKillWaiter kill_waiter(compromised_renderer->GetProcess()); + compromised_renderer->SetWebUIProperty("toolkit", "views"); + EXPECT_EQ(bad_message::RVH_WEB_UI_BINDINGS_MISMATCH, kill_waiter.Wait()); } // This is a test for crbug.com/312016 attempting to create duplicate @@ -463,13 +459,11 @@ // Web processes cannot make XHRs with chrome:// Origin headers. { - RenderProcessHostWatcher web_process_killed( - web_rfh->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter(web_rfh->GetProcess()); CreateLoaderAndStart(web_rfh->GetProcess(), web_rfh->GetRoutingID(), kRequestIdNotPreviouslyUsed, chrome_origin_msg); - web_process_killed.Wait(); + EXPECT_EQ(bad_message::RDH_ILLEGAL_ORIGIN, kill_waiter.Wait()); } // Web processes cannot make XHRs with URLs that the content embedder expects @@ -481,36 +475,30 @@ content::ResourceDispatcherHost::Get()->RegisterInterceptor( "Origin", "", base::Bind(&OnHttpHeaderReceived)); - RenderProcessHostWatcher web_process_killed( - web_rfh->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter(web_rfh->GetProcess()); CreateLoaderAndStart(web_rfh->GetProcess(), web_rfh->GetRoutingID(), kRequestIdNotPreviouslyUsed, embedder_isolated_origin_msg); - web_process_killed.Wait(); + EXPECT_EQ(bad_message::RDH_ILLEGAL_ORIGIN, kill_waiter.Wait()); } // Web processes cannot make XHRs with invalid Origin headers. NavigateToURL(shell(), web_url); { - RenderProcessHostWatcher web_process_killed( - web_rfh->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter(web_rfh->GetProcess()); CreateLoaderAndStart(web_rfh->GetProcess(), web_rfh->GetRoutingID(), kRequestIdNotPreviouslyUsed, invalid_origin_msg); - web_process_killed.Wait(); + EXPECT_EQ(bad_message::RDH_ILLEGAL_ORIGIN, kill_waiter.Wait()); } // Web processes cannot make XHRs with invalid scheme Origin headers. NavigateToURL(shell(), web_url); { - RenderProcessHostWatcher web_process_killed( - web_rfh->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter(web_rfh->GetProcess()); CreateLoaderAndStart(web_rfh->GetProcess(), web_rfh->GetRoutingID(), kRequestIdNotPreviouslyUsed, invalid_scheme_origin_msg); - web_process_killed.Wait(); + EXPECT_EQ(bad_message::RDH_ILLEGAL_ORIGIN, kill_waiter.Wait()); } } @@ -535,9 +523,7 @@ // Setup an URL which will never commit, allowing this test to send its own, // malformed, commit message. - GURL url(embedded_test_server()->GetURL("/title2.html")); - NavigationStallDelegate stall_delegate(url); - ResourceDispatcherHost::Get()->SetDelegate(&stall_delegate); + GURL url(embedded_test_server()->GetURL("/hung")); // Use LoadURL, as the test shouldn't wait for navigation commit. NavigationController& controller = shell()->web_contents()->GetController(); @@ -545,9 +531,8 @@ EXPECT_NE(nullptr, controller.GetPendingEntry()); EXPECT_EQ(url, controller.GetPendingEntry()->GetURL()); - RenderProcessHostWatcher exit_observer( - root->current_frame_host()->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter( + root->current_frame_host()->GetProcess()); // Create commit params with different origins in params.url and // params.origin. @@ -564,8 +549,10 @@ params->page_state = PageState::CreateFromURL(url); params->origin = url::Origin::Create(GURL("http://bar.com/")); + service_manager::mojom::InterfaceProviderPtr interface_provider; static_cast<mojom::FrameHost*>(root->current_frame_host()) - ->DidCommitProvisionalLoad(std::move(params), nullptr); + ->DidCommitProvisionalLoad(std::move(params), + mojo::MakeRequest(&interface_provider)); // When the IPC message is received and validation fails, the process is // terminated. However, the notification for that should be processed in a @@ -573,9 +560,7 @@ // considered alive. EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); - exit_observer.Wait(); - EXPECT_FALSE(exit_observer.did_exit_normally()); - ResourceDispatcherHost::Get()->SetDelegate(nullptr); + EXPECT_EQ(bad_message::RFH_INVALID_ORIGIN_ON_COMMIT, kill_waiter.Wait()); } namespace { @@ -627,16 +612,13 @@ EXPECT_TRUE(NavigateToURL(shell(), start_url)); - RenderProcessHostWatcher exit_observer( - shell()->web_contents()->GetMainFrame()->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter( + shell()->web_contents()->GetMainFrame()->GetProcess()); ScopedInterfaceProviderRequestReplacer replacer(shell()->web_contents(), nullptr); NavigateToURLAndExpectNoCommit(shell(), non_same_document_url); - exit_observer.Wait(); - - EXPECT_FALSE(exit_observer.did_exit_normally()); + EXPECT_EQ(bad_message::RFH_INTERFACE_PROVIDER_MISSING, kill_waiter.Wait()); } // Test that receiving a new InterfaceProviderRequest for a same-document @@ -649,17 +631,15 @@ EXPECT_TRUE(NavigateToURL(shell(), start_url)); - RenderProcessHostWatcher exit_observer( - shell()->web_contents()->GetMainFrame()->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter( + shell()->web_contents()->GetMainFrame()->GetProcess()); service_manager::mojom::InterfaceProviderPtr interface_provider; ScopedInterfaceProviderRequestReplacer replacer( shell()->web_contents(), mojo::MakeRequest(&interface_provider)); NavigateToURLAndExpectNoCommit(shell(), same_document_url); - exit_observer.Wait(); - - EXPECT_FALSE(exit_observer.did_exit_normally()); + EXPECT_EQ(bad_message::RFH_INTERFACE_PROVIDER_SUPERFLUOUS, + kill_waiter.Wait()); } // Test that a compromised renderer cannot ask to upload an arbitrary file in @@ -674,9 +654,8 @@ ->GetFrameTree() ->root(); - RenderProcessHostWatcher exit_observer( - root->current_frame_host()->GetProcess(), - RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + RenderProcessHostKillWaiter kill_waiter( + root->current_frame_host()->GetProcess()); // Prepare a file to upload. base::ThreadRestrictions::ScopedAllowIO allow_io_for_temp_dir; @@ -711,8 +690,7 @@ EXPECT_EQ(start_url, root->current_frame_host()->GetLastCommittedURL()); // Verify that the malicious renderer got killed. - exit_observer.Wait(); - EXPECT_FALSE(exit_observer.did_exit_normally()); + EXPECT_EQ(bad_message::RFH_ILLEGAL_UPLOAD_PARAMS, kill_waiter.Wait()); } // Test that forging a frame's unique name and commit won't allow changing the
diff --git a/content/browser/service_manager/service_manager_context.cc b/content/browser/service_manager/service_manager_context.cc index a7e9505..cdb87ff 100644 --- a/content/browser/service_manager/service_manager_context.cc +++ b/content/browser/service_manager/service_manager_context.cc
@@ -40,6 +40,7 @@ #include "content/public/common/content_client.h" #include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" +#include "content/public/common/network_service_test.mojom.h" #include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" #include "device/geolocation/geolocation_provider.h" @@ -272,12 +273,13 @@ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, base::WeakPtr<ui::ImageCursorsSet> image_cursors_set_weak_ptr, discardable_memory::DiscardableSharedMemoryManager* memory_manager) { - ui::Service::InProcessConfig config; - config.resource_runner = task_runner; - config.image_cursors_set_weak_ptr = image_cursors_set_weak_ptr; - config.memory_manager = memory_manager; - config.should_host_viz = switches::IsMusHostingViz(); - return std::make_unique<ui::Service>(&config); + ui::Service::InitParams params; + params.running_standalone = false; + params.resource_runner = task_runner; + params.image_cursors_set_weak_ptr = image_cursors_set_weak_ptr; + params.memory_manager = memory_manager; + params.should_host_viz = switches::IsMusHostingViz(); + return std::make_unique<ui::Service>(params); } void RegisterUIServiceInProcessIfNecessary( @@ -305,9 +307,11 @@ #endif std::unique_ptr<service_manager::Service> CreateNetworkService() { - // TODO(jam): make in-process network service work with test interfaces. - return std::make_unique<NetworkServiceImpl>( - std::make_unique<service_manager::BinderRegistry>()); + // The test interface doesn't need to be implemented in the in-process case. + auto registry = std::make_unique<service_manager::BinderRegistry>(); + registry->AddInterface(base::BindRepeating( + [](content::mojom::NetworkServiceTestRequest request) {})); + return std::make_unique<NetworkServiceImpl>(std::move(registry)); } } // namespace
diff --git a/content/browser/shared_worker/shared_worker_instance.cc b/content/browser/shared_worker/shared_worker_instance.cc index 83ed192..07d8173 100644 --- a/content/browser/shared_worker/shared_worker_instance.cc +++ b/content/browser/shared_worker/shared_worker_instance.cc
@@ -14,7 +14,7 @@ const url::Origin& constructor_origin, const std::string& content_security_policy, blink::WebContentSecurityPolicyType security_policy_type, - blink::WebAddressSpace creation_address_space, + blink::mojom::IPAddressSpace creation_address_space, blink::mojom::SharedWorkerCreationContextType creation_context_type) : url_(url), name_(name), @@ -22,8 +22,7 @@ content_security_policy_(content_security_policy), content_security_policy_type_(security_policy_type), creation_address_space_(creation_address_space), - creation_context_type_(creation_context_type) { -} + creation_context_type_(creation_context_type) {} SharedWorkerInstance::SharedWorkerInstance(const SharedWorkerInstance& other) = default;
diff --git a/content/browser/shared_worker/shared_worker_instance.h b/content/browser/shared_worker/shared_worker_instance.h index c71f253..c360c25e 100644 --- a/content/browser/shared_worker/shared_worker_instance.h +++ b/content/browser/shared_worker/shared_worker_instance.h
@@ -8,7 +8,7 @@ #include <string> #include "content/common/content_export.h" -#include "third_party/WebKit/public/platform/WebAddressSpace.h" +#include "third_party/WebKit/common/net/ip_address_space.mojom.h" #include "third_party/WebKit/public/platform/WebContentSecurityPolicy.h" #include "third_party/WebKit/public/web/shared_worker_creation_context_type.mojom.h" #include "url/gurl.h" @@ -26,7 +26,7 @@ const url::Origin& constructor_origin, const std::string& content_security_policy, blink::WebContentSecurityPolicyType content_security_policy_type, - blink::WebAddressSpace creation_address_space, + blink::mojom::IPAddressSpace creation_address_space, blink::mojom::SharedWorkerCreationContextType creation_context_type); SharedWorkerInstance(const SharedWorkerInstance& other); ~SharedWorkerInstance(); @@ -50,7 +50,7 @@ blink::WebContentSecurityPolicyType content_security_policy_type() const { return content_security_policy_type_; } - blink::WebAddressSpace creation_address_space() const { + blink::mojom::IPAddressSpace creation_address_space() const { return creation_address_space_; } blink::mojom::SharedWorkerCreationContextType creation_context_type() const { @@ -68,7 +68,7 @@ const std::string content_security_policy_; const blink::WebContentSecurityPolicyType content_security_policy_type_; - const blink::WebAddressSpace creation_address_space_; + const blink::mojom::IPAddressSpace creation_address_space_; const blink::mojom::SharedWorkerCreationContextType creation_context_type_; };
diff --git a/content/browser/shared_worker/shared_worker_instance_unittest.cc b/content/browser/shared_worker/shared_worker_instance_unittest.cc index 73b7bfe..c336b70c0 100644 --- a/content/browser/shared_worker/shared_worker_instance_unittest.cc +++ b/content/browser/shared_worker/shared_worker_instance_unittest.cc
@@ -23,7 +23,7 @@ return SharedWorkerInstance( script_url, name, constructor_origin, std::string(), blink::kWebContentSecurityPolicyTypeReport, - blink::kWebAddressSpacePublic, + blink::mojom::IPAddressSpace::kPublic, blink::mojom::SharedWorkerCreationContextType::kNonsecure); } @@ -193,15 +193,17 @@ } TEST_F(SharedWorkerInstanceTest, AddressSpace) { - for (int i = 0; i < static_cast<int>(blink::kWebAddressSpaceLast); i++) { + const blink::mojom::IPAddressSpace kAddressSpaces[] = { + blink::mojom::IPAddressSpace::kLocal, + blink::mojom::IPAddressSpace::kPrivate, + blink::mojom::IPAddressSpace::kPublic}; + for (auto address_space : kAddressSpaces) { SharedWorkerInstance instance( GURL("http://example.com/w.js"), "name", url::Origin::Create(GURL("http://example.com/")), std::string(), - blink::kWebContentSecurityPolicyTypeReport, - static_cast<blink::WebAddressSpace>(i), + blink::kWebContentSecurityPolicyTypeReport, address_space, blink::mojom::SharedWorkerCreationContextType::kNonsecure); - EXPECT_EQ(static_cast<blink::WebAddressSpace>(i), - instance.creation_address_space()); + EXPECT_EQ(address_space, instance.creation_address_space()); } }
diff --git a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc index 84adbfe..f782906 100644 --- a/content/browser/shared_worker/shared_worker_service_impl_unittest.cc +++ b/content/browser/shared_worker/shared_worker_service_impl_unittest.cc
@@ -309,7 +309,7 @@ mojom::SharedWorkerInfoPtr info( mojom::SharedWorkerInfo::New(GURL(url), name, std::string(), blink::kWebContentSecurityPolicyTypeReport, - blink::kWebAddressSpacePublic)); + blink::mojom::IPAddressSpace::kPublic)); mojo::MessagePipe message_pipe; *local_port = MessagePortChannel(std::move(message_pipe.handle0));
diff --git a/content/browser/site_per_process_browsertest.cc b/content/browser/site_per_process_browsertest.cc index 37445b29..6917cbc 100644 --- a/content/browser/site_per_process_browsertest.cc +++ b/content/browser/site_per_process_browsertest.cc
@@ -339,23 +339,14 @@ WaitForChildFrameSurfaceReady(child_node->current_frame_host()); - float scale_factor = GetPageScaleFactor(shell); - - // Get the view bounds of the child iframe, which should account for the - // relative offset of its direct parent within the root frame, for use in - // targeting the input event. - gfx::Rect bounds = rwhv_child->GetViewBounds(); - // Target input event to child frame. + gfx::PointF child_location(5, 5); + child_location = rwhv_child->TransformPointToRootCoordSpaceF(child_location); blink::WebMouseEvent child_event(blink::WebInputEvent::kMouseDown, blink::WebInputEvent::kNoModifiers, blink::WebInputEvent::kTimeStampForTesting); child_event.button = blink::WebPointerProperties::Button::kLeft; - child_event.SetPositionInWidget( - gfx::ToCeiledInt((bounds.x() - root_view->GetViewBounds().x() + 5) * - scale_factor), - gfx::ToCeiledInt((bounds.y() - root_view->GetViewBounds().y() + 5) * - scale_factor)); + child_event.SetPositionInWidget(child_location.x(), child_location.y()); child_event.click_count = 1; // Check the renderer hit-test API return the correct frame for @@ -364,22 +355,15 @@ viz::FrameSinkId received_frame_sink_id; base::Closure quit_closure = content::GetDeferredQuitTaskForRunLoop(&run_loop); - // TODO(crbug.com/793018): There is a confusion here about scale_factor. DCHECK_NE(root->current_frame_host()->GetInputTargetClient(), nullptr); root->current_frame_host()->GetInputTargetClient()->FrameSinkIdAt( - gfx::ScaleToCeiledPoint( - gfx::ToCeiledPoint(child_event.PositionInWidget()), scale_factor, - scale_factor), + gfx::ToCeiledPoint(child_event.PositionInWidget()), base::BindLambdaForTesting([&](const viz::FrameSinkId& id) { received_frame_sink_id = id; quit_closure.Run(); })); content::RunThisRunLoop(&run_loop); - ASSERT_EQ( - viz::FrameSinkId( - root_view->GetRenderWidgetHost()->GetProcess()->GetID(), - child_node->render_manager()->GetProxyToParent()->GetRoutingID()), - received_frame_sink_id); + ASSERT_EQ(rwhv_child->GetFrameSinkId(), received_frame_sink_id); main_frame_monitor.ResetEventReceived(); child_frame_monitor.ResetEventReceived(); @@ -2721,13 +2705,12 @@ // should kill foo_site_instance's process. RenderFrameProxyHost* foo_mainframe_rfph = root->render_manager()->GetRenderFrameProxyHost(foo_site_instance); - content::RenderProcessHostWatcher foo_terminated( - foo_mainframe_rfph->GetProcess(), - content::RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); + content::RenderProcessHostKillWaiter kill_waiter( + foo_mainframe_rfph->GetProcess()); FrameHostMsg_Detach evil_msg2(foo_mainframe_rfph->GetRoutingID()); IPC::IpcSecurityTestUtil::PwnMessageReceived( foo_mainframe_rfph->GetProcess()->GetChannel(), evil_msg2); - foo_terminated.Wait(); + EXPECT_EQ(bad_message::RFPH_DETACH, kill_waiter.Wait()); EXPECT_EQ( " Site A ------------ proxies for B C\n" @@ -3533,8 +3516,16 @@ // node1 is the root. // Initially, both node1.proxy_hosts_ and node3.proxy_hosts_ contain C. // After we kill B, make sure proxies for C are cleared. +// Flaky on Windows: crbug.com/798476 +#if defined(OS_WIN) +#define MAYBE_KillingRendererClearsDescendantProxies \ + DISABLED_KillingRendererClearsDescendantProxies +#else +#define MAYBE_KillingRendererClearsDescendantProxies \ + KillingRendererClearsDescendantProxies +#endif IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, - KillingRendererClearsDescendantProxies) { + MAYBE_KillingRendererClearsDescendantProxies) { GURL main_url(embedded_test_server()->GetURL( "a.com", "/frame_tree/page_with_two_frames_nested.html")); EXPECT_TRUE(NavigateToURL(shell(), main_url)); @@ -12873,17 +12864,13 @@ WaitForChildFrameSurfaceReady(grandchild_node->current_frame_host()); - float scale_factor = GetPageScaleFactor(shell()); - gfx::Rect child_bounds = rwhv_child->GetViewBounds(); - gfx::Rect nested_child_bounds = rwhv_grandchild->GetViewBounds(); - // Create two points to hit test: One in the child of the main frame, and // one in the frame nested within that. The hit test request is sent to the // child's renderer. gfx::Point point_in_child(1, 1); - gfx::Point point_in_nested_child( - (nested_child_bounds.x() - child_bounds.x() + 5) * scale_factor, - (nested_child_bounds.y() - child_bounds.y() + 5) * scale_factor); + gfx::PointF point_in_nested_child(5, 5); + rwhv_grandchild->TransformPointToCoordSpaceForView( + point_in_nested_child, rwhv_child, &point_in_nested_child); { base::RunLoop run_loop; @@ -12914,7 +12901,7 @@ DCHECK_NE(child_node->current_frame_host()->GetInputTargetClient(), nullptr); child_node->current_frame_host()->GetInputTargetClient()->FrameSinkIdAt( - point_in_nested_child, + gfx::ToCeiledPoint(point_in_nested_child), base::BindLambdaForTesting([&](const viz::FrameSinkId& id) { received_frame_sink_id = id; quit_closure.Run(); @@ -12923,12 +12910,7 @@ // |point_in_nested_child| should hit test to |rwhv_grandchild|. We have // to check against the nested child's RenderFrameProxyHost for the parent // frame's SiteInstance. - ASSERT_EQ(viz::FrameSinkId( - rwhv_child->GetRenderWidgetHost()->GetProcess()->GetID(), - grandchild_node->render_manager() - ->GetProxyToParent() - ->GetRoutingID()), - received_frame_sink_id); + ASSERT_EQ(rwhv_grandchild->GetFrameSinkId(), received_frame_sink_id); } }
diff --git a/content/browser/web_contents/aura/gesture_nav_simple.h b/content/browser/web_contents/aura/gesture_nav_simple.h index 999b187..040da49 100644 --- a/content/browser/web_contents/aura/gesture_nav_simple.h +++ b/content/browser/web_contents/aura/gesture_nav_simple.h
@@ -29,6 +29,8 @@ private: // OverscrollControllerDelegate: gfx::Size GetDisplaySize() const override; + void OnOverscrollBehaviorUpdate( + cc::OverscrollBehavior overscroll_behavior) override {} bool OnOverscrollUpdate(float delta_x, float delta_y) override; void OnOverscrollComplete(OverscrollMode overscroll_mode) override; void OnOverscrollModeChange(OverscrollMode old_mode,
diff --git a/content/browser/web_contents/aura/overscroll_window_animation.cc b/content/browser/web_contents/aura/overscroll_window_animation.cc index 1508bfe4..cd36565d 100644 --- a/content/browser/web_contents/aura/overscroll_window_animation.cc +++ b/content/browser/web_contents/aura/overscroll_window_animation.cc
@@ -62,6 +62,11 @@ .size(); } +void OverscrollWindowAnimation::OnOverscrollBehaviorUpdate( + cc::OverscrollBehavior overscroll_behavior) { + overscroll_behavior_ = overscroll_behavior; +} + bool OverscrollWindowAnimation::OnOverscrollUpdate(float delta_x, float delta_y) { if (direction_ == SLIDE_NONE) @@ -94,7 +99,9 @@ OverscrollSource source) { DCHECK_NE(old_mode, new_mode); Direction new_direction = GetDirectionForMode(new_mode); - if (new_direction == SLIDE_NONE) { + if (new_direction == SLIDE_NONE || + overscroll_behavior_.x != cc::OverscrollBehavior::OverscrollBehaviorType:: + kOverscrollBehaviorTypeAuto) { // The user cancelled the in progress animation. if (is_active()) CancelSlide();
diff --git a/content/browser/web_contents/aura/overscroll_window_animation.h b/content/browser/web_contents/aura/overscroll_window_animation.h index 84066f3..26e1f571 100644 --- a/content/browser/web_contents/aura/overscroll_window_animation.h +++ b/content/browser/web_contents/aura/overscroll_window_animation.h
@@ -85,6 +85,8 @@ // OverscrollControllerDelegate: gfx::Size GetDisplaySize() const override; + void OnOverscrollBehaviorUpdate( + cc::OverscrollBehavior overscroll_behavior) override; bool OnOverscrollUpdate(float delta_x, float delta_y) override; void OnOverscrollComplete(OverscrollMode overscroll_mode) override; void OnOverscrollModeChange(OverscrollMode old_mode, @@ -135,6 +137,12 @@ // on the delegate. OverscrollSource overscroll_source_ = OverscrollSource::NONE; + // OverscrollBehavior of the current overscroll gesture. Updated by + // OnOverscrollBehaviorUpdate(). This happens before before + // OnOverscrollModeChange and OnOverscrollUpdate. It prevents overscroll + // navigation if its x value is not auto. + cc::OverscrollBehavior overscroll_behavior_; + // Indicates if the current slide has been cancelled. True while the cancel // animation is in progress. bool overscroll_cancelled_;
diff --git a/content/browser/web_contents/aura/overscroll_window_animation_unittest.cc b/content/browser/web_contents/aura/overscroll_window_animation_unittest.cc index 3723390..66c1599 100644 --- a/content/browser/web_contents/aura/overscroll_window_animation_unittest.cc +++ b/content/browser/web_contents/aura/overscroll_window_animation_unittest.cc
@@ -239,4 +239,91 @@ EXPECT_FALSE(overscroll_aborted()); } +TEST_F(OverscrollWindowAnimationTest, OverscrollBehaviorAutoAllowsOverscroll) { + EXPECT_FALSE(owa()->is_active()); + EXPECT_FALSE(overscroll_started()); + EXPECT_FALSE(overscroll_completing()); + EXPECT_FALSE(overscroll_completed()); + EXPECT_FALSE(overscroll_aborted()); + + cc::OverscrollBehavior overscroll_behavior; + overscroll_behavior.x = cc::OverscrollBehavior::OverscrollBehaviorType:: + kOverscrollBehaviorTypeAuto; + owa()->OnOverscrollBehaviorUpdate(overscroll_behavior); + owa()->OnOverscrollModeChange(OVERSCROLL_NONE, OVERSCROLL_EAST, + OverscrollSource::TOUCHPAD); + EXPECT_TRUE(owa()->is_active()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, owa()->overscroll_source()); + EXPECT_TRUE(overscroll_started()); + EXPECT_FALSE(overscroll_completing()); + EXPECT_FALSE(overscroll_completed()); + EXPECT_FALSE(overscroll_aborted()); +} + +TEST_F(OverscrollWindowAnimationTest, + OverscrollBehaviorContainPreventsOverscroll) { + EXPECT_FALSE(owa()->is_active()); + EXPECT_FALSE(overscroll_started()); + EXPECT_FALSE(overscroll_completing()); + EXPECT_FALSE(overscroll_completed()); + EXPECT_FALSE(overscroll_aborted()); + + cc::OverscrollBehavior overscroll_behavior; + overscroll_behavior.x = cc::OverscrollBehavior::OverscrollBehaviorType:: + kOverscrollBehaviorTypeContain; + owa()->OnOverscrollBehaviorUpdate(overscroll_behavior); + owa()->OnOverscrollModeChange(OVERSCROLL_NONE, OVERSCROLL_EAST, + OverscrollSource::TOUCHPAD); + EXPECT_FALSE(owa()->is_active()); + EXPECT_FALSE(overscroll_started()); + EXPECT_FALSE(overscroll_completing()); + EXPECT_FALSE(overscroll_completed()); + EXPECT_FALSE(overscroll_aborted()); +} + +TEST_F(OverscrollWindowAnimationTest, + OverscrollBehaviorNonePreventsOverscroll) { + EXPECT_FALSE(owa()->is_active()); + EXPECT_FALSE(overscroll_started()); + EXPECT_FALSE(overscroll_completing()); + EXPECT_FALSE(overscroll_completed()); + EXPECT_FALSE(overscroll_aborted()); + + cc::OverscrollBehavior overscroll_behavior; + overscroll_behavior.x = cc::OverscrollBehavior::OverscrollBehaviorType:: + kOverscrollBehaviorTypeNone; + owa()->OnOverscrollBehaviorUpdate(overscroll_behavior); + owa()->OnOverscrollModeChange(OVERSCROLL_NONE, OVERSCROLL_EAST, + OverscrollSource::TOUCHPAD); + EXPECT_FALSE(owa()->is_active()); + EXPECT_FALSE(overscroll_started()); + EXPECT_FALSE(overscroll_completing()); + EXPECT_FALSE(overscroll_completed()); + EXPECT_FALSE(overscroll_aborted()); +} + +TEST_F(OverscrollWindowAnimationTest, + OverscrollBehaviorNoneOnYAllowsOverscroll) { + EXPECT_FALSE(owa()->is_active()); + EXPECT_FALSE(overscroll_started()); + EXPECT_FALSE(overscroll_completing()); + EXPECT_FALSE(overscroll_completed()); + EXPECT_FALSE(overscroll_aborted()); + + cc::OverscrollBehavior overscroll_behavior; + overscroll_behavior.x = cc::OverscrollBehavior::OverscrollBehaviorType:: + kOverscrollBehaviorTypeAuto; + overscroll_behavior.y = cc::OverscrollBehavior::OverscrollBehaviorType:: + kOverscrollBehaviorTypeNone; + owa()->OnOverscrollBehaviorUpdate(overscroll_behavior); + owa()->OnOverscrollModeChange(OVERSCROLL_NONE, OVERSCROLL_EAST, + OverscrollSource::TOUCHPAD); + EXPECT_TRUE(owa()->is_active()); + EXPECT_EQ(OverscrollSource::TOUCHPAD, owa()->overscroll_source()); + EXPECT_TRUE(overscroll_started()); + EXPECT_FALSE(overscroll_completing()); + EXPECT_FALSE(overscroll_completed()); + EXPECT_FALSE(overscroll_aborted()); +} + } // namespace content
diff --git a/content/browser/web_contents/aura/overscroll_window_delegate_unittest.cc b/content/browser/web_contents/aura/overscroll_window_delegate_unittest.cc index 6058a7cd..e488714c 100644 --- a/content/browser/web_contents/aura/overscroll_window_delegate_unittest.cc +++ b/content/browser/web_contents/aura/overscroll_window_delegate_unittest.cc
@@ -81,6 +81,9 @@ return gfx::Size(kTestDisplayWidth, kTestDisplayWidth); } + void OnOverscrollBehaviorUpdate( + cc::OverscrollBehavior overscroll_behavior) override {} + bool OnOverscrollUpdate(float delta_x, float delta_y) override { return true; }
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index c61d4ff..341b7efc3 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2449,12 +2449,7 @@ // this WebContentsImpl instance. If any other process sends the request, // it is invalid and the process must be terminated. if (!HasMatchingProcess(&frame_tree_, render_process_id)) { - base::ProcessHandle process_handle = process->GetHandle(); - if (process_handle != base::kNullProcessHandle) { - RecordAction( - base::UserMetricsAction("Terminate_ProcessMismatch_CreateNewWidget")); - process->Shutdown(RESULT_CODE_KILLED, false); - } + ReceivedBadMessage(process, bad_message::WCI_NEW_WIDGET_PROCESS_MISMATCH); return; } @@ -4025,15 +4020,12 @@ #endif void WebContentsImpl::OnDidDisplayContentWithCertificateErrors( - RenderFrameHostImpl* source, - const GURL& url) { - // TODO(nick): |url| is unused; get rid of it. + RenderFrameHostImpl* source) { controller_.ssl_manager()->DidDisplayContentWithCertErrors(); } void WebContentsImpl::OnDidRunContentWithCertificateErrors( - RenderFrameHostImpl* source, - const GURL& url) { + RenderFrameHostImpl* source) { // TODO(nick, estark): Do we need to consider |source| here somehow? NavigationEntry* entry = controller_.GetVisibleEntry(); if (!entry)
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index 60b40ef..6d9fd94 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h
@@ -1084,10 +1084,8 @@ void OnDidRunInsecureContent(RenderFrameHostImpl* source, const GURL& security_origin, const GURL& target_url); - void OnDidDisplayContentWithCertificateErrors(RenderFrameHostImpl* source, - const GURL& url); - void OnDidRunContentWithCertificateErrors(RenderFrameHostImpl* source, - const GURL& url); + void OnDidDisplayContentWithCertificateErrors(RenderFrameHostImpl* source); + void OnDidRunContentWithCertificateErrors(RenderFrameHostImpl* source); void OnDocumentLoadedInFrame(RenderFrameHostImpl* source); void OnDidFinishLoad(RenderFrameHostImpl* source, const GURL& url); void OnGoToEntryAtOffset(RenderViewHostImpl* source, int offset);
diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 7d17c87..96a4e499 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc
@@ -1096,6 +1096,12 @@ .size(); } +void WebContentsViewAura::OnOverscrollBehaviorUpdate( + cc::OverscrollBehavior overscroll_behavior) { + navigation_overlay_->relay_delegate()->OnOverscrollBehaviorUpdate( + overscroll_behavior); +} + bool WebContentsViewAura::OnOverscrollUpdate(float delta_x, float delta_y) { if (current_overscroll_gesture_ != OVERSCROLL_EAST && current_overscroll_gesture_ != OVERSCROLL_WEST) {
diff --git a/content/browser/web_contents/web_contents_view_aura.h b/content/browser/web_contents/web_contents_view_aura.h index 3e0cf1b3..534f92c 100644 --- a/content/browser/web_contents/web_contents_view_aura.h +++ b/content/browser/web_contents/web_contents_view_aura.h
@@ -156,6 +156,7 @@ // Overridden from OverscrollControllerDelegate: gfx::Size GetDisplaySize() const override; + void OnOverscrollBehaviorUpdate(cc::OverscrollBehavior) override; bool OnOverscrollUpdate(float delta_x, float delta_y) override; void OnOverscrollComplete(OverscrollMode overscroll_mode) override; void OnOverscrollModeChange(OverscrollMode old_mode,
diff --git a/content/browser/webauth/attestation_object.cc b/content/browser/webauth/attestation_object.cc deleted file mode 100644 index 4c0001c..0000000 --- a/content/browser/webauth/attestation_object.cc +++ /dev/null
@@ -1,44 +0,0 @@ -// Copyright 2017 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/webauth/attestation_object.h" - -#include <utility> - -#include "components/cbor/cbor_values.h" -#include "components/cbor/cbor_writer.h" -#include "content/browser/webauth/attestation_statement.h" - -namespace content { - -namespace { -constexpr char kAuthDataKey[] = "authData"; -constexpr char kFormatKey[] = "fmt"; -constexpr char kAttestationKey[] = "attStmt"; -} // namespace - -AttestationObject::AttestationObject( - std::unique_ptr<AuthenticatorData> data, - std::unique_ptr<AttestationStatement> statement) - : authenticator_data_(std::move(data)), - attestation_statement_(std::move(statement)) {} - -std::vector<uint8_t> AttestationObject::SerializeToCBOREncodedBytes() { - cbor::CBORValue::MapValue map; - map[cbor::CBORValue(kFormatKey)] = - cbor::CBORValue(attestation_statement_->format_name().c_str()); - map[cbor::CBORValue(kAuthDataKey)] = - cbor::CBORValue(authenticator_data_->SerializeToByteArray()); - map[cbor::CBORValue(kAttestationKey)] = - cbor::CBORValue(attestation_statement_->GetAsCBORMap()); - auto cbor = cbor::CBORWriter::Write(cbor::CBORValue(map)); - if (cbor.has_value()) { - return cbor.value(); - } - return std::vector<uint8_t>(); -} - -AttestationObject::~AttestationObject() {} - -} // namespace content
diff --git a/content/browser/webauth/attestation_object.h b/content/browser/webauth/attestation_object.h deleted file mode 100644 index 5b1993d..0000000 --- a/content/browser/webauth/attestation_object.h +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright 2017 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_WEBAUTH_ATTESTATION_OBJECT_H_ -#define CONTENT_BROWSER_WEBAUTH_ATTESTATION_OBJECT_H_ - -#include <memory> -#include <vector> - -#include "base/macros.h" -#include "content/browser/webauth/authenticator_data.h" -#include "content/common/content_export.h" - -namespace content { - -class AttestationStatement; - -// Object containing the authenticator-provided attestation every time -// a credential is created, per -// https://www.w3.org/TR/2017/WD-webauthn-20170505/#cred-attestation. -class CONTENT_EXPORT AttestationObject { - public: - AttestationObject(std::unique_ptr<AuthenticatorData> data, - std::unique_ptr<AttestationStatement> statement); - virtual ~AttestationObject(); - - // Produces a CBOR-encoded byte-array in the following format: - // {"authData": authenticator data bytes, - // "fmt": attestation format name, - // "attStmt": attestation statement bytes } - std::vector<uint8_t> SerializeToCBOREncodedBytes(); - - private: - const std::unique_ptr<AuthenticatorData> authenticator_data_; - const std::unique_ptr<AttestationStatement> attestation_statement_; - - DISALLOW_COPY_AND_ASSIGN(AttestationObject); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_WEBAUTH_ATTESTATION_OBJECT_H_
diff --git a/content/browser/webauth/attested_credential_data.cc b/content/browser/webauth/attested_credential_data.cc deleted file mode 100644 index 4b4651f1..0000000 --- a/content/browser/webauth/attested_credential_data.cc +++ /dev/null
@@ -1,61 +0,0 @@ -// Copyright 2017 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/webauth/attested_credential_data.h" - -#include <utility> - -#include "base/numerics/safe_math.h" -#include "content/browser/webauth/authenticator_utils.h" - -namespace content { - -// static -std::unique_ptr<AttestedCredentialData> -AttestedCredentialData::CreateFromU2fRegisterResponse( - const std::vector<uint8_t>& u2f_data, - std::vector<uint8_t> aaguid, - std::unique_ptr<PublicKey> public_key) { - // Extract the length of the credential (i.e. of the U2FResponse key - // handle). Length is big endian. - std::vector<uint8_t> credential_id_length(2, 0); - std::vector<uint8_t> extracted_length = authenticator_utils::Extract( - u2f_data, authenticator_utils::kU2fResponseKeyHandleLengthPos, 1); - - // Note that U2F responses only use one byte for length. - credential_id_length[1] = extracted_length[0]; - - // Extract the credential id (i.e. key handle). - std::vector<uint8_t> credential_id = authenticator_utils::Extract( - u2f_data, authenticator_utils::kU2fResponseKeyHandleStartPos, - base::strict_cast<size_t>(credential_id_length[1])); - - return std::make_unique<AttestedCredentialData>( - std::move(aaguid), std::move(credential_id_length), - std::move(credential_id), std::move(public_key)); -} - -AttestedCredentialData::AttestedCredentialData( - std::vector<uint8_t> aaguid, - std::vector<uint8_t> length, - std::vector<uint8_t> credential_id, - std::unique_ptr<PublicKey> public_key) - : aaguid_(std::move(aaguid)), - credential_id_length_(std::move(length)), - credential_id_(std::move(credential_id)), - public_key_(std::move(public_key)) {} - -std::vector<uint8_t> AttestedCredentialData::SerializeAsBytes() { - std::vector<uint8_t> attestation_data; - std::vector<uint8_t> cbor_encoded_key = public_key_->EncodeAsCBOR(); - authenticator_utils::Append(&attestation_data, aaguid_); - authenticator_utils::Append(&attestation_data, credential_id_length_); - authenticator_utils::Append(&attestation_data, credential_id_); - authenticator_utils::Append(&attestation_data, cbor_encoded_key); - return attestation_data; -} - -AttestedCredentialData::~AttestedCredentialData() {} - -} // namespace content
diff --git a/content/browser/webauth/attested_credential_data.h b/content/browser/webauth/attested_credential_data.h deleted file mode 100644 index 5ff2bd13..0000000 --- a/content/browser/webauth/attested_credential_data.h +++ /dev/null
@@ -1,56 +0,0 @@ -// Copyright 2017 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_WEBAUTH_ATTESTED_CREDENTIAL_DATA_H_ -#define CONTENT_BROWSER_WEBAUTH_ATTESTED_CREDENTIAL_DATA_H_ - -#include "content/browser/webauth/public_key.h" - -#include <stdint.h> -#include <memory> -#include <vector> - -#include "base/macros.h" -#include "content/common/content_export.h" - -namespace content { - -// https://www.w3.org/TR/2017/WD-webauthn-20170505/#sec-attestation-data -class CONTENT_EXPORT AttestedCredentialData { - public: - AttestedCredentialData(std::vector<uint8_t> aaguid, - std::vector<uint8_t> length, - std::vector<uint8_t> credential_id, - std::unique_ptr<PublicKey> public_key); - virtual ~AttestedCredentialData(); - - static std::unique_ptr<AttestedCredentialData> CreateFromU2fRegisterResponse( - const std::vector<uint8_t>& u2f_data, - std::vector<uint8_t> aaguid, - std::unique_ptr<PublicKey> public_key); - - const std::vector<uint8_t>& credential_id() { return credential_id_; } - - // Produces a byte array consisting of: - // * AAGUID (16 bytes) - // * Len (2 bytes) - // * Credential Id (Len bytes) - // * Credential Public Key. - std::vector<uint8_t> SerializeAsBytes(); - - private: - // The 16-byte AAGUID of the authenticator. - const std::vector<uint8_t> aaguid_; - - // Big-endian length of the credential (i.e. key handle). - const std::vector<uint8_t> credential_id_length_; - const std::vector<uint8_t> credential_id_; - const std::unique_ptr<PublicKey> public_key_; - - DISALLOW_COPY_AND_ASSIGN(AttestedCredentialData); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_WEBAUTH_ATTESTED_CREDENTIAL_DATA_H_
diff --git a/content/browser/webauth/authenticator_data.cc b/content/browser/webauth/authenticator_data.cc deleted file mode 100644 index e987657..0000000 --- a/content/browser/webauth/authenticator_data.cc +++ /dev/null
@@ -1,63 +0,0 @@ -// Copyright 2017 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/webauth/authenticator_data.h" - -#include <utility> - -#include "base/json/json_reader.h" -#include "base/values.h" -#include "content/browser/webauth/attested_credential_data.h" -#include "content/browser/webauth/authenticator_utils.h" -#include "crypto/sha2.h" - -namespace content { - -// static -std::unique_ptr<AuthenticatorData> AuthenticatorData::Create( - std::string client_data_json, - Flags flags, - std::vector<uint8_t> counter, - std::unique_ptr<AttestedCredentialData> data) { - base::DictionaryValue* client_data_dictionary; - std::unique_ptr<base::Value> client_data = - base::JSONReader::Read(client_data_json); - client_data->GetAsDictionary(&client_data_dictionary); - std::string relying_party_id = - client_data_dictionary->FindKey(authenticator_utils::kOriginKey) - ->GetString(); - - return std::make_unique<AuthenticatorData>( - std::move(relying_party_id), flags, std::move(counter), std::move(data)); -} - -AuthenticatorData::AuthenticatorData( - std::string relying_party_id, - Flags flags, - std::vector<uint8_t> counter, - std::unique_ptr<AttestedCredentialData> data) - : relying_party_id_(std::move(relying_party_id)), - flags_(flags), - counter_(std::move(counter)), - attested_data_(std::move(data)) { - CHECK_EQ(counter_.size(), 4u); -} - -std::vector<uint8_t> AuthenticatorData::SerializeToByteArray() { - std::vector<uint8_t> authenticator_data; - std::vector<uint8_t> rp_id_hash(crypto::kSHA256Length); - crypto::SHA256HashString(relying_party_id_, rp_id_hash.data(), - rp_id_hash.size()); - authenticator_utils::Append(&authenticator_data, rp_id_hash); - authenticator_data.insert(authenticator_data.end(), flags_); - authenticator_utils::Append(&authenticator_data, counter_); - std::vector<uint8_t> attestation_bytes = attested_data_->SerializeAsBytes(); - authenticator_utils::Append(&authenticator_data, attestation_bytes); - - return authenticator_data; -} - -AuthenticatorData::~AuthenticatorData() {} - -} // namespace content
diff --git a/content/browser/webauth/authenticator_data.h b/content/browser/webauth/authenticator_data.h deleted file mode 100644 index 76c8b84f..0000000 --- a/content/browser/webauth/authenticator_data.h +++ /dev/null
@@ -1,70 +0,0 @@ -// Copyright 2017 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_WEBAUTH_AUTHENTICATOR_DATA_H_ -#define CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_DATA_H_ - -#include <stdint.h> -#include <memory> -#include <string> -#include <vector> - -#include "base/macros.h" -#include "content/common/content_export.h" - -namespace content { - -class AttestedCredentialData; - -// https://www.w3.org/TR/2017/WD-webauthn-20170505/#sec-authenticator-data. -class CONTENT_EXPORT AuthenticatorData { - public: - enum class Flag : uint8_t { - TEST_OF_USER_PRESENCE = 1u << 0, - ATTESTATION = 1u << 6 - }; - - using Flags = uint8_t; - - AuthenticatorData(std::string relying_party_id, - Flags flags, - std::vector<uint8_t> counter, - std::unique_ptr<AttestedCredentialData> data); - virtual ~AuthenticatorData(); - - static std::unique_ptr<AuthenticatorData> Create( - std::string client_data_json, - Flags flags, - std::vector<uint8_t> counter, - std::unique_ptr<AttestedCredentialData> data); - - // Produces a byte array consisting of: - // * hash(relying_party_id) - // * flags - // * counter - // * attestation_data. - std::vector<uint8_t> SerializeToByteArray(); - - private: - // RP ID associated with the credential - const std::string relying_party_id_; - - // Flags (bit 0 is the least significant bit): - // [ED | AT | RFU | RFU | RFU | RFU | RFU | UP ] - // * Bit 0: Test of User Presence (TUP) result. - // * Bits 1-5: Reserved for future use (RFU). - // * Bit 6: Attestation data included (AT). - // * Bit 7: Extension data included (ED). - Flags flags_; - - // Signature counter, 32-bit unsigned big-endian integer. - const std::vector<uint8_t> counter_; - const std::unique_ptr<AttestedCredentialData> attested_data_; - - DISALLOW_COPY_AND_ASSIGN(AuthenticatorData); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_DATA_H_
diff --git a/content/browser/webauth/authenticator_impl.cc b/content/browser/webauth/authenticator_impl.cc index 67505713..b683b3bf 100644 --- a/content/browser/webauth/authenticator_impl.cc +++ b/content/browser/webauth/authenticator_impl.cc
@@ -8,16 +8,14 @@ #include <utility> #include "base/logging.h" -#include "base/time/tick_clock.h" +#include "base/timer/timer.h" #include "content/public/browser/render_frame_host.h" -#include "content/public/browser/web_contents.h" #include "content/public/common/service_manager_connection.h" #include "crypto/sha2.h" #include "device/u2f/u2f_hid_discovery.h" #include "device/u2f/u2f_register.h" #include "device/u2f/u2f_request.h" #include "device/u2f/u2f_return_code.h" -#include "mojo/public/cpp/bindings/strong_binding.h" #include "services/service_manager/public/cpp/connector.h" namespace content { @@ -36,14 +34,17 @@ } webauth::mojom::PublicKeyCredentialInfoPtr CreatePublicKeyCredentialInfo( - std::unique_ptr<RegisterResponseData> response_data) { + CollectedClientData client_data, + device::RegisterResponseData response_data) { auto credential_info = webauth::mojom::PublicKeyCredentialInfo::New(); - credential_info->client_data_json = response_data->GetClientDataJSONBytes(); - credential_info->raw_id = response_data->raw_id(); - credential_info->id = response_data->GetId(); + std::string client_data_json = client_data.SerializeToJson(); + credential_info->client_data_json.assign(client_data_json.begin(), + client_data_json.end()); + credential_info->raw_id = response_data.raw_id(); + credential_info->id = response_data.GetId(); auto response = webauth::mojom::AuthenticatorResponse::New(); response->attestation_object = - response_data->GetCBOREncodedAttestationObject(); + response_data.GetCBOREncodedAttestationObject(); credential_info->response = std::move(response); return credential_info; } @@ -115,13 +116,13 @@ DCHECK(make_credential_response_callback_.is_null()); make_credential_response_callback_ = std::move(callback); - client_data_ = CollectedClientData::Create(authenticator_utils::kCreateType, + client_data_ = CollectedClientData::Create(client_data::kCreateType, caller_origin.Serialize(), std::move(options->challenge)); // SHA-256 hash of the JSON data structure std::vector<uint8_t> client_data_hash(crypto::kSHA256Length); - crypto::SHA256HashString(client_data_->SerializeToJson(), + crypto::SHA256HashString(client_data_.SerializeToJson(), client_data_hash.data(), client_data_hash.size()); // The application parameter is the SHA-256 hash of the UTF-8 encoding of @@ -148,8 +149,8 @@ // The challenge parameter is the SHA-256 hash of the Client Data, // Among other things, the Client Data contains the challenge from the // relying party (hence the name of the parameter). - device::U2fRegister::ResponseCallback response_callback = base::Bind( - &AuthenticatorImpl::OnDeviceResponse, weak_factory_.GetWeakPtr()); + device::U2fRegister::RegisterResponseCallback response_callback = base::Bind( + &AuthenticatorImpl::OnRegisterResponse, weak_factory_.GetWeakPtr()); // Extract list of credentials to exclude. std::vector<std::vector<uint8_t>> registered_keys; @@ -161,16 +162,13 @@ // http://crbug.com/785955. u2f_request_ = device::U2fRegister::TryRegistration( registered_keys, client_data_hash, application_parameter, - {u2f_discovery_.get()}, response_callback); + relying_party_id, {u2f_discovery_.get()}, std::move(response_callback)); } -// Callback to handle the async response from a U2fDevice. -// |data| is returned for both successful sign and register responses, whereas -// |key_handle| is only returned for successful sign responses. -void AuthenticatorImpl::OnDeviceResponse( +// Callback to handle the async registration response from a U2fDevice. +void AuthenticatorImpl::OnRegisterResponse( device::U2fReturnCode status_code, - const std::vector<uint8_t>& u2f_register_response, - const std::vector<uint8_t>& key_handle) { + base::Optional<device::RegisterResponseData> response_data) { timer_->Stop(); switch (status_code) { @@ -185,28 +183,26 @@ .Run(webauth::mojom::AuthenticatorStatus::UNKNOWN_ERROR, nullptr); break; case device::U2fReturnCode::SUCCESS: - // TODO(kpaulhamus): Add fuzzers for the response parsers. - // http//crbug.com/785957. - std::unique_ptr<RegisterResponseData> response = - RegisterResponseData::CreateFromU2fRegisterResponse( - std::move(client_data_), std::move(u2f_register_response)); + DCHECK(response_data.has_value()); std::move(make_credential_response_callback_) .Run(webauth::mojom::AuthenticatorStatus::SUCCESS, - CreatePublicKeyCredentialInfo(std::move(response))); + CreatePublicKeyCredentialInfo(std::move(client_data_), + std::move(*response_data))); break; } - - u2f_request_.reset(); - u2f_discovery_.reset(); + Cleanup(); } void AuthenticatorImpl::OnTimeout() { DCHECK(make_credential_response_callback_); - u2f_request_.reset(); - u2f_discovery_.reset(); - client_data_.reset(); + Cleanup(); std::move(make_credential_response_callback_) .Run(webauth::mojom::AuthenticatorStatus::NOT_ALLOWED_ERROR, nullptr); } +void AuthenticatorImpl::Cleanup() { + u2f_request_.reset(); + u2f_discovery_.reset(); + client_data_ = CollectedClientData(); +} } // namespace content
diff --git a/content/browser/webauth/authenticator_impl.h b/content/browser/webauth/authenticator_impl.h index 6adbeedd..5ac97dc 100644 --- a/content/browser/webauth/authenticator_impl.h +++ b/content/browser/webauth/authenticator_impl.h
@@ -7,20 +7,20 @@ #include <stdint.h> #include <memory> -#include <vector> -#include "base/bind.h" -#include "base/bind_helpers.h" -#include "base/callback_forward.h" #include "base/macros.h" -#include "base/timer/timer.h" -#include "content/browser/webauth/register_response_data.h" +#include "base/optional.h" +#include "content/browser/webauth/collected_client_data.h" #include "content/common/content_export.h" +#include "device/u2f/register_response_data.h" #include "mojo/public/cpp/bindings/binding_set.h" -#include "mojo/public/cpp/bindings/interface_request.h" #include "third_party/WebKit/public/platform/modules/webauth/authenticator.mojom.h" #include "url/origin.h" +namespace base { +class OneShotTimer; +} + namespace device { class U2fDiscovery; class U2fRequest; @@ -41,9 +41,9 @@ explicit AuthenticatorImpl(RenderFrameHost* render_frame_host); // Permits setting connector and timer for testing. - explicit AuthenticatorImpl(RenderFrameHost* render_frame_host, - service_manager::Connector*, - std::unique_ptr<base::OneShotTimer>); + AuthenticatorImpl(RenderFrameHost* render_frame_host, + service_manager::Connector*, + std::unique_ptr<base::OneShotTimer>); ~AuthenticatorImpl() override; // Creates a binding between this object and |request|. Note that a @@ -57,12 +57,13 @@ MakeCredentialCallback callback) override; // Callback to handle the async response from a U2fDevice. - void OnDeviceResponse(device::U2fReturnCode status_code, - const std::vector<uint8_t>& data, - const std::vector<uint8_t>& key_handle); + void OnRegisterResponse( + device::U2fReturnCode status_code, + base::Optional<device::RegisterResponseData> response_data); // Runs when timer expires and cancels all issued requests to a U2fDevice. void OnTimeout(); + void Cleanup(); // Owns pipes to this Authenticator from |render_frame_host_|. mojo::BindingSet<webauth::mojom::Authenticator> bindings_; @@ -71,11 +72,12 @@ MakeCredentialCallback make_credential_response_callback_; // Holds the client data to be returned to the caller. - std::unique_ptr<CollectedClientData> client_data_; + CollectedClientData client_data_; std::unique_ptr<base::OneShotTimer> timer_; RenderFrameHost* render_frame_host_; service_manager::Connector* connector_ = nullptr; base::WeakPtrFactory<AuthenticatorImpl> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(AuthenticatorImpl); };
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc index 98dc4185..33df6be 100644 --- a/content/browser/webauth/authenticator_impl_unittest.cc +++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -7,26 +7,13 @@ #include <memory> #include <string> -#include "base/base64url.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/test/gtest_util.h" #include "base/test/test_mock_time_task_runner.h" #include "base/time/tick_clock.h" #include "base/time/time.h" -#include "components/cbor/cbor_writer.h" -#include "content/browser/webauth/attestation_object.h" -#include "content/browser/webauth/attested_credential_data.h" -#include "content/browser/webauth/authenticator_data.h" -#include "content/browser/webauth/authenticator_utils.h" #include "content/browser/webauth/collected_client_data.h" -#include "content/browser/webauth/ec_public_key.h" -#include "content/browser/webauth/fido_attestation_statement.h" -#include "content/browser/webauth/register_response_data.h" #include "content/public/browser/render_frame_host.h" -#include "content/public/browser/web_contents.h" -#include "content/public/test/navigation_simulator.h" -#include "content/public/test/test_renderer_host.h" #include "content/test/test_render_frame_host.h" #include "device/u2f/fake_hid_impl_for_testing.h" #include "mojo/public/cpp/bindings/binding.h" @@ -71,295 +58,11 @@ ":\"SHA-256\",\"origin\":\"google.com\",\"tokenBinding\":\"unused\"," "\"type\":\"webauthn.create\"}"; -constexpr uint8_t kTestCredentialRawIdBytes[] = { - 0x89, 0xAF, 0xB5, 0x24, 0x91, 0x1C, 0x40, 0x2B, 0x7F, 0x74, 0x59, - 0xC9, 0xF2, 0x21, 0xAF, 0xE6, 0xE5, 0x56, 0x65, 0x85, 0x04, 0xE8, - 0x5B, 0x49, 0x4D, 0x07, 0x55, 0x55, 0xF4, 0x6A, 0xBC, 0x44, 0x7B, - 0x15, 0xFC, 0x62, 0x61, 0x90, 0xA5, 0xFE, 0xEB, 0xE5, 0x9F, 0x5E, - 0xDC, 0x75, 0x32, 0x98, 0x6F, 0x44, 0x69, 0xD7, 0xF6, 0x13, 0xEB, - 0xAA, 0xEA, 0x33, 0xFB, 0xD5, 0x8E, 0xBF, 0xC6, 0x09}; - -// CBOR-encoded EC public key. -// Diagnostic notation: -// {"x": h'F868CE3869605224CE1059C0047EF01B830F2AD93BE27A3211F44E894560E695', -// "y": h'4E11538CABA2DF1CC1A6F250ED9F0C8B28B39DA44539DFABD46B589CD0E202E5', -// "alg": "ES256"} -constexpr uint8_t kTestECPublicKeyCBOR[] = { - // clang-format off - 0xA3, // map(3) - 0x61, // text(1) - 0x78, // "x" - 0x58, 0x20, // bytes(32) - 0xF8, 0x68, 0xCE, 0x38, 0x69, 0x60, 0x52, 0x24, 0xCE, 0x10, 0x59, 0xC0, - 0x04, 0x7E, 0xF0, 0x1B, 0x83, 0x0F, 0x2A, 0xD9, 0x3B, 0xE2, 0x7A, 0x32, - 0x11, 0xF4, 0x4E, 0x89, 0x45, 0x60, 0xE6, 0x95, - 0x61, // text(1) - 0x79, // "y" - 0x58, 0x20, // bytes(32) - 0x4E, 0x11, 0x53, 0x8C, 0xAB, 0xA2, 0xDF, 0x1C, 0xC1, 0xA6, 0xF2, 0x50, - 0xED, 0x9F, 0x0C, 0x8B, 0x28, 0xB3, 0x9D, 0xA4, 0x45, 0x39, 0xDF, 0xAB, - 0xD4, 0x6B, 0x58, 0x9C, 0xD0, 0xE2, 0x02, 0xE5, - 0x63, // text(3) - 0x61, 0x6C, 0x67, // "alg" - 0x65, // text(5) - 0x45, 0x53, 0x32, 0x35, 0x36, // "ES256" - // clang-format on -}; - -// U2F response blob produced by a U2F registration request. This example -// data uses testClientDataJson and 'created' a key with testCredentialRawId -// as its key handle and with the above x- and y- coordinates. -constexpr uint8_t kTestU2fRegisterResponse[] = { - 0x05, 0x04, 0xF8, 0x68, 0xCE, 0x38, 0x69, 0x60, 0x52, 0x24, 0xCE, 0x10, - 0x59, 0xC0, 0x04, 0x7E, 0xF0, 0x1B, 0x83, 0x0F, 0x2A, 0xD9, 0x3B, 0xE2, - 0x7A, 0x32, 0x11, 0xF4, 0x4E, 0x89, 0x45, 0x60, 0xE6, 0x95, 0x4E, 0x11, - 0x53, 0x8C, 0xAB, 0xA2, 0xDF, 0x1C, 0xC1, 0xA6, 0xF2, 0x50, 0xED, 0x9F, - 0x0C, 0x8B, 0x28, 0xB3, 0x9D, 0xA4, 0x45, 0x39, 0xDF, 0xAB, 0xD4, 0x6B, - 0x58, 0x9C, 0xD0, 0xE2, 0x02, 0xE5, 0x40, 0x89, 0xAF, 0xB5, 0x24, 0x91, - 0x1C, 0x40, 0x2B, 0x7F, 0x74, 0x59, 0xC9, 0xF2, 0x21, 0xAF, 0xE6, 0xE5, - 0x56, 0x65, 0x85, 0x04, 0xE8, 0x5B, 0x49, 0x4D, 0x07, 0x55, 0x55, 0xF4, - 0x6A, 0xBC, 0x44, 0x7B, 0x15, 0xFC, 0x62, 0x61, 0x90, 0xA5, 0xFE, 0xEB, - 0xE5, 0x9F, 0x5E, 0xDC, 0x75, 0x32, 0x98, 0x6F, 0x44, 0x69, 0xD7, 0xF6, - 0x13, 0xEB, 0xAA, 0xEA, 0x33, 0xFB, 0xD5, 0x8E, 0xBF, 0xC6, 0x09, 0x30, - 0x82, 0x02, 0x4A, 0x30, 0x82, 0x01, 0x32, 0xA0, 0x03, 0x02, 0x01, 0x02, - 0x02, 0x04, 0x04, 0x6C, 0x88, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, - 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x2E, 0x31, - 0x2C, 0x30, 0x2A, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x23, 0x59, 0x75, - 0x62, 0x69, 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x52, 0x6F, 0x6F, - 0x74, 0x20, 0x43, 0x41, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6C, 0x20, - 0x34, 0x35, 0x37, 0x32, 0x30, 0x30, 0x36, 0x33, 0x31, 0x30, 0x20, 0x17, - 0x0D, 0x31, 0x34, 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x5A, 0x18, 0x0F, 0x32, 0x30, 0x35, 0x30, 0x30, 0x39, 0x30, 0x34, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5A, 0x30, 0x2C, 0x31, 0x2A, 0x30, - 0x28, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x21, 0x59, 0x75, 0x62, 0x69, - 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x45, 0x45, 0x20, 0x53, 0x65, - 0x72, 0x69, 0x61, 0x6C, 0x20, 0x32, 0x34, 0x39, 0x31, 0x38, 0x32, 0x33, - 0x32, 0x34, 0x37, 0x37, 0x30, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, - 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, - 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x3C, 0xCA, 0xB9, 0x2C, - 0xCB, 0x97, 0x28, 0x7E, 0xE8, 0xE6, 0x39, 0x43, 0x7E, 0x21, 0xFC, 0xD6, - 0xB6, 0xF1, 0x65, 0xB2, 0xD5, 0xA3, 0xF3, 0xDB, 0x13, 0x1D, 0x31, 0xC1, - 0x6B, 0x74, 0x2B, 0xB4, 0x76, 0xD8, 0xD1, 0xE9, 0x90, 0x80, 0xEB, 0x54, - 0x6C, 0x9B, 0xBD, 0xF5, 0x56, 0xE6, 0x21, 0x0F, 0xD4, 0x27, 0x85, 0x89, - 0x9E, 0x78, 0xCC, 0x58, 0x9E, 0xBE, 0x31, 0x0F, 0x6C, 0xDB, 0x9F, 0xF4, - 0xA3, 0x3B, 0x30, 0x39, 0x30, 0x22, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, - 0x01, 0x82, 0xC4, 0x0A, 0x02, 0x04, 0x15, 0x31, 0x2E, 0x33, 0x2E, 0x36, - 0x2E, 0x31, 0x2E, 0x34, 0x2E, 0x31, 0x2E, 0x34, 0x31, 0x34, 0x38, 0x32, - 0x2E, 0x31, 0x2E, 0x32, 0x30, 0x13, 0x06, 0x0B, 0x2B, 0x06, 0x01, 0x04, - 0x01, 0x82, 0xE5, 0x1C, 0x02, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x04, - 0x30, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, - 0x01, 0x0B, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x9F, 0x9B, 0x05, - 0x22, 0x48, 0xBC, 0x4C, 0xF4, 0x2C, 0xC5, 0x99, 0x1F, 0xCA, 0xAB, 0xAC, - 0x9B, 0x65, 0x1B, 0xBE, 0x5B, 0xDC, 0xDC, 0x8E, 0xF0, 0xAD, 0x2C, 0x1C, - 0x1F, 0xFB, 0x36, 0xD1, 0x87, 0x15, 0xD4, 0x2E, 0x78, 0xB2, 0x49, 0x22, - 0x4F, 0x92, 0xC7, 0xE6, 0xE7, 0xA0, 0x5C, 0x49, 0xF0, 0xE7, 0xE4, 0xC8, - 0x81, 0xBF, 0x2E, 0x94, 0xF4, 0x5E, 0x4A, 0x21, 0x83, 0x3D, 0x74, 0x56, - 0x85, 0x1D, 0x0F, 0x6C, 0x14, 0x5A, 0x29, 0x54, 0x0C, 0x87, 0x4F, 0x30, - 0x92, 0xC9, 0x34, 0xB4, 0x3D, 0x22, 0x2B, 0x89, 0x62, 0xC0, 0xF4, 0x10, - 0xCE, 0xF1, 0xDB, 0x75, 0x89, 0x2A, 0xF1, 0x16, 0xB4, 0x4A, 0x96, 0xF5, - 0xD3, 0x5A, 0xDE, 0xA3, 0x82, 0x2F, 0xC7, 0x14, 0x6F, 0x60, 0x04, 0x38, - 0x5B, 0xCB, 0x69, 0xB6, 0x5C, 0x99, 0xE7, 0xEB, 0x69, 0x19, 0x78, 0x67, - 0x03, 0xC0, 0xD8, 0xCD, 0x41, 0xE8, 0xF7, 0x5C, 0xCA, 0x44, 0xAA, 0x8A, - 0xB7, 0x25, 0xAD, 0x8E, 0x79, 0x9F, 0xF3, 0xA8, 0x69, 0x6A, 0x6F, 0x1B, - 0x26, 0x56, 0xE6, 0x31, 0xB1, 0xE4, 0x01, 0x83, 0xC0, 0x8F, 0xDA, 0x53, - 0xFA, 0x4A, 0x8F, 0x85, 0xA0, 0x56, 0x93, 0x94, 0x4A, 0xE1, 0x79, 0xA1, - 0x33, 0x9D, 0x00, 0x2D, 0x15, 0xCA, 0xBD, 0x81, 0x00, 0x90, 0xEC, 0x72, - 0x2E, 0xF5, 0xDE, 0xF9, 0x96, 0x5A, 0x37, 0x1D, 0x41, 0x5D, 0x62, 0x4B, - 0x68, 0xA2, 0x70, 0x7C, 0xAD, 0x97, 0xBC, 0xDD, 0x17, 0x85, 0xAF, 0x97, - 0xE2, 0x58, 0xF3, 0x3D, 0xF5, 0x6A, 0x03, 0x1A, 0xA0, 0x35, 0x6D, 0x8E, - 0x8D, 0x5E, 0xBC, 0xAD, 0xC7, 0x4E, 0x07, 0x16, 0x36, 0xC6, 0xB1, 0x10, - 0xAC, 0xE5, 0xCC, 0x9B, 0x90, 0xDF, 0xEA, 0xCA, 0xE6, 0x40, 0xFF, 0x1B, - 0xB0, 0xF1, 0xFE, 0x5D, 0xB4, 0xEF, 0xF7, 0xA9, 0x5F, 0x06, 0x07, 0x33, - 0xF5, 0x30, 0x44, 0x02, 0x20, 0x08, 0xC3, 0xF8, 0xDB, 0x6E, 0x29, 0xFD, - 0x8B, 0x14, 0xD9, 0xDE, 0x1B, 0xD9, 0x8E, 0x84, 0x07, 0x2C, 0xB8, 0x13, - 0x38, 0x59, 0x89, 0xAA, 0x2C, 0xA2, 0x89, 0x39, 0x5E, 0x00, 0x09, 0xB8, - 0xB7, 0x02, 0x20, 0x26, 0x07, 0xB4, 0xF9, 0xAD, 0x05, 0xDE, 0x26, 0xF5, - 0x6F, 0x48, 0xB8, 0x25, 0x69, 0xEA, 0xD8, 0x23, 0x1A, 0x5A, 0x6C, 0x3A, - 0x14, 0x48, 0xDE, 0xAA, 0xAF, 0x15, 0xC0, 0xEF, 0x29, 0x63, 0x1A}; - -// The attested credential data, excluding the CBOR public key bytes. Append -// with kTestECPublicKeyCBOR to get the complete attestation data. -constexpr uint8_t kTestAttestedCredentialDataPrefix[] = { - // clang-format off - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, // 16-byte aaguid - 0x00, 0x40, // 2-byte length - 0x89, 0xAF, 0xB5, 0x24, 0x91, 0x1C, 0x40, 0x2B, 0x7F, 0x74, 0x59, 0xC9, - 0xF2, 0x21, 0xAF, 0xE6, 0xE5, 0x56, 0x65, 0x85, 0x04, 0xE8, 0x5B, 0x49, - 0x4D, 0x07, 0x55, 0x55, 0xF4, 0x6A, 0xBC, 0x44, 0x7B, 0x15, 0xFC, 0x62, - 0x61, 0x90, 0xA5, 0xFE, 0xEB, 0xE5, 0x9F, 0x5E, 0xDC, 0x75, 0x32, 0x98, - 0x6F, 0x44, 0x69, 0xD7, 0xF6, 0x13, 0xEB, 0xAA, 0xEA, 0x33, 0xFB, 0xD5, - 0x8E, 0xBF, 0xC6, 0x09 //64-byte key handle - // clang-format on -}; - -// The authenticator data, excluding the attested credential data bytes. Append -// with attested credential data to get the complete authenticator data. -constexpr uint8_t kTestAuthenticatorDataPrefix[] = { - // clang-format off - // sha256 hash of kTestRelyingPartyId - 0xD4, 0xC9, 0xD9, 0x02, 0x73, 0x26, 0x27, 0x1A, 0x89, 0xCE, 0x51, - 0xFC, 0xAF, 0x32, 0x8E, 0xD6, 0x73, 0xF1, 0x7B, 0xE3, 0x34, 0x69, - 0xFF, 0x97, 0x9E, 0x8A, 0xB8, 0xDD, 0x50, 0x1E, 0x66, 0x4F, - 0x41, // flags (TUP and AT bits set) - 0x00, 0x00, 0x00, 0x00 //counter - // clang-format on -}; - -// The attestation statement, a CBOR-encoded byte array. -// Diagnostic notation: -// {"sig": -// h'3044022008C3F8DB6E29FD8B14D9DE1BD98E84072CB813385989AA2CA289395E0009B8B70 \ -// 2202607B4F9AD05DE26F56F48B82569EAD8231A5A6C3A1448DEAAAF15C0EF29631A', -// "x5c": [h'3082024A30820132A0030201020204046C8822300D06092A864886F70D01010B0 \ -// 500302E312C302A0603550403132359756269636F2055324620526F6F742043412053657269 \ -// 616C203435373230303633313020170D3134303830313030303030305A180F3230353030393 \ -// 0343030303030305A302C312A302806035504030C2159756269636F20553246204545205365 \ -// 7269616C203234393138323332343737303059301306072A8648CE3D020106082A8648CE3D0 \ -// 30107034200043CCAB92CCB97287EE8E639437E21FCD6B6F165B2D5A3F3DB131D31C16B742B \ -// B476D8D1E99080EB546C9BBDF556E6210FD42785899E78CC589EBE310F6CDB9FF4A33B30393 \ -// 02206092B0601040182C40A020415312E332E362E312E342E312E34313438322E312E323013 \ -// 060B2B0601040182E51C020101040403020430300D06092A864886F70D01010B05000382010 \ -// 1009F9B052248BC4CF42CC5991FCAABAC9B651BBE5BDCDC8EF0AD2C1C1FFB36D18715D42E78 \ -// B249224F92C7E6E7A05C49F0E7E4C881BF2E94F45E4A21833D7456851D0F6C145A29540C874 \ -// F3092C934B43D222B8962C0F410CEF1DB75892AF116B44A96F5D35ADEA3822FC7146F600438 \ -// 5BCB69B65C99E7EB6919786703C0D8CD41E8F75CCA44AA8AB725AD8E799FF3A8696A6F1B265 \ -// 6E631B1E40183C08FDA53FA4A8F85A05693944AE179A1339D002D15CABD810090EC722EF5DE \ -// F9965A371D415D624B68A2707CAD97BCDD1785AF97E258F33DF56A031AA0356D8E8D5EBCADC \ -// 74E071636C6B110ACE5CC9B90DFEACAE640FF1BB0F1FE5DB4EFF7A95F060733F5']} -constexpr uint8_t kU2fAttestationStatementCBOR[] = { - // clang-format off - 0xA2, // map(2) - 0x63, // text(3) - 0x73, 0x69, 0x67, // "sig" - 0x58, 0x46, // bytes(70) - 0x30, 0x44, 0x02, 0x20, 0x08, 0xC3, 0xF8, 0xDB, 0x6E, 0x29, 0xFD, 0x8B, - 0x14, 0xD9, 0xDE, 0x1B, 0xD9, 0x8E, 0x84, 0x07, 0x2C, 0xB8, 0x13, 0x38, - 0x59, 0x89, 0xAA, 0x2C, 0xA2, 0x89, 0x39, 0x5E, 0x00, 0x09, 0xB8, 0xB7, - 0x02, 0x20, 0x26, 0x07, 0xB4, 0xF9, 0xAD, 0x05, 0xDE, 0x26, 0xF5, 0x6F, - 0x48, 0xB8, 0x25, 0x69, 0xEA, 0xD8, 0x23, 0x1A, 0x5A, 0x6C, 0x3A, 0x14, - 0x48, 0xDE, 0xAA, 0xAF, 0x15, 0xC0, 0xEF, 0x29, 0x63, 0x1A, - 0x63, // text(3) - 0x78, 0x35, 0x63, // "x5c" - 0x81, // array(1) - 0x59, 0x02, 0x4E, // bytes(590) - 0x30, 0x82, 0x02, 0x4A, 0x30, 0x82, 0x01, 0x32, 0xA0, 0x03, 0x02, - 0x01, 0x02, 0x02, 0x04, 0x04, 0x6C, 0x88, 0x22, 0x30, 0x0D, 0x06, - 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, - 0x00, 0x30, 0x2E, 0x31, 0x2C, 0x30, 0x2A, 0x06, 0x03, 0x55, 0x04, - 0x03, 0x13, 0x23, 0x59, 0x75, 0x62, 0x69, 0x63, 0x6F, 0x20, 0x55, - 0x32, 0x46, 0x20, 0x52, 0x6F, 0x6F, 0x74, 0x20, 0x43, 0x41, 0x20, - 0x53, 0x65, 0x72, 0x69, 0x61, 0x6C, 0x20, 0x34, 0x35, 0x37, 0x32, - 0x30, 0x30, 0x36, 0x33, 0x31, 0x30, 0x20, 0x17, 0x0D, 0x31, 0x34, - 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5A, - 0x18, 0x0F, 0x32, 0x30, 0x35, 0x30, 0x30, 0x39, 0x30, 0x34, 0x30, - 0x30, 0x30, 0x30, 0x30, 0x30, 0x5A, 0x30, 0x2C, 0x31, 0x2A, 0x30, - 0x28, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x21, 0x59, 0x75, 0x62, - 0x69, 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x45, 0x45, 0x20, - 0x53, 0x65, 0x72, 0x69, 0x61, 0x6C, 0x20, 0x32, 0x34, 0x39, 0x31, - 0x38, 0x32, 0x33, 0x32, 0x34, 0x37, 0x37, 0x30, 0x30, 0x59, 0x30, - 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, - 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, - 0x00, 0x04, 0x3C, 0xCA, 0xB9, 0x2C, 0xCB, 0x97, 0x28, 0x7E, 0xE8, - 0xE6, 0x39, 0x43, 0x7E, 0x21, 0xFC, 0xD6, 0xB6, 0xF1, 0x65, 0xB2, - 0xD5, 0xA3, 0xF3, 0xDB, 0x13, 0x1D, 0x31, 0xC1, 0x6B, 0x74, 0x2B, - 0xB4, 0x76, 0xD8, 0xD1, 0xE9, 0x90, 0x80, 0xEB, 0x54, 0x6C, 0x9B, - 0xBD, 0xF5, 0x56, 0xE6, 0x21, 0x0F, 0xD4, 0x27, 0x85, 0x89, 0x9E, - 0x78, 0xCC, 0x58, 0x9E, 0xBE, 0x31, 0x0F, 0x6C, 0xDB, 0x9F, 0xF4, - 0xA3, 0x3B, 0x30, 0x39, 0x30, 0x22, 0x06, 0x09, 0x2B, 0x06, 0x01, - 0x04, 0x01, 0x82, 0xC4, 0x0A, 0x02, 0x04, 0x15, 0x31, 0x2E, 0x33, - 0x2E, 0x36, 0x2E, 0x31, 0x2E, 0x34, 0x2E, 0x31, 0x2E, 0x34, 0x31, - 0x34, 0x38, 0x32, 0x2E, 0x31, 0x2E, 0x32, 0x30, 0x13, 0x06, 0x0B, - 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0xE5, 0x1C, 0x02, 0x01, 0x01, - 0x04, 0x04, 0x03, 0x02, 0x04, 0x30, 0x30, 0x0D, 0x06, 0x09, 0x2A, - 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x03, - 0x82, 0x01, 0x01, 0x00, 0x9F, 0x9B, 0x05, 0x22, 0x48, 0xBC, 0x4C, - 0xF4, 0x2C, 0xC5, 0x99, 0x1F, 0xCA, 0xAB, 0xAC, 0x9B, 0x65, 0x1B, - 0xBE, 0x5B, 0xDC, 0xDC, 0x8E, 0xF0, 0xAD, 0x2C, 0x1C, 0x1F, 0xFB, - 0x36, 0xD1, 0x87, 0x15, 0xD4, 0x2E, 0x78, 0xB2, 0x49, 0x22, 0x4F, - 0x92, 0xC7, 0xE6, 0xE7, 0xA0, 0x5C, 0x49, 0xF0, 0xE7, 0xE4, 0xC8, - 0x81, 0xBF, 0x2E, 0x94, 0xF4, 0x5E, 0x4A, 0x21, 0x83, 0x3D, 0x74, - 0x56, 0x85, 0x1D, 0x0F, 0x6C, 0x14, 0x5A, 0x29, 0x54, 0x0C, 0x87, - 0x4F, 0x30, 0x92, 0xC9, 0x34, 0xB4, 0x3D, 0x22, 0x2B, 0x89, 0x62, - 0xC0, 0xF4, 0x10, 0xCE, 0xF1, 0xDB, 0x75, 0x89, 0x2A, 0xF1, 0x16, - 0xB4, 0x4A, 0x96, 0xF5, 0xD3, 0x5A, 0xDE, 0xA3, 0x82, 0x2F, 0xC7, - 0x14, 0x6F, 0x60, 0x04, 0x38, 0x5B, 0xCB, 0x69, 0xB6, 0x5C, 0x99, - 0xE7, 0xEB, 0x69, 0x19, 0x78, 0x67, 0x03, 0xC0, 0xD8, 0xCD, 0x41, - 0xE8, 0xF7, 0x5C, 0xCA, 0x44, 0xAA, 0x8A, 0xB7, 0x25, 0xAD, 0x8E, - 0x79, 0x9F, 0xF3, 0xA8, 0x69, 0x6A, 0x6F, 0x1B, 0x26, 0x56, 0xE6, - 0x31, 0xB1, 0xE4, 0x01, 0x83, 0xC0, 0x8F, 0xDA, 0x53, 0xFA, 0x4A, - 0x8F, 0x85, 0xA0, 0x56, 0x93, 0x94, 0x4A, 0xE1, 0x79, 0xA1, 0x33, - 0x9D, 0x00, 0x2D, 0x15, 0xCA, 0xBD, 0x81, 0x00, 0x90, 0xEC, 0x72, - 0x2E, 0xF5, 0xDE, 0xF9, 0x96, 0x5A, 0x37, 0x1D, 0x41, 0x5D, 0x62, - 0x4B, 0x68, 0xA2, 0x70, 0x7C, 0xAD, 0x97, 0xBC, 0xDD, 0x17, 0x85, - 0xAF, 0x97, 0xE2, 0x58, 0xF3, 0x3D, 0xF5, 0x6A, 0x03, 0x1A, 0xA0, - 0x35, 0x6D, 0x8E, 0x8D, 0x5E, 0xBC, 0xAD, 0xC7, 0x4E, 0x07, 0x16, - 0x36, 0xC6, 0xB1, 0x10, 0xAC, 0xE5, 0xCC, 0x9B, 0x90, 0xDF, 0xEA, - 0xCA, 0xE6, 0x40, 0xFF, 0x1B, 0xB0, 0xF1, 0xFE, 0x5D, 0xB4, 0xEF, - 0xF7, 0xA9, 0x5F, 0x06, 0x07, 0x33, 0xF5 - // clang-format on -}; - -// Components of the CBOR needed to form an authenticator object. -// Combined diagnostic notation: -// {"fmt": "fido-u2f", "attStmt": {"sig": h'30...}, "authData": h'D4C9D9...'} -constexpr uint8_t kFormatFidoU2fCBOR[] = { - // clang-format off - 0xA3, // map(3) - 0x63, // text(3) - 0x66, 0x6D, 0x74, // "fmt" - 0x68, // text(8) - 0x66, 0x69, 0x64, 0x6F, 0x2D, 0x75, 0x32, 0x66 // "fido-u2f" - // clang-format on -}; - -constexpr uint8_t kAttStmtCBOR[] = { - // clang-format off - 0x67, // text(7) - 0x61, 0x74, 0x74, 0x53, 0x74, 0x6D, 0x74 // "attStmt" - // clang-format on -}; - -constexpr uint8_t kAuthDataCBOR[] = { - // clang-format off - 0x68, // text(8) - 0x61, 0x75, 0x74, 0x68, 0x44, 0x61, 0x74, 0x61, // "authData" - 0x58, 0xCA //bytes(202). i.e.,the authenticator_data bytearray - // clang-format on -}; - -// Helpers. - -const std::vector<uint8_t>& GetTestECPublicKeyCBOR() { - static const std::vector<uint8_t> data(std::begin(kTestECPublicKeyCBOR), - std::end(kTestECPublicKeyCBOR)); - return data; +std::vector<uint8_t> GetTestChallengeBytes() { + return std::vector<uint8_t>(std::begin(kTestChallengeBytes), + std::end(kTestChallengeBytes)); } -const std::vector<uint8_t>& GetTestRegisterResponse() { - static const std::vector<uint8_t> data(std::begin(kTestU2fRegisterResponse), - std::end(kTestU2fRegisterResponse)); - return data; -} - -const std::vector<uint8_t>& GetTestCredentialRawIdBytes() { - static const std::vector<uint8_t> data(std::begin(kTestCredentialRawIdBytes), - std::end(kTestCredentialRawIdBytes)); - return data; -} - -const std::vector<uint8_t>& GetTestChallengeBytes() { - static const std::vector<uint8_t> data(std::begin(kTestChallengeBytes), - std::end(kTestChallengeBytes)); - return data; -} - -const std::vector<uint8_t>& GetU2fAttestationStatementCBOR() { - static const std::vector<uint8_t> data( - std::begin(kU2fAttestationStatementCBOR), - std::end(kU2fAttestationStatementCBOR)); - return data; -} PublicKeyCredentialRpEntityPtr GetTestPublicKeyCredentialRPEntity() { auto entity = PublicKeyCredentialRpEntity::New(); @@ -400,55 +103,9 @@ return options; } -std::unique_ptr<CollectedClientData> GetTestClientData(std::string type) { - std::unique_ptr<CollectedClientData> client_data = - CollectedClientData::Create(type, kTestRelyingPartyId, - GetTestChallengeBytes()); - return client_data; -} - -std::vector<uint8_t> GetTestAttestedCredentialDataBytes() { - // Combine kTestAttestedCredentialDataPrefix and kTestECPublicKeyCBOR. - std::vector<uint8_t> test_attested_data( - std::begin(kTestAttestedCredentialDataPrefix), - std::end(kTestAttestedCredentialDataPrefix)); - test_attested_data.insert(test_attested_data.end(), - std::begin(kTestECPublicKeyCBOR), - std::end(kTestECPublicKeyCBOR)); - return test_attested_data; -} - -std::vector<uint8_t> GetTestAuthenticatorDataBytes() { - // Build the test authenticator data. - std::vector<uint8_t> test_authenticator_data( - std::begin(kTestAuthenticatorDataPrefix), - std::end(kTestAuthenticatorDataPrefix)); - std::vector<uint8_t> test_attested_data = - GetTestAttestedCredentialDataBytes(); - test_authenticator_data.insert(test_authenticator_data.end(), - test_attested_data.begin(), - test_attested_data.end()); - return test_authenticator_data; -} - -std::vector<uint8_t> GetTestAttestationObjectBytes() { - std::vector<uint8_t> test_authenticator_object(std::begin(kFormatFidoU2fCBOR), - std::end(kFormatFidoU2fCBOR)); - test_authenticator_object.insert(test_authenticator_object.end(), - std::begin(kAttStmtCBOR), - std::end(kAttStmtCBOR)); - test_authenticator_object.insert(test_authenticator_object.end(), - std::begin(kU2fAttestationStatementCBOR), - std::end(kU2fAttestationStatementCBOR)); - test_authenticator_object.insert(test_authenticator_object.end(), - std::begin(kAuthDataCBOR), - std::end(kAuthDataCBOR)); - std::vector<uint8_t> test_authenticator_data = - GetTestAuthenticatorDataBytes(); - test_authenticator_object.insert(test_authenticator_object.end(), - test_authenticator_data.begin(), - test_authenticator_data.end()); - return test_authenticator_object; +CollectedClientData GetTestClientData(std::string type) { + return CollectedClientData::Create(std::move(type), kTestRelyingPartyId, + GetTestChallengeBytes()); } class AuthenticatorImplTest : public content::RenderViewHostTestHarness { @@ -465,7 +122,7 @@ } AuthenticatorPtr ConnectToAuthenticator() { - authenticator_impl_.reset(new AuthenticatorImpl(main_rfh())); + authenticator_impl_ = std::make_unique<AuthenticatorImpl>(main_rfh()); AuthenticatorPtr authenticator; authenticator_impl_->Bind(mojo::MakeRequest(&authenticator)); return authenticator; @@ -488,8 +145,8 @@ class TestMakeCredentialCallback { public: TestMakeCredentialCallback() - : callback_(base::Bind(&TestMakeCredentialCallback::ReceivedCallback, - base::Unretained(this))) {} + : callback_(base::BindOnce(&TestMakeCredentialCallback::ReceivedCallback, + base::Unretained(this))) {} ~TestMakeCredentialCallback() {} void ReceivedCallback(AuthenticatorStatus status, @@ -498,6 +155,7 @@ closure_.Run(); } + // TODO(crbug.com/799044) - simplify the runloop usage. std::pair<AuthenticatorStatus, PublicKeyCredentialInfoPtr>& WaitForCallback() { closure_ = run_loop_.QuitClosure(); @@ -505,18 +163,14 @@ return response_; } - const base::Callback<void(AuthenticatorStatus status, - PublicKeyCredentialInfoPtr credential)>& - callback() { - return callback_; + AuthenticatorImpl::MakeCredentialCallback callback() { + return std::move(callback_); } private: std::pair<AuthenticatorStatus, PublicKeyCredentialInfoPtr> response_; base::Closure closure_; - base::Callback<void(AuthenticatorStatus status, - PublicKeyCredentialInfoPtr credential)> - callback_; + AuthenticatorImpl::MakeCredentialCallback callback_; base::RunLoop run_loop_; }; @@ -560,121 +214,8 @@ // Test that client data serializes to JSON properly. TEST_F(AuthenticatorImplTest, TestSerializedClientData) { - EXPECT_EQ( - kTestClientDataJsonString, - GetTestClientData(authenticator_utils::kCreateType)->SerializeToJson()); -} - -// Test that an EC public key serializes to CBOR properly. -TEST_F(AuthenticatorImplTest, TestSerializedPublicKey) { - std::unique_ptr<ECPublicKey> public_key = - ECPublicKey::ExtractFromU2fRegistrationResponse( - authenticator_utils::kEs256, GetTestRegisterResponse()); - EXPECT_EQ(GetTestECPublicKeyCBOR(), public_key->EncodeAsCBOR()); -} - -// Test that the attestation statement cbor map is constructed properly. -TEST_F(AuthenticatorImplTest, TestU2fAttestationStatementCBOR) { - std::unique_ptr<FidoAttestationStatement> fido_attestation_statement = - FidoAttestationStatement::CreateFromU2fRegisterResponse( - GetTestRegisterResponse()); - auto cbor = cbor::CBORWriter::Write( - cbor::CBORValue(fido_attestation_statement->GetAsCBORMap())); - ASSERT_TRUE(cbor.has_value()); - EXPECT_EQ(GetU2fAttestationStatementCBOR(), cbor.value()); -} - -// Tests that well-formed attested credential data serializes properly. -TEST_F(AuthenticatorImplTest, TestAttestedCredentialData) { - std::unique_ptr<ECPublicKey> public_key = - ECPublicKey::ExtractFromU2fRegistrationResponse( - authenticator_utils::kEs256, GetTestRegisterResponse()); - std::unique_ptr<AttestedCredentialData> attested_data = - AttestedCredentialData::CreateFromU2fRegisterResponse( - GetTestRegisterResponse(), std::vector<uint8_t>(16, 0) /* aaguid */, - std::move(public_key)); - - EXPECT_EQ(GetTestAttestedCredentialDataBytes(), - attested_data->SerializeAsBytes()); -} - -// Tests that well-formed authenticator data serializes properly. -TEST_F(AuthenticatorImplTest, TestAuthenticatorData) { - std::unique_ptr<ECPublicKey> public_key = - ECPublicKey::ExtractFromU2fRegistrationResponse( - authenticator_utils::kEs256, GetTestRegisterResponse()); - std::unique_ptr<AttestedCredentialData> attested_data = - AttestedCredentialData::CreateFromU2fRegisterResponse( - GetTestRegisterResponse(), std::vector<uint8_t>(16, 0) /* aaguid */, - std::move(public_key)); - - AuthenticatorData::Flags flags = - static_cast<AuthenticatorData::Flags>( - AuthenticatorData::Flag::TEST_OF_USER_PRESENCE) | - static_cast<AuthenticatorData::Flags>( - AuthenticatorData::Flag::ATTESTATION); - - std::unique_ptr<AuthenticatorData> authenticator_data = - AuthenticatorData::Create( - GetTestClientData(authenticator_utils::kCreateType) - ->SerializeToJson(), - flags, std::vector<uint8_t>(4, 0) /* counter */, - std::move(attested_data)); - - EXPECT_EQ(GetTestAuthenticatorDataBytes(), - authenticator_data->SerializeToByteArray()); -} - -// Tests that a U2F attestation object serializes properly. -TEST_F(AuthenticatorImplTest, TestU2fAttestationObject) { - std::unique_ptr<ECPublicKey> public_key = - ECPublicKey::ExtractFromU2fRegistrationResponse( - authenticator_utils::kEs256, GetTestRegisterResponse()); - std::unique_ptr<AttestedCredentialData> attested_data = - AttestedCredentialData::CreateFromU2fRegisterResponse( - GetTestRegisterResponse(), std::vector<uint8_t>(16, 0) /* aaguid */, - std::move(public_key)); - - AuthenticatorData::Flags flags = - static_cast<AuthenticatorData::Flags>( - AuthenticatorData::Flag::TEST_OF_USER_PRESENCE) | - static_cast<AuthenticatorData::Flags>( - AuthenticatorData::Flag::ATTESTATION); - std::unique_ptr<AuthenticatorData> authenticator_data = - AuthenticatorData::Create( - GetTestClientData(authenticator_utils::kCreateType) - ->SerializeToJson(), - flags, std::vector<uint8_t>(4, 0) /* counter */, - std::move(attested_data)); - - // Construct the attestation statement. - std::unique_ptr<FidoAttestationStatement> fido_attestation_statement = - FidoAttestationStatement::CreateFromU2fRegisterResponse( - GetTestRegisterResponse()); - - // Construct the attestation object. - auto attestation_object = std::make_unique<AttestationObject>( - std::move(authenticator_data), std::move(fido_attestation_statement)); - - EXPECT_EQ(GetTestAttestationObjectBytes(), - attestation_object->SerializeToCBOREncodedBytes()); -} - -// Test that a U2F register response is properly parsed. -TEST_F(AuthenticatorImplTest, TestRegisterResponseData) { - std::unique_ptr<CollectedClientData> client_data = - GetTestClientData(authenticator_utils::kCreateType); - std::unique_ptr<RegisterResponseData> response = - RegisterResponseData::CreateFromU2fRegisterResponse( - std::move(client_data), GetTestRegisterResponse()); - - EXPECT_EQ(std::vector<uint8_t>( - kTestClientDataJsonString, - kTestClientDataJsonString + strlen(kTestClientDataJsonString)), - response->GetClientDataJSONBytes()); - EXPECT_EQ(GetTestCredentialRawIdBytes(), response->raw_id()); - EXPECT_EQ(GetTestAttestationObjectBytes(), - response->GetCBOREncodedAttestationObject()); + EXPECT_EQ(kTestClientDataJsonString, + GetTestClientData(client_data::kCreateType).SerializeToJson()); } TEST_F(AuthenticatorImplTest, TestTimeout) { @@ -684,8 +225,7 @@ TestMakeCredentialCallback cb; // Set up service_manager::Connector for tests. - std::unique_ptr<device::FakeHidManager> fake_hid_manager = - std::make_unique<device::FakeHidManager>(); + auto fake_hid_manager = std::make_unique<device::FakeHidManager>(); service_manager::mojom::ConnectorRequest request; std::unique_ptr<service_manager::Connector> connector = service_manager::Connector::Create(&request); @@ -696,9 +236,8 @@ base::Unretained(fake_hid_manager.get()))); // Set up a timer for testing. - scoped_refptr<base::TestMockTimeTaskRunner> task_runner( - new base::TestMockTimeTaskRunner(base::Time::Now(), - base::TimeTicks::Now())); + auto task_runner = base::MakeRefCounted<base::TestMockTimeTaskRunner>( + base::Time::Now(), base::TimeTicks::Now()); std::unique_ptr<base::TickClock> tick_clock = task_runner->GetMockTickClock(); auto timer = std::make_unique<base::OneShotTimer>(tick_clock.get()); timer->SetTaskRunner(task_runner);
diff --git a/content/browser/webauth/authenticator_utils.cc b/content/browser/webauth/authenticator_utils.cc deleted file mode 100644 index 6f7081f8..0000000 --- a/content/browser/webauth/authenticator_utils.cc +++ /dev/null
@@ -1,29 +0,0 @@ -// Copyright 2017 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/webauth/authenticator_utils.h" - -#include "base/logging.h" - -namespace content { -namespace authenticator_utils { - -void Append(std::vector<uint8_t>* target, - const std::vector<uint8_t>& in_values) { - target->insert(target->end(), in_values.begin(), in_values.end()); -} - -std::vector<uint8_t> Extract(const std::vector<uint8_t>& source, - size_t pos, - size_t length) { - if (!(pos <= source.size() && length <= source.size() - pos)) { - return std::vector<uint8_t>(); - } - - return std::vector<uint8_t>(source.begin() + pos, - source.begin() + pos + length); -} - -} // namespace authenticator_utils -} // namespace content
diff --git a/content/browser/webauth/authenticator_utils.h b/content/browser/webauth/authenticator_utils.h deleted file mode 100644 index fc249283..0000000 --- a/content/browser/webauth/authenticator_utils.h +++ /dev/null
@@ -1,40 +0,0 @@ -// Copyright 2017 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_WEBAUTH_AUTHENTICATOR_UTILS_H_ -#define CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_UTILS_H_ - -#include <stddef.h> -#include <stdint.h> -#include <vector> - -namespace content { -namespace authenticator_utils { - -// JSON key values -constexpr char kTypeKey[] = "type"; -constexpr char kChallengeKey[] = "challenge"; -constexpr char kOriginKey[] = "origin"; -constexpr char kHashAlgorithm[] = "hashAlgorithm"; -constexpr char kTokenBindingKey[] = "tokenBinding"; - -// U2FResponse offsets. The format of a U2F response is defined in -// https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#registration-response-message-success -constexpr uint32_t kU2fResponseKeyHandleLengthPos = 66; -constexpr uint32_t kU2fResponseKeyHandleStartPos = 67; - -constexpr char kEs256[] = "ES256"; - -void Append(std::vector<uint8_t>* target, - const std::vector<uint8_t>& in_values); - -// Parses out a sub-vector after verifying no out-of-bound reads. -std::vector<uint8_t> Extract(const std::vector<uint8_t>& source, - size_t pos, - size_t length); - -} // namespace authenticator_utils -} // namespace content - -#endif // CONTENT_BROWSER_WEBAUTH_AUTHENTICATOR_UTILS_H_
diff --git a/content/browser/webauth/collected_client_data.cc b/content/browser/webauth/collected_client_data.cc index 5f3a82a..1d493a0 100644 --- a/content/browser/webauth/collected_client_data.cc +++ b/content/browser/webauth/collected_client_data.cc
@@ -8,16 +8,28 @@ #include "base/base64url.h" #include "base/json/json_writer.h" +#include "base/strings/string_piece.h" #include "base/values.h" -#include "content/browser/webauth/authenticator_utils.h" namespace content { +namespace client_data { +const char kCreateType[] = "webauthn.create"; +} // namespace client_data + +namespace { +constexpr char kTypeKey[] = "type"; +constexpr char kChallengeKey[] = "challenge"; +constexpr char kOriginKey[] = "origin"; +constexpr char kHashAlgorithm[] = "hashAlgorithm"; +constexpr char kTokenBindingKey[] = "tokenBinding"; +} // namespace + // static -std::unique_ptr<CollectedClientData> CollectedClientData::Create( +CollectedClientData CollectedClientData::Create( std::string type, std::string relying_party_id, - std::vector<uint8_t> challenge) { + base::span<const uint8_t> challenge) { // The base64url encoding of options.challenge. std::string encoded_challenge; base::Base64UrlEncode( @@ -29,11 +41,12 @@ // supports Token Binding, but is not using it to talk to the origin. // TODO(kpaulhamus): Fetch and add the Token Binding ID public key used to // communicate with the origin. - return std::make_unique<CollectedClientData>( - std::move(type), std::move(encoded_challenge), - std::move(relying_party_id), "SHA-256", "unused"); + return CollectedClientData(std::move(type), std::move(encoded_challenge), + std::move(relying_party_id), "SHA-256", "unused"); } +CollectedClientData::CollectedClientData() = default; + CollectedClientData::CollectedClientData(std::string type, std::string base64_encoded_challenge, std::string origin, @@ -45,27 +58,29 @@ hash_algorithm_(std::move(hash_algorithm)), token_binding_id_(std::move(token_binding_id)) {} -std::string CollectedClientData::SerializeToJson() { +CollectedClientData::CollectedClientData(CollectedClientData&& other) = default; +CollectedClientData& CollectedClientData::operator=( + CollectedClientData&& other) = default; + +CollectedClientData::~CollectedClientData() = default; + +std::string CollectedClientData::SerializeToJson() const { base::DictionaryValue client_data; - client_data.SetString(authenticator_utils::kTypeKey, type_); - client_data.SetString(authenticator_utils::kChallengeKey, - base64_encoded_challenge_); + client_data.SetKey(kTypeKey, base::Value(type_)); + client_data.SetKey(kChallengeKey, base::Value(base64_encoded_challenge_)); // The serialization of callerOrigin. - client_data.SetString(authenticator_utils::kOriginKey, origin_); + client_data.SetKey(kOriginKey, base::Value(origin_)); // The recognized algorithm name of the hash algorithm selected by the client // for generating the hash of the serialized client data. - client_data.SetString(authenticator_utils::kHashAlgorithm, hash_algorithm_); + client_data.SetKey(kHashAlgorithm, base::Value(hash_algorithm_)); - client_data.SetString(authenticator_utils::kTokenBindingKey, - token_binding_id_); + client_data.SetKey(kTokenBindingKey, base::Value(token_binding_id_)); std::string json; base::JSONWriter::Write(client_data, &json); return json; } -CollectedClientData::~CollectedClientData() {} - } // namespace content
diff --git a/content/browser/webauth/collected_client_data.h b/content/browser/webauth/collected_client_data.h index 35d8f8e..70a933fa 100644 --- a/content/browser/webauth/collected_client_data.h +++ b/content/browser/webauth/collected_client_data.h
@@ -6,46 +6,51 @@ #define CONTENT_BROWSER_WEBAUTH_COLLECTED_CLIENT_DATA_H_ #include <stdint.h> -#include <memory> #include <string> -#include <vector> +#include "base/containers/span.h" #include "base/macros.h" #include "content/common/content_export.h" namespace content { -namespace authenticator_utils { -constexpr char kCreateType[] = "webauthn.create"; -} +namespace client_data { +CONTENT_EXPORT extern const char kCreateType[]; +} // namespace client_data // Represents the contextual bindings of both the Relying Party and the // client platform that is used in authenticator signatures. // https://www.w3.org/TR/2017/WD-webauthn-20170505/#dictdef-collectedclientdata class CONTENT_EXPORT CollectedClientData { public: + static CollectedClientData Create(std::string type, + std::string relying_party_id, + base::span<const uint8_t> challenge); + + CollectedClientData(); + CollectedClientData(std::string type_, std::string base64_encoded_challenge_, std::string origin, std::string hash_algorithm, std::string token_binding_id); - virtual ~CollectedClientData(); - static std::unique_ptr<CollectedClientData> Create( - std::string type, - std::string relying_party_id, - std::vector<uint8_t> challenge); + // Moveable. + CollectedClientData(CollectedClientData&& other); + CollectedClientData& operator=(CollectedClientData&& other); + + ~CollectedClientData(); // Builds a JSON-serialized string per step 13 of // https://www.w3.org/TR/2017/WD-webauthn-20170505/#createCredential. - std::string SerializeToJson(); + std::string SerializeToJson() const; private: - const std::string type_; - const std::string base64_encoded_challenge_; - const std::string origin_; - const std::string hash_algorithm_; - const std::string token_binding_id_; + std::string type_; + std::string base64_encoded_challenge_; + std::string origin_; + std::string hash_algorithm_; + std::string token_binding_id_; // TODO(kpaulhamus): Add extensions support. https://crbug/757502. DISALLOW_COPY_AND_ASSIGN(CollectedClientData);
diff --git a/content/browser/webauth/ec_public_key.cc b/content/browser/webauth/ec_public_key.cc deleted file mode 100644 index 62a845a..0000000 --- a/content/browser/webauth/ec_public_key.cc +++ /dev/null
@@ -1,54 +0,0 @@ -// Copyright 2017 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/webauth/ec_public_key.h" - -#include <utility> - -#include "components/cbor/cbor_writer.h" -#include "content/browser/webauth/authenticator_utils.h" - -namespace content { - -// static -std::unique_ptr<ECPublicKey> ECPublicKey::ExtractFromU2fRegistrationResponse( - std::string algorithm, - const std::vector<uint8_t>& u2f_data) { - // Extract the key, which is located after the first byte of the response - // (which is a reserved byte). - // The uncompressed form consists of 65 bytes: - // - a constant 0x04 prefix - // - the 32-byte x coordinate - // - the 32-byte y coordinate. - int start = 2; // Account for reserved byte and 0x04 prefix. - std::vector<uint8_t> x = authenticator_utils::Extract(u2f_data, start, 32); - std::vector<uint8_t> y = - authenticator_utils::Extract(u2f_data, start + 32, 32); - return std::make_unique<ECPublicKey>(std::move(algorithm), std::move(x), - std::move(y)); -} - -ECPublicKey::ECPublicKey(std::string algorithm, - std::vector<uint8_t> x, - std::vector<uint8_t> y) - : PublicKey(std::move(algorithm)), - x_coordinate_(std::move(x)), - y_coordinate_(std::move(y)) { - DCHECK_EQ(x_coordinate_.size(), 32u); - DCHECK_EQ(y_coordinate_.size(), 32u); -} - -std::vector<uint8_t> ECPublicKey::EncodeAsCBOR() { - cbor::CBORValue::MapValue map; - map[cbor::CBORValue("alg")] = cbor::CBORValue(algorithm_.c_str()); - map[cbor::CBORValue("x")] = cbor::CBORValue(x_coordinate_); - map[cbor::CBORValue("y")] = cbor::CBORValue(y_coordinate_); - auto cbor = cbor::CBORWriter::Write(cbor::CBORValue(map)); - DCHECK(cbor.has_value()); - return cbor.value(); -} - -ECPublicKey::~ECPublicKey() {} - -} // namespace content
diff --git a/content/browser/webauth/register_response_data.cc b/content/browser/webauth/register_response_data.cc deleted file mode 100644 index 73d4ca8..0000000 --- a/content/browser/webauth/register_response_data.cc +++ /dev/null
@@ -1,89 +0,0 @@ -// Copyright 2017 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/webauth/register_response_data.h" - -#include <utility> - -#include "content/browser/webauth/attested_credential_data.h" -#include "content/browser/webauth/authenticator_utils.h" -#include "content/browser/webauth/ec_public_key.h" -#include "content/browser/webauth/fido_attestation_statement.h" - -namespace content { - -// static -std::unique_ptr<RegisterResponseData> -RegisterResponseData::CreateFromU2fRegisterResponse( - std::unique_ptr<CollectedClientData> client_data, - std::vector<uint8_t> u2f_data) { - std::unique_ptr<ECPublicKey> public_key = - ECPublicKey::ExtractFromU2fRegistrationResponse( - authenticator_utils::kEs256, u2f_data); - - // Construct the attestation data. - // AAGUID is zeroed out for U2F responses. - std::vector<uint8_t> aaguid(16u, 0u); - std::unique_ptr<AttestedCredentialData> attested_data = - AttestedCredentialData::CreateFromU2fRegisterResponse( - u2f_data, std::move(aaguid), std::move(public_key)); - - // Extract the credential_id for packing into the reponse data. - std::vector<uint8_t> credential_id = attested_data->credential_id(); - - // Construct the authenticator data. - // The counter is zeroed out for Register requests. - std::vector<uint8_t> counter(4u, 0u); - AuthenticatorData::Flags flags = - static_cast<AuthenticatorData::Flags>( - AuthenticatorData::Flag::TEST_OF_USER_PRESENCE) | - static_cast<AuthenticatorData::Flags>( - AuthenticatorData::Flag::ATTESTATION); - - std::unique_ptr<AuthenticatorData> authenticator_data = - AuthenticatorData::Create(client_data->SerializeToJson(), flags, - std::move(counter), std::move(attested_data)); - - // Construct the attestation statement. - std::unique_ptr<FidoAttestationStatement> fido_attestation_statement = - FidoAttestationStatement::CreateFromU2fRegisterResponse(u2f_data); - - // Construct the attestation object. - auto attestation_object = std::make_unique<AttestationObject>( - std::move(authenticator_data), std::move(fido_attestation_statement)); - - return std::make_unique<RegisterResponseData>(std::move(client_data), - std::move(credential_id), - std::move(attestation_object)); -} - -RegisterResponseData::RegisterResponseData( - std::unique_ptr<CollectedClientData> client_data, - std::vector<uint8_t> credential_id, - std::unique_ptr<AttestationObject> object) - : client_data_(std::move(client_data)), - raw_id_(std::move(credential_id)), - attestation_object_(std::move(object)) {} - -std::vector<uint8_t> RegisterResponseData::GetClientDataJSONBytes() { - std::string client_data_json = client_data_->SerializeToJson(); - return std::vector<uint8_t>(client_data_json.begin(), client_data_json.end()); -} - -std::vector<uint8_t> RegisterResponseData::GetCBOREncodedAttestationObject() { - return attestation_object_->SerializeToCBOREncodedBytes(); -} - -std::string RegisterResponseData::GetId() { - std::string id; - base::Base64UrlEncode( - base::StringPiece(reinterpret_cast<const char*>(raw_id_.data()), - raw_id_.size()), - base::Base64UrlEncodePolicy::OMIT_PADDING, &id); - return id; -} - -RegisterResponseData::~RegisterResponseData() {} - -} // namespace content
diff --git a/content/browser/webauth/register_response_data.h b/content/browser/webauth/register_response_data.h deleted file mode 100644 index 29e9cc4..0000000 --- a/content/browser/webauth/register_response_data.h +++ /dev/null
@@ -1,52 +0,0 @@ -// Copyright 2017 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_WEBAUTH_REGISTER_RESPONSE_DATA_H_ -#define CONTENT_BROWSER_WEBAUTH_REGISTER_RESPONSE_DATA_H_ - -#include <stdint.h> -#include <memory> -#include <string> -#include <vector> - -#include "base/base64url.h" -#include "base/macros.h" -#include "content/browser/webauth/attestation_object.h" -#include "content/browser/webauth/collected_client_data.h" -#include "content/common/content_export.h" - -namespace content { - -// See figure 2: -// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/ \ -// fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#using-the- \ -// ctap2-authenticatormakecredential-command-with-ctap1-u2f-authenticators -class CONTENT_EXPORT RegisterResponseData { - public: - RegisterResponseData(std::unique_ptr<CollectedClientData> client_data, - std::vector<uint8_t> credential_id, - std::unique_ptr<AttestationObject> object); - - static std::unique_ptr<RegisterResponseData> CreateFromU2fRegisterResponse( - std::unique_ptr<CollectedClientData> client_data, - std::vector<uint8_t> u2f_data); - - virtual ~RegisterResponseData(); - - std::vector<uint8_t> GetClientDataJSONBytes(); - std::string GetId(); - std::vector<uint8_t> GetCBOREncodedAttestationObject(); - const std::vector<uint8_t>& raw_id() { return raw_id_; } - - private: - const std::unique_ptr<CollectedClientData> client_data_; - const std::vector<uint8_t> raw_id_; - const std::unique_ptr<AttestationObject> attestation_object_; - - DISALLOW_COPY_AND_ASSIGN(RegisterResponseData); -}; - -} // namespace content - -#endif // CONTENT_BROWSER_WEBAUTH_REGISTER_RESPONSE_DATA_H_
diff --git a/content/browser/webrtc/webrtc_event_log_manager.cc b/content/browser/webrtc/webrtc_event_log_manager.cc index a5ce88b3..d72fbf6 100644 --- a/content/browser/webrtc/webrtc_event_log_manager.cc +++ b/content/browser/webrtc/webrtc_event_log_manager.cc
@@ -102,6 +102,11 @@ base::Unretained(this), observer, std::move(reply))); } +void WebRtcEventLogManager::SetTaskRunnerForTesting( + const scoped_refptr<base::SequencedTaskRunner>& task_runner) { + task_runner_ = task_runner; +} + void WebRtcEventLogManager::OnLocalLogStarted(PeerConnectionKey peer_connection, base::FilePath file_path) { DCHECK(task_runner_->RunsTasksInCurrentSequence());
diff --git a/content/browser/webrtc/webrtc_event_log_manager.h b/content/browser/webrtc/webrtc_event_log_manager.h index 749531d..8e211c6 100644 --- a/content/browser/webrtc/webrtc_event_log_manager.h +++ b/content/browser/webrtc/webrtc_event_log_manager.h
@@ -115,6 +115,9 @@ WebRtcEventLogManager(); ~WebRtcEventLogManager() override; + void SetTaskRunnerForTesting( + const scoped_refptr<base::SequencedTaskRunner>& task_runner); + private: using PeerConnectionKey = WebRtcEventLogPeerConnectionKey;
diff --git a/content/browser/webrtc/webrtc_internals_unittest.cc b/content/browser/webrtc/webrtc_internals_unittest.cc index b98d02e..b1e659be 100644 --- a/content/browser/webrtc/webrtc_internals_unittest.cc +++ b/content/browser/webrtc/webrtc_internals_unittest.cc
@@ -9,6 +9,7 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" +#include "base/threading/thread_task_runner_handle.h" #include "base/values.h" #include "content/browser/webrtc/webrtc_internals_ui_observer.h" #include "content/public/test/test_browser_thread.h" @@ -74,7 +75,9 @@ class WebRtcEventLogManagerForTesting : public WebRtcEventLogManager { public: - WebRtcEventLogManagerForTesting() = default; + WebRtcEventLogManagerForTesting() { + SetTaskRunnerForTesting(base::ThreadTaskRunnerHandle::Get()); + } ~WebRtcEventLogManagerForTesting() override = default; }; @@ -168,6 +171,8 @@ EXPECT_EQ("", observer.command()); webrtc_internals.OnRemovePeerConnection(3, 4); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -194,6 +199,8 @@ ASSERT_FALSE(dict->GetList("log", &log)); webrtc_internals.OnRemovePeerConnection(3, 4); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -231,6 +238,8 @@ ASSERT_FALSE(dict->GetList("log", &log)); webrtc_internals.OnRemovePeerConnection(3, 4); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -257,6 +266,8 @@ webrtc_internals.RemoveObserver(&observer); webrtc_internals.OnRemovePeerConnection(1, 2); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -280,6 +291,8 @@ VerifyInt(dict, "lid", 2); webrtc_internals.RemoveObserver(&observer); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -313,6 +326,8 @@ webrtc_internals.OnRemovePeerConnection(1, 2); webrtc_internals.RemoveObserver(&observer); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -338,6 +353,8 @@ video_constraint); webrtc_internals.RemoveObserver(&observer); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -360,6 +377,8 @@ video_constraint); webrtc_internals.RemoveObserver(&observer); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -406,6 +425,8 @@ std::string time; EXPECT_TRUE(dict->GetString("time", &time)); EXPECT_FALSE(time.empty()); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -434,6 +455,8 @@ VerifyInt(dict, "pid", pid); VerifyInt(dict, "lid", lid); VerifyList(dict, "reports", list); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -451,6 +474,8 @@ EXPECT_EQ("audioDebugRecordingsFileSelectionCancelled", observer.command()); EXPECT_EQ(nullptr, observer.value()); + + base::RunLoop().RunUntilIdle(); } // Flaky: crbug.com/796047. @@ -501,6 +526,8 @@ webrtc_internals.OnRemovePeerConnection(pid, lid[0]); EXPECT_EQ(0, webrtc_internals.num_open_connections()); EXPECT_FALSE(webrtc_internals.HasWakeLock()); + + base::RunLoop().RunUntilIdle(); } } // namespace content
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index 1bebbc1..fc37e0d 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc
@@ -204,8 +204,6 @@ return IDS_MEDIA_OVERFLOW_MENU_ENTER_FULLSCREEN; case WebLocalizedString::kOverflowMenuExitFullscreen: return IDS_MEDIA_OVERFLOW_MENU_EXIT_FULLSCREEN; - case WebLocalizedString::kOverflowMenuStopCast: - return IDS_MEDIA_OVERFLOW_MENU_STOP_CAST; case WebLocalizedString::kOverflowMenuMute: return IDS_MEDIA_OVERFLOW_MENU_MUTE; case WebLocalizedString::kOverflowMenuUnmute:
diff --git a/content/child/child_process.cc b/content/child/child_process.cc index 9ab78bd..835a59e6 100644 --- a/content/child/child_process.cc +++ b/content/child/child_process.cc
@@ -9,7 +9,6 @@ #include "base/bind.h" #include "base/lazy_instance.h" #include "base/message_loop/message_loop.h" -#include "base/metrics/statistics_recorder.h" #include "base/process/process_handle.h" #include "base/single_thread_task_runner.h" #include "base/task_scheduler/task_scheduler.h" @@ -36,8 +35,6 @@ DCHECK(!g_lazy_tls.Pointer()->Get()); g_lazy_tls.Pointer()->Set(this); - base::StatisticsRecorder::Initialize(); - // Initialize TaskScheduler if not already done. A TaskScheduler may already // exist when ChildProcess is instantiated in the browser process or in a // test process.
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn index 30e6154f..726c909 100644 --- a/content/common/BUILD.gn +++ b/content/common/BUILD.gn
@@ -393,6 +393,7 @@ "//ui/gfx/ipc/geometry", "//ui/gfx/ipc/skia", "//ui/gl", + "//ui/gl/init", "//ui/latency/ipc", "//ui/shell_dialogs", "//url",
diff --git a/content/common/content_param_traits_macros.h b/content/common/content_param_traits_macros.h index b183cee..a030577 100644 --- a/content/common/content_param_traits_macros.h +++ b/content/common/content_param_traits_macros.h
@@ -18,7 +18,6 @@ #include "ipc/ipc_message_macros.h" #include "services/network/public/interfaces/request_context_frame_type.mojom.h" #include "third_party/WebKit/common/page/page_visibility_state.mojom.h" -#include "third_party/WebKit/public/platform/WebAddressSpace.h" #include "third_party/WebKit/public/platform/WebContentSecurityPolicy.h" #include "third_party/WebKit/public/platform/WebInputEvent.h" #include "third_party/WebKit/public/web/WebImeTextSpan.h" @@ -42,7 +41,6 @@ blink::kWebContentSecurityPolicySourceLast) IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContentSecurityPolicyType, blink::kWebContentSecurityPolicyTypeLast) -IPC_ENUM_TRAITS_MAX_VALUE(blink::WebAddressSpace, blink::kWebAddressSpaceLast) IPC_ENUM_TRAITS_MIN_MAX_VALUE(blink::WebInputEvent::Type, blink::WebInputEvent::kTypeFirst, blink::WebInputEvent::kTypeLast)
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h index 1693d92..6c216df5 100644 --- a/content/common/frame_messages.h +++ b/content/common/frame_messages.h
@@ -1548,13 +1548,11 @@ // Sent when the renderer displays content that was loaded with // certificate errors. -IPC_MESSAGE_ROUTED1(FrameHostMsg_DidDisplayContentWithCertificateErrors, - GURL /* resource url */) +IPC_MESSAGE_ROUTED0(FrameHostMsg_DidDisplayContentWithCertificateErrors) // Sent when the renderer runs content that was loaded with certificate // errors. -IPC_MESSAGE_ROUTED1(FrameHostMsg_DidRunContentWithCertificateErrors, - GURL /* resource url */) +IPC_MESSAGE_ROUTED0(FrameHostMsg_DidRunContentWithCertificateErrors) // Response to FrameMsg_GetSavableResourceLinks. IPC_MESSAGE_ROUTED3(FrameHostMsg_SavableResourceLinksResponse,
diff --git a/content/common/loader_util.cc b/content/common/loader_util.cc index 0960fe4a..1aaf7774 100644 --- a/content/common/loader_util.cc +++ b/content/common/loader_util.cc
@@ -138,8 +138,7 @@ request->SetExtraRequestHeaderByName(kAcceptHeader, accept_value, false); } -int BuildLoadFlagsForRequest(const ResourceRequest& request, - bool is_sync_load) { +int BuildLoadFlagsForRequest(const ResourceRequest& request) { int load_flags = request.load_flags; // Although EV status is irrelevant to sub-frames and sub-resources, we have @@ -153,9 +152,6 @@ load_flags |= net::LOAD_PREFETCH; } - if (is_sync_load) - load_flags |= net::LOAD_IGNORE_LIMITS; - return load_flags; }
diff --git a/content/common/loader_util.h b/content/common/loader_util.h index 0f8531b..cf3ce294 100644 --- a/content/common/loader_util.h +++ b/content/common/loader_util.h
@@ -38,8 +38,7 @@ void AttachAcceptHeader(ResourceType type, net::URLRequest* request); -int BuildLoadFlagsForRequest(const ResourceRequest& request_data, - bool is_sync_load); +int BuildLoadFlagsForRequest(const ResourceRequest& request_data); } // namespace content
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h index ddbf42b..ab08ac8 100644 --- a/content/common/resource_messages.h +++ b/content/common/resource_messages.h
@@ -25,7 +25,6 @@ #include "net/base/request_priority.h" #include "net/http/http_response_info.h" #include "net/traffic_annotation/network_traffic_annotation.h" -#include "net/url_request/redirect_info.h" #include "services/network/public/cpp/network_param_ipc_traits.h" #include "services/network/public/interfaces/fetch_api.mojom.h" #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" @@ -150,19 +149,6 @@ IPC_STRUCT_TRAITS_MEMBER(cors_exposed_header_names) IPC_STRUCT_TRAITS_END() -IPC_ENUM_TRAITS_MAX_VALUE(net::URLRequest::ReferrerPolicy, - net::URLRequest::MAX_REFERRER_POLICY - 1) - -IPC_STRUCT_TRAITS_BEGIN(net::RedirectInfo) - IPC_STRUCT_TRAITS_MEMBER(status_code) - IPC_STRUCT_TRAITS_MEMBER(new_method) - IPC_STRUCT_TRAITS_MEMBER(new_url) - IPC_STRUCT_TRAITS_MEMBER(new_site_for_cookies) - IPC_STRUCT_TRAITS_MEMBER(new_referrer) - IPC_STRUCT_TRAITS_MEMBER(new_referrer_policy) - IPC_STRUCT_TRAITS_MEMBER(referred_token_binding_host) -IPC_STRUCT_TRAITS_END() - IPC_STRUCT_TRAITS_BEGIN(net::MutableNetworkTrafficAnnotationTag) IPC_STRUCT_TRAITS_MEMBER(unique_id_hash_code) IPC_STRUCT_TRAITS_END()
diff --git a/content/common/shared_worker/shared_worker_info.mojom b/content/common/shared_worker/shared_worker_info.mojom index 7b7e3ea8..34e2221 100644 --- a/content/common/shared_worker/shared_worker_info.mojom +++ b/content/common/shared_worker/shared_worker_info.mojom
@@ -4,7 +4,7 @@ module content.mojom; -import "third_party/WebKit/public/platform/address_space.mojom"; +import "third_party/WebKit/common/net/ip_address_space.mojom"; import "third_party/WebKit/public/platform/content_security_policy.mojom"; import "url/mojo/url.mojom"; @@ -17,5 +17,5 @@ string name; string content_security_policy; blink.mojom.ContentSecurityPolicyType content_security_policy_type; - blink.mojom.AddressSpace creation_address_space; + blink.mojom.IPAddressSpace creation_address_space; };
diff --git a/content/common/throttling_url_loader.cc b/content/common/throttling_url_loader.cc index d96223e..ac2ae12f 100644 --- a/content/common/throttling_url_loader.cc +++ b/content/common/throttling_url_loader.cc
@@ -35,6 +35,14 @@ loader_->StopDeferringForThrottle(throttle_); } + void SetPriority(net::RequestPriority priority) override { + if (!loader_) + return; + + ScopedDelegateCall scoped_delegate_call(this); + loader_->SetPriority(priority); + } + void PauseReadingBodyFromNet() override { if (!loader_) return; @@ -91,14 +99,14 @@ int32_t in_request_id, uint32_t in_options, StartLoaderCallback in_start_loader_callback, - const ResourceRequest& in_url_request, + ResourceRequest* in_url_request, scoped_refptr<base::SingleThreadTaskRunner> in_task_runner) : url_loader_factory(in_url_loader_factory), routing_id(in_routing_id), request_id(in_request_id), options(in_options), start_loader_callback(std::move(in_start_loader_callback)), - url_request(in_url_request), + url_request(*in_url_request), task_runner(std::move(in_task_runner)) {} ThrottlingURLLoader::StartInfo::~StartInfo() = default; @@ -134,7 +142,7 @@ int32_t routing_id, int32_t request_id, uint32_t options, - const ResourceRequest& url_request, + ResourceRequest* url_request, mojom::URLLoaderClient* client, const net::NetworkTrafficAnnotationTag& traffic_annotation, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { @@ -150,7 +158,7 @@ StartLoaderCallback start_loader_callback, std::vector<std::unique_ptr<URLLoaderThrottle>> throttles, int32_t routing_id, - const ResourceRequest& url_request, + ResourceRequest* url_request, mojom::URLLoaderClient* client, const net::NetworkTrafficAnnotationTag& traffic_annotation, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { @@ -213,7 +221,8 @@ const net::NetworkTrafficAnnotationTag& traffic_annotation) : forwarding_client_(client), client_binding_(this), - traffic_annotation_(traffic_annotation) { + traffic_annotation_(traffic_annotation), + weak_factory_(this) { throttles_.reserve(throttles.size()); for (auto& throttle : throttles) throttles_.emplace_back(this, std::move(throttle)); @@ -225,7 +234,7 @@ int32_t request_id, uint32_t options, StartLoaderCallback start_loader_callback, - const ResourceRequest& url_request, + ResourceRequest* url_request, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { DCHECK_EQ(DEFERRED_NONE, deferred_stage_); DCHECK(!loader_cancelled_); @@ -265,7 +274,7 @@ int32_t request_id, uint32_t options, StartLoaderCallback start_loader_callback, - const ResourceRequest& url_request, + ResourceRequest* url_request, scoped_refptr<base::SingleThreadTaskRunner> task_runner) { mojom::URLLoaderClientPtr client; client_binding_.Bind(mojo::MakeRequest(&client), std::move(task_runner)); @@ -277,7 +286,7 @@ factory->CreateLoaderAndStart( mojo::MakeRequest(&url_loader_), routing_id, request_id, options, - url_request, std::move(client), + *url_request, std::move(client), net::MutableNetworkTrafficAnnotationTag(traffic_annotation_)); } else { std::move(start_loader_callback) @@ -294,7 +303,7 @@ } // Initialize with the request URL, may be updated when on redirects - response_url_ = url_request.url; + response_url_ = url_request->url; } bool ThrottlingURLLoader::HandleThrottleResult(URLLoaderThrottle* throttle, @@ -363,7 +372,11 @@ for (auto& entry : throttles_) { auto* throttle = entry.throttle.get(); bool throttle_deferred = false; - throttle->WillRedirectRequest(redirect_info, &throttle_deferred); + auto weak_ptr = weak_factory_.GetWeakPtr(); + throttle->WillRedirectRequest(redirect_info, response_head, + &throttle_deferred); + if (!weak_ptr) + return; if (!HandleThrottleResult(throttle, throttle_deferred, &deferred)) return; } @@ -470,7 +483,7 @@ StartNow(start_info_->url_loader_factory, start_info_->routing_id, start_info_->request_id, start_info_->options, std::move(start_info_->start_loader_callback), - start_info_->url_request, std::move(start_info_->task_runner)); + &start_info_->url_request, std::move(start_info_->task_runner)); break; } case DEFERRED_REDIRECT: { @@ -496,6 +509,11 @@ } } +void ThrottlingURLLoader::SetPriority(net::RequestPriority priority) { + if (url_loader_) + url_loader_->SetPriority(priority, -1); +} + void ThrottlingURLLoader::PauseReadingBodyFromNet(URLLoaderThrottle* throttle) { if (pausing_reading_body_from_net_throttles_.empty() && url_loader_) url_loader_->PauseReadingBodyFromNet();
diff --git a/content/common/throttling_url_loader.h b/content/common/throttling_url_loader.h index 4628efd..cc831727 100644 --- a/content/common/throttling_url_loader.h +++ b/content/common/throttling_url_loader.h
@@ -9,6 +9,7 @@ #include "base/callback.h" #include "base/memory/ref_counted.h" +#include "base/memory/weak_ptr.h" #include "base/threading/thread_task_runner_handle.h" #include "content/common/content_export.h" #include "content/common/possibly_associated_interface_ptr.h" @@ -42,7 +43,7 @@ int32_t routing_id, int32_t request_id, uint32_t options, - const ResourceRequest& url_request, + ResourceRequest* url_request, mojom::URLLoaderClient* client, const net::NetworkTrafficAnnotationTag& traffic_annotation, scoped_refptr<base::SingleThreadTaskRunner> task_runner); @@ -58,7 +59,7 @@ StartLoaderCallback start_loader_callback, std::vector<std::unique_ptr<URLLoaderThrottle>> throttles, int32_t routing_id, - const ResourceRequest& url_request, + ResourceRequest* url_request, mojom::URLLoaderClient* client, const net::NetworkTrafficAnnotationTag& traffic_annotation, scoped_refptr<base::SingleThreadTaskRunner> task_runner); @@ -96,7 +97,7 @@ int32_t request_id, uint32_t options, StartLoaderCallback start_loader_callback, - const ResourceRequest& url_request, + ResourceRequest* url_request, scoped_refptr<base::SingleThreadTaskRunner> task_runner); void StartNow(mojom::URLLoaderFactory* factory, @@ -104,7 +105,7 @@ int32_t request_id, uint32_t options, StartLoaderCallback start_loader_callback, - const ResourceRequest& url_request, + ResourceRequest* url_request, scoped_refptr<base::SingleThreadTaskRunner> task_runner); // Processes the result of a URLLoaderThrottle call, adding the throttle to @@ -140,7 +141,7 @@ void CancelWithError(int error_code); void Resume(); - + void SetPriority(net::RequestPriority priority); void PauseReadingBodyFromNet(URLLoaderThrottle* throttle); void ResumeReadingBodyFromNet(URLLoaderThrottle* throttle); @@ -187,7 +188,7 @@ int32_t in_request_id, uint32_t in_options, StartLoaderCallback in_start_loader_callback, - const ResourceRequest& in_url_request, + ResourceRequest* in_url_request, scoped_refptr<base::SingleThreadTaskRunner> in_task_runner); ~StartInfo(); @@ -247,6 +248,8 @@ // The latest request URL from where we expect a response GURL response_url_; + base::WeakPtrFactory<ThrottlingURLLoader> weak_factory_; + DISALLOW_COPY_AND_ASSIGN(ThrottlingURLLoader); };
diff --git a/content/common/throttling_url_loader_unittest.cc b/content/common/throttling_url_loader_unittest.cc index 7cdbdb8..9c3154c 100644 --- a/content/common/throttling_url_loader_unittest.cc +++ b/content/common/throttling_url_loader_unittest.cc
@@ -213,13 +213,14 @@ private: // URLLoaderThrottle implementation. - void WillStartRequest(const ResourceRequest& request, bool* defer) override { + void WillStartRequest(ResourceRequest* request, bool* defer) override { will_start_request_called_++; if (will_start_request_callback_) will_start_request_callback_.Run(delegate_, defer); } void WillRedirectRequest(const net::RedirectInfo& redirect_info, + const content::ResourceResponseHead& response_head, bool* defer) override { will_redirect_request_called_++; if (will_redirect_request_callback_) @@ -277,7 +278,7 @@ request.url = request_url; loader_ = ThrottlingURLLoader::CreateLoaderAndStart( factory_.factory_ptr().get(), std::move(throttles_), 0, 0, options, - request, &client_, TRAFFIC_ANNOTATION_FOR_TESTS, + &request, &client_, TRAFFIC_ANNOTATION_FOR_TESTS, base::ThreadTaskRunnerHandle::Get()); factory_.factory_ptr().FlushForTesting(); }
diff --git a/content/common/view_messages.h b/content/common/view_messages.h index 46a0a02..2e45c773 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h
@@ -511,11 +511,6 @@ bool /* result */) #endif -// An acknowledgement to ViewHostMsg_ShowDisambiguationPopup to notify the -// renderer process to release the magnified image. -IPC_MESSAGE_ROUTED1(ViewMsg_ReleaseDisambiguationPopupBitmap, - viz::SharedBitmapId /* id */) - // If the ViewHostMsg_ShowDisambiguationPopup resulted in the user tapping // inside the popup, instruct the renderer to generate a synthetic tap at that // offset. @@ -758,7 +753,7 @@ IPC_MESSAGE_ROUTED3(ViewHostMsg_ShowDisambiguationPopup, gfx::Rect, /* Border of touched targets */ gfx::Size, /* Size of zoomed image */ - viz::SharedBitmapId /* id */) + base::SharedMemoryHandle /* Bitmap pixels */) // Message sent from renderer to the browser when the element that is focused // has been touched. A bool is passed in this message which indicates if the
diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn index 926d8057..4c50c537 100644 --- a/content/gpu/BUILD.gn +++ b/content/gpu/BUILD.gn
@@ -66,6 +66,7 @@ "//gpu/ipc/common:gpu_preferences_util", "//gpu/ipc/service", "//ipc", + "//media:media_features", "//media/gpu", "//media/mojo:features",
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index fbb5378..f701f23 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc
@@ -11,7 +11,6 @@ #include "base/lazy_instance.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_macros.h" -#include "base/metrics/statistics_recorder.h" #include "base/rand_util.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" @@ -274,9 +273,6 @@ base::PlatformThread::SetName("CrGpuMain"); - // Initializes StatisticsRecorder which tracks UMA histograms. - base::StatisticsRecorder::Initialize(); - #if defined(OS_ANDROID) || defined(OS_CHROMEOS) // Set thread priority before sandbox initialization. base::PlatformThread::SetCurrentThreadPriority(base::ThreadPriority::DISPLAY); @@ -365,11 +361,8 @@ gpu_info && angle::IsAMD(gpu_info->active_gpu().vendor_id); sandbox_options.accelerated_video_decode_enabled = !gpu_prefs.disable_accelerated_video_decode; - -#if defined(OS_CHROMEOS) - sandbox_options.vaapi_accelerated_video_encode_enabled = - !gpu_prefs.disable_vaapi_accelerated_video_encode; -#endif + sandbox_options.accelerated_video_encode_enabled = + !gpu_prefs.disable_accelerated_video_encode; bool res = service_manager::SandboxLinux::GetInstance()->InitializeSandbox( service_manager::SandboxTypeFromCommandLine(
diff --git a/content/gpu/gpu_sandbox_hook_linux.cc b/content/gpu/gpu_sandbox_hook_linux.cc index 3d94882..e69e23e 100644 --- a/content/gpu/gpu_sandbox_hook_linux.cc +++ b/content/gpu/gpu_sandbox_hook_linux.cc
@@ -114,9 +114,11 @@ permissions->push_back(BrokerFilePermission::ReadWrite(name.value())); } - // Device node for V4L2 video encode accelerator drivers. - static const char kDevVideoEncPath[] = "/dev/video-enc"; - permissions->push_back(BrokerFilePermission::ReadWrite(kDevVideoEncPath)); + if (options.accelerated_video_encode_enabled) { + // Device node for V4L2 video encode accelerator drivers. + static const char kDevVideoEncPath[] = "/dev/video-enc"; + permissions->push_back(BrokerFilePermission::ReadWrite(kDevVideoEncPath)); + } // Device node for V4L2 JPEG decode accelerator drivers. static const char kDevJpegDecPath[] = "/dev/jpeg-dec"; @@ -250,12 +252,21 @@ return true; } -void LoadV4L2Libraries() { - if (UseLibV4L2()) { +bool IsAcceleratedVideoEnabled( + const service_manager::SandboxSeccompBPF::Options& options) { + return options.accelerated_video_encode_enabled || + options.accelerated_video_decode_enabled; +} + +void LoadV4L2Libraries( + const service_manager::SandboxSeccompBPF::Options& options) { + if (IsAcceleratedVideoEnabled(options) && UseLibV4L2()) { dlopen("/usr/lib/libv4l2.so", dlopen_flag); - // This is a device-specific encoder plugin. - dlopen("/usr/lib/libv4l/plugins/libv4l-encplugin.so", dlopen_flag); + if (options.accelerated_video_encode_enabled) { + // This is a device-specific encoder plugin. + dlopen("/usr/lib/libv4l/plugins/libv4l-encplugin.so", dlopen_flag); + } } } @@ -264,8 +275,7 @@ if (IsArchitectureX86_64() || IsArchitectureI386()) { // Accelerated video dlopen()'s some shared objects // inside the sandbox, so preload them now. - if (options.vaapi_accelerated_video_encode_enabled || - options.accelerated_video_decode_enabled) { + if (IsAcceleratedVideoEnabled(options)) { if (IsLibVAVersion2()) { if (IsArchitectureX86_64()) { dlopen("/usr/lib64/va/drivers/i965_drv_video.so", dlopen_flag); @@ -308,7 +318,7 @@ const service_manager::SandboxSeccompBPF::Options& options) { if (IsChromeOS()) { if (UseV4L2Codec()) - LoadV4L2Libraries(); + LoadV4L2Libraries(options); if (IsArchitectureArm()) { LoadArmGpuLibraries(); return true;
diff --git a/content/gpu/gpu_service_factory.cc b/content/gpu/gpu_service_factory.cc index 9daced1..e283133 100644 --- a/content/gpu/gpu_service_factory.cc +++ b/content/gpu/gpu_service_factory.cc
@@ -14,7 +14,10 @@ #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) #include "base/bind.h" #include "media/mojo/services/media_service_factory.h" // nogncheck -#endif +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) +#include "content/public/gpu/content_gpu_client.h" +#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) +#endif // BUILDFLAG(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) namespace content { @@ -34,10 +37,18 @@ void GpuServiceFactory::RegisterServices(ServiceMap* services) { #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) + media::CdmProxyFactoryCB cdm_proxy_factory_cb; +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) + cdm_proxy_factory_cb = + base::BindRepeating(&ContentGpuClient::CreateCdmProxy, + base::Unretained(GetContentClient()->gpu())); +#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) + service_manager::EmbeddedServiceInfo info; info.factory = - base::Bind(&media::CreateGpuMediaService, gpu_preferences_, task_runner_, - media_gpu_channel_manager_, android_overlay_factory_cb_); + base::BindRepeating(&media::CreateGpuMediaService, gpu_preferences_, + task_runner_, media_gpu_channel_manager_, + android_overlay_factory_cb_, cdm_proxy_factory_cb); // This service will host audio/video decoders, and if these decoding // operations are blocked, user may hear audio glitch or see video freezing, // hence "user blocking". @@ -45,7 +56,7 @@ info.task_runner = base::CreateSingleThreadTaskRunnerWithTraits( {base::TaskPriority::USER_BLOCKING}); services->insert(std::make_pair("media", info)); -#endif +#endif // BUILDFLAG(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) service_manager::EmbeddedServiceInfo shape_detection_info; shape_detection_info.factory =
diff --git a/content/network/proxy_resolver_factory_mojo_unittest.cc b/content/network/proxy_resolver_factory_mojo_unittest.cc index 6a83251..f7763d2 100644 --- a/content/network/proxy_resolver_factory_mojo_unittest.cc +++ b/content/network/proxy_resolver_factory_mojo_unittest.cc
@@ -495,6 +495,14 @@ return net::ERR_DNS_CACHE_MISS; } + int ResolveStaleFromCache( + const RequestInfo& info, + net::AddressList* addresses, + net::HostCache::EntryStaleness* stale_info, + const net::NetLogWithSource& source_net_log) override { + return net::ERR_DNS_CACHE_MISS; + } + net::HostCache* GetHostCache() override { return nullptr; } bool HasCached(base::StringPiece hostname,
diff --git a/content/network/url_loader.cc b/content/network/url_loader.cc index 813a2df3..a23ff97 100644 --- a/content/network/url_loader.cc +++ b/content/network/url_loader.cc
@@ -219,7 +219,7 @@ base::BindOnce(&URLLoader::OnConnectionError, base::Unretained(this))); url_request_ = context_->url_request_context()->CreateRequest( - GURL(request.url), net::DEFAULT_PRIORITY, this, traffic_annotation); + GURL(request.url), request.priority, this, traffic_annotation); url_request_->set_method(request.method); url_request_->set_site_for_cookies(request.site_for_cookies); @@ -257,8 +257,7 @@ net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); } - int load_flags = BuildLoadFlagsForRequest(request, false); - url_request_->SetLoadFlags(load_flags); + url_request_->SetLoadFlags(BuildLoadFlagsForRequest(request)); if (report_raw_headers_) { url_request_->SetRequestHeadersCallback( base::Bind(&net::HttpRawRequestHeaders::Assign,
diff --git a/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java b/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java index 47876bb..713f44288 100644 --- a/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java +++ b/content/public/android/java/src/org/chromium/content/browser/SelectionPopupController.java
@@ -382,11 +382,13 @@ @Override public void paste() { SelectionPopupController.this.paste(); + mWebContents.dismissTextHandles(); } @Override public void pasteAsPlainText() { SelectionPopupController.this.pasteAsPlainText(); + mWebContents.dismissTextHandles(); } @Override @@ -748,14 +750,17 @@ selectAll(); } else if (id == R.id.select_action_menu_cut) { cut(); + mode.finish(); } else if (id == R.id.select_action_menu_copy) { copy(); mode.finish(); } else if (id == R.id.select_action_menu_paste) { paste(); + mode.finish(); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && id == R.id.select_action_menu_paste_as_plain_text) { pasteAsPlainText(); + mode.finish(); } else if (id == R.id.select_action_menu_share) { share(); mode.finish(); @@ -1072,7 +1077,10 @@ if (top == bottom) ++bottom; final float deviceScale = getDeviceScaleFactor(); boundMiddlePointX *= deviceScale; - boundMiddlePointY *= deviceScale; + // The selection coordinates are relative to the content viewport, but we need + // coordinates relative to the containing View, so adding getContentOffsetYPix(). + boundMiddlePointY = boundMiddlePointY * deviceScale + + mWebContents.getRenderCoordinates().getContentOffsetYPix(); switch (eventType) { case SelectionEventType.SELECTION_HANDLES_SHOWN: break;
diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc index f1a25d0..5f2631c 100644 --- a/content/public/app/content_main_delegate.cc +++ b/content/public/app/content_main_delegate.cc
@@ -4,6 +4,7 @@ #include "content/public/app/content_main_delegate.h" +#include "base/logging.h" #include "build/build_config.h" #include "content/public/gpu/content_gpu_client.h" #include "content/public/renderer/content_renderer_client.h" @@ -48,6 +49,11 @@ #endif // defined(OS_LINUX) +int ContentMainDelegate::TerminateForFatalInitializationError() { + CHECK(false); + return 0; +} + bool ContentMainDelegate::ShouldEnableProfilerRecording() { return false; }
diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h index 0868d0d1..a53d40b 100644 --- a/content/public/app/content_main_delegate.h +++ b/content/public/app/content_main_delegate.h
@@ -92,6 +92,11 @@ // Returns whether or not profiler recording should be enabled. virtual bool ShouldEnableProfilerRecording(); + // Fatal errors during initialization are reported by this function, so that + // the embedder can implement graceful exit by displaying some message and + // returning initialization error code. Default behavior is CHECK(false). + virtual int TerminateForFatalInitializationError(); + // Overrides the Service Manager process type to use for the currently running // process. virtual service_manager::ProcessType OverrideProcessType();
diff --git a/content/public/browser/BUILD.gn b/content/public/browser/BUILD.gn index 7154497e..5bb4fc4 100644 --- a/content/public/browser/BUILD.gn +++ b/content/public/browser/BUILD.gn
@@ -167,6 +167,7 @@ "native_web_keyboard_event.h", "navigation_controller.cc", "navigation_controller.h", + "navigation_data.h", "navigation_details.cc", "navigation_details.h", "navigation_entry.h",
diff --git a/content/public/browser/android/compositor.h b/content/public/browser/android/compositor.h index e454121..d3bead1c 100644 --- a/content/public/browser/android/compositor.h +++ b/content/public/browser/android/compositor.h
@@ -65,9 +65,6 @@ // Set the output surface bounds. virtual void SetWindowBounds(const gfx::Size& size) = 0; - // Defer commits on the layer tree host. - virtual void SetDeferCommits(bool defer_commits) = 0; - // Set the output surface which the compositor renders into. virtual void SetSurface(jobject surface) = 0;
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc index 445422c..0a54591 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc
@@ -565,7 +565,8 @@ std::vector<std::unique_ptr<URLLoaderThrottle>> ContentBrowserClient::CreateURLLoaderThrottles( - const base::Callback<WebContents*()>& wc_getter) { + const base::Callback<WebContents*()>& wc_getter, + NavigationUIData* navigation_ui_data) { return std::vector<std::unique_ptr<URLLoaderThrottle>>(); }
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h index bb21f85..4917c582 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h
@@ -939,7 +939,8 @@ // URL request. This is used only when --enable-network-service is in effect. // This is called on the IO thread. virtual std::vector<std::unique_ptr<URLLoaderThrottle>> - CreateURLLoaderThrottles(const base::Callback<WebContents*()>& wc_getter); + CreateURLLoaderThrottles(const base::Callback<WebContents*()>& wc_getter, + NavigationUIData* navigation_ui_data); // Allows the embedder to register per-scheme URLLoaderFactory implementations // to handle navigation URL requests for schemes not handled by the Network
diff --git a/content/public/browser/gpu_utils.cc b/content/public/browser/gpu_utils.cc index 008fdc6..001b3ad 100644 --- a/content/public/browser/gpu_utils.cc +++ b/content/public/browser/gpu_utils.cc
@@ -56,10 +56,8 @@ command_line->HasSwitch(switches::kInProcessGPU); gpu_preferences.disable_accelerated_video_decode = command_line->HasSwitch(switches::kDisableAcceleratedVideoDecode); -#if defined(OS_CHROMEOS) - gpu_preferences.disable_vaapi_accelerated_video_encode = - command_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode); -#endif + gpu_preferences.disable_accelerated_video_encode = + command_line->HasSwitch(switches::kDisableAcceleratedVideoEncode); #if BUILDFLAG(ENABLE_WEBRTC) gpu_preferences.disable_web_rtc_hw_encoding = command_line->HasSwitch(switches::kDisableWebRtcHWEncoding);
diff --git a/content/public/browser/navigation_data.h b/content/public/browser/navigation_data.h new file mode 100644 index 0000000..d0fccd6d --- /dev/null +++ b/content/public/browser/navigation_data.h
@@ -0,0 +1,25 @@ +// 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. + +#ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_DATA_H_ +#define CONTENT_PUBLIC_BROWSER_NAVIGATION_DATA_H_ + +#include <memory> + +namespace content { + +// Copyable interface for embedders to pass opaque data to content/. It is +// expected to be created on the IO thread, and content/ will transfer it to the +// UI thread as a clone. +class NavigationData { + public: + virtual ~NavigationData(){}; + + // Creates a new NavigationData that is a deep copy of the original + virtual std::unique_ptr<NavigationData> Clone() const = 0; +}; + +} // namespace content + +#endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_DATA_H_
diff --git a/content/public/browser/navigation_handle.cc b/content/public/browser/navigation_handle.cc index 8eea81f..1acf7c5 100644 --- a/content/public/browser/navigation_handle.cc +++ b/content/public/browser/navigation_handle.cc
@@ -27,9 +27,20 @@ RenderFrameHost* render_frame_host, bool committed, net::Error error, - bool is_same_document) { + bool is_same_document, + bool is_post, + ui::PageTransition transition) { RenderFrameHostImpl* rfhi = static_cast<RenderFrameHostImpl*>(render_frame_host); + scoped_refptr<ResourceRequestBody> resource_request_body; + std::string method = "GET"; + if (is_post) { + method = "POST"; + + std::string body = "test=body"; + resource_request_body = new ResourceRequestBody(); + resource_request_body->AppendBytes(body.data(), body.size()); + } std::unique_ptr<NavigationHandleImpl> handle_impl = NavigationHandleImpl::Create( url, std::vector<GURL>(), rfhi->frame_tree_node(), @@ -37,7 +48,11 @@ is_same_document, base::TimeTicks::Now(), 0, false, // started_from_context_menu CSPDisposition::CHECK, // should_check_main_world_csp - false); // is_form_submission + false, // is_form_submission + base::nullopt, // suggested_filename + method, resource_request_body, Referrer(), + false, // has_user_gesture + transition); handle_impl->set_render_frame_host(rfhi); if (error != net::OK) handle_impl->set_net_error_code(error);
diff --git a/content/public/browser/navigation_handle.h b/content/public/browser/navigation_handle.h index ffcb64e0..b0b9a843 100644 --- a/content/public/browser/navigation_handle.h +++ b/content/public/browser/navigation_handle.h
@@ -21,16 +21,13 @@ class GURL; -namespace base { -class Value; -} // namespace base - namespace net { class HttpResponseHeaders; } // namespace net namespace content { struct GlobalRequestID; +class NavigationData; class NavigationThrottle; class RenderFrameHost; class SiteInstance; @@ -121,13 +118,6 @@ // Used for specifying a base URL for pages loaded via data URLs. virtual const GURL& GetBaseURLForDataURL() = 0; - // Parameters available at network request start time ------------------------ - // - // The following parameters are only available when the network request is - // made for the navigation (or at commit time if no network request is made). - // This corresponds to NavigationThrottle::WillSendRequest. They should not - // be queried before that. - // Whether the navigation is done using HTTP POST method. This may change // during the navigation (e.g. after encountering a server redirect). // @@ -260,6 +250,10 @@ // navigation when processing final (post redirect) HTTP response headers. virtual bool IsDownload() = 0; + // If this navigation was triggered by an anchor with a download attribute, + // this returns the (possibly empty) value of that attribute. + virtual const base::Optional<std::string>& GetSuggestedFilename() = 0; + // Testing methods ---------------------------------------------------------- // // The following methods should be used exclusively for writing unit tests. @@ -269,7 +263,9 @@ RenderFrameHost* render_frame_host, bool committed = false, net::Error error = net::OK, - bool is_same_document = false); + bool is_same_document = false, + bool is_post = false, + ui::PageTransition transition = ui::PAGE_TRANSITION_LINK); // Registers a NavigationThrottle for tests. The throttle can // modify the request, pause the request or cancel the request. This will @@ -283,11 +279,7 @@ // Simulates the network request starting. virtual NavigationThrottle::ThrottleCheckResult - CallWillStartRequestForTesting(bool is_post, - const Referrer& sanitized_referrer, - bool has_user_gesture, - ui::PageTransition transition, - bool is_external_protocol) = 0; + CallWillStartRequestForTesting() = 0; // Simulates the network request being redirected. virtual NavigationThrottle::ThrottleCheckResult @@ -316,7 +308,7 @@ // The NavigationData that the embedder returned from // ResourceDispatcherHostDelegate::GetNavigationData during commit. This will // be a clone of the NavigationData. - virtual const base::Value& GetNavigationData() = 0; + virtual NavigationData* GetNavigationData() = 0; }; } // namespace content
diff --git a/content/public/browser/resource_dispatcher_host_delegate.cc b/content/public/browser/resource_dispatcher_host_delegate.cc index 5ceaa8f..e51377e 100644 --- a/content/public/browser/resource_dispatcher_host_delegate.cc +++ b/content/public/browser/resource_dispatcher_host_delegate.cc
@@ -4,7 +4,7 @@ #include "content/public/browser/resource_dispatcher_host_delegate.h" -#include "base/values.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/resource_request_info.h" #include "content/public/browser/stream_info.h" #include "net/ssl/client_cert_store.h" @@ -87,9 +87,9 @@ return PREVIEWS_UNSPECIFIED; } -base::Value ResourceDispatcherHostDelegate::GetNavigationData( - net::URLRequest* request) { - return base::Value(); +NavigationData* ResourceDispatcherHostDelegate::GetNavigationData( + net::URLRequest* request) const { + return nullptr; } std::unique_ptr<net::ClientCertStore>
diff --git a/content/public/browser/resource_dispatcher_host_delegate.h b/content/public/browser/resource_dispatcher_host_delegate.h index b26956a..3d24882 100644 --- a/content/public/browser/resource_dispatcher_host_delegate.h +++ b/content/public/browser/resource_dispatcher_host_delegate.h
@@ -18,11 +18,6 @@ #include "ui/base/page_transition_types.h" class GURL; - -namespace base { -class Value; -} - namespace net { class AuthChallengeInfo; class ClientCertStore; @@ -32,6 +27,7 @@ namespace content { class AppCacheService; +class NavigationData; class ResourceContext; class ResourceDispatcherHostLoginDelegate; class ResourceThrottle; @@ -135,7 +131,7 @@ // Asks the embedder for NavigationData related to this request. It is only // called for navigation requests. - virtual base::Value GetNavigationData(net::URLRequest* request); + virtual NavigationData* GetNavigationData(net::URLRequest* request) const; // Get platform ClientCertStore. May return nullptr. virtual std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc index 847a1af6..9075bd85 100644 --- a/content/public/common/content_features.cc +++ b/content/public/common/content_features.cc
@@ -312,7 +312,7 @@ // http://tc39.github.io/ecmascript_sharedmem/shmem.html const base::Feature kSharedArrayBuffer{"SharedArrayBuffer", - base::FEATURE_ENABLED_BY_DEFAULT}; + base::FEATURE_DISABLED_BY_DEFAULT}; // An experiment to require process isolation for the sign-in origin, // https://accounts.google.com. Launch bug: https://crbug.com/739418.
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 28c3faf..b7a1cacd 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc
@@ -88,6 +88,10 @@ const char kDisableAcceleratedVideoDecode[] = "disable-accelerated-video-decode"; +// Disables hardware acceleration of video encode, where available. +const char kDisableAcceleratedVideoEncode[] = + "disable-accelerated-video-encode"; + // Disable limits on the number of backing stores. Can prevent blinking for // users with many windows/tabs and lots of memory. const char kDisableBackingStoreLimit[] = "disable-backing-store-limit"; @@ -847,9 +851,6 @@ // streams (e.g. WebRTC). Works with --use-fake-device-for-media-stream. const char kUseFakeUIForMediaStream[] = "use-fake-ui-for-media-stream"; -// Texture target for CHROMIUM_image backed content textures. -const char kContentImageTextureTarget[] = "content-image-texture-target"; - // Texture target for CHROMIUM_image backed video frame textures. const char kVideoImageTextureTarget[] = "video-image-texture-target"; @@ -984,10 +985,6 @@ #if defined(OS_CHROMEOS) // Disables panel fitting (used for mirror mode). const char kDisablePanelFitting[] = "disable-panel-fitting"; - -// Disables VA-API accelerated video encode. -const char kDisableVaapiAcceleratedVideoEncode[] = - "disable-vaapi-accelerated-video-encode"; #endif #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index 4ba53bc..e0c0f91 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h
@@ -35,6 +35,7 @@ CONTENT_EXPORT extern const char kDisableAcceleratedJpegDecoding[]; CONTENT_EXPORT extern const char kDisableAcceleratedMjpegDecode[]; CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[]; +CONTENT_EXPORT extern const char kDisableAcceleratedVideoEncode[]; CONTENT_EXPORT extern const char kDisableAudioSupportForDesktopShare[]; extern const char kDisableBackingStoreLimit[]; CONTENT_EXPORT extern const char @@ -230,7 +231,6 @@ CONTENT_EXPORT extern const char kTouchEventFeatureDetectionDisabled[]; CONTENT_EXPORT extern const char kTouchTextSelectionStrategy[]; CONTENT_EXPORT extern const char kUseFakeUIForMediaStream[]; -CONTENT_EXPORT extern const char kContentImageTextureTarget[]; CONTENT_EXPORT extern const char kVideoImageTextureTarget[]; CONTENT_EXPORT extern const char kUseMobileUserAgent[]; extern const char kUtilityCmdPrefix[]; @@ -273,7 +273,6 @@ #if defined(OS_CHROMEOS) CONTENT_EXPORT extern const char kDisablePanelFitting[]; -CONTENT_EXPORT extern const char kDisableVaapiAcceleratedVideoEncode[]; #endif #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
diff --git a/content/public/common/resource_response_info.cc b/content/public/common/resource_response_info.cc index dff9f8e..0ca94dd 100644 --- a/content/public/common/resource_response_info.cc +++ b/content/public/common/resource_response_info.cc
@@ -4,8 +4,6 @@ #include "content/public/common/resource_response_info.h" -#include "content/public/common/appcache_info.h" -#include "content/public/common/previews_state.h" #include "net/http/http_response_headers.h" namespace content { @@ -15,7 +13,7 @@ content_length(-1), encoded_data_length(-1), encoded_body_length(-1), - appcache_id(kAppCacheNoCacheId), + appcache_id(0), was_fetched_via_spdy(false), was_alpn_negotiated(false), was_alternate_protocol_available(false), @@ -24,7 +22,7 @@ was_fallback_required_by_service_worker(false), response_type_via_service_worker( network::mojom::FetchResponseType::kDefault), - previews_state(PREVIEWS_OFF), + previews_state(0), effective_connection_type(net::EFFECTIVE_CONNECTION_TYPE_UNKNOWN), cert_status(0), ssl_connection_status(0),
diff --git a/content/public/common/resource_response_info.h b/content/public/common/resource_response_info.h index 897243f..fce17573 100644 --- a/content/public/common/resource_response_info.h +++ b/content/public/common/resource_response_info.h
@@ -13,7 +13,6 @@ #include "base/memory/ref_counted.h" #include "base/time/time.h" #include "content/common/content_export.h" -#include "content/public/common/previews_state.h" #include "net/base/host_port_pair.h" #include "net/base/load_timing_info.h" #include "net/cert/signed_certificate_timestamp_and_status.h" @@ -70,6 +69,7 @@ int64_t encoded_body_length; // The appcache this response was loaded from, or kAppCacheNoCacheId. + // TODO(rdsmith): Remove conceptual dependence on appcache. int64_t appcache_id; // The manifest url of the appcache this response was loaded from. @@ -145,7 +145,9 @@ // A bitmask of potentially several Previews optimizations that the resource // could have requested. - PreviewsState previews_state; + // TODO(rdsmith, reillyg): Only used by DRP; should be removed as part of DRP + // servicification. + int previews_state; // Effective connection type when the resource was fetched. This is populated // only for responses that correspond to main frame requests.
diff --git a/content/public/common/url_loader.mojom b/content/public/common/url_loader.mojom index 120d2164..241ef40a 100644 --- a/content/public/common/url_loader.mojom +++ b/content/public/common/url_loader.mojom
@@ -49,7 +49,8 @@ // Sets the request priority. // |intra_priority_value| is a lesser priority which is used to prioritize - // requests within a given priority level. + // requests within a given priority level. If -1 is passed, the existing + // intra priority value is maintained. SetPriority(RequestPriority priority, int32 intra_priority_value); // If a URLLoader fetches the resource from network, it should handle these
diff --git a/content/public/common/url_loader_throttle.cc b/content/public/common/url_loader_throttle.cc index 20115f9d..ff796773 100644 --- a/content/public/common/url_loader_throttle.cc +++ b/content/public/common/url_loader_throttle.cc
@@ -8,6 +8,7 @@ namespace content { +void URLLoaderThrottle::Delegate::SetPriority(net::RequestPriority priority) {} void URLLoaderThrottle::Delegate::PauseReadingBodyFromNet() {} void URLLoaderThrottle::Delegate::ResumeReadingBodyFromNet() {} @@ -19,11 +20,12 @@ NOTREACHED(); } -void URLLoaderThrottle::WillStartRequest(const ResourceRequest& request, +void URLLoaderThrottle::WillStartRequest(ResourceRequest* request, bool* defer) {} void URLLoaderThrottle::WillRedirectRequest( const net::RedirectInfo& redirect_info, + const ResourceResponseHead& response_head, bool* defer) {} void URLLoaderThrottle::WillProcessResponse(
diff --git a/content/public/common/url_loader_throttle.h b/content/public/common/url_loader_throttle.h index e6d67cc..09768b6 100644 --- a/content/public/common/url_loader_throttle.h +++ b/content/public/common/url_loader_throttle.h
@@ -7,6 +7,7 @@ #include "content/common/content_export.h" #include "content/public/common/resource_type.h" +#include "net/base/request_priority.h" class GURL; @@ -45,6 +46,8 @@ // not deferred or has already been canceled. virtual void Resume() = 0; + virtual void SetPriority(net::RequestPriority priority); + // Pauses/resumes reading response body if the resource is fetched from // network. virtual void PauseReadingBodyFromNet(); @@ -62,13 +65,14 @@ virtual void DetachFromCurrentSequence(); // Called before the resource request is started. - virtual void WillStartRequest(const ResourceRequest& request, bool* defer); + virtual void WillStartRequest(ResourceRequest* request, bool* defer); // Called when the request was redirected. |redirect_info| contains the // redirect responses's HTTP status code and some information about the new // request that will be sent if the redirect is followed, including the new // URL and new method. virtual void WillRedirectRequest(const net::RedirectInfo& redirect_info, + const ResourceResponseHead& response_head, bool* defer); // Called when the response headers and meta data are available.
diff --git a/content/public/common/url_request_redirect_info.typemap b/content/public/common/url_request_redirect_info.typemap index cf98da5b..ef52349 100644 --- a/content/public/common/url_request_redirect_info.typemap +++ b/content/public/common/url_request_redirect_info.typemap
@@ -4,9 +4,8 @@ mojom = "//content/public/common/url_loader.mojom" public_headers = [ "//net/url_request/redirect_info.h" ] -traits_headers = [ "//content/common/resource_messages.h" ] +traits_headers = [ "//services/network/public/cpp/network_param_ipc_traits.h" ] deps = [ - "//content:export", "//net:net", ] type_mappings = [ "content.mojom.URLRequestRedirectInfo=net::RedirectInfo" ]
diff --git a/content/public/gpu/content_gpu_client.cc b/content/public/gpu/content_gpu_client.cc index 1f2226a..7530868 100644 --- a/content/public/gpu/content_gpu_client.cc +++ b/content/public/gpu/content_gpu_client.cc
@@ -4,6 +4,10 @@ #include "content/public/gpu/content_gpu_client.h" +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) +#include "media/cdm/cdm_proxy.h" +#endif + namespace content { gpu::SyncPointManager* ContentGpuClient::GetSyncPointManager() { @@ -18,4 +22,11 @@ return nullptr; } +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) +std::unique_ptr<media::CdmProxy> ContentGpuClient::CreateCdmProxy( + const std::string& cdm_guid) { + return nullptr; +} +#endif + } // namespace content
diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h index cda3fd8..11a0ece 100644 --- a/content/public/gpu/content_gpu_client.h +++ b/content/public/gpu/content_gpu_client.h
@@ -5,8 +5,12 @@ #ifndef CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ #define CONTENT_PUBLIC_GPU_CONTENT_GPU_CLIENT_H_ +#include <memory> +#include <string> + #include "base/metrics/field_trial.h" #include "content/public/common/content_client.h" +#include "media/media_features.h" #include "services/service_manager/public/cpp/binder_registry.h" namespace gpu { @@ -16,6 +20,10 @@ class SyncPointManager; } +namespace media { +class CdmProxy; +} + namespace content { // Embedder API for participating in gpu logic. @@ -42,6 +50,13 @@ // Allows client to re-use GPUInfo and GpuFeatureInfo if already computed. virtual const gpu::GPUInfo* GetGPUInfo(); virtual const gpu::GpuFeatureInfo* GetGpuFeatureInfo(); + +#if BUILDFLAG(ENABLE_LIBRARY_CDMS) + // Creates a media::CdmProxy for the type of Content Decryption Module (CDM) + // identified by |cdm_guid|. + virtual std::unique_ptr<media::CdmProxy> CreateCdmProxy( + const std::string& cdm_guid); +#endif }; } // namespace content
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc index 3e3d132..ee43a87 100644 --- a/content/public/renderer/content_renderer_client.cc +++ b/content/public/renderer/content_renderer_client.cc
@@ -132,6 +132,7 @@ blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, + ResourceType resource_type, std::vector<std::unique_ptr<URLLoaderThrottle>>* throttles, GURL* new_url) { return false;
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h index 3d34633..627450e 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h
@@ -18,6 +18,7 @@ #include "base/task_scheduler/task_scheduler.h" #include "build/build_config.h" #include "content/public/common/content_client.h" +#include "content/public/common/resource_type.h" #include "media/base/decode_capabilities.h" #include "third_party/WebKit/common/page/page_visibility_state.mojom.h" #include "third_party/WebKit/public/platform/WebContentSettingsClient.h" @@ -230,6 +231,7 @@ blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, + ResourceType resource_type, std::vector<std::unique_ptr<URLLoaderThrottle>>* throttles, GURL* new_url);
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc index 29f4a84..72ad87e 100644 --- a/content/public/test/browser_test_utils.cc +++ b/content/public/test/browser_test_utils.cc
@@ -1530,7 +1530,7 @@ void SurfaceHitTestReadyNotifier::WaitForSurfaceReady( RenderWidgetHostViewBase* root_view) { - viz::SurfaceId root_surface_id = root_view->SurfaceIdForTesting(); + viz::SurfaceId root_surface_id = root_view->GetCurrentSurfaceId(); while (!ContainsSurfaceId(root_surface_id)) { // TODO(kenrb): Need a better way to do this. Needs investigation on // whether we can add a callback through RenderWidgetHostViewBaseObserver @@ -1556,7 +1556,7 @@ for (const viz::SurfaceId& id : *container_surface->active_referenced_surfaces()) { - if (id == target_view_->SurfaceIdForTesting() || ContainsSurfaceId(id)) + if (id == target_view_->GetCurrentSurfaceId() || ContainsSurfaceId(id)) return true; } return false;
diff --git a/content/public/test/content_test_suite_base.cc b/content/public/test/content_test_suite_base.cc index deb8892..a1f0f0a 100644 --- a/content/public/test/content_test_suite_base.cc +++ b/content/public/test/content_test_suite_base.cc
@@ -7,7 +7,6 @@ #include <memory> #include "base/compiler_specific.h" -#include "base/metrics/statistics_recorder.h" #include "base/test/test_suite.h" #include "base/threading/sequenced_worker_pool.h" #include "build/build_config.h" @@ -40,11 +39,6 @@ void ContentTestSuiteBase::Initialize() { base::TestSuite::Initialize(); - // Initialize the histograms subsystem, so that any histograms hit in tests - // are correctly registered with the statistics recorder and can be queried - // by tests. - base::StatisticsRecorder::Initialize(); - #if defined(V8_USE_EXTERNAL_STARTUP_DATA) gin::V8Initializer::LoadV8Snapshot(); gin::V8Initializer::LoadV8Natives();
diff --git a/content/public/test/navigation_simulator.cc b/content/public/test/navigation_simulator.cc index 545f327..046dd89 100644 --- a/content/public/test/navigation_simulator.cc +++ b/content/public/test/navigation_simulator.cc
@@ -234,6 +234,7 @@ handle_(nullptr), navigation_url_(original_url), socket_address_("2001:db8::1", 80), + initial_method_("GET"), browser_initiated_(browser_initiated), transition_(browser_initiated ? ui::PAGE_TRANSITION_TYPED : ui::PAGE_TRANSITION_LINK), @@ -622,6 +623,12 @@ transition_ = ui::PAGE_TRANSITION_RELOAD; } +void NavigationSimulator::SetMethod(const std::string& method) { + CHECK_EQ(INITIALIZATION, state_) << "The method parameter cannot " + "be set after the navigation has started"; + initial_method_ = method; +} + void NavigationSimulator::SetReferrer(const Referrer& referrer) { CHECK_LE(state_, STARTED) << "The referrer cannot be set after the " "navigation has committed or has failed"; @@ -822,6 +829,7 @@ base::nullopt /* suggested_filename */); CommonNavigationParams common_params; common_params.url = navigation_url_; + common_params.method = initial_method_; common_params.referrer = referrer_; common_params.transition = transition_; common_params.navigation_type =
diff --git a/content/public/test/navigation_simulator.h b/content/public/test/navigation_simulator.h index 10e9b51..ec4fb53 100644 --- a/content/public/test/navigation_simulator.h +++ b/content/public/test/navigation_simulator.h
@@ -213,6 +213,9 @@ // navigations. void SetReloadType(ReloadType reload_type); + // Sets the HTTP method for the navigation. + void SetMethod(const std::string& method); + // The following parameters can change during redirects. They should be // specified before calling |Start| if they need to apply to the navigation to // the original url. Otherwise, they should be specified before calling @@ -343,6 +346,7 @@ GURL navigation_url_; net::HostPortPair socket_address_; + std::string initial_method_; bool browser_initiated_; bool same_document_ = false; Referrer referrer_;
diff --git a/content/public/test/test_renderer_host.cc b/content/public/test/test_renderer_host.cc index 9fba244..8ba67bab 100644 --- a/content/public/test/test_renderer_host.cc +++ b/content/public/test/test_renderer_host.cc
@@ -208,7 +208,7 @@ } BrowserContext* RenderViewHostTestHarness::browser_context() { - return browser_context_.get(); + return GetBrowserContext(); } MockRenderProcessHost* RenderViewHostTestHarness::process() { @@ -233,10 +233,10 @@ #endif scoped_refptr<SiteInstance> instance = - SiteInstance::Create(browser_context_.get()); + SiteInstance::Create(GetBrowserContext()); instance->GetProcess()->Init(); - return TestWebContents::Create(browser_context_.get(), std::move(instance)); + return TestWebContents::Create(GetBrowserContext(), std::move(instance)); } void RenderViewHostTestHarness::NavigateAndCommit(const GURL& url) { @@ -319,6 +319,10 @@ return new TestBrowserContext(); } +BrowserContext* RenderViewHostTestHarness::GetBrowserContext() { + return browser_context_.get(); +} + void RenderViewHostTestHarness::SetRenderProcessHostFactory( RenderProcessHostFactory* factory) { if (rvh_test_enabler_)
diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h index 6478b1b..b5066ca 100644 --- a/content/public/test/test_renderer_host.h +++ b/content/public/test/test_renderer_host.h
@@ -249,6 +249,12 @@ // BrowserContext. virtual BrowserContext* CreateBrowserContext(); + // Derived classes can override this method to have the test harness use a + // different BrowserContext than the one owned by this class. This is most + // useful for off-the-record contexts, which are usually owned by the original + // context. + virtual BrowserContext* GetBrowserContext(); + #if defined(USE_AURA) aura::Window* root_window() { return aura_test_helper_->root_window(); } #endif
diff --git a/content/public/test/web_contents_tester.h b/content/public/test/web_contents_tester.h index b73bec6b..5b64dca4 100644 --- a/content/public/test/web_contents_tester.h +++ b/content/public/test/web_contents_tester.h
@@ -15,10 +15,6 @@ class GURL; class SkBitmap; -namespace base { -class Value; -} - namespace gfx { class Size; } @@ -30,6 +26,7 @@ namespace content { class BrowserContext; +class NavigationData; class NavigationHandle; class RenderFrameHost; @@ -102,8 +99,9 @@ ui::PageTransition transition) = 0; // Sets NavgationData on |navigation_handle|. - virtual void SetNavigationData(NavigationHandle* navigation_handle, - base::Value navigation_data) = 0; + virtual void SetNavigationData( + NavigationHandle* navigation_handle, + std::unique_ptr<NavigationData> navigation_data) = 0; // Sets HttpResponseData on |navigation_handle|. virtual void SetHttpResponseHeaders(
diff --git a/content/renderer/android/synchronous_layer_tree_frame_sink.cc b/content/renderer/android/synchronous_layer_tree_frame_sink.cc index f5065bf5..3d20070 100644 --- a/content/renderer/android/synchronous_layer_tree_frame_sink.cc +++ b/content/renderer/android/synchronous_layer_tree_frame_sink.cc
@@ -203,9 +203,9 @@ // TODO(crbug.com/692814): The Display never sends its resources out of // process so there is no reason for it to use a SharedBitmapManager. display_ = std::make_unique<viz::Display>( - &shared_bitmap_manager_, nullptr /* gpu_memory_buffer_manager */, - software_renderer_settings, kRootFrameSinkId, std::move(output_surface), - nullptr /* scheduler */, nullptr /* current_task_runner */); + &shared_bitmap_manager_, software_renderer_settings, kRootFrameSinkId, + std::move(output_surface), nullptr /* scheduler */, + nullptr /* current_task_runner */); display_->Initialize(&display_client_, frame_sink_manager_->surface_manager()); display_->SetVisible(true);
diff --git a/content/renderer/child_frame_compositing_helper.cc b/content/renderer/child_frame_compositing_helper.cc index c9d8866..4edf6ac 100644 --- a/content/renderer/child_frame_compositing_helper.cc +++ b/content/renderer/child_frame_compositing_helper.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/command_line.h" +#include "build/build_config.h" #include "cc/blink/web_layer_impl.h" #include "cc/layers/picture_image_layer.h" #include "cc/layers/solid_color_layer.h" @@ -46,6 +47,16 @@ namespace { +bool AreSurfaceReferencesEnabled() { +#if defined(OS_ANDROID) + return base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableSurfaceReferences); +#else + // Surface references are always enabled for non-Android platforms. + return true; +#endif +} + class IframeSurfaceReferenceFactory : public viz::SequenceSurfaceReferenceFactory { public: @@ -169,11 +180,10 @@ : host_routing_id_(host_routing_id), browser_plugin_(browser_plugin), render_frame_proxy_(render_frame_proxy), - frame_(frame) { - enable_surface_references_ = - !base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableSurfaceReferences); - if (enable_surface_references_) { + frame_(frame), + enable_surface_references_(AreSurfaceReferencesEnabled()) { + // In some tests there is no RenderThreadImpl instance. + if (enable_surface_references_ || !RenderThreadImpl::current()) { surface_reference_factory_ = new viz::StubSurfaceReferenceFactory(); } else { scoped_refptr<ThreadSafeSender> sender( @@ -256,7 +266,7 @@ surface_layer_ = cc::SurfaceLayer::Create(surface_reference_factory_); surface_layer_->SetMasksToBounds(true); - surface_layer_->SetDefaultBackgroundColor(SK_ColorTRANSPARENT); + surface_layer_->SetBackgroundColor(SK_ColorTRANSPARENT); surface_layer_->SetPrimarySurfaceId(surface_id); surface_layer_->SetFallbackSurfaceId(fallback_surface_id_);
diff --git a/content/renderer/gpu/compositor_dependencies.h b/content/renderer/gpu/compositor_dependencies.h index 29b907d..536de2a 100644 --- a/content/renderer/gpu/compositor_dependencies.h +++ b/content/renderer/gpu/compositor_dependencies.h
@@ -38,8 +38,6 @@ virtual bool IsPartialRasterEnabled() = 0; virtual bool IsGpuMemoryBufferCompositorResourcesEnabled() = 0; virtual bool IsElasticOverscrollEnabled() = 0; - virtual const viz::BufferUsageAndFormatList& - GetTextureTargetExceptionList() = 0; virtual scoped_refptr<base::SingleThreadTaskRunner> GetCompositorMainThreadTaskRunner() = 0; // Returns null if the compositor is in single-threaded mode (ie. there is no
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index d211c01c..cebf457d 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -424,8 +424,6 @@ compositor_deps->IsElasticOverscrollEnabled(); settings.resource_settings.use_gpu_memory_buffer_resources = compositor_deps->IsGpuMemoryBufferCompositorResourcesEnabled(); - settings.resource_settings.texture_target_exception_list = - compositor_deps->GetTextureTargetExceptionList(); settings.enable_oop_rasterization = cmd.HasSwitch(switches::kEnableOOPRasterization);
diff --git a/content/renderer/input/input_target_client_impl.cc b/content/renderer/input/input_target_client_impl.cc index 1ce6116..db8a81e 100644 --- a/content/renderer/input/input_target_client_impl.cc +++ b/content/renderer/input/input_target_client_impl.cc
@@ -24,9 +24,8 @@ void InputTargetClientImpl::FrameSinkIdAt(const gfx::Point& point, FrameSinkIdAtCallback callback) { - std::move(callback).Run(viz::FrameSinkId( - RenderThread::Get()->GetClientId(), - render_frame_->GetRenderWidget()->GetWidgetRoutingIdAtPoint(point))); + std::move(callback).Run( + render_frame_->GetRenderWidget()->GetFrameSinkIdAtPoint(point)); } } // namespace content
diff --git a/content/renderer/input/main_thread_event_queue.cc b/content/renderer/input/main_thread_event_queue.cc index a9efa0c..b14c6a1c 100644 --- a/content/renderer/input/main_thread_event_queue.cc +++ b/content/renderer/input/main_thread_event_queue.cc
@@ -16,7 +16,6 @@ namespace { -const size_t kTenSeconds = 10 * 1000 * 1000; constexpr base::TimeDelta kMaxRafDelay = base::TimeDelta::FromMilliseconds(5 * 1000); @@ -100,23 +99,9 @@ void Dispatch(MainThreadEventQueue* queue) override { // Report the coalesced count only for continuous events; otherwise // the zero value would be dominated by non-continuous events. - base::TimeTicks now = base::TimeTicks::Now(); if (IsContinuousEvent()) { - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Event.MainThreadEventQueue.Continuous.QueueingTime", - (now - creationTimestamp()).InMicroseconds(), 1, kTenSeconds, 50); - - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Event.MainThreadEventQueue.Continuous.FreshnessTime", - (now - lastCoalescedTimestamp()).InMicroseconds(), 1, kTenSeconds, - 50); - UMA_HISTOGRAM_COUNTS_1000("Event.MainThreadEventQueue.CoalescedCount", coalescedCount()); - } else { - UMA_HISTOGRAM_CUSTOM_COUNTS( - "Event.MainThreadEventQueue.NonContinuous.QueueingTime", - (now - creationTimestamp()).InMicroseconds(), 1, kTenSeconds, 50); } HandledEventCallback callback =
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc index c6b9520..f2591a8 100644 --- a/content/renderer/input/render_widget_input_handler.cc +++ b/content/renderer/input/render_widget_input_handler.cc
@@ -13,13 +13,16 @@ #include "base/metrics/histogram_macros.h" #include "build/build_config.h" #include "cc/trees/swap_promise_monitor.h" +#include "components/viz/common/surfaces/frame_sink_id.h" #include "content/common/input/input_event_ack.h" #include "content/public/common/content_switches.h" #include "content/public/common/input_event_ack_state.h" +#include "content/public/common/use_zoom_for_dsf_policy.h" #include "content/public/renderer/render_frame.h" #include "content/renderer/gpu/render_widget_compositor.h" #include "content/renderer/ime_event_guard.h" #include "content/renderer/input/render_widget_input_handler_delegate.h" +#include "content/renderer/render_frame_proxy.h" #include "content/renderer/render_thread_impl.h" #include "content/renderer/render_widget.h" #include "third_party/WebKit/public/platform/WebFloatPoint.h" @@ -159,11 +162,13 @@ RenderWidgetInputHandler::~RenderWidgetInputHandler() {} -int RenderWidgetInputHandler::GetWidgetRoutingIdAtPoint( +viz::FrameSinkId RenderWidgetInputHandler::GetFrameSinkIdAtPoint( const gfx::Point& point) { - gfx::PointF point_in_pixel = - gfx::ConvertPointToPixel(widget_->GetOriginalDeviceScaleFactor(), - gfx::PointF(point.x(), point.y())); + gfx::PointF point_in_pixel(point); + if (UseZoomForDSFEnabled()) { + point_in_pixel = gfx::ConvertPointToPixel( + widget_->GetOriginalDeviceScaleFactor(), point_in_pixel); + } blink::WebNode result_node = widget_->GetWebWidget() ->HitTestResultAt(blink::WebPoint( point_in_pixel.x(), point_in_pixel.y())) @@ -178,17 +183,23 @@ DCHECK(web_widget->IsWebFrameWidget()); auto* frame_widget = static_cast<blink::WebFrameWidget*>(web_widget); blink::WebFrame* web_frame = frame_widget->LocalRoot(); - return RenderFrame::GetRoutingIdForWebFrame(web_frame); + return viz::FrameSinkId(RenderThread::Get()->GetClientId(), + RenderFrame::GetRoutingIdForWebFrame(web_frame)); } blink::WebFrame* result_frame = blink::WebFrame::FromFrameOwnerElement(result_node); if (!result_frame) { // This means that the node is not an iframe itself. So we just return the - // the frame containing the node. + // frame containing the node. result_frame = result_node.GetDocument().GetFrame(); } - return RenderFrame::GetRoutingIdForWebFrame(result_frame); + if (result_frame->IsWebRemoteFrame()) { + return RenderFrameProxy::FromWebFrame(result_frame->ToWebRemoteFrame()) + ->frame_sink_id(); + } + return viz::FrameSinkId(RenderThread::Get()->GetClientId(), + RenderFrame::GetRoutingIdForWebFrame(result_frame)); } void RenderWidgetInputHandler::HandleInputEvent(
diff --git a/content/renderer/input/render_widget_input_handler.h b/content/renderer/input/render_widget_input_handler.h index 2e8431a6..f80c1a2 100644 --- a/content/renderer/input/render_widget_input_handler.h +++ b/content/renderer/input/render_widget_input_handler.h
@@ -26,6 +26,10 @@ class LatencyInfo; } +namespace viz { +class FrameSinkId; +} + namespace content { class RenderWidget; @@ -40,8 +44,8 @@ virtual ~RenderWidgetInputHandler(); // Hit test the given point to find out the frame underneath and - // return the routing id for that frame. - int GetWidgetRoutingIdAtPoint(const gfx::Point& point); + // returns the FrameSinkId for that frame. + viz::FrameSinkId GetFrameSinkIdAtPoint(const gfx::Point& point); // Handle input events from the input event provider. virtual void HandleInputEvent(
diff --git a/content/renderer/loader/resource_dispatcher.cc b/content/renderer/loader/resource_dispatcher.cc index 3b7afd6..6c668488 100644 --- a/content/renderer/loader/resource_dispatcher.cc +++ b/content/renderer/loader/resource_dispatcher.cc
@@ -37,6 +37,7 @@ #include "content/renderer/loader/sync_load_response.h" #include "content/renderer/loader/url_loader_client_impl.h" #include "content/renderer/render_frame_impl.h" +#include "net/base/load_flags.h" #include "net/base/net_errors.h" #include "net/base/request_priority.h" #include "net/http/http_response_headers.h" @@ -441,13 +442,15 @@ // MIME sniffing should be disabled for a request initiated by fetch(). options |= mojom::kURLLoadOptionSniffMimeType; } - if (is_sync) + if (is_sync) { options |= mojom::kURLLoadOptionSynchronous; + request->load_flags |= net::LOAD_IGNORE_LIMITS; + } std::unique_ptr<ThrottlingURLLoader> url_loader = ThrottlingURLLoader::CreateLoaderAndStart( url_loader_factory, std::move(throttles), routing_id, request_id, - options, *request, client.get(), traffic_annotation, + options, request.get(), client.get(), traffic_annotation, std::move(task_runner)); pending_requests_[request_id]->url_loader = std::move(url_loader); pending_requests_[request_id]->url_loader_client = std::move(client);
diff --git a/content/renderer/loader/web_url_loader_impl.cc b/content/renderer/loader/web_url_loader_impl.cc index 3cf60a8..ea9a20f 100644 --- a/content/renderer/loader/web_url_loader_impl.cc +++ b/content/renderer/loader/web_url_loader_impl.cc
@@ -29,6 +29,7 @@ #include "content/common/service_worker/service_worker_types.h" #include "content/public/common/browser_side_navigation_policy.h" #include "content/public/common/content_features.h" +#include "content/public/common/previews_state.h" #include "content/public/common/referrer.h" #include "content/public/common/resource_request.h" #include "content/public/common/resource_request_body.h" @@ -216,6 +217,7 @@ info->content_length = data->length(); info->encoded_data_length = 0; info->encoded_body_length = 0; + info->previews_state = PREVIEWS_OFF; return net::OK; } @@ -1167,7 +1169,8 @@ extra_data->set_was_alpn_negotiated(info.was_alpn_negotiated); extra_data->set_was_alternate_protocol_available( info.was_alternate_protocol_available); - extra_data->set_previews_state(info.previews_state); + extra_data->set_previews_state( + static_cast<PreviewsState>(info.previews_state)); extra_data->set_effective_connection_type(info.effective_connection_type); // If there's no received headers end time, don't set load timing. This is
diff --git a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc index 05deb05..4532924 100644 --- a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc +++ b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.cc
@@ -12,7 +12,6 @@ #include "base/metrics/histogram_macros.h" #include "base/unguessable_token.h" #include "components/viz/common/gpu/context_provider.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "content/child/child_thread_impl.h" #include "content/public/common/content_features.h" #include "content/public/common/service_names.mojom.h" @@ -57,7 +56,6 @@ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider, bool enable_gpu_memory_buffer_video_frames, - const viz::BufferUsageAndFormatList& texture_target_exception_list, bool enable_video_accelerator, media::mojom::VideoEncodeAcceleratorProviderPtrInfo unbound_vea_provider) { RecordContextProviderPhaseUmaEnum( @@ -65,8 +63,7 @@ return base::WrapUnique(new GpuVideoAcceleratorFactoriesImpl( std::move(gpu_channel_host), main_thread_task_runner, task_runner, context_provider, enable_gpu_memory_buffer_video_frames, - texture_target_exception_list, enable_video_accelerator, - std::move(unbound_vea_provider))); + enable_video_accelerator, std::move(unbound_vea_provider))); } GpuVideoAcceleratorFactoriesImpl::GpuVideoAcceleratorFactoriesImpl( @@ -75,7 +72,6 @@ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider, bool enable_gpu_memory_buffer_video_frames, - const viz::BufferUsageAndFormatList& texture_target_exception_list, bool enable_video_accelerator, media::mojom::VideoEncodeAcceleratorProviderPtrInfo unbound_vea_provider) : main_thread_task_runner_(main_thread_task_runner), @@ -85,7 +81,6 @@ context_provider_(context_provider.get()), enable_gpu_memory_buffer_video_frames_( enable_gpu_memory_buffer_video_frames), - texture_target_exception_list_(texture_target_exception_list), video_accelerator_enabled_(enable_video_accelerator), gpu_memory_buffer_manager_( RenderThreadImpl::current()->GetGpuMemoryBufferManager()), @@ -287,13 +282,10 @@ unsigned GpuVideoAcceleratorFactoriesImpl::ImageTextureTarget( gfx::BufferFormat format) { - auto it = std::find(texture_target_exception_list_.begin(), - texture_target_exception_list_.end(), - viz::BufferUsageAndFormat( - gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, format)); - if (it == texture_target_exception_list_.end()) - return GL_TEXTURE_2D; - return gpu::GetPlatformSpecificTextureTarget(); + DCHECK(context_provider_); + return gpu::GetBufferTextureTarget(gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, + format, + context_provider_->ContextCapabilities()); } media::GpuVideoAcceleratorFactories::OutputFormat
diff --git a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.h b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.h index b70c03b..41a6c2f 100644 --- a/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.h +++ b/content/renderer/media/gpu/gpu_video_accelerator_factories_impl.h
@@ -17,7 +17,6 @@ #include "base/single_thread_task_runner.h" #include "base/synchronization/waitable_event.h" #include "base/unguessable_token.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "content/child/thread_safe_sender.h" #include "content/common/content_export.h" #include "media/mojo/interfaces/video_encode_accelerator.mojom.h" @@ -59,7 +58,6 @@ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider, bool enable_gpu_memory_buffer_video_frames, - const viz::BufferUsageAndFormatList& texture_target_exception_list, bool enable_video_accelerator, media::mojom::VideoEncodeAcceleratorProviderPtrInfo unbound_vea_provider); @@ -117,7 +115,6 @@ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, const scoped_refptr<ui::ContextProviderCommandBuffer>& context_provider, bool enable_gpu_memory_buffer_video_frames, - const viz::BufferUsageAndFormatList& texture_target_exception_list, bool enable_video_accelerator, media::mojom::VideoEncodeAcceleratorProviderPtrInfo unbound_vea_provider); @@ -139,7 +136,6 @@ // Whether gpu memory buffers should be used to hold video frames data. bool enable_gpu_memory_buffer_video_frames_; - const viz::BufferUsageAndFormatList texture_target_exception_list_; // Whether video acceleration encoding/decoding should be enabled. const bool video_accelerator_enabled_;
diff --git a/content/renderer/media/media_interface_factory.cc b/content/renderer/media/media_interface_factory.cc index 74e3f73..f2ea09f 100644 --- a/content/renderer/media/media_interface_factory.cc +++ b/content/renderer/media/media_interface_factory.cc
@@ -82,6 +82,7 @@ } void MediaInterfaceFactory::CreateCdmProxy( + const std::string& cdm_guid, media::mojom::CdmProxyRequest request) { NOTREACHED() << "CdmProxy should only be connected from a library CDM"; }
diff --git a/content/renderer/media/media_interface_factory.h b/content/renderer/media/media_interface_factory.h index f127eefe..02cd30e 100644 --- a/content/renderer/media/media_interface_factory.h +++ b/content/renderer/media/media_interface_factory.h
@@ -36,7 +36,9 @@ media::mojom::RendererRequest request) final; void CreateCdm(const std::string& key_system, media::mojom::ContentDecryptionModuleRequest request) final; - void CreateCdmProxy(media::mojom::CdmProxyRequest request) final; + // TODO(xhwang): We should not expose this here. + void CreateCdmProxy(const std::string& cdm_guid, + media::mojom::CdmProxyRequest request) final; private: media::mojom::InterfaceFactory* GetMediaInterfaceFactory();
diff --git a/content/renderer/media/media_stream_constraints_util.cc b/content/renderer/media/media_stream_constraints_util.cc index cc8511c..c45646f 100644 --- a/content/renderer/media/media_stream_constraints_util.cc +++ b/content/renderer/media/media_stream_constraints_util.cc
@@ -30,9 +30,9 @@ return true; } for (const auto& advanced_constraint : constraints.Advanced()) { - const auto& the_field = advanced_constraint.*picker; - if (the_field.HasExact()) { - *value = the_field.Exact(); + const auto& advanced_field = advanced_constraint.*picker; + if (advanced_field.HasExact()) { + *value = advanced_field.Exact(); return true; } } @@ -45,7 +45,6 @@ T* value) { if (constraints.IsNull()) return false; - const auto& the_field = constraints.Basic().*picker; if (the_field.HasMax()) { *value = the_field.Max(); @@ -56,13 +55,13 @@ return true; } for (const auto& advanced_constraint : constraints.Advanced()) { - const auto& the_field = advanced_constraint.*picker; - if (the_field.HasMax()) { - *value = the_field.Max(); + const auto& advanced_field = advanced_constraint.*picker; + if (advanced_field.HasMax()) { + *value = advanced_field.Max(); return true; } - if (the_field.HasExact()) { - *value = the_field.Exact(); + if (advanced_field.HasExact()) { + *value = advanced_field.Exact(); return true; } } @@ -75,7 +74,6 @@ T* value) { if (constraints.IsNull()) return false; - const auto& the_field = constraints.Basic().*picker; if (the_field.HasMin()) { *value = the_field.Min(); @@ -86,13 +84,13 @@ return true; } for (const auto& advanced_constraint : constraints.Advanced()) { - const auto& the_field = advanced_constraint.*picker; - if (the_field.HasMin()) { - *value = the_field.Min(); + const auto& advanced_field = advanced_constraint.*picker; + if (advanced_field.HasMin()) { + *value = advanced_field.Min(); return true; } - if (the_field.HasExact()) { - *value = the_field.Exact(); + if (advanced_field.HasExact()) { + *value = advanced_field.Exact(); return true; } }
diff --git a/content/renderer/media/media_stream_video_source.cc b/content/renderer/media/media_stream_video_source.cc index 937124c..220b49c 100644 --- a/content/renderer/media/media_stream_video_source.cc +++ b/content/renderer/media/media_stream_video_source.cc
@@ -85,10 +85,12 @@ void MediaStreamVideoSource::RemoveTrack(MediaStreamVideoTrack* video_track, base::OnceClosure callback) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - std::vector<MediaStreamVideoTrack*>::iterator it = - std::find(tracks_.begin(), tracks_.end(), video_track); - DCHECK(it != tracks_.end()); - tracks_.erase(it); + { + std::vector<MediaStreamVideoTrack*>::iterator it = + std::find(tracks_.begin(), tracks_.end(), video_track); + DCHECK(it != tracks_.end()); + tracks_.erase(it); + } secure_tracker_.Remove(video_track); for (auto it = pending_tracks_.begin(); it != pending_tracks_.end(); ++it) {
diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc index 54f6388..90e0173 100644 --- a/content/renderer/media/rtc_peer_connection_handler.cc +++ b/content/renderer/media/rtc_peer_connection_handler.cc
@@ -293,6 +293,20 @@ NOTREACHED(); } + switch (blink_config.sdp_semantics) { + case blink::WebRTCSdpSemantics::kDefault: + webrtc_config->sdp_semantics = webrtc::SdpSemantics::kDefault; + break; + case blink::WebRTCSdpSemantics::kPlanB: + webrtc_config->sdp_semantics = webrtc::SdpSemantics::kPlanB; + break; + case blink::WebRTCSdpSemantics::kUnifiedPlan: + webrtc_config->sdp_semantics = webrtc::SdpSemantics::kUnifiedPlan; + break; + default: + NOTREACHED(); + } + webrtc_config->certificates.clear(); for (const std::unique_ptr<blink::WebRTCCertificate>& blink_certificate : blink_config.certificates) { @@ -2187,14 +2201,17 @@ DCHECK(thread_checker_.CalledOnValidThread()); TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnRemoveRemoteTrack"); - uintptr_t receiver_id = RTCRtpReceiver::getId(webrtc_receiver.get()); - auto it = rtp_receivers_.find(receiver_id); - DCHECK(it != rtp_receivers_.end()); std::vector<std::unique_ptr<WebRtcMediaStreamAdapterMap::AdapterRef>> - remote_stream_adapter_refs = it->second->StreamAdapterRefs(); - if (!is_closed_) - client_->DidRemoveRemoteTrack(it->second->ShallowCopy()); - rtp_receivers_.erase(it); + remote_stream_adapter_refs; + { + uintptr_t receiver_id = RTCRtpReceiver::getId(webrtc_receiver.get()); + auto it = rtp_receivers_.find(receiver_id); + DCHECK(it != rtp_receivers_.end()); + remote_stream_adapter_refs = it->second->StreamAdapterRefs(); + if (!is_closed_) + client_->DidRemoveRemoteTrack(it->second->ShallowCopy()); + rtp_receivers_.erase(it); + } for (const auto& remote_stream_adapter_ref : remote_stream_adapter_refs) { // Was this the last usage of the remote stream?
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc index 4ca26ec..c2bf6bb4 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host.cc +++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
@@ -230,28 +230,6 @@ is_always_opaque_ = is_always_opaque; scale_ = 1.0f; - // Gets the texture target for RGBA and BGRA textures if we can make - // image-backed textures for direct scanout (for use in overlays). - RenderThreadImpl* rti = RenderThreadImpl::current(); - if (rti && rti->IsGpuMemoryBufferCompositorResourcesEnabled()) { - const auto& list = rti->GetTextureTargetExceptionList(); - if (base::ContainsValue( - list, viz::BufferUsageAndFormat(gfx::BufferUsage::SCANOUT, - gfx::BufferFormat::BGRA_8888))) { - scanout_texture_target_bgra_ = gpu::GetPlatformSpecificTextureTarget(); - } else { - scanout_texture_target_bgra_ = GL_TEXTURE_2D; - } - - if (base::ContainsValue( - list, viz::BufferUsageAndFormat(gfx::BufferUsage::SCANOUT, - gfx::BufferFormat::RGBA_8888))) { - scanout_texture_target_rgba_ = gpu::GetPlatformSpecificTextureTarget(); - } else { - scanout_texture_target_rgba_ = GL_TEXTURE_2D; - } - } - return true; } @@ -672,16 +650,24 @@ const bool upload_bgra = bitmap_is_bgra && texture_can_be_bgra; const uint32_t format = upload_bgra ? GL_BGRA_EXT : GL_RGBA; + RenderThreadImpl* rti = RenderThreadImpl::current(); + bool overlays_supported = + rti->IsGpuMemoryBufferCompositorResourcesEnabled() && + main_thread_context_->ContextCapabilities().texture_storage_image; bool overlay_candidate = false; uint32_t texture_target = GL_TEXTURE_2D; uint32_t storage_format = 0; - if (main_thread_context_->ContextCapabilities().texture_storage_image) { - if (upload_bgra && scanout_texture_target_bgra_) { - texture_target = scanout_texture_target_bgra_; + if (overlays_supported) { + if (upload_bgra) { + texture_target = gpu::GetBufferTextureTarget( + gfx::BufferUsage::SCANOUT, gfx::BufferFormat::BGRA_8888, + main_thread_context_->ContextCapabilities()); storage_format = GL_BGRA8_EXT; overlay_candidate = true; - } else if (!upload_bgra && scanout_texture_target_rgba_) { - texture_target = scanout_texture_target_rgba_; + } else { + texture_target = gpu::GetBufferTextureTarget( + gfx::BufferUsage::SCANOUT, gfx::BufferFormat::RGBA_8888, + main_thread_context_->ContextCapabilities()); storage_format = GL_RGBA8_OES; overlay_candidate = true; }
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.h b/content/renderer/pepper/pepper_graphics_2d_host.h index 16a2395..069cd8d 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host.h +++ b/content/renderer/pepper/pepper_graphics_2d_host.h
@@ -244,8 +244,6 @@ // Texture ids move from |texture_copies_| to here once they are available for // reuse. std::vector<TextureInfo> recycled_texture_copies_; - uint32_t scanout_texture_target_rgba_ = 0; - uint32_t scanout_texture_target_bgra_ = 0; // This is a bitmap that was recently released by the compositor and may be // used to transfer bytes to the compositor again.
diff --git a/content/renderer/pepper/url_response_info_util.cc b/content/renderer/pepper/url_response_info_util.cc index ff61dae..2cbbf57 100644 --- a/content/renderer/pepper/url_response_info_util.cc +++ b/content/renderer/pepper/url_response_info_util.cc
@@ -31,10 +31,10 @@ namespace { -class HeaderFlattener : public WebHTTPHeaderVisitor { +class HeadersToString : public WebHTTPHeaderVisitor { public: - HeaderFlattener() {} - ~HeaderFlattener() override {} + HeadersToString() {} + ~HeadersToString() override {} const std::string& buffer() const { return buffer_; } @@ -88,9 +88,9 @@ response.HttpHeaderField(WebString::FromUTF8("Location")).Utf8(); } - HeaderFlattener flattener; - response.VisitHTTPHeaderFields(&flattener); - data.headers = flattener.buffer(); + HeadersToString headers_to_string; + response.VisitHTTPHeaderFields(&headers_to_string); + data.headers = headers_to_string.buffer(); WebString file_path = response.DownloadFilePath(); if (!file_path.IsEmpty()) {
diff --git a/content/renderer/quota_dispatcher.cc b/content/renderer/quota_dispatcher.cc index 46de0938..828f8b9 100644 --- a/content/renderer/quota_dispatcher.cc +++ b/content/renderer/quota_dispatcher.cc
@@ -13,14 +13,13 @@ #include "base/threading/thread_local.h" #include "content/public/common/service_names.mojom.h" #include "content/public/renderer/render_thread.h" +#include "mojo/public/cpp/bindings/callback_helpers.h" #include "services/service_manager/public/cpp/connector.h" #include "third_party/WebKit/common/quota/quota_types.mojom.h" -#include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" #include "url/origin.h" using blink::mojom::QuotaStatusCode; using blink::mojom::StorageType; -using blink::WebStorageQuotaCallbacks; namespace content { @@ -58,13 +57,6 @@ } QuotaDispatcher::~QuotaDispatcher() { - base::IDMap<std::unique_ptr<WebStorageQuotaCallbacks>>::iterator iter( - &pending_quota_callbacks_); - while (!iter.IsAtEnd()) { - iter.GetCurrentValue()->DidFail(blink::mojom::QuotaStatusCode::kErrorAbort); - iter.Advance(); - } - g_quota_dispatcher_tls.Pointer()->Set(nullptr); } @@ -86,13 +78,16 @@ void QuotaDispatcher::QueryStorageUsageAndQuota( const url::Origin& origin, StorageType type, - std::unique_ptr<WebStorageQuotaCallbacks> callback) { + blink::mojom::QuotaDispatcherHost::QueryStorageUsageAndQuotaCallback + callback) { DCHECK(callback); - int request_id = pending_quota_callbacks_.Add(std::move(callback)); + // Use WrapCallbackWithDefaultInvokeIfNotRun() to ensure the callback is run + // with a failure code if QuotaDispatcher is destroyed. quota_host_->QueryStorageUsageAndQuota( origin, type, - base::BindOnce(&QuotaDispatcher::DidQueryStorageUsageAndQuota, - base::Unretained(this), request_id)); + mojo::WrapCallbackWithDefaultInvokeIfNotRun( + std::move(callback), blink::mojom::QuotaStatusCode::kErrorAbort, 0, + 0)); } void QuotaDispatcher::RequestStorageQuota( @@ -100,57 +95,17 @@ const url::Origin& origin, StorageType type, int64_t requested_size, - std::unique_ptr<WebStorageQuotaCallbacks> callback) { + blink::mojom::QuotaDispatcherHost::RequestStorageQuotaCallback callback) { DCHECK(callback); DCHECK_EQ(CurrentWorkerId(), 0) << "Requests may show permission UI and are not allowed from workers."; - int request_id = pending_quota_callbacks_.Add(std::move(callback)); + // Use WrapCallbackWithDefaultInvokeIfNotRun() to ensure the callback is run + // with a failure code if QuotaDispatcher is destroyed. quota_host_->RequestStorageQuota( render_frame_id, origin, type, requested_size, - base::BindOnce(&QuotaDispatcher::DidGrantStorageQuota, - base::Unretained(this), request_id)); -} - -void QuotaDispatcher::DidGrantStorageQuota(int64_t request_id, - QuotaStatusCode status, - int64_t current_usage, - int64_t granted_quota) { - if (status != blink::mojom::QuotaStatusCode::kOk) { - DidFail(request_id, status); - return; - } - - WebStorageQuotaCallbacks* callback = - pending_quota_callbacks_.Lookup(request_id); - DCHECK(callback); - callback->DidGrantStorageQuota(current_usage, granted_quota); - pending_quota_callbacks_.Remove(request_id); -} - -void QuotaDispatcher::DidQueryStorageUsageAndQuota(int64_t request_id, - QuotaStatusCode status, - int64_t current_usage, - int64_t current_quota) { - if (status != blink::mojom::QuotaStatusCode::kOk) { - DidFail(request_id, status); - return; - } - - WebStorageQuotaCallbacks* callback = - pending_quota_callbacks_.Lookup(request_id); - DCHECK(callback); - callback->DidQueryStorageUsageAndQuota(current_usage, current_quota); - pending_quota_callbacks_.Remove(request_id); -} - -void QuotaDispatcher::DidFail( - int request_id, - QuotaStatusCode error) { - WebStorageQuotaCallbacks* callback = - pending_quota_callbacks_.Lookup(request_id); - DCHECK(callback); - callback->DidFail(error); - pending_quota_callbacks_.Remove(request_id); + mojo::WrapCallbackWithDefaultInvokeIfNotRun( + std::move(callback), blink::mojom::QuotaStatusCode::kErrorAbort, 0, + 0)); } } // namespace content
diff --git a/content/renderer/quota_dispatcher.h b/content/renderer/quota_dispatcher.h index c95b2fd..aba0da5 100644 --- a/content/renderer/quota_dispatcher.h +++ b/content/renderer/quota_dispatcher.h
@@ -16,10 +16,6 @@ #include "content/public/renderer/worker_thread.h" #include "third_party/WebKit/common/quota/quota_dispatcher_host.mojom.h" -namespace blink { -class WebStorageQuotaCallbacks; -} - namespace url { class Origin; } @@ -46,35 +42,18 @@ void QueryStorageUsageAndQuota( const url::Origin& origin, blink::mojom::StorageType type, - std::unique_ptr<blink::WebStorageQuotaCallbacks> callback); + blink::mojom::QuotaDispatcherHost::QueryStorageUsageAndQuotaCallback); void RequestStorageQuota( int render_frame_id, const url::Origin& origin, blink::mojom::StorageType type, int64_t requested_size, - std::unique_ptr<blink::WebStorageQuotaCallbacks> callback); + blink::mojom::QuotaDispatcherHost::RequestStorageQuotaCallback); private: - // Message handlers. - void DidQueryStorageUsageAndQuota(int64_t request_id, - blink::mojom::QuotaStatusCode status, - int64_t current_usage, - int64_t current_quota); - void DidGrantStorageQuota(int64_t request_id, - blink::mojom::QuotaStatusCode status, - int64_t current_usage, - int64_t granted_quota); - void DidFail(int request_id, blink::mojom::QuotaStatusCode error); - blink::mojom::QuotaDispatcherHostPtr quota_host_; scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; - // TODO(sashab, nverne): Once default callbacks are available for dropped mojo - // callbacks (crbug.com/775358), use them to call DidFail for them in the - // destructor and remove this. - base::IDMap<std::unique_ptr<blink::WebStorageQuotaCallbacks>> - pending_quota_callbacks_; - DISALLOW_COPY_AND_ASSIGN(QuotaDispatcher); };
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 5a56bc2a..29d906e8 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -181,7 +181,6 @@ #include "third_party/WebKit/public/platform/WebPoint.h" #include "third_party/WebKit/public/platform/WebRemoteScrollProperties.h" #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" -#include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURLError.h" @@ -285,7 +284,6 @@ using blink::WebSerializedScriptValue; using blink::WebServiceWorkerProvider; using blink::WebSettings; -using blink::WebStorageQuotaCallbacks; using blink::WebString; using blink::WebThreadSafeData; using blink::WebURL; @@ -311,6 +309,9 @@ const int kExtraCharsBeforeAndAfterSelection = 100; +const PreviewsState kDisabledPreviewsBits = + PREVIEWS_OFF | PREVIEWS_NO_TRANSFORM; + typedef std::map<int, RenderFrameImpl*> RoutingIDFrameMap; static base::LazyInstance<RoutingIDFrameMap>::DestructorAtExit g_routing_id_frame_map = LAZY_INSTANCE_INITIALIZER; @@ -2523,12 +2524,11 @@ } void RenderFrameImpl::OnTextSurroundingSelectionRequest(uint32_t max_length) { - blink::WebSurroundingText surroundingText; - surroundingText.InitializeFromCurrentSelection(frame_, max_length); + blink::WebSurroundingText surrounding_text(frame_, max_length); - if (surroundingText.IsNull()) { - // |surroundingText| might not be correctly initialized, for example if - // |frame_->selectionRange().isNull()|, in other words, if there was no + if (surrounding_text.IsEmpty()) { + // |surrounding_text| might not be correctly initialized, for example if + // |frame_->SelectionRange().IsNull()|, in other words, if there was no // selection. Send(new FrameHostMsg_TextSurroundingSelectionResponse( routing_id_, base::string16(), 0, 0)); @@ -2536,9 +2536,9 @@ } Send(new FrameHostMsg_TextSurroundingSelectionResponse( - routing_id_, surroundingText.TextContent().Utf16(), - surroundingText.StartOffsetInTextContent(), - surroundingText.EndOffsetInTextContent())); + routing_id_, surrounding_text.TextContent().Utf16(), + surrounding_text.StartOffsetInTextContent(), + surrounding_text.EndOffsetInTextContent())); } bool RenderFrameImpl::RunJavaScriptDialog(JavaScriptDialogType type, @@ -4221,13 +4221,6 @@ // before updating the current history item. SendUpdateState(); - // Update the current history item for this frame. - current_history_item_ = item; - // Note: don't reference |item| after this point, as its value may not match - // |current_history_item_|. - current_history_item_.SetTarget( - blink::WebString::FromUTF8(unique_name_helper_.value())); - InternalDocumentStateData* internal_data = InternalDocumentStateData::FromDocumentState(document_state); @@ -4236,30 +4229,6 @@ internal_data->set_must_reset_scroll_and_scale_state(false); } - const RequestNavigationParams& request_params = - navigation_state->request_params(); - bool is_new_navigation = commit_type == blink::kWebStandardCommit; - if (is_new_navigation) { - DCHECK(!navigation_state->common_params().should_replace_current_entry || - render_view_->history_list_length_ > 0); - if (!navigation_state->common_params().should_replace_current_entry) { - // Advance our offset in session history, applying the length limit. - // There is now no forward history. - render_view_->history_list_offset_++; - if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) - render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; - render_view_->history_list_length_ = - render_view_->history_list_offset_ + 1; - } - } else { - if (request_params.nav_entry_id != 0 && - !request_params.intended_as_new_entry) { - // This is a successful session history navigation! - render_view_->history_list_offset_ = - request_params.pending_history_list_offset; - } - } - service_manager::mojom::InterfaceProviderRequest remote_interface_provider_request; if (!navigation_state->WasWithinSameDocument() && @@ -4297,8 +4266,7 @@ } } - if (commit_type == blink::WebHistoryCommitType::kWebBackForwardCommit) - render_view_->DidCommitProvisionalHistoryLoad(); + bool is_new_navigation = UpdateNavigationHistory(item, commit_type); for (auto& observer : render_view_->observers_) observer.DidCommitProvisionalLoad(frame_, is_new_navigation); @@ -4605,29 +4573,15 @@ effective_connection_type_ = type; } -bool RenderFrameImpl::ShouldUseClientLoFiForRequest( - const WebURLRequest& request) { - if (request.GetPreviewsState() != WebURLRequest::kPreviewsUnspecified) - return request.GetPreviewsState() & WebURLRequest::kClientLoFiOn; - - if (!IsClientLoFiActiveForFrame()) - return false; - - // Even if this frame is using Server Lo-Fi, https:// images won't be handled - // by Server Lo-Fi since their requests won't be sent to the Data Saver proxy, - // so use Client Lo-Fi instead. - if (previews_state_ & SERVER_LOFI_ON) - return request.Url().ProtocolIs("https"); - return true; -} - -bool RenderFrameImpl::IsClientLoFiActiveForFrame() { - if (!(previews_state_ & CLIENT_LOFI_ON)) - return false; - if (previews_state_ & (PREVIEWS_OFF | PREVIEWS_NO_TRANSFORM)) { - return false; +blink::WebURLRequest::PreviewsState RenderFrameImpl::GetPreviewsStateForFrame() + const { + PreviewsState disabled_state = previews_state_ & kDisabledPreviewsBits; + if (disabled_state) { + // Sanity check disabled vs. enabled bits here before passing on. + DCHECK(!(previews_state_ & ~kDisabledPreviewsBits)) << previews_state_; + return disabled_state; } - return true; + return static_cast<WebURLRequest::PreviewsState>(previews_state_); } void RenderFrameImpl::DidBlockFramebust(const WebURL& url) { @@ -4813,7 +4767,8 @@ std::vector<std::unique_ptr<URLLoaderThrottle>> throttles; GURL new_url; if (GetContentClient()->renderer()->WillSendRequest( - frame_, transition_type, request.Url(), &throttles, &new_url)) { + frame_, transition_type, request.Url(), + WebURLRequestToResourceType(request), &throttles, &new_url)) { request.SetURL(WebURL(new_url)); } @@ -4917,8 +4872,8 @@ static_cast<WebURLRequest::PreviewsState>(previews_state_); // The decision of whether or not to enable Client Lo-Fi is made earlier - // in the request lifetime, using ShouldUseClientLoFiForRequest(), so - // don't add the Client Lo-Fi bit to the request here. + // in the request lifetime, in LocalFrame::MaybeAllowImagePlaceholder(), + // so don't add the Client Lo-Fi bit to the request here. request_previews_state &= ~(WebURLRequest::kClientLoFiOn); if (request_previews_state == WebURLRequest::kPreviewsUnspecified) request_previews_state = WebURLRequest::kPreviewsOff; @@ -5009,15 +4964,12 @@ GURL(origin.ToString().Utf8())); } -void RenderFrameImpl::DidDisplayContentWithCertificateErrors( - const blink::WebURL& url) { - Send(new FrameHostMsg_DidDisplayContentWithCertificateErrors( - routing_id_, url)); +void RenderFrameImpl::DidDisplayContentWithCertificateErrors() { + Send(new FrameHostMsg_DidDisplayContentWithCertificateErrors(routing_id_)); } -void RenderFrameImpl::DidRunContentWithCertificateErrors( - const blink::WebURL& url) { - Send(new FrameHostMsg_DidRunContentWithCertificateErrors(routing_id_, url)); +void RenderFrameImpl::DidRunContentWithCertificateErrors() { + Send(new FrameHostMsg_DidRunContentWithCertificateErrors(routing_id_)); } bool RenderFrameImpl::OverrideLegacySymantecCertConsoleMessage( @@ -5112,16 +5064,15 @@ void RenderFrameImpl::RequestStorageQuota( blink::mojom::StorageType type, unsigned long long requested_size, - blink::WebStorageQuotaCallbacks callbacks) { + RequestStorageQuotaCallback callback) { WebSecurityOrigin origin = frame_->GetDocument().GetSecurityOrigin(); if (origin.IsUnique()) { // Unique origins cannot store persistent state. - callbacks.DidFail(blink::mojom::QuotaStatusCode::kErrorAbort); + std::move(callback).Run(blink::mojom::QuotaStatusCode::kErrorAbort, 0, 0); return; } RenderThreadImpl::current()->quota_dispatcher()->RequestStorageQuota( - routing_id_, origin, type, requested_size, - std::make_unique<blink::WebStorageQuotaCallbacks>(callbacks)); + routing_id_, origin, type, requested_size, std::move(callback)); } blink::WebPresentationClient* RenderFrameImpl::PresentationClient() { @@ -5491,42 +5442,11 @@ frame, document_loader->GetRequest()); } + UpdateZoomLevel(); + if (!frame->Parent()) { // Top-level navigation. - // Reset the zoom limits in case a plugin had changed them previously. This - // will also call us back which will cause us to send a message to - // update WebContentsImpl. - render_view_->webview()->ZoomLimitsChanged( - ZoomFactorToZoomLevel(kMinimumZoomFactor), - ZoomFactorToZoomLevel(kMaximumZoomFactor)); - - // Set zoom level, but don't do it for full-page plugin since they don't use - // the same zoom settings. - HostZoomLevels::iterator host_zoom = - host_zoom_levels_.find(GURL(request.Url())); - if (render_view_->webview()->MainFrame()->IsWebLocalFrame() && - render_view_->webview() - ->MainFrame() - ->ToWebLocalFrame() - ->GetDocument() - .IsPluginDocument()) { - // Reset the zoom levels for plugins. - render_view_->SetZoomLevel(0); - } else { - // If the zoom level is not found, then do nothing. In-page navigation - // relies on not changing the zoom level in this case. - if (host_zoom != host_zoom_levels_.end()) - render_view_->SetZoomLevel(host_zoom->second); - } - - if (host_zoom != host_zoom_levels_.end()) { - // This zoom level was merely recorded transiently for this load. We can - // erase it now. If at some point we reload this page, the browser will - // send us a new, up-to-date zoom level. - host_zoom_levels_.erase(host_zoom); - } - // Update contents MIME type for main frame. params->contents_mime_type = document_loader->GetResponse().MimeType().Utf8(); @@ -5572,8 +5492,6 @@ DCHECK(!navigation_state->request_params().should_clear_history_list); params->history_list_was_cleared = false; params->report_type = FrameMsg_UILoadMetricsReportType::NO_REPORT; - // Subframes should match the zoom level of the main frame. - render_view_->SetZoomLevel(render_view_->page_zoom_level()); } // Standard URLs must match the reported origin, when it is not unique. @@ -5603,6 +5521,87 @@ navigation_state->set_transition_type(ui::PAGE_TRANSITION_LINK); } +void RenderFrameImpl::UpdateZoomLevel() { + if (!frame_->Parent()) { + // Reset the zoom limits in case a plugin had changed them previously. This + // will also call us back which will cause us to send a message to + // update WebContentsImpl. + render_view_->webview()->ZoomLimitsChanged( + ZoomFactorToZoomLevel(kMinimumZoomFactor), + ZoomFactorToZoomLevel(kMaximumZoomFactor)); + + // Set zoom level, but don't do it for full-page plugin since they don't use + // the same zoom settings. + HostZoomLevels::iterator host_zoom = + host_zoom_levels_.find(GetLoadingUrl()); + if (render_view_->webview()->MainFrame()->IsWebLocalFrame() && + render_view_->webview() + ->MainFrame() + ->ToWebLocalFrame() + ->GetDocument() + .IsPluginDocument()) { + // Reset the zoom levels for plugins. + render_view_->SetZoomLevel(0); + } else { + // If the zoom level is not found, then do nothing. In-page navigation + // relies on not changing the zoom level in this case. + if (host_zoom != host_zoom_levels_.end()) + render_view_->SetZoomLevel(host_zoom->second); + } + + if (host_zoom != host_zoom_levels_.end()) { + // This zoom level was merely recorded transiently for this load. We can + // erase it now. If at some point we reload this page, the browser will + // send us a new, up-to-date zoom level. + host_zoom_levels_.erase(host_zoom); + } + } else { + // Subframes should match the zoom level of the main frame. + render_view_->SetZoomLevel(render_view_->page_zoom_level()); + } +} + +bool RenderFrameImpl::UpdateNavigationHistory( + const blink::WebHistoryItem& item, + blink::WebHistoryCommitType commit_type) { + DocumentState* document_state = + DocumentState::FromDocumentLoader(frame_->GetDocumentLoader()); + NavigationStateImpl* navigation_state = + static_cast<NavigationStateImpl*>(document_state->navigation_state()); + const RequestNavigationParams& request_params = + navigation_state->request_params(); + + // Update the current history item for this frame. + current_history_item_ = item; + // Note: don't reference |item| after this point, as its value may not match + // |current_history_item_|. + current_history_item_.SetTarget( + blink::WebString::FromUTF8(unique_name_helper_.value())); + bool is_new_navigation = commit_type == blink::kWebStandardCommit; + if (is_new_navigation) { + DCHECK(!navigation_state->common_params().should_replace_current_entry || + render_view_->history_list_length_ > 0); + if (!navigation_state->common_params().should_replace_current_entry) { + // Advance our offset in session history, applying the length limit. + // There is now no forward history. + render_view_->history_list_offset_++; + if (render_view_->history_list_offset_ >= kMaxSessionHistoryEntries) + render_view_->history_list_offset_ = kMaxSessionHistoryEntries - 1; + render_view_->history_list_length_ = + render_view_->history_list_offset_ + 1; + } + } else if (request_params.nav_entry_id != 0 && + !request_params.intended_as_new_entry) { + render_view_->history_list_offset_ = + navigation_state->request_params().pending_history_list_offset; + } + + if (commit_type == blink::WebHistoryCommitType::kWebBackForwardCommit) + render_view_->DidCommitProvisionalHistoryLoad(); + + return is_new_navigation; +} + bool RenderFrameImpl::SwapIn() { CHECK_NE(proxy_routing_id_, MSG_ROUTING_NONE); CHECK(!in_frame_tree_);
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 912ab4d8..5030ef9 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -641,8 +641,7 @@ blink::WebEffectiveConnectionType GetEffectiveConnectionType() override; void SetEffectiveConnectionTypeForTesting( blink::WebEffectiveConnectionType) override; - bool IsClientLoFiActiveForFrame() override; - bool ShouldUseClientLoFiForRequest(const blink::WebURLRequest&) override; + blink::WebURLRequest::PreviewsState GetPreviewsStateForFrame() const override; void DidBlockFramebust(const blink::WebURL& url) override; blink::WebString GetInstrumentationToken() override; void AbortClientNavigation() override; @@ -668,9 +667,8 @@ void DidContainInsecureFormAction() override; void DidRunInsecureContent(const blink::WebSecurityOrigin& origin, const blink::WebURL& target) override; - void DidDisplayContentWithCertificateErrors( - const blink::WebURL& url) override; - void DidRunContentWithCertificateErrors(const blink::WebURL& url) override; + void DidDisplayContentWithCertificateErrors() override; + void DidRunContentWithCertificateErrors() override; bool OverrideLegacySymantecCertConsoleMessage( const blink::WebURL& url, base::Time cert_validity_start, @@ -694,7 +692,7 @@ const blink::WebRect& sel) override; void RequestStorageQuota(blink::mojom::StorageType type, unsigned long long requested_size, - blink::WebStorageQuotaCallbacks callbacks) override; + RequestStorageQuotaCallback) override; blink::WebPushClient* PushClient() override; blink::WebPresentationClient* PresentationClient() override; blink::WebRelatedAppsFetcher* GetRelatedAppsFetcher() override; @@ -1265,6 +1263,16 @@ return custom_url_loader_factory_.get(); } + // Updates the Zoom level of the render view to match current content. + void UpdateZoomLevel(); + + // Updates the navigation history depending on the passed parameters. + // This could result either in the creation of a new entry or a modification + // of the current entry or nothing. If a new entry was created, + // returns true, false otherwise. + bool UpdateNavigationHistory(const blink::WebHistoryItem& item, + blink::WebHistoryCommitType commit_type); + // Stores the WebLocalFrame we are associated with. This is null from the // constructor until BindToFrame() is called, and it is null after // FrameDetached() is called until destruction (which is asynchronous in the
diff --git a/content/renderer/render_frame_impl_browsertest.cc b/content/renderer/render_frame_impl_browsertest.cc index 316a83d..b346a29 100644 --- a/content/renderer/render_frame_impl_browsertest.cc +++ b/content/renderer/render_frame_impl_browsertest.cc
@@ -13,6 +13,7 @@ #include "base/run_loop.h" #include "base/strings/utf_string_conversions.h" #include "base/test/bind_test_util.h" +#include "base/test/gtest_util.h" #include "build/build_config.h" #include "content/common/frame_messages.h" #include "content/common/frame_owner_properties.h" @@ -540,95 +541,20 @@ } } -TEST_F(RenderFrameImplTest, IsClientLoFiActiveForFrame) { - const struct { - PreviewsState frame_previews_state; - bool expected_is_client_lo_fi_active_for_frame; - } tests[] = { - // With no previews enabled for the frame, no previews should be - // activated. - {PREVIEWS_UNSPECIFIED, false}, +TEST_F(RenderFrameImplTest, GetPreviewsStateForFrame) { + SetPreviewsState(frame(), CLIENT_LOFI_ON | SERVER_LOFI_ON); + EXPECT_EQ(WebURLRequest::kClientLoFiOn | WebURLRequest::kServerLoFiOn, + frame()->GetPreviewsStateForFrame()); - // Server Lo-Fi should not make Client Lo-Fi active. - {SERVER_LOFI_ON, false}, + SetPreviewsState(frame(), PREVIEWS_OFF); + EXPECT_EQ(WebURLRequest::kPreviewsOff, frame()->GetPreviewsStateForFrame()); - // PREVIEWS_NO_TRANSFORM and PREVIEWS_OFF should - // take precedence over Client Lo-Fi. - {CLIENT_LOFI_ON | PREVIEWS_NO_TRANSFORM, false}, - {CLIENT_LOFI_ON | PREVIEWS_OFF, false}, + SetPreviewsState(frame(), PREVIEWS_OFF | PREVIEWS_NO_TRANSFORM); + EXPECT_EQ(WebURLRequest::kPreviewsOff | WebURLRequest::kPreviewsNoTransform, + frame()->GetPreviewsStateForFrame()); - // Otherwise, if Client Lo-Fi is enabled on its own or with - // SERVER_LOFI_ON, then it is active for the frame. - {CLIENT_LOFI_ON, true}, - {CLIENT_LOFI_ON | SERVER_LOFI_ON, true}, - }; - - for (const auto& test : tests) { - SetPreviewsState(frame(), test.frame_previews_state); - - EXPECT_EQ(test.expected_is_client_lo_fi_active_for_frame, - frame()->IsClientLoFiActiveForFrame()) - << (&test - tests); - } -} - -TEST_F(RenderFrameImplTest, ShouldUseClientLoFiForRequest) { - const struct { - PreviewsState frame_previews_state; - bool is_https; - WebURLRequest::PreviewsState initial_request_previews_state; - bool expected_should_use_client_lo_fi_for_request; - } tests[] = { - // With no previews enabled for the frame, no previews should be - // activated. - {PREVIEWS_UNSPECIFIED, false, WebURLRequest::kPreviewsUnspecified, false}, - - // If the request already has a previews state set, then Client Lo-Fi - // should only be used if the request already has that bit set. - {CLIENT_LOFI_ON, false, WebURLRequest::kServerLoFiOn, false}, - {PREVIEWS_UNSPECIFIED, false, WebURLRequest::kClientLoFiOn, true}, - {CLIENT_LOFI_ON, false, WebURLRequest::kClientLoFiOn, true}, - {CLIENT_LOFI_ON | SERVER_LITE_PAGE_ON, true, - WebURLRequest::kPreviewsUnspecified, true}, - {CLIENT_LOFI_ON | SERVER_LITE_PAGE_ON, false, - WebURLRequest::kPreviewsUnspecified, true}, - - // If Client Lo-Fi isn't enabled for the frame, then it shouldn't be used - // for any requests. - {SERVER_LOFI_ON, true, WebURLRequest::kPreviewsUnspecified, false}, - - // PREVIEWS_NO_TRANSFORM and PREVIEWS_OFF should take precedence - // over Client Lo-Fi. - {CLIENT_LOFI_ON | PREVIEWS_NO_TRANSFORM, false, - WebURLRequest::kPreviewsUnspecified, false}, - {CLIENT_LOFI_ON | PREVIEWS_OFF, false, - WebURLRequest::kPreviewsUnspecified, false}, - - // If both Server Lo-Fi and Client Lo-Fi are enabled for the frame, then - // only https:// requests should use Client Lo-Fi. - {CLIENT_LOFI_ON | SERVER_LOFI_ON, false, - WebURLRequest::kPreviewsUnspecified, false}, - {CLIENT_LOFI_ON | SERVER_LOFI_ON, true, - WebURLRequest::kPreviewsUnspecified, true}, - - // Otherwise, if Client Lo-Fi is enabled on its own, then requests should - // use Client Lo-Fi. - {CLIENT_LOFI_ON, false, WebURLRequest::kPreviewsUnspecified, true}, - {CLIENT_LOFI_ON, true, WebURLRequest::kPreviewsUnspecified, true}, - }; - - for (const auto& test : tests) { - SetPreviewsState(frame(), test.frame_previews_state); - - WebURLRequest request; - request.SetURL( - GURL(test.is_https ? "https://example.com" : "http://example.com")); - request.SetPreviewsState(test.initial_request_previews_state); - - EXPECT_EQ(test.expected_should_use_client_lo_fi_for_request, - frame()->ShouldUseClientLoFiForRequest(request)) - << (&test - tests); - } + SetPreviewsState(frame(), CLIENT_LOFI_ON | PREVIEWS_OFF); + EXPECT_DCHECK_DEATH(frame()->GetPreviewsStateForFrame()); } // RenderFrameRemoteInterfacesTest ------------------------------------
diff --git a/content/renderer/render_frame_proxy.h b/content/renderer/render_frame_proxy.h index f811dfcd..2bd08ef 100644 --- a/content/renderer/render_frame_proxy.h +++ b/content/renderer/render_frame_proxy.h
@@ -162,6 +162,8 @@ return pending_resize_params_.sequence_number; } + const viz::FrameSinkId& frame_sink_id() const { return frame_sink_id_; } + // blink::WebRemoteFrameClient implementation: void FrameDetached(DetachType type) override; void ForwardPostMessage(blink::WebLocalFrame* sourceFrame,
diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc index 33cc50c..3843e3d 100644 --- a/content/renderer/render_process_impl.cc +++ b/content/renderer/render_process_impl.cc
@@ -17,6 +17,7 @@ #include <algorithm> #include <utility> +#include "base/base_switches.h" #include "base/bind.h" #include "base/command_line.h" #include "base/compiler_specific.h" @@ -34,6 +35,7 @@ #include "content/public/common/content_switches.h" #include "content/public/renderer/content_renderer_client.h" #include "content/renderer/loader/site_isolation_stats_gatherer.h" +#include "services/service_manager/embedder/switches.h" #include "third_party/WebKit/public/web/WebFrame.h" #include "v8/include/v8.h" @@ -170,7 +172,19 @@ "--no-wasm-trap-handler"); #if defined(OS_LINUX) && defined(ARCH_CPU_X86_64) && !defined(OS_ANDROID) if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) { - base::debug::SetStackDumpFirstChanceCallback(v8::V8::TryHandleSignal); + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + if (!command_line->HasSwitch( + service_manager::switches::kDisableInProcessStackTraces)) { + base::debug::SetStackDumpFirstChanceCallback(v8::V8::TryHandleSignal); + } else if (!command_line->HasSwitch(switches::kEnableCrashReporter) && + !command_line->HasSwitch( + switches::kEnableCrashReporterForTesting)) { + // If we are using WebAssembly trap handling but both Breakpad and + // in-process stack traces are disabled then there will be no signal + // handler. In this case, we fall back on V8's default handler + // (https://crbug.com/798150). + v8::V8::RegisterDefaultSignalHandler(); + } } #endif
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index fef03d7..b1c79cd3 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc
@@ -58,7 +58,6 @@ #include "components/viz/common/features.h" #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/gpu/vulkan_in_process_context_provider.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "content/child/memory/child_memory_coordinator_impl.h" #include "content/child/runtime_features.h" #include "content/child/thread_safe_sender.h" @@ -848,11 +847,6 @@ is_elastic_overscroll_enabled_ = false; #endif - std::string image_texture_target_string = - command_line.GetSwitchValueASCII(switches::kContentImageTextureTarget); - texture_target_exception_list_ = - viz::StringToBufferUsageAndFormatList(image_texture_target_string); - if (command_line.HasSwitch(switches::kDisableLCDText)) { is_lcd_text_enabled_ = false; } else if (command_line.HasSwitch(switches::kEnableLCDText)) { @@ -1499,8 +1493,8 @@ gpu_factories_.push_back(GpuVideoAcceleratorFactoriesImpl::Create( std::move(gpu_channel_host), base::ThreadTaskRunnerHandle::Get(), media_task_runner, std::move(media_context_provider), - enable_gpu_memory_buffer_video_frames, texture_target_exception_list_, - enable_video_accelerator, vea_provider.PassInterface())); + enable_gpu_memory_buffer_video_frames, enable_video_accelerator, + vea_provider.PassInterface())); return gpu_factories_.back().get(); } @@ -1635,11 +1629,6 @@ return is_elastic_overscroll_enabled_; } -const viz::BufferUsageAndFormatList& -RenderThreadImpl::GetTextureTargetExceptionList() { - return texture_target_exception_list_; -} - scoped_refptr<base::SingleThreadTaskRunner> RenderThreadImpl::GetCompositorMainThreadTaskRunner() { return main_thread_compositor_task_runner_;
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index fb53ccc..fd3764a0 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h
@@ -255,7 +255,6 @@ bool IsPartialRasterEnabled() override; bool IsGpuMemoryBufferCompositorResourcesEnabled() override; bool IsElasticOverscrollEnabled() override; - const viz::BufferUsageAndFormatList& GetTextureTargetExceptionList() override; scoped_refptr<base::SingleThreadTaskRunner> GetCompositorMainThreadTaskRunner() override; scoped_refptr<base::SingleThreadTaskRunner> @@ -776,7 +775,6 @@ bool is_gpu_memory_buffer_compositor_resources_enabled_; bool is_partial_raster_enabled_; bool is_elastic_overscroll_enabled_; - viz::BufferUsageAndFormatList texture_target_exception_list_; bool is_threaded_animation_enabled_; bool is_scroll_animator_enabled_;
diff --git a/content/renderer/render_thread_impl_browsertest.cc b/content/renderer/render_thread_impl_browsertest.cc index 1cb95d5..ce4a841 100644 --- a/content/renderer/render_thread_impl_browsertest.cc +++ b/content/renderer/render_thread_impl_browsertest.cc
@@ -21,7 +21,6 @@ #include "base/threading/sequenced_task_runner_handle.h" #include "base/threading/sequenced_worker_pool.h" #include "base/threading/thread_task_runner_handle.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "content/app/mojo/mojo_init.h" #include "content/common/in_process_child_thread_params.h" #include "content/common/service_manager/child_connection.h" @@ -215,9 +214,6 @@ cmd->AppendSwitchASCII(switches::kLang, "en-US"); cmd->AppendSwitchASCII(switches::kNumRasterThreads, "1"); - cmd->AppendSwitchASCII( - switches::kContentImageTextureTarget, - viz::BufferUsageAndFormatListToString(viz::BufferUsageAndFormatList())); std::unique_ptr<blink::scheduler::RendererScheduler> renderer_scheduler = blink::scheduler::RendererScheduler::Create();
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index a3b1b02..c1409183 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc
@@ -40,7 +40,6 @@ #include "build/build_config.h" #include "cc/base/switches.h" #include "cc/paint/skia_paint_canvas.h" -#include "components/viz/client/client_shared_bitmap_manager.h" #include "content/common/content_constants_internal.h" #include "content/common/content_switches_internal.h" #include "content/common/dom_storage/dom_storage_types.h" @@ -121,7 +120,6 @@ #include "third_party/WebKit/public/platform/WebRect.h" #include "third_party/WebKit/public/platform/WebRuntimeFeatures.h" #include "third_party/WebKit/public/platform/WebSize.h" -#include "third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURLError.h" @@ -180,6 +178,8 @@ #include <cpu-features.h> #include "base/android/build_info.h" +#include "base/memory/shared_memory.h" +#include "content/child/child_thread_impl.h" #include "content/renderer/android/disambiguation_popup_helper.h" #include "ui/gfx/geometry/rect_f.h" @@ -235,7 +235,6 @@ using blink::WebSecurityPolicy; using blink::WebSettings; using blink::WebSize; -using blink::WebStorageQuotaCallbacks; using blink::WebString; using blink::WebTappedInfo; using blink::WebTextDirection; @@ -650,8 +649,6 @@ RenderViewImpl::~RenderViewImpl() { DCHECK(!frame_widget_); - disambiguation_bitmaps_.clear(); - #if defined(OS_ANDROID) // The date/time picker client is both a std::unique_ptr member of this class // and a RenderViewObserver. Reset it to prevent double deletion. @@ -1129,8 +1126,6 @@ IPC_MESSAGE_HANDLER(ViewMsg_MediaPlayerActionAt, OnMediaPlayerActionAt) IPC_MESSAGE_HANDLER(ViewMsg_PluginActionAt, OnPluginActionAt) IPC_MESSAGE_HANDLER(ViewMsg_SetActive, OnSetActive) - IPC_MESSAGE_HANDLER(ViewMsg_ReleaseDisambiguationPopupBitmap, - OnReleaseDisambiguationPopupBitmap) IPC_MESSAGE_HANDLER(ViewMsg_ResolveTapDisambiguation, OnResolveTapDisambiguation) IPC_MESSAGE_HANDLER(ViewMsg_ForceRedraw, OnForceRedraw) @@ -2311,16 +2306,25 @@ case TAP_MULTIPLE_TARGETS_STRATEGY_POPUP: { gfx::Size canvas_size = gfx::ScaleToCeiledSize(zoom_rect.size(), new_total_scale); - viz::SharedBitmapManager* manager = - RenderThreadImpl::current()->shared_bitmap_manager(); - std::unique_ptr<viz::SharedBitmap> shared_bitmap = - manager->AllocateSharedBitmap(canvas_size); - CHECK(shared_bitmap); + + SkImageInfo info = + SkImageInfo::MakeN32Premul(canvas_size.width(), canvas_size.height()); + size_t shm_size = info.computeMinByteSize(); + + if (shm_size == 0) { + DLOG(ERROR) << "Invalid size for SharedMemory"; + return false; + } + + auto shm = ChildThreadImpl::AllocateSharedMemory(shm_size); + if (!shm || !shm->Map(shm_size)) { + DLOG(ERROR) << "SharedMemory allocate/map failed"; + return false; + } + { SkBitmap bitmap; - SkImageInfo info = SkImageInfo::MakeN32Premul(canvas_size.width(), - canvas_size.height()); - bitmap.installPixels(info, shared_bitmap->pixels(), info.minRowBytes()); + bitmap.installPixels(info, shm->memory(), info.minRowBytes()); cc::SkiaPaintCanvas canvas(bitmap); // TODO(trchen): Cleanup the device scale factor mess. @@ -2343,11 +2347,12 @@ gfx::Rect physical_window_zoom_rect = gfx::ToEnclosingRect( ClientRectToPhysicalWindowRect(gfx::RectF(zoom_rect_in_screen))); + // A SharedMemoryHandle is sent to the browser process, which is + // responsible for freeing the shared memory when no longer needed. Send(new ViewHostMsg_ShowDisambiguationPopup( GetRoutingID(), physical_window_zoom_rect, canvas_size, - shared_bitmap->id())); - viz::SharedBitmapId id = shared_bitmap->id(); - disambiguation_bitmaps_[id] = std::move(shared_bitmap); + shm->TakeHandle())); + handled = true; break; } @@ -2443,12 +2448,6 @@ OnDisableAutoResize(new_size); } -void RenderViewImpl::OnReleaseDisambiguationPopupBitmap( - const viz::SharedBitmapId& id) { - size_t erased_count = disambiguation_bitmaps_.erase(id); - DCHECK_EQ(1U, erased_count); -} - void RenderViewImpl::OnResolveTapDisambiguation(double timestamp_seconds, gfx::Point tap_viewport_offset, bool is_long_press) {
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index d5e9ef9..8304f2fb7 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h
@@ -23,7 +23,6 @@ #include "base/timer/timer.h" #include "build/build_config.h" #include "cc/input/browser_controls_state.h" -#include "components/viz/common/quads/shared_bitmap.h" #include "content/common/content_export.h" #include "content/common/frame_message_enums.h" #include "content/common/navigation_gesture.h" @@ -521,7 +520,6 @@ void OnPluginActionAt(const gfx::Point& location, const blink::WebPluginAction& action); void OnMoveOrResizeStarted(); - void OnReleaseDisambiguationPopupBitmap(const viz::SharedBitmapId& id); void OnResolveTapDisambiguation(double timestamp_seconds, gfx::Point tap_viewport_offset, bool is_long_press); @@ -786,9 +784,6 @@ // constructors call the AddObservers method of RenderViewImpl. std::unique_ptr<StatsCollectionObserver> stats_collection_observer_; - std::map<viz::SharedBitmapId, std::unique_ptr<viz::SharedBitmap>> - disambiguation_bitmaps_; - std::unique_ptr<IdleUserDetector> idle_user_detector_; blink::WebScopedVirtualTimePauser history_navigation_virtual_time_pauser_;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index 6f9369b..a79406f 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc
@@ -902,8 +902,8 @@ latency_info, std::move(callback)); } -int RenderWidget::GetWidgetRoutingIdAtPoint(const gfx::Point& point) { - return input_handler_->GetWidgetRoutingIdAtPoint(point); +viz::FrameSinkId RenderWidget::GetFrameSinkIdAtPoint(const gfx::Point& point) { + return input_handler_->GetFrameSinkIdAtPoint(point); } void RenderWidget::HandleInputEvent(
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index 65073b5..d554f61 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h
@@ -418,7 +418,7 @@ // Requests a BeginMainFrame callback from the compositor. void SetNeedsMainFrame() override; - int GetWidgetRoutingIdAtPoint(const gfx::Point& point); + viz::FrameSinkId GetFrameSinkIdAtPoint(const gfx::Point& point); void HandleInputEvent(const blink::WebCoalescedInputEvent& input_event, const ui::LatencyInfo& latency_info,
diff --git a/content/renderer/render_widget_browsertest.cc b/content/renderer/render_widget_browsertest.cc index 44f4dcf9..15599b4 100644 --- a/content/renderer/render_widget_browsertest.cc +++ b/content/renderer/render_widget_browsertest.cc
@@ -6,6 +6,7 @@ #include "content/common/resize_params.h" #include "content/public/renderer/render_frame_visitor.h" #include "content/public/test/render_view_test.h" +#include "content/renderer/render_frame_proxy.h" #include "content/renderer/render_view_impl.h" #include "content/renderer/render_widget.h" #include "third_party/WebKit/public/web/WebFrameWidget.h" @@ -134,10 +135,20 @@ "</body>'></iframe><div></body>"); blink::WebFrame* main_web_frame = static_cast<RenderViewImpl*>(view_)->GetMainRenderFrame()->GetWebFrame(); - EXPECT_EQ(RenderFrame::GetRoutingIdForWebFrame(main_web_frame), - widget()->GetWidgetRoutingIdAtPoint(gfx::Point(10, 10))); - EXPECT_EQ(RenderFrame::GetRoutingIdForWebFrame(main_web_frame->FirstChild()), - widget()->GetWidgetRoutingIdAtPoint(gfx::Point(150, 150))); + viz::FrameSinkId main_frame_sink_id = + widget()->GetFrameSinkIdAtPoint(gfx::Point(10, 10)); + EXPECT_EQ(static_cast<uint32_t>( + RenderFrame::GetRoutingIdForWebFrame(main_web_frame)), + main_frame_sink_id.sink_id()); + EXPECT_EQ(static_cast<uint32_t>(RenderThreadImpl::Get()->GetClientId()), + main_frame_sink_id.client_id()); + + viz::FrameSinkId frame_sink_id = + widget()->GetFrameSinkIdAtPoint(gfx::Point(150, 150)); + EXPECT_EQ(static_cast<uint32_t>(RenderFrame::GetRoutingIdForWebFrame( + main_web_frame->FirstChild())), + frame_sink_id.sink_id()); + EXPECT_EQ(main_frame_sink_id.client_id(), frame_sink_id.client_id()); } TEST_F(RenderWidgetTest, GetCompositionRangeValidComposition) {
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc index 7b25a741..98db817 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -1369,11 +1369,9 @@ void RendererBlinkPlatformImpl::QueryStorageUsageAndQuota( const blink::WebSecurityOrigin& storage_partition, blink::mojom::StorageType type, - blink::WebStorageQuotaCallbacks callbacks) { + QueryStorageUsageAndQuotaCallback callback) { QuotaDispatcher::ThreadSpecificInstance(default_task_runner_) - ->QueryStorageUsageAndQuota( - storage_partition, type, - std::make_unique<blink::WebStorageQuotaCallbacks>(callbacks)); + ->QueryStorageUsageAndQuota(storage_partition, type, std::move(callback)); } //------------------------------------------------------------------------------
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h index 9719faf..351efa1 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h
@@ -210,7 +210,7 @@ void QueryStorageUsageAndQuota( const blink::WebSecurityOrigin& storage_partition, blink::mojom::StorageType, - blink::WebStorageQuotaCallbacks) override; + QueryStorageUsageAndQuotaCallback) override; blink::WebThread* CurrentThread() override; blink::BlameContext* GetTopLevelBlameContext() override; void RecordRappor(const char* metric,
diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc index 8916170..b3d66e5 100644 --- a/content/renderer/renderer_main.cc +++ b/content/renderer/renderer_main.cc
@@ -12,7 +12,6 @@ #include "base/i18n/rtl.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_macros.h" -#include "base/metrics/statistics_recorder.h" #include "base/pending_task.h" #include "base/run_loop.h" #include "base/strings/string_util.h" @@ -168,9 +167,6 @@ bool no_sandbox = parsed_command_line.HasSwitch(switches::kNoSandbox); - // Initialize histogram statistics gathering system. - base::StatisticsRecorder::Initialize(); - #if defined(OS_ANDROID) // If we have any pending LibraryLoader histograms, record them. base::android::RecordLibraryLoaderRendererHistograms();
diff --git a/content/renderer/service_worker/worker_fetch_context_impl.cc b/content/renderer/service_worker/worker_fetch_context_impl.cc index 322c85f..06d94dd 100644 --- a/content/renderer/service_worker/worker_fetch_context_impl.cc +++ b/content/renderer/service_worker/worker_fetch_context_impl.cc
@@ -187,16 +187,13 @@ return site_for_cookies_; } -void WorkerFetchContextImpl::DidRunContentWithCertificateErrors( - const blink::WebURL& url) { - Send(new FrameHostMsg_DidRunContentWithCertificateErrors(parent_frame_id_, - url)); +void WorkerFetchContextImpl::DidRunContentWithCertificateErrors() { + Send(new FrameHostMsg_DidRunContentWithCertificateErrors(parent_frame_id_)); } -void WorkerFetchContextImpl::DidDisplayContentWithCertificateErrors( - const blink::WebURL& url) { - Send(new FrameHostMsg_DidDisplayContentWithCertificateErrors(parent_frame_id_, - url)); +void WorkerFetchContextImpl::DidDisplayContentWithCertificateErrors() { + Send(new FrameHostMsg_DidDisplayContentWithCertificateErrors( + parent_frame_id_)); } void WorkerFetchContextImpl::DidRunInsecureContent(
diff --git a/content/renderer/service_worker/worker_fetch_context_impl.h b/content/renderer/service_worker/worker_fetch_context_impl.h index 1464eba4..4bb3b0e 100644 --- a/content/renderer/service_worker/worker_fetch_context_impl.h +++ b/content/renderer/service_worker/worker_fetch_context_impl.h
@@ -54,9 +54,8 @@ void SetIsOnSubframe(bool) override; bool IsOnSubframe() const override; blink::WebURL SiteForCookies() const override; - void DidRunContentWithCertificateErrors(const blink::WebURL& url) override; - void DidDisplayContentWithCertificateErrors( - const blink::WebURL& url) override; + void DidRunContentWithCertificateErrors() override; + void DidDisplayContentWithCertificateErrors() override; void DidRunInsecureContent(const blink::WebSecurityOrigin&, const blink::WebURL& insecure_url) override; void SetApplicationCacheHostID(int id) override;
diff --git a/content/renderer/shared_worker/embedded_shared_worker_stub.h b/content/renderer/shared_worker/embedded_shared_worker_stub.h index d07e2601..6341f4f 100644 --- a/content/renderer/shared_worker/embedded_shared_worker_stub.h +++ b/content/renderer/shared_worker/embedded_shared_worker_stub.h
@@ -18,7 +18,6 @@ #include "ipc/ipc_listener.h" #include "mojo/public/cpp/bindings/binding.h" #include "services/service_manager/public/interfaces/interface_provider.mojom.h" -#include "third_party/WebKit/public/platform/WebAddressSpace.h" #include "third_party/WebKit/public/platform/WebContentSecurityPolicy.h" #include "third_party/WebKit/public/platform/WebContentSettingsClient.h" #include "third_party/WebKit/public/platform/WebString.h"
diff --git a/content/renderer/shared_worker/shared_worker_repository.cc b/content/renderer/shared_worker/shared_worker_repository.cc index 5b3eef8f..28ef1cc 100644 --- a/content/renderer/shared_worker/shared_worker_repository.cc +++ b/content/renderer/shared_worker/shared_worker_repository.cc
@@ -23,7 +23,7 @@ DocumentID document_id, const blink::WebString& content_security_policy, blink::WebContentSecurityPolicyType content_security_policy_type, - blink::WebAddressSpace creation_address_space, + blink::mojom::IPAddressSpace creation_address_space, blink::mojom::SharedWorkerCreationContextType creation_context_type, blink::MessagePortChannel channel, std::unique_ptr<blink::WebSharedWorkerConnectListener> listener) {
diff --git a/content/renderer/shared_worker/shared_worker_repository.h b/content/renderer/shared_worker/shared_worker_repository.h index cedec5a..0b69c63 100644 --- a/content/renderer/shared_worker/shared_worker_repository.h +++ b/content/renderer/shared_worker/shared_worker_repository.h
@@ -41,7 +41,7 @@ DocumentID document_id, const blink::WebString& content_security_policy, blink::WebContentSecurityPolicyType, - blink::WebAddressSpace, + blink::mojom::IPAddressSpace, blink::mojom::SharedWorkerCreationContextType, blink::MessagePortChannel channel, std::unique_ptr<blink::WebSharedWorkerConnectListener> listener) override;
diff --git a/content/shell/app/blink_test_platform_support_linux.cc b/content/shell/app/blink_test_platform_support_linux.cc index 95b8b234..8317845 100644 --- a/content/shell/app/blink_test_platform_support_linux.cc +++ b/content/shell/app/blink_test_platform_support_linux.cc
@@ -56,24 +56,6 @@ return false; } - base::FilePath garuda_path("/usr/share/fonts/truetype/thai/Garuda.ttf"); - if (!base::PathExists(garuda_path)) - garuda_path = base::FilePath("/usr/share/fonts/truetype/tlwg/Garuda.ttf"); - if (!base::PathExists(garuda_path)) - garuda_path = base::FilePath("/usr/share/fonts/opentype/tlwg/Garuda.otf"); - if (!gfx::LoadFontIntoFontconfig(garuda_path)) - return false; - - // We special case these fonts because they're only needed in a few layout - // tests. - base::FilePath lohit_path( - "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf"); - if (!base::PathExists(lohit_path)) { - lohit_path = base::FilePath( - "/usr/share/fonts/truetype/ttf-punjabi-fonts/lohit_pa.ttf"); - } - gfx::LoadFontIntoFontconfig(lohit_path); - return true; }
diff --git a/content/shell/test_runner/web_frame_test_client.cc b/content/shell/test_runner/web_frame_test_client.cc index d477b1077..ce29430b 100644 --- a/content/shell/test_runner/web_frame_test_client.cc +++ b/content/shell/test_runner/web_frame_test_client.cc
@@ -350,6 +350,12 @@ "webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"); } +void WebFrameTestClient::DidChangeContents() { + if (test_runner()->shouldDumpEditingCallbacks()) + delegate_->PrintMessage( + "EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n"); +} + blink::WebPlugin* WebFrameTestClient::CreatePlugin( const blink::WebPluginParams& params) { blink::WebLocalFrame* frame = web_frame_test_proxy_base_->web_frame();
diff --git a/content/shell/test_runner/web_frame_test_client.h b/content/shell/test_runner/web_frame_test_client.h index 6b9fa42..5c87e37 100644 --- a/content/shell/test_runner/web_frame_test_client.h +++ b/content/shell/test_runner/web_frame_test_client.h
@@ -43,6 +43,7 @@ void PostAccessibilityEvent(const blink::WebAXObject& object, blink::WebAXEvent event) override; void DidChangeSelection(bool is_selection_empty) override; + void DidChangeContents() override; blink::WebPlugin* CreatePlugin(const blink::WebPluginParams& params) override; void ShowContextMenu( const blink::WebContextMenuData& context_menu_data) override;
diff --git a/content/shell/test_runner/web_frame_test_proxy.h b/content/shell/test_runner/web_frame_test_proxy.h index f5d5ba1..c8683019 100644 --- a/content/shell/test_runner/web_frame_test_proxy.h +++ b/content/shell/test_runner/web_frame_test_proxy.h
@@ -168,6 +168,11 @@ Base::DidChangeSelection(is_selection_empty); } + void DidChangeContents() override { + test_client()->DidChangeContents(); + Base::DidChangeContents(); + } + blink::WebEffectiveConnectionType GetEffectiveConnectionType() override { if (test_client()->GetEffectiveConnectionType() != blink::WebEffectiveConnectionType::kTypeUnknown) {
diff --git a/content/shell/test_runner/web_view_test_client.cc b/content/shell/test_runner/web_view_test_client.cc index 8a80087..a36a743a 100644 --- a/content/shell/test_runner/web_view_test_client.cc +++ b/content/shell/test_runner/web_view_test_client.cc
@@ -40,12 +40,6 @@ // The output from these methods in layout test mode should match that // expected by the layout tests. See EditingDelegate.m in DumpRenderTree. -void WebViewTestClient::DidChangeContents() { - if (test_runner()->shouldDumpEditingCallbacks()) - delegate()->PrintMessage( - "EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n"); -} - blink::WebView* WebViewTestClient::CreateView( blink::WebLocalFrame* frame, const blink::WebURLRequest& request,
diff --git a/content/shell/test_runner/web_view_test_client.h b/content/shell/test_runner/web_view_test_client.h index 7190c11..4a575c8 100644 --- a/content/shell/test_runner/web_view_test_client.h +++ b/content/shell/test_runner/web_view_test_client.h
@@ -30,7 +30,6 @@ ~WebViewTestClient() override; // WebViewClient overrides needed by WebViewTestProxy. - void DidChangeContents() override; blink::WebView* CreateView(blink::WebLocalFrame* creator, const blink::WebURLRequest& request, const blink::WebWindowFeatures& features,
diff --git a/content/shell/test_runner/web_view_test_proxy.h b/content/shell/test_runner/web_view_test_proxy.h index 00223837d..ac0385b 100644 --- a/content/shell/test_runner/web_view_test_proxy.h +++ b/content/shell/test_runner/web_view_test_proxy.h
@@ -181,10 +181,6 @@ // Don't forward this call to Base because we don't want to do a real // drag-and-drop. } - void DidChangeContents() override { - view_test_client()->DidChangeContents(); - Base::DidChangeContents(); - } blink::WebView* CreateView(blink::WebLocalFrame* creator, const blink::WebURLRequest& request, const blink::WebWindowFeatures& features,
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn index e61a7e5b..1897bed 100644 --- a/content/test/BUILD.gn +++ b/content/test/BUILD.gn
@@ -317,6 +317,7 @@ "//device/geolocation", "//device/geolocation/public/cpp:test_support", "//device/geolocation/public/interfaces", + "//gpu/ipc:gl_in_process_context", "//ipc:test_support", "//media", "//media/capture", @@ -599,6 +600,7 @@ "//device/bluetooth", "//device/gamepad/public/cpp:shared_with_blink", "//device/sensors/public/cpp:full", + "//gpu/ipc/service", "//services/ui/public/cpp/gpu", "//skia", "//ui/accessibility:ax_gen", @@ -1690,6 +1692,7 @@ "//gpu", "//gpu:test_support", "//gpu/ipc/host", + "//gpu/ipc/service", "//ipc:test_support", "//media:test_support", "//media/blink", @@ -1869,6 +1872,7 @@ "//third_party/webrtc/media:rtc_media", "//third_party/webrtc/modules/desktop_capture:primitives", "//third_party/webrtc/modules/video_capture", + "//third_party/webrtc/modules/video_coding", "//third_party/webrtc/pc:libjingle_peerconnection", "//third_party/webrtc/rtc_base:rtc_base", "//third_party/webrtc/stats:rtc_stats_test_utils", @@ -1985,10 +1989,7 @@ is_linux_without_udev = is_linux && !use_udev if (!is_linux_without_udev && !is_android) { sources += [ "../browser/webauth/authenticator_impl_unittest.cc" ] - deps += [ - "//components/cbor", - "//device/u2f:test_support", - ] + deps += [ "//device/u2f:test_support" ] } if (use_aura) {
diff --git a/content/test/content_browser_test_utils_internal.cc b/content/test/content_browser_test_utils_internal.cc index f76e12fe6..ab900146 100644 --- a/content/test/content_browser_test_utils_internal.cc +++ b/content/test/content_browser_test_utils_internal.cc
@@ -425,4 +425,36 @@ return false; } +RenderProcessHostKillWaiter::RenderProcessHostKillWaiter( + RenderProcessHost* render_process_host) + : exit_watcher_(render_process_host, + RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT) {} + +base::Optional<bad_message::BadMessageReason> +RenderProcessHostKillWaiter::Wait() { + base::Optional<bad_message::BadMessageReason> result; + + // Wait for the renderer kill. + exit_watcher_.Wait(); + if (exit_watcher_.did_exit_normally()) + return result; + + // Find the logged Stability.BadMessageTerminated.Content data (if present). + std::vector<base::Bucket> uma_samples = + histogram_tester_.GetAllSamples("Stability.BadMessageTerminated.Content"); + // No UMA will be present if the kill was not trigerred by the //content layer + // (e.g. if it was trigerred by bad_message::ReceivedBadMessage from //chrome + // layer or from somewhere in the //components layer). + if (uma_samples.empty()) + return result; + const base::Bucket& bucket = uma_samples.back(); + // Assumming that user of RenderProcessHostKillWatcher makes sure that only + // one kill can happen while using the class. + DCHECK_EQ(1u, uma_samples.size()) + << "Multiple renderer kills are unsupported"; + + // Translate contents of the bucket into bad_message::BadMessageReason. + return static_cast<bad_message::BadMessageReason>(bucket.min); +} + } // namespace content
diff --git a/content/test/content_browser_test_utils_internal.h b/content/test/content_browser_test_utils_internal.h index 213e646..4929f14 100644 --- a/content/test/content_browser_test_utils_internal.h +++ b/content/test/content_browser_test_utils_internal.h
@@ -14,10 +14,14 @@ #include <string> #include <vector> +#include "base/compiler_specific.h" #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/weak_ptr.h" +#include "base/optional.h" #include "base/run_loop.h" +#include "base/test/histogram_tester.h" +#include "content/browser/bad_message.h" #include "content/public/browser/resource_dispatcher_host_delegate.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/common/file_chooser_params.h" @@ -118,7 +122,7 @@ public: // Constructs a WebContentsDelegate that mocks a file dialog. // The mocked file dialog will always reply that the user selected |file|. - FileChooserDelegate(const base::FilePath& file); + explicit FileChooserDelegate(const base::FilePath& file); // Implementation of WebContentsDelegate::RunFileChooser. void RunFileChooser(RenderFrameHost* render_frame_host, @@ -219,6 +223,33 @@ DISALLOW_COPY_AND_ASSIGN(UpdateResizeParamsMessageFilter); }; +// Waits for a kill of the given RenderProcessHost and returns the +// BadMessageReason that caused a //content-triggerred kill. +// +// Example usage: +// RenderProcessHostKillWaiter kill_waiter(render_process_host); +// ... test code that triggers a renderer kill ... +// EXPECT_EQ(bad_message::RFH_INVALID_ORIGIN_ON_COMMIT, kill_waiter.Wait()); +// +// Tests that don't expect kills (e.g. tests where a renderer process exits +// normally, like RenderFrameHostManagerTest.ProcessExitWithSwappedOutViews) +// should use RenderProcessHostWatcher instead of RenderProcessHostKillWaiter. +class RenderProcessHostKillWaiter { + public: + explicit RenderProcessHostKillWaiter(RenderProcessHost* render_process_host); + + // Waits until the renderer process exits. Returns the bad message that made + // //content kill the renderer. |base::nullopt| is returned if the renderer + // was killed outside of //content or exited normally. + base::Optional<bad_message::BadMessageReason> Wait() WARN_UNUSED_RESULT; + + private: + RenderProcessHostWatcher exit_watcher_; + base::HistogramTester histogram_tester_; + + DISALLOW_COPY_AND_ASSIGN(RenderProcessHostKillWaiter); +}; + } // namespace content #endif // CONTENT_TEST_CONTENT_BROWSER_TEST_UTILS_INTERNAL_H_
diff --git a/content/test/data/device_sensors/device_motion_only_some_sensors_are_available_test.html b/content/test/data/device_sensors/device_motion_only_some_sensors_are_available_test.html index b0286e7..0823ec9 100644 --- a/content/test/data/device_sensors/device_motion_only_some_sensors_are_available_test.html +++ b/content/test/data/device_sensors/device_motion_only_some_sensors_are_available_test.html
@@ -21,6 +21,16 @@ window.removeEventListener('devicemotion', onMotion); pass(); } else { + console.log("event.acceleration.x is: " + event.acceleration.x); + console.log("event.acceleration.y is: " + event.acceleration.y); + console.log("event.acceleration.z is: " + event.acceleration.z); + console.log("event.accelerationIncludingGravity.x is: " + event.accelerationIncludingGravity.x); + console.log("event.accelerationIncludingGravity.y is: " + event.accelerationIncludingGravity.y); + console.log("event.accelerationIncludingGravity.z is: " + event.accelerationIncludingGravity.z); + console.log("event.rotationRate.alpha is: " + event.rotationRate.alpha); + console.log("event.rotationRate.beta is: " + event.rotationRate.beta); + console.log("event.rotationRate.gamma is: " + event.rotationRate.gamma); + console.log("event.interval is: " + event.interval); fail(); } }
diff --git a/content/test/fake_compositor_dependencies.cc b/content/test/fake_compositor_dependencies.cc index 85a5e9d..b1fa5f5 100644 --- a/content/test/fake_compositor_dependencies.cc +++ b/content/test/fake_compositor_dependencies.cc
@@ -53,11 +53,6 @@ return true; } -const viz::BufferUsageAndFormatList& -FakeCompositorDependencies::GetTextureTargetExceptionList() { - return texture_target_exception_list_; -} - scoped_refptr<base::SingleThreadTaskRunner> FakeCompositorDependencies::GetCompositorMainThreadTaskRunner() { return base::ThreadTaskRunnerHandle::Get();
diff --git a/content/test/fake_compositor_dependencies.h b/content/test/fake_compositor_dependencies.h index b7e94af..dd7f325f 100644 --- a/content/test/fake_compositor_dependencies.h +++ b/content/test/fake_compositor_dependencies.h
@@ -8,7 +8,6 @@ #include "base/macros.h" #include "base/single_thread_task_runner.h" #include "cc/test/test_task_graph_runner.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "content/renderer/gpu/compositor_dependencies.h" #include "third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h" @@ -28,7 +27,6 @@ bool IsPartialRasterEnabled() override; bool IsGpuMemoryBufferCompositorResourcesEnabled() override; bool IsElasticOverscrollEnabled() override; - const viz::BufferUsageAndFormatList& GetTextureTargetExceptionList() override; scoped_refptr<base::SingleThreadTaskRunner> GetCompositorMainThreadTaskRunner() override; scoped_refptr<base::SingleThreadTaskRunner> @@ -42,7 +40,6 @@ private: cc::TestTaskGraphRunner task_graph_runner_; blink::scheduler::FakeRendererScheduler renderer_scheduler_; - viz::BufferUsageAndFormatList texture_target_exception_list_; DISALLOW_COPY_AND_ASSIGN(FakeCompositorDependencies); };
diff --git a/content/test/gpu/generate_buildbot_json.py b/content/test/gpu/generate_buildbot_json.py index e39961a..c175dfb 100755 --- a/content/test/gpu/generate_buildbot_json.py +++ b/content/test/gpu/generate_buildbot_json.py
@@ -1415,6 +1415,9 @@ { 'names': [ 'Linux Ozone (Intel)', + # On Android, these are already run on the main waterfall. + # Run them on the one-off Android FYI bots, though. + 'Android Release (Nexus 5X)', ], }, ], @@ -1447,6 +1450,9 @@ { 'names': [ 'Linux Ozone (Intel)', + # On Android, these are already run on the main waterfall. + # Run them on the one-off Android FYI bots, though. + 'Android Release (Nexus 5X)', ], }, ], @@ -1695,7 +1701,7 @@ '--enable-gpu', '--test-launcher-bot-mode', '--test-launcher-jobs=1', - '--gtest_filter=VrBrowserTest.*', + '--gtest_filter=VrBrowserTest*', '--gtest_also_run_disabled_tests', ], 'test': 'browser_tests',
diff --git a/content/test/gpu/gpu_tests/pixel_expectations.py b/content/test/gpu/gpu_tests/pixel_expectations.py index 2af9b843..7254ce3d 100644 --- a/content/test/gpu/gpu_tests/pixel_expectations.py +++ b/content/test/gpu/gpu_tests/pixel_expectations.py
@@ -96,3 +96,8 @@ # Failing on NVIDIA Shield TV; not sure why yet. self.Fail('Pixel_WebGL_PremultipliedAlpha_False', ['android', 'nvidia'], bug=791733) + + # Temporary supression to rebaseline Video tests on Windows with the + # passthrough command decoder + self.Fail('Pixel_DirectComposition_Video_MP4', ['win'], bug=602688) + self.Fail('Pixel_DirectComposition_Video_VP9', ['win'], bug=602688)
diff --git a/content/test/gpu/gpu_tests/pixel_test_pages.py b/content/test/gpu/gpu_tests/pixel_test_pages.py index 6aba7a00..600cd515 100644 --- a/content/test/gpu/gpu_tests/pixel_test_pages.py +++ b/content/test/gpu/gpu_tests/pixel_test_pages.py
@@ -708,13 +708,13 @@ 'pixel_video_mp4.html', base_name + '_DirectComposition_Video_MP4', test_rect=[0, 0, 300, 300], - revision=5, + revision=6, browser_args=browser_args), PixelTestPage( 'pixel_video_vp9.html', base_name + '_DirectComposition_Video_VP9', test_rect=[0, 0, 300, 300], - revision=6, + revision=7, browser_args=browser_args), ]
diff --git a/content/test/mock_overscroll_controller_delegate_aura.h b/content/test/mock_overscroll_controller_delegate_aura.h index bcd2561..b872513b 100644 --- a/content/test/mock_overscroll_controller_delegate_aura.h +++ b/content/test/mock_overscroll_controller_delegate_aura.h
@@ -26,6 +26,7 @@ // OverscrollControllerDelegate: gfx::Size GetDisplaySize() const override; base::Optional<float> GetMaxOverscrollDelta() const override; + void OnOverscrollBehaviorUpdate(cc::OverscrollBehavior) override {} bool OnOverscrollUpdate(float, float) override; void OnOverscrollComplete(OverscrollMode) override; void OnOverscrollModeChange(OverscrollMode old_mode,
diff --git a/content/test/test_navigation_url_loader.cc b/content/test/test_navigation_url_loader.cc index 2e262b39..853cd74 100644 --- a/content/test/test_navigation_url_loader.cc +++ b/content/test/test_navigation_url_loader.cc
@@ -6,10 +6,10 @@ #include <utility> -#include "base/values.h" #include "content/browser/loader/navigation_url_loader_delegate.h" #include "content/common/navigation_subresource_loader_params.h" #include "content/public/browser/global_request_id.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/ssl_status.h" @@ -63,7 +63,7 @@ void TestNavigationURLLoader::CallOnResponseStarted( const scoped_refptr<ResourceResponse>& response, std::unique_ptr<StreamHandle> body, - base::Value navigation_data) { + std::unique_ptr<NavigationData> navigation_data) { // Start the request_ids at 1000 to avoid collisions with request ids from // network resources (it should be rare to compare these in unit tests). static int request_id = 1000;
diff --git a/content/test/test_navigation_url_loader.h b/content/test/test_navigation_url_loader.h index 56bb0de..8edcdfc 100644 --- a/content/test/test_navigation_url_loader.h +++ b/content/test/test_navigation_url_loader.h
@@ -12,16 +12,13 @@ #include "content/browser/loader/navigation_url_loader.h" #include "content/common/navigation_params.h" -namespace base { -class Value; -} - namespace net { struct RedirectInfo; } namespace content { +class NavigationData; class NavigationURLLoaderDelegate; class StreamHandle; struct ResourceResponse; @@ -50,7 +47,7 @@ const scoped_refptr<ResourceResponse>& response); void CallOnResponseStarted(const scoped_refptr<ResourceResponse>& response, std::unique_ptr<StreamHandle> body, - base::Value navigation_data); + std::unique_ptr<NavigationData> navigation_data); int redirect_count() { return redirect_count_; }
diff --git a/content/test/test_navigation_url_loader_delegate.cc b/content/test/test_navigation_url_loader_delegate.cc index 0b43d87..19311a19 100644 --- a/content/test/test_navigation_url_loader_delegate.cc +++ b/content/test/test_navigation_url_loader_delegate.cc
@@ -7,6 +7,7 @@ #include "base/run_loop.h" #include "content/common/navigation_subresource_loader_params.h" #include "content/public/browser/global_request_id.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/stream_handle.h" #include "content/public/common/resource_response.h" #include "testing/gtest/include/gtest/gtest.h" @@ -61,7 +62,7 @@ mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints, std::unique_ptr<StreamHandle> body, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream,
diff --git a/content/test/test_navigation_url_loader_delegate.h b/content/test/test_navigation_url_loader_delegate.h index 346f119d..e0a6941 100644 --- a/content/test/test_navigation_url_loader_delegate.h +++ b/content/test/test_navigation_url_loader_delegate.h
@@ -62,7 +62,7 @@ mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints, std::unique_ptr<StreamHandle> body, const net::SSLInfo& ssl_info, - base::Value navigation_data, + std::unique_ptr<NavigationData> navigation_data, const GlobalRequestID& request_id, bool is_download, bool is_stream,
diff --git a/content/test/test_overscroll_delegate.h b/content/test/test_overscroll_delegate.h index 724e981f..6fdd9d85 100644 --- a/content/test/test_overscroll_delegate.h +++ b/content/test/test_overscroll_delegate.h
@@ -39,6 +39,8 @@ void OnOverscrollModeChange(OverscrollMode old_mode, OverscrollMode new_mode, OverscrollSource source) override; + void OnOverscrollBehaviorUpdate( + cc::OverscrollBehavior overscroll_behavior) override {} base::Optional<float> GetMaxOverscrollDelta() const override; gfx::Size display_size_;
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc index 17d14c19..b7f3f197 100644 --- a/content/test/test_render_frame_host.cc +++ b/content/test/test_render_frame_host.cc
@@ -9,7 +9,6 @@ #include "base/guid.h" #include "base/run_loop.h" -#include "base/values.h" #include "content/browser/frame_host/frame_tree.h" #include "content/browser/frame_host/navigation_handle_impl.h" #include "content/browser/frame_host/navigation_request.h" @@ -169,7 +168,6 @@ OnDidStartLoading(true); OnDidStartProvisionalLoad(url, std::vector<GURL>(), base::TimeTicks::Now()); - SimulateWillStartRequest(ui::PAGE_TRANSITION_LINK); } void TestRenderFrameHost::SimulateRedirect(const GURL& new_url) { @@ -386,7 +384,6 @@ GURL url_copy(url); OnDidStartProvisionalLoad(url_copy, std::vector<GURL>(), base::TimeTicks::Now()); - SimulateWillStartRequest(transition); FrameHostMsg_DidCommitProvisionalLoad_Params params; params.nav_entry_id = nav_entry_id; @@ -587,9 +584,7 @@ response->head.socket_address = socket_address; // TODO(carlosk): ideally with PlzNavigate it should be possible someday to // fully commit the navigation at this call to CallOnResponseStarted. - url_loader->CallOnResponseStarted( - response, MakeEmptyStream(), base::Value() // navigation_data - ); + url_loader->CallOnResponseStarted(response, MakeEmptyStream(), nullptr); } void TestRenderFrameHost::PrepareForCommitIfNecessary() { @@ -607,17 +602,6 @@ return service; } -void TestRenderFrameHost::SimulateWillStartRequest( - ui::PageTransition transition) { - // PlzNavigate: NavigationHandle::WillStartRequest has already been called at - // this point. - if (!navigation_handle() || IsBrowserSideNavigationEnabled()) - return; - navigation_handle()->CallWillStartRequestForTesting( - false /* is_post */, Referrer(GURL(), blink::kWebReferrerPolicyDefault), - true /* user_gesture */, transition, false /* is_external_protocol */); -} - void TestRenderFrameHost::SendFramePolicy( blink::WebSandboxFlags sandbox_flags, const blink::ParsedFeaturePolicy& declared_policy) {
diff --git a/content/test/test_render_frame_host.h b/content/test/test_render_frame_host.h index 7a6715f46..9e234be 100644 --- a/content/test/test_render_frame_host.h +++ b/content/test/test_render_frame_host.h
@@ -209,8 +209,6 @@ // Computes the page ID for a pending navigation in this RenderFrameHost; int32_t ComputeNextPageID(); - void SimulateWillStartRequest(ui::PageTransition transition); - // RenderFrameHostImpl: mojom::FrameNavigationControl* GetNavigationControl() override;
diff --git a/content/test/test_render_view_host.cc b/content/test/test_render_view_host.cc index dc71813..17cfb63 100644 --- a/content/test/test_render_view_host.cc +++ b/content/test/test_render_view_host.cc
@@ -222,6 +222,10 @@ return frame_sink_id_; } +viz::SurfaceId TestRenderWidgetHostView::GetCurrentSurfaceId() const { + return viz::SurfaceId(); +} + void TestRenderWidgetHostView::OnFirstSurfaceActivation( const viz::SurfaceInfo& surface_info) { // TODO(fsamuel): Once surface synchronization is turned on, the fallback
diff --git a/content/test/test_render_view_host.h b/content/test/test_render_view_host.h index 3489d49..be3ecaf1 100644 --- a/content/test/test_render_view_host.h +++ b/content/test/test_render_view_host.h
@@ -119,6 +119,7 @@ void UnlockMouse() override; RenderWidgetHostImpl* GetRenderWidgetHostImpl() const override; viz::FrameSinkId GetFrameSinkId() override; + viz::SurfaceId GetCurrentSurfaceId() const override; bool is_showing() const { return is_showing_; } bool is_occluded() const { return is_occluded_; }
diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc index e20dcda..0b698b7 100644 --- a/content/test/test_web_contents.cc +++ b/content/test/test_web_contents.cc
@@ -8,7 +8,6 @@ #include <utility> #include <vector> -#include "base/values.h" #include "content/browser/browser_url_handler_impl.h" #include "content/browser/frame_host/cross_process_frame_connector.h" #include "content/browser/frame_host/debug_urls.h" @@ -21,6 +20,7 @@ #include "content/common/frame_messages.h" #include "content/common/render_message_filter.mojom.h" #include "content/common/view_messages.h" +#include "content/public/browser/navigation_data.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" @@ -328,8 +328,9 @@ frame_tree_.root()->current_frame_host()->OnMessageReceived(msg); } -void TestWebContents::SetNavigationData(NavigationHandle* navigation_handle, - base::Value navigation_data) { +void TestWebContents::SetNavigationData( + NavigationHandle* navigation_handle, + std::unique_ptr<NavigationData> navigation_data) { static_cast<NavigationHandleImpl*>(navigation_handle) ->set_navigation_data(std::move(navigation_data)); }
diff --git a/content/test/test_web_contents.h b/content/test/test_web_contents.h index af13411..9f54971 100644 --- a/content/test/test_web_contents.h +++ b/content/test/test_web_contents.h
@@ -22,10 +22,6 @@ class Referrer; class SkBitmap; -namespace base { -class Value; -} - namespace gfx { class Size; } @@ -36,6 +32,7 @@ namespace content { +class NavigationData; class NavigationHandle; class RenderViewHost; class TestRenderViewHost; @@ -137,8 +134,9 @@ int error_code, const base::string16& error_description); - void SetNavigationData(NavigationHandle* navigation_handle, - base::Value navigation_data) override; + void SetNavigationData( + NavigationHandle* navigation_handle, + std::unique_ptr<NavigationData> navigation_data) override; void SetHttpResponseHeaders( NavigationHandle* navigation_handle,
diff --git a/dbus/signal_sender_verification_unittest.cc b/dbus/signal_sender_verification_unittest.cc index 3a5f299..00a1138 100644 --- a/dbus/signal_sender_verification_unittest.cc +++ b/dbus/signal_sender_verification_unittest.cc
@@ -8,7 +8,6 @@ #include "base/message_loop/message_loop.h" #include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_samples.h" -#include "base/metrics/statistics_recorder.h" #include "base/run_loop.h" #include "base/single_thread_task_runner.h" #include "base/test/test_timeouts.h" @@ -31,8 +30,6 @@ } void SetUp() override { - base::StatisticsRecorder::Initialize(); - // Make the main thread not to allow IO. base::ThreadRestrictions::SetIOAllowed(false);
diff --git a/device/BUILD.gn b/device/BUILD.gn index 4b13da7..e11df00 100644 --- a/device/BUILD.gn +++ b/device/BUILD.gn
@@ -64,6 +64,7 @@ "bluetooth/test/test_bluetooth_local_gatt_service_delegate.cc", "bluetooth/test/test_bluetooth_local_gatt_service_delegate.h", "bluetooth/uribeacon/uri_encoder_unittest.cc", + "ctap/ctap_request_unittest.cc", "gamepad/abstract_haptic_gamepad_unittest.cc", "gamepad/gamepad_provider_unittest.cc", "gamepad/gamepad_service_unittest.cc", @@ -86,11 +87,13 @@ deps = [ "//base/test:test_support", "//base/third_party/dynamic_annotations:dynamic_annotations", + "//components/cbor", "//device/base/synchronization", "//device/bluetooth", "//device/bluetooth:deprecated_experimental_mojo", "//device/bluetooth:mocks", "//device/bluetooth/uribeacon", + "//device/ctap", "//device/gamepad", "//device/gamepad:test_helpers", "//device/gamepad/public/cpp:shared_with_blink",
diff --git a/device/ctap/BUILD.gn b/device/ctap/BUILD.gn new file mode 100644 index 0000000..a8ca5eee --- /dev/null +++ b/device/ctap/BUILD.gn
@@ -0,0 +1,35 @@ +# Copyright 2017 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("//build/config/features.gni") + +source_set("ctap") { + sources = [ + "ctap_device_command.h", + "ctap_get_assertion_request_param.cc", + "ctap_get_assertion_request_param.h", + "ctap_make_credential_request_param.cc", + "ctap_make_credential_request_param.h", + "ctap_request_command.h", + "ctap_request_param.cc", + "ctap_request_param.h", + "ctap_response_code.h", + "public_key_credential_descriptor.cc", + "public_key_credential_descriptor.h", + "public_key_credential_params.cc", + "public_key_credential_params.h", + "public_key_credential_rp_entity.cc", + "public_key_credential_rp_entity.h", + "public_key_credential_user_entity.cc", + "public_key_credential_user_entity.h", + ] + + deps = [ + "//base", + "//components/cbor", + "//services/device/public/interfaces", + "//services/service_manager/public/cpp", + "//services/service_manager/public/interfaces", + ] +}
diff --git a/device/ctap/DEPS b/device/ctap/DEPS new file mode 100644 index 0000000..4a77465 --- /dev/null +++ b/device/ctap/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+components/cbor", +]
diff --git a/device/ctap/OWNERS b/device/ctap/OWNERS new file mode 100644 index 0000000..732c53e --- /dev/null +++ b/device/ctap/OWNERS
@@ -0,0 +1,5 @@ +reillyg@chromium.org +jdoerrie@chromium.org + +# TEAM: security-dev@chromium.org +# COMPONENT: Blink>WebAuthentication
diff --git a/device/ctap/ctap_device_command.h b/device/ctap/ctap_device_command.h new file mode 100644 index 0000000..a7656d8 --- /dev/null +++ b/device/ctap/ctap_device_command.h
@@ -0,0 +1,28 @@ +// Copyright 2017 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 DEVICE_CTAP_CTAP_DEVICE_COMMAND_H_ +#define DEVICE_CTAP_CTAP_DEVICE_COMMAND_H_ + +#include <stdint.h> + +namespace device { + +// Commands supported by CTAPHID device as specified in +// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#ctaphid-commands +enum class CTAPHIDDeviceCommand : uint8_t { + kCtapHidMsg = 0x03, + kCtapHidCBOR = 0x10, + kCtapHidInit = 0x06, + kCtapHidPing = 0x01, + kCtapHidCancel = 0x11, + kCtapHidError = 0x3F, + kCtapHidKeepAlive = 0x3B, + kCtapHidWink = 0x08, + kCtapHidLock = 0x04, +}; + +} // namespace device + +#endif // DEVICE_CTAP_CTAP_DEVICE_COMMAND_H_
diff --git a/device/ctap/ctap_get_assertion_request_param.cc b/device/ctap/ctap_get_assertion_request_param.cc new file mode 100644 index 0000000..48737d24 --- /dev/null +++ b/device/ctap/ctap_get_assertion_request_param.cc
@@ -0,0 +1,82 @@ +// Copyright 2017 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 "device/ctap/ctap_get_assertion_request_param.h" + +#include <utility> + +#include "base/numerics/safe_conversions.h" +#include "components/cbor/cbor_writer.h" +#include "device/ctap/ctap_request_command.h" + +namespace device { + +CTAPGetAssertionRequestParam::CTAPGetAssertionRequestParam( + std::string rp_id, + std::vector<uint8_t> client_data_hash) + : rp_id_(std::move(rp_id)), + client_data_hash_(std::move(client_data_hash)) {} + +CTAPGetAssertionRequestParam::CTAPGetAssertionRequestParam( + CTAPGetAssertionRequestParam&& that) = default; + +CTAPGetAssertionRequestParam& CTAPGetAssertionRequestParam::operator=( + CTAPGetAssertionRequestParam&& other) = default; + +CTAPGetAssertionRequestParam::~CTAPGetAssertionRequestParam() = default; + +base::Optional<std::vector<uint8_t>> +CTAPGetAssertionRequestParam::SerializeToCBOR() const { + cbor::CBORValue::MapValue cbor_map; + cbor_map[cbor::CBORValue(1)] = cbor::CBORValue(rp_id_); + cbor_map[cbor::CBORValue(2)] = cbor::CBORValue(client_data_hash_); + + if (allow_list_) { + cbor::CBORValue::ArrayValue allow_list_array; + for (const auto& descriptor : *allow_list_) { + allow_list_array.push_back(descriptor.ConvertToCBOR()); + } + cbor_map[cbor::CBORValue(3)] = cbor::CBORValue(std::move(allow_list_array)); + } + + if (pin_auth_) { + cbor_map[cbor::CBORValue(6)] = cbor::CBORValue(*pin_auth_); + } + + if (pin_protocol_) { + cbor_map[cbor::CBORValue(7)] = cbor::CBORValue(*pin_protocol_); + } + + auto serialized_param = + cbor::CBORWriter::Write(cbor::CBORValue(std::move(cbor_map))); + if (!serialized_param) { + return base::nullopt; + } + + std::vector<uint8_t> cbor_request({base::strict_cast<uint8_t>( + CTAPRequestCommand::kAuthenticatorGetAssertion)}); + cbor_request.insert(cbor_request.end(), serialized_param->begin(), + serialized_param->end()); + return cbor_request; +} + +CTAPGetAssertionRequestParam& CTAPGetAssertionRequestParam::SetAllowList( + std::vector<PublicKeyCredentialDescriptor> allow_list) { + allow_list_ = std::move(allow_list); + return *this; +} + +CTAPGetAssertionRequestParam& CTAPGetAssertionRequestParam::SetPinAuth( + std::vector<uint8_t> pin_auth) { + pin_auth_ = std::move(pin_auth); + return *this; +} + +CTAPGetAssertionRequestParam& CTAPGetAssertionRequestParam::SetPinProtocol( + uint8_t pin_protocol) { + pin_protocol_ = pin_protocol; + return *this; +} + +} // namespace device
diff --git a/device/ctap/ctap_get_assertion_request_param.h b/device/ctap/ctap_get_assertion_request_param.h new file mode 100644 index 0000000..19c4c21 --- /dev/null +++ b/device/ctap/ctap_get_assertion_request_param.h
@@ -0,0 +1,46 @@ +// Copyright 2017 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 DEVICE_CTAP_CTAP_GET_ASSERTION_REQUEST_PARAM_H_ +#define DEVICE_CTAP_CTAP_GET_ASSERTION_REQUEST_PARAM_H_ + +#include <stdint.h> +#include <string> +#include <vector> + +#include "base/optional.h" +#include "device/ctap/ctap_request_param.h" +#include "device/ctap/public_key_credential_descriptor.h" + +namespace device { + +// Object that encapsulates request parameters for AuthenticatorGetAssertion as +// specified in the CTAP spec. +class CTAPGetAssertionRequestParam : public CTAPRequestParam { + public: + CTAPGetAssertionRequestParam(std::string rp_id, + std::vector<uint8_t> client_data_hash); + CTAPGetAssertionRequestParam(CTAPGetAssertionRequestParam&& that); + CTAPGetAssertionRequestParam& operator=(CTAPGetAssertionRequestParam&& other); + ~CTAPGetAssertionRequestParam() override; + + base::Optional<std::vector<uint8_t>> SerializeToCBOR() const override; + CTAPGetAssertionRequestParam& SetAllowList( + std::vector<PublicKeyCredentialDescriptor> allow_list); + CTAPGetAssertionRequestParam& SetPinAuth(std::vector<uint8_t> pin_auth); + CTAPGetAssertionRequestParam& SetPinProtocol(uint8_t pin_protocol); + + private: + std::string rp_id_; + std::vector<uint8_t> client_data_hash_; + base::Optional<std::vector<PublicKeyCredentialDescriptor>> allow_list_; + base::Optional<std::vector<uint8_t>> pin_auth_; + base::Optional<uint8_t> pin_protocol_; + + DISALLOW_COPY_AND_ASSIGN(CTAPGetAssertionRequestParam); +}; + +} // namespace device + +#endif // DEVICE_CTAP_CTAP_GET_ASSERTION_REQUEST_PARAM_H_
diff --git a/device/ctap/ctap_make_credential_request_param.cc b/device/ctap/ctap_make_credential_request_param.cc new file mode 100644 index 0000000..a7fe0f1 --- /dev/null +++ b/device/ctap/ctap_make_credential_request_param.cc
@@ -0,0 +1,86 @@ +// Copyright 2017 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 "device/ctap/ctap_make_credential_request_param.h" + +#include <utility> + +#include "base/numerics/safe_conversions.h" +#include "components/cbor/cbor_writer.h" +#include "device/ctap/ctap_request_command.h" + +namespace device { + +CTAPMakeCredentialRequestParam::CTAPMakeCredentialRequestParam( + std::vector<uint8_t> client_data_hash, + PublicKeyCredentialRPEntity rp, + PublicKeyCredentialUserEntity user, + PublicKeyCredentialParams public_key_credential_params) + : client_data_hash_(std::move(client_data_hash)), + rp_(std::move(rp)), + user_(std::move(user)), + public_key_credentials_(std::move(public_key_credential_params)) {} + +CTAPMakeCredentialRequestParam::CTAPMakeCredentialRequestParam( + CTAPMakeCredentialRequestParam&& that) = default; + +CTAPMakeCredentialRequestParam& CTAPMakeCredentialRequestParam::operator=( + CTAPMakeCredentialRequestParam&& that) = default; + +CTAPMakeCredentialRequestParam::~CTAPMakeCredentialRequestParam() = default; + +base::Optional<std::vector<uint8_t>> +CTAPMakeCredentialRequestParam::SerializeToCBOR() const { + cbor::CBORValue::MapValue cbor_map; + cbor_map[cbor::CBORValue(1)] = cbor::CBORValue(client_data_hash_); + cbor_map[cbor::CBORValue(2)] = rp_.ConvertToCBOR(); + cbor_map[cbor::CBORValue(3)] = user_.ConvertToCBOR(); + cbor_map[cbor::CBORValue(4)] = public_key_credentials_.ConvertToCBOR(); + if (exclude_list_) { + cbor::CBORValue::ArrayValue exclude_list_array; + for (const auto& descriptor : *exclude_list_) { + exclude_list_array.push_back(descriptor.ConvertToCBOR()); + } + cbor_map[cbor::CBORValue(5)] = + cbor::CBORValue(std::move(exclude_list_array)); + } + if (pin_auth_) { + cbor_map[cbor::CBORValue(8)] = cbor::CBORValue(*pin_auth_); + } + + if (pin_protocol_) { + cbor_map[cbor::CBORValue(9)] = cbor::CBORValue(*pin_protocol_); + } + + auto serialized_param = + cbor::CBORWriter::Write(cbor::CBORValue(std::move(cbor_map))); + if (!serialized_param) + return base::nullopt; + + std::vector<uint8_t> cbor_request({base::strict_cast<uint8_t>( + CTAPRequestCommand::kAuthenticatorMakeCredential)}); + cbor_request.insert(cbor_request.end(), serialized_param->begin(), + serialized_param->end()); + return cbor_request; +} + +CTAPMakeCredentialRequestParam& CTAPMakeCredentialRequestParam::SetExcludeList( + std::vector<PublicKeyCredentialDescriptor> exclude_list) { + exclude_list_ = std::move(exclude_list); + return *this; +} + +CTAPMakeCredentialRequestParam& CTAPMakeCredentialRequestParam::SetPinAuth( + std::vector<uint8_t> pin_auth) { + pin_auth_ = std::move(pin_auth); + return *this; +} + +CTAPMakeCredentialRequestParam& CTAPMakeCredentialRequestParam::SetPinProtocol( + uint8_t pin_protocol) { + pin_protocol_ = pin_protocol; + return *this; +} + +} // namespace device
diff --git a/device/ctap/ctap_make_credential_request_param.h b/device/ctap/ctap_make_credential_request_param.h new file mode 100644 index 0000000..2ce6eb2 --- /dev/null +++ b/device/ctap/ctap_make_credential_request_param.h
@@ -0,0 +1,56 @@ +// Copyright 2017 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 DEVICE_CTAP_CTAP_MAKE_CREDENTIAL_REQUEST_PARAM_H_ +#define DEVICE_CTAP_CTAP_MAKE_CREDENTIAL_REQUEST_PARAM_H_ + +#include <stdint.h> +#include <string> +#include <vector> + +#include "base/optional.h" +#include "device/ctap/ctap_request_param.h" +#include "device/ctap/public_key_credential_descriptor.h" +#include "device/ctap/public_key_credential_params.h" +#include "device/ctap/public_key_credential_rp_entity.h" +#include "device/ctap/public_key_credential_user_entity.h" + +namespace device { + +// Object containing request parameters for AuthenticatorMakeCredential command +// as specified in +// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html +class CTAPMakeCredentialRequestParam : public CTAPRequestParam { + public: + CTAPMakeCredentialRequestParam( + std::vector<uint8_t> client_data_hash, + PublicKeyCredentialRPEntity rp, + PublicKeyCredentialUserEntity user, + PublicKeyCredentialParams public_key_credential_params); + CTAPMakeCredentialRequestParam(CTAPMakeCredentialRequestParam&& that); + CTAPMakeCredentialRequestParam& operator=( + CTAPMakeCredentialRequestParam&& that); + ~CTAPMakeCredentialRequestParam() override; + + base::Optional<std::vector<uint8_t>> SerializeToCBOR() const override; + CTAPMakeCredentialRequestParam& SetExcludeList( + std::vector<PublicKeyCredentialDescriptor> exclude_list); + CTAPMakeCredentialRequestParam& SetPinAuth(std::vector<uint8_t> pin_auth); + CTAPMakeCredentialRequestParam& SetPinProtocol(uint8_t pin_protocol); + + private: + std::vector<uint8_t> client_data_hash_; + PublicKeyCredentialRPEntity rp_; + PublicKeyCredentialUserEntity user_; + PublicKeyCredentialParams public_key_credentials_; + base::Optional<std::vector<PublicKeyCredentialDescriptor>> exclude_list_; + base::Optional<std::vector<uint8_t>> pin_auth_; + base::Optional<uint8_t> pin_protocol_; + + DISALLOW_COPY_AND_ASSIGN(CTAPMakeCredentialRequestParam); +}; + +} // namespace device + +#endif // DEVICE_CTAP_CTAP_MAKE_CREDENTIAL_REQUEST_PARAM_H_
diff --git a/device/ctap/ctap_request_command.h b/device/ctap/ctap_request_command.h new file mode 100644 index 0000000..671d9e1 --- /dev/null +++ b/device/ctap/ctap_request_command.h
@@ -0,0 +1,26 @@ +// Copyright 2017 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 DEVICE_CTAP_CTAP_REQUEST_COMMAND_H_ +#define DEVICE_CTAP_CTAP_REQUEST_COMMAND_H_ + +#include <stdint.h> + +namespace device { + +// Authenticator API commands supported by CTAP devices, as specified in +// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#authenticator-api +enum class CTAPRequestCommand : uint8_t { + kAuthenticatorMakeCredential = 0x01, + kAuthenticatorGetAssertion = 0x02, + kAuthenticatorGetNextAssertion = 0x08, + kAuthenticatorCancel = 0x03, + kAuthenticatorGetInfo = 0x04, + kAuthenticatorClientPin = 0x06, + kAuthenticatorReset = 0x07, +}; + +} // namespace device + +#endif // DEVICE_CTAP_CTAP_REQUEST_COMMAND_H_
diff --git a/device/ctap/ctap_request_param.cc b/device/ctap/ctap_request_param.cc new file mode 100644 index 0000000..a29254e --- /dev/null +++ b/device/ctap/ctap_request_param.cc
@@ -0,0 +1,12 @@ +// Copyright 2017 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 "device/ctap/ctap_request_param.h" + +namespace device { + +CTAPRequestParam::CTAPRequestParam() = default; +CTAPRequestParam::~CTAPRequestParam() = default; + +} // namespace device
diff --git a/device/ctap/ctap_request_param.h b/device/ctap/ctap_request_param.h new file mode 100644 index 0000000..09229abc --- /dev/null +++ b/device/ctap/ctap_request_param.h
@@ -0,0 +1,24 @@ +// Copyright 2017 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 DEVICE_CTAP_CTAP_REQUEST_PARAM_H_ +#define DEVICE_CTAP_CTAP_REQUEST_PARAM_H_ + +#include <stdint.h> +#include <vector> + +#include "base/optional.h" + +namespace device { + +class CTAPRequestParam { + public: + CTAPRequestParam(); + virtual ~CTAPRequestParam(); + virtual base::Optional<std::vector<uint8_t>> SerializeToCBOR() const = 0; +}; + +} // namespace device + +#endif // DEVICE_CTAP_CTAP_REQUEST_PARAM_H_
diff --git a/device/ctap/ctap_request_unittest.cc b/device/ctap/ctap_request_unittest.cc new file mode 100644 index 0000000..b3cbd495 --- /dev/null +++ b/device/ctap/ctap_request_unittest.cc
@@ -0,0 +1,201 @@ +// Copyright 2017 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 "device/ctap/ctap_get_assertion_request_param.h" +#include "device/ctap/ctap_make_credential_request_param.h" +#include "device/ctap/ctap_request_param.h" +#include "testing/gmock/include/gmock/gmock.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace device { + +// Leveraging example 4 of section 6.1 of the spec +// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html +TEST(CTAPRequestTest, TestConstructMakeCredentialRequestParam) { + const std::vector<uint8_t> kClientDataHash = { + 0x68, 0x71, 0x34, 0x96, 0x82, 0x22, 0xec, 0x17, 0x20, 0x2e, 0x42, + 0x50, 0x5f, 0x8e, 0xd2, 0xb1, 0x6a, 0xe2, 0x2f, 0x16, 0xbb, 0x05, + 0xb8, 0x8c, 0x25, 0xdb, 0x9e, 0x60, 0x26, 0x45, 0xf1, 0x41}; + + const std::vector<uint8_t> kUserId = { + 0x30, 0x82, 0x01, 0x93, 0x30, 0x82, 0x01, 0x38, 0xa0, 0x03, 0x02, + 0x01, 0x02, 0x30, 0x82, 0x01, 0x93, 0x30, 0x82, 0x01, 0x38, 0xa0, + 0x03, 0x02, 0x01, 0x02, 0x30, 0x82, 0x01, 0x93, 0x30, 0x82}; + + const std::vector<uint8_t> kSerializedRequest = { + // clang format-off + 0x01, // authenticatorMakeCredential command + 0xa4, // map(4) + 0x01, // clientDataHash + 0x58, 0x20, // bytes(32) + 0x68, 0x71, 0x34, 0x96, 0x82, 0x22, 0xec, 0x17, 0x20, 0x2e, 0x42, 0x50, + 0x5f, 0x8e, 0xd2, 0xb1, 0x6a, 0xe2, 0x2f, 0x16, 0xbb, 0x05, 0xb8, 0x8c, + 0x25, 0xdb, 0x9e, 0x60, 0x26, 0x45, 0xf1, 0x41, + + 0x02, // unsigned(2) - rp + 0xa2, // map(2) + 0x62, // text(2) + 0x69, 0x64, // "id" + 0x68, // text(8) + // "acme.com" + 0x61, 0x63, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x64, // text(4) + 0x6e, 0x61, 0x6d, 0x65, // "name" + 0x64, // text(4) + 0x41, 0x63, 0x6d, 0x65, // "Acme" + + 0x03, // unsigned(3) - user + 0xa4, // map(4) + 0x62, // text(2) + 0x69, 0x64, // "id" + 0x58, 0x20, // bytes(32) - user id + 0x30, 0x82, 0x01, 0x93, 0x30, 0x82, 0x01, 0x38, 0xa0, 0x03, 0x02, 0x01, + 0x02, 0x30, 0x82, 0x01, 0x93, 0x30, 0x82, 0x01, 0x38, 0xa0, 0x03, 0x02, + 0x01, 0x02, 0x30, 0x82, 0x01, 0x93, 0x30, 0x82, + 0x64, // text(4) + 0x69, 0x63, 0x6f, 0x6e, // "icon" + 0x78, 0x28, // text(40) + // "https://pics.acme.com/00/p/aBjjjpqPb.png" + 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x70, 0x69, 0x63, 0x73, + 0x2e, 0x61, 0x63, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x30, + 0x2f, 0x70, 0x2f, 0x61, 0x42, 0x6a, 0x6a, 0x6a, 0x70, 0x71, 0x50, 0x62, + 0x2e, 0x70, 0x6e, 0x67, + 0x64, // text(4) + 0x6e, 0x61, 0x6d, 0x65, // "name" + 0x76, // text(22) + // "johnpsmith@example.com" + 0x6a, 0x6f, 0x68, 0x6e, 0x70, 0x73, 0x6d, 0x69, 0x74, 0x68, 0x40, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + 0x6b, // text(11) + // "displayName" + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, + 0x6d, // text(13) + // "John P. Smith" + 0x4a, 0x6f, 0x68, 0x6e, 0x20, 0x50, 0x2e, 0x20, 0x53, 0x6d, 0x69, 0x74, + 0x68, + + 0x04, // unsigned(4) - pubKeyCredParams + 0x82, // array(2) + 0xa2, // map(2) + 0x63, // text(3) + 0x61, 0x6c, 0x67, // "alg" + 0x07, // 7 + 0x64, // text(4) + 0x74, 0x79, 0x70, 0x65, // "type" + 0x6a, // text(10) + // "public-key" + 0x70, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x2D, 0x6B, 0x65, 0x79, + 0xa2, // map(2) + 0x63, // text(3) + 0x61, 0x6c, 0x67, // "alg" + 0x19, 0x01, 0x01, // 257 + 0x64, // text(4) + 0x74, 0x79, 0x70, 0x65, // "type" + 0x6a, // text(10) + // "public-key" + 0x70, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x2D, 0x6B, 0x65, 0x79 + // clang format-on + }; + + PublicKeyCredentialRPEntity rp("acme.com"); + rp.SetRPName("Acme"); + + PublicKeyCredentialUserEntity user(kUserId); + user.SetUserName("johnpsmith@example.com") + .SetDisplayName("John P. Smith") + .SetIconUrl(GURL("https://pics.acme.com/00/p/aBjjjpqPb.png")); + + CTAPMakeCredentialRequestParam make_credential_param( + kClientDataHash, std::move(rp), std::move(user), + PublicKeyCredentialParams({{"public-key", 7}, {"public-key", 257}})); + auto serialized_data = make_credential_param.SerializeToCBOR(); + ASSERT_TRUE(serialized_data); + EXPECT_THAT(*serialized_data, testing::ElementsAreArray(kSerializedRequest)); +} + +TEST(CTAPRequestTest, TestConstructGetAssertionRequest) { + const std::vector<uint8_t> kClientDataHash = { + 0x68, 0x71, 0x34, 0x96, 0x82, 0x22, 0xec, 0x17, 0x20, 0x2e, 0x42, + 0x50, 0x5f, 0x8e, 0xd2, 0xb1, 0x6a, 0xe2, 0x2f, 0x16, 0xbb, 0x05, + 0xb8, 0x8c, 0x25, 0xdb, 0x9e, 0x60, 0x26, 0x45, 0xf1, 0x41}; + + static const uint8_t kSerializedRequest[] = { + // clang format-off + 0x02, // authenticatorGetAssertion command + 0xa3, // map(3) + + 0x01, // rpId + 0x68, // text(8) + // "acme.com" + 0x61, 0x63, 0x6d, 0x65, 0x2e, 0x63, 0x6f, 0x6d, + + 0x02, // unsigned(2) - client data hash + 0x58, 0x20, // bytes(32) + 0x68, 0x71, 0x34, 0x96, 0x82, 0x22, 0xec, 0x17, 0x20, 0x2e, 0x42, 0x50, + 0x5f, 0x8e, 0xd2, 0xb1, 0x6a, 0xe2, 0x2f, 0x16, 0xbb, 0x05, 0xb8, 0x8c, + 0x25, 0xdb, 0x9e, 0x60, 0x26, 0x45, 0xf1, 0x41, + + 0x03, // unsigned(3) - allow list + 0x82, // array(2) + 0xa2, // map(2) + 0x62, // text(2) + 0x69, 0x64, // "id" + 0x58, 0x40, + // credential ID + 0xf2, 0x20, 0x06, 0xde, 0x4f, 0x90, 0x5a, 0xf6, 0x8a, 0x43, 0x94, 0x2f, + 0x02, 0x4f, 0x2a, 0x5e, 0xce, 0x60, 0x3d, 0x9c, 0x6d, 0x4b, 0x3d, 0xf8, + 0xbe, 0x08, 0xed, 0x01, 0xfc, 0x44, 0x26, 0x46, 0xd0, 0x34, 0x85, 0x8a, + 0xc7, 0x5b, 0xed, 0x3f, 0xd5, 0x80, 0xbf, 0x98, 0x08, 0xd9, 0x4f, 0xcb, + 0xee, 0x82, 0xb9, 0xb2, 0xef, 0x66, 0x77, 0xaf, 0x0a, 0xdc, 0xc3, 0x58, + 0x52, 0xea, 0x6b, 0x9e, + + 0x64, // text(4) + 0x74, 0x79, 0x70, 0x65, // "type" + 0x6a, // text(10) + // "public-key" + 0x70, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x2D, 0x6B, 0x65, 0x79, + 0xa2, // map(2) + 0x62, // text(2) + 0x69, 0x64, // "id" + 0x58, 0x32, // text(22) + // credential ID + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, + 0x64, // text(4) + 0x74, 0x79, 0x70, 0x65, // "type" + 0x6a, // text(10) + // "public-key" + 0x70, 0x75, 0x62, 0x6C, 0x69, 0x63, 0x2D, 0x6B, 0x65, 0x79, + // clang format-on + }; + + CTAPGetAssertionRequestParam get_assertion_req("acme.com", kClientDataHash); + std::vector<PublicKeyCredentialDescriptor> allowed_list; + allowed_list.push_back(PublicKeyCredentialDescriptor( + "public-key", + {0xf2, 0x20, 0x06, 0xde, 0x4f, 0x90, 0x5a, 0xf6, 0x8a, 0x43, 0x94, + 0x2f, 0x02, 0x4f, 0x2a, 0x5e, 0xce, 0x60, 0x3d, 0x9c, 0x6d, 0x4b, + 0x3d, 0xf8, 0xbe, 0x08, 0xed, 0x01, 0xfc, 0x44, 0x26, 0x46, 0xd0, + 0x34, 0x85, 0x8a, 0xc7, 0x5b, 0xed, 0x3f, 0xd5, 0x80, 0xbf, 0x98, + 0x08, 0xd9, 0x4f, 0xcb, 0xee, 0x82, 0xb9, 0xb2, 0xef, 0x66, 0x77, + 0xaf, 0x0a, 0xdc, 0xc3, 0x58, 0x52, 0xea, 0x6b, 0x9e})); + allowed_list.push_back(PublicKeyCredentialDescriptor( + "public-key", + {0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03})); + + get_assertion_req.SetAllowList(std::move(allowed_list)); + + auto serialized_data = get_assertion_req.SerializeToCBOR(); + ASSERT_TRUE(serialized_data); + EXPECT_THAT(*serialized_data, testing::ElementsAreArray(kSerializedRequest)); +} + +} // namespace device
diff --git a/device/ctap/ctap_response_code.h b/device/ctap/ctap_response_code.h new file mode 100644 index 0000000..f614b2b --- /dev/null +++ b/device/ctap/ctap_response_code.h
@@ -0,0 +1,71 @@ +// Copyright 2017 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 DEVICE_CTAP_CTAP_RESPONSE_CODE_H_ +#define DEVICE_CTAP_CTAP_RESPONSE_CODE_H_ + +#include <stdint.h> +#include <vector> + +namespace device { + +// CTAP protocol device response code, as specified in +// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#authenticator-api +enum class CTAPResponseCode : uint8_t { + kSuccess = 0x00, + kCtap1ErrInvalidCommand = 0x01, + kCtap1ErrInvalidParameter = 0x02, + kCtap1ErrInvalidLength = 0x03, + kCtap1ErrInvalidSeq = 0x04, + kCtap1ErrTimeout = 0x05, + kCtap1ErrChannelBusy = 0x06, + kCtap1ErrLockRequired = 0x0A, + kCtap1ErrInvalidChannel = 0x0B, + kCtap2ErrCBORParsing = 0x10, + kCtap2ErrUnexpectedType = 0x11, + kCtap2ErrInvalidCBOR = 0x12, + kCtap2ErrInvalidCBORType = 0x13, + kCtap2ErrMissingParameter = 0x14, + kCtap2ErrLimitExceeded = 0x15, + kCtap2ErrUnsupportedExtension = 0x16, + kCtap2ErrTooManyElements = 0x17, + kCtap2ErrExtensionNotSupported = 0x18, + kCtap2ErrCredentialExcluded = 0x19, + kCtap2ErrCredentialNotValid = 0x20, + kCtap2ErrProcesssing = 0x21, + kCtap2ErrInvalidCredential = 0x22, + kCtap2ErrUserActionPending = 0x23, + kCtap2ErrOperationPending = 0x24, + kCtap2ErrNoOperations = 0x25, + kCtap2ErrUnsupportedAlgorithms = 0x26, + kCtap2ErrOperationDenied = 0x27, + kCtap2ErrKeyStoreFull = 0x28, + kCtap2ErrNotBusy = 0x29, + kCtap2ErrNoOperationPending = 0x2A, + kCtap2ErrUnsupportedOption = 0x2B, + kCtap2ErrInvalidOption = 0x2C, + kCtap2ErrKeepAliveCancel = 0x2D, + kCtap2ErrNoCredentials = 0x2E, + kCtap2ErrUserActionTimeout = 0x2F, + kCtap2ErrNotAllowed = 0x30, + kCtap2ErrPinInvalid = 0x31, + kCtap2ErrPinBlocked = 0x32, + kCtap2ErrPinAuthInvalid = 0x33, + kCtap2ErrPinAuthBlocked = 0x34, + kCtap2ErrPinNotSet = 0x35, + kCtap2ErrPinRequired = 0x36, + kCtap2ErrPinPolicyViolation = 0x37, + kCtap2ErrPinTokenExpired = 0x38, + kCtap2ErrRequestTooLarge = 0x39, + kCtap2ErrOther = 0x7F, + kCtap2ErrSpecLast = 0xDF, + kCtap2ErrExtensionFirst = 0xE0, + kCtap2ErrExtensionLast = 0xEF, + kCtap2ErrVendorFirst = 0xF0, + kCtap2ErrVendorLast = 0xFF +}; + +} // namespace device + +#endif // DEVICE_CTAP_CTAP_RESPONSE_CODE_H_
diff --git a/device/ctap/public_key_credential_descriptor.cc b/device/ctap/public_key_credential_descriptor.cc new file mode 100644 index 0000000..f0e7408 --- /dev/null +++ b/device/ctap/public_key_credential_descriptor.cc
@@ -0,0 +1,67 @@ +// Copyright 2017 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 <utility> + +#include "device/ctap/public_key_credential_descriptor.h" + +namespace device { + +namespace { + +// Keys for storing credential descriptor information in CBOR map. +constexpr char kCredentialIdKey[] = "id"; +constexpr char kCredentialTypeKey[] = "type"; + +} // namespace + +// static +base::Optional<PublicKeyCredentialDescriptor> +PublicKeyCredentialDescriptor::CreateFromCBORValue( + const cbor::CBORValue& cbor) { + if (!cbor.is_map()) { + return base::nullopt; + } + + const cbor::CBORValue::MapValue& map = cbor.GetMap(); + auto type = map.find(cbor::CBORValue(kCredentialTypeKey)); + if (type == map.end() || !type->second.is_string()) + return base::nullopt; + + auto id = map.find(cbor::CBORValue(kCredentialIdKey)); + if (id == map.end() || !id->second.is_bytestring()) + return base::nullopt; + + return PublicKeyCredentialDescriptor(type->second.GetString(), + id->second.GetBytestring()); +} + +PublicKeyCredentialDescriptor::PublicKeyCredentialDescriptor( + std::string credential_type, + std::vector<uint8_t> id) + : credential_type_(std::move(credential_type)), id_(std::move(id)) {} + +PublicKeyCredentialDescriptor::PublicKeyCredentialDescriptor( + PublicKeyCredentialDescriptor&& other) = default; + +PublicKeyCredentialDescriptor::PublicKeyCredentialDescriptor( + const PublicKeyCredentialDescriptor& other) = default; + +PublicKeyCredentialDescriptor& PublicKeyCredentialDescriptor::operator=( + PublicKeyCredentialDescriptor&& other) = default; + +PublicKeyCredentialDescriptor& PublicKeyCredentialDescriptor::operator=( + const PublicKeyCredentialDescriptor& other) = default; + +PublicKeyCredentialDescriptor::~PublicKeyCredentialDescriptor() = default; + +cbor::CBORValue PublicKeyCredentialDescriptor::ConvertToCBOR() const { + cbor::CBORValue::MapValue cbor_descriptor_map; + cbor_descriptor_map[cbor::CBORValue(kCredentialIdKey)] = cbor::CBORValue(id_); + cbor_descriptor_map[cbor::CBORValue(kCredentialTypeKey)] = + cbor::CBORValue(credential_type_); + return cbor::CBORValue(std::move(cbor_descriptor_map)); +} + +} // namespace device
diff --git a/device/ctap/public_key_credential_descriptor.h b/device/ctap/public_key_credential_descriptor.h new file mode 100644 index 0000000..8148601 --- /dev/null +++ b/device/ctap/public_key_credential_descriptor.h
@@ -0,0 +1,48 @@ +// Copyright 2017 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 DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_DESCRIPTOR_H_ +#define DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_DESCRIPTOR_H_ + +#include <stdint.h> +#include <string> +#include <vector> + +#include "base/optional.h" +#include "components/cbor/cbor_values.h" + +namespace device { + +// Data structure containing public key credential type (string) and credential +// id (byte array) as specified in the CTAP spec. Used for exclude_list for +// AuthenticatorMakeCredential command and allow_list parameter for +// AuthenticatorGetAssertion command. +class PublicKeyCredentialDescriptor { + public: + static base::Optional<PublicKeyCredentialDescriptor> CreateFromCBORValue( + const cbor::CBORValue& cbor); + + PublicKeyCredentialDescriptor(std::string credential_type, + std::vector<uint8_t> id); + PublicKeyCredentialDescriptor(PublicKeyCredentialDescriptor&& other); + PublicKeyCredentialDescriptor(const PublicKeyCredentialDescriptor& other); + PublicKeyCredentialDescriptor& operator=( + PublicKeyCredentialDescriptor&& other); + PublicKeyCredentialDescriptor& operator=( + const PublicKeyCredentialDescriptor& other); + ~PublicKeyCredentialDescriptor(); + + cbor::CBORValue ConvertToCBOR() const; + + const std::string& credential_type() const { return credential_type_; } + const std::vector<uint8_t>& id() const { return id_; } + + private: + std::string credential_type_; + std::vector<uint8_t> id_; +}; + +} // namespace device + +#endif // DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_DESCRIPTOR_H_
diff --git a/device/ctap/public_key_credential_params.cc b/device/ctap/public_key_credential_params.cc new file mode 100644 index 0000000..02a6b40 --- /dev/null +++ b/device/ctap/public_key_credential_params.cc
@@ -0,0 +1,38 @@ +// Copyright 2017 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 "device/ctap/public_key_credential_params.h" + +#include <utility> + +namespace device { + +PublicKeyCredentialParams::PublicKeyCredentialParams( + std::vector<std::tuple<std::string, int>> credential_params) + : public_key_credential_params_(std::move(credential_params)) {} + +PublicKeyCredentialParams::PublicKeyCredentialParams( + PublicKeyCredentialParams&& other) = default; + +PublicKeyCredentialParams& PublicKeyCredentialParams::operator=( + PublicKeyCredentialParams&& other) = default; + +PublicKeyCredentialParams::~PublicKeyCredentialParams() = default; + +cbor::CBORValue PublicKeyCredentialParams::ConvertToCBOR() const { + cbor::CBORValue::ArrayValue credential_param_array; + credential_param_array.reserve(public_key_credential_params_.size()); + + for (const auto& credential : public_key_credential_params_) { + cbor::CBORValue::MapValue cbor_credential_map; + cbor_credential_map[cbor::CBORValue("type")] = + cbor::CBORValue(std::get<0>(credential)); + cbor_credential_map[cbor::CBORValue("alg")] = + cbor::CBORValue(std::get<1>(credential)); + credential_param_array.emplace_back(std::move(cbor_credential_map)); + } + return cbor::CBORValue(std::move(credential_param_array)); +} + +} // namespace device
diff --git a/device/ctap/public_key_credential_params.h b/device/ctap/public_key_credential_params.h new file mode 100644 index 0000000..89d70b7 --- /dev/null +++ b/device/ctap/public_key_credential_params.h
@@ -0,0 +1,37 @@ +// Copyright 2017 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 DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_PARAMS_H_ +#define DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_PARAMS_H_ + +#include <string> +#include <tuple> +#include <vector> + +#include "components/cbor/cbor_values.h" + +namespace device { + +// Data structure containing public key credential type(string) and +// cryptographic algorithm(integer) as specified by the CTAP spec. Used as a +// request parameter for AuthenticatorMakeCredential. +class PublicKeyCredentialParams { + public: + explicit PublicKeyCredentialParams( + std::vector<std::tuple<std::string, int>> credential_params); + PublicKeyCredentialParams(PublicKeyCredentialParams&& other); + PublicKeyCredentialParams& operator=(PublicKeyCredentialParams&& other); + ~PublicKeyCredentialParams(); + + cbor::CBORValue ConvertToCBOR() const; + + private: + std::vector<std::tuple<std::string, int>> public_key_credential_params_; + + DISALLOW_COPY_AND_ASSIGN(PublicKeyCredentialParams); +}; + +} // namespace device + +#endif // DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_PARAMS_H_
diff --git a/device/ctap/public_key_credential_rp_entity.cc b/device/ctap/public_key_credential_rp_entity.cc new file mode 100644 index 0000000..e8428471 --- /dev/null +++ b/device/ctap/public_key_credential_rp_entity.cc
@@ -0,0 +1,44 @@ +// Copyright 2017 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 "device/ctap/public_key_credential_rp_entity.h" + +#include <utility> + +namespace device { + +PublicKeyCredentialRPEntity::PublicKeyCredentialRPEntity(std::string rp_id) + : rp_id_(std::move(rp_id)) {} + +PublicKeyCredentialRPEntity::PublicKeyCredentialRPEntity( + PublicKeyCredentialRPEntity&& other) = default; + +PublicKeyCredentialRPEntity& PublicKeyCredentialRPEntity::operator=( + PublicKeyCredentialRPEntity&& other) = default; + +PublicKeyCredentialRPEntity::~PublicKeyCredentialRPEntity() = default; + +PublicKeyCredentialRPEntity& PublicKeyCredentialRPEntity::SetRPName( + std::string rp_name) { + rp_name_ = std::move(rp_name); + return *this; +} + +PublicKeyCredentialRPEntity& PublicKeyCredentialRPEntity::SetRPIconUrl( + GURL icon_url) { + rp_icon_url_ = std::move(icon_url); + return *this; +} + +cbor::CBORValue PublicKeyCredentialRPEntity::ConvertToCBOR() const { + cbor::CBORValue::MapValue rp_map; + rp_map[cbor::CBORValue("id")] = cbor::CBORValue(rp_id_); + if (rp_name_) + rp_map[cbor::CBORValue("name")] = cbor::CBORValue(*rp_name_); + if (rp_icon_url_) + rp_map[cbor::CBORValue("icon")] = cbor::CBORValue(rp_icon_url_->spec()); + return cbor::CBORValue(std::move(rp_map)); +} + +} // namespace device
diff --git a/device/ctap/public_key_credential_rp_entity.h b/device/ctap/public_key_credential_rp_entity.h new file mode 100644 index 0000000..5f0470a --- /dev/null +++ b/device/ctap/public_key_credential_rp_entity.h
@@ -0,0 +1,41 @@ +// Copyright 2017 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 DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_RP_ENTITY_H_ +#define DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_RP_ENTITY_H_ + +#include <string> +#include <vector> + +#include "base/optional.h" +#include "components/cbor/cbor_values.h" +#include "url/gurl.h" + +namespace device { + +// Data structure containing information about relying party that invoked +// WebAuth API. Includes a relying party id, an optional relying party name,, +// and optional relying party display image url. +class PublicKeyCredentialRPEntity { + public: + explicit PublicKeyCredentialRPEntity(std::string rp_id); + PublicKeyCredentialRPEntity(PublicKeyCredentialRPEntity&& other); + PublicKeyCredentialRPEntity& operator=(PublicKeyCredentialRPEntity&& other); + ~PublicKeyCredentialRPEntity(); + + PublicKeyCredentialRPEntity& SetRPName(std::string rp_name); + PublicKeyCredentialRPEntity& SetRPIconUrl(GURL icon_url); + cbor::CBORValue ConvertToCBOR() const; + + private: + std::string rp_id_; + base::Optional<std::string> rp_name_; + base::Optional<GURL> rp_icon_url_; + + DISALLOW_COPY_AND_ASSIGN(PublicKeyCredentialRPEntity); +}; + +} // namespace device + +#endif // DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_RP_ENTITY_H_
diff --git a/device/ctap/public_key_credential_user_entity.cc b/device/ctap/public_key_credential_user_entity.cc new file mode 100644 index 0000000..f6ec056 --- /dev/null +++ b/device/ctap/public_key_credential_user_entity.cc
@@ -0,0 +1,106 @@ +// Copyright 2017 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 "device/ctap/public_key_credential_user_entity.h" + +#include <utility> + +namespace device { + +namespace { + +// Keys for storing user entity information in CBOR map. +constexpr char kUserIdKey[] = "id"; +constexpr char kUserNameKey[] = "name"; +constexpr char kUserDisplayNameKey[] = "displayName"; +constexpr char kUserIconUrlKey[] = "icon"; + +} // namespace + +// static +base::Optional<PublicKeyCredentialUserEntity> +PublicKeyCredentialUserEntity::CreateFromCBORValue( + const cbor::CBORValue& cbor) { + if (!cbor.is_map()) + return base::nullopt; + + const cbor::CBORValue::MapValue& cbor_map = cbor.GetMap(); + + auto user_id = cbor_map.find(cbor::CBORValue(kUserIdKey)); + if (user_id == cbor_map.end() || !user_id->second.is_bytestring()) + return base::nullopt; + + PublicKeyCredentialUserEntity user(user_id->second.GetBytestring()); + + auto user_name = cbor_map.find(cbor::CBORValue(kUserNameKey)); + if (user_name != cbor_map.end() && user_name->second.is_string()) { + user.SetUserName(user_name->second.GetString()); + } + + auto user_display_name = cbor_map.find(cbor::CBORValue(kUserDisplayNameKey)); + if (user_display_name != cbor_map.end() && + user_display_name->second.is_string()) { + user.SetDisplayName(user_display_name->second.GetString()); + } + + auto user_icon_url = cbor_map.find(cbor::CBORValue(kUserIconUrlKey)); + if (user_icon_url != cbor_map.end() && user_icon_url->second.is_string()) { + user.SetIconUrl(GURL(user_icon_url->second.GetString())); + } + + return user; +} + +PublicKeyCredentialUserEntity::PublicKeyCredentialUserEntity( + std::vector<uint8_t> user_id) + : user_id_(std::move(user_id)) {} + +PublicKeyCredentialUserEntity::PublicKeyCredentialUserEntity( + PublicKeyCredentialUserEntity&& other) = default; + +PublicKeyCredentialUserEntity::PublicKeyCredentialUserEntity( + const PublicKeyCredentialUserEntity& other) = default; + +PublicKeyCredentialUserEntity& PublicKeyCredentialUserEntity::operator=( + PublicKeyCredentialUserEntity&& other) = default; + +PublicKeyCredentialUserEntity& PublicKeyCredentialUserEntity::operator=( + const PublicKeyCredentialUserEntity& other) = default; + +PublicKeyCredentialUserEntity::~PublicKeyCredentialUserEntity() = default; + +cbor::CBORValue PublicKeyCredentialUserEntity::ConvertToCBOR() const { + cbor::CBORValue::MapValue user_map; + user_map[cbor::CBORValue(kUserIdKey)] = cbor::CBORValue(user_id_); + if (user_name_) + user_map[cbor::CBORValue(kUserNameKey)] = cbor::CBORValue(*user_name_); + if (user_icon_url_) + user_map[cbor::CBORValue(kUserIconUrlKey)] = + cbor::CBORValue(user_icon_url_->spec()); + if (user_display_name_) { + user_map[cbor::CBORValue(kUserDisplayNameKey)] = + cbor::CBORValue(*user_display_name_); + } + return cbor::CBORValue(std::move(user_map)); +} + +PublicKeyCredentialUserEntity& PublicKeyCredentialUserEntity::SetUserName( + std::string user_name) { + user_name_ = std::move(user_name); + return *this; +} + +PublicKeyCredentialUserEntity& PublicKeyCredentialUserEntity::SetDisplayName( + std::string user_display_name) { + user_display_name_ = std::move(user_display_name); + return *this; +} + +PublicKeyCredentialUserEntity& PublicKeyCredentialUserEntity::SetIconUrl( + GURL icon_url) { + user_icon_url_ = std::move(icon_url); + return *this; +} + +} // namespace device
diff --git a/device/ctap/public_key_credential_user_entity.h b/device/ctap/public_key_credential_user_entity.h new file mode 100644 index 0000000..6606e256 --- /dev/null +++ b/device/ctap/public_key_credential_user_entity.h
@@ -0,0 +1,57 @@ +// Copyright 2017 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 DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_USER_ENTITY_H_ +#define DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_USER_ENTITY_H_ + +#include <stdint.h> +#include <string> +#include <vector> + +#include "base/optional.h" +#include "components/cbor/cbor_values.h" +#include "url/gurl.h" + +namespace device { + +// Data structure containing a user id, an optional user name, an optional user +// display image url, and an optional user display name as specified by the CTAP +// spec. Used as required parameter type for AuthenticatorMakeCredential +// request. +class PublicKeyCredentialUserEntity { + public: + static base::Optional<PublicKeyCredentialUserEntity> CreateFromCBORValue( + const cbor::CBORValue& cbor); + + explicit PublicKeyCredentialUserEntity(std::vector<uint8_t> user_id); + PublicKeyCredentialUserEntity(PublicKeyCredentialUserEntity&& other); + PublicKeyCredentialUserEntity(const PublicKeyCredentialUserEntity& other); + PublicKeyCredentialUserEntity& operator=( + PublicKeyCredentialUserEntity&& other); + PublicKeyCredentialUserEntity& operator=( + const PublicKeyCredentialUserEntity& other); + ~PublicKeyCredentialUserEntity(); + + cbor::CBORValue ConvertToCBOR() const; + PublicKeyCredentialUserEntity& SetUserName(std::string user_name); + PublicKeyCredentialUserEntity& SetDisplayName(std::string display_name); + PublicKeyCredentialUserEntity& SetIconUrl(GURL icon_url); + + const std::vector<uint8_t>& user_id() const { return user_id_; } + const base::Optional<std::string>& user_name() const { return user_name_; } + const base::Optional<std::string>& user_display_name() const { + return user_display_name_; + } + const base::Optional<GURL>& user_icon_url() const { return user_icon_url_; } + + private: + std::vector<uint8_t> user_id_; + base::Optional<std::string> user_name_; + base::Optional<std::string> user_display_name_; + base::Optional<GURL> user_icon_url_; +}; + +} // namespace device + +#endif // DEVICE_CTAP_PUBLIC_KEY_CREDENTIAL_USER_ENTITY_H_
diff --git a/device/geolocation/location_arbitrator.cc b/device/geolocation/location_arbitrator.cc index 4b8e546..fa0ffb01 100644 --- a/device/geolocation/location_arbitrator.cc +++ b/device/geolocation/location_arbitrator.cc
@@ -14,7 +14,6 @@ #include "build/build_config.h" #include "device/geolocation/network_location_provider.h" #include "device/geolocation/public/cpp/geoposition.h" -#include "device/geolocation/wifi_polling_policy.h" namespace device { @@ -34,12 +33,7 @@ is_permission_granted_(false), is_running_(false) {} -LocationArbitrator::~LocationArbitrator() { - // Destroy the global WifiPollingPolicy. The policy is created and used by the - // network location provider but should be retained across network provider - // restarts to ensure the time of the most recent WiFi scan is not lost. - WifiPollingPolicy::Shutdown(); -} +LocationArbitrator::~LocationArbitrator() = default; bool LocationArbitrator::HasPermissionBeenGrantedForTest() const { return is_permission_granted_;
diff --git a/device/geolocation/wifi_polling_policy.cc b/device/geolocation/wifi_polling_policy.cc index 6cd52bbc..01deed3 100644 --- a/device/geolocation/wifi_polling_policy.cc +++ b/device/geolocation/wifi_polling_policy.cc
@@ -7,11 +7,13 @@ namespace device { namespace { +// Leaks at exit. WifiPollingPolicy* g_wifi_polling_policy; } // namespace // static void WifiPollingPolicy::Initialize(std::unique_ptr<WifiPollingPolicy> policy) { + DCHECK(!g_wifi_polling_policy); g_wifi_polling_policy = policy.release(); }
diff --git a/device/u2f/BUILD.gn b/device/u2f/BUILD.gn index 6213b36..07b8811 100644 --- a/device/u2f/BUILD.gn +++ b/device/u2f/BUILD.gn
@@ -7,6 +7,22 @@ source_set("u2f") { sources = [ + "attestation_object.cc", + "attestation_object.h", + "attestation_statement.cc", + "attestation_statement.h", + "attested_credential_data.cc", + "attested_credential_data.h", + "authenticator_data.cc", + "authenticator_data.h", + "ec_public_key.cc", + "ec_public_key.h", + "fido_attestation_statement.cc", + "fido_attestation_statement.h", + "public_key.cc", + "public_key.h", + "register_response_data.cc", + "register_response_data.h", "u2f_apdu_command.cc", "u2f_apdu_command.h", "u2f_apdu_response.cc", @@ -32,6 +48,8 @@ "u2f_message.h", "u2f_packet.cc", "u2f_packet.h", + "u2f_parsing_utils.cc", + "u2f_parsing_utils.h", "u2f_register.cc", "u2f_register.h", "u2f_request.cc", @@ -43,6 +61,7 @@ deps = [ "//base", + "//components/cbor", "//crypto", "//device/base", "//device/bluetooth", @@ -50,6 +69,7 @@ "//services/device/public/interfaces", "//services/service_manager/public/cpp", "//services/service_manager/public/interfaces", + "//third_party/boringssl", ] # HID is not supported on Android.
diff --git a/device/u2f/DEPS b/device/u2f/DEPS index 30b2f1c..7f30d6c 100644 --- a/device/u2f/DEPS +++ b/device/u2f/DEPS
@@ -1,4 +1,6 @@ include_rules = [ + "+components/cbor", "+crypto", "+net/base", + "+third_party/boringssl/src/include", ]
diff --git a/device/u2f/attestation_object.cc b/device/u2f/attestation_object.cc new file mode 100644 index 0000000..b7ea781 --- /dev/null +++ b/device/u2f/attestation_object.cc
@@ -0,0 +1,45 @@ +// Copyright 2017 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 "device/u2f/attestation_object.h" + +#include <utility> + +#include "components/cbor/cbor_values.h" +#include "components/cbor/cbor_writer.h" +#include "device/u2f/attestation_statement.h" + +namespace device { + +namespace { +constexpr char kAuthDataKey[] = "authData"; +constexpr char kFormatKey[] = "fmt"; +constexpr char kAttestationKey[] = "attStmt"; +} // namespace + +AttestationObject::AttestationObject( + AuthenticatorData data, + std::unique_ptr<AttestationStatement> statement) + : authenticator_data_(std::move(data)), + attestation_statement_(std::move(statement)) {} + +AttestationObject::AttestationObject(AttestationObject&& other) = default; +AttestationObject& AttestationObject::operator=(AttestationObject&& other) = + default; + +AttestationObject::~AttestationObject() = default; + +std::vector<uint8_t> AttestationObject::SerializeToCBOREncodedBytes() const { + cbor::CBORValue::MapValue map; + map[cbor::CBORValue(kFormatKey)] = + cbor::CBORValue(attestation_statement_->format_name()); + map[cbor::CBORValue(kAuthDataKey)] = + cbor::CBORValue(authenticator_data_.SerializeToByteArray()); + map[cbor::CBORValue(kAttestationKey)] = + cbor::CBORValue(attestation_statement_->GetAsCBORMap()); + return cbor::CBORWriter::Write(cbor::CBORValue(std::move(map))) + .value_or(std::vector<uint8_t>()); +} + +} // namespace device
diff --git a/device/u2f/attestation_object.h b/device/u2f/attestation_object.h new file mode 100644 index 0000000..e711a8f --- /dev/null +++ b/device/u2f/attestation_object.h
@@ -0,0 +1,48 @@ +// Copyright 2017 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 DEVICE_U2F_ATTESTATION_OBJECT_H_ +#define DEVICE_U2F_ATTESTATION_OBJECT_H_ + +#include <stdint.h> +#include <memory> +#include <vector> + +#include "base/macros.h" +#include "device/u2f/authenticator_data.h" + +namespace device { + +class AttestationStatement; + +// Object containing the authenticator-provided attestation every time +// a credential is created, per +// https://www.w3.org/TR/2017/WD-webauthn-20170505/#cred-attestation. +class AttestationObject { + public: + AttestationObject(AuthenticatorData data, + std::unique_ptr<AttestationStatement> statement); + + // Moveable. + AttestationObject(AttestationObject&& other); + AttestationObject& operator=(AttestationObject&& other); + + ~AttestationObject(); + + // Produces a CBOR-encoded byte-array in the following format: + // {"authData": authenticator data bytes, + // "fmt": attestation format name, + // "attStmt": attestation statement bytes } + std::vector<uint8_t> SerializeToCBOREncodedBytes() const; + + private: + AuthenticatorData authenticator_data_; + std::unique_ptr<AttestationStatement> attestation_statement_; + + DISALLOW_COPY_AND_ASSIGN(AttestationObject); +}; + +} // namespace device + +#endif // DEVICE_U2F_ATTESTATION_OBJECT_H_
diff --git a/content/browser/webauth/attestation_statement.cc b/device/u2f/attestation_statement.cc similarity index 66% rename from content/browser/webauth/attestation_statement.cc rename to device/u2f/attestation_statement.cc index c677322..378398fb 100644 --- a/content/browser/webauth/attestation_statement.cc +++ b/device/u2f/attestation_statement.cc
@@ -2,16 +2,16 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/webauth/attestation_statement.h" +#include "device/u2f/attestation_statement.h" #include <string> #include <utility> -namespace content { +namespace device { + +AttestationStatement::~AttestationStatement() = default; AttestationStatement::AttestationStatement(std::string format) : format_(std::move(format)) {} -AttestationStatement::~AttestationStatement() {} - -} // namespace content +} // namespace device
diff --git a/content/browser/webauth/attestation_statement.h b/device/u2f/attestation_statement.h similarity index 85% rename from content/browser/webauth/attestation_statement.h rename to device/u2f/attestation_statement.h index 01f22108..33e25d2 100644 --- a/content/browser/webauth/attestation_statement.h +++ b/device/u2f/attestation_statement.h
@@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_WEBAUTH_ATTESTATION_STATEMENT_H_ -#define CONTENT_BROWSER_WEBAUTH_ATTESTATION_STATEMENT_H_ +#ifndef DEVICE_U2F_ATTESTATION_STATEMENT_H_ +#define DEVICE_U2F_ATTESTATION_STATEMENT_H_ #include "base/macros.h" #include "components/cbor/cbor_values.h" -namespace content { +namespace device { // A signed data object containing statements about a credential itself and // the authenticator that created it. @@ -39,6 +39,6 @@ DISALLOW_COPY_AND_ASSIGN(AttestationStatement); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_WEBAUTH_ATTESTATION_STATEMENT_H_ +#endif // DEVICE_U2F_ATTESTATION_STATEMENT_H_
diff --git a/device/u2f/attested_credential_data.cc b/device/u2f/attested_credential_data.cc new file mode 100644 index 0000000..ad80a5c --- /dev/null +++ b/device/u2f/attested_credential_data.cc
@@ -0,0 +1,68 @@ +// Copyright 2017 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 "device/u2f/attested_credential_data.h" + +#include <utility> + +#include "base/numerics/safe_math.h" +#include "device/u2f/public_key.h" +#include "device/u2f/u2f_parsing_utils.h" + +namespace device { + +// static +AttestedCredentialData AttestedCredentialData::CreateFromU2fRegisterResponse( + base::span<const uint8_t> u2f_data, + std::vector<uint8_t> aaguid, + std::unique_ptr<PublicKey> public_key) { + // TODO(crbug/799075): Introduce a CredentialID class to do this extraction. + // Extract the length of the credential (i.e. of the U2FResponse key + // handle). Length is big endian. + std::vector<uint8_t> credential_id_length(2); + std::vector<uint8_t> extracted_length = u2f_parsing_utils::Extract( + u2f_data, u2f_parsing_utils::kU2fResponseKeyHandleLengthPos, 1); + + // Note that U2F responses only use one byte for length. + credential_id_length[1] = extracted_length[0]; + + // Extract the credential id (i.e. key handle). + std::vector<uint8_t> credential_id = u2f_parsing_utils::Extract( + u2f_data, u2f_parsing_utils::kU2fResponseKeyHandleStartPos, + base::strict_cast<size_t>(credential_id_length[1])); + + return AttestedCredentialData( + std::move(aaguid), std::move(credential_id_length), + std::move(credential_id), std::move(public_key)); +} + +AttestedCredentialData::AttestedCredentialData( + std::vector<uint8_t> aaguid, + std::vector<uint8_t> length, + std::vector<uint8_t> credential_id, + std::unique_ptr<PublicKey> public_key) + : aaguid_(std::move(aaguid)), + credential_id_length_(std::move(length)), + credential_id_(std::move(credential_id)), + public_key_(std::move(public_key)) {} + +AttestedCredentialData::AttestedCredentialData(AttestedCredentialData&& other) = + default; + +AttestedCredentialData& AttestedCredentialData::operator=( + AttestedCredentialData&& other) = default; + +AttestedCredentialData::~AttestedCredentialData() = default; + +std::vector<uint8_t> AttestedCredentialData::SerializeAsBytes() const { + std::vector<uint8_t> attestation_data; + std::vector<uint8_t> cbor_encoded_key = public_key_->EncodeAsCBOR(); + u2f_parsing_utils::Append(&attestation_data, aaguid_); + u2f_parsing_utils::Append(&attestation_data, credential_id_length_); + u2f_parsing_utils::Append(&attestation_data, credential_id_); + u2f_parsing_utils::Append(&attestation_data, std::move(cbor_encoded_key)); + return attestation_data; +} + +} // namespace device
diff --git a/device/u2f/attested_credential_data.h b/device/u2f/attested_credential_data.h new file mode 100644 index 0000000..094c135a --- /dev/null +++ b/device/u2f/attested_credential_data.h
@@ -0,0 +1,61 @@ +// Copyright 2017 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 DEVICE_U2F_ATTESTED_CREDENTIAL_DATA_H_ +#define DEVICE_U2F_ATTESTED_CREDENTIAL_DATA_H_ + +#include <stdint.h> +#include <memory> +#include <vector> + +#include "base/containers/span.h" +#include "base/macros.h" + +namespace device { + +class PublicKey; + +// https://www.w3.org/TR/2017/WD-webauthn-20170505/#sec-attestation-data +class AttestedCredentialData { + public: + static AttestedCredentialData CreateFromU2fRegisterResponse( + base::span<const uint8_t> u2f_data, + std::vector<uint8_t> aaguid, + std::unique_ptr<PublicKey> public_key); + + AttestedCredentialData(std::vector<uint8_t> aaguid, + std::vector<uint8_t> length, + std::vector<uint8_t> credential_id, + std::unique_ptr<PublicKey> public_key); + + // Moveable. + AttestedCredentialData(AttestedCredentialData&& other); + AttestedCredentialData& operator=(AttestedCredentialData&& other); + + ~AttestedCredentialData(); + + const std::vector<uint8_t>& credential_id() { return credential_id_; } + + // Produces a byte array consisting of: + // * AAGUID (16 bytes) + // * Len (2 bytes) + // * Credential Id (Len bytes) + // * Credential Public Key. + std::vector<uint8_t> SerializeAsBytes() const; + + private: + // The 16-byte AAGUID of the authenticator. + std::vector<uint8_t> aaguid_; + + // Big-endian length of the credential (i.e. key handle). + std::vector<uint8_t> credential_id_length_; + std::vector<uint8_t> credential_id_; + std::unique_ptr<PublicKey> public_key_; + + DISALLOW_COPY_AND_ASSIGN(AttestedCredentialData); +}; + +} // namespace device + +#endif // DEVICE_U2F_ATTESTED_CREDENTIAL_DATA_H_
diff --git a/device/u2f/authenticator_data.cc b/device/u2f/authenticator_data.cc new file mode 100644 index 0000000..67c32dc --- /dev/null +++ b/device/u2f/authenticator_data.cc
@@ -0,0 +1,55 @@ +// Copyright 2017 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 "device/u2f/authenticator_data.h" + +#include <utility> + +#include "crypto/sha2.h" +#include "device/u2f/u2f_parsing_utils.h" + +namespace device { + +// static +AuthenticatorData AuthenticatorData::Create(std::string relying_party_id, + uint8_t flags, + std::vector<uint8_t> counter, + AttestedCredentialData data) { + return AuthenticatorData(std::move(relying_party_id), flags, + std::move(counter), std::move(data)); +} + +AuthenticatorData::AuthenticatorData(std::string relying_party_id, + uint8_t flags, + std::vector<uint8_t> counter, + AttestedCredentialData data) + : relying_party_id_(std::move(relying_party_id)), + flags_(flags), + counter_(std::move(counter)), + attested_data_(std::move(data)) { + // TODO(kpaulhamus): use std::array for these small, fixed-sized vectors. + CHECK_EQ(counter_.size(), 4u); +} + +AuthenticatorData::AuthenticatorData(AuthenticatorData&& other) = default; +AuthenticatorData& AuthenticatorData::operator=(AuthenticatorData&& other) = + default; + +AuthenticatorData::~AuthenticatorData() = default; + +std::vector<uint8_t> AuthenticatorData::SerializeToByteArray() const { + std::vector<uint8_t> authenticator_data; + std::vector<uint8_t> rp_id_hash(crypto::kSHA256Length); + crypto::SHA256HashString(relying_party_id_, rp_id_hash.data(), + rp_id_hash.size()); + u2f_parsing_utils::Append(&authenticator_data, rp_id_hash); + authenticator_data.insert(authenticator_data.end(), flags_); + u2f_parsing_utils::Append(&authenticator_data, counter_); + std::vector<uint8_t> attestation_bytes = attested_data_.SerializeAsBytes(); + u2f_parsing_utils::Append(&authenticator_data, attestation_bytes); + + return authenticator_data; +} + +} // namespace device
diff --git a/device/u2f/authenticator_data.h b/device/u2f/authenticator_data.h new file mode 100644 index 0000000..b39061d --- /dev/null +++ b/device/u2f/authenticator_data.h
@@ -0,0 +1,70 @@ +// Copyright 2017 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 DEVICE_U2F_AUTHENTICATOR_DATA_H_ +#define DEVICE_U2F_AUTHENTICATOR_DATA_H_ + +#include <stdint.h> +#include <string> +#include <vector> + +#include "base/macros.h" +#include "device/u2f/attested_credential_data.h" + +namespace device { + +// https://www.w3.org/TR/2017/WD-webauthn-20170505/#sec-authenticator-data. +class AuthenticatorData { + public: + enum class Flag : uint8_t { + kTestOfUserPresence = 1u << 0, + kAttestation = 1u << 6 + }; + + static AuthenticatorData Create(std::string relying_party_id, + uint8_t flags, + std::vector<uint8_t> counter, + AttestedCredentialData data); + + AuthenticatorData(std::string relying_party_id, + uint8_t flags, + std::vector<uint8_t> counter, + AttestedCredentialData data); + + // Moveable. + AuthenticatorData(AuthenticatorData&& other); + AuthenticatorData& operator=(AuthenticatorData&& other); + + ~AuthenticatorData(); + + // Produces a byte array consisting of: + // * hash(relying_party_id) + // * flags + // * counter + // * attestation_data. + std::vector<uint8_t> SerializeToByteArray() const; + + private: + // RP ID associated with the credential + std::string relying_party_id_; + + // Flags (bit 0 is the least significant bit): + // [ED | AT | RFU | RFU | RFU | RFU | RFU | UP ] + // * Bit 0: Test of User Presence (TUP) result. + // * Bits 1-5: Reserved for future use (RFU). + // * Bit 6: Attestation data included (AT). + // * Bit 7: Extension data included (ED). + uint8_t flags_; + + // Signature counter, 32-bit unsigned big-endian integer. + std::vector<uint8_t> counter_; + + AttestedCredentialData attested_data_; + + DISALLOW_COPY_AND_ASSIGN(AuthenticatorData); +}; + +} // namespace device + +#endif // DEVICE_U2F_AUTHENTICATOR_DATA_H_
diff --git a/device/u2f/ec_public_key.cc b/device/u2f/ec_public_key.cc new file mode 100644 index 0000000..591129d4 --- /dev/null +++ b/device/u2f/ec_public_key.cc
@@ -0,0 +1,57 @@ +// Copyright 2017 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 "device/u2f/ec_public_key.h" + +#include <utility> + +#include "components/cbor/cbor_writer.h" +#include "device/u2f/u2f_parsing_utils.h" + +namespace device { + +namespace { +// The key is located after the first byte of the response +// (which is a reserved byte). +// The uncompressed form consists of 65 bytes: +// - a constant 0x04 prefix +// - the 32-byte x coordinate +// - the 32-byte y coordinate. +constexpr size_t kHeaderLength = 2; // Account for reserved byte and prefix. +constexpr size_t kKeyLength = 32; +} // namespace + +// static +std::unique_ptr<ECPublicKey> ECPublicKey::ExtractFromU2fRegistrationResponse( + std::string algorithm, + base::span<const uint8_t> u2f_data) { + std::vector<uint8_t> x = + u2f_parsing_utils::Extract(u2f_data, kHeaderLength, kKeyLength); + std::vector<uint8_t> y = u2f_parsing_utils::Extract( + u2f_data, kHeaderLength + kKeyLength, kKeyLength); + return std::make_unique<ECPublicKey>(std::move(algorithm), std::move(x), + std::move(y)); +} + +ECPublicKey::ECPublicKey(std::string algorithm, + std::vector<uint8_t> x, + std::vector<uint8_t> y) + : PublicKey(std::move(algorithm)), + x_coordinate_(std::move(x)), + y_coordinate_(std::move(y)) { + DCHECK_EQ(x_coordinate_.size(), kKeyLength); + DCHECK_EQ(y_coordinate_.size(), kKeyLength); +} + +ECPublicKey::~ECPublicKey() = default; + +std::vector<uint8_t> ECPublicKey::EncodeAsCBOR() const { + cbor::CBORValue::MapValue map; + map[cbor::CBORValue("alg")] = cbor::CBORValue(algorithm_); + map[cbor::CBORValue("x")] = cbor::CBORValue(x_coordinate_); + map[cbor::CBORValue("y")] = cbor::CBORValue(y_coordinate_); + return *cbor::CBORWriter::Write(cbor::CBORValue(std::move(map))); +} + +} // namespace device
diff --git a/content/browser/webauth/ec_public_key.h b/device/u2f/ec_public_key.h similarity index 68% rename from content/browser/webauth/ec_public_key.h rename to device/u2f/ec_public_key.h index 45b1ffb..649c310 100644 --- a/content/browser/webauth/ec_public_key.h +++ b/device/u2f/ec_public_key.h
@@ -2,39 +2,39 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_WEBAUTH_EC_PUBLIC_KEY_H_ -#define CONTENT_BROWSER_WEBAUTH_EC_PUBLIC_KEY_H_ +#ifndef DEVICE_U2F_EC_PUBLIC_KEY_H_ +#define DEVICE_U2F_EC_PUBLIC_KEY_H_ #include <stdint.h> #include <memory> #include <string> #include <vector> +#include "base/containers/span.h" #include "base/macros.h" -#include "content/browser/webauth/public_key.h" -#include "content/common/content_export.h" +#include "device/u2f/public_key.h" -namespace content { +namespace device { // An uncompressed ECPublicKey consisting of 64 bytes: // - the 32-byte x coordinate // - the 32-byte y coordinate. -class CONTENT_EXPORT ECPublicKey : public PublicKey { +class ECPublicKey : public PublicKey { public: + static std::unique_ptr<ECPublicKey> ExtractFromU2fRegistrationResponse( + std::string algorithm, + base::span<const uint8_t> u2f_data); + ECPublicKey(std::string algorithm, std::vector<uint8_t> x, std::vector<uint8_t> y); ~ECPublicKey() override; - static std::unique_ptr<ECPublicKey> ExtractFromU2fRegistrationResponse( - std::string algorithm, - const std::vector<uint8_t>& u2f_data); - // Produces a CBOR-encoded public key encoded in the following format: // { alg: eccAlgName, x: biguint, y: biguint } // where eccAlgName = "ES256" / "ES384" / "ES512" - std::vector<uint8_t> EncodeAsCBOR() override; + std::vector<uint8_t> EncodeAsCBOR() const override; private: const std::vector<uint8_t> x_coordinate_; @@ -43,6 +43,6 @@ DISALLOW_COPY_AND_ASSIGN(ECPublicKey); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_WEBAUTH_EC_PUBLIC_KEY_H_ +#endif // DEVICE_U2F_EC_PUBLIC_KEY_H_
diff --git a/content/browser/webauth/fido_attestation_statement.cc b/device/u2f/fido_attestation_statement.cc similarity index 66% rename from content/browser/webauth/fido_attestation_statement.cc rename to device/u2f/fido_attestation_statement.cc index 21333ad..3e0e3ad 100644 --- a/content/browser/webauth/fido_attestation_statement.cc +++ b/device/u2f/fido_attestation_statement.cc
@@ -2,16 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/webauth/fido_attestation_statement.h" +#include "device/u2f/fido_attestation_statement.h" #include <utility> -#include "base/numerics/safe_conversions.h" -#include "components/cbor/cbor_writer.h" -#include "content/browser/webauth/authenticator_utils.h" +#include "device/u2f/u2f_parsing_utils.h" #include "third_party/boringssl/src/include/openssl/bytestring.h" -namespace content { +namespace device { namespace { constexpr char kFidoFormatName[] = "fido-u2f"; @@ -22,15 +20,14 @@ // static std::unique_ptr<FidoAttestationStatement> FidoAttestationStatement::CreateFromU2fRegisterResponse( - const std::vector<uint8_t>& u2f_data) { + base::span<const uint8_t> u2f_data) { CBS response, cert; CBS_init(&response, u2f_data.data(), u2f_data.size()); // The format of |u2f_data| is specified here: // https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#registration-response-message-success uint8_t credential_length; - if (!CBS_skip(&response, - authenticator_utils::kU2fResponseKeyHandleLengthPos) || + if (!CBS_skip(&response, u2f_parsing_utils::kU2fResponseKeyHandleLengthPos) || !CBS_get_u8(&response, &credential_length) || !CBS_skip(&response, credential_length) || !CBS_get_asn1_element(&response, &cert, CBS_ASN1_SEQUENCE)) { @@ -43,8 +40,8 @@ CBS_data(&cert) + CBS_len(&cert)); // The remaining bytes are the signature. - const std::vector<uint8_t> signature( - CBS_data(&response), CBS_data(&response) + CBS_len(&response)); + std::vector<uint8_t> signature(CBS_data(&response), + CBS_data(&response) + CBS_len(&response)); return std::make_unique<FidoAttestationStatement>( std::move(signature), std::move(x509_certificates)); } @@ -56,20 +53,22 @@ signature_(std::move(signature)), x509_certificates_(std::move(x509_certificates)) {} -cbor::CBORValue::MapValue FidoAttestationStatement::GetAsCBORMap() { - cbor::CBORValue::MapValue attstmt_map; - attstmt_map[cbor::CBORValue(kSignatureKey)] = cbor::CBORValue(signature_); +FidoAttestationStatement::~FidoAttestationStatement() = default; - std::vector<cbor::CBORValue> array; - for (auto cert : x509_certificates_) { - array.push_back(cbor::CBORValue(cert)); +cbor::CBORValue::MapValue FidoAttestationStatement::GetAsCBORMap() { + cbor::CBORValue::MapValue attestation_statement_map; + attestation_statement_map[cbor::CBORValue(kSignatureKey)] = + cbor::CBORValue(signature_); + + std::vector<cbor::CBORValue> certificate_array; + for (const auto& cert : x509_certificates_) { + certificate_array.push_back(cbor::CBORValue(cert)); } - attstmt_map[cbor::CBORValue(kX509CertKey)] = cbor::CBORValue(array); + attestation_statement_map[cbor::CBORValue(kX509CertKey)] = + cbor::CBORValue(std::move(certificate_array)); - return attstmt_map; + return attestation_statement_map; } -FidoAttestationStatement::~FidoAttestationStatement() {} - -} // namespace content +} // namespace device
diff --git a/content/browser/webauth/fido_attestation_statement.h b/device/u2f/fido_attestation_statement.h similarity index 66% rename from content/browser/webauth/fido_attestation_statement.h rename to device/u2f/fido_attestation_statement.h index 07dc8b6f..6c4537b 100644 --- a/content/browser/webauth/fido_attestation_statement.h +++ b/device/u2f/fido_attestation_statement.h
@@ -2,30 +2,30 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_WEBAUTH_FIDO_ATTESTATION_STATEMENT_H_ -#define CONTENT_BROWSER_WEBAUTH_FIDO_ATTESTATION_STATEMENT_H_ +#ifndef DEVICE_U2F_FIDO_ATTESTATION_STATEMENT_H_ +#define DEVICE_U2F_FIDO_ATTESTATION_STATEMENT_H_ #include <stdint.h> #include <memory> #include <vector> +#include "base/containers/span.h" #include "base/macros.h" #include "components/cbor/cbor_values.h" -#include "content/browser/webauth/attestation_statement.h" -#include "content/common/content_export.h" +#include "device/u2f/attestation_statement.h" -namespace content { +namespace device { // https://www.w3.org/TR/2017/WD-webauthn-20170505/#fido-u2f-attestation -class CONTENT_EXPORT FidoAttestationStatement : public AttestationStatement { +class FidoAttestationStatement : public AttestationStatement { public: + static std::unique_ptr<FidoAttestationStatement> + CreateFromU2fRegisterResponse(base::span<const uint8_t> u2f_data); + FidoAttestationStatement(std::vector<uint8_t> signature, std::vector<std::vector<uint8_t>> x509_certificates); ~FidoAttestationStatement() override; - static std::unique_ptr<FidoAttestationStatement> - CreateFromU2fRegisterResponse(const std::vector<uint8_t>& u2f_data); - // AttestationStatement overrides // Produces a map in the following format: @@ -39,6 +39,6 @@ DISALLOW_COPY_AND_ASSIGN(FidoAttestationStatement); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_WEBAUTH_FIDO_ATTESTATION_STATEMENT_H_ +#endif // DEVICE_U2F_FIDO_ATTESTATION_STATEMENT_H_
diff --git a/device/u2f/mock_u2f_device.cc b/device/u2f/mock_u2f_device.cc index 1891f9e9..547d28a 100644 --- a/device/u2f/mock_u2f_device.cc +++ b/device/u2f/mock_u2f_device.cc
@@ -6,6 +6,8 @@ #include <utility> +#include "device/u2f/u2f_response_test_data.h" + namespace device { MockU2fDevice::MockU2fDevice() : weak_factory_(this) {} @@ -45,9 +47,12 @@ // static void MockU2fDevice::NoErrorRegister(U2fApduCommand* cmd, DeviceCallback& cb) { - std::move(cb).Run(true, std::make_unique<U2fApduResponse>( - std::vector<uint8_t>({kRegister}), - U2fApduResponse::Status::SW_NO_ERROR)); + std::move(cb).Run( + true, + std::make_unique<U2fApduResponse>( + std::vector<uint8_t>(std::begin(test_data::kTestU2fRegisterResponse), + std::end(test_data::kTestU2fRegisterResponse)), + U2fApduResponse::Status::SW_NO_ERROR)); } // static
diff --git a/device/u2f/mock_u2f_device.h b/device/u2f/mock_u2f_device.h index 3172c47..2658fbe 100644 --- a/device/u2f/mock_u2f_device.h +++ b/device/u2f/mock_u2f_device.h
@@ -19,7 +19,6 @@ class MockU2fDevice : public U2fDevice { public: static constexpr uint8_t kSign = 0x1; - static constexpr uint8_t kRegister = 0x5; MockU2fDevice(); ~MockU2fDevice() override;
diff --git a/content/browser/webauth/public_key.cc b/device/u2f/public_key.cc similarity index 71% rename from content/browser/webauth/public_key.cc rename to device/u2f/public_key.cc index 10d0c7ed..b9e1cb8 100644 --- a/content/browser/webauth/public_key.cc +++ b/device/u2f/public_key.cc
@@ -2,17 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "content/browser/webauth/public_key.h" +#include "device/u2f/public_key.h" #include <utility> #include "base/macros.h" -namespace content { +namespace device { + +PublicKey::~PublicKey() = default; PublicKey::PublicKey(std::string algorithm) : algorithm_(std::move(algorithm)) {} -PublicKey::~PublicKey() {} - -} // namespace content +} // namespace device
diff --git a/content/browser/webauth/public_key.h b/device/u2f/public_key.h similarity index 72% rename from content/browser/webauth/public_key.h rename to device/u2f/public_key.h index dc1ca291..564e8c2b 100644 --- a/content/browser/webauth/public_key.h +++ b/device/u2f/public_key.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 CONTENT_BROWSER_WEBAUTH_PUBLIC_KEY_H_ -#define CONTENT_BROWSER_WEBAUTH_PUBLIC_KEY_H_ +#ifndef DEVICE_U2F_PUBLIC_KEY_H_ +#define DEVICE_U2F_PUBLIC_KEY_H_ #include <stdint.h> #include <string> @@ -11,7 +11,7 @@ #include "base/macros.h" -namespace content { +namespace device { // https://www.w3.org/TR/2017/WD-webauthn-20170505/#sec-attestation-data. class PublicKey { @@ -20,16 +20,17 @@ // The credential public key as a CBOR map according to a format // defined per public key type. - virtual std::vector<uint8_t> EncodeAsCBOR() = 0; + virtual std::vector<uint8_t> EncodeAsCBOR() const = 0; protected: PublicKey(const std::string algorithm); + const std::string algorithm_; private: DISALLOW_COPY_AND_ASSIGN(PublicKey); }; -} // namespace content +} // namespace device -#endif // CONTENT_BROWSER_WEBAUTH_PUBLIC_KEY_H_ +#endif // DEVICE_U2F_PUBLIC_KEY_H_
diff --git a/device/u2f/register_response_data.cc b/device/u2f/register_response_data.cc new file mode 100644 index 0000000..6624663 --- /dev/null +++ b/device/u2f/register_response_data.cc
@@ -0,0 +1,91 @@ +// Copyright 2017 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 "device/u2f/register_response_data.h" + +#include <utility> + +#include "base/base64url.h" +#include "device/u2f/attestation_object.h" +#include "device/u2f/attested_credential_data.h" +#include "device/u2f/authenticator_data.h" +#include "device/u2f/ec_public_key.h" +#include "device/u2f/fido_attestation_statement.h" +#include "device/u2f/u2f_parsing_utils.h" + +namespace device { + +// static +RegisterResponseData RegisterResponseData::CreateFromU2fRegisterResponse( + std::string relying_party_id, + std::vector<uint8_t> u2f_data) { + std::unique_ptr<ECPublicKey> public_key = + ECPublicKey::ExtractFromU2fRegistrationResponse(u2f_parsing_utils::kEs256, + u2f_data); + + // Construct the attestation data. + // AAGUID is zeroed out for U2F responses. + std::vector<uint8_t> aaguid(16u); + + auto attested_credential_data = + AttestedCredentialData::CreateFromU2fRegisterResponse( + u2f_data, std::move(aaguid), std::move(public_key)); + + // Extract the credential_id for packing into the reponse data. + std::vector<uint8_t> credential_id = attested_credential_data.credential_id(); + + // Construct the authenticator data. + // The counter is zeroed out for Register requests. + std::vector<uint8_t> counter(4u); + constexpr uint8_t flags = + static_cast<uint8_t>(AuthenticatorData::Flag::kTestOfUserPresence) | + static_cast<uint8_t>(AuthenticatorData::Flag::kAttestation); + + auto authenticator_data = AuthenticatorData::Create( + std::move(relying_party_id), flags, std::move(counter), + std::move(attested_credential_data)); + + // Construct the attestation statement. + std::unique_ptr<FidoAttestationStatement> fido_attestation_statement = + FidoAttestationStatement::CreateFromU2fRegisterResponse(u2f_data); + + // Construct the attestation object. + auto attestation_object = std::make_unique<AttestationObject>( + std::move(authenticator_data), std::move(fido_attestation_statement)); + + return RegisterResponseData(std::move(credential_id), + std::move(attestation_object)); +} + +RegisterResponseData::RegisterResponseData() = default; + +RegisterResponseData::RegisterResponseData( + std::vector<uint8_t> credential_id, + std::unique_ptr<AttestationObject> object) + : raw_id_(std::move(credential_id)), + attestation_object_(std::move(object)) {} + +RegisterResponseData::RegisterResponseData(RegisterResponseData&& other) = + default; + +RegisterResponseData& RegisterResponseData::operator=( + RegisterResponseData&& other) = default; + +RegisterResponseData::~RegisterResponseData() = default; + +std::vector<uint8_t> RegisterResponseData::GetCBOREncodedAttestationObject() + const { + return attestation_object_->SerializeToCBOREncodedBytes(); +} + +std::string RegisterResponseData::GetId() const { + std::string id; + base::Base64UrlEncode( + base::StringPiece(reinterpret_cast<const char*>(raw_id_.data()), + raw_id_.size()), + base::Base64UrlEncodePolicy::OMIT_PADDING, &id); + return id; +} + +} // namespace device
diff --git a/device/u2f/register_response_data.h b/device/u2f/register_response_data.h new file mode 100644 index 0000000..8aec955 --- /dev/null +++ b/device/u2f/register_response_data.h
@@ -0,0 +1,53 @@ +// Copyright 2017 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 DEVICE_U2F_REGISTER_RESPONSE_DATA_H_ +#define DEVICE_U2F_REGISTER_RESPONSE_DATA_H_ + +#include <stdint.h> +#include <memory> +#include <string> +#include <vector> + +#include "base/macros.h" + +namespace device { + +class AttestationObject; + +// See figure 2: +// https://fidoalliance.org/specs/fido-v2.0-rd-20170927/ \ +// fido-client-to-authenticator-protocol-v2.0-rd-20170927.html#using-the- \ +// ctap2-authenticatormakecredential-command-with-ctap1-u2f-authenticators +class RegisterResponseData { + public: + static RegisterResponseData CreateFromU2fRegisterResponse( + std::string relying_party_id, + std::vector<uint8_t> u2f_data); + + RegisterResponseData(); + + RegisterResponseData(std::vector<uint8_t> credential_id, + std::unique_ptr<AttestationObject> object); + + // Moveable. + RegisterResponseData(RegisterResponseData&& other); + RegisterResponseData& operator=(RegisterResponseData&& other); + + ~RegisterResponseData(); + + std::string GetId() const; + std::vector<uint8_t> GetCBOREncodedAttestationObject() const; + const std::vector<uint8_t>& raw_id() const { return raw_id_; } + + private: + std::vector<uint8_t> raw_id_; + std::unique_ptr<AttestationObject> attestation_object_; + + DISALLOW_COPY_AND_ASSIGN(RegisterResponseData); +}; + +} // namespace device + +#endif // DEVICE_U2F_REGISTER_RESPONSE_DATA_H_
diff --git a/device/u2f/u2f_parsing_utils.cc b/device/u2f/u2f_parsing_utils.cc new file mode 100644 index 0000000..be7022c --- /dev/null +++ b/device/u2f/u2f_parsing_utils.cc
@@ -0,0 +1,32 @@ +// Copyright 2017 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 "device/u2f/u2f_parsing_utils.h" + +#include "base/logging.h" + +namespace device { +namespace u2f_parsing_utils { + +const uint32_t kU2fResponseKeyHandleLengthPos = 66u; +const uint32_t kU2fResponseKeyHandleStartPos = 67u; +const char kEs256[] = "ES256"; + +void Append(std::vector<uint8_t>* target, base::span<const uint8_t> in_values) { + target->insert(target->end(), in_values.begin(), in_values.end()); +} + +std::vector<uint8_t> Extract(base::span<const uint8_t> source, + size_t pos, + size_t length) { + if (!(pos <= source.size() && length <= source.size() - pos)) { + return std::vector<uint8_t>(); + } + + return std::vector<uint8_t>(source.begin() + pos, + source.begin() + pos + length); +} + +} // namespace u2f_parsing_utils +} // namespace device
diff --git a/device/u2f/u2f_parsing_utils.h b/device/u2f/u2f_parsing_utils.h new file mode 100644 index 0000000..f32d7e3b --- /dev/null +++ b/device/u2f/u2f_parsing_utils.h
@@ -0,0 +1,32 @@ +// Copyright 2017 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 DEVICE_U2F_AUTHENTICATOR_UTILS_H_ +#define DEVICE_U2F_AUTHENTICATOR_UTILS_H_ + +#include <stddef.h> +#include <stdint.h> +#include <vector> + +#include "base/containers/span.h" + +namespace device { +namespace u2f_parsing_utils { +// U2FResponse offsets. The format of a U2F response is defined in +// https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#registration-response-message-success +extern const uint32_t kU2fResponseKeyHandleLengthPos; +extern const uint32_t kU2fResponseKeyHandleStartPos; +extern const char kEs256[]; + +void Append(std::vector<uint8_t>* target, base::span<const uint8_t> in_values); + +// Parses out a sub-vector after verifying no out-of-bound reads. +std::vector<uint8_t> Extract(base::span<const uint8_t> source, + size_t pos, + size_t length); + +} // namespace u2f_parsing_utils +} // namespace device + +#endif // DEVICE_U2F_AUTHENTICATOR_UTILS_H_
diff --git a/device/u2f/u2f_register.cc b/device/u2f/u2f_register.cc index 4a944c8..b41ae5fc 100644 --- a/device/u2f/u2f_register.cc +++ b/device/u2f/u2f_register.cc
@@ -7,6 +7,7 @@ #include <utility> #include "base/stl_util.h" +#include "device/u2f/register_response_data.h" #include "device/u2f/u2f_discovery.h" #include "services/service_manager/public/cpp/connector.h" @@ -16,12 +17,14 @@ const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, + std::string relying_party_id, std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb) - : U2fRequest(std::move(discoveries), cb), + RegisterResponseCallback completion_callback) + : U2fRequest(std::move(relying_party_id), std::move(discoveries)), challenge_hash_(challenge_hash), app_param_(app_param), registered_keys_(registered_keys), + completion_callback_(std::move(completion_callback)), weak_factory_(this) {} U2fRegister::~U2fRegister() = default; @@ -31,10 +34,12 @@ const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, + std::string relying_party_id, std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb) { + RegisterResponseCallback completion_callback) { std::unique_ptr<U2fRequest> request = std::make_unique<U2fRegister>( - registered_keys, challenge_hash, app_param, std::move(discoveries), cb); + registered_keys, challenge_hash, app_param, std::move(relying_party_id), + std::move(discoveries), std::move(completion_callback)); request->Start(); return request; } @@ -114,12 +119,19 @@ void U2fRegister::OnTryDevice(bool is_duplicate_registration, U2fReturnCode return_code, const std::vector<uint8_t>& response_data) { + base::Optional<RegisterResponseData> response; switch (return_code) { case U2fReturnCode::SUCCESS: state_ = State::COMPLETE; - if (is_duplicate_registration) + if (is_duplicate_registration) { return_code = U2fReturnCode::CONDITIONS_NOT_SATISFIED; - cb_.Run(return_code, response_data, std::vector<uint8_t>()); + } else { + // TODO(kpaulhamus): Add fuzzers for the response parsers. + // https://crbug.com/785957. + response = RegisterResponseData::CreateFromU2fRegisterResponse( + relying_party_id_, std::move(response_data)); + } + std::move(completion_callback_).Run(return_code, std::move(response)); break; case U2fReturnCode::CONDITIONS_NOT_SATISFIED: // Waiting for user touch, move on and try this device later.
diff --git a/device/u2f/u2f_register.h b/device/u2f/u2f_register.h index 437d4971..2f5dc25 100644 --- a/device/u2f/u2f_register.h +++ b/device/u2f/u2f_register.h
@@ -10,27 +10,37 @@ #include <string> #include <vector> +#include "base/optional.h" #include "device/u2f/u2f_request.h" namespace device { +class RegisterResponseData; class U2fDiscovery; class U2fRegister : public U2fRequest { public: + // Response is optional, depending on the status and + // the type of request being served. + using RegisterResponseCallback = base::OnceCallback<void( + U2fReturnCode status_code, + base::Optional<RegisterResponseData> response_data)>; + U2fRegister(const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, + std::string relying_party_id, std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb); + RegisterResponseCallback completion_callback); ~U2fRegister() override; static std::unique_ptr<U2fRequest> TryRegistration( const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, + std::string relying_party_id, std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb); + RegisterResponseCallback completion_callback); private: void TryDevice() override; @@ -55,6 +65,8 @@ std::vector<uint8_t> challenge_hash_; std::vector<uint8_t> app_param_; const std::vector<std::vector<uint8_t>> registered_keys_; + RegisterResponseCallback completion_callback_; + // List of authenticators that did not create any of the key handles in the // exclude list. std::set<std::string> checked_device_id_list_;
diff --git a/device/u2f/u2f_register_unittest.cc b/device/u2f/u2f_register_unittest.cc index 573b1600..76a890e 100644 --- a/device/u2f/u2f_register_unittest.cc +++ b/device/u2f/u2f_register_unittest.cc
@@ -4,20 +4,277 @@ #include "device/u2f/u2f_register.h" -#include <list> -#include <tuple> #include <utility> #include "base/run_loop.h" #include "base/test/scoped_task_environment.h" +#include "components/cbor/cbor_writer.h" +#include "device/u2f/attestation_object.h" +#include "device/u2f/attested_credential_data.h" +#include "device/u2f/authenticator_data.h" +#include "device/u2f/ec_public_key.h" +#include "device/u2f/fido_attestation_statement.h" #include "device/u2f/mock_u2f_device.h" #include "device/u2f/mock_u2f_discovery.h" +#include "device/u2f/register_response_data.h" +#include "device/u2f/u2f_parsing_utils.h" +#include "device/u2f/u2f_response_test_data.h" +#include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" namespace device { using ::testing::_; +namespace { + +constexpr char kTestRelyingPartyId[] = "google.com"; + +// CBOR-encoded EC public key. +// Diagnostic notation: +// {"x": h'F868CE3869605224CE1059C0047EF01B830F2AD93BE27A3211F44E894560E695', +// "y": h'4E11538CABA2DF1CC1A6F250ED9F0C8B28B39DA44539DFABD46B589CD0E202E5', +// "alg": "ES256"} +constexpr uint8_t kTestECPublicKeyCBOR[] = { + // clang-format off + 0xA3, // map(3) + 0x61, // text(1) + 0x78, // "x" + 0x58, 0x20, // bytes(32) + 0xF8, 0x68, 0xCE, 0x38, 0x69, 0x60, 0x52, 0x24, 0xCE, 0x10, 0x59, 0xC0, + 0x04, 0x7E, 0xF0, 0x1B, 0x83, 0x0F, 0x2A, 0xD9, 0x3B, 0xE2, 0x7A, 0x32, + 0x11, 0xF4, 0x4E, 0x89, 0x45, 0x60, 0xE6, 0x95, + 0x61, // text(1) + 0x79, // "y" + 0x58, 0x20, // bytes(32) + 0x4E, 0x11, 0x53, 0x8C, 0xAB, 0xA2, 0xDF, 0x1C, 0xC1, 0xA6, 0xF2, 0x50, + 0xED, 0x9F, 0x0C, 0x8B, 0x28, 0xB3, 0x9D, 0xA4, 0x45, 0x39, 0xDF, 0xAB, + 0xD4, 0x6B, 0x58, 0x9C, 0xD0, 0xE2, 0x02, 0xE5, + 0x63, // text(3) + 0x61, 0x6C, 0x67, // "alg" + 0x65, // text(5) + 0x45, 0x53, 0x32, 0x35, 0x36, // "ES256" + // clang-format on +}; + +// The attested credential data, excluding the CBOR public key bytes. Append +// with kTestECPublicKeyCBOR to get the complete attestation data. +constexpr uint8_t kTestAttestedCredentialDataPrefix[] = { + // clang-format off + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, // 16-byte aaguid + 0x00, 0x40, // 2-byte length + 0x89, 0xAF, 0xB5, 0x24, 0x91, 0x1C, 0x40, 0x2B, 0x7F, 0x74, 0x59, 0xC9, + 0xF2, 0x21, 0xAF, 0xE6, 0xE5, 0x56, 0x65, 0x85, 0x04, 0xE8, 0x5B, 0x49, + 0x4D, 0x07, 0x55, 0x55, 0xF4, 0x6A, 0xBC, 0x44, 0x7B, 0x15, 0xFC, 0x62, + 0x61, 0x90, 0xA5, 0xFE, 0xEB, 0xE5, 0x9F, 0x5E, 0xDC, 0x75, 0x32, 0x98, + 0x6F, 0x44, 0x69, 0xD7, 0xF6, 0x13, 0xEB, 0xAA, 0xEA, 0x33, 0xFB, 0xD5, + 0x8E, 0xBF, 0xC6, 0x09 // 64-byte key handle + // clang-format on +}; + +// The authenticator data, excluding the attested credential data bytes. Append +// with attested credential data to get the complete authenticator data. +constexpr uint8_t kTestAuthenticatorDataPrefix[] = { + // clang-format off + // sha256 hash of kTestRelyingPartyId + 0xD4, 0xC9, 0xD9, 0x02, 0x73, 0x26, 0x27, 0x1A, 0x89, 0xCE, 0x51, + 0xFC, 0xAF, 0x32, 0x8E, 0xD6, 0x73, 0xF1, 0x7B, 0xE3, 0x34, 0x69, + 0xFF, 0x97, 0x9E, 0x8A, 0xB8, 0xDD, 0x50, 0x1E, 0x66, 0x4F, + 0x41, // flags (TUP and AT bits set) + 0x00, 0x00, 0x00, 0x00 // counter + // clang-format on +}; + +// The attestation statement, a CBOR-encoded byte array. +// Diagnostic notation: +// {"sig": +// h'3044022008C3F8DB6E29FD8B14D9DE1BD98E84072CB813385989AA2CA289395E0009B8B70 \ +// 2202607B4F9AD05DE26F56F48B82569EAD8231A5A6C3A1448DEAAAF15C0EF29631A', +// "x5c": [h'3082024A30820132A0030201020204046C8822300D06092A864886F70D01010B0 \ +// 500302E312C302A0603550403132359756269636F2055324620526F6F742043412053657269 \ +// 616C203435373230303633313020170D3134303830313030303030305A180F3230353030393 \ +// 0343030303030305A302C312A302806035504030C2159756269636F20553246204545205365 \ +// 7269616C203234393138323332343737303059301306072A8648CE3D020106082A8648CE3D0 \ +// 30107034200043CCAB92CCB97287EE8E639437E21FCD6B6F165B2D5A3F3DB131D31C16B742B \ +// B476D8D1E99080EB546C9BBDF556E6210FD42785899E78CC589EBE310F6CDB9FF4A33B30393 \ +// 02206092B0601040182C40A020415312E332E362E312E342E312E34313438322E312E323013 \ +// 060B2B0601040182E51C020101040403020430300D06092A864886F70D01010B05000382010 \ +// 1009F9B052248BC4CF42CC5991FCAABAC9B651BBE5BDCDC8EF0AD2C1C1FFB36D18715D42E78 \ +// B249224F92C7E6E7A05C49F0E7E4C881BF2E94F45E4A21833D7456851D0F6C145A29540C874 \ +// F3092C934B43D222B8962C0F410CEF1DB75892AF116B44A96F5D35ADEA3822FC7146F600438 \ +// 5BCB69B65C99E7EB6919786703C0D8CD41E8F75CCA44AA8AB725AD8E799FF3A8696A6F1B265 \ +// 6E631B1E40183C08FDA53FA4A8F85A05693944AE179A1339D002D15CABD810090EC722EF5DE \ +// F9965A371D415D624B68A2707CAD97BCDD1785AF97E258F33DF56A031AA0356D8E8D5EBCADC \ +// 74E071636C6B110ACE5CC9B90DFEACAE640FF1BB0F1FE5DB4EFF7A95F060733F5']} +constexpr uint8_t kU2fAttestationStatementCBOR[] = { + // clang-format off + 0xA2, // map(2) + 0x63, // text(3) + 0x73, 0x69, 0x67, // "sig" + 0x58, 0x46, // bytes(70) + 0x30, 0x44, 0x02, 0x20, 0x08, 0xC3, 0xF8, 0xDB, 0x6E, 0x29, 0xFD, 0x8B, + 0x14, 0xD9, 0xDE, 0x1B, 0xD9, 0x8E, 0x84, 0x07, 0x2C, 0xB8, 0x13, 0x38, + 0x59, 0x89, 0xAA, 0x2C, 0xA2, 0x89, 0x39, 0x5E, 0x00, 0x09, 0xB8, 0xB7, + 0x02, 0x20, 0x26, 0x07, 0xB4, 0xF9, 0xAD, 0x05, 0xDE, 0x26, 0xF5, 0x6F, + 0x48, 0xB8, 0x25, 0x69, 0xEA, 0xD8, 0x23, 0x1A, 0x5A, 0x6C, 0x3A, 0x14, + 0x48, 0xDE, 0xAA, 0xAF, 0x15, 0xC0, 0xEF, 0x29, 0x63, 0x1A, + 0x63, // text(3) + 0x78, 0x35, 0x63, // "x5c" + 0x81, // array(1) + 0x59, 0x02, 0x4E, // bytes(590) + 0x30, 0x82, 0x02, 0x4A, 0x30, 0x82, 0x01, 0x32, 0xA0, 0x03, 0x02, + 0x01, 0x02, 0x02, 0x04, 0x04, 0x6C, 0x88, 0x22, 0x30, 0x0D, 0x06, + 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, + 0x00, 0x30, 0x2E, 0x31, 0x2C, 0x30, 0x2A, 0x06, 0x03, 0x55, 0x04, + 0x03, 0x13, 0x23, 0x59, 0x75, 0x62, 0x69, 0x63, 0x6F, 0x20, 0x55, + 0x32, 0x46, 0x20, 0x52, 0x6F, 0x6F, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6C, 0x20, 0x34, 0x35, 0x37, 0x32, + 0x30, 0x30, 0x36, 0x33, 0x31, 0x30, 0x20, 0x17, 0x0D, 0x31, 0x34, + 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5A, + 0x18, 0x0F, 0x32, 0x30, 0x35, 0x30, 0x30, 0x39, 0x30, 0x34, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x5A, 0x30, 0x2C, 0x31, 0x2A, 0x30, + 0x28, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x21, 0x59, 0x75, 0x62, + 0x69, 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x45, 0x45, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6C, 0x20, 0x32, 0x34, 0x39, 0x31, + 0x38, 0x32, 0x33, 0x32, 0x34, 0x37, 0x37, 0x30, 0x30, 0x59, 0x30, + 0x13, 0x06, 0x07, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, + 0x08, 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, + 0x00, 0x04, 0x3C, 0xCA, 0xB9, 0x2C, 0xCB, 0x97, 0x28, 0x7E, 0xE8, + 0xE6, 0x39, 0x43, 0x7E, 0x21, 0xFC, 0xD6, 0xB6, 0xF1, 0x65, 0xB2, + 0xD5, 0xA3, 0xF3, 0xDB, 0x13, 0x1D, 0x31, 0xC1, 0x6B, 0x74, 0x2B, + 0xB4, 0x76, 0xD8, 0xD1, 0xE9, 0x90, 0x80, 0xEB, 0x54, 0x6C, 0x9B, + 0xBD, 0xF5, 0x56, 0xE6, 0x21, 0x0F, 0xD4, 0x27, 0x85, 0x89, 0x9E, + 0x78, 0xCC, 0x58, 0x9E, 0xBE, 0x31, 0x0F, 0x6C, 0xDB, 0x9F, 0xF4, + 0xA3, 0x3B, 0x30, 0x39, 0x30, 0x22, 0x06, 0x09, 0x2B, 0x06, 0x01, + 0x04, 0x01, 0x82, 0xC4, 0x0A, 0x02, 0x04, 0x15, 0x31, 0x2E, 0x33, + 0x2E, 0x36, 0x2E, 0x31, 0x2E, 0x34, 0x2E, 0x31, 0x2E, 0x34, 0x31, + 0x34, 0x38, 0x32, 0x2E, 0x31, 0x2E, 0x32, 0x30, 0x13, 0x06, 0x0B, + 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0xE5, 0x1C, 0x02, 0x01, 0x01, + 0x04, 0x04, 0x03, 0x02, 0x04, 0x30, 0x30, 0x0D, 0x06, 0x09, 0x2A, + 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x03, + 0x82, 0x01, 0x01, 0x00, 0x9F, 0x9B, 0x05, 0x22, 0x48, 0xBC, 0x4C, + 0xF4, 0x2C, 0xC5, 0x99, 0x1F, 0xCA, 0xAB, 0xAC, 0x9B, 0x65, 0x1B, + 0xBE, 0x5B, 0xDC, 0xDC, 0x8E, 0xF0, 0xAD, 0x2C, 0x1C, 0x1F, 0xFB, + 0x36, 0xD1, 0x87, 0x15, 0xD4, 0x2E, 0x78, 0xB2, 0x49, 0x22, 0x4F, + 0x92, 0xC7, 0xE6, 0xE7, 0xA0, 0x5C, 0x49, 0xF0, 0xE7, 0xE4, 0xC8, + 0x81, 0xBF, 0x2E, 0x94, 0xF4, 0x5E, 0x4A, 0x21, 0x83, 0x3D, 0x74, + 0x56, 0x85, 0x1D, 0x0F, 0x6C, 0x14, 0x5A, 0x29, 0x54, 0x0C, 0x87, + 0x4F, 0x30, 0x92, 0xC9, 0x34, 0xB4, 0x3D, 0x22, 0x2B, 0x89, 0x62, + 0xC0, 0xF4, 0x10, 0xCE, 0xF1, 0xDB, 0x75, 0x89, 0x2A, 0xF1, 0x16, + 0xB4, 0x4A, 0x96, 0xF5, 0xD3, 0x5A, 0xDE, 0xA3, 0x82, 0x2F, 0xC7, + 0x14, 0x6F, 0x60, 0x04, 0x38, 0x5B, 0xCB, 0x69, 0xB6, 0x5C, 0x99, + 0xE7, 0xEB, 0x69, 0x19, 0x78, 0x67, 0x03, 0xC0, 0xD8, 0xCD, 0x41, + 0xE8, 0xF7, 0x5C, 0xCA, 0x44, 0xAA, 0x8A, 0xB7, 0x25, 0xAD, 0x8E, + 0x79, 0x9F, 0xF3, 0xA8, 0x69, 0x6A, 0x6F, 0x1B, 0x26, 0x56, 0xE6, + 0x31, 0xB1, 0xE4, 0x01, 0x83, 0xC0, 0x8F, 0xDA, 0x53, 0xFA, 0x4A, + 0x8F, 0x85, 0xA0, 0x56, 0x93, 0x94, 0x4A, 0xE1, 0x79, 0xA1, 0x33, + 0x9D, 0x00, 0x2D, 0x15, 0xCA, 0xBD, 0x81, 0x00, 0x90, 0xEC, 0x72, + 0x2E, 0xF5, 0xDE, 0xF9, 0x96, 0x5A, 0x37, 0x1D, 0x41, 0x5D, 0x62, + 0x4B, 0x68, 0xA2, 0x70, 0x7C, 0xAD, 0x97, 0xBC, 0xDD, 0x17, 0x85, + 0xAF, 0x97, 0xE2, 0x58, 0xF3, 0x3D, 0xF5, 0x6A, 0x03, 0x1A, 0xA0, + 0x35, 0x6D, 0x8E, 0x8D, 0x5E, 0xBC, 0xAD, 0xC7, 0x4E, 0x07, 0x16, + 0x36, 0xC6, 0xB1, 0x10, 0xAC, 0xE5, 0xCC, 0x9B, 0x90, 0xDF, 0xEA, + 0xCA, 0xE6, 0x40, 0xFF, 0x1B, 0xB0, 0xF1, 0xFE, 0x5D, 0xB4, 0xEF, + 0xF7, 0xA9, 0x5F, 0x06, 0x07, 0x33, 0xF5 + // clang-format on +}; + +// Components of the CBOR needed to form an authenticator object. +// Combined diagnostic notation: +// {"fmt": "fido-u2f", "attStmt": {"sig": h'30...}, "authData": h'D4C9D9...'} +constexpr uint8_t kFormatFidoU2fCBOR[] = { + // clang-format off + 0xA3, // map(3) + 0x63, // text(3) + 0x66, 0x6D, 0x74, // "fmt" + 0x68, // text(8) + 0x66, 0x69, 0x64, 0x6F, 0x2D, 0x75, 0x32, 0x66 // "fido-u2f" + // clang-format on +}; + +constexpr uint8_t kAttStmtCBOR[] = { + // clang-format off + 0x67, // text(7) + 0x61, 0x74, 0x74, 0x53, 0x74, 0x6D, 0x74 // "attStmt" + // clang-format on +}; + +constexpr uint8_t kAuthDataCBOR[] = { + // clang-format off + 0x68, // text(8) + 0x61, 0x75, 0x74, 0x68, 0x44, 0x61, 0x74, 0x61, // "authData" + 0x58, 0xCA // bytes(202). i.e.,the authenticator_data bytearray + // clang-format on +}; + +// Helpers for testing U2f register responses. +std::vector<uint8_t> GetTestECPublicKeyCBOR() { + return std::vector<uint8_t>(std::begin(kTestECPublicKeyCBOR), + std::end(kTestECPublicKeyCBOR)); +} + +std::vector<uint8_t> GetTestRegisterResponse() { + return std::vector<uint8_t>(std::begin(test_data::kTestU2fRegisterResponse), + std::end(test_data::kTestU2fRegisterResponse)); +} + +std::vector<uint8_t> GetTestCredentialRawIdBytes() { + return std::vector<uint8_t>(std::begin(test_data::kTestCredentialRawIdBytes), + std::end(test_data::kTestCredentialRawIdBytes)); +} + +std::vector<uint8_t> GetU2fAttestationStatementCBOR() { + return std::vector<uint8_t>(std::begin(kU2fAttestationStatementCBOR), + std::end(kU2fAttestationStatementCBOR)); +} + +std::vector<uint8_t> GetTestAttestedCredentialDataBytes() { + // Combine kTestAttestedCredentialDataPrefix and kTestECPublicKeyCBOR. + std::vector<uint8_t> test_attested_data( + std::begin(kTestAttestedCredentialDataPrefix), + std::end(kTestAttestedCredentialDataPrefix)); + test_attested_data.insert(test_attested_data.end(), + std::begin(kTestECPublicKeyCBOR), + std::end(kTestECPublicKeyCBOR)); + return test_attested_data; +} + +std::vector<uint8_t> GetTestAuthenticatorDataBytes() { + // Build the test authenticator data. + std::vector<uint8_t> test_authenticator_data( + std::begin(kTestAuthenticatorDataPrefix), + std::end(kTestAuthenticatorDataPrefix)); + std::vector<uint8_t> test_attested_data = + GetTestAttestedCredentialDataBytes(); + test_authenticator_data.insert(test_authenticator_data.end(), + test_attested_data.begin(), + test_attested_data.end()); + return test_authenticator_data; +} + +std::vector<uint8_t> GetTestAttestationObjectBytes() { + std::vector<uint8_t> test_authenticator_object(std::begin(kFormatFidoU2fCBOR), + std::end(kFormatFidoU2fCBOR)); + test_authenticator_object.insert(test_authenticator_object.end(), + std::begin(kAttStmtCBOR), + std::end(kAttStmtCBOR)); + test_authenticator_object.insert(test_authenticator_object.end(), + std::begin(kU2fAttestationStatementCBOR), + std::end(kU2fAttestationStatementCBOR)); + test_authenticator_object.insert(test_authenticator_object.end(), + std::begin(kAuthDataCBOR), + std::end(kAuthDataCBOR)); + std::vector<uint8_t> test_authenticator_data = + GetTestAuthenticatorDataBytes(); + test_authenticator_object.insert(test_authenticator_object.end(), + test_authenticator_data.begin(), + test_authenticator_data.end()); + return test_authenticator_object; +} + +} // namespace + class U2fRegisterTest : public testing::Test { public: U2fRegisterTest() @@ -31,36 +288,34 @@ class TestRegisterCallback { public: TestRegisterCallback() - : callback_(base::Bind(&TestRegisterCallback::ReceivedCallback, - base::Unretained(this))) {} + : callback_(base::BindOnce(&TestRegisterCallback::ReceivedCallback, + base::Unretained(this))) {} ~TestRegisterCallback() = default; void ReceivedCallback(U2fReturnCode status_code, - const std::vector<uint8_t>& response, - const std::vector<uint8_t>& key_handle) { - response_ = std::make_tuple(status_code, response, key_handle); + base::Optional<RegisterResponseData> response_data) { + response_ = std::make_pair(status_code, std::move(response_data)); closure_.Run(); } - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& + const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& WaitForCallback() { closure_ = run_loop_.QuitClosure(); run_loop_.Run(); return response_; } - const U2fRequest::ResponseCallback& callback() { return callback_; } + U2fRegister::RegisterResponseCallback& callback() { return callback_; } private: - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>> - response_; + std::pair<U2fReturnCode, base::Optional<RegisterResponseData>> response_; base::Closure closure_; - U2fRequest::ResponseCallback callback_; + U2fRegister::RegisterResponseCallback callback_; base::RunLoop run_loop_; }; TEST_F(U2fRegisterTest, TestRegisterSuccess) { - std::unique_ptr<MockU2fDevice> device(new MockU2fDevice()); + std::unique_ptr<MockU2fDevice> device(std::make_unique<MockU2fDevice>()); MockU2fDiscovery discovery; EXPECT_CALL(*device.get(), GetId()) @@ -77,22 +332,17 @@ std::vector<std::vector<uint8_t>> registration_keys; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( registration_keys, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - {&discovery}, cb.callback()); + kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); request->Start(); discovery.AddDevice(std::move(device)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& + const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& response = cb.WaitForCallback(); EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); - ASSERT_GE(1u, std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kRegister), - std::get<1>(response)[0]); - - // Verify that we get a blank key handle. - EXPECT_TRUE(std::get<2>(response).empty()); + EXPECT_EQ(GetTestCredentialRawIdBytes(), std::get<1>(response)->raw_id()); } TEST_F(U2fRegisterTest, TestDelayedSuccess) { - std::unique_ptr<MockU2fDevice> device(new MockU2fDevice()); + std::unique_ptr<MockU2fDevice> device(std::make_unique<MockU2fDevice>()); MockU2fDiscovery discovery; EXPECT_CALL(*device.get(), GetId()) @@ -112,24 +362,19 @@ std::vector<std::vector<uint8_t>> registration_keys; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( registration_keys, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - {&discovery}, cb.callback()); + kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); request->Start(); discovery.AddDevice(std::move(device)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& + const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& response = cb.WaitForCallback(); EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); - ASSERT_GE(1u, std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kRegister), - std::get<1>(response)[0]); - - // Verify that we get a blank key handle. - EXPECT_TRUE(std::get<2>(response).empty()); + EXPECT_EQ(GetTestCredentialRawIdBytes(), std::get<1>(response)->raw_id()); } TEST_F(U2fRegisterTest, TestMultipleDevices) { // Second device will have a successful touch - std::unique_ptr<MockU2fDevice> device0(new MockU2fDevice()); - std::unique_ptr<MockU2fDevice> device1(new MockU2fDevice()); + std::unique_ptr<MockU2fDevice> device0(std::make_unique<MockU2fDevice>()); + std::unique_ptr<MockU2fDevice> device1(std::make_unique<MockU2fDevice>()); MockU2fDiscovery discovery; EXPECT_CALL(*device0.get(), GetId()) @@ -153,20 +398,16 @@ std::vector<std::vector<uint8_t>> registration_keys; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( registration_keys, std::vector<uint8_t>(32), std::vector<uint8_t>(32), - {&discovery}, cb.callback()); + kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); request->Start(); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& + const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& response = cb.WaitForCallback(); EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); - ASSERT_GE(1u, std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kRegister), - std::get<1>(response)[0]); - - // Verify that we get a blank key handle. - EXPECT_TRUE(std::get<2>(response).empty()); + EXPECT_EQ(GetTestCredentialRawIdBytes(), + std::get<1>(response).value().raw_id()); } // Tests a scenario where a single device is connected and registration call @@ -178,7 +419,7 @@ std::vector<uint8_t> unknown_key2(32, 0xD); std::vector<std::vector<uint8_t>> handles = {unknown_key0, unknown_key1, unknown_key2}; - std::unique_ptr<MockU2fDevice> device(new MockU2fDevice()); + std::unique_ptr<MockU2fDevice> device(std::make_unique<MockU2fDevice>()); MockU2fDiscovery discovery; EXPECT_CALL(*device.get(), GetId()) @@ -206,20 +447,15 @@ TestRegisterCallback cb; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), {&discovery}, - cb.callback()); + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); discovery.AddDevice(std::move(device)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& + const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& response = cb.WaitForCallback(); EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); - ASSERT_LT(static_cast<size_t>(0), std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kRegister), - std::get<1>(response)[0]); - - // Verify that we get a blank key handle. - EXPECT_TRUE(std::get<2>(response).empty()); + EXPECT_EQ(GetTestCredentialRawIdBytes(), std::get<1>(response)->raw_id()); } // Tests a scenario where two devices are connected and registration call is @@ -231,8 +467,8 @@ std::vector<uint8_t> unknown_key2(32, 0xD); std::vector<std::vector<uint8_t>> handles = {unknown_key0, unknown_key1, unknown_key2}; - std::unique_ptr<MockU2fDevice> device0(new MockU2fDevice()); - std::unique_ptr<MockU2fDevice> device1(new MockU2fDevice()); + std::unique_ptr<MockU2fDevice> device0(std::make_unique<MockU2fDevice>()); + std::unique_ptr<MockU2fDevice> device1(std::make_unique<MockU2fDevice>()); MockU2fDiscovery discovery; EXPECT_CALL(*device0.get(), GetId()) @@ -273,21 +509,16 @@ TestRegisterCallback cb; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), {&discovery}, - cb.callback()); + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& + const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& response = cb.WaitForCallback(); EXPECT_EQ(U2fReturnCode::SUCCESS, std::get<0>(response)); - ASSERT_LT(static_cast<size_t>(0), std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kRegister), - std::get<1>(response)[0]); - - // Verify that we get a blank key handle. - EXPECT_TRUE(std::get<2>(response).empty()); + EXPECT_EQ(GetTestCredentialRawIdBytes(), std::get<1>(response)->raw_id()); } // Tests a scenario where single device is connected and registration is called @@ -303,7 +534,7 @@ std::vector<std::vector<uint8_t>> handles = {unknown_key0, unknown_key1, unknown_key2, duplicate_key}; - std::unique_ptr<MockU2fDevice> device(new MockU2fDevice()); + std::unique_ptr<MockU2fDevice> device(std::make_unique<MockU2fDevice>()); MockU2fDiscovery discovery; EXPECT_CALL(*device.get(), GetId()) @@ -333,12 +564,13 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestRegisterCallback cb; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), {&discovery}, - cb.callback()); + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); discovery.AddDevice(std::move(device)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& + const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& response = cb.WaitForCallback(); EXPECT_EQ(U2fReturnCode::CONDITIONS_NOT_SATISFIED, std::get<0>(response)); + EXPECT_EQ(base::nullopt, std::get<1>(response)); } // Tests a scenario where one(device1) of the two devices connected has created @@ -396,13 +628,110 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestRegisterCallback cb; std::unique_ptr<U2fRequest> request = U2fRegister::TryRegistration( - handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), {&discovery}, - cb.callback()); + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, std::move(cb.callback())); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); - std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& + const std::pair<U2fReturnCode, base::Optional<RegisterResponseData>>& response = cb.WaitForCallback(); EXPECT_EQ(U2fReturnCode::CONDITIONS_NOT_SATISFIED, std::get<0>(response)); + EXPECT_EQ(base::nullopt, std::get<1>(response)); +} + +// These test the parsing of the U2F raw bytes of the registration response. +// Test that an EC public key serializes to CBOR properly. +TEST_F(U2fRegisterTest, TestSerializedPublicKey) { + std::unique_ptr<ECPublicKey> public_key = + ECPublicKey::ExtractFromU2fRegistrationResponse( + u2f_parsing_utils::kEs256, GetTestRegisterResponse()); + EXPECT_EQ(GetTestECPublicKeyCBOR(), public_key->EncodeAsCBOR()); +} + +// Test that the attestation statement cbor map is constructed properly. +TEST_F(U2fRegisterTest, TestU2fAttestationStatementCBOR) { + std::unique_ptr<FidoAttestationStatement> fido_attestation_statement = + FidoAttestationStatement::CreateFromU2fRegisterResponse( + GetTestRegisterResponse()); + auto cbor = cbor::CBORWriter::Write( + cbor::CBORValue(fido_attestation_statement->GetAsCBORMap())); + ASSERT_TRUE(cbor); + EXPECT_EQ(GetU2fAttestationStatementCBOR(), *cbor); +} + +// Tests that well-formed attested credential data serializes properly. +TEST_F(U2fRegisterTest, TestAttestedCredentialData) { + std::unique_ptr<ECPublicKey> public_key = + ECPublicKey::ExtractFromU2fRegistrationResponse( + u2f_parsing_utils::kEs256, GetTestRegisterResponse()); + AttestedCredentialData attested_data = + AttestedCredentialData::CreateFromU2fRegisterResponse( + GetTestRegisterResponse(), std::vector<uint8_t>(16) /* aaguid */, + std::move(public_key)); + + EXPECT_EQ(GetTestAttestedCredentialDataBytes(), + attested_data.SerializeAsBytes()); +} + +// Tests that well-formed authenticator data serializes properly. +TEST_F(U2fRegisterTest, TestAuthenticatorData) { + std::unique_ptr<ECPublicKey> public_key = + ECPublicKey::ExtractFromU2fRegistrationResponse( + u2f_parsing_utils::kEs256, GetTestRegisterResponse()); + AttestedCredentialData attested_data = + AttestedCredentialData::CreateFromU2fRegisterResponse( + GetTestRegisterResponse(), std::vector<uint8_t>(16, 0) /* aaguid */, + std::move(public_key)); + + uint8_t flags = + static_cast<uint8_t>(AuthenticatorData::Flag::kTestOfUserPresence) | + static_cast<uint8_t>(AuthenticatorData::Flag::kAttestation); + + auto authenticator_data = AuthenticatorData::Create( + kTestRelyingPartyId, flags, std::vector<uint8_t>(4, 0) /* counter */, + std::move(attested_data)); + + EXPECT_EQ(GetTestAuthenticatorDataBytes(), + authenticator_data.SerializeToByteArray()); +} + +// Tests that a U2F attestation object serializes properly. +TEST_F(U2fRegisterTest, TestU2fAttestationObject) { + std::unique_ptr<ECPublicKey> public_key = + ECPublicKey::ExtractFromU2fRegistrationResponse( + u2f_parsing_utils::kEs256, GetTestRegisterResponse()); + AttestedCredentialData attested_data = + AttestedCredentialData::CreateFromU2fRegisterResponse( + GetTestRegisterResponse(), std::vector<uint8_t>(16, 0) /* aaguid */, + std::move(public_key)); + + uint8_t flags = + static_cast<uint8_t>(AuthenticatorData::Flag::kTestOfUserPresence) | + static_cast<uint8_t>(AuthenticatorData::Flag::kAttestation); + auto authenticator_data = AuthenticatorData::Create( + kTestRelyingPartyId, flags, std::vector<uint8_t>(4, 0) /* counter */, + std::move(attested_data)); + + // Construct the attestation statement. + std::unique_ptr<FidoAttestationStatement> fido_attestation_statement = + FidoAttestationStatement::CreateFromU2fRegisterResponse( + GetTestRegisterResponse()); + + // Construct the attestation object. + auto attestation_object = std::make_unique<AttestationObject>( + std::move(authenticator_data), std::move(fido_attestation_statement)); + + EXPECT_EQ(GetTestAttestationObjectBytes(), + attestation_object->SerializeToCBOREncodedBytes()); +} + +// Test that a U2F register response is properly parsed. +TEST_F(U2fRegisterTest, TestRegisterResponseData) { + RegisterResponseData response = + RegisterResponseData::CreateFromU2fRegisterResponse( + kTestRelyingPartyId, GetTestRegisterResponse()); + EXPECT_EQ(GetTestCredentialRawIdBytes(), response.raw_id()); + EXPECT_EQ(GetTestAttestationObjectBytes(), + response.GetCBOREncodedAttestationObject()); } } // namespace device
diff --git a/device/u2f/u2f_request.cc b/device/u2f/u2f_request.cc index de591629..31f801b 100644 --- a/device/u2f/u2f_request.cc +++ b/device/u2f/u2f_request.cc
@@ -12,11 +12,11 @@ namespace device { -U2fRequest::U2fRequest(std::vector<U2fDiscovery*> discoveries, - ResponseCallback cb) +U2fRequest::U2fRequest(std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries) : state_(State::INIT), + relying_party_id_(std::move(relying_party_id)), discoveries_(std::move(discoveries)), - cb_(std::move(cb)), weak_factory_(this) { for (auto* discovery : discoveries_) discovery->AddObserver(this);
diff --git a/device/u2f/u2f_request.h b/device/u2f/u2f_request.h index 315bdcc..8cd1c9e 100644 --- a/device/u2f/u2f_request.h +++ b/device/u2f/u2f_request.h
@@ -27,7 +27,8 @@ // U2fRequest will register itself as an observer for each entry in // |discoveries|. Clients need to ensure that each discovery outlives this // request. - U2fRequest(std::vector<U2fDiscovery*> discoveries, ResponseCallback callback); + U2fRequest(std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries); ~U2fRequest() override; void Start(); @@ -55,8 +56,8 @@ std::list<U2fDevice*> attempted_devices_; State state_; + const std::string relying_party_id_; std::vector<U2fDiscovery*> discoveries_; - ResponseCallback cb_; private: FRIEND_TEST_ALL_PREFIXES(U2fRequestTest, TestIterateDevice);
diff --git a/device/u2f/u2f_request_unittest.cc b/device/u2f/u2f_request_unittest.cc index 260764c..47e1dc0b 100644 --- a/device/u2f/u2f_request_unittest.cc +++ b/device/u2f/u2f_request_unittest.cc
@@ -18,17 +18,24 @@ namespace device { namespace { +constexpr char kTestRelyingPartyId[] = "google.com"; + class FakeU2fRequest : public U2fRequest { public: - FakeU2fRequest(std::vector<U2fDiscovery*> discoveries, + FakeU2fRequest(std::string relying_party_id, + std::vector<U2fDiscovery*> discoveries, const ResponseCallback& cb) - : U2fRequest(std::move(discoveries), cb) {} + : U2fRequest(std::move(relying_party_id), std::move(discoveries)), + cb_(cb) {} ~FakeU2fRequest() override = default; void TryDevice() override { cb_.Run(U2fReturnCode::SUCCESS, std::vector<uint8_t>(), std::vector<uint8_t>()); } + + private: + ResponseCallback cb_; }; void ReponseDoNothing(U2fReturnCode status_code, @@ -49,7 +56,8 @@ TEST_F(U2fRequestTest, TestIterateDevice) { MockU2fDiscovery discovery; - FakeU2fRequest request({&discovery}, base::BindRepeating(ReponseDoNothing)); + FakeU2fRequest request(kTestRelyingPartyId, {&discovery}, + base::BindRepeating(ReponseDoNothing)); auto device0 = std::make_unique<MockU2fDevice>(); auto device1 = std::make_unique<MockU2fDevice>(); @@ -95,7 +103,8 @@ EXPECT_CALL(discovery, Start()) .WillOnce(testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccess)); - FakeU2fRequest request({&discovery}, base::BindRepeating(ReponseDoNothing)); + FakeU2fRequest request(kTestRelyingPartyId, {&discovery}, + base::BindRepeating(ReponseDoNothing)); request.Start(); // Add one U2F device @@ -117,7 +126,8 @@ EXPECT_CALL(discovery, Start()) .WillOnce(testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccess)); - FakeU2fRequest request({&discovery}, base::BindRepeating(ReponseDoNothing)); + FakeU2fRequest request(kTestRelyingPartyId, {&discovery}, + base::BindRepeating(ReponseDoNothing)); request.Start(); EXPECT_NE(nullptr, request.current_device_);
diff --git a/device/u2f/u2f_response_test_data.h b/device/u2f/u2f_response_test_data.h new file mode 100644 index 0000000..f4977cc --- /dev/null +++ b/device/u2f/u2f_response_test_data.h
@@ -0,0 +1,97 @@ +// Copyright 2017 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. + +// This file declares common data used to test U2F register and sign responses. + +#ifndef DEVICE_U2F_U2F_RESPONSE_TEST_DATA_H_ +#define DEVICE_U2F_U2F_RESPONSE_TEST_DATA_H_ + +namespace device { + +namespace test_data { + +constexpr uint8_t kTestCredentialRawIdBytes[] = { + 0x89, 0xAF, 0xB5, 0x24, 0x91, 0x1C, 0x40, 0x2B, 0x7F, 0x74, 0x59, + 0xC9, 0xF2, 0x21, 0xAF, 0xE6, 0xE5, 0x56, 0x65, 0x85, 0x04, 0xE8, + 0x5B, 0x49, 0x4D, 0x07, 0x55, 0x55, 0xF4, 0x6A, 0xBC, 0x44, 0x7B, + 0x15, 0xFC, 0x62, 0x61, 0x90, 0xA5, 0xFE, 0xEB, 0xE5, 0x9F, 0x5E, + 0xDC, 0x75, 0x32, 0x98, 0x6F, 0x44, 0x69, 0xD7, 0xF6, 0x13, 0xEB, + 0xAA, 0xEA, 0x33, 0xFB, 0xD5, 0x8E, 0xBF, 0xC6, 0x09}; + +// U2F response blob produced by a U2F registration request. This example +// data uses testClientDataJson and 'created' a key with testCredentialRawId +// as its key handle and with the above x- and y- coordinates. +constexpr uint8_t kTestU2fRegisterResponse[] = { + 0x05, 0x04, 0xF8, 0x68, 0xCE, 0x38, 0x69, 0x60, 0x52, 0x24, 0xCE, 0x10, + 0x59, 0xC0, 0x04, 0x7E, 0xF0, 0x1B, 0x83, 0x0F, 0x2A, 0xD9, 0x3B, 0xE2, + 0x7A, 0x32, 0x11, 0xF4, 0x4E, 0x89, 0x45, 0x60, 0xE6, 0x95, 0x4E, 0x11, + 0x53, 0x8C, 0xAB, 0xA2, 0xDF, 0x1C, 0xC1, 0xA6, 0xF2, 0x50, 0xED, 0x9F, + 0x0C, 0x8B, 0x28, 0xB3, 0x9D, 0xA4, 0x45, 0x39, 0xDF, 0xAB, 0xD4, 0x6B, + 0x58, 0x9C, 0xD0, 0xE2, 0x02, 0xE5, 0x40, 0x89, 0xAF, 0xB5, 0x24, 0x91, + 0x1C, 0x40, 0x2B, 0x7F, 0x74, 0x59, 0xC9, 0xF2, 0x21, 0xAF, 0xE6, 0xE5, + 0x56, 0x65, 0x85, 0x04, 0xE8, 0x5B, 0x49, 0x4D, 0x07, 0x55, 0x55, 0xF4, + 0x6A, 0xBC, 0x44, 0x7B, 0x15, 0xFC, 0x62, 0x61, 0x90, 0xA5, 0xFE, 0xEB, + 0xE5, 0x9F, 0x5E, 0xDC, 0x75, 0x32, 0x98, 0x6F, 0x44, 0x69, 0xD7, 0xF6, + 0x13, 0xEB, 0xAA, 0xEA, 0x33, 0xFB, 0xD5, 0x8E, 0xBF, 0xC6, 0x09, 0x30, + 0x82, 0x02, 0x4A, 0x30, 0x82, 0x01, 0x32, 0xA0, 0x03, 0x02, 0x01, 0x02, + 0x02, 0x04, 0x04, 0x6C, 0x88, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, + 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x2E, 0x31, + 0x2C, 0x30, 0x2A, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x23, 0x59, 0x75, + 0x62, 0x69, 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x52, 0x6F, 0x6F, + 0x74, 0x20, 0x43, 0x41, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6C, 0x20, + 0x34, 0x35, 0x37, 0x32, 0x30, 0x30, 0x36, 0x33, 0x31, 0x30, 0x20, 0x17, + 0x0D, 0x31, 0x34, 0x30, 0x38, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5A, 0x18, 0x0F, 0x32, 0x30, 0x35, 0x30, 0x30, 0x39, 0x30, 0x34, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5A, 0x30, 0x2C, 0x31, 0x2A, 0x30, + 0x28, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x21, 0x59, 0x75, 0x62, 0x69, + 0x63, 0x6F, 0x20, 0x55, 0x32, 0x46, 0x20, 0x45, 0x45, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6C, 0x20, 0x32, 0x34, 0x39, 0x31, 0x38, 0x32, 0x33, + 0x32, 0x34, 0x37, 0x37, 0x30, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2A, + 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01, 0x06, 0x08, 0x2A, 0x86, 0x48, 0xCE, + 0x3D, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x3C, 0xCA, 0xB9, 0x2C, + 0xCB, 0x97, 0x28, 0x7E, 0xE8, 0xE6, 0x39, 0x43, 0x7E, 0x21, 0xFC, 0xD6, + 0xB6, 0xF1, 0x65, 0xB2, 0xD5, 0xA3, 0xF3, 0xDB, 0x13, 0x1D, 0x31, 0xC1, + 0x6B, 0x74, 0x2B, 0xB4, 0x76, 0xD8, 0xD1, 0xE9, 0x90, 0x80, 0xEB, 0x54, + 0x6C, 0x9B, 0xBD, 0xF5, 0x56, 0xE6, 0x21, 0x0F, 0xD4, 0x27, 0x85, 0x89, + 0x9E, 0x78, 0xCC, 0x58, 0x9E, 0xBE, 0x31, 0x0F, 0x6C, 0xDB, 0x9F, 0xF4, + 0xA3, 0x3B, 0x30, 0x39, 0x30, 0x22, 0x06, 0x09, 0x2B, 0x06, 0x01, 0x04, + 0x01, 0x82, 0xC4, 0x0A, 0x02, 0x04, 0x15, 0x31, 0x2E, 0x33, 0x2E, 0x36, + 0x2E, 0x31, 0x2E, 0x34, 0x2E, 0x31, 0x2E, 0x34, 0x31, 0x34, 0x38, 0x32, + 0x2E, 0x31, 0x2E, 0x32, 0x30, 0x13, 0x06, 0x0B, 0x2B, 0x06, 0x01, 0x04, + 0x01, 0x82, 0xE5, 0x1C, 0x02, 0x01, 0x01, 0x04, 0x04, 0x03, 0x02, 0x04, + 0x30, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, + 0x01, 0x0B, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x9F, 0x9B, 0x05, + 0x22, 0x48, 0xBC, 0x4C, 0xF4, 0x2C, 0xC5, 0x99, 0x1F, 0xCA, 0xAB, 0xAC, + 0x9B, 0x65, 0x1B, 0xBE, 0x5B, 0xDC, 0xDC, 0x8E, 0xF0, 0xAD, 0x2C, 0x1C, + 0x1F, 0xFB, 0x36, 0xD1, 0x87, 0x15, 0xD4, 0x2E, 0x78, 0xB2, 0x49, 0x22, + 0x4F, 0x92, 0xC7, 0xE6, 0xE7, 0xA0, 0x5C, 0x49, 0xF0, 0xE7, 0xE4, 0xC8, + 0x81, 0xBF, 0x2E, 0x94, 0xF4, 0x5E, 0x4A, 0x21, 0x83, 0x3D, 0x74, 0x56, + 0x85, 0x1D, 0x0F, 0x6C, 0x14, 0x5A, 0x29, 0x54, 0x0C, 0x87, 0x4F, 0x30, + 0x92, 0xC9, 0x34, 0xB4, 0x3D, 0x22, 0x2B, 0x89, 0x62, 0xC0, 0xF4, 0x10, + 0xCE, 0xF1, 0xDB, 0x75, 0x89, 0x2A, 0xF1, 0x16, 0xB4, 0x4A, 0x96, 0xF5, + 0xD3, 0x5A, 0xDE, 0xA3, 0x82, 0x2F, 0xC7, 0x14, 0x6F, 0x60, 0x04, 0x38, + 0x5B, 0xCB, 0x69, 0xB6, 0x5C, 0x99, 0xE7, 0xEB, 0x69, 0x19, 0x78, 0x67, + 0x03, 0xC0, 0xD8, 0xCD, 0x41, 0xE8, 0xF7, 0x5C, 0xCA, 0x44, 0xAA, 0x8A, + 0xB7, 0x25, 0xAD, 0x8E, 0x79, 0x9F, 0xF3, 0xA8, 0x69, 0x6A, 0x6F, 0x1B, + 0x26, 0x56, 0xE6, 0x31, 0xB1, 0xE4, 0x01, 0x83, 0xC0, 0x8F, 0xDA, 0x53, + 0xFA, 0x4A, 0x8F, 0x85, 0xA0, 0x56, 0x93, 0x94, 0x4A, 0xE1, 0x79, 0xA1, + 0x33, 0x9D, 0x00, 0x2D, 0x15, 0xCA, 0xBD, 0x81, 0x00, 0x90, 0xEC, 0x72, + 0x2E, 0xF5, 0xDE, 0xF9, 0x96, 0x5A, 0x37, 0x1D, 0x41, 0x5D, 0x62, 0x4B, + 0x68, 0xA2, 0x70, 0x7C, 0xAD, 0x97, 0xBC, 0xDD, 0x17, 0x85, 0xAF, 0x97, + 0xE2, 0x58, 0xF3, 0x3D, 0xF5, 0x6A, 0x03, 0x1A, 0xA0, 0x35, 0x6D, 0x8E, + 0x8D, 0x5E, 0xBC, 0xAD, 0xC7, 0x4E, 0x07, 0x16, 0x36, 0xC6, 0xB1, 0x10, + 0xAC, 0xE5, 0xCC, 0x9B, 0x90, 0xDF, 0xEA, 0xCA, 0xE6, 0x40, 0xFF, 0x1B, + 0xB0, 0xF1, 0xFE, 0x5D, 0xB4, 0xEF, 0xF7, 0xA9, 0x5F, 0x06, 0x07, 0x33, + 0xF5, 0x30, 0x44, 0x02, 0x20, 0x08, 0xC3, 0xF8, 0xDB, 0x6E, 0x29, 0xFD, + 0x8B, 0x14, 0xD9, 0xDE, 0x1B, 0xD9, 0x8E, 0x84, 0x07, 0x2C, 0xB8, 0x13, + 0x38, 0x59, 0x89, 0xAA, 0x2C, 0xA2, 0x89, 0x39, 0x5E, 0x00, 0x09, 0xB8, + 0xB7, 0x02, 0x20, 0x26, 0x07, 0xB4, 0xF9, 0xAD, 0x05, 0xDE, 0x26, 0xF5, + 0x6F, 0x48, 0xB8, 0x25, 0x69, 0xEA, 0xD8, 0x23, 0x1A, 0x5A, 0x6C, 0x3A, + 0x14, 0x48, 0xDE, 0xAA, 0xAF, 0x15, 0xC0, 0xEF, 0x29, 0x63, 0x1A}; + +} // namespace test_data + +} // namespace device + +#endif // DEVICE_U2F_U2F_RESPONSE_TEST_DATA_H_
diff --git a/device/u2f/u2f_sign.cc b/device/u2f/u2f_sign.cc index 38142857..1a234f51 100644 --- a/device/u2f/u2f_sign.cc +++ b/device/u2f/u2f_sign.cc
@@ -14,9 +14,11 @@ U2fSign::U2fSign(const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, + std::string relying_party_id, std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb) - : U2fRequest(std::move(discoveries), cb), + const ResponseCallback& completion_callback) + : U2fRequest(std::move(relying_party_id), std::move(discoveries)), + completion_callback_(std::move(completion_callback)), registered_keys_(registered_keys), challenge_hash_(challenge_hash), app_param_(app_param), @@ -29,10 +31,12 @@ const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, + std::string relying_party_id, std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb) { + const ResponseCallback& completion_callback) { std::unique_ptr<U2fRequest> request = std::make_unique<U2fSign>( - registered_keys, challenge_hash, app_param, std::move(discoveries), cb); + registered_keys, challenge_hash, app_param, std::move(relying_party_id), + std::move(discoveries), completion_callback); request->Start(); return request; @@ -64,9 +68,10 @@ state_ = State::COMPLETE; if (it == registered_keys_.cend()) { // This was a response to a fake enrollment. Return an empty key handle. - cb_.Run(return_code, response_data, std::vector<uint8_t>()); + completion_callback_.Run(return_code, response_data, + std::vector<uint8_t>()); } else { - cb_.Run(return_code, response_data, *it); + completion_callback_.Run(return_code, response_data, *it); } break; case U2fReturnCode::CONDITIONS_NOT_SATISFIED: {
diff --git a/device/u2f/u2f_sign.h b/device/u2f/u2f_sign.h index ac48271..8f8325e 100644 --- a/device/u2f/u2f_sign.h +++ b/device/u2f/u2f_sign.h
@@ -6,6 +6,7 @@ #define DEVICE_U2F_U2F_SIGN_H_ #include <memory> +#include <string> #include <vector> #include "device/u2f/u2f_request.h" @@ -19,16 +20,18 @@ U2fSign(const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, + std::string relying_party_id, std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb); + const ResponseCallback& completion_callback); ~U2fSign() override; static std::unique_ptr<U2fRequest> TrySign( const std::vector<std::vector<uint8_t>>& registered_keys, const std::vector<uint8_t>& challenge_hash, const std::vector<uint8_t>& app_param, + std::string relying_party_id, std::vector<U2fDiscovery*> discoveries, - const ResponseCallback& cb); + const ResponseCallback& completion_callback); private: void TryDevice() override; @@ -36,6 +39,7 @@ U2fReturnCode return_code, const std::vector<uint8_t>& response_data); + ResponseCallback completion_callback_; const std::vector<std::vector<uint8_t>> registered_keys_; std::vector<uint8_t> challenge_hash_; std::vector<uint8_t> app_param_;
diff --git a/device/u2f/u2f_sign_unittest.cc b/device/u2f/u2f_sign_unittest.cc index bac79efe..912b72b 100644 --- a/device/u2f/u2f_sign_unittest.cc +++ b/device/u2f/u2f_sign_unittest.cc
@@ -13,12 +13,17 @@ #include "base/test/test_io_thread.h" #include "device/u2f/mock_u2f_device.h" #include "device/u2f/mock_u2f_discovery.h" +#include "device/u2f/u2f_response_test_data.h" #include "testing/gtest/include/gtest/gtest.h" using ::testing::_; namespace device { +namespace { +constexpr char kTestRelyingPartyId[] = "google.com"; +} + class U2fSignTest : public testing::Test { public: U2fSignTest() @@ -76,9 +81,9 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestSignCallback cb; - std::unique_ptr<U2fRequest> request = - U2fSign::TrySign(handles, std::vector<uint8_t>(32), - std::vector<uint8_t>(32), {&discovery}, cb.callback()); + std::unique_ptr<U2fRequest> request = U2fSign::TrySign( + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, cb.callback()); discovery.AddDevice(std::move(device)); std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& @@ -113,9 +118,9 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestSignCallback cb; - std::unique_ptr<U2fRequest> request = - U2fSign::TrySign(handles, std::vector<uint8_t>(32), - std::vector<uint8_t>(32), {&discovery}, cb.callback()); + std::unique_ptr<U2fRequest> request = U2fSign::TrySign( + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, cb.callback()); request->Start(); discovery.AddDevice(std::move(device)); std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& @@ -158,9 +163,9 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestSignCallback cb; - std::unique_ptr<U2fRequest> request = - U2fSign::TrySign(handles, std::vector<uint8_t>(32), - std::vector<uint8_t>(32), {&discovery}, cb.callback()); + std::unique_ptr<U2fRequest> request = U2fSign::TrySign( + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, cb.callback()); discovery.AddDevice(std::move(device)); std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& response = cb.WaitForCallback(); @@ -202,9 +207,9 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestSignCallback cb; - std::unique_ptr<U2fRequest> request = - U2fSign::TrySign(handles, std::vector<uint8_t>(32), - std::vector<uint8_t>(32), {&discovery}, cb.callback()); + std::unique_ptr<U2fRequest> request = U2fSign::TrySign( + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, cb.callback()); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); std::tuple<U2fReturnCode, std::vector<uint8_t>, std::vector<uint8_t>>& @@ -249,9 +254,9 @@ testing::Invoke(&discovery, &MockU2fDiscovery::StartSuccessAsync)); TestSignCallback cb; - std::unique_ptr<U2fRequest> request = - U2fSign::TrySign(handles, std::vector<uint8_t>(32), - std::vector<uint8_t>(32), {&discovery}, cb.callback()); + std::unique_ptr<U2fRequest> request = U2fSign::TrySign( + handles, std::vector<uint8_t>(32), std::vector<uint8_t>(32), + kTestRelyingPartyId, {&discovery}, cb.callback()); request->Start(); discovery.AddDevice(std::move(device0)); discovery.AddDevice(std::move(device1)); @@ -261,9 +266,10 @@ // Device that responded had no correct keys, so a registration response is // expected. - ASSERT_GE(1u, std::get<1>(response).size()); - EXPECT_EQ(static_cast<uint8_t>(MockU2fDevice::kRegister), - std::get<1>(response)[0]); + EXPECT_EQ( + std::vector<uint8_t>(std::begin(test_data::kTestU2fRegisterResponse), + std::end(test_data::kTestU2fRegisterResponse)), + std::get<1>(response)); // Verify that we get a blank key handle for the key that was registered. EXPECT_TRUE(std::get<2>(response).empty());
diff --git a/device/usb/usb_device_handle_usbfs.cc b/device/usb/usb_device_handle_usbfs.cc index 87d9feb..5a91d3f 100644 --- a/device/usb/usb_device_handle_usbfs.cc +++ b/device/usb/usb_device_handle_usbfs.cc
@@ -4,11 +4,7 @@ #include "device/usb/usb_device_handle_usbfs.h" -#if defined(OS_ANDROID) && __ANDROID_API__ < 21 -#include <linux/usb_ch9.h> -#else #include <linux/usb/ch9.h> -#endif #include <linux/usbdevice_fs.h> #include <sys/ioctl.h>
diff --git a/device/vr/BUILD.gn b/device/vr/BUILD.gn index e8725cf..f392cb4 100644 --- a/device/vr/BUILD.gn +++ b/device/vr/BUILD.gn
@@ -42,6 +42,7 @@ "//services/service_manager/public/cpp", "//ui/display", "//ui/gfx", + "//ui/gfx/mojo:mojo", ] if (enable_gvr_services) { @@ -227,5 +228,6 @@ "//gpu/ipc/common:interfaces", "//mojo/common:common_custom_types", "//ui/gfx/geometry/mojo", + "//ui/gfx/mojo:mojo", ] }
diff --git a/device/vr/android/gvr/gvr_delegate_provider.h b/device/vr/android/gvr/gvr_delegate_provider.h index e8ce393..9ff82cc 100644 --- a/device/vr/android/gvr/gvr_delegate_provider.h +++ b/device/vr/android/gvr/gvr_delegate_provider.h
@@ -19,10 +19,12 @@ GvrDelegateProvider() = default; virtual bool ShouldDisableGvrDevice() = 0; virtual void SetDeviceId(unsigned int device_id) = 0; - virtual void RequestWebVRPresent(mojom::VRSubmitFrameClientPtr submit_client, - mojom::VRPresentationProviderRequest request, - mojom::VRDisplayInfoPtr display_info, - base::Callback<void(bool)> callback) = 0; + virtual void RequestWebVRPresent( + mojom::VRSubmitFrameClientPtr submit_client, + mojom::VRPresentationProviderRequest request, + mojom::VRDisplayInfoPtr display_info, + device::mojom::VRRequestPresentOptionsPtr present_options, + device::mojom::VRDisplayHost::RequestPresentCallback callback) = 0; virtual void ExitWebVRPresent() = 0; virtual void OnListeningForActivateChanged(bool listening) = 0;
diff --git a/device/vr/android/gvr/gvr_device.cc b/device/vr/android/gvr/gvr_device.cc index 3e4463ab..bdcb355 100644 --- a/device/vr/android/gvr/gvr_device.cc +++ b/device/vr/android/gvr/gvr_device.cc
@@ -150,10 +150,11 @@ VRDisplayImpl* display, mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback) { GvrDelegateProvider* delegate_provider = GetGvrDelegateProvider(); if (!delegate_provider) { - std::move(callback).Run(false); + std::move(callback).Run(false, nullptr); return; } @@ -161,6 +162,7 @@ // pauses Chrome. delegate_provider->RequestWebVRPresent( std::move(submit_client), std::move(request), GetVRDisplayInfo(), + std::move(present_options), base::Bind(&GvrDevice::OnRequestPresentResult, weak_ptr_factory_.GetWeakPtr(), base::Passed(&callback), base::Unretained(display))); @@ -169,10 +171,11 @@ void GvrDevice::OnRequestPresentResult( mojom::VRDisplayHost::RequestPresentCallback callback, VRDisplayImpl* display, - bool result) { + bool result, + mojom::VRDisplayFrameTransportOptionsPtr transport_options) { if (result) SetPresentingDisplay(display); - std::move(callback).Run(result); + std::move(callback).Run(result, std::move(transport_options)); } void GvrDevice::ExitPresent() {
diff --git a/device/vr/android/gvr/gvr_device.h b/device/vr/android/gvr/gvr_device.h index 66c88ce..5cebdb6 100644 --- a/device/vr/android/gvr/gvr_device.h +++ b/device/vr/android/gvr/gvr_device.h
@@ -30,6 +30,7 @@ VRDisplayImpl* display, mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback) override; void ExitPresent() override; void PauseTracking() override; @@ -50,7 +51,8 @@ void OnRequestPresentResult( mojom::VRDisplayHost::RequestPresentCallback callback, VRDisplayImpl* display, - bool result); + bool result, + mojom::VRDisplayFrameTransportOptionsPtr transport_options); GvrDevice(); GvrDelegateProvider* GetGvrDelegateProvider();
diff --git a/device/vr/openvr/openvr_device.cc b/device/vr/openvr/openvr_device.cc index e7a36ba..e728871 100644 --- a/device/vr/openvr/openvr_device.cc +++ b/device/vr/openvr/openvr_device.cc
@@ -160,29 +160,32 @@ VRDisplayImpl* display, mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback) { if (!render_loop_->IsRunning()) render_loop_->Start(); if (!render_loop_->IsRunning()) { - std::move(callback).Run(false); + std::move(callback).Run(false, nullptr); return; } - base::Callback<void(bool)> my_callback = - base::Bind(&OpenVRDevice::OnRequestPresentResult, - weak_ptr_factory_.GetWeakPtr(), base::Passed(&callback)); + auto my_callback = + base::BindOnce(&OpenVRDevice::OnRequestPresentResult, + weak_ptr_factory_.GetWeakPtr(), std::move(callback)); render_loop_->task_runner()->PostTask( FROM_HERE, - base::Bind(&OpenVRRenderLoop::RequestPresent, render_loop_->GetWeakPtr(), - base::Passed(submit_client.PassInterface()), - base::Passed(&request), base::Passed(&my_callback))); + base::BindOnce(&OpenVRRenderLoop::RequestPresent, + render_loop_->GetWeakPtr(), submit_client.PassInterface(), + std::move(request), std::move(present_options), + std::move(my_callback))); } void OpenVRDevice::OnRequestPresentResult( mojom::VRDisplayHost::RequestPresentCallback callback, - bool result) { - std::move(callback).Run(result); + bool result, + mojom::VRDisplayFrameTransportOptionsPtr transport_options) { + std::move(callback).Run(result, std::move(transport_options)); if (result) { using ViewerMap = std::map<std::string, VrViewerType>;
diff --git a/device/vr/openvr/openvr_device.h b/device/vr/openvr/openvr_device.h index c05a4fa..046cc4db 100644 --- a/device/vr/openvr/openvr_device.h +++ b/device/vr/openvr/openvr_device.h
@@ -31,6 +31,7 @@ VRDisplayImpl* display, mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback) override; void ExitPresent() override; @@ -38,7 +39,8 @@ void OnRequestPresentResult( mojom::VRDisplayHost::RequestPresentCallback callback, - bool result); + bool result, + mojom::VRDisplayFrameTransportOptionsPtr transport_options); private: // VRDeviceBase
diff --git a/device/vr/openvr/openvr_render_loop.cc b/device/vr/openvr/openvr_render_loop.cc index 6cab4d57..f379ca73f 100644 --- a/device/vr/openvr/openvr_render_loop.cc +++ b/device/vr/openvr/openvr_render_loop.cc
@@ -103,13 +103,15 @@ void OpenVRRenderLoop::RequestPresent( mojom::VRSubmitFrameClientPtrInfo submit_client_info, mojom::VRPresentationProviderRequest request, - base::Callback<void(bool)> callback) { + device::mojom::VRRequestPresentOptionsPtr present_options, + device::mojom::VRDisplayHost::RequestPresentCallback callback) { #if defined(OS_WIN) int32_t adapter_index; vr::VRSystem()->GetDXGIOutputInfo(&adapter_index); if (!texture_helper_.SetAdapterIndex(adapter_index) || !texture_helper_.EnsureInitialized()) { - main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(callback, false)); + main_thread_task_runner_->PostTask( + FROM_HERE, base::BindOnce(std::move(callback), false, nullptr)); return; } #endif @@ -118,7 +120,17 @@ binding_.Close(); binding_.Bind(std::move(request)); - main_thread_task_runner_->PostTask(FROM_HERE, base::Bind(callback, true)); + device::mojom::VRDisplayFrameTransportOptionsPtr transport_options = + device::mojom::VRDisplayFrameTransportOptions::New(); + transport_options->transport_method = + device::mojom::VRDisplayFrameTransportMethod::SUBMIT_AS_TEXTURE_HANDLE; + // Only set boolean options that we need. Default is false, and we should be + // able to safely ignore ones that our implementation doesn't care about. + transport_options->wait_for_transfer_notification = true; + + main_thread_task_runner_->PostTask( + FROM_HERE, + base::BindOnce(std::move(callback), true, std::move(transport_options))); is_presenting_ = true; vr_compositor_->SuspendRendering(false); }
diff --git a/device/vr/openvr/openvr_render_loop.h b/device/vr/openvr/openvr_render_loop.h index cf08b6e..1b3ce8c2 100644 --- a/device/vr/openvr/openvr_render_loop.h +++ b/device/vr/openvr/openvr_render_loop.h
@@ -26,9 +26,11 @@ OpenVRRenderLoop(); ~OpenVRRenderLoop() override; - void RequestPresent(mojom::VRSubmitFrameClientPtrInfo submit_client_info, - mojom::VRPresentationProviderRequest request, - base::Callback<void(bool)> callback); + void RequestPresent( + mojom::VRSubmitFrameClientPtrInfo submit_client_info, + mojom::VRPresentationProviderRequest request, + device::mojom::VRRequestPresentOptionsPtr present_options, + device::mojom::VRDisplayHost::RequestPresentCallback callback); void ExitPresent(); base::WeakPtr<OpenVRRenderLoop> GetWeakPtr();
diff --git a/device/vr/test/fake_vr_device.cc b/device/vr/test/fake_vr_device.cc index df18e9f..1d7e45c 100644 --- a/device/vr/test/fake_vr_device.cc +++ b/device/vr/test/fake_vr_device.cc
@@ -53,9 +53,10 @@ VRDisplayImpl* display, mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback) { SetPresentingDisplay(display); - std::move(callback).Run(true); + std::move(callback).Run(true, mojom::VRDisplayFrameTransportOptions::New()); } void FakeVRDevice::ExitPresent() {
diff --git a/device/vr/test/fake_vr_device.h b/device/vr/test/fake_vr_device.h index c625909..d8b7b00 100644 --- a/device/vr/test/fake_vr_device.h +++ b/device/vr/test/fake_vr_device.h
@@ -23,6 +23,7 @@ VRDisplayImpl* display, mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback) override; void ExitPresent() override;
diff --git a/device/vr/vr_device_base.cc b/device/vr/vr_device_base.cc index 993904f..50391f82 100644 --- a/device/vr/vr_device_base.cc +++ b/device/vr/vr_device_base.cc
@@ -59,8 +59,9 @@ VRDisplayImpl* display, mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback) { - std::move(callback).Run(false); + std::move(callback).Run(false, nullptr); } void VRDeviceBase::ExitPresent() {
diff --git a/device/vr/vr_device_base.h b/device/vr/vr_device_base.h index a4d0abe..e5879aea 100644 --- a/device/vr/vr_device_base.h +++ b/device/vr/vr_device_base.h
@@ -37,6 +37,7 @@ VRDisplayImpl* display, mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback); virtual void ExitPresent(); bool IsFallbackDevice() override;
diff --git a/device/vr/vr_display_impl.cc b/device/vr/vr_display_impl.cc index 20502d8d..e47cce8d 100644 --- a/device/vr/vr_display_impl.cc +++ b/device/vr/vr_display_impl.cc
@@ -59,14 +59,15 @@ void VRDisplayImpl::RequestPresent( mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr present_options, mojom::VRDisplayHost::RequestPresentCallback callback) { if (!device_->IsAccessAllowed(this) || !InFocusedFrame()) { - std::move(callback).Run(false); + std::move(callback).Run(false, nullptr); return; } device_->RequestPresent(this, std::move(submit_client), std::move(request), - std::move(callback)); + std::move(present_options), std::move(callback)); } void VRDisplayImpl::ExitPresent() {
diff --git a/device/vr/vr_display_impl.h b/device/vr/vr_display_impl.h index 2df1b6c..9f8502d 100644 --- a/device/vr/vr_display_impl.h +++ b/device/vr/vr_display_impl.h
@@ -48,6 +48,7 @@ void RequestPresent(mojom::VRSubmitFrameClientPtr submit_client, mojom::VRPresentationProviderRequest request, + mojom::VRRequestPresentOptionsPtr options, mojom::VRDisplayHost::RequestPresentCallback callback); void ExitPresent();
diff --git a/device/vr/vr_display_impl_unittest.cc b/device/vr/vr_display_impl_unittest.cc index acbefa8..0beb419 100644 --- a/device/vr/vr_display_impl_unittest.cc +++ b/device/vr/vr_display_impl_unittest.cc
@@ -21,7 +21,9 @@ VRDisplayImplTest() {} ~VRDisplayImplTest() override {} void onDisplaySynced() {} - void onPresentComplete(bool success) { + void onPresentComplete( + bool success, + device::mojom::VRDisplayFrameTransportOptionsPtr transport_options) { is_request_presenting_success_ = success; } @@ -44,7 +46,7 @@ device::mojom::VRSubmitFrameClientPtr submit_client = nullptr; device::mojom::VRPresentationProviderRequest request = nullptr; display_impl->RequestPresent( - std::move(submit_client), std::move(request), + std::move(submit_client), std::move(request), nullptr, base::Bind(&VRDisplayImplTest::onPresentComplete, base::Unretained(this))); }
diff --git a/device/vr/vr_service.mojom b/device/vr/vr_service.mojom index 3a5a90da..b3c532d 100644 --- a/device/vr/vr_service.mojom +++ b/device/vr/vr_service.mojom
@@ -8,6 +8,7 @@ import "gpu/ipc/common/mailbox_holder.mojom"; import "gpu/ipc/common/sync_token.mojom"; import "ui/gfx/geometry/mojo/geometry.mojom"; +import "ui/gfx/mojo/gpu_fence_handle.mojom"; // A field of view, given by 4 degrees describing the view from a center point. struct VRFieldOfView { @@ -60,6 +61,39 @@ VREyeParameters? rightEye; }; +// Options supplied by the Renderer when requesting presentation. +struct VRRequestPresentOptions { + // If true, must use a render path that can preserve drawing buffer + // contents across frames. If false, each frame is drawn independently. + bool preserve_drawing_buffer; +}; + +// Frame transport method from the Renderer's point of view. +enum VRDisplayFrameTransportMethod { + NONE = 0, + + // Renderer should create a new texture handle (Windows) or + // texture mailbox (Android Surface path) containing the + // frame's image and supply that as a submitFrame argument. + SUBMIT_AS_TEXTURE_HANDLE = 1, + SUBMIT_AS_MAILBOX_HOLDER = 2, + + // Not yet implemented: Renderer should draw directly into + // a texture mailbox provided for each frame in OnVSync. + // DRAW_INTO_TEXTURE_MAILBOX = 3, +}; + +struct VRDisplayFrameTransportOptions { + VRDisplayFrameTransportMethod transport_method; + + // Booleans indicating which of the VRSubmitFrameClient callbacks + // are in use. Default is false, the device implementation should set + // the ones to true that it needs and can ignore the rest. + bool wait_for_transfer_notification; + bool wait_for_render_notification; + bool wait_for_gpu_fence; +}; + enum VRDisplayEventReason { NONE = 0, NAVIGATION = 1, @@ -90,6 +124,9 @@ // will be transferred (read from, perhaps copied to another texture), and then // rendered (submitted to the underlying VR API). // The client lives in the render process, implemented by VRDisplay. +// +// See VRDisplayFrameTransportConfiguration which configures which of these +// callbacks are in use. interface VRSubmitFrameClient { // The VRPresentationProvider calls this to indicate that the submitted frame // has been transferred, so the backing data (mailbox or GpuMemoryBuffer) can @@ -106,13 +143,25 @@ // delaying expensive tasks for a subsequent frame until the current frame has // completed. OnSubmitFrameRendered(); + + // This callback provides a GpuFence corresponding to the previous frame's + // rendering completion, intended for use with a server wait issued before + // the following wait to prevent its rendering work from competing with + // the previous frame. + OnSubmitFrameGpuFence(gfx.mojom.GpuFenceHandle gpu_fence_handle); }; + // Provides a communication channel from the renderer to the browser-side host // of a (device/) VrDisplayImpl. interface VRDisplayHost { + // The returned transport_options is marked optional: it's null for + // a failure result but must be non-null for a success result. RequestPresent(VRSubmitFrameClient client, - VRPresentationProvider& request) => (bool success); + VRPresentationProvider& request, + VRRequestPresentOptions options) => ( + bool success, + VRDisplayFrameTransportOptions? transport_options); ExitPresent(); }; @@ -134,14 +183,18 @@ // no mapping. GetVSync() => (VRPose? pose, mojo.common.mojom.TimeDelta time, int16 frame_id, VSyncStatus status); + + UpdateLayerBounds(int16 frame_id, gfx.mojom.RectF left_bounds, + gfx.mojom.RectF right_bounds, gfx.mojom.Size source_size); + + // VRDisplayFrameTransportMethod SUBMIT_AS_MAILBOX_HOLDER SubmitFrame(int16 frame_id, gpu.mojom.MailboxHolder mailbox_holder, mojo.common.mojom.TimeDelta time_waited); + // VRDisplayFrameTransportMethod SUBMIT_AS_TEXTURE_HANDLE // TODO(https://crbug.com/676224): Support preprocessing of mojom files, since // this is Windows only. SubmitFrameWithTextureHandle(int16 frameId, handle texture); - UpdateLayerBounds(int16 frame_id, gfx.mojom.RectF left_bounds, - gfx.mojom.RectF right_bounds, gfx.mojom.Size source_size); }; interface VRDisplayClient {
diff --git a/docs/debugging_with_crash_keys.md b/docs/debugging_with_crash_keys.md new file mode 100644 index 0000000..400f948 --- /dev/null +++ b/docs/debugging_with_crash_keys.md
@@ -0,0 +1,153 @@ +# Debugging with Crash Keys + +Chrome is client-side software, which means that sometimes there are bugs that +can occur only on users' machines ("in production") that cannot be reproduced by +test or software engineering. When this happens, it's often helpful to gather bug- +specific data from production to help pinpoint the cause of the crash. The crash +key logging system is a generic method to help do that. + +[TOC] + +## High-Level Overview + +The core of the crash key logging system is in [//components/crash/core/common/crash_key.h](https://cs.chromium.org/chromium/src/components/crash/core/common/crash_key.h), +which declares a `crash_reporter::CrashKeyString` class. Every crash key has +an associated value maximum length and a string name to identify it. The maximum +length is specified as a template parameter in order to allocate that amount of +space for the value up-front. When a process is crashing, memory corruption can +make it unsafe to call into the system allocator, so pre-allocating space for +the value defends against that. + +When a crash key is set, the specified value is copied to its internal storage. +And if the process subsequently crashes, the name-value tuple is uploaded as +POST form-multipart data when the crash report minidump is uploaded to the +Google crash reporting system. (The data therefore are only accessible to those +with access to crash reports internally at Google). For platforms that use +[Crashpad](https://crashpad.chromium.org) as the crash reporting platform, the +crash keys are also stored in the minidump file itself. For platforms that use +Breakpad, the keys are only available at upload. + +The crash key system is used to report some common pieces of data, not just +things that happen in exceptional cases: the URL of the webpage, command line +switches, active extension IDs, GPU vendor information, experiment/variations +information, etc. + +## Getting Started with a Single Key-Value Pair + +Imagine you are investigating a crash, and you want to know the value of some +variable when the crash occurs; the crash key logging system enables you to do +just that. + +#### 1. Declare the Crash Key + +A crash key must be allocated using static storage duration, so that there is +space for the value to be set. This can be done as a static variable in the +global or function scope, or in an anonymous namespace: + + static crash_reporter::CrashKeyString<32> crash_key_one("one"); + + namespace { + crash_reporter::CrashKeyString<64> crash_key_two("two"); + } + + void DoSomething(const std::string& arg) { + static crash_reporter::CrashKeyString<8> three("three"); + crash_key_two.Set(arg); + three.Set("true"); + } + +The template argument specifies the maximum length a value can be, and it +should include space for a trailing NUL byte. Values must be C-strings and +cannot have embedded NULs. The constructor argument is the name of the +crash key, and it is what you will use to identify your data in uploaded +crash reports. + +If you need to declare an array of crash keys (e.g., for recording N values +of an array), you can use a constructor tag to avoid warnings about `explicit`: + + static ArrayItemKey = crash_reporter::CrashKeyString<32>; + static ArrayItemKey crash_keys[] = { + {"array-item-1", ArrayItemKey::Tag::kArray}, + {"array-item-2", ArrayItemKey::Tag::kArray}, + {"array-item-3", ArrayItemKey::Tag::kArray}, + {"array-item-4", ArrayItemKey::Tag::kArray}, + }; + +The crash key system will require your target to have a dependency on +`//components/crash/core/common:crash_key`. If you encounter link errors for +unresolved symbols to `crashpad::Annotation::SetSize(unsigned int)`, adding +the dependency will resolve them. + +#### 2. Set the Crash Key + +After a key has been allocated, its `Set(base::StringPiece)` and +`Clear()` methods can be used to record and clear a value. In addition, +crash_key.h provides a `ScopedCrashKeyString` class to set the value for the +duration of a scope and clear it upon exiting. + +#### 3. Seeing the Data + +Using <http://go/crash> (internal only), find the crash report signature related +to your bug, and click on the "N of M" reports link to drill down to +report-specific information. From there, select a report and go to the +"Product Data" section to view all the crash key-value pairs. + +## Dealing with DEPS + +Not all targets in the Chromium source tree are permitted to depend on the +`//components/crash/core/common:crash_key` target due to DEPS file +`include_rules`. + +If the crash key being added is only a temporary debugging aid to track down a +crash, consider adding the dependency temporarily and removing it when done. +A specific include rule can be added for crash_key.h: + + # DEPS + include_rules = [ + '+components/crash/core/common/crash_key.h', + ] + +Then simply remove it (and the BUILD.gn dependency) once the crash is resolved +and the crash key deleted. + +If this crash key is more permanent, then there is an alternate API in //base +that can be used. This API is used by the //content module to set its permanent +crash key information. Note however that the base-level API is more limited in +terms of features and flexibility. See the header documentation in +[//base/debug/crash_logging.h](https://cs.chromium.org/chromium/src/base/debug/crash_logging.h) +for usage examples. + +## Advanced Topics: Stack Traces + +Now imagine a scenario where you have a use-after-free. The crash reports coming +in do not indicate where the object being used was initially freed, however, +just where it is later being dereferenced. To make debugging easier, it would be +nice to have the stack trace of the destructor, and the crash key system works +for that, too. + +#### 1. Declare the Crash Key + +Declaring the crash key is no different than written above, though special +attention should be paid to the maximum size argument, which will affect the +number of stack frames that are recorded. Typically a value of _1024_ is +recommended. + +#### 2. Set the Crash Key + +To set a stack trace to a crash key, use the `SetCrashKeyStringToStackTrace()` +function in crash_logging.h: + + Usemeafterfree::~Usemeafterfree() { + static crash_reporter::CrashKeyString<1024> trace_key("uaf-dtor-trace"); + crash_reporter::SetCrashKeyStringToStackTrace(&trace_key, + base::debug::StackTrace()); + } + +#### 3. Seeing the Data + +Unlike with the previous example, a stack trace will just be a string of +hexadecimal addresses. To turn the addresses back into symbols use, +<http://go/crsym> (internal instance of <https://github.com/chromium/crsym/>). +Using the **Crash Key** input type, give it a crash report ID and the name of +your crash key. Crsym will then fetch the symbol data from the internal crash +processing backends and return a formatted, symbolized stack trace.
diff --git a/docs/tour_of_luci_ui.md b/docs/tour_of_luci_ui.md index e4e8fae..d0a7cb68 100644 --- a/docs/tour_of_luci_ui.md +++ b/docs/tour_of_luci_ui.md
@@ -165,14 +165,21 @@ #### Build Results page **Buildbot Build URL:** ` -ci.chromium.org/buildbot/<group_id>/<builder_name>/<build_id>` +ci.chromium.org/buildbot/<group_id>/<builder_name>/<build_#>` **LUCI Build URL:** -`ci.chromium.org/p/<project_id>/builders/<bucket>/<builder_name>/<build_id>` +`ci.chromium.org/p/<project_id>/builders/<bucket>/<builder_name>/<build_#>` + +*Alternate LUCI Build URL: `ci.chromium.org/p/<project_id>/builds/b<buildbucket_build_id>`* This is the page describing the build and results. Contains build info, properties, result status, blame-list, steps and links to log files. The layout -is equivalent to Buildbot layout of build result pages +is equivalent to Buildbot layout of build result pages. + +Builds can also have an alternate LUCI build URL under +`ci.chromium.org/p/<project_id>/builds/b<buildbucket_build_id>` if the build does +not have a “buildnumber” property. This does not apply to Chromium builds since +all Chromium builds have a buildnumber property. 
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_delegate.h b/extensions/browser/api/media_perception_private/media_perception_api_delegate.h index 69d29ce..a8db423 100644 --- a/extensions/browser/api/media_perception_private/media_perception_api_delegate.h +++ b/extensions/browser/api/media_perception_private/media_perception_api_delegate.h
@@ -6,6 +6,7 @@ #define EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_DELEGATE_H_ #include "base/callback.h" +#include "base/files/file_path.h" #include "extensions/common/api/media_perception_private.h" namespace extensions { @@ -16,7 +17,7 @@ // the loaded component, if installation succeeded. If the component failed to // install, |mount_point| will be empty. using LoadCrOSComponentCallback = - base::OnceCallback<void(const std::string& mount_point)>; + base::OnceCallback<void(const base::FilePath& mount_point)>; virtual ~MediaPerceptionAPIDelegate() {}
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_manager.cc b/extensions/browser/api/media_perception_private/media_perception_api_manager.cc index 7ea97079..591f0751 100644 --- a/extensions/browser/api/media_perception_private/media_perception_api_manager.cc +++ b/extensions/browser/api/media_perception_private/media_perception_api_manager.cc
@@ -138,14 +138,14 @@ void MediaPerceptionAPIManager::LoadComponentCallback( APISetAnalyticsComponentCallback callback, - const std::string& mount_point) { + const base::FilePath& mount_point) { if (mount_point.empty()) { std::move(callback).Run(GetFailedToInstallComponentState()); return; } // If the new component is loaded, override the mount point. - mount_point_ = mount_point; + mount_point_ = mount_point.value(); media_perception::ComponentState component_state; component_state.status = media_perception::COMPONENT_STATUS_INSTALLED;
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_manager.h b/extensions/browser/api/media_perception_private/media_perception_api_manager.h index b136d01..b4fda310 100644 --- a/extensions/browser/api/media_perception_private/media_perception_api_manager.h +++ b/extensions/browser/api/media_perception_private/media_perception_api_manager.h
@@ -95,7 +95,7 @@ // Callback with the mount point for a loaded component. void LoadComponentCallback(APISetAnalyticsComponentCallback callback, - const std::string& mount_point); + const base::FilePath& mount_point); bool ComponentIsLoaded();
diff --git a/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc b/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc index 345f4d3..241ef16 100644 --- a/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc +++ b/extensions/browser/api/media_perception_private/media_perception_private_apitest.cc
@@ -28,22 +28,23 @@ class TestMediaPerceptionAPIDelegate : public MediaPerceptionAPIDelegate { public: - void LoadCrOSComponent( - const media_perception::ComponentType& type, - base::OnceCallback<void(const std::string&)> load_callback) override { + void LoadCrOSComponent(const media_perception::ComponentType& type, + LoadCrOSComponentCallback load_callback) override { // For testing both success and failure cases, test class has the LIGHT // component succeed install and the others fail. if (type == media_perception::COMPONENT_TYPE_LIGHT) { base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(std::move(load_callback), - "/run/imageloader/rtanalytics-light/1.0")); + FROM_HERE, + base::BindOnce( + std::move(load_callback), + base::FilePath("/run/imageloader/rtanalytics-light/1.0"))); return; } // Firing callback with empty string indicates that the installation of the // component failed. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(std::move(load_callback), "")); + FROM_HERE, base::BindOnce(std::move(load_callback), base::FilePath())); } };
diff --git a/extensions/shell/renderer/shell_content_renderer_client.cc b/extensions/shell/renderer/shell_content_renderer_client.cc index a709efef..f48f4dc 100644 --- a/extensions/shell/renderer/shell_content_renderer_client.cc +++ b/extensions/shell/renderer/shell_content_renderer_client.cc
@@ -88,6 +88,7 @@ blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, + content::ResourceType resource_type, std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles, GURL* new_url) { // TODO(jamescook): Cause an error for bad extension scheme requests?
diff --git a/extensions/shell/renderer/shell_content_renderer_client.h b/extensions/shell/renderer/shell_content_renderer_client.h index d97d5c3..5f9fb0f5 100644 --- a/extensions/shell/renderer/shell_content_renderer_client.h +++ b/extensions/shell/renderer/shell_content_renderer_client.h
@@ -40,6 +40,7 @@ blink::WebLocalFrame* frame, ui::PageTransition transition_type, const blink::WebURL& url, + content::ResourceType resource_type, std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles, GURL* new_url) override; bool IsExternalPepperPlugin(const std::string& module_name) override;
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc index 66cfb07..c0aae855 100644 --- a/gin/isolate_holder.cc +++ b/gin/isolate_holder.cc
@@ -70,12 +70,12 @@ } isolate_ = v8::Isolate::New(params); - // TODO(ssid): Make sure the task runner is never null here, crbug.com/762723. - SetUp(task_runner ? std::move(task_runner) - : base::ThreadTaskRunnerHandle::Get()); + SetUp(task_runner); } -IsolateHolder::IsolateHolder(v8::StartupData* existing_blob) +IsolateHolder::IsolateHolder( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + v8::StartupData* existing_blob) : access_mode_(AccessMode::kSingleThread) { CHECK(existing_blob); @@ -89,7 +89,8 @@ new v8::SnapshotCreator(g_reference_table, existing_blob)); isolate_ = snapshot_creator_->GetIsolate(); - SetUp(base::ThreadTaskRunnerHandle::Get()); + DCHECK(task_runner->BelongsToCurrentThread()); + SetUp(task_runner); } IsolateHolder::~IsolateHolder() {
diff --git a/gin/per_isolate_data.cc b/gin/per_isolate_data.cc index 0bc8bec..81f80577 100644 --- a/gin/per_isolate_data.cc +++ b/gin/per_isolate_data.cc
@@ -31,7 +31,7 @@ : isolate_(isolate), allocator_(allocator) { isolate_->SetData(kEmbedderNativeGin, this); - task_runner = task_runner ? task_runner : base::ThreadTaskRunnerHandle::Get(); + DCHECK(task_runner); if (access_mode == IsolateHolder::kUseLocker) { task_runner_ = std::make_shared<V8ForegroundTaskRunnerWithLocker>( isolate, task_runner);
diff --git a/gin/public/isolate_holder.h b/gin/public/isolate_holder.h index f29b2de..8ce49ff6 100644 --- a/gin/public/isolate_holder.h +++ b/gin/public/isolate_holder.h
@@ -64,7 +64,8 @@ // This constructor is to create V8 snapshot for Blink. // Note this constructor calls isolate->Enter() internally. - explicit IsolateHolder(v8::StartupData* existing_blob); + IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, + v8::StartupData* existing_blob); ~IsolateHolder();
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc index 784a49a..373ae56 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc
@@ -8,8 +8,10 @@ #include "base/allocator/partition_allocator/page_allocator.h" #include "base/bind.h" +#include "base/bit_cast.h" #include "base/debug/stack_trace.h" #include "base/location.h" +#include "base/rand_util.h" #include "base/sys_info.h" #include "base/task_scheduler/post_task.h" #include "base/task_scheduler/task_scheduler.h" @@ -100,6 +102,57 @@ base::LazyInstance<EnabledStateObserverImpl>::Leaky g_trace_state_dispatcher = LAZY_INSTANCE_INITIALIZER; +// TODO(skyostil): Deduplicate this with the clamper in Blink. +class TimeClamper { + public: + static constexpr double kResolutionSeconds = 0.001; + + TimeClamper() : secret_(base::RandUint64()) {} + + double ClampTimeResolution(double time_seconds) const { + DCHECK_GE(time_seconds, 0); + // For each clamped time interval, compute a pseudorandom transition + // threshold. The reported time will either be the start of that interval or + // the next one depending on which side of the threshold |time_seconds| is. + double clamped_time = + floor(time_seconds / kResolutionSeconds) * kResolutionSeconds; + double tick_threshold = ThresholdFor(clamped_time); + + if (time_seconds >= tick_threshold) + return clamped_time + kResolutionSeconds; + return clamped_time; + } + + private: + inline double ThresholdFor(double clamped_time) const { + uint64_t time_hash = MurmurHash3(bit_cast<int64_t>(clamped_time) ^ secret_); + return clamped_time + kResolutionSeconds * ToDouble(time_hash); + } + + static inline double ToDouble(uint64_t value) { + // Exponent for double values for [1.0 .. 2.0] + static const uint64_t kExponentBits = uint64_t{0x3FF0000000000000}; + static const uint64_t kMantissaMask = uint64_t{0x000FFFFFFFFFFFFF}; + uint64_t random = (value & kMantissaMask) | kExponentBits; + return bit_cast<double>(random) - 1; + } + + static inline uint64_t MurmurHash3(uint64_t value) { + value ^= value >> 33; + value *= uint64_t{0xFF51AFD7ED558CCD}; + value ^= value >> 33; + value *= uint64_t{0xC4CEB9FE1A85EC53}; + value ^= value >> 33; + return value; + } + + const uint64_t secret_; + DISALLOW_COPY_AND_ASSIGN(TimeClamper); +}; + +base::LazyInstance<TimeClamper>::Leaky g_time_clamper = + LAZY_INSTANCE_INITIALIZER; + } // namespace class V8Platform::TracingControllerImpl : public v8::TracingController { @@ -228,7 +281,8 @@ } double V8Platform::CurrentClockTimeMillis() { - return base::Time::Now().ToJsTime(); + double now_seconds = base::Time::Now().ToJsTime() / 1000; + return g_time_clamper.Get().ClampTimeResolution(now_seconds) * 1000; } v8::TracingController* V8Platform::GetTracingController() {
diff --git a/google_apis/drive/drive_api_parser.cc b/google_apis/drive/drive_api_parser.cc index 5b2ad14..a9a9078 100644 --- a/google_apis/drive/drive_api_parser.cc +++ b/google_apis/drive/drive_api_parser.cc
@@ -38,7 +38,7 @@ // Converts |url_string| to |result|. Always returns true to be used // for JSONValueConverter::RegisterCustomField method. // TODO(mukai): make it return false in case of invalid |url_string|. -bool GetGURLFromString(const base::StringPiece& url_string, GURL* result) { +bool GetGURLFromString(base::StringPiece url_string, GURL* result) { *result = GURL(url_string); return true; } @@ -336,7 +336,7 @@ } // static -bool DriveAppIcon::GetIconCategory(const base::StringPiece& category, +bool DriveAppIcon::GetIconCategory(base::StringPiece category, DriveAppIcon::IconCategory* result) { for (size_t i = 0; i < arraysize(kAppIconCategoryMap); i++) { if (category == kAppIconCategoryMap[i].category_name) { @@ -774,7 +774,7 @@ } // static -bool ChangeResource::GetType(const base::StringPiece& type_name, +bool ChangeResource::GetType(base::StringPiece type_name, ChangeResource::ChangeType* result) { for (size_t i = 0; i < arraysize(kChangeTypeMap); i++) { if (type_name == kChangeTypeMap[i].type_name) {
diff --git a/google_apis/drive/drive_api_parser.h b/google_apis/drive/drive_api_parser.h index fec88f80..ea25951 100644 --- a/google_apis/drive/drive_api_parser.h +++ b/google_apis/drive/drive_api_parser.h
@@ -135,8 +135,7 @@ // Extracts the icon category from the given string. Returns false and does // not change |result| when |scheme| has an unrecognizable value. - static bool GetIconCategory(const base::StringPiece& category, - IconCategory* result); + static bool GetIconCategory(base::StringPiece category, IconCategory* result); friend class base::internal::RepeatedMessageConverter<DriveAppIcon>; friend class AppResource; @@ -901,7 +900,7 @@ // Extracts the change type from the given string. Returns false and does // not change |result| when |type_name| has an unrecognizable value. - static bool GetType(const base::StringPiece& type_name, + static bool GetType(base::StringPiece type_name, ChangeResource::ChangeType* result); int64_t change_id_;
diff --git a/google_apis/drive/time_util.cc b/google_apis/drive/time_util.cc index 806e158..d3cea0c 100644 --- a/google_apis/drive/time_util.cc +++ b/google_apis/drive/time_util.cc
@@ -20,7 +20,7 @@ const char kNullTimeString[] = "null"; -bool ParseTimezone(const base::StringPiece& timezone, +bool ParseTimezone(base::StringPiece timezone, bool ahead, int* out_offset_to_utc_in_minutes) { DCHECK(out_offset_to_utc_in_minutes); @@ -42,8 +42,7 @@ } // namespace -bool GetTimeFromString(const base::StringPiece& raw_value, - base::Time* parsed_time) { +bool GetTimeFromString(base::StringPiece raw_value, base::Time* parsed_time) { base::StringPiece date; base::StringPiece time_and_tz; base::StringPiece time;
diff --git a/google_apis/drive/time_util.h b/google_apis/drive/time_util.h index f281d80..80f481e 100644 --- a/google_apis/drive/time_util.h +++ b/google_apis/drive/time_util.h
@@ -19,7 +19,7 @@ // Parses an RFC 3339 date/time into a base::Time, returning true on success. // The time string must be in the format "yyyy-mm-ddThh:mm:ss.dddTZ" (TZ is // either '+hh:mm', '-hh:mm', 'Z' (representing UTC), or an empty string). -bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time); +bool GetTimeFromString(base::StringPiece raw_value, base::Time* time); // Formats a base::Time as an RFC 3339 date/time (in UTC). // If |time| is null, returns "null".
diff --git a/gpu/BUILD.gn b/gpu/BUILD.gn index 4757a7a..8352b5b 100644 --- a/gpu/BUILD.gn +++ b/gpu/BUILD.gn
@@ -24,10 +24,8 @@ "//gpu/command_buffer/service:gles2_sources", "//gpu/command_buffer/service:service_sources", "//gpu/config:config_sources", - "//gpu/ipc:command_buffer_sources", "//gpu/ipc/client:ipc_client_sources", "//gpu/ipc/common:ipc_common_sources", - "//gpu/ipc/service:ipc_service_sources", ] } @@ -62,7 +60,8 @@ "//build/config:exe_and_shlib_deps", "//gpu/command_buffer/client:gles2_c_lib", "//gpu/command_buffer/client:gles2_implementation", - "//ui/gl:gl", + "//ui/gl", + "//ui/gl/init", ] defines = [ @@ -213,6 +212,7 @@ "//gpu/command_buffer/client:gles2_implementation", "//gpu/command_buffer/common:gles2_utils", "//gpu/ipc:gl_in_process_context", + "//gpu/ipc/service", "//testing/gmock", "//testing/gtest", "//third_party/angle:translator", @@ -220,6 +220,7 @@ "//ui/gfx:test_support", "//ui/gfx/geometry", "//ui/gl", + "//ui/gl/init", ] libs = []
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py index 31e44550..f80badc 100755 --- a/gpu/command_buffer/build_gles2_cmd_buffer.py +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -6253,21 +6253,21 @@ def WriteImmediateCmdComputeSize(self, func, f): """Overrriden from TypeHandler.""" - f.write(" static uint32_t ComputeDataSize(GLsizei n) {\n") + f.write(" static uint32_t ComputeDataSize(GLsizei _n) {\n") f.write( - " return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT\n") + " return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT\n") f.write(" }\n") f.write("\n") - f.write(" static uint32_t ComputeSize(GLsizei n) {\n") + f.write(" static uint32_t ComputeSize(GLsizei _n) {\n") f.write(" return static_cast<uint32_t>(\n") - f.write(" sizeof(ValueType) + ComputeDataSize(n)); // NOLINT\n") + f.write(" sizeof(ValueType) + ComputeDataSize(_n)); // NOLINT\n") f.write(" }\n") f.write("\n") def WriteImmediateCmdSetHeader(self, func, f): """Overrriden from TypeHandler.""" - f.write(" void SetHeader(GLsizei n) {\n") - f.write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(n));\n") + f.write(" void SetHeader(GLsizei _n) {\n") + f.write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(_n));\n") f.write(" }\n") f.write("\n") @@ -6662,21 +6662,21 @@ def WriteImmediateCmdComputeSize(self, func, f): """Overrriden from TypeHandler.""" - f.write(" static uint32_t ComputeDataSize(GLsizei n) {\n") + f.write(" static uint32_t ComputeDataSize(GLsizei _n) {\n") f.write( - " return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT\n") + " return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT\n") f.write(" }\n") f.write("\n") - f.write(" static uint32_t ComputeSize(GLsizei n) {\n") + f.write(" static uint32_t ComputeSize(GLsizei _n) {\n") f.write(" return static_cast<uint32_t>(\n") - f.write(" sizeof(ValueType) + ComputeDataSize(n)); // NOLINT\n") + f.write(" sizeof(ValueType) + ComputeDataSize(_n)); // NOLINT\n") f.write(" }\n") f.write("\n") def WriteImmediateCmdSetHeader(self, func, f): """Overrriden from TypeHandler.""" - f.write(" void SetHeader(GLsizei n) {\n") - f.write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(n));\n") + f.write(" void SetHeader(GLsizei _n) {\n") + f.write(" header.SetCmdByTotalSize<ValueType>(ComputeSize(_n));\n") f.write(" }\n") f.write("\n") @@ -7609,24 +7609,24 @@ def WriteImmediateCmdComputeSize(self, func, f): """Overrriden from TypeHandler.""" - f.write(" static uint32_t ComputeDataSize(GLsizei count) {\n") + f.write(" static uint32_t ComputeDataSize(GLsizei _n) {\n") f.write(" return static_cast<uint32_t>(\n") - f.write(" sizeof(%s) * %d * count); // NOLINT\n" % + f.write(" sizeof(%s) * %d * _n); // NOLINT\n" % (self.GetArrayType(func), self.GetArrayCount(func))) f.write(" }\n") f.write("\n") - f.write(" static uint32_t ComputeSize(GLsizei count) {\n") + f.write(" static uint32_t ComputeSize(GLsizei _n) {\n") f.write(" return static_cast<uint32_t>(\n") f.write( - " sizeof(ValueType) + ComputeDataSize(count)); // NOLINT\n") + " sizeof(ValueType) + ComputeDataSize(_n)); // NOLINT\n") f.write(" }\n") f.write("\n") def WriteImmediateCmdSetHeader(self, func, f): """Overrriden from TypeHandler.""" - f.write(" void SetHeader(GLsizei count) {\n") + f.write(" void SetHeader(GLsizei _n) {\n") f.write( - " header.SetCmdByTotalSize<ValueType>(ComputeSize(count));\n") + " header.SetCmdByTotalSize<ValueType>(ComputeSize(_n));\n") f.write(" }\n") f.write("\n")
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h index 0470e27..44bb8fb 100644 --- a/gpu/command_buffer/client/gles2_c_lib_autogen.h +++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -1766,18 +1766,13 @@ use_distance_field_text, pixel_config); } void GL_APIENTRY GLES2RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, GLfloat post_scale) { gles2::GetGLContext()->RasterCHROMIUM( - list, translate_x, translate_y, clip_x, clip_y, clip_w, clip_h, - post_translate_x, post_translate_y, post_scale); + list, provider, translate, playback_rect, post_translate, post_scale); } void GL_APIENTRY GLES2EndRasterCHROMIUM() { gles2::GetGLContext()->EndRasterCHROMIUM();
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 8c57bb0e..83423db 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -51,6 +51,7 @@ #endif #if !defined(OS_NACL) +#include "cc/paint/decode_stashing_image_provider.h" #include "cc/paint/display_item_list.h" // nogncheck #include "cc/paint/paint_op_buffer_serializer.h" #include "cc/paint/transfer_cache_entry.h" @@ -7226,9 +7227,13 @@ public: PaintOpSerializer(size_t initial_size, TransferBufferInterface* transfer_buffer, - GLES2CmdHelper* helper) + GLES2CmdHelper* helper, + cc::DecodeStashingImageProvider* stashing_image_provider, + cc::TransferCacheSerializeHelper* transfer_cache_helper) : transfer_buffer_(initial_size, helper, transfer_buffer), helper_(helper), + stashing_image_provider_(stashing_image_provider), + transfer_cache_helper_(transfer_cache_helper), free_bytes_(initial_size) { DCHECK(transfer_buffer_.valid()); } @@ -7244,7 +7249,6 @@ size_t size = op->Serialize(memory + written_bytes_, free_bytes_, options); if (!size) { SendSerializedData(); - options.transfer_cache->FlushEntries(); transfer_buffer_.Reset(kBlockAlloc); memory = static_cast<char*>(transfer_buffer_.address()); free_bytes_ = transfer_buffer_.size(); @@ -7264,6 +7268,11 @@ transfer_buffer_.Shrink(written_bytes_); helper_->RasterCHROMIUM(transfer_buffer_.shm_id(), transfer_buffer_.offset(), written_bytes_); + // Now that we've issued the RasterCHROMIUM referencing the stashed + // images, Reset the |stashing_image_provider_|, causing us to issue + // unlock commands for these images. + stashing_image_provider_->Reset(); + transfer_cache_helper_->FlushEntries(); written_bytes_ = 0; } @@ -7272,6 +7281,8 @@ ScopedTransferBufferPtr transfer_buffer_; GLES2CmdHelper* helper_; + cc::DecodeStashingImageProvider* stashing_image_provider_; + cc::TransferCacheSerializeHelper* transfer_cache_helper_; size_t written_bytes_ = 0; size_t free_bytes_ = 0; @@ -7279,29 +7290,23 @@ #endif void GLES2Implementation::RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, GLfloat post_scale) { #if defined(OS_NACL) NOTREACHED(); #else GPU_CLIENT_SINGLE_THREAD_CHECK(); GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glRasterChromium(" << list << ", " - << translate_x << ", " << translate_y << ", " << clip_x - << ", " << clip_y << ", " << clip_w << ", " << clip_h - << ", " << post_translate_x << ", " << post_translate_y - << ", " << post_scale << ")"); + << translate.ToString() << ", " << playback_rect.ToString() + << ", " << post_translate.ToString() << ", " << post_scale + << ")"); if (std::abs(post_scale) < std::numeric_limits<float>::epsilon()) return; - gfx::Rect playback_rect(clip_x, clip_y, clip_w, clip_h); gfx::Rect query_rect = gfx::ScaleToEnclosingRect(playback_rect, 1.f / post_scale); std::vector<size_t> offsets = list->rtree_.Search(query_rect); @@ -7315,27 +7320,30 @@ // This section duplicates RasterSource::PlaybackToCanvas setup preamble. cc::PaintOpBufferSerializer::Preamble preamble; - preamble.translation = - gfx::Vector2dF(SkIntToScalar(translate_x), SkIntToScalar(translate_y)); + preamble.translation = translate; preamble.playback_rect = playback_rect; - preamble.post_translation = - gfx::Vector2dF(post_translate_x, post_translate_y); + preamble.post_translation = post_translate; preamble.post_scale = post_scale; + // Wrap the provided provider in a stashing provider so that we can delay + // unrefing images until we have serialized dependent commands. + provider->BeginRaster(); + cc::DecodeStashingImageProvider stashing_image_provider(provider); + // TODO(enne): need to implement alpha folding optimization from POB. // TODO(enne): don't access private members of DisplayItemList. - PaintOpSerializer op_serializer(free_size, transfer_buffer_, helper_); + TransferCacheSerializeHelperImpl transfer_cache_serialize_helper(this); + PaintOpSerializer op_serializer(free_size, transfer_buffer_, helper_, + &stashing_image_provider, + &transfer_cache_serialize_helper); cc::PaintOpBufferSerializer::SerializeCallback serialize_cb = base::Bind( &PaintOpSerializer::Serialize, base::Unretained(&op_serializer)); - TransferCacheSerializeHelperImpl transfer_cache_serialize_helper(this); - cc::PaintOpBufferSerializer serializer(serialize_cb, nullptr, + cc::PaintOpBufferSerializer serializer(serialize_cb, &stashing_image_provider, &transfer_cache_serialize_helper); serializer.Serialize(&list->paint_op_buffer_, &offsets, preamble); DCHECK(serializer.valid()); - // TODO(vmpstr): Refactor this so that we don't have to repeat the flush calls - // in two spots. op_serializer.SendSerializedData(); - transfer_cache_serialize_helper.FlushEntries(); + provider->EndRaster(); CheckGLError(); #endif
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index 7e9fc1a9..d83627b0 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -1240,14 +1240,10 @@ GLint pixel_config) override; void RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, GLfloat post_scale) override; void EndRasterCHROMIUM() override;
diff --git a/gpu/command_buffer/client/gles2_interface.h b/gpu/command_buffer/client/gles2_interface.h index 47acec7..85aa9546 100644 --- a/gpu/command_buffer/client/gles2_interface.h +++ b/gpu/command_buffer/client/gles2_interface.h
@@ -12,7 +12,14 @@ namespace cc { class ClientTransferCacheEntry; class DisplayItemList; -} +class ImageProvider; +} // namespace cc + +namespace gfx { +class Rect; +class Vector2d; +class Vector2dF; +} // namespace gfx extern "C" typedef struct _ClientBuffer* ClientBuffer; extern "C" typedef struct _GLColorSpace* GLColorSpace;
diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h index 9d1626f2..5dcf962b 100644 --- a/gpu/command_buffer/client/gles2_interface_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -921,14 +921,10 @@ GLboolean use_distance_field_text, GLint pixel_config) = 0; virtual void RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, GLfloat post_scale) = 0; virtual void EndRasterCHROMIUM() = 0; virtual void TexStorage2DImageCHROMIUM(GLenum target,
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h index 241a82cb..c6c2eb8 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -894,14 +894,10 @@ GLboolean use_distance_field_text, GLint pixel_config) override; void RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, GLfloat post_scale) override; void EndRasterCHROMIUM() override; void TexStorage2DImageCHROMIUM(GLenum target,
diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h index 92f0e049..babadb9 100644 --- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -1200,16 +1200,13 @@ GLboolean /* can_use_lcd_text */, GLboolean /* use_distance_field_text */, GLint /* pixel_config */) {} -void GLES2InterfaceStub::RasterCHROMIUM(const cc::DisplayItemList* /* list */, - GLint /* translate_x */, - GLint /* translate_y */, - GLint /* clip_x */, - GLint /* clip_y */, - GLint /* clip_w */, - GLint /* clip_h */, - GLfloat /* post_translate_x */, - GLfloat /* post_translate_y */, - GLfloat /* post_scale */) {} +void GLES2InterfaceStub::RasterCHROMIUM( + const cc::DisplayItemList* /* list */, + cc::ImageProvider* /* provider */, + const gfx::Vector2d& /* translate */, + const gfx::Rect& /* playback_rect */, + const gfx::Vector2dF& /* post_translate */, + GLfloat /* post_scale */) {} void GLES2InterfaceStub::EndRasterCHROMIUM() {} void GLES2InterfaceStub::TexStorage2DImageCHROMIUM(GLenum /* target */, GLenum /* internalFormat */,
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h index e8e147b..a21ece0 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -894,14 +894,10 @@ GLboolean use_distance_field_text, GLint pixel_config) override; void RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, GLfloat post_scale) override; void EndRasterCHROMIUM() override; void TexStorage2DImageCHROMIUM(GLenum target,
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h index 39585093..d9f77423 100644 --- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h +++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -2568,19 +2568,16 @@ pixel_config); } -void GLES2TraceImplementation::RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, - GLfloat post_scale) { +void GLES2TraceImplementation::RasterCHROMIUM( + const cc::DisplayItemList* list, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, + GLfloat post_scale) { TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::RasterCHROMIUM"); - gl_->RasterCHROMIUM(list, translate_x, translate_y, clip_x, clip_y, clip_w, - clip_h, post_translate_x, post_translate_y, post_scale); + gl_->RasterCHROMIUM(list, provider, translate, playback_rect, post_translate, + post_scale); } void GLES2TraceImplementation::EndRasterCHROMIUM() {
diff --git a/gpu/command_buffer/client/raster_implementation_gles.cc b/gpu/command_buffer/client/raster_implementation_gles.cc index dd767ec7..2dd6f45 100644 --- a/gpu/command_buffer/client/raster_implementation_gles.cc +++ b/gpu/command_buffer/client/raster_implementation_gles.cc
@@ -276,18 +276,15 @@ pixel_config); }; -void RasterImplementationGLES::RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, - GLfloat post_scale) { - gl_->RasterCHROMIUM(list, translate_x, translate_y, clip_x, clip_y, clip_w, - clip_h, post_translate_x, post_translate_y, post_scale); +void RasterImplementationGLES::RasterCHROMIUM( + const cc::DisplayItemList* list, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, + GLfloat post_scale) { + gl_->RasterCHROMIUM(list, provider, translate, playback_rect, post_translate, + post_scale); } void RasterImplementationGLES::EndRasterCHROMIUM() {
diff --git a/gpu/command_buffer/client/raster_implementation_gles.h b/gpu/command_buffer/client/raster_implementation_gles.h index 8f5c21a..0520d74 100644 --- a/gpu/command_buffer/client/raster_implementation_gles.h +++ b/gpu/command_buffer/client/raster_implementation_gles.h
@@ -135,14 +135,10 @@ GLboolean use_distance_field_text, GLint pixel_config) override; void RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, GLfloat post_scale) override; void EndRasterCHROMIUM() override;
diff --git a/gpu/command_buffer/client/raster_implementation_gles_unittest.cc b/gpu/command_buffer/client/raster_implementation_gles_unittest.cc index eba45b06..23025cb 100644 --- a/gpu/command_buffer/client/raster_implementation_gles_unittest.cc +++ b/gpu/command_buffer/client/raster_implementation_gles_unittest.cc
@@ -141,17 +141,13 @@ GLboolean can_use_lcd_text, GLboolean use_distance_field_text, GLint pixel_config)); - MOCK_METHOD10(RasterCHROMIUM, - void(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, - GLfloat post_scale)); + MOCK_METHOD6(RasterCHROMIUM, + void(const cc::DisplayItemList* list, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, + GLfloat post_scale)); MOCK_METHOD0(EndRasterCHROMIUM, void()); MOCK_METHOD2(PixelStorei, void(GLenum pname, GLint param)); @@ -619,24 +615,18 @@ TEST_F(RasterImplementationGLESTest, RasterCHROMIUM) { scoped_refptr<cc::DisplayItemList> display_list = new cc::DisplayItemList; - const GLint translate_x = 1; - const GLint translate_y = 2; - const GLint clip_x = 3; - const GLint clip_y = 4; - const GLint clip_w = 5; - const GLint clip_h = 6; - const GLfloat post_translate_x = 7.0f; - const GLfloat post_translate_y = 8.0f; + cc::ImageProvider* image_provider = nullptr; + const gfx::Vector2d translate(1, 2); + const gfx::Rect playback_rect(3, 4, 5, 6); + const gfx::Vector2dF post_translate(7.0f, 8.0f); const GLfloat post_scale = 9.0f; - EXPECT_CALL( - *gl_, RasterCHROMIUM(display_list.get(), translate_x, translate_y, clip_x, - clip_y, clip_w, clip_h, post_translate_x, - post_translate_y, post_scale)) + EXPECT_CALL(*gl_, + RasterCHROMIUM(display_list.get(), image_provider, translate, + playback_rect, post_translate, post_scale)) .Times(1); - ri_->RasterCHROMIUM(display_list.get(), translate_x, translate_y, clip_x, - clip_y, clip_w, clip_h, post_translate_x, - post_translate_y, post_scale); + ri_->RasterCHROMIUM(display_list.get(), image_provider, translate, + playback_rect, post_translate, post_scale); } TEST_F(RasterImplementationGLESTest, EndRasterCHROMIUM) {
diff --git a/gpu/command_buffer/client/raster_interface.h b/gpu/command_buffer/client/raster_interface.h index 95ebcd0..2793107 100644 --- a/gpu/command_buffer/client/raster_interface.h +++ b/gpu/command_buffer/client/raster_interface.h
@@ -11,8 +11,15 @@ namespace cc { class DisplayItemList; +class ImageProvider; } // namespace cc +namespace gfx { +class Rect; +class Vector2d; +class Vector2dF; +} // namespace gfx + extern "C" typedef struct _ClientBuffer* ClientBuffer; extern "C" typedef struct _GLColorSpace* GLColorSpace; @@ -141,14 +148,10 @@ GLboolean use_distance_field_text, GLint pixel_config) = 0; virtual void RasterCHROMIUM(const cc::DisplayItemList* list, - GLint translate_x, - GLint translate_y, - GLint clip_x, - GLint clip_y, - GLint clip_w, - GLint clip_h, - GLfloat post_translate_x, - GLfloat post_translate_y, + cc::ImageProvider* provider, + const gfx::Vector2d& translate, + const gfx::Rect& playback_rect, + const gfx::Vector2dF& post_translate, GLfloat post_scale) = 0; virtual void EndRasterCHROMIUM() = 0;
diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt index b878b92..5ce0a63 100644 --- a/gpu/command_buffer/cmd_buffer_functions.txt +++ b/gpu/command_buffer/cmd_buffer_functions.txt
@@ -378,7 +378,7 @@ // Extension CHROMIUM_raster_transport GL_APICALL void GL_APIENTRY glBeginRasterCHROMIUM (GLuint texture_id, GLuint sk_color, GLuint msaa_sample_count, GLboolean can_use_lcd_text, GLboolean use_distance_field_text, GLint pixel_config); -GL_APICALL void GL_APIENTRY glRasterCHROMIUM (const cc::DisplayItemList* list, GLint translate_x, GLint translate_y, GLint clip_x, GLint clip_y, GLint clip_w, GLint clip_h, GLfloat post_translate_x, GLfloat post_translate_y, GLfloat post_scale); +GL_APICALL void GL_APIENTRY glRasterCHROMIUM (const cc::DisplayItemList* list, cc::ImageProvider* provider, const gfx::Vector2d& translate, const gfx::Rect& playback_rect, const gfx::Vector2dF& post_translate, GLfloat post_scale); GL_APICALL void GL_APIENTRY glEndRasterCHROMIUM (void); GL_APICALL void GL_APIENTRY glCreateTransferCacheEntryINTERNAL (GLuint entry_type, GLuint entry_id, GLuint handle_shm_id, GLuint handle_shm_offset, GLuint data_shm_id, GLuint data_shm_offset, GLuint data_size); GL_APICALL void GL_APIENTRY glDeleteTransferCacheEntryINTERNAL (GLuint entry_type, GLuint entry_id);
diff --git a/gpu/command_buffer/common/capabilities.cc b/gpu/command_buffer/common/capabilities.cc index f774c89..409dd98e 100644 --- a/gpu/command_buffer/common/capabilities.cc +++ b/gpu/command_buffer/common/capabilities.cc
@@ -12,4 +12,6 @@ Capabilities::Capabilities(const Capabilities& other) = default; +Capabilities::~Capabilities() = default; + } // namespace gpu
diff --git a/gpu/command_buffer/common/capabilities.h b/gpu/command_buffer/common/capabilities.h index 9247748e..a27f69e 100644 --- a/gpu/command_buffer/common/capabilities.h +++ b/gpu/command_buffer/common/capabilities.h
@@ -6,8 +6,10 @@ #define GPU_COMMAND_BUFFER_COMMON_CAPABILITIES_H_ #include <stdint.h> +#include <vector> #include "gpu/gpu_export.h" +#include "ui/gfx/buffer_types.h" // From gl2.h. We want to avoid including gl headers because client-side and // service-side headers conflict. @@ -46,6 +48,7 @@ Capabilities(); Capabilities(const Capabilities& other); + ~Capabilities(); template <typename T> void VisitStagePrecisions(unsigned stage, @@ -181,6 +184,8 @@ int major_version = 2; int minor_version = 0; + + std::vector<gfx::BufferUsageAndFormat> texture_target_exception_list; }; } // namespace gpu
diff --git a/gpu/command_buffer/common/cmd_buffer_common.h b/gpu/command_buffer/common/cmd_buffer_common.h index 38acf4a..71ffd8d6e 100644 --- a/gpu/command_buffer/common/cmd_buffer_common.h +++ b/gpu/command_buffer/common/cmd_buffer_common.h
@@ -373,9 +373,7 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - void SetHeader(uint32_t size) { - header.SetCmdBySize<ValueType>(size); - } + void SetHeader(uint32_t _size) { header.SetCmdBySize<ValueType>(_size); } void Init(uint32_t _bucket_id, uint32_t _offset, @@ -561,4 +559,3 @@ } // namespace gpu #endif // GPU_COMMAND_BUFFER_COMMON_CMD_BUFFER_COMMON_H_ -
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h index 2bcfd00..8c0d0c8 100644 --- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h +++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -2384,17 +2384,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, const GLuint* _buffers) { @@ -2426,17 +2426,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, const GLuint* _framebuffers) { @@ -2500,17 +2500,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, const GLuint* _renderbuffers) { @@ -2542,17 +2542,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, const GLuint* _samplers) { @@ -2648,17 +2648,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, const GLuint* _textures) { @@ -2690,17 +2690,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, const GLuint* _ids) { @@ -3374,17 +3374,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, GLuint* _buffers) { @@ -3449,17 +3449,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, GLuint* _framebuffers) { @@ -3491,17 +3491,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, GLuint* _renderbuffers) { @@ -3533,17 +3533,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, GLuint* _samplers) { @@ -3575,17 +3575,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, GLuint* _textures) { @@ -3617,17 +3617,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, GLuint* _ids) { @@ -6112,17 +6112,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLenum) * 1 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLenum) * 1 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLenum _target, GLsizei _count, const GLenum* _attachments) { @@ -6161,17 +6161,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLenum) * 1 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLenum) * 1 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLenum _target, @@ -8424,17 +8424,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 1 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 1 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLfloat* _v) { @@ -8505,17 +8505,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLint) * 1 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLint) * 1 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLint* _v) { @@ -8587,17 +8587,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLuint) * 1 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * 1 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLuint* _v) { @@ -8672,17 +8672,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 2 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 2 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLfloat* _v) { @@ -8757,17 +8757,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLint) * 2 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLint) * 2 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLint* _v) { @@ -8843,17 +8843,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLuint) * 2 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * 2 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLuint* _v) { @@ -8932,17 +8932,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 3 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 3 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLfloat* _v) { @@ -9021,17 +9021,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLint) * 3 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLint) * 3 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLint* _v) { @@ -9111,17 +9111,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLuint) * 3 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * 3 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLuint* _v) { @@ -9209,17 +9209,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 4 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 4 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLfloat* _v) { @@ -9307,17 +9307,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLint) * 4 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLint) * 4 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLint* _v) { @@ -9406,17 +9406,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLuint) * 4 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * 4 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, GLsizei _count, const GLuint* _v) { @@ -9493,17 +9493,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 4 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 4 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -9550,17 +9550,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 6 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 6 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -9607,17 +9607,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 8 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 8 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -9664,17 +9664,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 9 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 9 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -9721,17 +9721,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 6 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 6 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -9778,17 +9778,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 12 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 12 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -9835,17 +9835,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 16 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 16 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -9892,17 +9892,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 8 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 8 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -9949,17 +9949,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLfloat) * 12 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLfloat) * 12 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLint _location, @@ -11149,17 +11149,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, GLuint* _queries) { @@ -11191,17 +11191,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, const GLuint* _queries) { @@ -11576,17 +11576,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, GLuint* _arrays) { @@ -11618,17 +11618,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei n) { - return static_cast<uint32_t>(sizeof(GLuint) * n); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei n) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(n)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei n) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(n)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _n, const GLuint* _arrays) { @@ -13151,17 +13151,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLenum) * 1 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLenum) * 1 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLenum _target, GLsizei _count, const GLenum* _attachments) { @@ -13346,17 +13346,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(2); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLenum) * 1 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLenum) * 1 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _count, const GLenum* _bufs) { @@ -13650,17 +13650,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLuint) * 1 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLuint) * 1 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _count, const GLuint* _textures) { @@ -15757,17 +15757,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLint) * 4 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLint) * 4 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLsizei _count, const GLint* _rects) { @@ -16403,17 +16403,17 @@ static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; static const uint8_t cmd_flags = CMD_FLAG_SET_TRACE_LEVEL(3); - static uint32_t ComputeDataSize(GLsizei count) { - return static_cast<uint32_t>(sizeof(GLint) * 4 * count); // NOLINT + static uint32_t ComputeDataSize(GLsizei _n) { + return static_cast<uint32_t>(sizeof(GLint) * 4 * _n); // NOLINT } - static uint32_t ComputeSize(GLsizei count) { + static uint32_t ComputeSize(GLsizei _n) { return static_cast<uint32_t>(sizeof(ValueType) + - ComputeDataSize(count)); // NOLINT + ComputeDataSize(_n)); // NOLINT } - void SetHeader(GLsizei count) { - header.SetCmdByTotalSize<ValueType>(ComputeSize(count)); + void SetHeader(GLsizei _n) { + header.SetCmdByTotalSize<ValueType>(ComputeSize(_n)); } void Init(GLenum _mode, GLsizei _count, const GLint* _box) {
diff --git a/gpu/command_buffer/common/gpu_memory_buffer_support.cc b/gpu/command_buffer/common/gpu_memory_buffer_support.cc index 9ef3050..0be7441 100644 --- a/gpu/command_buffer/common/gpu_memory_buffer_support.cc +++ b/gpu/command_buffer/common/gpu_memory_buffer_support.cc
@@ -178,4 +178,12 @@ #endif } +GPU_EXPORT uint32_t GetBufferTextureTarget(gfx::BufferUsage usage, + gfx::BufferFormat format, + const Capabilities& capabilities) { + bool found = base::ContainsValue(capabilities.texture_target_exception_list, + gfx::BufferUsageAndFormat(usage, format)); + return found ? gpu::GetPlatformSpecificTextureTarget() : GL_TEXTURE_2D; +} + } // namespace gpu
diff --git a/gpu/command_buffer/common/gpu_memory_buffer_support.h b/gpu/command_buffer/common/gpu_memory_buffer_support.h index 6e6de27e..d5fe853 100644 --- a/gpu/command_buffer/common/gpu_memory_buffer_support.h +++ b/gpu/command_buffer/common/gpu_memory_buffer_support.h
@@ -33,6 +33,12 @@ // Returns the texture target to use with native GpuMemoryBuffers. GPU_EXPORT uint32_t GetPlatformSpecificTextureTarget(); +// Returns the texture target to be used for the given |usage| and |format| +// based on |capabilities|. +GPU_EXPORT uint32_t GetBufferTextureTarget(gfx::BufferUsage usage, + gfx::BufferFormat format, + const Capabilities& capabilities); + } // namespace gpu #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_BUFFER_SUPPORT_H_
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index ace8739..ca95f2c 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -4036,6 +4036,8 @@ feature_info_->feature_flags().chromium_texture_storage_image; caps.supports_oop_raster = supports_oop_raster_; caps.chromium_gpu_fence = feature_info_->feature_flags().chromium_gpu_fence; + caps.texture_target_exception_list = + group_->gpu_preferences().texture_target_exception_list; return caps; } @@ -17911,7 +17913,7 @@ for (int ii = 0; ii < levels; ++ii) { uint32_t size; if (is_compressed_format) { - GLsizei level_size; + GLsizei level_size; if (!GetCompressedTexSizeInBytes(function_name, level_width, level_height, level_depth, internal_format, &level_size)) {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc index da59dd0..ef758a40 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -691,24 +691,15 @@ GLint num_texture_units = 0; api()->glGetIntegervFn(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &num_texture_units); + if (num_texture_units > static_cast<GLint>(kMaxTextureUnits)) { + Destroy(true); + LOG(ERROR) << "kMaxTextureUnits (" << kMaxTextureUnits + << ") must be at least GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS (" + << num_texture_units << ")."; + return gpu::ContextResult::kFatalFailure; + } active_texture_unit_ = 0; - bound_textures_[GL_TEXTURE_2D].resize(num_texture_units); - bound_textures_[GL_TEXTURE_CUBE_MAP].resize(num_texture_units); - if (feature_info_->gl_version_info().IsAtLeastGLES(3, 0)) { - bound_textures_[GL_TEXTURE_2D_ARRAY].resize(num_texture_units); - bound_textures_[GL_TEXTURE_3D].resize(num_texture_units); - } - if (feature_info_->gl_version_info().IsAtLeastGLES(3, 1)) { - bound_textures_[GL_TEXTURE_2D_MULTISAMPLE].resize(num_texture_units); - } - if (feature_info_->feature_flags().oes_egl_image_external || - feature_info_->feature_flags().nv_egl_stream_consumer_external) { - bound_textures_[GL_TEXTURE_EXTERNAL_OES].resize(num_texture_units); - } - if (feature_info_->feature_flags().arb_texture_rectangle) { - bound_textures_[GL_TEXTURE_RECTANGLE_ARB].resize(num_texture_units); - } // Initialize the tracked buffer bindings bound_buffers_[GL_ARRAY_BUFFER] = 0; @@ -847,16 +838,14 @@ pending_read_pixels_.clear(); } - if (!have_context) { - for (const auto& bound_texture_type : bound_textures_) { - for (const auto& bound_texture : bound_texture_type.second) { - if (bound_texture.texture) { - bound_texture.texture->MarkContextLost(); - } + for (auto& bound_texture_type : bound_textures_) { + for (auto& bound_texture : bound_texture_type) { + if (!have_context && bound_texture.texture) { + bound_texture.texture->MarkContextLost(); } + bound_texture.texture = nullptr; } } - bound_textures_.clear(); DeleteServiceObjects(&framebuffer_id_map_, have_context, [this](GLuint client_id, GLuint framebuffer) { @@ -1185,6 +1174,8 @@ caps.dc_layers = !offscreen_ && surface_->SupportsDCLayers(); caps.texture_npot = feature_info_->feature_flags().npot_ok; caps.chromium_gpu_fence = feature_info_->feature_flags().chromium_gpu_fence; + caps.texture_target_exception_list = + group_->gpu_preferences().texture_target_exception_list; // TODO: // caps.commit_overlay_planes @@ -1423,7 +1414,9 @@ // Binding an image to a texture requires that the texture is currently // bound. scoped_refptr<TexturePassthrough> current_texture = - bound_textures_[bind_target][active_texture_unit_].texture; + bound_textures_[static_cast<size_t>(GLenumToTextureTarget(bind_target))] + [active_texture_unit_] + .texture; bool bind_new_texture = current_texture != passthrough_texture; if (bind_new_texture) { api()->glBindTextureFn(bind_target, passthrough_texture->service_id()); @@ -1928,7 +1921,8 @@ TexturePassthrough* texture) { GLuint texture_service_id = texture ? texture->service_id() : 0; size_t cur_texture_unit = active_texture_unit_; - auto& target_bound_textures = bound_textures_.at(target); + auto& target_bound_textures = + bound_textures_[static_cast<size_t>(GLenumToTextureTarget(target))]; for (size_t bound_texture_index = 0; bound_texture_index < target_bound_textures.size(); bound_texture_index++) { @@ -1969,7 +1963,8 @@ } const BoundTexture& bound_texture = - bound_textures_[GL_TEXTURE_2D][active_texture_unit_]; + bound_textures_[static_cast<size_t>(TextureTarget::k2D)] + [active_texture_unit_]; if (bound_texture.texture == nullptr) { InsertError(GL_INVALID_OPERATION, "No texture bound"); return error::kNoError; @@ -2025,6 +2020,29 @@ return false; } +// static +GLES2DecoderPassthroughImpl::TextureTarget +GLES2DecoderPassthroughImpl::GLenumToTextureTarget(GLenum target) { + switch (target) { + case GL_TEXTURE_2D: + return TextureTarget::k2D; + case GL_TEXTURE_CUBE_MAP: + return TextureTarget::kCubeMap; + case GL_TEXTURE_2D_ARRAY: + return TextureTarget::k2DArray; + case GL_TEXTURE_3D: + return TextureTarget::k3D; + case GL_TEXTURE_2D_MULTISAMPLE: + return TextureTarget::k2DMultisample; + case GL_TEXTURE_EXTERNAL_OES: + return TextureTarget::kExternal; + case GL_TEXTURE_RECTANGLE_ARB: + return TextureTarget::kRectangle; + default: + return TextureTarget::kUnkown; + } +} + #define GLES2_CMD_OP(name) \ { \ &GLES2DecoderPassthroughImpl::Handle##name, cmds::name::kArgFlags, \
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h index cdce850a0..06aba64b43 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -457,6 +457,20 @@ // State tracking of currently bound 2D textures (client IDs) size_t active_texture_unit_; + enum class TextureTarget : uint8_t { + k2D = 0, + kCubeMap = 1, + k2DArray = 2, + k3D = 3, + k2DMultisample = 4, + kExternal = 5, + kRectangle = 6, + + kUnkown = 7, + kCount = kUnkown, + }; + static TextureTarget GLenumToTextureTarget(GLenum target); + struct BoundTexture { BoundTexture(); ~BoundTexture(); @@ -468,7 +482,14 @@ GLuint client_id = 0; scoped_refptr<TexturePassthrough> texture; }; - std::unordered_map<GLenum, std::vector<BoundTexture>> bound_textures_; + + // Use a limit that is at least ANGLE's IMPLEMENTATION_MAX_ACTIVE_TEXTURES + // constant + static constexpr size_t kMaxTextureUnits = 64; + static constexpr size_t kNumTextureTypes = + static_cast<size_t>(TextureTarget::kCount); + std::array<std::array<BoundTexture, kMaxTextureUnits>, kNumTextureTypes> + bound_textures_; // State tracking of currently bound buffers std::unordered_map<GLenum, GLuint> bound_buffers_;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc index 41da9d2..1b1fef6f 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
@@ -326,6 +326,8 @@ } active_texture_unit_ = static_cast<size_t>(texture) - GL_TEXTURE0; + DCHECK(active_texture_unit_ < kMaxTextureUnits); + return error::kNoError; } @@ -461,8 +463,7 @@ } // Track the currently bound textures - DCHECK(bound_textures_.find(target) != bound_textures_.end()); - DCHECK(bound_textures_[target].size() > active_texture_unit_); + DCHECK(GLenumToTextureTarget(target) != TextureTarget::kUnkown); scoped_refptr<TexturePassthrough> texture_passthrough = nullptr; if (service_id != 0) { @@ -478,7 +479,9 @@ } } - BoundTexture* bound_texture = &bound_textures_[target][active_texture_unit_]; + BoundTexture* bound_texture = + &bound_textures_[static_cast<size_t>(GLenumToTextureTarget(target))] + [active_texture_unit_]; bound_texture->client_id = texture; bound_texture->texture = std::move(texture_passthrough); @@ -946,7 +949,8 @@ for (GLsizei ii = 0; ii < n; ++ii) { GLuint client_id = textures[ii]; scoped_refptr<TexturePassthrough> texture = nullptr; - if (!resources_->texture_object_map.GetServiceID(client_id, &texture)) { + if (!resources_->texture_object_map.GetServiceID(client_id, &texture) || + texture == nullptr) { // Delete with DeleteHelper non_mailbox_client_ids.push_back(client_id); } else { @@ -4016,7 +4020,8 @@ } const BoundTexture& bound_texture = - bound_textures_[GL_TEXTURE_2D][active_texture_unit_]; + bound_textures_[static_cast<size_t>(TextureTarget::k2D)] + [active_texture_unit_]; if (bound_texture.texture == nullptr) { InsertError(GL_INVALID_OPERATION, "No texture bound"); return error::kNoError;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_commands.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_commands.cc index 8cc4498..896a239 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_commands.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_unittest_commands.cc
@@ -1,162 +1,162 @@ -// Copyright 2017 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 <stdint.h> - -#include "gpu/command_buffer/service/gles2_cmd_decoder.h" -#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" - -namespace gpu { -namespace gles2 { - -using namespace cmds; - -template <typename T> -class GLES2DecoderPassthroughFixedCommandTest - : public GLES2DecoderPassthroughTest {}; -TYPED_TEST_CASE_P(GLES2DecoderPassthroughFixedCommandTest); - -TYPED_TEST_P(GLES2DecoderPassthroughFixedCommandTest, InvalidCommand) { - TypeParam cmd; - cmd.SetHeader(); - EXPECT_EQ(error::kUnknownCommand, this->ExecuteCmd(cmd)); -} -REGISTER_TYPED_TEST_CASE_P(GLES2DecoderPassthroughFixedCommandTest, - InvalidCommand); - -template <typename T> -class GLES2DecoderPassthroughImmediateNoArgCommandTest - : public GLES2DecoderPassthroughTest {}; -TYPED_TEST_CASE_P(GLES2DecoderPassthroughImmediateNoArgCommandTest); - -TYPED_TEST_P(GLES2DecoderPassthroughImmediateNoArgCommandTest, InvalidCommand) { - TypeParam& cmd = *(this->template GetImmediateAs<TypeParam>()); - cmd.SetHeader(); - EXPECT_EQ(error::kUnknownCommand, this->ExecuteImmediateCmd(cmd, 64)); -} -REGISTER_TYPED_TEST_CASE_P(GLES2DecoderPassthroughImmediateNoArgCommandTest, - InvalidCommand); - -template <typename T> -class GLES2DecoderPassthroughImmediateSizeArgCommandTest - : public GLES2DecoderPassthroughTest {}; -TYPED_TEST_CASE_P(GLES2DecoderPassthroughImmediateSizeArgCommandTest); - -TYPED_TEST_P(GLES2DecoderPassthroughImmediateSizeArgCommandTest, - InvalidCommand) { - TypeParam& cmd = *(this->template GetImmediateAs<TypeParam>()); - cmd.SetHeader(0); - EXPECT_EQ(error::kUnknownCommand, this->ExecuteImmediateCmd(cmd, 0)); -} -REGISTER_TYPED_TEST_CASE_P(GLES2DecoderPassthroughImmediateSizeArgCommandTest, - InvalidCommand); - -using ES3FixedCommandTypes0 = - ::testing::Types<BindBufferBase, - BindBufferRange, - BindSampler, - BindTransformFeedback, - ClearBufferfi, - ClientWaitSync, - CopyBufferSubData, - CompressedTexImage3D, - CompressedTexImage3DBucket, - CompressedTexSubImage3D, - CompressedTexSubImage3DBucket, - CopyTexSubImage3D, - DeleteSync, - FenceSync, - FlushMappedBufferRange, - FramebufferTextureLayer, - GetActiveUniformBlockiv, - GetActiveUniformBlockName, - GetActiveUniformsiv, - GetBufferSubDataAsyncCHROMIUM, - GetFragDataLocation, - GetBufferParameteri64v, - GetInteger64v, - GetInteger64i_v, - GetIntegeri_v, - GetInternalformativ, - GetSamplerParameterfv, - GetSamplerParameteriv, - GetSynciv, - GetUniformBlockIndex, - GetUniformBlocksCHROMIUM, - GetUniformsES3CHROMIUM, - GetTransformFeedbackVarying, - GetTransformFeedbackVaryingsCHROMIUM, - GetUniformuiv, - GetUniformIndices, - GetVertexAttribIiv, - GetVertexAttribIuiv, - IsSampler, - IsSync, - IsTransformFeedback, - MapBufferRange, - PauseTransformFeedback, - ReadBuffer, - ResumeTransformFeedback, - SamplerParameterf, - SamplerParameteri, - TexImage3D, - TexStorage3D, - TexSubImage3D>; - -using ES3FixedCommandTypes1 = ::testing::Types<TransformFeedbackVaryingsBucket, - Uniform1ui, - Uniform2ui, - Uniform3ui, - Uniform4ui, - UniformBlockBinding, - UnmapBuffer, - VertexAttribI4i, - VertexAttribI4ui, - VertexAttribIPointer, - WaitSync, - BeginTransformFeedback, - EndTransformFeedback>; - -using ES3ImmediateNoArgCommandTypes0 = - ::testing::Types<ClearBufferivImmediate, - ClearBufferuivImmediate, - ClearBufferfvImmediate, - SamplerParameterfvImmediate, - SamplerParameterfvImmediate, - VertexAttribI4ivImmediate, - VertexAttribI4uivImmediate>; - -using ES3ImmediateSizeArgCommandTypes0 = - ::testing::Types<DeleteSamplersImmediate, - DeleteTransformFeedbacksImmediate, - GenTransformFeedbacksImmediate, - InvalidateFramebufferImmediate, - InvalidateSubFramebufferImmediate, - Uniform1uivImmediate, - Uniform2uivImmediate, - Uniform3uivImmediate, - Uniform4uivImmediate, - UniformMatrix2x3fvImmediate, - UniformMatrix2x4fvImmediate, - UniformMatrix3x2fvImmediate, - UniformMatrix3x4fvImmediate, - UniformMatrix4x2fvImmediate, - UniformMatrix4x3fvImmediate>; - -INSTANTIATE_TYPED_TEST_CASE_P(0, - GLES2DecoderPassthroughFixedCommandTest, - ES3FixedCommandTypes0); -INSTANTIATE_TYPED_TEST_CASE_P(1, - GLES2DecoderPassthroughFixedCommandTest, - ES3FixedCommandTypes1); -INSTANTIATE_TYPED_TEST_CASE_P(0, - GLES2DecoderPassthroughImmediateNoArgCommandTest, - ES3ImmediateNoArgCommandTypes0); -INSTANTIATE_TYPED_TEST_CASE_P( - 0, - GLES2DecoderPassthroughImmediateSizeArgCommandTest, - ES3ImmediateSizeArgCommandTypes0); - -} // namespace gles2 -} // namespace gpu +// Copyright 2017 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 <stdint.h> + +#include "gpu/command_buffer/service/gles2_cmd_decoder.h" +#include "gpu/command_buffer/service/gles2_cmd_decoder_unittest.h" + +namespace gpu { +namespace gles2 { + +using namespace cmds; + +template <typename T> +class GLES2DecoderPassthroughFixedCommandTest + : public GLES2DecoderPassthroughTest {}; +TYPED_TEST_CASE_P(GLES2DecoderPassthroughFixedCommandTest); + +TYPED_TEST_P(GLES2DecoderPassthroughFixedCommandTest, InvalidCommand) { + TypeParam cmd; + cmd.SetHeader(); + EXPECT_EQ(error::kUnknownCommand, this->ExecuteCmd(cmd)); +} +REGISTER_TYPED_TEST_CASE_P(GLES2DecoderPassthroughFixedCommandTest, + InvalidCommand); + +template <typename T> +class GLES2DecoderPassthroughImmediateNoArgCommandTest + : public GLES2DecoderPassthroughTest {}; +TYPED_TEST_CASE_P(GLES2DecoderPassthroughImmediateNoArgCommandTest); + +TYPED_TEST_P(GLES2DecoderPassthroughImmediateNoArgCommandTest, InvalidCommand) { + TypeParam& cmd = *(this->template GetImmediateAs<TypeParam>()); + cmd.SetHeader(); + EXPECT_EQ(error::kUnknownCommand, this->ExecuteImmediateCmd(cmd, 64)); +} +REGISTER_TYPED_TEST_CASE_P(GLES2DecoderPassthroughImmediateNoArgCommandTest, + InvalidCommand); + +template <typename T> +class GLES2DecoderPassthroughImmediateSizeArgCommandTest + : public GLES2DecoderPassthroughTest {}; +TYPED_TEST_CASE_P(GLES2DecoderPassthroughImmediateSizeArgCommandTest); + +TYPED_TEST_P(GLES2DecoderPassthroughImmediateSizeArgCommandTest, + InvalidCommand) { + TypeParam& cmd = *(this->template GetImmediateAs<TypeParam>()); + cmd.SetHeader(0); + EXPECT_EQ(error::kUnknownCommand, this->ExecuteImmediateCmd(cmd, 0)); +} +REGISTER_TYPED_TEST_CASE_P(GLES2DecoderPassthroughImmediateSizeArgCommandTest, + InvalidCommand); + +using ES3FixedCommandTypes0 = + ::testing::Types<BindBufferBase, + BindBufferRange, + BindSampler, + BindTransformFeedback, + ClearBufferfi, + ClientWaitSync, + CopyBufferSubData, + CompressedTexImage3D, + CompressedTexImage3DBucket, + CompressedTexSubImage3D, + CompressedTexSubImage3DBucket, + CopyTexSubImage3D, + DeleteSync, + FenceSync, + FlushMappedBufferRange, + FramebufferTextureLayer, + GetActiveUniformBlockiv, + GetActiveUniformBlockName, + GetActiveUniformsiv, + GetBufferSubDataAsyncCHROMIUM, + GetFragDataLocation, + GetBufferParameteri64v, + GetInteger64v, + GetInteger64i_v, + GetIntegeri_v, + GetInternalformativ, + GetSamplerParameterfv, + GetSamplerParameteriv, + GetSynciv, + GetUniformBlockIndex, + GetUniformBlocksCHROMIUM, + GetUniformsES3CHROMIUM, + GetTransformFeedbackVarying, + GetTransformFeedbackVaryingsCHROMIUM, + GetUniformuiv, + GetUniformIndices, + GetVertexAttribIiv, + GetVertexAttribIuiv, + IsSampler, + IsSync, + IsTransformFeedback, + MapBufferRange, + PauseTransformFeedback, + ReadBuffer, + ResumeTransformFeedback, + SamplerParameterf, + SamplerParameteri, + TexImage3D, + TexStorage3D, + TexSubImage3D>; + +using ES3FixedCommandTypes1 = ::testing::Types<TransformFeedbackVaryingsBucket, + Uniform1ui, + Uniform2ui, + Uniform3ui, + Uniform4ui, + UniformBlockBinding, + UnmapBuffer, + VertexAttribI4i, + VertexAttribI4ui, + VertexAttribIPointer, + WaitSync, + BeginTransformFeedback, + EndTransformFeedback>; + +using ES3ImmediateNoArgCommandTypes0 = + ::testing::Types<ClearBufferivImmediate, + ClearBufferuivImmediate, + ClearBufferfvImmediate, + SamplerParameterfvImmediate, + SamplerParameterfvImmediate, + VertexAttribI4ivImmediate, + VertexAttribI4uivImmediate>; + +using ES3ImmediateSizeArgCommandTypes0 = + ::testing::Types<DeleteSamplersImmediate, + DeleteTransformFeedbacksImmediate, + GenTransformFeedbacksImmediate, + InvalidateFramebufferImmediate, + InvalidateSubFramebufferImmediate, + Uniform1uivImmediate, + Uniform2uivImmediate, + Uniform3uivImmediate, + Uniform4uivImmediate, + UniformMatrix2x3fvImmediate, + UniformMatrix2x4fvImmediate, + UniformMatrix3x2fvImmediate, + UniformMatrix3x4fvImmediate, + UniformMatrix4x2fvImmediate, + UniformMatrix4x3fvImmediate>; + +INSTANTIATE_TYPED_TEST_CASE_P(0, + GLES2DecoderPassthroughFixedCommandTest, + ES3FixedCommandTypes0); +INSTANTIATE_TYPED_TEST_CASE_P(1, + GLES2DecoderPassthroughFixedCommandTest, + ES3FixedCommandTypes1); +INSTANTIATE_TYPED_TEST_CASE_P(0, + GLES2DecoderPassthroughImmediateNoArgCommandTest, + ES3ImmediateNoArgCommandTypes0); +INSTANTIATE_TYPED_TEST_CASE_P( + 0, + GLES2DecoderPassthroughImmediateSizeArgCommandTest, + ES3ImmediateSizeArgCommandTypes0); + +} // namespace gles2 +} // namespace gpu
diff --git a/gpu/command_buffer/service/gpu_preferences.h b/gpu/command_buffer/service/gpu_preferences.h index c4c3015..ceedb16 100644 --- a/gpu/command_buffer/service/gpu_preferences.h +++ b/gpu/command_buffer/service/gpu_preferences.h
@@ -6,12 +6,14 @@ #define GPU_COMMAND_BUFFER_SERVICE_GPU_PREFERENCES_H_ #include <stddef.h> +#include <vector> #include "base/macros.h" #include "build/build_config.h" #include "gpu/command_buffer/common/constants.h" #include "gpu/gpu_export.h" #include "media/media_features.h" +#include "ui/gfx/buffer_types.h" namespace gpu { @@ -44,6 +46,9 @@ // Disables hardware acceleration of video decode, where available. bool disable_accelerated_video_decode = false; + // Disables hardware acceleration of video decode, where available. + bool disable_accelerated_video_encode = false; + // Causes the GPU process to display a dialog on launch. bool gpu_startup_dialog = false; @@ -54,9 +59,6 @@ // Starts the GPU sandbox before creating a GL context. bool gpu_sandbox_start_early = false; - // Disables VA-API accelerated video encode. ChromeOS only. - bool disable_vaapi_accelerated_video_encode = false; - // Disables HW encode acceleration for WebRTC. bool disable_web_rtc_hw_encoding = false; @@ -157,6 +159,10 @@ // Disable using a single multiplanar GpuMemoryBuffer to store biplanar // VideoFrames (e.g. NV12), see https://crbug.com/791676. bool disable_biplanar_gpu_memory_buffers_for_video_frames = false; + + // List of texture usage & formats that require use of a platform specific + // texture target. + std::vector<gfx::BufferUsageAndFormat> texture_target_exception_list; }; } // namespace gpu
diff --git a/gpu/command_buffer/service/mailbox_manager_factory.h b/gpu/command_buffer/service/mailbox_manager_factory.h index 2faffcd..87bd888 100644 --- a/gpu/command_buffer/service/mailbox_manager_factory.h +++ b/gpu/command_buffer/service/mailbox_manager_factory.h
@@ -6,6 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_MAILBOX_MANAGER_FACTORY_H_ #include "gpu/command_buffer/service/mailbox_manager.h" +#include "gpu/gpu_export.h" namespace gpu { @@ -13,8 +14,8 @@ namespace gles2 { -std::unique_ptr<MailboxManager> CreateMailboxManager( - const GpuPreferences& gpu_preferences); +std::unique_ptr<MailboxManager> GPU_EXPORT +CreateMailboxManager(const GpuPreferences& gpu_preferences); } // namespace gles2 } // namespace gpu
diff --git a/gpu/command_buffer/service/raster_decoder.cc b/gpu/command_buffer/service/raster_decoder.cc index 34d599d..dc893e9d 100644 --- a/gpu/command_buffer/service/raster_decoder.cc +++ b/gpu/command_buffer/service/raster_decoder.cc
@@ -191,6 +191,8 @@ gpu::Capabilities caps; caps.gpu_rasterization = true; caps.supports_oop_raster = true; + caps.texture_target_exception_list = + group_->gpu_preferences().texture_target_exception_list; return caps; }
diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_list.json index 32e3883c..a74301de 100644 --- a/gpu/config/gpu_driver_bug_list.json +++ b/gpu/config/gpu_driver_bug_list.json
@@ -2776,6 +2776,19 @@ "features": [ "disable_es3_gl_context" ] + }, + { + "id": 254, + "description": "Limit MSAA samples to 4x on AMD Stoney", + "cr_bugs": [798936], + "os": { + "type" : "chromeos" + }, + "vendor_id": "0x1002", + "device_id": ["0x98e4"], + "features": [ + "max_msaa_sample_count_4" + ] } ] }
diff --git a/gpu/config/gpu_driver_bug_workaround_type.h b/gpu/config/gpu_driver_bug_workaround_type.h index 156bc97..e5ee729 100644 --- a/gpu/config/gpu_driver_bug_workaround_type.h +++ b/gpu/config/gpu_driver_bug_workaround_type.h
@@ -155,6 +155,8 @@ max_copy_texture_chromium_size_262144) \ GPU_OP(MAX_FRAGMENT_UNIFORM_VECTORS_32, \ max_fragment_uniform_vectors_32) \ + GPU_OP(MAX_MSAA_SAMPLE_COUNT_4, \ + max_msaa_sample_count_4) \ GPU_OP(MAX_TEXTURE_SIZE_LIMIT_4096, \ max_texture_size_limit_4096) \ GPU_OP(MAX_VARYING_VECTORS_16, \
diff --git a/gpu/gles2_conform_support/egl/BUILD.gn b/gpu/gles2_conform_support/egl/BUILD.gn index edc1ed7b..622671c 100644 --- a/gpu/gles2_conform_support/egl/BUILD.gn +++ b/gpu/gles2_conform_support/egl/BUILD.gn
@@ -37,5 +37,6 @@ "//ui/gfx", "//ui/gfx/geometry", "//ui/gl", + "//ui/gl/init", ] }
diff --git a/gpu/ipc/BUILD.gn b/gpu/ipc/BUILD.gn index e5c68ea..aec82e98 100644 --- a/gpu/ipc/BUILD.gn +++ b/gpu/ipc/BUILD.gn
@@ -4,67 +4,40 @@ import("//build/config/ui.gni") -group("command_buffer") { - if (is_component_build) { - public_deps = [ - "//gpu", - ] - } else { - public_deps = [ - ":command_buffer_sources", - ] - } -} - -if (is_component_build) { - link_target_type = "source_set" -} else { - link_target_type = "static_library" -} -target(link_target_type, "command_buffer_sources") { - visibility = [ "//gpu/*" ] - +component("gl_in_process_context") { sources = [ + "gl_in_process_context.cc", + "gl_in_process_context.h", + "gl_in_process_context_export.h", "gpu_in_process_thread_service.cc", "gpu_in_process_thread_service.h", "in_process_command_buffer.cc", "in_process_command_buffer.h", ] - configs += [ "//gpu:gpu_implementation" ] - - deps = [ - "//base", - "//gpu/command_buffer/client:client_sources", - "//gpu/command_buffer/common:common_sources", - "//gpu/command_buffer/service:gles2_sources", - "//gpu/command_buffer/service:service_sources", - "//gpu/config:config_sources", - "//gpu/ipc/client:ipc_client_sources", - "//gpu/ipc/service:ipc_service_sources", - "//ui/gfx", - "//ui/gl", - "//ui/gl/init", - ] -} - -component("gl_in_process_context") { - sources = [ - "gl_in_process_context.cc", - "gl_in_process_context.h", - "gl_in_process_context_export.h", - ] - defines = [ "GL_IN_PROCESS_CONTEXT_IMPLEMENTATION" ] deps = [ - ":command_buffer", "//base", "//base/third_party/dynamic_annotations", - "//gpu", + + # crbug.com/799267: crash_key needs to be added explicitly for Windows and + # Mac even though it's not directly referenced, because it's being + # implicitly depended upon by gpu/config/gpu_crash_keys.h but deps (even + # public ones) are not transitive for static libraries. + "//components/crash/core/common:crash_key", + "//gpu/command_buffer/client", + "//gpu/command_buffer/client:gles2_cmd_helper", "//gpu/command_buffer/client:gles2_implementation", - "//gpu/ipc:command_buffer", + "//gpu/command_buffer/common", + "//gpu/command_buffer/service", + "//gpu/command_buffer/service:gles2", + "//gpu/config", + "//gpu/ipc/client", + "//gpu/ipc/service", + "//ui/gfx", "//ui/gfx/geometry", "//ui/gl", + "//ui/gl/init", ] }
diff --git a/gpu/ipc/client/BUILD.gn b/gpu/ipc/client/BUILD.gn index af8652b..893723183 100644 --- a/gpu/ipc/client/BUILD.gn +++ b/gpu/ipc/client/BUILD.gn
@@ -64,6 +64,7 @@ "//mojo/public/cpp/system", "//ui/base/", "//ui/gfx/ipc", + "//ui/gfx/ipc/buffer_types", "//ui/gfx/ipc/geometry", "//ui/gl", "//url/ipc:url_ipc",
diff --git a/gpu/ipc/common/BUILD.gn b/gpu/ipc/common/BUILD.gn index 746024e..bf9d6f4c 100644 --- a/gpu/ipc/common/BUILD.gn +++ b/gpu/ipc/common/BUILD.gn
@@ -61,11 +61,12 @@ public_deps = [ "//gpu/command_buffer/common:common_sources", "//ipc", + "//ui/gfx/ipc", ] deps = [ "//base", - "//ui/gfx/ipc", + "//ui/gfx/ipc/buffer_types", "//ui/gfx/ipc/geometry", ] } @@ -107,6 +108,7 @@ "//gpu/config:config_sources", "//ui/base", "//ui/gfx/ipc", + "//ui/gfx/ipc/buffer_types", "//ui/gfx/ipc/geometry", "//ui/gl", "//url/ipc:url_ipc", @@ -116,16 +118,12 @@ sources += [ "android/scoped_surface_request_conduit.cc", "android/scoped_surface_request_conduit.h", - ] - } - - if (is_android) { - sources += [ "gpu_surface_lookup.cc", "gpu_surface_lookup.h", "gpu_surface_tracker.cc", "gpu_surface_tracker.h", ] + libs = [ "android" ] } if (use_ozone) { @@ -161,6 +159,7 @@ public_deps = [ "//mojo/common:common_custom_types", "//ui/gfx/geometry/mojo", + "//ui/gfx/mojo", ] }
diff --git a/gpu/ipc/common/flush_params.h b/gpu/ipc/common/flush_params.h index a88a915..257b534a 100644 --- a/gpu/ipc/common/flush_params.h +++ b/gpu/ipc/common/flush_params.h
@@ -13,7 +13,7 @@ namespace gpu { -struct FlushParams { +struct GPU_EXPORT FlushParams { FlushParams(); FlushParams(const FlushParams& other); FlushParams(FlushParams&& other);
diff --git a/gpu/ipc/common/gpu_command_buffer_traits_multi.h b/gpu/ipc/common/gpu_command_buffer_traits_multi.h index 52f7d580..237dbd3 100644 --- a/gpu/ipc/common/gpu_command_buffer_traits_multi.h +++ b/gpu/ipc/common/gpu_command_buffer_traits_multi.h
@@ -11,6 +11,7 @@ #include "gpu/gpu_export.h" #include "ipc/ipc_message_utils.h" #include "ipc/param_traits_macros.h" +#include "ui/gfx/ipc/buffer_types/gfx_param_traits.h" #include "ui/gfx/ipc/geometry/gfx_param_traits.h" #include "ui/gl/gpu_preference.h" @@ -117,6 +118,7 @@ IPC_STRUCT_TRAITS_MEMBER(color_buffer_half_float_rgba) IPC_STRUCT_TRAITS_MEMBER(image_ycbcr_422) IPC_STRUCT_TRAITS_MEMBER(image_ycbcr_420v) + IPC_STRUCT_TRAITS_MEMBER(image_ycbcr_420v_disabled_for_video_frames) IPC_STRUCT_TRAITS_MEMBER(render_buffer_format_bgra8888) IPC_STRUCT_TRAITS_MEMBER(occlusion_query) IPC_STRUCT_TRAITS_MEMBER(occlusion_query_boolean) @@ -139,6 +141,8 @@ IPC_STRUCT_TRAITS_MEMBER(major_version) IPC_STRUCT_TRAITS_MEMBER(minor_version) + + IPC_STRUCT_TRAITS_MEMBER(texture_target_exception_list) IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_BEGIN(gpu::CommandBuffer::State)
diff --git a/gpu/ipc/common/gpu_preferences.mojom b/gpu/ipc/common/gpu_preferences.mojom index 5f70088..45428f6 100644 --- a/gpu/ipc/common/gpu_preferences.mojom +++ b/gpu/ipc/common/gpu_preferences.mojom
@@ -5,6 +5,8 @@ // gpu/command_buffer/service/gpu_preferences.h module gpu.mojom; +import "ui/gfx/mojo/buffer_types.mojom"; + // gpu::GpuPreferences::VpxDecodeVendors enum VpxDecodeVendors { VPX_VENDOR_NONE = 0, @@ -18,12 +20,11 @@ bool single_process; bool in_process_gpu; bool disable_accelerated_video_decode; + bool disable_accelerated_video_encode; bool gpu_startup_dialog; bool disable_gpu_watchdog; bool gpu_sandbox_start_early; - bool disable_vaapi_accelerated_video_encode; - bool disable_web_rtc_hw_encoding; // TODO(http://crbug.com/676224) Support preprocessing of mojoms. Following @@ -57,4 +58,5 @@ bool enable_gpu_service_tracing; bool use_passthrough_cmd_decoder; bool disable_biplanar_gpu_memory_buffers_for_video_frames; + array<gfx.mojom.BufferUsageAndFormat> texture_target_exception_list; };
diff --git a/gpu/ipc/common/gpu_preferences_struct_traits.h b/gpu/ipc/common/gpu_preferences_struct_traits.h index a05f76a..7abc721 100644 --- a/gpu/ipc/common/gpu_preferences_struct_traits.h +++ b/gpu/ipc/common/gpu_preferences_struct_traits.h
@@ -5,7 +5,9 @@ #ifndef GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ #define GPU_IPC_COMMON_GPU_PREFERENCES_STRUCT_TRAITS_H_ +#include "gpu/command_buffer/service/gpu_preferences.h" #include "gpu/ipc/common/gpu_preferences.mojom.h" +#include "ui/gfx/mojo/buffer_types_struct_traits.h" namespace mojo { @@ -56,11 +58,11 @@ out->in_process_gpu = prefs.in_process_gpu(); out->disable_accelerated_video_decode = prefs.disable_accelerated_video_decode(); + out->disable_accelerated_video_encode = + prefs.disable_accelerated_video_encode(); out->gpu_startup_dialog = prefs.gpu_startup_dialog(); out->disable_gpu_watchdog = prefs.disable_gpu_watchdog(); out->gpu_sandbox_start_early = prefs.gpu_sandbox_start_early(); - out->disable_vaapi_accelerated_video_encode = - prefs.disable_vaapi_accelerated_video_encode(); out->disable_web_rtc_hw_encoding = prefs.disable_web_rtc_hw_encoding(); if (!prefs.ReadEnableAcceleratedVpxDecode( &out->enable_accelerated_vpx_decode)) @@ -99,6 +101,16 @@ out->use_passthrough_cmd_decoder = prefs.use_passthrough_cmd_decoder(); out->disable_biplanar_gpu_memory_buffers_for_video_frames = prefs.disable_biplanar_gpu_memory_buffers_for_video_frames(); + + mojo::ArrayDataView<gfx::mojom::BufferUsageAndFormatDataView> + usage_and_format_list; + prefs.GetTextureTargetExceptionListDataView(&usage_and_format_list); + for (size_t i = 0; i < usage_and_format_list.size(); ++i) { + gfx::BufferUsageAndFormat usage_format; + if (!usage_and_format_list.Read(i, &usage_format)) + return false; + out->texture_target_exception_list.push_back(usage_format); + } return true; } @@ -112,6 +124,10 @@ const gpu::GpuPreferences& prefs) { return prefs.disable_accelerated_video_decode; } + static bool disable_accelerated_video_encode( + const gpu::GpuPreferences& prefs) { + return prefs.disable_accelerated_video_encode; + } static bool gpu_startup_dialog(const gpu::GpuPreferences& prefs) { return prefs.gpu_startup_dialog; } @@ -122,11 +138,6 @@ return prefs.gpu_sandbox_start_early; } - static bool disable_vaapi_accelerated_video_encode( - const gpu::GpuPreferences& prefs) { - return prefs.disable_vaapi_accelerated_video_encode; - } - static bool disable_web_rtc_hw_encoding(const gpu::GpuPreferences& prefs) { return prefs.disable_web_rtc_hw_encoding; } @@ -221,6 +232,10 @@ const gpu::GpuPreferences& prefs) { return prefs.disable_biplanar_gpu_memory_buffers_for_video_frames; } + static const std::vector<gfx::BufferUsageAndFormat>& + texture_target_exception_list(const gpu::GpuPreferences& input) { + return input.texture_target_exception_list; + } }; } // namespace mojo
diff --git a/gpu/ipc/common/gpu_preferences_util_unittest.cc b/gpu/ipc/common/gpu_preferences_util_unittest.cc index 8a354c6..65d032c 100644 --- a/gpu/ipc/common/gpu_preferences_util_unittest.cc +++ b/gpu/ipc/common/gpu_preferences_util_unittest.cc
@@ -32,7 +32,13 @@ } // namespace -TEST(GpuPreferencesUtilTest, EncodeDecode) { +// TODO(https://crbug.com/799458): Fix this test. +#if defined(OS_WIN) +#define MAYBE_EncodeDecode DISABLED_EncodeDecode +#else +#define MAYBE_EncodeDecode EncodeDecode +#endif +TEST(GpuPreferencesUtilTest, MAYBE_EncodeDecode) { { // Testing default values. ScopedGpuPreferences scoped_input_prefs, scoped_decoded_prefs; GpuPreferences& input_prefs = scoped_input_prefs.Ref(); @@ -66,10 +72,10 @@ GPU_PREFERENCES_FIELD(single_process, true) GPU_PREFERENCES_FIELD(in_process_gpu, true) GPU_PREFERENCES_FIELD(disable_accelerated_video_decode, true) + GPU_PREFERENCES_FIELD(disable_accelerated_video_encode, true) GPU_PREFERENCES_FIELD(gpu_startup_dialog, true) GPU_PREFERENCES_FIELD(disable_gpu_watchdog, true) GPU_PREFERENCES_FIELD(gpu_sandbox_start_early, true) - GPU_PREFERENCES_FIELD(disable_vaapi_accelerated_video_encode, true) GPU_PREFERENCES_FIELD(disable_web_rtc_hw_encoding, true) GPU_PREFERENCES_FIELD(enable_accelerated_vpx_decode, GpuPreferences::VPX_VENDOR_AMD)
diff --git a/gpu/ipc/gpu_in_process_thread_service.h b/gpu/ipc/gpu_in_process_thread_service.h index 4cdd9a96..a9bcece6 100644 --- a/gpu/ipc/gpu_in_process_thread_service.h +++ b/gpu/ipc/gpu_in_process_thread_service.h
@@ -8,7 +8,7 @@ #include "base/compiler_specific.h" #include "base/single_thread_task_runner.h" #include "gpu/command_buffer/service/mailbox_manager.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/gl_in_process_context_export.h" #include "gpu/ipc/in_process_command_buffer.h" #include "ui/gl/gl_share_group.h" @@ -16,7 +16,7 @@ // Default Service class when no service is specified. GpuInProcessThreadService // is used by Mus and unit tests. -class GPU_EXPORT GpuInProcessThreadService +class GL_IN_PROCESS_CONTEXT_EXPORT GpuInProcessThreadService : public gpu::InProcessCommandBuffer::Service, public base::RefCountedThreadSafe<GpuInProcessThreadService> { public:
diff --git a/gpu/ipc/in_process_command_buffer.h b/gpu/ipc/in_process_command_buffer.h index 7f181e8d..69a5c39 100644 --- a/gpu/ipc/in_process_command_buffer.h +++ b/gpu/ipc/in_process_command_buffer.h
@@ -34,7 +34,7 @@ #include "gpu/command_buffer/service/service_discardable_manager.h" #include "gpu/command_buffer/service/service_transfer_cache.h" #include "gpu/config/gpu_feature_info.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/gl_in_process_context_export.h" #include "gpu/ipc/service/image_transport_surface_delegate.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/native_widget_types.h" @@ -82,11 +82,12 @@ // example GPU thread) when being run in single process mode. // However, the behavior for accessing one context (i.e. one instance of this // class) from different client threads is undefined. -class GPU_EXPORT InProcessCommandBuffer : public CommandBuffer, - public GpuControl, - public CommandBufferServiceClient, - public gles2::GLES2DecoderClient, - public ImageTransportSurfaceDelegate { +class GL_IN_PROCESS_CONTEXT_EXPORT InProcessCommandBuffer + : public CommandBuffer, + public GpuControl, + public CommandBufferServiceClient, + public gles2::GLES2DecoderClient, + public ImageTransportSurfaceDelegate { public: class Service;
diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn index 24aac683..11b63a8 100644 --- a/gpu/ipc/service/BUILD.gn +++ b/gpu/ipc/service/BUILD.gn
@@ -8,25 +8,8 @@ import("//build/config/mac/mac_sdk.gni") } -group("service") { - if (is_component_build) { - public_deps = [ - "//gpu", - ] - } else { - public_deps = [ - ":ipc_service_sources", - ] - } -} - -if (is_component_build) { - link_target_type = "source_set" -} else { - link_target_type = "static_library" -} -target(link_target_type, "ipc_service_sources") { - visibility = [ "//gpu/*" ] +component("service") { + output_name = "gpu_ipc_service" sources = [ "command_buffer_stub.cc", "command_buffer_stub.h", @@ -59,7 +42,7 @@ "switches.cc", "switches.h", ] - configs += [ "//gpu:gpu_implementation" ] + defines = [ "GPU_IPC_SERVICE_IMPLEMENTATION" ] public_deps = [ "//base", "//ipc", @@ -74,11 +57,17 @@ ] deps = [ "//base/third_party/dynamic_annotations", - "//gpu/command_buffer/common:common_sources", - "//gpu/command_buffer/service:gles2_sources", - "//gpu/command_buffer/service:service_sources", - "//gpu/config:config_sources", - "//gpu/ipc/common:ipc_common_sources", + + # crbug.com/799267: crash_key needs to be added explicitly for Windows and + # Mac even though it's not directly referenced, because it's being + # implicitly depended upon by gpu/config/gpu_crash_keys.h but deps (even + # public ones) are not transitive for static libraries. + "//components/crash/core/common:crash_key", + "//gpu/command_buffer/common", + "//gpu/command_buffer/service", + "//gpu/command_buffer/service:gles2", + "//gpu/config", + "//gpu/ipc/common", ] libs = [] ldflags = [] @@ -111,8 +100,10 @@ deps += [ "//ui/accelerated_widget_mac" ] lib_dirs = [ "$mac_sdk_path/usr/lib" ] libs += [ - "QuartzCore.framework", "CoreGraphics.framework", + "IOSurface.framework", + "OpenGL.framework", + "QuartzCore.framework", ] } if (is_android) { @@ -134,6 +125,7 @@ } if (use_x11) { sources += [ "x_util.h" ] + libs += [ "X11" ] } if (use_ozone) { deps += [ "//ui/ozone" ]
diff --git a/gpu/ipc/service/command_buffer_stub.h b/gpu/ipc/service/command_buffer_stub.h index d82b612..41a915fc 100644 --- a/gpu/ipc/service/command_buffer_stub.h +++ b/gpu/ipc/service/command_buffer_stub.h
@@ -24,8 +24,8 @@ #include "gpu/command_buffer/service/context_group.h" #include "gpu/command_buffer/service/gles2_cmd_decoder.h" #include "gpu/command_buffer/service/sequence_id.h" -#include "gpu/gpu_export.h" #include "gpu/ipc/common/surface_handle.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/gpu_memory_manager.h" #include "ipc/ipc_listener.h" #include "ipc/ipc_sender.h" @@ -48,7 +48,7 @@ class GpuChannel; class SyncPointClientState; -class GPU_EXPORT CommandBufferStub +class GPU_IPC_SERVICE_EXPORT CommandBufferStub : public IPC::Listener, public IPC::Sender, public CommandBufferServiceClient,
diff --git a/gpu/ipc/service/direct_composition_child_surface_win.h b/gpu/ipc/service/direct_composition_child_surface_win.h index 315530dc..4550a9f 100644 --- a/gpu/ipc/service/direct_composition_child_surface_win.h +++ b/gpu/ipc/service/direct_composition_child_surface_win.h
@@ -10,12 +10,13 @@ #include <dcomp.h> #include <wrl/client.h> -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "ui/gl/gl_surface_egl.h" namespace gpu { -class GPU_EXPORT DirectCompositionChildSurfaceWin : public gl::GLSurfaceEGL { +class GPU_IPC_SERVICE_EXPORT DirectCompositionChildSurfaceWin + : public gl::GLSurfaceEGL { public: DirectCompositionChildSurfaceWin(const gfx::Size& size, bool is_hdr,
diff --git a/gpu/ipc/service/direct_composition_surface_win.h b/gpu/ipc/service/direct_composition_surface_win.h index ccb16e9..f135c1d 100644 --- a/gpu/ipc/service/direct_composition_surface_win.h +++ b/gpu/ipc/service/direct_composition_surface_win.h
@@ -12,8 +12,8 @@ #include "base/memory/weak_ptr.h" #include "gpu/config/gpu_driver_bug_workarounds.h" -#include "gpu/gpu_export.h" #include "gpu/ipc/service/child_window_win.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/image_transport_surface_delegate.h" #include "ui/gl/gl_image.h" #include "ui/gl/gl_surface_egl.h" @@ -23,7 +23,8 @@ class DCLayerTree; class DirectCompositionChildSurfaceWin; -class GPU_EXPORT DirectCompositionSurfaceWin : public gl::GLSurfaceEGL { +class GPU_IPC_SERVICE_EXPORT DirectCompositionSurfaceWin + : public gl::GLSurfaceEGL { public: DirectCompositionSurfaceWin( std::unique_ptr<gfx::VSyncProvider> vsync_provider,
diff --git a/gpu/ipc/service/gles2_command_buffer_stub.h b/gpu/ipc/service/gles2_command_buffer_stub.h index 27f56741..ff4921f 100644 --- a/gpu/ipc/service/gles2_command_buffer_stub.h +++ b/gpu/ipc/service/gles2_command_buffer_stub.h
@@ -12,7 +12,7 @@ namespace gpu { -class GPU_EXPORT GLES2CommandBufferStub +class GPU_IPC_SERVICE_EXPORT GLES2CommandBufferStub : public CommandBufferStub, public ImageTransportSurfaceDelegate, public base::SupportsWeakPtr<GLES2CommandBufferStub> {
diff --git a/gpu/ipc/service/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc index 48b97f93..281195c 100644 --- a/gpu/ipc/service/gpu_channel.cc +++ b/gpu/ipc/service/gpu_channel.cc
@@ -77,7 +77,8 @@ // - forwards messages to child message filters // - posts control and out of order messages to the main thread // - forwards other messages to the scheduler -class GPU_EXPORT GpuChannelMessageFilter : public IPC::MessageFilter { +class GPU_IPC_SERVICE_EXPORT GpuChannelMessageFilter + : public IPC::MessageFilter { public: GpuChannelMessageFilter( GpuChannel* gpu_channel,
diff --git a/gpu/ipc/service/gpu_channel.h b/gpu/ipc/service/gpu_channel.h index 9e27b4f..31e857f 100644 --- a/gpu/ipc/service/gpu_channel.h +++ b/gpu/ipc/service/gpu_channel.h
@@ -21,8 +21,8 @@ #include "build/build_config.h" #include "gpu/command_buffer/common/context_result.h" #include "gpu/command_buffer/service/sync_point_manager.h" -#include "gpu/gpu_export.h" #include "gpu/ipc/service/command_buffer_stub.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/gpu_memory_manager.h" #include "ipc/ipc_sender.h" #include "ipc/ipc_sync_channel.h" @@ -45,7 +45,7 @@ class GpuChannelManager; class GpuChannelMessageFilter; -class GPU_EXPORT FilteredSender : public IPC::Sender { +class GPU_IPC_SERVICE_EXPORT FilteredSender : public IPC::Sender { public: FilteredSender(); ~FilteredSender() override; @@ -54,7 +54,7 @@ virtual void RemoveFilter(IPC::MessageFilter* filter) = 0; }; -class GPU_EXPORT SyncChannelFilteredSender : public FilteredSender { +class GPU_IPC_SERVICE_EXPORT SyncChannelFilteredSender : public FilteredSender { public: SyncChannelFilteredSender( IPC::ChannelHandle channel_handle, @@ -75,7 +75,8 @@ // Encapsulates an IPC channel between the GPU process and one renderer // process. On the renderer side there's a corresponding GpuChannelHost. -class GPU_EXPORT GpuChannel : public IPC::Listener, public FilteredSender { +class GPU_IPC_SERVICE_EXPORT GpuChannel : public IPC::Listener, + public FilteredSender { public: // Takes ownership of the renderer process handle. GpuChannel(GpuChannelManager* gpu_channel_manager,
diff --git a/gpu/ipc/service/gpu_channel_manager.h b/gpu/ipc/service/gpu_channel_manager.h index 432910b03..52325c83 100644 --- a/gpu/ipc/service/gpu_channel_manager.h +++ b/gpu/ipc/service/gpu_channel_manager.h
@@ -25,7 +25,7 @@ #include "gpu/command_buffer/service/shader_translator_cache.h" #include "gpu/config/gpu_driver_bug_workarounds.h" #include "gpu/config/gpu_feature_info.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/gpu_memory_manager.h" #include "ui/gfx/gpu_memory_buffer.h" #include "ui/gfx/native_widget_types.h" @@ -60,7 +60,7 @@ // A GpuChannelManager is a thread responsible for issuing rendering commands // managing the lifetimes of GPU channels and forwarding IPC requests from the // browser process to them based on the corresponding renderer ID. -class GPU_EXPORT GpuChannelManager { +class GPU_IPC_SERVICE_EXPORT GpuChannelManager { public: GpuChannelManager(const GpuPreferences& gpu_preferences, GpuChannelManagerDelegate* delegate,
diff --git a/gpu/ipc/service/gpu_init.h b/gpu/ipc/service/gpu_init.h index b7993947..9fd6b89 100644 --- a/gpu/ipc/service/gpu_init.h +++ b/gpu/ipc/service/gpu_init.h
@@ -10,7 +10,7 @@ #include "gpu/command_buffer/service/gpu_preferences.h" #include "gpu/config/gpu_feature_info.h" #include "gpu/config/gpu_info.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/gpu_watchdog_thread.h" namespace base { @@ -19,7 +19,7 @@ namespace gpu { -class GPU_EXPORT GpuSandboxHelper { +class GPU_IPC_SERVICE_EXPORT GpuSandboxHelper { public: virtual ~GpuSandboxHelper() = default; @@ -30,7 +30,7 @@ const GpuPreferences& gpu_prefs) = 0; }; -class GPU_EXPORT GpuInit { +class GPU_IPC_SERVICE_EXPORT GpuInit { public: GpuInit(); ~GpuInit();
diff --git a/gpu/ipc/service/gpu_ipc_service_export.h b/gpu/ipc/service/gpu_ipc_service_export.h new file mode 100644 index 0000000..314832d --- /dev/null +++ b/gpu/ipc/service/gpu_ipc_service_export.h
@@ -0,0 +1,29 @@ +// Copyright 2018 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 GPU_GPU_IPC_SERVICE_EXPORT_H_ +#define GPU_GPU_IPC_SERVICE_EXPORT_H_ + +#if defined(COMPONENT_BUILD) && !defined(NACL_WIN64) +#if defined(WIN32) + +#if defined(GPU_IPC_SERVICE_IMPLEMENTATION) +#define GPU_IPC_SERVICE_EXPORT __declspec(dllexport) +#else +#define GPU_IPC_SERVICE_EXPORT __declspec(dllimport) +#endif // defined(GPU_IPC_SERVICE_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(GPU_IPC_SERVICE_IMPLEMENTATION) +#define GPU_IPC_SERVICE_EXPORT __attribute__((visibility("default"))) +#else +#define GPU_IPC_SERVICE_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define GPU_IPC_SERVICE_EXPORT +#endif + +#endif // GPU_GPU_IPC_SERVICE_EXPORT_H_
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory.h b/gpu/ipc/service/gpu_memory_buffer_factory.h index 31303529..237ce7e9 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory.h +++ b/gpu/ipc/service/gpu_memory_buffer_factory.h
@@ -10,8 +10,8 @@ #include "base/macros.h" #include "base/memory/ref_counted.h" -#include "gpu/gpu_export.h" #include "gpu/ipc/common/surface_handle.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" @@ -19,7 +19,7 @@ class ImageFactory; -class GPU_EXPORT GpuMemoryBufferFactory { +class GPU_IPC_SERVICE_EXPORT GpuMemoryBufferFactory { public: virtual ~GpuMemoryBufferFactory() = default;
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_android_hardware_buffer.h b/gpu/ipc/service/gpu_memory_buffer_factory_android_hardware_buffer.h index 84afa491f..6d06729 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory_android_hardware_buffer.h +++ b/gpu/ipc/service/gpu_memory_buffer_factory_android_hardware_buffer.h
@@ -6,7 +6,7 @@ #define GPU_IPC_SERVICE_GPU_MEMORY_BUFFER_FACTORY_ANDROID_HARDWARE_BUFFER_H_ #include "gpu/command_buffer/service/image_factory.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/gpu_memory_buffer_factory.h" namespace gl { @@ -15,7 +15,7 @@ namespace gpu { -class GPU_EXPORT GpuMemoryBufferFactoryAndroidHardwareBuffer +class GPU_IPC_SERVICE_EXPORT GpuMemoryBufferFactoryAndroidHardwareBuffer : public GpuMemoryBufferFactory, public ImageFactory { public:
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.h b/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.h index 73e160f..559fa0c 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.h +++ b/gpu/ipc/service/gpu_memory_buffer_factory_dxgi.h
@@ -15,7 +15,7 @@ #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" #include "gpu/command_buffer/service/image_factory.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/gpu_memory_buffer_factory.h" #include "ui/gfx/geometry/size.h" #include "ui/gl/gl_image_dxgi.h" @@ -26,8 +26,9 @@ namespace gpu { -class GPU_EXPORT GpuMemoryBufferFactoryDXGI : public GpuMemoryBufferFactory, - public ImageFactory { +class GPU_IPC_SERVICE_EXPORT GpuMemoryBufferFactoryDXGI + : public GpuMemoryBufferFactory, + public ImageFactory { public: GpuMemoryBufferFactoryDXGI(); ~GpuMemoryBufferFactoryDXGI() override;
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h b/gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h index 66b7f77..964c3f4c 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h +++ b/gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h
@@ -15,7 +15,7 @@ #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" #include "gpu/command_buffer/service/image_factory.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/gpu_memory_buffer_factory.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/gpu_memory_buffer.h" @@ -27,7 +27,7 @@ namespace gpu { -class GPU_EXPORT GpuMemoryBufferFactoryIOSurface +class GPU_IPC_SERVICE_EXPORT GpuMemoryBufferFactoryIOSurface : public GpuMemoryBufferFactory, public ImageFactory { public:
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc b/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc index 81f0dd5..4d262b7 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc +++ b/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.cc
@@ -4,6 +4,7 @@ #include "gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h" +#include "ui/gfx/buffer_format_util.h" #include "ui/gfx/client_native_pixmap.h" #include "ui/gfx/native_pixmap.h" #include "ui/gl/gl_image_native_pixmap.h" @@ -35,8 +36,8 @@ ->GetSurfaceFactoryOzone() ->CreateNativePixmap(surface_handle, size, format, usage); if (!pixmap.get()) { - DLOG(ERROR) << "Failed to create pixmap " << size.ToString() << " format " - << static_cast<int>(format) << ", usage " + DLOG(ERROR) << "Failed to create pixmap " << size.ToString() << ", " + << gfx::BufferFormatToString(format) << ", usage " << static_cast<int>(usage); return gfx::GpuMemoryBufferHandle(); } @@ -122,8 +123,8 @@ scoped_refptr<gl::GLImageNativePixmap> image( new gl::GLImageNativePixmap(size, internalformat)); if (!image->Initialize(pixmap.get(), format)) { - LOG(ERROR) << "Failed to create GLImage " << size.ToString() << " format " - << static_cast<int>(format); + LOG(ERROR) << "Failed to create GLImage " << size.ToString() << ", " + << gfx::BufferFormatToString(format); return nullptr; } return image; @@ -146,15 +147,15 @@ NOTIMPLEMENTED(); #endif if (!pixmap.get()) { - LOG(ERROR) << "Failed to create pixmap " << size.ToString() << " format " - << static_cast<int>(format); + LOG(ERROR) << "Failed to create pixmap " << size.ToString() << ", " + << gfx::BufferFormatToString(format); return nullptr; } scoped_refptr<gl::GLImageNativePixmap> image( new gl::GLImageNativePixmap(size, internalformat)); if (!image->Initialize(pixmap.get(), format)) { - LOG(ERROR) << "Failed to create GLImage " << size.ToString() << " format " - << static_cast<int>(format); + LOG(ERROR) << "Failed to create GLImage " << size.ToString() << ", " + << gfx::BufferFormatToString(format); return nullptr; } *is_cleared = true;
diff --git a/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h b/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h index 44887d2..76463660 100644 --- a/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h +++ b/gpu/ipc/service/gpu_memory_buffer_factory_native_pixmap.h
@@ -12,7 +12,7 @@ #include "base/macros.h" #include "base/synchronization/lock.h" #include "gpu/command_buffer/service/image_factory.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/gpu_memory_buffer_factory.h" #include "ui/gfx/native_pixmap.h" @@ -22,7 +22,7 @@ namespace gpu { -class GPU_EXPORT GpuMemoryBufferFactoryNativePixmap +class GPU_IPC_SERVICE_EXPORT GpuMemoryBufferFactoryNativePixmap : public GpuMemoryBufferFactory, public ImageFactory { public:
diff --git a/gpu/ipc/service/gpu_memory_manager.h b/gpu/ipc/service/gpu_memory_manager.h index 74f3caf..84d082e 100644 --- a/gpu/ipc/service/gpu_memory_manager.h +++ b/gpu/ipc/service/gpu_memory_manager.h
@@ -17,7 +17,7 @@ #include "base/memory/weak_ptr.h" #include "gpu/command_buffer/common/gpu_memory_allocation.h" #include "gpu/command_buffer/service/memory_tracking.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" namespace gpu { @@ -25,8 +25,8 @@ class GpuMemoryTrackingGroup; struct VideoMemoryUsageStats; -class GPU_EXPORT GpuMemoryManager : - public base::SupportsWeakPtr<GpuMemoryManager> { +class GPU_IPC_SERVICE_EXPORT GpuMemoryManager + : public base::SupportsWeakPtr<GpuMemoryManager> { public: explicit GpuMemoryManager(GpuChannelManager* channel_manager); ~GpuMemoryManager();
diff --git a/gpu/ipc/service/gpu_memory_tracking.h b/gpu/ipc/service/gpu_memory_tracking.h index 35dd396..adb8721ad 100644 --- a/gpu/ipc/service/gpu_memory_tracking.h +++ b/gpu/ipc/service/gpu_memory_tracking.h
@@ -9,7 +9,7 @@ #include "base/process/process.h" #include "gpu/command_buffer/service/memory_tracking.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" namespace gpu { @@ -17,7 +17,7 @@ // All decoders in a context group point to a single GpuMemoryTrackingGroup, // which tracks GPU resource consumption for the entire context group. -class GPU_EXPORT GpuMemoryTrackingGroup { +class GPU_IPC_SERVICE_EXPORT GpuMemoryTrackingGroup { public: ~GpuMemoryTrackingGroup(); void TrackMemoryAllocatedChange(uint64_t old_size, uint64_t new_size);
diff --git a/gpu/ipc/service/gpu_vsync_provider_win.h b/gpu/ipc/service/gpu_vsync_provider_win.h index 0b40c3ce4..d9ab1d3 100644 --- a/gpu/ipc/service/gpu_vsync_provider_win.h +++ b/gpu/ipc/service/gpu_vsync_provider_win.h
@@ -12,8 +12,8 @@ #include "base/memory/weak_ptr.h" #include "base/synchronization/lock.h" #include "base/time/time.h" -#include "gpu/gpu_export.h" #include "gpu/ipc/common/surface_handle.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "gpu/ipc/service/image_transport_surface_delegate.h" #include "ui/gfx/vsync_provider.h" @@ -22,7 +22,7 @@ class GpuVSyncWorker; class GpuVSyncMessageFilter; -class GPU_EXPORT GpuVSyncProviderWin : public gfx::VSyncProvider { +class GPU_IPC_SERVICE_EXPORT GpuVSyncProviderWin : public gfx::VSyncProvider { public: GpuVSyncProviderWin(base::WeakPtr<ImageTransportSurfaceDelegate> delegate, SurfaceHandle surface_handle);
diff --git a/gpu/ipc/service/gpu_watchdog_thread.h b/gpu/ipc/service/gpu_watchdog_thread.h index 09238c1e..177e7af 100644 --- a/gpu/ipc/service/gpu_watchdog_thread.h +++ b/gpu/ipc/service/gpu_watchdog_thread.h
@@ -15,7 +15,7 @@ #include "base/time/time.h" #include "build/build_config.h" #include "gpu/command_buffer/service/progress_reporter.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "ui/gfx/native_widget_types.h" #if defined(USE_X11) @@ -28,9 +28,10 @@ // A thread that intermitently sends tasks to a group of watched message loops // and deliberately crashes if one of them does not respond after a timeout. -class GPU_EXPORT GpuWatchdogThread : public base::Thread, - public base::PowerObserver, - public gles2::ProgressReporter { +class GPU_IPC_SERVICE_EXPORT GpuWatchdogThread + : public base::Thread, + public base::PowerObserver, + public gles2::ProgressReporter { public: ~GpuWatchdogThread() override;
diff --git a/gpu/ipc/service/image_transport_surface.h b/gpu/ipc/service/image_transport_surface.h index 41f3c97..8303330b 100644 --- a/gpu/ipc/service/image_transport_surface.h +++ b/gpu/ipc/service/image_transport_surface.h
@@ -11,8 +11,8 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "build/build_config.h" -#include "gpu/gpu_export.h" #include "gpu/ipc/common/surface_handle.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" #include "ui/gl/gl_surface.h" namespace gpu { @@ -23,10 +23,10 @@ // the results to the browser process to display. This file provides a simple // framework for making the offscreen path seem more like the onscreen path. -class ImageTransportSurface { +class GPU_IPC_SERVICE_EXPORT ImageTransportSurface { public: #if defined(OS_MACOSX) - GPU_EXPORT static void SetAllowOSMesaForTesting(bool allow); + static void SetAllowOSMesaForTesting(bool allow); #endif // Creates the appropriate native surface depending on the GL implementation.
diff --git a/gpu/ipc/service/image_transport_surface_delegate.h b/gpu/ipc/service/image_transport_surface_delegate.h index 73718ad..0eb7b3d5 100644 --- a/gpu/ipc/service/image_transport_surface_delegate.h +++ b/gpu/ipc/service/image_transport_surface_delegate.h
@@ -7,8 +7,8 @@ #include "base/callback.h" #include "gpu/command_buffer/common/texture_in_use_response.h" -#include "gpu/gpu_export.h" #include "gpu/ipc/common/surface_handle.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" namespace IPC { class MessageFilter; @@ -26,7 +26,7 @@ class FeatureInfo; } -class GPU_EXPORT ImageTransportSurfaceDelegate { +class GPU_IPC_SERVICE_EXPORT ImageTransportSurfaceDelegate { public: #if defined(OS_WIN) // Tells the delegate that a child window was created with the provided
diff --git a/gpu/ipc/service/raster_command_buffer_stub.h b/gpu/ipc/service/raster_command_buffer_stub.h index 309a702..0f82a8fd 100644 --- a/gpu/ipc/service/raster_command_buffer_stub.h +++ b/gpu/ipc/service/raster_command_buffer_stub.h
@@ -9,7 +9,8 @@ namespace gpu { -class GPU_EXPORT RasterCommandBufferStub : public CommandBufferStub { +class GPU_IPC_SERVICE_EXPORT RasterCommandBufferStub + : public CommandBufferStub { public: RasterCommandBufferStub(GpuChannel* channel, const GPUCreateCommandBufferConfig& init_params,
diff --git a/gpu/ipc/service/switches.h b/gpu/ipc/service/switches.h index 46d5eae..a1eea6e 100644 --- a/gpu/ipc/service/switches.h +++ b/gpu/ipc/service/switches.h
@@ -6,11 +6,11 @@ #define GPU_IPC_SERVICE_SWITCHES_H_ #include "base/feature_list.h" -#include "gpu/gpu_export.h" +#include "gpu/ipc/service/gpu_ipc_service_export.h" namespace switches { -GPU_EXPORT extern const base::Feature kDirectCompositionOverlays; +GPU_IPC_SERVICE_EXPORT extern const base::Feature kDirectCompositionOverlays; } // namespace switches
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index 912c913d..bf0905c 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -430,6 +430,7 @@ "//gin", "//third_party/WebKit/public:blink", "//third_party/WebKit/public:blink_headers", + "//ui/gl", "//v8", ]
diff --git a/infra/config/cq.cfg b/infra/config/cq.cfg index 931004b..e37ecae 100644 --- a/infra/config/cq.cfg +++ b/infra/config/cq.cfg
@@ -26,44 +26,99 @@ try_job { buckets { name: "master.tryserver.chromium.android" - builders { name: "android_arm64_dbg_recipe" } - builders { name: "android_clang_dbg_recipe" } - builders { name: "android_compile_dbg" } - builders { name: "android_cronet" } - builders { name: "android_n5x_swarming_rel" } - builders { name: "cast_shell_android" } - builders { name: "linux_android_rel_ng" } + builders { + name: "android_arm64_dbg_recipe" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "android_clang_dbg_recipe" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "android_compile_dbg" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "android_cronet" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "android_n5x_swarming_rel" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "cast_shell_android" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "linux_android_rel_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } } buckets { name: "master.tryserver.chromium.chromiumos" - builders { name: "chromeos-amd64-generic-rel" } - builders { name: "chromeos-daisy-rel" } - builders { name: "linux-chromeos-rel" } + builders { + name: "chromeos-amd64-generic-rel" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "chromeos-daisy-rel" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "linux-chromeos-rel" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } } buckets { name: "master.tryserver.chromium.linux" - builders { name: "cast_shell_linux" } - builders { name: "chromium_presubmit" } - builders { name: "fuchsia_arm64" } - builders { name: "fuchsia_x64" } - builders { name: "linux_chromium_asan_rel_ng" } + builders { + name: "cast_shell_linux" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "chromium_presubmit" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "fuchsia_arm64" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "fuchsia_x64" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "linux_chromium_asan_rel_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } builders { name: "linux_chromium_ozone_compile_only_ng" experiment_percentage: 10 } - builders { name: "linux_chromium_compile_dbg_ng" } - builders { name: "linux_chromium_headless_rel" } - builders { name: "linux_chromium_tsan_rel_ng" } + builders { + name: "linux_chromium_compile_dbg_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + # The only purpose of this builder here is get data for migrating this + # builder to LUCI, see https://crbug.com/731434. + # TODO(tandrii): remove this builder once enough data has been + # collected. + name: "linux_chromium_dbg_ng" + experiment_percentage: 5 + } + builders { + name: "linux_chromium_headless_rel" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "linux_chromium_tsan_rel_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } builders { name: "linux_chromium_rel_ng" - equivalent_to { - # Builders in this bucket are defined in - # https://chromium.googlesource.com/chromium/src/+/infra/config/cr-buildbucket.cfg - bucket: "luci.chromium.try" - builder: "linux_chromium_rel_ng" - owner_whitelist_group: "luci-chromium-cq-dogfood" - percentage: 100 - } + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } } } buckets { @@ -78,15 +133,22 @@ name: "ios-device-xcode-clang" experiment_percentage: 10 } - builders { name: "ios-simulator" } + builders { + name: "ios-simulator" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } # https://crbug.com/739556 builders { name: "ios-simulator-xcode-clang" experiment_percentage: 10 } - builders { name: "mac_chromium_compile_dbg_ng" } + builders { + name: "mac_chromium_compile_dbg_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } builders { name: "mac_chromium_rel_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } } } buckets { @@ -95,10 +157,22 @@ name: "win-msvc-dbg" experiment_percentage: 25 } - builders { name: "win-msvc-rel" } - builders { name: "win7_chromium_rel_ng" } - builders { name: "win10_chromium_x64_rel_ng" } - builders { name: "win_chromium_compile_dbg_ng" } + builders { + name: "win-msvc-rel" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "win7_chromium_rel_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "win10_chromium_x64_rel_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } + builders { + name: "win_chromium_compile_dbg_ng" + equivalent_to { bucket: "luci.chromium.try" percentage: 0 } + } builders { name: "win7_chromium_rel_loc_exp" experiment_percentage: 20
diff --git a/ios/chrome/app/BUILD.gn b/ios/chrome/app/BUILD.gn index 8314f041..f94d20f 100644 --- a/ios/chrome/app/BUILD.gn +++ b/ios/chrome/app/BUILD.gn
@@ -162,6 +162,7 @@ "//ios/chrome/browser/content_settings", "//ios/chrome/browser/crash_report", "//ios/chrome/browser/crash_report:crash_report_internal", + "//ios/chrome/browser/download", "//ios/chrome/browser/favicon", "//ios/chrome/browser/feature_engagement", "//ios/chrome/browser/first_run",
diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm index 9dacd33a..88495b96 100644 --- a/ios/chrome/app/main_controller.mm +++ b/ios/chrome/app/main_controller.mm
@@ -74,6 +74,7 @@ #include "ios/chrome/browser/crash_report/breakpad_helper.h" #import "ios/chrome/browser/crash_report/crash_report_background_uploader.h" #import "ios/chrome/browser/crash_report/crash_restore_helper.h" +#include "ios/chrome/browser/download/download_directory_util.h" #include "ios/chrome/browser/experimental_flags.h" #include "ios/chrome/browser/feature_engagement/tracker_factory.h" #include "ios/chrome/browser/file_metadata_util.h" @@ -1135,7 +1136,7 @@ [[DeferredInitializationRunner sharedInstance] enqueueBlockNamed:kDeleteDownloads block:^{ - [LegacyDownloadManagerController clearDownloadsDirectory]; + DeleteDownloadsDirectory(); }]; }
diff --git a/ios/chrome/app/strings/ios_chromium_strings.grd b/ios/chrome/app/strings/ios_chromium_strings.grd index 6797f7c4..c37b7d17 100644 --- a/ios/chrome/app/strings/ios_chromium_strings.grd +++ b/ios/chrome/app/strings/ios_chromium_strings.grd
@@ -156,8 +156,8 @@ <message name="IDS_IOS_DISCONNECT_DIALOG_TITLE" desc="The title of the disconnect dialog [Length: 30em]."> Sign out of Chromium? </message> - <message name="IDS_IOS_FIRSTRUN_AGREE_TO_TERMS" desc="Label containing a link to the Terms of Service, displayed in the first run flow. [Length: 70em] [iOS only]"> - By using this application, you agree to Chromium’s <ph name="BEGIN_LINK">BEGIN_LINK</ph>Terms of Service<ph name="END_LINK">END_LINK</ph>. + <message name="IDS_IOS_FIRSTRUN_AGREE_TO_TERMS" desc="Label containing a link to the Terms of Service and Privacy Notice, displayed in the first run flow. [Length: 70em] [iOS only]"> + By using this application, you agree to Chromium’s <ph name="BEGIN_LINK_TOS">BEGIN_LINK_TOS</ph>Terms of Service<ph name="END_LINK_TOS">END_LINK_TOS</ph> and <ph name="BEGIN_LINK_PRIVACY">BEGIN_LINK_PRIVACY</ph>Privacy Notice<ph name="END_LINK_PRIVACY">END_LINK_PRIVACY</ph>. </message> <message name="IDS_IOS_FIRSTRUN_NEW_OPT_IN_LABEL" desc="User metrics opt-in label [Length: 80em] [iOS only]"> Help make Chromium better by sending usage statistics and crash reports to Google. @@ -165,6 +165,9 @@ <message name="IDS_IOS_FIRSTRUN_TERMS_TITLE" desc="Title for the Terms of Service page shown to user on First Run. [Length: 30em]"> Chromium Terms of Service </message> + <message name="IDS_IOS_FIRSTRUN_PRIVACY_TITLE" desc="Title for the Privacy Notice page shown to user on First Run. [Length: 30em]"> + Chromium Privacy Notice + </message> <message name="IDS_IOS_FIRSTRUN_WELCOME_TO_CHROME" desc="Title on the Welcome to Chromium screen presented to the user on First Run. [iOS only]"> Welcome to Chromium </message>
diff --git a/ios/chrome/app/strings/ios_google_chrome_strings.grd b/ios/chrome/app/strings/ios_google_chrome_strings.grd index 73ec0d9..688b0df 100644 --- a/ios/chrome/app/strings/ios_google_chrome_strings.grd +++ b/ios/chrome/app/strings/ios_google_chrome_strings.grd
@@ -156,8 +156,8 @@ <message name="IDS_IOS_DISCONNECT_DIALOG_TITLE" desc="The title of the disconnect dialog [Length: 30em]."> Sign out of Chrome? </message> - <message name="IDS_IOS_FIRSTRUN_AGREE_TO_TERMS" desc="Label containing a link to the Terms of Service, displayed in the first run flow. [Length: 70em] [iOS only]"> - By using this application, you agree to Chrome’s <ph name="BEGIN_LINK">BEGIN_LINK</ph>Terms of Service<ph name="END_LINK">END_LINK</ph>. + <message name="IDS_IOS_FIRSTRUN_AGREE_TO_TERMS" desc="Label containing a link to the Terms of Service and Privacy Notice, displayed in the first run flow. [Length: 70em] [iOS only]"> + By using this application, you agree to Chrome’s <ph name="BEGIN_LINK_TOS">BEGIN_LINK_TOS</ph>Terms of Service<ph name="END_LINK_TOS">END_LINK_TOS</ph> and <ph name="BEGIN_LINK_PRIVACY">BEGIN_LINK_PRIVACY</ph>Privacy Notice<ph name="END_LINK_PRIVACY">END_LINK_PRIVACY</ph>. </message> <message name="IDS_IOS_FIRSTRUN_NEW_OPT_IN_LABEL" desc="User metrics opt-in label [Length: 80em] [iOS only]"> Help make Chrome better by sending usage statistics and crash reports to Google. @@ -165,6 +165,9 @@ <message name="IDS_IOS_FIRSTRUN_TERMS_TITLE" desc="Title for the Terms of Service page shown to user on First Run. [Length: 30em]"> Google Chrome Terms of Service </message> + <message name="IDS_IOS_FIRSTRUN_PRIVACY_TITLE" desc="Title for the Privacy Notice page shown to user on First Run. [Length: 30em]"> + Google Chrome Privacy Notice + </message> <message name="IDS_IOS_FIRSTRUN_WELCOME_TO_CHROME" desc="Title on the Welcome to Chrome screen presented to the user on First Run. [iOS only]"> Welcome to Chrome </message>
diff --git a/ios/chrome/browser/BUILD.gn b/ios/chrome/browser/BUILD.gn index 03a244b8..5cd66987 100644 --- a/ios/chrome/browser/BUILD.gn +++ b/ios/chrome/browser/BUILD.gn
@@ -64,8 +64,6 @@ "ios_chrome_io_thread.mm", "notification_promo.cc", "notification_promo.h", - "open_url_util.h", - "open_url_util.mm", "pref_names.cc", "pref_names.h", "procedural_block_types.h",
diff --git a/ios/chrome/browser/about_flags.mm b/ios/chrome/browser/about_flags.mm index 173c434d..0ddaa758 100644 --- a/ios/chrome/browser/about_flags.mm +++ b/ios/chrome/browser/about_flags.mm
@@ -220,7 +220,7 @@ {"bookmark-new-edit-page", flag_descriptions::kBookmarkNewEditPageName, flag_descriptions::kBookmarkNewEditPageDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(kBookmarkNewEditPage)}, - {"password-export", flag_descriptions::kPasswordExportName, + {"PasswordExport", flag_descriptions::kPasswordExportName, flag_descriptions::kPasswordExportDescription, flags_ui::kOsIos, FEATURE_VALUE_TYPE(password_manager::features::kPasswordExport)}, {"wk-http-system-cookie-store", @@ -231,7 +231,11 @@ flag_descriptions::kShowAutofillTypePredictionsName, flag_descriptions::kShowAutofillTypePredictionsDescription, flags_ui::kOsIos, - FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)}}; + FEATURE_VALUE_TYPE(autofill::features::kAutofillShowTypePredictions)}, + {"adaptive-toolbar", flag_descriptions::kAdaptiveToolbarName, + flag_descriptions::kAdaptiveToolbarDescription, flags_ui::kOsIos, + FEATURE_VALUE_TYPE(kAdaptiveToolbar)}, +}; // Add all switches from experimental flags to |command_line|. void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
diff --git a/ios/chrome/browser/crash_report/crash_restore_helper.mm b/ios/chrome/browser/crash_report/crash_restore_helper.mm index d77f97a..e5299da 100644 --- a/ios/chrome/browser/crash_report/crash_restore_helper.mm +++ b/ios/chrome/browser/crash_report/crash_restore_helper.mm
@@ -140,7 +140,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier SessionCrashedInfoBarDelegate::GetIdentifier() const { - return SESSION_CRASHED_INFOBAR_DELEGATE; + return SESSION_CRASHED_INFOBAR_DELEGATE_MAC_IOS; } base::string16 SessionCrashedInfoBarDelegate::GetMessageText() const { @@ -281,7 +281,7 @@ DCHECK(infobar->delegate()); if (_sessionRestored || infobar->delegate()->GetIdentifier() != - infobars::InfoBarDelegate::SESSION_CRASHED_INFOBAR_DELEGATE) { + infobars::InfoBarDelegate::SESSION_CRASHED_INFOBAR_DELEGATE_MAC_IOS) { return; }
diff --git a/ios/chrome/browser/download/BUILD.gn b/ios/chrome/browser/download/BUILD.gn index 364a14c..9617cf43 100644 --- a/ios/chrome/browser/download/BUILD.gn +++ b/ios/chrome/browser/download/BUILD.gn
@@ -8,6 +8,8 @@ "browser_download_service.mm", "browser_download_service_factory.h", "browser_download_service_factory.mm", + "download_directory_util.cc", + "download_directory_util.h", "pass_kit_mime_type.cc", "pass_kit_mime_type.h", "pass_kit_tab_helper.h", @@ -35,6 +37,7 @@ sources = [ "browser_download_service_factory_unittest.mm", "browser_download_service_unittest.mm", + "download_directory_util_unittest.mm", "pass_kit_tab_helper_unittest.mm", ] deps = [ @@ -43,6 +46,7 @@ "//ios/chrome/browser/browser_state:test_support", "//ios/chrome/browser/download", "//ios/chrome/test/fakes", + "//ios/testing:ios_test_support", "//ios/web/public", "//ios/web/public/download", "//ios/web/public/test",
diff --git a/ios/chrome/browser/download/OWNERS b/ios/chrome/browser/download/OWNERS index f1a8cd4..476af25d 100644 --- a/ios/chrome/browser/download/OWNERS +++ b/ios/chrome/browser/download/OWNERS
@@ -1,5 +1,5 @@ eugenebut@chromium.org -gchatz@chromium.org +sdefresne@chromium.org # TEAM: ios-directory-owners@chromium.org # OS: iOS
diff --git a/ios/chrome/browser/download/download_directory_util.cc b/ios/chrome/browser/download/download_directory_util.cc new file mode 100644 index 0000000..9b9a853 --- /dev/null +++ b/ios/chrome/browser/download/download_directory_util.cc
@@ -0,0 +1,35 @@ +// Copyright 2018 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 "ios/chrome/browser/download/download_directory_util.h" + +#include "base/bind.h" +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/task_scheduler/post_task.h" +#include "base/task_scheduler/task_traits.h" + +namespace { +// Synchronously deletes downloads directory. +void DeleteDownloadsDirectorySync() { + base::FilePath downloads_directory; + if (GetDownloadsDirectory(&downloads_directory)) { + DeleteFile(downloads_directory, /*recursive=*/true); + } +} +} // namespace + +bool GetDownloadsDirectory(base::FilePath* directory_path) { + if (!GetTempDir(directory_path)) { + return false; + } + *directory_path = directory_path->Append("downloads"); + return true; +} + +void DeleteDownloadsDirectory() { + base::PostTaskWithTraits(FROM_HERE, + {base::MayBlock(), base::TaskPriority::BACKGROUND}, + base::BindOnce(&DeleteDownloadsDirectorySync)); +}
diff --git a/ios/chrome/browser/download/download_directory_util.h b/ios/chrome/browser/download/download_directory_util.h new file mode 100644 index 0000000..a82ea9c --- /dev/null +++ b/ios/chrome/browser/download/download_directory_util.h
@@ -0,0 +1,20 @@ +// Copyright 2018 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 IOS_CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DIRECTORY_UTIL_H_ +#define IOS_CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DIRECTORY_UTIL_H_ + +namespace base { +class FilePath; +} + +// Fills |directory_path| with the FilePath to the downloads directory. Returns +// true if this is successful. This method does not create the directory, it +// just returns the path. +bool GetDownloadsDirectory(base::FilePath* directory_path); + +// Asynchronously deletes downloads directory. +void DeleteDownloadsDirectory(); + +#endif // IOS_CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DIRECTORY_UTIL_H_
diff --git a/ios/chrome/browser/download/download_directory_util_unittest.mm b/ios/chrome/browser/download/download_directory_util_unittest.mm new file mode 100644 index 0000000..4ad0de4 --- /dev/null +++ b/ios/chrome/browser/download/download_directory_util_unittest.mm
@@ -0,0 +1,42 @@ +// Copyright 2018 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 "ios/chrome/browser/download/download_directory_util.h" + +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/test/scoped_task_environment.h" +#include "base/time/time.h" +#import "ios/testing/wait_util.h" +#include "testing/platform_test.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +using testing::WaitUntilConditionOrTimeout; +using testing::kWaitForFileOperationTimeout; + +using DownloadDirectoryTest = PlatformTest; + +// Tests that DeleteDownloadsDirectory() actually deletes the directory. +TEST_F(DownloadDirectoryTest, Deletion) { + base::test::ScopedTaskEnvironment envoronment; + + // Create a new file in downloads directory. + base::FilePath dir; + EXPECT_TRUE(GetDownloadsDirectory(&dir)); + EXPECT_TRUE(CreateDirectory(dir)); + base::FilePath file = dir.Append("file.txt"); + EXPECT_EQ(0, WriteFile(file, "", 0)); + ASSERT_TRUE(base::PathExists(file)); + + // Delete download directory. + DeleteDownloadsDirectory(); + + // Verify download directory deletion. + EXPECT_TRUE(WaitUntilConditionOrTimeout(kWaitForFileOperationTimeout, ^{ + return !base::PathExists(dir); + })); +}
diff --git a/ios/chrome/browser/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/ios_chrome_flag_descriptions.cc index 52b4b127..fbe0c52 100644 --- a/ios/chrome/browser/ios_chrome_flag_descriptions.cc +++ b/ios/chrome/browser/ios_chrome_flag_descriptions.cc
@@ -11,6 +11,10 @@ namespace flag_descriptions { +const char kAdaptiveToolbarName[] = "Adaptive Toolbar"; +const char kAdaptiveToolbarDescription[] = + "When enabled, the adaptive toolbar will be used."; + const char kBookmarkNewEditPageName[] = "Bookmark New Edit Page"; const char kBookmarkNewEditPageDescription[] = "When enabled, the new bookmark edit page and folder picker will be used "
diff --git a/ios/chrome/browser/ios_chrome_flag_descriptions.h b/ios/chrome/browser/ios_chrome_flag_descriptions.h index bf8aaad..9c1a6fb25 100644 --- a/ios/chrome/browser/ios_chrome_flag_descriptions.h +++ b/ios/chrome/browser/ios_chrome_flag_descriptions.h
@@ -7,6 +7,10 @@ namespace flag_descriptions { +// Title and description for the flag to enable the adaptive toolbar. +extern const char kAdaptiveToolbarName[]; +extern const char kAdaptiveToolbarDescription[]; + // Title and description for the flag to enable the new bookmark edit page in // the new bookmark UI. extern const char kBookmarkNewEditPageName[];
diff --git a/ios/chrome/browser/open_url_util.h b/ios/chrome/browser/open_url_util.h deleted file mode 100644 index 7f660e9..0000000 --- a/ios/chrome/browser/open_url_util.h +++ /dev/null
@@ -1,15 +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. - -#ifndef IOS_CHROME_BROWSER_OPEN_URL_UTIL_H_ -#define IOS_CHROME_BROWSER_OPEN_URL_UTIL_H_ - -#import <Foundation/Foundation.h> - -// Wrapper method for UIApplication openURL() that uses -// the non-deprecated method when it is available (iOS10+). -void OpenUrlWithCompletionHandler(NSURL* url, - void (^completion_handler)(BOOL success)); - -#endif // IOS_CHROME_BROWSER_OPEN_URL_UTIL_H_
diff --git a/ios/chrome/browser/open_url_util.mm b/ios/chrome/browser/open_url_util.mm deleted file mode 100644 index b0819ff..0000000 --- a/ios/chrome/browser/open_url_util.mm +++ /dev/null
@@ -1,32 +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. - -#import "ios/chrome/browser/open_url_util.h" - -#import <UIKit/UIKit.h> - -#include "base/ios/ios_util.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -void OpenUrlWithCompletionHandler(NSURL* url, - void (^completion_handler)(BOOL success)) { - if (@available(iOS 10, *)) { - [[UIApplication sharedApplication] openURL:url - options:@{} - completionHandler:completion_handler]; - } -#if !defined(__IPHONE_10_0) || __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0 - else { - BOOL result = [[UIApplication sharedApplication] openURL:url]; - if (!completion_handler) - return; - dispatch_async(dispatch_get_main_queue(), ^{ - completion_handler(result); - }); - } -#endif -}
diff --git a/ios/chrome/browser/passwords/ios_chrome_save_password_infobar_delegate.mm b/ios/chrome/browser/passwords/ios_chrome_save_password_infobar_delegate.mm index 41dc556..0690c35 100644 --- a/ios/chrome/browser/passwords/ios_chrome_save_password_infobar_delegate.mm +++ b/ios/chrome/browser/passwords/ios_chrome_save_password_infobar_delegate.mm
@@ -53,7 +53,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier IOSChromeSavePasswordInfoBarDelegate::GetIdentifier() const { - return IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE; + return SAVE_PASSWORD_INFOBAR_DELEGATE_MOBILE; } base::string16 IOSChromeSavePasswordInfoBarDelegate::GetMessageText() const {
diff --git a/ios/chrome/browser/passwords/ios_chrome_update_password_infobar_delegate.mm b/ios/chrome/browser/passwords/ios_chrome_update_password_infobar_delegate.mm index 3f15503b..cea8d39 100644 --- a/ios/chrome/browser/passwords/ios_chrome_update_password_infobar_delegate.mm +++ b/ios/chrome/browser/passwords/ios_chrome_update_password_infobar_delegate.mm
@@ -86,7 +86,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier IOSChromeUpdatePasswordInfoBarDelegate::GetIdentifier() const { - return UPDATE_PASSWORD_INFOBAR_DELEGATE; + return UPDATE_PASSWORD_INFOBAR_DELEGATE_MOBILE; } base::string16 IOSChromeUpdatePasswordInfoBarDelegate::GetMessageText() const {
diff --git a/ios/chrome/browser/signin/signin_error_controller_factory.cc b/ios/chrome/browser/signin/signin_error_controller_factory.cc index e959680..c3b9ef5 100644 --- a/ios/chrome/browser/signin/signin_error_controller_factory.cc +++ b/ios/chrome/browser/signin/signin_error_controller_factory.cc
@@ -4,6 +4,8 @@ #include "ios/chrome/browser/signin/signin_error_controller_factory.h" +#include <utility> + #include "base/memory/ptr_util.h" #include "base/memory/singleton.h" #include "components/keyed_service/core/service_access_type.h" @@ -37,7 +39,8 @@ std::unique_ptr<KeyedService> SigninErrorControllerFactory::BuildServiceInstanceFor( web::BrowserState* context) const { - return base::WrapUnique(new SigninErrorController); + return std::make_unique<SigninErrorController>( + SigninErrorController::AccountMode::ANY_ACCOUNT); } } // namespace ios
diff --git a/ios/chrome/browser/signin/signin_manager_factory.cc b/ios/chrome/browser/signin/signin_manager_factory.cc index 0ea8a6e..3388ea2 100644 --- a/ios/chrome/browser/signin/signin_manager_factory.cc +++ b/ios/chrome/browser/signin/signin_manager_factory.cc
@@ -19,6 +19,7 @@ #include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h" #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" #include "ios/chrome/browser/signin/signin_client_factory.h" +#include "ios/chrome/browser/signin/signin_error_controller_factory.h" #include "ios/chrome/browser/signin/signin_manager_factory_observer.h" namespace ios { @@ -31,6 +32,7 @@ DependsOn(ios::GaiaCookieManagerServiceFactory::GetInstance()); DependsOn(OAuth2TokenServiceFactory::GetInstance()); DependsOn(ios::AccountTrackerServiceFactory::GetInstance()); + DependsOn(ios::SigninErrorControllerFactory::GetInstance()); } SigninManagerFactory::~SigninManagerFactory() {} @@ -89,6 +91,8 @@ ios::AccountTrackerServiceFactory::GetForBrowserState( chrome_browser_state), ios::GaiaCookieManagerServiceFactory::GetForBrowserState( + chrome_browser_state), + ios::SigninErrorControllerFactory::GetForBrowserState( chrome_browser_state))); service->Initialize(GetApplicationContext()->GetLocalState()); for (auto& observer : observer_list_)
diff --git a/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm b/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm index 24c0f1e5..ec7e8f89 100644 --- a/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm +++ b/ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.mm
@@ -99,7 +99,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier ReSignInInfoBarDelegate::GetIdentifier() const { - return RE_SIGN_IN_INFOBAR_DELEGATE; + return RE_SIGN_IN_INFOBAR_DELEGATE_IOS; } base::string16 ReSignInInfoBarDelegate::GetMessageText() const {
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm index faccf726..289c4a6 100644 --- a/ios/chrome/browser/ui/browser_view_controller.mm +++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -689,8 +689,8 @@ // Returns the LegacyToolbarCoordinator. This property is here to separate // methods which will be removed during cleanup to other methods. Uses this // property only for deprecated methods. -@property(nonatomic, readonly) - LegacyToolbarCoordinator* legacyToolbarCoordinator; +@property(nonatomic, readonly) id<LegacyToolbarCoordinator> + legacyToolbarCoordinator; // Vertical offset for fullscreen toolbar. @property(nonatomic, strong) NSLayoutConstraint* primaryToolbarOffsetConstraint; @@ -2009,7 +2009,7 @@ _activityServiceCoordinator.tabModel = _model; _activityServiceCoordinator.browserState = _browserState; _activityServiceCoordinator.positionProvider = - [_toolbarCoordinator activityServicePositioner]; + [self.primaryToolbarCoordinator activityServicePositioner]; _activityServiceCoordinator.presentationProvider = self; _qrScannerCoordinator = @@ -2456,9 +2456,9 @@ [guide.owningView convertPoint:anchorPoint toView:guide.owningView.window]; } else { - DCHECK([_toolbarCoordinator + DCHECK([self.legacyToolbarCoordinator respondsToSelector:@selector(anchorPointForTabSwitcherButton:)]); - tabSwitcherAnchor = [_toolbarCoordinator + tabSwitcherAnchor = [self.legacyToolbarCoordinator anchorPointForTabSwitcherButton:BubbleArrowDirectionUp]; } } @@ -2501,7 +2501,7 @@ - (void)presentNewIncognitoTabTipBubble { DCHECK(self.browserState); - DCHECK([_toolbarCoordinator + DCHECK([self.legacyToolbarCoordinator respondsToSelector:@selector(anchorPointForToolsMenuButton:)]); // If the BVC is not visible, do not present the bubble. if (!self.viewVisible) @@ -2526,7 +2526,7 @@ toolsButtonAnchor = [guide.owningView convertPoint:anchorPoint toView:guide.owningView.window]; } else { - toolsButtonAnchor = [_toolbarCoordinator + toolsButtonAnchor = [self.legacyToolbarCoordinator anchorPointForToolsMenuButton:BubbleArrowDirectionUp]; } @@ -2573,7 +2573,12 @@ referenceFrame = _contentArea.frame; } - CGRect omniboxFrame = [_toolbarCoordinator visibleOmniboxFrame]; + CGRect omniboxFrame; + if (base::FeatureList::IsEnabled(kCleanToolbar)) { + omniboxFrame = FindNamedGuide(kOmniboxGuide, self.view).layoutFrame; + } else { + omniboxFrame = [self.legacyToolbarCoordinator visibleOmniboxFrame]; + } [_findBarController addFindBarView:animate intoView:self.view withFrame:referenceFrame
diff --git a/ios/chrome/browser/ui/browser_view_controller_dependency_factory.mm b/ios/chrome/browser/ui/browser_view_controller_dependency_factory.mm index 50cdc82..6a3dd12 100644 --- a/ios/chrome/browser/ui/browser_view_controller_dependency_factory.mm +++ b/ios/chrome/browser/ui/browser_view_controller_dependency_factory.mm
@@ -53,8 +53,8 @@ DCHECK(infoBarManager); SimpleAlertInfoBarDelegate::Create( infoBarManager, - infobars::InfoBarDelegate::SHOW_PASSKIT_INFOBAR_ERROR_DELEGATE, nullptr, - l10n_util::GetStringUTF16(IDS_IOS_GENERIC_PASSKIT_ERROR), true); + infobars::InfoBarDelegate::SHOW_PASSKIT_ERROR_INFOBAR_DELEGATE_IOS, + nullptr, l10n_util::GetStringUTF16(IDS_IOS_GENERIC_PASSKIT_ERROR), true); } - (ToolbarModelIOS*)newToolbarModelIOSWithDelegate:
diff --git a/ios/chrome/browser/ui/browser_view_controller_unittest.mm b/ios/chrome/browser/ui/browser_view_controller_unittest.mm index 8a68c500..e313007 100644 --- a/ios/chrome/browser/ui/browser_view_controller_unittest.mm +++ b/ios/chrome/browser/ui/browser_view_controller_unittest.mm
@@ -149,6 +149,9 @@ - (void)selectedTabChanged; - (void)dismissToolsMenuPopup; - (void)cancelOmniboxEdit; +- (void)setBackgroundAlpha:(CGFloat)alpha; +- (void)browserStateDestroyed; +- (void)stop; - (ToolbarButtonUpdater*)buttonUpdater; - (void)setToolsMenuStateProvider:(id)provider; @@ -199,6 +202,15 @@ - (void)start { return; } +- (void)setBackgroundAlpha:(CGFloat)alpha { + return; +} +- (void)browserStateDestroyed { + return; +} +- (void)stop { + return; +} @end #pragma mark -
diff --git a/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state.mm b/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state.mm index c3f3b18..c70a8a21 100644 --- a/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state.mm +++ b/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state.mm
@@ -40,8 +40,11 @@ web_state->GetNavigationManager()->GetLastCommittedItem(); // The dialog blocking state should be reset for user-initiated loads or for // document-changing, non-reload navigations. + bool navigation_is_reload = ui::PageTransitionCoreTypeIs( + navigation_context->GetPageTransition(), ui::PAGE_TRANSITION_RELOAD); if (!navigation_context->IsRendererInitiated() || - (!navigation_context->IsSameDocument() && item != blocked_item_)) { + (!navigation_context->IsSameDocument() && item != blocked_item_ && + !navigation_is_reload)) { dialog_count_ = 0; blocked_item_ = nullptr; }
diff --git a/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state_unittest.mm b/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state_unittest.mm index 7099d95..d5df528 100644 --- a/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state_unittest.mm +++ b/ios/chrome/browser/ui/dialogs/java_script_dialog_blocking_state_unittest.mm
@@ -34,6 +34,7 @@ // Simulates a navigation by sending a WebStateObserver callback. void SimulateNavigationStarted(bool renderer_initiated, bool same_document, + ui::PageTransition transition, bool change_last_committed_item) { if (change_last_committed_item) { last_committed_item_ = web::NavigationItem::Create(); @@ -83,38 +84,62 @@ EXPECT_TRUE(state().blocked()); } -// Tests that blocked() returns false after a user-initiated or document- -// changing navigation. -TEST_F(JavaScriptDialogBlockingStateTest, StopBlocking) { - EXPECT_FALSE(state().blocked()); +// Tests that blocked() returns false after user-initiated navigations. +TEST_F(JavaScriptDialogBlockingStateTest, StopBlockingForUserInitiated) { + // Verify that the blocked bit is unset after a document-changing, user- + // initiated navigation. state().JavaScriptDialogBlockingOptionSelected(); EXPECT_TRUE(state().blocked()); - web_state().SimulateNavigationStarted(false /* renderer_initiated */, - false /* same_document */, - true /* change_last_committed_item */); + web_state().SimulateNavigationStarted( + false /* renderer_initiated */, false /* same_document */, + ui::PAGE_TRANSITION_TYPED, /* transition */ + true /* change_last_committed_item */); EXPECT_FALSE(state().blocked()); + + // Verify that the blocked bit is unset after a same-changing, user- + // initiated navigation. state().JavaScriptDialogBlockingOptionSelected(); EXPECT_TRUE(state().blocked()); - web_state().SimulateNavigationStarted(true /* renderer_initiated */, - false /* same_document */, - true /* change_last_committed_item */); - EXPECT_FALSE(state().blocked()); - state().JavaScriptDialogBlockingOptionSelected(); - EXPECT_TRUE(state().blocked()); - web_state().SimulateNavigationStarted(false /* renderer_initiated */, - true /* same_document */, - true /* change_last_committed_item */); + web_state().SimulateNavigationStarted( + false /* renderer_initiated */, true /* same_document */, + ui::PAGE_TRANSITION_LINK, /* transition */ + true /* change_last_committed_item */); EXPECT_FALSE(state().blocked()); } -// Tests that blocked() returns true after a renderer-initiated, same-document -// navigation that doesn't change the last committed item. -TEST_F(JavaScriptDialogBlockingStateTest, ContinueBlocking) { - EXPECT_FALSE(state().blocked()); +// Tests that blocked() returns false after document-changing navigations. +TEST_F(JavaScriptDialogBlockingStateTest, StopBlockingForDocumentChange) { + // Verify that the blocked bit is unset after a document-changing, renderer- + // initiated navigation. state().JavaScriptDialogBlockingOptionSelected(); EXPECT_TRUE(state().blocked()); - web_state().SimulateNavigationStarted(true /* renderer_initiated */, - true /* same_document */, - false /* change_last_committed_item */); + web_state().SimulateNavigationStarted( + true /* renderer_initiated */, false /* same_document */, + ui::PAGE_TRANSITION_LINK, /* transition */ + true /* change_last_committed_item */); + EXPECT_FALSE(state().blocked()); +} + +// Tests that blocked() continues to return true after a reload. +TEST_F(JavaScriptDialogBlockingStateTest, ContinueBlockingForReload) { + state().JavaScriptDialogBlockingOptionSelected(); + EXPECT_TRUE(state().blocked()); + web_state().SimulateNavigationStarted( + true /* renderer_initiated */, true /* same_document */, + ui::PAGE_TRANSITION_RELOAD, /* transition */ + true /* change_last_committed_item */); + EXPECT_TRUE(state().blocked()); +} + +// Tests that blocked() returns true after a renderer-initiated, same-document +// navigation. +TEST_F(JavaScriptDialogBlockingStateTest, + ContinueBlockingForRendererInitiatedSameDocument) { + state().JavaScriptDialogBlockingOptionSelected(); + EXPECT_TRUE(state().blocked()); + web_state().SimulateNavigationStarted( + true /* renderer_initiated */, true /* same_document */, + ui::PAGE_TRANSITION_LINK, /* transition */ + false /* change_last_committed_item */); EXPECT_TRUE(state().blocked()); }
diff --git a/ios/chrome/browser/ui/download/OWNERS b/ios/chrome/browser/ui/download/OWNERS new file mode 100644 index 0000000..476af25d --- /dev/null +++ b/ios/chrome/browser/ui/download/OWNERS
@@ -0,0 +1,5 @@ +eugenebut@chromium.org +sdefresne@chromium.org + +# TEAM: ios-directory-owners@chromium.org +# OS: iOS
diff --git a/ios/chrome/browser/ui/download/legacy_download_manager_controller.h b/ios/chrome/browser/ui/download/legacy_download_manager_controller.h index b3a129f..6f46a2de 100644 --- a/ios/chrome/browser/ui/download/legacy_download_manager_controller.h +++ b/ios/chrome/browser/ui/download/legacy_download_manager_controller.h
@@ -33,10 +33,6 @@ // initialization. - (void)start; -// Deletes the directory in which downloaded files are saved. It should only be -// called on the UI thread. -+ (void)clearDownloadsDirectory; - @end #endif // IOS_CHROME_BROWSER_UI_DOWNLOAD_LEGACY_DOWNLOAD_MANAGER_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/download/legacy_download_manager_controller.mm b/ios/chrome/browser/ui/download/legacy_download_manager_controller.mm index 1915209..f593b316 100644 --- a/ios/chrome/browser/ui/download/legacy_download_manager_controller.mm +++ b/ios/chrome/browser/ui/download/legacy_download_manager_controller.mm
@@ -11,8 +11,6 @@ #include "base/files/file_util.h" #include "base/location.h" #include "base/mac/bind_objc_block.h" -#include "base/task_scheduler/post_task.h" - #include "base/memory/ref_counted.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" @@ -21,6 +19,7 @@ #include "base/strings/sys_string_conversions.h" #include "base/task_scheduler/post_task.h" #include "components/strings/grit/components_strings.h" +#include "ios/chrome/browser/download/download_directory_util.h" #import "ios/chrome/browser/installation_notifier.h" #import "ios/chrome/browser/store_kit/store_kit_tab_helper.h" #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" @@ -199,10 +198,6 @@ // NetworkActivityIndicatorManager. - (NSString*)getNetworkActivityKey; -// Fills |path| with the FilePath to the downloads directory. Returns YES if -// this is successul, or NO otherwise. -+ (BOOL)fetchDownloadsDirectoryFilePath:(base::FilePath*)path; - @end namespace { @@ -1207,8 +1202,7 @@ - (void)beginStartingContentDownload { // Ensure the directory that downloaded files are saved to exists. base::FilePath downloadsDirectoryPath; - if (![LegacyDownloadManagerController - fetchDownloadsDirectoryFilePath:&downloadsDirectoryPath]) { + if (!GetDownloadsDirectory(&downloadsDirectoryPath)) { [self displayError]; return; } @@ -1229,8 +1223,7 @@ return; } base::FilePath downloadsDirectoryPath; - if (![LegacyDownloadManagerController - fetchDownloadsDirectoryFilePath:&downloadsDirectoryPath]) { + if (!GetDownloadsDirectory(&downloadsDirectoryPath)) { [self displayError]; return; } @@ -1564,27 +1557,6 @@ _downloadManagerId]; } -+ (BOOL)fetchDownloadsDirectoryFilePath:(base::FilePath*)path { - if (!GetTempDir(path)) { - return NO; - } - *path = path->Append("downloads"); - return YES; -} - -+ (void)clearDownloadsDirectory { - base::PostTaskWithTraits( - FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, - base::BindBlockArc(^{ - base::FilePath downloadsDirectory; - if (![LegacyDownloadManagerController - fetchDownloadsDirectoryFilePath:&downloadsDirectory]) { - return; - } - DeleteFile(downloadsDirectory, true); - })); -} - #pragma mark - UIDocumentInteractionControllerDelegate - (void)documentInteractionController:
diff --git a/ios/chrome/browser/ui/download/pass_kit_coordinator.mm b/ios/chrome/browser/ui/download/pass_kit_coordinator.mm index 7fee990..aa006549 100644 --- a/ios/chrome/browser/ui/download/pass_kit_coordinator.mm +++ b/ios/chrome/browser/ui/download/pass_kit_coordinator.mm
@@ -115,7 +115,7 @@ DCHECK(InfoBarManagerImpl::FromWebState(_webState)); SimpleAlertInfoBarDelegate::Create( InfoBarManagerImpl::FromWebState(_webState), - infobars::InfoBarDelegate::SHOW_PASSKIT_INFOBAR_ERROR_DELEGATE, + infobars::InfoBarDelegate::SHOW_PASSKIT_ERROR_INFOBAR_DELEGATE_IOS, /*vector_icon=*/nullptr, l10n_util::GetStringUTF16(IDS_IOS_GENERIC_PASSKIT_ERROR), /*auto_expire=*/true);
diff --git a/ios/chrome/browser/ui/find_bar/find_bar_controller_ios.mm b/ios/chrome/browser/ui/find_bar/find_bar_controller_ios.mm index 60973bd..6b67d89 100644 --- a/ios/chrome/browser/ui/find_bar/find_bar_controller_ios.mm +++ b/ios/chrome/browser/ui/find_bar/find_bar_controller_ios.mm
@@ -33,6 +33,9 @@ const CGFloat kFindBarIPhoneHeight = 56; const CGFloat kFindBarIPadHeight = 62; +// Padding added by the invisible background. +const CGFloat kBackgroundPadding = 6; + // Find Bar animation drop down duration. const CGFloat kAnimationDuration = 0.15; @@ -361,7 +364,6 @@ frame.size.height = 0; CGFloat containerWidth = parentView.bounds.size.width; - CGFloat nibWidth = frame.size.width; // On iPad, there are three possible frames for the Search bar: // 1. In Regular width size class, it is short, right-aligned to the omnibox's @@ -372,17 +374,19 @@ // container view from edge to edge, ignoring the omnibox. if (view.cr_widthSizeClass == REGULAR) { if (base::i18n::IsRTL()) { - frame.origin.x = CGRectGetMinX(omniboxFrame); + frame.origin.x = CGRectGetMinX(omniboxFrame) - kBackgroundPadding; } else { - frame.origin.x = - CGRectGetMinX(omniboxFrame) + CGRectGetWidth(omniboxFrame) - nibWidth; + frame.origin.x = CGRectGetMinX(omniboxFrame) + + CGRectGetWidth(omniboxFrame) - frame.size.width + + kBackgroundPadding; } - frame.size.width = nibWidth; } else { // Compact size class. - if (omniboxFrame.size.width > nibWidth) { - frame.origin.x = omniboxFrame.origin.x; - frame.size.width = omniboxFrame.size.width; + CGRect visibleFrame = CGRectInset(frame, kBackgroundPadding, 0); + if (omniboxFrame.size.width > visibleFrame.size.width) { + visibleFrame.origin.x = omniboxFrame.origin.x; + visibleFrame.size.width = omniboxFrame.size.width; + frame = CGRectInset(visibleFrame, -kBackgroundPadding, 0); } else { frame.origin.x = 0; frame.size.width = containerWidth;
diff --git a/ios/chrome/browser/ui/first_run/first_run_egtest.mm b/ios/chrome/browser/ui/first_run/first_run_egtest.mm index 99f620e..aca0f183 100644 --- a/ios/chrome/browser/ui/first_run/first_run_egtest.mm +++ b/ios/chrome/browser/ui/first_run/first_run_egtest.mm
@@ -122,6 +122,25 @@ } // Navigates to the terms of service and back. +- (void)testPrivacy { + [chrome_test_util::GetMainController() showFirstRunUI]; + + id<GREYMatcher> privacyLink = grey_accessibilityLabel(@"Privacy Notice"); + [[EarlGrey selectElementWithMatcher:privacyLink] performAction:grey_tap()]; + + [[EarlGrey selectElementWithMatcher:grey_text(l10n_util::GetNSString( + IDS_IOS_FIRSTRUN_PRIVACY_TITLE))] + assertWithMatcher:grey_sufficientlyVisible()]; + + [[EarlGrey selectElementWithMatcher:SettingsMenuBackButton()] + performAction:grey_tap()]; + + // Ensure we went back to the First Run screen. + [[EarlGrey selectElementWithMatcher:privacyLink] + assertWithMatcher:grey_sufficientlyVisible()]; +} + +// Navigates to the terms of service and back. - (void)testTermsAndConditions { [chrome_test_util::GetMainController() showFirstRunUI];
diff --git a/ios/chrome/browser/ui/first_run/welcome_to_chrome_view.h b/ios/chrome/browser/ui/first_run/welcome_to_chrome_view.h index a819590d..5acb9a2c1 100644 --- a/ios/chrome/browser/ui/first_run/welcome_to_chrome_view.h +++ b/ios/chrome/browser/ui/first_run/welcome_to_chrome_view.h
@@ -13,7 +13,10 @@ @protocol WelcomeToChromeViewDelegate<NSObject> // Called when the user taps on the "Terms of Service" link. -- (void)welcomeToChromeViewDidTapTOSLink:(WelcomeToChromeView*)view; +- (void)welcomeToChromeViewDidTapTOSLink; + +// Called when the user taps on the "Privacy Notice" link. +- (void)welcomeToChromeViewDidTapPrivacyLink; // Called when the user taps the "Accept & Continue" button. - (void)welcomeToChromeViewDidTapOKButton:(WelcomeToChromeView*)view;
diff --git a/ios/chrome/browser/ui/first_run/welcome_to_chrome_view.mm b/ios/chrome/browser/ui/first_run/welcome_to_chrome_view.mm index 1300680..68b3b9d 100644 --- a/ios/chrome/browser/ui/first_run/welcome_to_chrome_view.mm +++ b/ios/chrome/browser/ui/first_run/welcome_to_chrome_view.mm
@@ -131,10 +131,6 @@ // Action triggered by the ok button. - (void)OKButtonWasTapped; -// The TOS label button was tapped. -// TODO(crbug.com/539961): Remove once link detection is fixed. -- (void)TOSLinkWasTapped; - @end @implementation WelcomeToChromeView @@ -360,19 +356,35 @@ containerSize.height = CGFLOAT_MAX; self.TOSLabel.frame = {CGPointZero, containerSize}; NSString* TOSText = l10n_util::GetNSString(IDS_IOS_FIRSTRUN_AGREE_TO_TERMS); - NSRange linkTextRange = NSMakeRange(NSNotFound, 0); - NSString* strippedText = ParseStringWithLink(TOSText, &linkTextRange); - DCHECK_NE(NSNotFound, static_cast<NSInteger>(linkTextRange.location)); - DCHECK_NE(0u, linkTextRange.length); + NSRange tosLinkTextRange = NSMakeRange(NSNotFound, 0); + NSRange privacyLinkTextRange = NSMakeRange(NSNotFound, 0); + TOSText = ParseStringWithTag(TOSText, &tosLinkTextRange, + @"BEGIN_LINK_TOS[ \t]*", @"[ \t]*END_LINK_TOS"); + TOSText = ParseStringWithTag(TOSText, &privacyLinkTextRange, + @"BEGIN_LINK_PRIVACY[ \t]*", + @"[ \t]*END_LINK_PRIVACY"); - self.TOSLabel.text = strippedText; + DCHECK_NE(NSNotFound, static_cast<NSInteger>(tosLinkTextRange.location)); + DCHECK_NE(0u, tosLinkTextRange.length); + DCHECK_NE(NSNotFound, static_cast<NSInteger>(privacyLinkTextRange.location)); + DCHECK_NE(0u, privacyLinkTextRange.length); + + self.TOSLabel.text = TOSText; if (FixOrphanWord(self.TOSLabel)) { // If a newline is inserted, check whether it was added mid-link and adjust - // |linkTextRange| accordingly. - NSRange newlineRange = - [self.TOSLabel.text rangeOfString:@"\n" options:0 range:linkTextRange]; + // |tosLinkTextRange| and |privacyLinkTextRange| accordingly. + NSRange newlineRange = [self.TOSLabel.text rangeOfString:@"\n" + options:0 + range:tosLinkTextRange]; + if (newlineRange.length) { + tosLinkTextRange.location++; + privacyLinkTextRange.location++; + } + newlineRange = [self.TOSLabel.text rangeOfString:@"\n" + options:0 + range:privacyLinkTextRange]; if (newlineRange.length) - linkTextRange.length++; + privacyLinkTextRange.location++; } __weak WelcomeToChromeView* weakSelf = self; @@ -380,14 +392,22 @@ WelcomeToChromeView* strongSelf = weakSelf; if (!strongSelf) return; - [[strongSelf delegate] welcomeToChromeViewDidTapTOSLink:strongSelf]; + if (url == GURL("internal://terms-of-service")) { + [[strongSelf delegate] welcomeToChromeViewDidTapTOSLink]; + } else if (url == GURL("internal://privacy-notice")) { + [[strongSelf delegate] welcomeToChromeViewDidTapPrivacyLink]; + } else { + NOTREACHED(); + } }; _TOSLabelLinkController = [[LabelLinkController alloc] initWithLabel:_TOSLabel action:action]; [_TOSLabelLinkController - addLinkWithRange:linkTextRange + addLinkWithRange:tosLinkTextRange url:GURL("internal://terms-of-service")]; + [_TOSLabelLinkController addLinkWithRange:privacyLinkTextRange + url:GURL("internal://privacy-notice")]; [_TOSLabelLinkController setLinkColor:UIColorFromRGB(kLinkColorRGB)]; CGSize TOSLabelSize = [self.TOSLabel sizeThatFits:containerSize]; @@ -554,8 +574,4 @@ [self.delegate welcomeToChromeViewDidTapOKButton:self]; } -- (void)TOSLinkWasTapped { - [self.delegate welcomeToChromeViewDidTapTOSLink:self]; -} - @end
diff --git a/ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller.mm b/ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller.mm index fbcd02bb..b401f8f 100644 --- a/ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller.mm +++ b/ios/chrome/browser/ui/first_run/welcome_to_chrome_view_controller.mm
@@ -29,6 +29,7 @@ #include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/public/provider/chrome/browser/chrome_browser_provider.h" #import "ios/public/provider/chrome/browser/signin/chrome_identity_service.h" +#include "net/base/mac/url_conversions.h" #include "ui/base/l10n/l10n_util.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -158,12 +159,19 @@ #pragma mark - WelcomeToChromeViewDelegate -- (void)welcomeToChromeViewDidTapTOSLink:(WelcomeToChromeView*)view { +- (void)welcomeToChromeViewDidTapTOSLink { NSString* title = l10n_util::GetNSString(IDS_IOS_FIRSTRUN_TERMS_TITLE); NSURL* tosUrl = [self newTermsOfServiceUrl]; [self openStaticFileWithURL:tosUrl title:title]; } +- (void)welcomeToChromeViewDidTapPrivacyLink { + NSString* title = l10n_util::GetNSString(IDS_IOS_FIRSTRUN_PRIVACY_TITLE); + NSURL* privacyUrl = net::NSURLWithGURL( + GURL("https://www.google.com/chrome/browser/privacy/")); + [self openStaticFileWithURL:privacyUrl title:title]; +} + - (void)welcomeToChromeViewDidTapOKButton:(WelcomeToChromeView*)view { GetApplicationContext()->GetLocalState()->SetBoolean( metrics::prefs::kMetricsReportingEnabled, view.checkBoxSelected);
diff --git a/ios/chrome/browser/ui/fullscreen/BUILD.gn b/ios/chrome/browser/ui/fullscreen/BUILD.gn index eea00f6..07727b1 100644 --- a/ios/chrome/browser/ui/fullscreen/BUILD.gn +++ b/ios/chrome/browser/ui/fullscreen/BUILD.gn
@@ -187,6 +187,7 @@ configs += [ "//build/config/compiler:enable_arc" ] deps = [ + ":fullscreen", "//base", "//ios/chrome/browser/ui:ui_util", "//ios/chrome/browser/ui/side_swipe",
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_egtest.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_egtest.mm index 59f345e..1dc8968 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_egtest.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_egtest.mm
@@ -11,6 +11,8 @@ #include "base/strings/stringprintf.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" +#import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h" #include "ios/chrome/browser/ui/ui_util.h" #import "ios/chrome/test/app/chrome_test_util.h" #import "ios/chrome/test/app/settings_test_util.h" @@ -66,12 +68,20 @@ #pragma mark - Tests // Fullscreens tests for Chrome. -@interface FullscreenTestCase : ChromeTestCase +@interface FullscreenTestCase : ChromeTestCase { + base::test::ScopedFeatureList _featureList; +} @end @implementation FullscreenTestCase +- (void)setUp { + // TODO(crbug.com/799345): Remove scoped feature list. + _featureList.InitAndDisableFeature(fullscreen::features::kNewFullscreen); + [super setUp]; +} + // Verifies that the content offset of the web view is set up at the correct // initial value when initially displaying a PDF. - (void)testLongPDFInitialState {
diff --git a/ios/chrome/browser/ui/fullscreen/fullscreen_features.mm b/ios/chrome/browser/ui/fullscreen/fullscreen_features.mm index 7c29879..2b40d21 100644 --- a/ios/chrome/browser/ui/fullscreen/fullscreen_features.mm +++ b/ios/chrome/browser/ui/fullscreen/fullscreen_features.mm
@@ -12,7 +12,7 @@ namespace features { const base::Feature kNewFullscreen{"NewFullscreen", - base::FEATURE_DISABLED_BY_DEFAULT}; + base::FEATURE_ENABLED_BY_DEFAULT}; } // namespace features } // namespace fullscreen
diff --git a/ios/chrome/browser/ui/image_util/BUILD.gn b/ios/chrome/browser/ui/image_util/BUILD.gn index b1fe214..f270f75 100644 --- a/ios/chrome/browser/ui/image_util/BUILD.gn +++ b/ios/chrome/browser/ui/image_util/BUILD.gn
@@ -15,7 +15,6 @@ "//components/image_fetcher/ios", "//components/strings", "//ios/chrome/app/strings", - "//ios/chrome/browser", "//ios/chrome/browser/ui/alert_coordinator", "//net", "//ui/base",
diff --git a/ios/chrome/browser/ui/image_util/image_saver.mm b/ios/chrome/browser/ui/image_util/image_saver.mm index 237ce01d..b41406140 100644 --- a/ios/chrome/browser/ui/image_util/image_saver.mm +++ b/ios/chrome/browser/ui/image_util/image_saver.mm
@@ -14,7 +14,6 @@ #include "base/threading/thread_restrictions.h" #include "components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h" #include "components/strings/grit/components_strings.h" -#import "ios/chrome/browser/open_url_util.h" #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" #include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_strings.h" @@ -205,7 +204,9 @@ addItemWithTitle:l10n_util::GetNSString( IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_GO_TO_SETTINGS) action:^{ - OpenUrlWithCompletionHandler(settingURL, nil); + [[UIApplication sharedApplication] openURL:settingURL + options:@{} + completionHandler:nil]; } style:UIAlertActionStyleDefault];
diff --git a/ios/chrome/browser/ui/omnibox_perftest.mm b/ios/chrome/browser/ui/omnibox_perftest.mm index 50dbec6..6277064 100644 --- a/ios/chrome/browser/ui/omnibox_perftest.mm +++ b/ios/chrome/browser/ui/omnibox_perftest.mm
@@ -262,7 +262,8 @@ // Measures the amount of time it takes to type in the word "google" one // letter at a time. -TEST_F(OmniboxPerfTest, TestTypingInTextField) { +// TODO(crbug.com/799488): Re-enable this test. +TEST_F(OmniboxPerfTest, DISABLED_TestTypingInTextField) { OmniboxTextFieldIOS* textField = (OmniboxTextFieldIOS*)FindViewByClass( [toolbar_ view], [OmniboxTextFieldIOS class]); // The characters to type into the omnibox text field.
diff --git a/ios/chrome/browser/ui/qr_scanner/BUILD.gn b/ios/chrome/browser/ui/qr_scanner/BUILD.gn index 33344a8..521cb9d 100644 --- a/ios/chrome/browser/ui/qr_scanner/BUILD.gn +++ b/ios/chrome/browser/ui/qr_scanner/BUILD.gn
@@ -22,7 +22,6 @@ "//base", "//components/version_info", "//ios/chrome/app/strings", - "//ios/chrome/browser", "//ios/chrome/browser/ui", "//ios/chrome/browser/ui/icons", "//ios/chrome/browser/ui/qr_scanner/requirements",
diff --git a/ios/chrome/browser/ui/qr_scanner/qr_scanner_alerts.mm b/ios/chrome/browser/ui/qr_scanner/qr_scanner_alerts.mm index 27ecbbe..71d085c 100644 --- a/ios/chrome/browser/ui/qr_scanner/qr_scanner_alerts.mm +++ b/ios/chrome/browser/ui/qr_scanner/qr_scanner_alerts.mm
@@ -8,7 +8,6 @@ #include "base/logging.h" #include "components/version_info/version_info.h" -#import "ios/chrome/browser/open_url_util.h" #include "ios/chrome/grit/ios_chromium_strings.h" #include "ios/chrome/grit/ios_strings.h" #include "ui/base/l10n/l10n_util.h" @@ -78,12 +77,16 @@ UIAlertController* dialog = AlertWithCancelButton(dialogTitle, dialogBody, cancelBlock); + void (^handler)(UIAlertAction*) = ^(UIAlertAction* action) { + [[UIApplication sharedApplication] openURL:settingsURL + options:@{} + completionHandler:nil]; + }; + UIAlertAction* settingsAction = [UIAlertAction actionWithTitle:settingsButton style:UIAlertActionStyleDefault - handler:^(UIAlertAction* action) { - OpenUrlWithCompletionHandler(settingsURL, nil); - }]; + handler:handler]; [dialog addAction:settingsAction]; [dialog setPreferredAction:settingsAction]; return dialog;
diff --git a/ios/chrome/browser/ui/settings/autofill_collection_view_controller.mm b/ios/chrome/browser/ui/settings/autofill_collection_view_controller.mm index 1cec9ba..fdc417d6 100644 --- a/ios/chrome/browser/ui/settings/autofill_collection_view_controller.mm +++ b/ios/chrome/browser/ui/settings/autofill_collection_view_controller.mm
@@ -323,6 +323,26 @@ switchItem.on = on; } +// Sets switchItem's enaled status to |enabled| and reconfigures the +// corresponding cell. It is important that there is no more than one item of +// |switchItemType| in SectionIdentifierSwitches. +- (void)setSwitchItemEnabled:(BOOL)enabled itemType:(ItemType)switchItemType { + CollectionViewModel* model = self.collectionViewModel; + + if (![model hasItemForItemType:switchItemType + sectionIdentifier:SectionIdentifierSwitches]) { + return; + } + NSIndexPath* switchPath = + [model indexPathForItemType:switchItemType + sectionIdentifier:SectionIdentifierSwitches]; + CollectionViewSwitchItem* switchItem = + base::mac::ObjCCastStrict<CollectionViewSwitchItem>( + [model itemAtIndexPath:switchPath]); + [switchItem setEnabled:enabled]; + [self reconfigureCellsForItems:@[ switchItem ]]; +} + #pragma mark - Insert or Delete Items and Sections - (void)insertWalletSwitchItem { @@ -463,6 +483,20 @@ return YES; } +- (void)collectionViewWillBeginEditing:(UICollectionView*)collectionView { + [super collectionViewWillBeginEditing:collectionView]; + + [self setSwitchItemEnabled:NO itemType:ItemTypeAutofillSwitch]; + [self setSwitchItemEnabled:NO itemType:ItemTypeWalletSwitch]; +} + +- (void)collectionViewWillEndEditing:(UICollectionView*)collectionView { + [super collectionViewWillEndEditing:collectionView]; + + [self setSwitchItemEnabled:YES itemType:ItemTypeAutofillSwitch]; + [self setSwitchItemEnabled:YES itemType:ItemTypeWalletSwitch]; +} + - (BOOL)collectionView:(UICollectionView*)collectionView canEditItemAtIndexPath:(NSIndexPath*)indexPath { // Only autofill data cells are editable. @@ -534,7 +568,8 @@ } // Turn off edit mode if there is nothing to edit. - if (![strongSelf localProfilesOrCreditCardsExist]) { + if (![strongSelf localProfilesOrCreditCardsExist] && + [strongSelf.editor isEditing]) { [[strongSelf editor] setEditing:NO]; } [strongSelf updateEditButton]; @@ -557,7 +592,7 @@ if (_userInteractionInProgress) return; - if (![self localProfilesOrCreditCardsExist]) { + if (![self localProfilesOrCreditCardsExist] && [self.editor isEditing]) { // Turn off edit mode if there exists nothing to edit. [self.editor setEditing:NO]; }
diff --git a/ios/chrome/browser/ui/settings/sync_utils/sync_error_infobar_delegate.mm b/ios/chrome/browser/ui/settings/sync_utils/sync_error_infobar_delegate.mm index d3fc563..70a576b 100644 --- a/ios/chrome/browser/ui/settings/sync_utils/sync_error_infobar_delegate.mm +++ b/ios/chrome/browser/ui/settings/sync_utils/sync_error_infobar_delegate.mm
@@ -69,7 +69,7 @@ infobars::InfoBarDelegate::InfoBarIdentifier SyncErrorInfoBarDelegate::GetIdentifier() const { - return SYNC_ERROR_INFOBAR_DELEGATE; + return SYNC_ERROR_INFOBAR_DELEGATE_IOS; } base::string16 SyncErrorInfoBarDelegate::GetMessageText() const {
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.h b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.h index 3ff93dff..014d7b52 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.h +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.h
@@ -74,9 +74,6 @@ - (void)setBackgroundToIncognitoNTPColorWithAlpha:(CGFloat)alpha; // Briefly animate the progress bar when a pre-rendered tab is displayed. - (void)showPrerenderingAnimation; -// TODO(crbug.com/789583):Use named layout guide instead of frame. -// Returns visible omnibox frame in Toolbar's superview coordinate system. -- (CGRect)visibleOmniboxFrame; // Returns whether omnibox is a first responder. - (BOOL)isOmniboxFirstResponder; // Returns whether the omnibox popup is currently displayed.
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm index fc4cc29..c3937069 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm
@@ -185,6 +185,9 @@ } - (void)stop { + if (!self.started) + return; + self.started = NO; self.delegate = nil; [self.mediator disconnect]; @@ -262,10 +265,6 @@ [self.toolbarViewController showPrerenderingAnimation]; } -- (CGRect)visibleOmniboxFrame { - return [self.toolbarViewController visibleOmniboxFrame]; -} - - (BOOL)isOmniboxFirstResponder { return [self.locationBarCoordinator.locationBarView.textField isFirstResponder];
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h index 6590e24..f5998963 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h
@@ -65,9 +65,6 @@ - (void)setBackgroundToIncognitoNTPColorWithAlpha:(CGFloat)alpha; // Briefly animate the progress bar when a pre-rendered tab is displayed. - (void)showPrerenderingAnimation; -// TODO(crbug.com/789583):Use named layout guide instead of frame. -// Returns visible omnibox frame in Toolbar's superview coordinate system. -- (CGRect)visibleOmniboxFrame; // IPad only function. iPad doesn't animate when locationBar is first responder, // but there are small UI changes to the locationBarContainer. - (void)locationBarIsFirstResonderOnIPad:(BOOL)isFirstResponder;
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm index c19e0423..cdbe701 100644 --- a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm +++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm
@@ -92,13 +92,20 @@ forViews:self.view.trailingStackViewButtons]; [self setAllToolbarButtonsOpacity:0]; }; + void (^completion)(UIViewAnimatingPosition finalPosition) = ^( + UIViewAnimatingPosition finalPosition) { + [self setHorizontalTranslationOffset:0 + forViews:self.view.leadingStackViewButtons]; + [self setHorizontalTranslationOffset:0 + forViews:self.view.trailingStackViewButtons]; + }; [UIViewPropertyAnimator runningPropertyAnimatorWithDuration:ios::material::kDuration2 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:animations - completion:nil]; + completion:completion]; [animator addAnimations:^{ [self.view layoutIfNeeded]; @@ -250,15 +257,6 @@ }]; } -- (CGRect)visibleOmniboxFrame { - CGRect frame = self.view.locationBarContainer.frame; - frame = [self.view.superview - convertRect:frame - fromView:[self.view.locationBarContainer superview]]; - // Needed by the find in page view. - return CGRectInset(frame, -kBackgroundImageVisibleRectOffset, 0); -} - - (void)locationBarIsFirstResonderOnIPad:(BOOL)isFirstResponder { // This is an iPad only function. DCHECK(IsIPadIdiom()); @@ -361,6 +359,7 @@ // Stop button. self.view.stopButton.visibilityMask = ToolbarComponentVisibilityRegularWidth; + self.view.stopButton.hiddenInCurrentState = YES; [self addStandardActionsForButton:self.view.stopButton]; // Voice Search button.
diff --git a/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.h b/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.h index cc3a1c9..3ab9673 100644 --- a/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.h +++ b/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.h
@@ -7,43 +7,21 @@ #import <UIKit/UIKit.h> -#import "ios/chrome/browser/ui/bubble/bubble_view_anchor_point_provider.h" #import "ios/chrome/browser/ui/coordinators/chrome_coordinator.h" -#import "ios/chrome/browser/ui/fullscreen/fullscreen_ui_element.h" #import "ios/chrome/browser/ui/ntp/incognito_view_controller_delegate.h" -#import "ios/chrome/browser/ui/toolbar/public/abstract_web_toolbar.h" +#import "ios/chrome/browser/ui/toolbar/public/legacy_toolbar_coordinator.h" #import "ios/chrome/browser/ui/toolbar/public/primary_toolbar_coordinator.h" +#import "ios/chrome/browser/ui/toolbar/public/toolbar.h" #import "ios/chrome/browser/ui/toolbar/toolbar_snapshot_providing.h" -#import "ios/chrome/browser/ui/tools_menu/public/tools_menu_presentation_provider.h" #import "ios/chrome/browser/ui/tools_menu/public/tools_menu_presentation_state_provider.h" -@protocol ActivityServicePositioner; -@class Tab; -@protocol ToolsMenuConfigurationProvider; - @class CommandDispatcher; -@class TabModel; -@class ToolbarController; -@class WebToolbarController; - -@protocol Toolbar<AbstractWebToolbar, - OmniboxFocuser, - VoiceSearchControllerDelegate, - ActivityServicePositioner, - QRScannerResultLoading, - BubbleViewAnchorPointProvider, - ToolsMenuPresentationProvider, - FullscreenUIElement> - -- (void)setToolsMenuIsVisibleForToolsMenuButton:(BOOL)isVisible; -- (void)start; - -@end +@protocol ToolsMenuConfigurationProvider; @interface LegacyToolbarCoordinator : ChromeCoordinator<PrimaryToolbarCoordinator, - BubbleViewAnchorPointProvider, IncognitoViewControllerDelegate, + LegacyToolbarCoordinator, ToolbarSnapshotProviding, ToolsMenuPresentationStateProvider> @@ -61,27 +39,12 @@ (ios::ChromeBrowserState*)browserState NS_UNAVAILABLE; -// Returns the different protocols and superclass now implemented by the -// internal ViewController. -- (id<ActivityServicePositioner>)activityServicePositioner; - // Sets the toolbarController for this coordinator. - (void)setToolbarController:(id<Toolbar>)toolbarController; // ToolbarController public interface. - (void)updateToolbarState; -- (CGRect)visibleOmniboxFrame; - (void)triggerToolsMenuButtonAnimation; -- (BOOL)isShowingToolsMenu; - -// TODO(crbug.com/788705): Legacy interface. Removes those methods once the old -// toolbar is removed. -- (void)selectedTabChanged; -- (void)setTabCount:(NSInteger)tabCount; -- (void)browserStateDestroyed; -- (void)setShareButtonEnabled:(BOOL)enabled; -- (void)currentPageLoadStarted; -- (void)adjustToolbarHeight; @end
diff --git a/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.mm index 2a7cf77..1c3f8606 100644 --- a/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.mm +++ b/ios/chrome/browser/ui/toolbar/legacy_toolbar_coordinator.mm
@@ -73,6 +73,9 @@ } - (void)stop { + [self.toolbarController setBackgroundAlpha:1.0]; + [self.toolbarController browserStateDestroyed]; + [self.toolbarController stop]; if (base::FeatureList::IsEnabled(fullscreen::features::kNewFullscreen)) [self stopObservingFullscreen]; self.toolbarController = nil; @@ -130,10 +133,7 @@ } - (void)browserStateDestroyed { - [self.toolbarController setBackgroundAlpha:1.0]; - [self.toolbarController browserStateDestroyed]; - if (base::FeatureList::IsEnabled(fullscreen::features::kNewFullscreen)) - [self stopObservingFullscreen]; + [self stop]; } - (void)updateToolbarState {
diff --git a/ios/chrome/browser/ui/toolbar/public/BUILD.gn b/ios/chrome/browser/ui/toolbar/public/BUILD.gn index 612022bd..bb391d9 100644 --- a/ios/chrome/browser/ui/toolbar/public/BUILD.gn +++ b/ios/chrome/browser/ui/toolbar/public/BUILD.gn
@@ -7,9 +7,11 @@ sources = [ "abstract_toolbar.h", "abstract_web_toolbar.h", + "legacy_toolbar_coordinator.h", "omnibox_focuser.h", "primary_toolbar_coordinator.h", "side_swipe_toolbar_interacting.h", + "toolbar.h", "toolbar_controller_constants.h", "toolbar_controller_constants.mm", "toolbar_utils.h", @@ -21,6 +23,12 @@ ":toolbar_base_feature", "//base", "//ios/chrome/browser/ui", + "//ios/chrome/browser/ui/activity_services/requirements", + "//ios/chrome/browser/ui/bubble", + "//ios/chrome/browser/ui/fullscreen:new_fullscreen_ui", + "//ios/chrome/browser/ui/qr_scanner/requirements", + "//ios/chrome/browser/ui/tools_menu/public", + "//ios/public/provider/chrome/browser/voice", ] }
diff --git a/ios/chrome/browser/ui/toolbar/public/legacy_toolbar_coordinator.h b/ios/chrome/browser/ui/toolbar/public/legacy_toolbar_coordinator.h new file mode 100644 index 0000000..7911a5d --- /dev/null +++ b/ios/chrome/browser/ui/toolbar/public/legacy_toolbar_coordinator.h
@@ -0,0 +1,26 @@ +// Copyright 2018 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 IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_LEGACY_TOOLBAR_COORDINATOR_H_ +#define IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_LEGACY_TOOLBAR_COORDINATOR_H_ + +#import "ios/chrome/browser/ui/bubble/bubble_view_anchor_point_provider.h" + +// TODO(crbug.com/788705): Remove this protocol during old toolbar cleanup. +// This protocol is containing the legacy methods implemented by the +// LegacyToolbarCoordinator. It is used to separate those methods from the ones +// used in the refactored toolbar. +@protocol LegacyToolbarCoordinator<BubbleViewAnchorPointProvider, NSObject> + +- (void)selectedTabChanged; +- (void)setTabCount:(NSInteger)tabCount; +- (void)browserStateDestroyed; +- (void)setShareButtonEnabled:(BOOL)enabled; +- (void)currentPageLoadStarted; +- (void)adjustToolbarHeight; +- (CGRect)visibleOmniboxFrame; + +@end + +#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_LEGACY_TOOLBAR_COORDINATOR_H_
diff --git a/ios/chrome/browser/ui/toolbar/public/primary_toolbar_coordinator.h b/ios/chrome/browser/ui/toolbar/public/primary_toolbar_coordinator.h index 04681b2..aec08d1 100644 --- a/ios/chrome/browser/ui/toolbar/public/primary_toolbar_coordinator.h +++ b/ios/chrome/browser/ui/toolbar/public/primary_toolbar_coordinator.h
@@ -8,6 +8,7 @@ #import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" #import "ios/chrome/browser/ui/toolbar/public/side_swipe_toolbar_interacting.h" +@protocol ActivityServicePositioner; @protocol QRScannerResultLoading; @protocol TabHistoryPositioner; @protocol TabHistoryUIUpdater; @@ -27,6 +28,7 @@ - (id<QRScannerResultLoading>)QRScannerResultLoader; - (id<TabHistoryPositioner>)tabHistoryPositioner; - (id<TabHistoryUIUpdater>)tabHistoryUIUpdater; +- (id<ActivityServicePositioner>)activityServicePositioner; // Show the animation when transitioning to a prerendered page. - (void)showPrerenderingAnimation;
diff --git a/ios/chrome/browser/ui/toolbar/public/toolbar.h b/ios/chrome/browser/ui/toolbar/public/toolbar.h new file mode 100644 index 0000000..4aae810 --- /dev/null +++ b/ios/chrome/browser/ui/toolbar/public/toolbar.h
@@ -0,0 +1,32 @@ +// Copyright 2018 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 IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_TOOLBAR_H_ +#define IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_TOOLBAR_H_ + +#import "ios/chrome/browser/ui/activity_services/requirements/activity_service_positioner.h" +#import "ios/chrome/browser/ui/bubble/bubble_view_anchor_point_provider.h" +#import "ios/chrome/browser/ui/fullscreen/fullscreen_ui_element.h" +#import "ios/chrome/browser/ui/qr_scanner/requirements/qr_scanner_result_loading.h" +#import "ios/chrome/browser/ui/toolbar/public/abstract_web_toolbar.h" +#import "ios/chrome/browser/ui/toolbar/public/omnibox_focuser.h" +#import "ios/chrome/browser/ui/tools_menu/public/tools_menu_presentation_provider.h" +#import "ios/public/provider/chrome/browser/voice/voice_search_controller_delegate.h" + +@protocol Toolbar<AbstractWebToolbar, + OmniboxFocuser, + VoiceSearchControllerDelegate, + ActivityServicePositioner, + QRScannerResultLoading, + BubbleViewAnchorPointProvider, + ToolsMenuPresentationProvider, + FullscreenUIElement> + +- (void)setToolsMenuIsVisibleForToolsMenuButton:(BOOL)isVisible; +- (void)start; +- (void)stop; + +@end + +#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_TOOLBAR_H_
diff --git a/ios/chrome/browser/ui/toolbar/public/toolbar_controller_base_feature.h b/ios/chrome/browser/ui/toolbar/public/toolbar_controller_base_feature.h index 567eb1a..c6598f5b 100644 --- a/ios/chrome/browser/ui/toolbar/public/toolbar_controller_base_feature.h +++ b/ios/chrome/browser/ui/toolbar/public/toolbar_controller_base_feature.h
@@ -11,4 +11,8 @@ // WebToolbarController. extern const base::Feature kCleanToolbar; +// Feature to choose whether to use the Adaptive Toolbar or the standard +// toolbar. +extern const base::Feature kAdaptiveToolbar; + #endif // IOS_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_CONTROLLER_BASE_FEATURE_H_
diff --git a/ios/chrome/browser/ui/toolbar/public/toolbar_controller_base_feature.mm b/ios/chrome/browser/ui/toolbar/public/toolbar_controller_base_feature.mm index 78a9374..97a06b6 100644 --- a/ios/chrome/browser/ui/toolbar/public/toolbar_controller_base_feature.mm +++ b/ios/chrome/browser/ui/toolbar/public/toolbar_controller_base_feature.mm
@@ -10,3 +10,6 @@ const base::Feature kCleanToolbar{"CleanToolbar", base::FEATURE_ENABLED_BY_DEFAULT}; + +const base::Feature kAdaptiveToolbar{"AdaptiveToolbar", + base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.h b/ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.h index 5feeed64..3fbca1c 100644 --- a/ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.h +++ b/ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.h
@@ -55,9 +55,6 @@ extern const CGFloat kIPadToolbarY; extern const CGFloat kScrollFadeDistance; -// Offset from the image edge to the beginning of the visible omnibox rectangle. -// The image is symmetrical, so the offset is equal on each side. -extern const CGFloat kBackgroundImageVisibleRectOffset; extern const CGFloat kWebToolbarWidths[INTERFACE_IDIOM_COUNT]; // UI layouts. iPhone values followed by iPad values.
diff --git a/ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.mm b/ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.mm index cd632b7..86f510da 100644 --- a/ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.mm +++ b/ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.mm
@@ -38,7 +38,6 @@ const CGFloat kIPadToolbarY = 53; const CGFloat kScrollFadeDistance = 30; -const CGFloat kBackgroundImageVisibleRectOffset = 6; const CGFloat kWebToolbarWidths[INTERFACE_IDIOM_COUNT] = {224, 720}; // clang-format off
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_adapter.mm b/ios/chrome/browser/ui/toolbar/toolbar_adapter.mm index 5af08ab..4184d32 100644 --- a/ios/chrome/browser/ui/toolbar/toolbar_adapter.mm +++ b/ios/chrome/browser/ui/toolbar/toolbar_adapter.mm
@@ -72,7 +72,8 @@ } - (CGRect)visibleOmniboxFrame { - return [self.toolbarCoordinator visibleOmniboxFrame]; + // No-op. The Clean Toolbar uses named layout guides. + return CGRectZero; } - (BOOL)isOmniboxFirstResponder { @@ -129,6 +130,10 @@ [self.toolbarCoordinator start]; } +- (void)stop { + [self.toolbarCoordinator stop]; +} + #pragma mark - OmniboxFocuser - (void)focusOmnibox {
diff --git a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm index f1011d4e..0e5d0f0 100644 --- a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm +++ b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
@@ -575,6 +575,9 @@ - (void)start { } +- (void)stop { +} + - (void)didMoveToParentViewController:(UIViewController*)parent { UILayoutGuide* omniboxPopupGuide = FindNamedGuide(kOmniboxGuide, self.view); // The layout guide should be positioned with the same constraints as the @@ -732,10 +735,8 @@ - (CGRect)visibleOmniboxFrame { CGRect frame = _omniboxBackground.frame; - frame = [self.view.superview convertRect:frame - fromView:[_omniboxBackground superview]]; - // Account for the omnibox background image transparent sides. - return CGRectInset(frame, -kBackgroundImageVisibleRectOffset, 0); + return [self.view.superview convertRect:frame + fromView:[_omniboxBackground superview]]; } - (BOOL)isOmniboxFirstResponder { @@ -1392,7 +1393,7 @@ [_voiceSearchButton setHidden:isCompactTabletView]; [_starButton setHidden:isCompactTabletView]; [_reloadButton setHidden:isCompactTabletView]; - [_stopButton setHidden:isCompactTabletView]; + [_stopButton setHidden:YES]; [self updateToolbarState]; if ([_locationBarView.textField isFirstResponder]) {
diff --git a/ios/chrome/browser/ui/util/label_link_controller.h b/ios/chrome/browser/ui/util/label_link_controller.h index e1bed54..4a19e7f 100644 --- a/ios/chrome/browser/ui/util/label_link_controller.h +++ b/ios/chrome/browser/ui/util/label_link_controller.h
@@ -67,6 +67,8 @@ // Returns the tap rects generated by the controller that are associated with // |url|. - (NSArray*)tapRectsForURL:(GURL)url; +// Return all button frames. +- (NSArray*)buttonFrames; // Simulates a tap in the controlled label at |point|. No touch events are // generated, but |action| should be invoked if |point| is inside a tap rect. - (void)tapLabelAtPoint:(CGPoint)point;
diff --git a/ios/chrome/browser/ui/util/label_link_controller.mm b/ios/chrome/browser/ui/util/label_link_controller.mm index bb9cd53e..236a422 100644 --- a/ios/chrome/browser/ui/util/label_link_controller.mm +++ b/ios/chrome/browser/ui/util/label_link_controller.mm
@@ -12,6 +12,7 @@ #include "base/mac/foundation_util.h" #import "base/strings/sys_string_conversions.h" #include "ios/chrome/browser/ui/ui_util.h" +#include "ios/chrome/browser/ui/util/CRUILabel+AttributeUtils.h" #import "ios/chrome/browser/ui/util/label_observer.h" #import "ios/chrome/browser/ui/util/text_region_mapper.h" #import "ios/chrome/browser/ui/util/transparent_link_button.h" @@ -372,9 +373,14 @@ GURL URL = net::GURLWithNSURL(key); NSString* accessibilityLabel = [[_label text] substringWithRange:layout.range]; + // Only pass along line height if there are more than one layouts that + // can overlap. + CGFloat lineHeightLimit = + [_layoutsForURLs count] > 1 ? _label.cr_lineHeight : 0; NSArray* buttons = [TransparentLinkButton buttonsForLinkFrames:layout.frames URL:URL + lineHeight:lineHeightLimit accessibilityLabel:accessibilityLabel]; for (TransparentLinkButton* button in buttons) { #ifndef NDEBUG @@ -406,6 +412,15 @@ return layout.frames; } +- (NSArray*)buttonFrames { + NSMutableArray* array = + [NSMutableArray arrayWithCapacity:[_linkButtons count]]; + for (TransparentLinkButton* button in _linkButtons) { + [array addObject:[NSValue valueWithCGRect:button.frame]]; + } + return array; +} + - (void)tapLabelAtPoint:(CGPoint)point { [_layoutsForURLs enumerateKeysAndObjectsUsingBlock:^( NSURL* key, LinkLayout* layout, BOOL* stop) {
diff --git a/ios/chrome/browser/ui/util/label_link_controller_unittest.mm b/ios/chrome/browser/ui/util/label_link_controller_unittest.mm index be9e5b3..190aadc 100644 --- a/ios/chrome/browser/ui/util/label_link_controller_unittest.mm +++ b/ios/chrome/browser/ui/util/label_link_controller_unittest.mm
@@ -289,4 +289,37 @@ EXPECT_NSNE(smallTextRect, rects[0]); } +TEST_F(LabelLinkControllerTest, LinkMaximumHeightTest) { + NSMutableParagraphStyle* newStyle = + [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; + CGFloat lineHeight = 20; + [newStyle setMinimumLineHeight:lineHeight]; + [newStyle setMaximumLineHeight:lineHeight]; + setLabelAttrStringWithAttr(@"first line test\nsecond line test.", + NSParagraphStyleAttributeName, newStyle); + CGRect newFrame = CGRectMake(0, 0, 200, 100); + [label_ setFrame:newFrame]; + [label_ setFont:[UIFont systemFontOfSize:14]]; + NSRange firstLinkRange = NSMakeRange(0, 5); // "first". + NSRange secondLinkRange = NSMakeRange(16, 6); // "second". + LabelLinkController* llc = + [[LabelLinkController alloc] initWithLabel:label_ action:nullptr]; + GURL firsturl = GURL("http://www.google.com"); + GURL secondurl = GURL("http://www.cnn.com"); + + // Test that a single link is expanded to 44. + [llc addLinkWithRange:firstLinkRange url:firsturl]; + NSArray* rects = [llc buttonFrames]; + ASSERT_EQ(1UL, [rects count]); + ASSERT_EQ(44.0, CGRectGetHeight([rects[0] CGRectValue])); + + // Test that multiple links overlap by only .25 of |lineHeight|. + [llc addLinkWithRange:secondLinkRange url:secondurl]; + rects = [llc buttonFrames]; + ASSERT_EQ(2UL, [rects count]); + CGRect intersection = + CGRectIntersection([rects[0] CGRectValue], [rects[1] CGRectValue]); + ASSERT_EQ(.25 * lineHeight, CGRectGetHeight(intersection)); +} + } // namespace
diff --git a/ios/chrome/browser/ui/util/transparent_link_button.h b/ios/chrome/browser/ui/util/transparent_link_button.h index 985091d..72ede6b 100644 --- a/ios/chrome/browser/ui/util/transparent_link_button.h +++ b/ios/chrome/browser/ui/util/transparent_link_button.h
@@ -28,9 +28,12 @@ // Only the first button in the array will be accessible, and |label| will be // set as its accessibility label. This is done to ensure that VoiceOver mode // does not have multiple accessibility elements with the same accessibility -// label and the same action. +// label and the same action. |lineHeight| is used to limit the overlap from +// increasing the TransparentLinkButtons to satisfy a11y guidelines for a +// minimum touch area. + (NSArray*)buttonsForLinkFrames:(NSArray*)linkFrames URL:(const GURL&)URL + lineHeight:(CGFloat)lineHeight accessibilityLabel:(NSString*)label; // The URL passed upon initialization.
diff --git a/ios/chrome/browser/ui/util/transparent_link_button.mm b/ios/chrome/browser/ui/util/transparent_link_button.mm index 1fb5678..a713371 100644 --- a/ios/chrome/browser/ui/util/transparent_link_button.mm +++ b/ios/chrome/browser/ui/util/transparent_link_button.mm
@@ -16,6 +16,9 @@ // Minimum tap area dimension, as specified by Apple guidelines. const CGFloat kLinkTapAreaMinimum = 44.0; +// Maximum line height expansion factor. +const CGFloat kMaximumExpansionFactor = 1.25; + namespace { // The corner radius of the highlight view. const CGFloat kHighlightViewCornerRadius = 2.0; @@ -40,10 +43,12 @@ // Designated initializer. |linkFrame| is the frame of the link text; this may // differ from the actual frame of the resulting TransparentLinkButton, which is -// guaranteed to be at least |kLinkTapAreaMinimum| in each dimension. |URL| is -// the URL for the associated link. +// guaranteed to be at least |kLinkTapAreaMinimum| in each dimension, or +// |lineHeight| * |kMaximumExpansionFactor| for height, whichever is smaller. +// |URL| is the URL for the associated link. - (instancetype)initWithLinkFrame:(CGRect)linkFrame - URL:(const GURL&)URL NS_DESIGNATED_INITIALIZER; + URL:(const GURL&)URL + lineHeight:(CGFloat)lineHeight NS_DESIGNATED_INITIALIZER; // Sets the properties, propogating state to its adjacent link buttons. // |sender| is the TransparentLinkButon whose state is being propogated to @@ -66,9 +71,16 @@ @synthesize previousLinkButton = _previousLinkButton; @synthesize nextLinkButton = _nextLinkButton; -- (instancetype)initWithLinkFrame:(CGRect)linkFrame URL:(const GURL&)URL { +- (instancetype)initWithLinkFrame:(CGRect)linkFrame + URL:(const GURL&)URL + lineHeight:(CGFloat)lineHeight { + CGFloat linkTapHeightMinimum = kLinkTapAreaMinimum; + if (lineHeight > 0) { + linkTapHeightMinimum = + MIN(lineHeight * kMaximumExpansionFactor, kLinkTapAreaMinimum); + } CGFloat linkHeightExpansion = - MAX(0, (kLinkTapAreaMinimum - linkFrame.size.height) / 2.0); + MAX(0, (linkTapHeightMinimum - linkFrame.size.height) / 2.0); CGFloat linkWidthExpansion = MAX(0, (kLinkTapAreaMinimum - linkFrame.size.width) / 2.0); // Expand the frame as necessary to meet the minimum tap area dimensions. @@ -129,6 +141,7 @@ + (NSArray*)buttonsForLinkFrames:(NSArray*)linkFrames URL:(const GURL&)URL + lineHeight:(CGFloat)lineHeight accessibilityLabel:(NSString*)label { if (!linkFrames.count) return @[]; @@ -137,7 +150,9 @@ for (NSValue* linkFrameValue in linkFrames) { CGRect linkFrame = [linkFrameValue CGRectValue]; TransparentLinkButton* button = - [[TransparentLinkButton alloc] initWithLinkFrame:linkFrame URL:URL]; + [[TransparentLinkButton alloc] initWithLinkFrame:linkFrame + URL:URL + lineHeight:lineHeight]; TransparentLinkButton* previousButton = [buttons lastObject]; previousButton.nextLinkButton = button; [button setPreviousLinkButton:previousButton];
diff --git a/ios/chrome/browser/upgrade/BUILD.gn b/ios/chrome/browser/upgrade/BUILD.gn index 2c33ed2..d805333 100644 --- a/ios/chrome/browser/upgrade/BUILD.gn +++ b/ios/chrome/browser/upgrade/BUILD.gn
@@ -15,7 +15,6 @@ "//components/infobars/core", "//components/version_info", "//ios/chrome/app/strings", - "//ios/chrome/browser", "//ios/chrome/browser/ui/commands", "//ios/web", "//net",
diff --git a/ios/chrome/browser/upgrade/upgrade_center.mm b/ios/chrome/browser/upgrade/upgrade_center.mm index c0d9a45..b831999 100644 --- a/ios/chrome/browser/upgrade/upgrade_center.mm +++ b/ios/chrome/browser/upgrade/upgrade_center.mm
@@ -17,7 +17,6 @@ #include "components/infobars/core/infobar.h" #include "components/infobars/core/infobar_manager.h" #include "components/version_info/version_info.h" -#import "ios/chrome/browser/open_url_util.h" #import "ios/chrome/browser/ui/commands/application_commands.h" #import "ios/chrome/browser/ui/commands/open_url_command.h" #include "ios/chrome/grit/ios_chromium_strings.h" @@ -356,20 +355,22 @@ if (!urlString) return; // Missing URL, no upgrade possible. - GURL url = GURL(base::SysNSStringToUTF8(urlString)); - if (!url.is_valid()) + GURL URL = GURL(base::SysNSStringToUTF8(urlString)); + if (!URL.is_valid()) return; - if (web::UrlHasWebScheme(url)) { + if (web::UrlHasWebScheme(URL)) { // This URL can be opened in the application, just open in a new tab. OpenUrlCommand* command = - [[OpenUrlCommand alloc] initWithURLFromChrome:url]; + [[OpenUrlCommand alloc] initWithURLFromChrome:URL]; [self.dispatcher openURL:command]; } else { // This URL scheme is not understood, ask the system to open it. - NSURL* nsurl = [NSURL URLWithString:urlString]; - if (nsurl) { - OpenUrlWithCompletionHandler(nsurl, nil); + NSURL* launchURL = [NSURL URLWithString:urlString]; + if (launchURL) { + [[UIApplication sharedApplication] openURL:launchURL + options:@{} + completionHandler:nil]; } } }
diff --git a/ios/chrome/browser/web/blocked_popup_tab_helper.mm b/ios/chrome/browser/web/blocked_popup_tab_helper.mm index e3bd545..fb32ad7 100644 --- a/ios/chrome/browser/web/blocked_popup_tab_helper.mm +++ b/ios/chrome/browser/web/blocked_popup_tab_helper.mm
@@ -46,7 +46,7 @@ ~BlockPopupInfoBarDelegate() override {} InfoBarIdentifier GetIdentifier() const override { - return POPUP_BLOCKED_INFOBAR_DELEGATE; + return POPUP_BLOCKED_INFOBAR_DELEGATE_MOBILE; } gfx::Image GetIcon() const override {
diff --git a/ios/chrome/browser/web/external_app_launcher_tab_helper.mm b/ios/chrome/browser/web/external_app_launcher_tab_helper.mm index 8468811..ab5ff97 100644 --- a/ios/chrome/browser/web/external_app_launcher_tab_helper.mm +++ b/ios/chrome/browser/web/external_app_launcher_tab_helper.mm
@@ -8,7 +8,6 @@ #include "base/logging.h" #include "base/metrics/histogram_macros.h" #include "components/strings/grit/components_strings.h" -#import "ios/chrome/browser/open_url_util.h" #import "ios/chrome/browser/ui/external_app/open_mail_handler_view_controller.h" #import "ios/chrome/browser/web/external_app_launcher_util.h" #import "ios/chrome/browser/web/external_apps_launch_policy_decider.h" @@ -102,8 +101,11 @@ // Launches external app identified by |url| if |accept| is true. void LaunchExternalApp(NSURL* url, bool accept) { UMA_HISTOGRAM_BOOLEAN("Tab.ExternalApplicationOpened", accept); - if (accept) - OpenUrlWithCompletionHandler(url, nil); + if (accept) { + [[UIApplication sharedApplication] openURL:url + options:@{} + completionHandler:nil]; + } } // Presents an alert controller with |prompt| and |open_label| as button label
diff --git a/ios/chrome/test/app/histogram_test_util.h b/ios/chrome/test/app/histogram_test_util.h index 42a1ced..6f00337 100644 --- a/ios/chrome/test/app/histogram_test_util.h +++ b/ios/chrome/test/app/histogram_test_util.h
@@ -33,8 +33,7 @@ public: using CountsMap = std::map<std::string, base::HistogramBase::Count>; - // The constructor will call StatisticsRecorder::Initialize() for you. Also, - // this takes a snapshot of all current histograms counts. + // Takes a snapshot of all current histograms counts. HistogramTester(); ~HistogramTester();
diff --git a/ios/chrome/test/app/histogram_test_util.mm b/ios/chrome/test/app/histogram_test_util.mm index ac5e62e..0eb0738 100644 --- a/ios/chrome/test/app/histogram_test_util.mm +++ b/ios/chrome/test/app/histogram_test_util.mm
@@ -34,8 +34,6 @@ namespace chrome_test_util { HistogramTester::HistogramTester() { - base::StatisticsRecorder::Initialize(); // Safe to call multiple times. - // Record any histogram data that exists when the object is created so it can // be subtracted later. base::StatisticsRecorder::Histograms histograms;
diff --git a/ios/web/download/download_task_impl.mm b/ios/web/download/download_task_impl.mm index f3e38f3..a756343 100644 --- a/ios/web/download/download_task_impl.mm +++ b/ios/web/download/download_task_impl.mm
@@ -169,8 +169,7 @@ void DownloadTaskImpl::Start( std::unique_ptr<net::URLFetcherResponseWriter> writer) { DCHECK_CURRENTLY_ON(web::WebThread::UI); - DCHECK(!writer_); - DCHECK_EQ(state_, State::kNotStarted); + DCHECK_NE(state_, State::kInProgress); writer_ = std::move(writer); state_ = State::kInProgress; GetCookies(base::Bind(&DownloadTaskImpl::StartWithCookies,
diff --git a/ios/web/download/download_task_impl_unittest.mm b/ios/web/download/download_task_impl_unittest.mm index b83dc651..5351b93e 100644 --- a/ios/web/download/download_task_impl_unittest.mm +++ b/ios/web/download/download_task_impl_unittest.mm
@@ -250,6 +250,43 @@ EXPECT_CALL(task_delegate_, OnTaskDestroyed(task_.get())); } +// Tests restarting failed download task. +TEST_F(DownloadTaskImplTest, Restarting) { + EXPECT_CALL(task_observer_, OnDownloadUpdated(task_.get())); + CRWFakeNSURLSessionTask* session_task = Start(); + ASSERT_TRUE(session_task); + testing::Mock::VerifyAndClearExpectations(&task_observer_); + + // Download has failed. + EXPECT_CALL(task_observer_, OnDownloadUpdated(task_.get())); + NSError* error = [NSError errorWithDomain:NSURLErrorDomain + code:NSURLErrorNotConnectedToInternet + userInfo:nil]; + SimulateDownloadCompletion(session_task, error); + ASSERT_TRUE(WaitUntilConditionOrTimeout(kWaitForDownloadTimeout, ^{ + return task_->IsDone(); + })); + + // Restart the task. + EXPECT_CALL(task_observer_, OnDownloadUpdated(task_.get())); + session_task = Start(); + ASSERT_TRUE(session_task); + testing::Mock::VerifyAndClearExpectations(&task_observer_); + + // Download has finished. + EXPECT_CALL(task_observer_, OnDownloadUpdated(task_.get())); + SimulateDownloadCompletion(session_task); + testing::Mock::VerifyAndClearExpectations(&task_observer_); + ASSERT_TRUE(WaitUntilConditionOrTimeout(kWaitForDownloadTimeout, ^{ + return task_->IsDone(); + })); + EXPECT_EQ(DownloadTask::State::kComplete, task_->GetState()); + EXPECT_EQ(0, task_->GetErrorCode()); + EXPECT_EQ(100, task_->GetPercentComplete()); + + EXPECT_CALL(task_delegate_, OnTaskDestroyed(task_.get())); +} + // Tests sucessfull download of response with only one // URLSession:dataTask:didReceiveData: callback. TEST_F(DownloadTaskImplTest, SmallResponseDownload) {
diff --git a/ios/web/navigation/legacy_navigation_manager_impl.h b/ios/web/navigation/legacy_navigation_manager_impl.h index 070590b..27501c4 100644 --- a/ios/web/navigation/legacy_navigation_manager_impl.h +++ b/ios/web/navigation/legacy_navigation_manager_impl.h
@@ -87,7 +87,7 @@ NavigationItemImpl* GetLastCommittedItemImpl() const override; NavigationItemImpl* GetPendingItemImpl() const override; NavigationItemImpl* GetTransientItemImpl() const override; - void FinishGoToIndex(int index) override; + void FinishGoToIndex(int index, NavigationInitiationType type) override; // Returns true if the PageTransition for the underlying navigation item at // |index| has ui::PAGE_TRANSITION_IS_REDIRECT_MASK.
diff --git a/ios/web/navigation/legacy_navigation_manager_impl.mm b/ios/web/navigation/legacy_navigation_manager_impl.mm index 9188c6f2..de19f2c 100644 --- a/ios/web/navigation/legacy_navigation_manager_impl.mm +++ b/ios/web/navigation/legacy_navigation_manager_impl.mm
@@ -298,25 +298,25 @@ return [session_controller_ transientItem]; } -void LegacyNavigationManagerImpl::FinishGoToIndex(int index) { +void LegacyNavigationManagerImpl::FinishGoToIndex( + int index, + NavigationInitiationType type) { const ScopedNavigationItemImplList& items = [session_controller_ items]; NavigationItem* to_item = items[index].get(); NavigationItem* previous_item = [session_controller_ currentItem]; + to_item->SetTransitionType(ui::PageTransitionFromInt( + to_item->GetTransitionType() | ui::PAGE_TRANSITION_FORWARD_BACK)); + bool same_document_navigation = [session_controller_ isSameDocumentNavigationBetweenItem:previous_item andItem:to_item]; if (same_document_navigation) { [session_controller_ goToItemAtIndex:index discardNonCommittedItems:YES]; - delegate_->UpdateHtml5HistoryState(); + delegate_->OnGoToIndexSameDocumentNavigation(type); } else { [session_controller_ discardNonCommittedItems]; [session_controller_ setPendingItemIndex:index]; - - NavigationItemImpl* pending_item = [session_controller_ pendingItem]; - pending_item->SetTransitionType(ui::PageTransitionFromInt( - pending_item->GetTransitionType() | ui::PAGE_TRANSITION_FORWARD_BACK)); - delegate_->LoadCurrentItem(); } }
diff --git a/ios/web/navigation/navigation_manager_delegate.h b/ios/web/navigation/navigation_manager_delegate.h index 867879b0..b31a48c 100644 --- a/ios/web/navigation/navigation_manager_delegate.h +++ b/ios/web/navigation/navigation_manager_delegate.h
@@ -12,6 +12,7 @@ namespace web { +enum class NavigationInitiationType; struct LoadCommittedDetails; class WebState; @@ -29,9 +30,9 @@ // navigation item. virtual void RecordPageStateInNavigationItem() = 0; - // Instructs the delegate to update HTML5 History state of the page using the - // current NavigationItem. - virtual void UpdateHtml5HistoryState() = 0; + // Informs the delegate that a go to index same-document navigation occured. + virtual void OnGoToIndexSameDocumentNavigation( + NavigationInitiationType type) = 0; // Instructs the delegate to perform book keeping in preparation for a new // navigation using a different user agent type.
diff --git a/ios/web/navigation/navigation_manager_impl.h b/ios/web/navigation/navigation_manager_impl.h index de7c6e74..aaea3e1c 100644 --- a/ios/web/navigation/navigation_manager_impl.h +++ b/ios/web/navigation/navigation_manager_impl.h
@@ -152,6 +152,9 @@ void UpdateCurrentItemForReplaceState(const GURL& url, NSString* state_object); + // Same as GoToIndex(int), but allows renderer-initiated navigations. + void GoToIndex(int index, NavigationInitiationType initiation_type); + // NavigationManager: NavigationItem* GetLastCommittedItem() const final; NavigationItem* GetPendingItem() const final; @@ -211,7 +214,7 @@ virtual NavigationItemImpl* GetLastCommittedItemImpl() const = 0; // Subclass specific implementation to update session state. - virtual void FinishGoToIndex(int index) = 0; + virtual void FinishGoToIndex(int index, NavigationInitiationType type) = 0; // The primary delegate for this manager. NavigationManagerDelegate* delegate_;
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm index 8b0eafa7..88c7328 100644 --- a/ios/web/navigation/navigation_manager_impl.mm +++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -175,7 +175,9 @@ } } -void NavigationManagerImpl::GoToIndex(int index) { +void NavigationManagerImpl::GoToIndex( + int index, + NavigationInitiationType initiation_type) { if (index < 0 || index >= GetItemCount()) { NOTREACHED(); return; @@ -200,7 +202,11 @@ delegate_->WillChangeUserAgentType(); } - FinishGoToIndex(index); + FinishGoToIndex(index, initiation_type); +} + +void NavigationManagerImpl::GoToIndex(int index) { + GoToIndex(index, NavigationInitiationType::USER_INITIATED); } NavigationItem* NavigationManagerImpl::GetLastCommittedItem() const {
diff --git a/ios/web/navigation/navigation_manager_impl_unittest.mm b/ios/web/navigation/navigation_manager_impl_unittest.mm index f184ae7..9f161df 100644 --- a/ios/web/navigation/navigation_manager_impl_unittest.mm +++ b/ios/web/navigation/navigation_manager_impl_unittest.mm
@@ -72,7 +72,8 @@ MOCK_METHOD0(ClearTransientContent, void()); MOCK_METHOD0(RecordPageStateInNavigationItem, void()); - MOCK_METHOD0(UpdateHtml5HistoryState, void()); + MOCK_METHOD1(OnGoToIndexSameDocumentNavigation, + void(NavigationInitiationType type)); MOCK_METHOD0(WillChangeUserAgentType, void()); MOCK_METHOD0(LoadCurrentItem, void()); MOCK_METHOD0(LoadIfNecessary, void()); @@ -2236,7 +2237,9 @@ .Times(0); if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { - EXPECT_CALL(navigation_manager_delegate(), UpdateHtml5HistoryState()) + EXPECT_CALL(navigation_manager_delegate(), + OnGoToIndexSameDocumentNavigation( + NavigationInitiationType::USER_INITIATED)) .Times(0); EXPECT_CALL(navigation_manager_delegate(), LoadCurrentItem()); } @@ -2283,17 +2286,15 @@ .Times(0); if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { - EXPECT_CALL(navigation_manager_delegate(), UpdateHtml5HistoryState()); + EXPECT_CALL(navigation_manager_delegate(), + OnGoToIndexSameDocumentNavigation( + NavigationInitiationType::USER_INITIATED)); EXPECT_CALL(navigation_manager_delegate(), LoadCurrentItem()).Times(0); } navigation_manager()->GoToIndex(0); - // Preserve the existing behavior of legacy navigation manager for change - // management, even though it seems like a bug that the back-forward - // transition bit is not set for same-document history navigation. - EXPECT_EQ(GetParam() == TEST_WK_BASED_NAVIGATION_MANAGER, - (navigation_manager()->GetItemAtIndex(0)->GetTransitionType() & - ui::PAGE_TRANSITION_FORWARD_BACK) > 0); + EXPECT_TRUE(navigation_manager()->GetItemAtIndex(0)->GetTransitionType() & + ui::PAGE_TRANSITION_FORWARD_BACK); if (GetParam() == TEST_LEGACY_NAVIGATION_MANAGER) { EXPECT_EQ(0, navigation_manager()->GetLastCommittedItemIndex());
diff --git a/ios/web/navigation/wk_based_navigation_manager_impl.h b/ios/web/navigation/wk_based_navigation_manager_impl.h index 16fb922d..62e4610 100644 --- a/ios/web/navigation/wk_based_navigation_manager_impl.h +++ b/ios/web/navigation/wk_based_navigation_manager_impl.h
@@ -51,6 +51,22 @@ // because the provisional load and commit events for iframe navigation are not // visible via the WKNavigationDelegate interface. Consequently, pending item // and previous item are only tracked for the main frame. +// +// Empty Window Open Navigation edge case: +// +// If window.open() is called with an empty URL, WKWebView does not seem to +// create a WKBackForwardListItem for the first about:blank navigation. Any +// subsequent navigation in this window will replace the about:blank entry. +// This is consistent with the HTML spec regarding Location-object navigation +// when the browser context's only Document is about:blank: +// https://html.spec.whatwg.org/multipage/history.html (Section 7.7.4) +// +// This navigation manager will still create a pendingNavigationItem for this +// "empty window open item" and allow CommitPendingItem() to be called on it. +// All accessors will behave identically as if the navigation history has a +// single normal entry. The only difference is that a subsequent call to +// CommitPendingItem() will *replace* the empty window open item. From this +// point onward, it is as if the empty window open item never occurred. class WKBasedNavigationManagerImpl : public NavigationManagerImpl { public: WKBasedNavigationManagerImpl(); @@ -113,7 +129,8 @@ // Returns the pending navigation item in the main frame. NavigationItemImpl* GetPendingItemImpl() const override; NavigationItemImpl* GetTransientItemImpl() const override; - void FinishGoToIndex(int index) override; + void FinishGoToIndex(int index, + NavigationInitiationType initiation_type) override; // Returns the absolute index of WKBackForwardList's |currentItem|. Returns -1 // if |currentItem| is nil. @@ -143,6 +160,13 @@ // field will equal to -1. int last_committed_item_index_; + // The NavigationItem that corresponds to the empty window open navigation. It + // has to be stored separately because it has no WKBackForwardListItem. It is + // not null if when CommitPendingItem() is last called, the WKBackForwardList + // is empty but not nil. Any subsequent call to CommitPendingItem() will reset + // this field to null. + std::unique_ptr<NavigationItemImpl> empty_window_open_item_; + // The transient item in main frame. std::unique_ptr<NavigationItemImpl> transient_item_;
diff --git a/ios/web/navigation/wk_based_navigation_manager_impl.mm b/ios/web/navigation/wk_based_navigation_manager_impl.mm index dea06a7..33e27c4 100644 --- a/ios/web/navigation/wk_based_navigation_manager_impl.mm +++ b/ios/web/navigation/wk_based_navigation_manager_impl.mm
@@ -10,6 +10,7 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" #include "base/memory/ptr_util.h" +#include "base/strings/sys_string_conversions.h" #import "ios/web/navigation/crw_navigation_item_holder.h" #import "ios/web/navigation/navigation_item_impl.h" #include "ios/web/navigation/navigation_item_impl_list.h" @@ -156,28 +157,54 @@ } void WKBasedNavigationManagerImpl::CommitPendingItem() { + bool last_committed_item_was_empty_window_open_item = + empty_window_open_item_ != nullptr; + if (pending_item_index_ == -1) { pending_item_->ResetForCommit(); pending_item_->SetTimestamp( time_smoother_.GetSmoothedTime(base::Time::Now())); - // WKBackForwardList's |currentItem| would have already been updated when - // this method is called and it is the last committed item. id<CRWWebViewNavigationProxy> proxy = delegate_->GetWebViewNavigationProxy(); - SetNavigationItemInWKItem(proxy.backForwardList.currentItem, - std::move(pending_item_)); + + // If WKBackForwardList exists but |currentItem| is nil at this point, it is + // because the current navigation is an empty window open navigation. + // If |currentItem| is not nil, it is the last committed item in the + // WKWebView. + if (proxy.backForwardList && !proxy.backForwardList.currentItem) { + // WKWebView's URL should be about:blank for empty window open item. + DCHECK_EQ(url::kAboutBlankURL, net::GURLWithNSURL(proxy.URL).spec()); + // There should be no back-forward history for empty window open item. + DCHECK_EQ(0UL, proxy.backForwardList.backList.count); + DCHECK_EQ(0UL, proxy.backForwardList.forwardList.count); + + empty_window_open_item_ = std::move(pending_item_); + } else { + empty_window_open_item_.reset(); + SetNavigationItemInWKItem(proxy.backForwardList.currentItem, + std::move(pending_item_)); + } } pending_item_index_ = -1; - previous_item_index_ = last_committed_item_index_; - last_committed_item_index_ = GetWKCurrentItemIndex(); + // If the last committed item is the empty window open item, then don't update + // previous item because the new commit replaces the last committed item. + if (!last_committed_item_was_empty_window_open_item) { + previous_item_index_ = last_committed_item_index_; + } + // If the newly committed item is the empty window open item, fake an index of + // 0 because WKBackForwardList is empty at this point. + last_committed_item_index_ = + empty_window_open_item_ ? 0 : GetWKCurrentItemIndex(); OnNavigationItemCommitted(); } int WKBasedNavigationManagerImpl::GetIndexForOffset(int offset) const { - int result = (pending_item_index_ == -1) ? GetWKCurrentItemIndex() - : pending_item_index_; + int current_item_index = pending_item_index_; + if (pending_item_index_ == -1) { + current_item_index = empty_window_open_item_ ? 0 : GetWKCurrentItemIndex(); + } if (offset < 0 && GetTransientItem() && pending_item_index_ == -1) { // Going back from transient item that added to the end navigation stack @@ -185,8 +212,7 @@ // index back. offset++; } - result += offset; - return result; + return current_item_index + offset; } int WKBasedNavigationManagerImpl::GetPreviousItemIndex() const { @@ -240,6 +266,10 @@ } int WKBasedNavigationManagerImpl::GetItemCount() const { + if (empty_window_open_item_) { + return 1; + } + id<CRWWebViewNavigationProxy> proxy = delegate_->GetWebViewNavigationProxy(); if (proxy) { int count_current_page = proxy.backForwardList.currentItem ? 1 : 0; @@ -259,6 +289,10 @@ int WKBasedNavigationManagerImpl::GetIndexOfItem( const NavigationItem* item) const { + if (item == empty_window_open_item_.get()) { + return 0; + } + for (int index = 0; index < GetItemCount(); index++) { if (GetNavigationItemFromWKItem(GetWKItemAtIndex(index)) == item) { return index; @@ -281,12 +315,14 @@ int WKBasedNavigationManagerImpl::GetLastCommittedItemIndex() const { // WKBackForwardList's |currentItem| is usually the last committed item, - // except when the pending navigation is a back-forward navigation, in which - // case it is actually the pending item. As a workaround, fall back to - // last_committed_item_index_. This is not 100% correct (since - // last_committed_item_index_ is only updated for main frame navigations), - // but is the best possible answer. - if (pending_item_index_ >= 0) { + // except two cases: + // 1) when the pending navigation is a back-forward navigation, in which + // case it is actually the pending item. As a workaround, fall back to + // last_committed_item_index_. This is not 100% correct (since + // last_committed_item_index_ is only updated for main frame navigations), + // but is the best possible answer. + // 2) when the last committed item is an empty window open item. + if (pending_item_index_ >= 0 || empty_window_open_item_) { return last_committed_item_index_; } return GetWKCurrentItemIndex(); @@ -306,6 +342,11 @@ } bool WKBasedNavigationManagerImpl::CanGoToOffset(int offset) const { + // If the last committed item is the empty window.open item, no back-forward + // navigation is allowed. + if (empty_window_open_item_) { + return offset == 0; + } int index = GetIndexForOffset(offset); return index >= 0 && index < GetItemCount(); } @@ -394,6 +435,16 @@ NavigationItemImpl* WKBasedNavigationManagerImpl::GetNavigationItemImplAtIndex( size_t index) const { + if (empty_window_open_item_) { + // Return nullptr for index != 0 instead of letting the code fall through + // (which in most cases will return null anyways because wk_item should be + // nil) for the slim chance that WKBackForwardList has been updated for a + // new navigation but WKWebView has not triggered the |didCommitNavigation:| + // callback. NavigationItem for the new wk_item should not be returned until + // after DidCommitPendingItem() is called. + return index == 0 ? empty_window_open_item_.get() : nullptr; + } + WKBackForwardListItem* wk_item = GetWKItemAtIndex(index); NavigationItemImpl* item = GetNavigationItemFromWKItem(wk_item); @@ -439,6 +490,10 @@ NavigationItemImpl* WKBasedNavigationManagerImpl::GetLastCommittedItemImpl() const { + if (empty_window_open_item_) { + return empty_window_open_item_.get(); + } + int index = GetLastCommittedItemIndex(); return index == -1 ? nullptr : GetNavigationItemImplAtIndex(static_cast<size_t>(index)); @@ -454,14 +509,22 @@ return transient_item_.get(); } -void WKBasedNavigationManagerImpl::FinishGoToIndex(int index) { +void WKBasedNavigationManagerImpl::FinishGoToIndex( + int index, + NavigationInitiationType type) { DiscardNonCommittedItems(); NavigationItem* item = GetItemAtIndex(index); item->SetTransitionType(ui::PageTransitionFromInt( item->GetTransitionType() | ui::PAGE_TRANSITION_FORWARD_BACK)); WKBackForwardListItem* wk_item = GetWKItemAtIndex(index); - DCHECK(wk_item); - [delegate_->GetWebViewNavigationProxy() goToBackForwardListItem:wk_item]; + if (wk_item) { + [delegate_->GetWebViewNavigationProxy() goToBackForwardListItem:wk_item]; + } else { + DCHECK(index == 0 && empty_window_open_item_) + << " wk_item should not be nullptr. index: " << index + << " has_empty_window_open_item: " + << (empty_window_open_item_ != nullptr); + } } int WKBasedNavigationManagerImpl::GetWKCurrentItemIndex() const {
diff --git a/ios/web/navigation/wk_based_navigation_manager_impl_unittest.mm b/ios/web/navigation/wk_based_navigation_manager_impl_unittest.mm index f658b2a7..69fdca8 100644 --- a/ios/web/navigation/wk_based_navigation_manager_impl_unittest.mm +++ b/ios/web/navigation/wk_based_navigation_manager_impl_unittest.mm
@@ -20,6 +20,7 @@ #import "ios/web/public/web_client.h" #import "ios/web/test/fakes/crw_fake_back_forward_list.h" #include "ios/web/test/test_url_constants.h" +#import "net/base/mac/url_conversions.h" #include "net/base/url_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -70,7 +71,8 @@ MOCK_METHOD0(ClearTransientContent, void()); MOCK_METHOD0(RecordPageStateInNavigationItem, void()); - MOCK_METHOD0(UpdateHtml5HistoryState, void()); + MOCK_METHOD1(OnGoToIndexSameDocumentNavigation, + void(NavigationInitiationType type)); MOCK_METHOD0(WillChangeUserAgentType, void()); MOCK_METHOD0(LoadCurrentItem, void()); MOCK_METHOD0(LoadIfNecessary, void()); @@ -679,4 +681,93 @@ EXPECT_EQ(url, item->GetURL()); } +// Tests that all NavigationManager APIs return reasonable values in the Empty +// Window Open Navigation edge case. See comments in header file for details. +TEST_F(WKBasedNavigationManagerTest, EmptyWindowOpenNavigation) { + // Set up the precondition for an empty window open item. + OCMExpect([mock_web_view_ URL]) + .andReturn(net::NSURLWithGURL(GURL(url::kAboutBlankURL))); + mock_wk_list_.currentItem = nil; + + manager_->AddPendingItem( + GURL(url::kAboutBlankURL), Referrer(), ui::PAGE_TRANSITION_LINK, + web::NavigationInitiationType::RENDERER_INITIATED, + web::NavigationManager::UserAgentOverrideOption::INHERIT); + + const NavigationItem* pending_item = manager_->GetPendingItem(); + ASSERT_TRUE(pending_item); + EXPECT_EQ(-1, manager_->GetPendingItemIndex()); + EXPECT_EQ(url::kAboutBlankURL, pending_item->GetURL().spec()); + + manager_->CommitPendingItem(); + + const NavigationItem* last_committed_item = manager_->GetLastCommittedItem(); + ASSERT_EQ(pending_item, last_committed_item); + EXPECT_EQ(last_committed_item, manager_->GetVisibleItem()); + + EXPECT_EQ(0, manager_->GetIndexForOffset(0)); + EXPECT_EQ(1, manager_->GetIndexForOffset(1)); + EXPECT_EQ(-1, manager_->GetIndexForOffset(-1)); + + EXPECT_EQ(-1, manager_->GetPreviousItemIndex()); + EXPECT_EQ(1, manager_->GetItemCount()); + EXPECT_EQ(last_committed_item, manager_->GetItemAtIndex(0)); + EXPECT_FALSE(manager_->GetItemAtIndex(1)); + + EXPECT_EQ(0, manager_->GetIndexOfItem(last_committed_item)); + EXPECT_EQ(-1, manager_->GetPendingItemIndex()); + EXPECT_EQ(0, manager_->GetLastCommittedItemIndex()); + + EXPECT_FALSE(manager_->CanGoBack()); + EXPECT_FALSE(manager_->CanGoForward()); + EXPECT_TRUE(manager_->CanGoToOffset(0)); + EXPECT_FALSE(manager_->CanGoToOffset(-1)); + EXPECT_FALSE(manager_->CanGoToOffset(1)); + + // This is allowed on an empty window open item. + manager_->GoToIndex(0); + + // Add another navigation and verify that it replaces the empty window open + // item. + manager_->AddPendingItem( + GURL("http://www.2.com"), Referrer(), ui::PAGE_TRANSITION_TYPED, + web::NavigationInitiationType::USER_INITIATED, + web::NavigationManager::UserAgentOverrideOption::INHERIT); + + const NavigationItem* pending_item_2 = manager_->GetPendingItem(); + ASSERT_TRUE(pending_item_2); + EXPECT_EQ("http://www.2.com/", pending_item_2->GetURL().spec()); + + [mock_wk_list_ setCurrentURL:@"http://www.2.com"]; + manager_->CommitPendingItem(); + + const NavigationItem* last_committed_item_2 = + manager_->GetLastCommittedItem(); + ASSERT_EQ(pending_item_2, last_committed_item_2); + EXPECT_EQ(last_committed_item_2, manager_->GetVisibleItem()); + + EXPECT_EQ(0, manager_->GetIndexForOffset(0)); + EXPECT_EQ(1, manager_->GetIndexForOffset(1)); + EXPECT_EQ(-1, manager_->GetIndexForOffset(-1)); + + EXPECT_EQ(-1, manager_->GetPreviousItemIndex()); + EXPECT_EQ(1, manager_->GetItemCount()); + EXPECT_EQ(last_committed_item_2, manager_->GetItemAtIndex(0)); + EXPECT_FALSE(manager_->GetItemAtIndex(1)); + + EXPECT_EQ(-1, manager_->GetIndexOfItem(last_committed_item)); + EXPECT_EQ(0, manager_->GetIndexOfItem(last_committed_item_2)); + EXPECT_EQ(-1, manager_->GetPendingItemIndex()); + EXPECT_EQ(0, manager_->GetLastCommittedItemIndex()); + + EXPECT_FALSE(manager_->CanGoBack()); + EXPECT_FALSE(manager_->CanGoForward()); + EXPECT_TRUE(manager_->CanGoToOffset(0)); + EXPECT_FALSE(manager_->CanGoToOffset(-1)); + EXPECT_FALSE(manager_->CanGoToOffset(1)); + + // This is still allowed on a length-1 navigation history. + manager_->GoToIndex(0); +} + } // namespace web
diff --git a/ios/web/net/request_tracker_impl.h b/ios/web/net/request_tracker_impl.h index a99443790..7eaefcea 100644 --- a/ios/web/net/request_tracker_impl.h +++ b/ios/web/net/request_tracker_impl.h
@@ -14,7 +14,6 @@ #include <vector> #include "base/callback_forward.h" -#import "base/mac/scoped_nsobject.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #import "ios/net/request_tracker.h" @@ -313,13 +312,13 @@ // Current page URL, as far as we know. GURL page_url_; // Userinfo attached to the page, passed back by the delegate. - base::scoped_nsobject<id> user_info_; + id user_info_; // A tracker identifier (a simple increasing number) used to store // certificates. int identifier_; // The string that identifies the tab this tracker serves. Used to index // g_trackers. - base::scoped_nsobject<NSString> request_group_id_; + NSString* request_group_id_; // Flag to synchronize deletion and callback creation. Lives on the IO thread. // True when this tracker has beed Close()d. If this is the case, no further // references to it should be generated (for example by binding it into a
diff --git a/ios/web/net/request_tracker_impl.mm b/ios/web/net/request_tracker_impl.mm index 9644c38..c0ec4a9 100644 --- a/ios/web/net/request_tracker_impl.mm +++ b/ios/web/net/request_tracker_impl.mm
@@ -10,7 +10,6 @@ #include "base/logging.h" #import "base/mac/bind_objc_block.h" -#import "base/mac/scoped_nsobject.h" #include "base/macros.h" #include "base/memory/ptr_util.h" #include "base/strings/sys_string_conversions.h" @@ -29,19 +28,6 @@ namespace { -struct EqualNSStrings { - bool operator()(const base::scoped_nsobject<NSString>& s1, - const base::scoped_nsobject<NSString>& s2) const { - // Use a ternary due to the BOOL vs bool type difference. - return [s1 isEqualToString:s2] ? true : false; - } -}; - -struct HashNSString { - size_t operator()(const base::scoped_nsobject<NSString>& s) const { - return [s hash]; - } -}; // A map of all RequestTrackerImpls for tabs that are: // * Currently open @@ -50,9 +36,7 @@ // always access it from the main thread, the provider is accessing it from the // WebThread, a thread created by the UIWebView/CFURL. For this reason access to // this variable must always gated by |g_trackers_lock|. -typedef base::hash_map<base::scoped_nsobject<NSString>, - web::RequestTrackerImpl*, - HashNSString, EqualNSStrings> TrackerMap; +typedef base::hash_map<std::string, web::RequestTrackerImpl*> TrackerMap; TrackerMap* g_trackers = NULL; base::Lock* g_trackers_lock = NULL; @@ -90,7 +74,7 @@ DCHECK_CURRENTLY_ON(web::WebThread::UI); pthread_once(&g_once_control, &InitializeGlobals); { - base::scoped_nsobject<NSString> scoped_key([key copy]); + std::string scoped_key = base::SysNSStringToUTF8(key); base::AutoLock scoped_lock(*g_trackers_lock); DCHECK(!g_trackers->count(scoped_key)); (*g_trackers)[scoped_key] = tracker; @@ -213,7 +197,7 @@ void RequestTrackerImpl::StartPageLoad(const GURL& url, id user_info) { DCHECK_CURRENTLY_ON(web::WebThread::UI); - base::scoped_nsobject<id> scoped_user_info(user_info); + id scoped_user_info = user_info; web::WebThread::PostTask( web::WebThread::IO, FROM_HERE, base::Bind(&RequestTrackerImpl::TrimToURL, this, url, scoped_user_info)); @@ -251,7 +235,7 @@ base::RetainedRef(this))); // The user_info is no longer needed. - user_info_.reset(); + user_info_ = nil; } // static @@ -311,8 +295,7 @@ pthread_once(&g_once_control, &InitializeGlobals); { base::AutoLock scoped_lock(*g_trackers_lock); - map_it = g_trackers->find( - base::scoped_nsobject<NSString>([request_group_id copy])); + map_it = g_trackers->find(base::SysNSStringToUTF8(request_group_id)); if (map_it != g_trackers->end()) tracker = map_it->second; } @@ -525,7 +508,7 @@ pthread_once(&g_once_control, &InitializeGlobals); { base::AutoLock scoped_lock(*g_trackers_lock); - g_trackers->erase(request_group_id_); + g_trackers->erase(base::SysNSStringToUTF8(request_group_id_)); } InvalidateWeakPtrs(); // Delete on the UI thread. @@ -856,7 +839,7 @@ has_mixed_content_ = new_url_has_mixed_content; page_url_ = url; - user_info_.reset(user_info); + user_info_ = user_info; estimate_start_index_ = 0; is_loading_ = true; previous_estimate_ = 0.0f; @@ -898,7 +881,7 @@ [urls addObject:tracker_count->Description()]; return [NSString stringWithFormat:@"RequestGroupID %@\n%@\n%@", - request_group_id_.get(), + request_group_id_, net::NSURLWithGURL(page_url_), [urls componentsJoinedByString:@"\n"]]; }
diff --git a/ios/web/public/download/OWNERS b/ios/web/public/download/OWNERS index f1a8cd4..476af25d 100644 --- a/ios/web/public/download/OWNERS +++ b/ios/web/public/download/OWNERS
@@ -1,5 +1,5 @@ eugenebut@chromium.org -gchatz@chromium.org +sdefresne@chromium.org # TEAM: ios-directory-owners@chromium.org # OS: iOS
diff --git a/ios/web/public/global_state/ios_global_state.mm b/ios/web/public/global_state/ios_global_state.mm index 150f78d..41b35e8d1 100644 --- a/ios/web/public/global_state/ios_global_state.mm +++ b/ios/web/public/global_state/ios_global_state.mm
@@ -8,7 +8,6 @@ #include "base/command_line.h" #include "base/memory/ptr_util.h" #include "base/message_loop/message_loop.h" -#include "base/metrics/statistics_recorder.h" #include "base/task_scheduler/initialization_util.h" #include "net/base/network_change_notifier.h" @@ -54,8 +53,6 @@ base::TaskScheduler::Create(""); base::CommandLine::Init(create_params.argc, create_params.argv); - - base::StatisticsRecorder::Initialize(); }); }
diff --git a/ios/web/shell/test/plugin_placeholder_egtest.mm b/ios/web/shell/test/plugin_placeholder_egtest.mm index 4145aa9..eede7216 100644 --- a/ios/web/shell/test/plugin_placeholder_egtest.mm +++ b/ios/web/shell/test/plugin_placeholder_egtest.mm
@@ -76,8 +76,31 @@ [ShellEarlGrey waitForWebViewContainingCSSSelector:"img[src*='data']"]; } -// Tests placeholder for a large <object> with an embed fallback. -- (void)testPluginPlaceholderObjectEmbed { +// Tests placeholder for a large <object> with a flash embed fallback. +- (void)testPluginPlaceholderObjectFlashEmbedFallback { + const char kPageDescription[] = "Object, embed fallback"; + const std::string page = base::StringPrintf( + "<html><body width='800' height='600'>" + "<p>%s</p>" + "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" + " codebase='http://download.macromedia.com/pub/shockwave/cabs/'" + "flash/swflash.cab#version=6,0,0,0' width='550' height='550'>" + " <param name='movie' value='some.swf'>" + " <embed src='some.swf' type='application/x-shockwave-flash' " + "width='550' height='550'>" + "</object>" + "</body></html>", + kPageDescription); + LoadPage(page); + + // Verify that plugin object is replaced with placeholder image. + [ShellEarlGrey waitForWebViewContainingText:kPageDescription]; + [ShellEarlGrey waitForWebViewContainingCSSSelector:"img[src*='data']"]; +} + +// Tests that a large <object> with an embed fallback of unspecified type is +// untouched. +- (void)testPluginPlaceholderObjectUndefinedEmbedFallback { const char kPageDescription[] = "Object, embed fallback"; const std::string page = base::StringPrintf( "<html><body width='800' height='600'>" @@ -92,9 +115,9 @@ kPageDescription); LoadPage(page); - // Verify that plugin object is replaced with placeholder image. + // Verify that placeholder image is not displayed. [ShellEarlGrey waitForWebViewContainingText:kPageDescription]; - [ShellEarlGrey waitForWebViewContainingCSSSelector:"img[src*='data']"]; + [ShellEarlGrey waitForWebViewNotContainingCSSSelector:"img"]; } // Tests that a large <object> with text fallback is untouched.
diff --git a/ios/web/test/fakes/fake_navigation_manager_delegate.h b/ios/web/test/fakes/fake_navigation_manager_delegate.h index 9fe648a..260d283 100644 --- a/ios/web/test/fakes/fake_navigation_manager_delegate.h +++ b/ios/web/test/fakes/fake_navigation_manager_delegate.h
@@ -15,7 +15,8 @@ public: void ClearTransientContent() override; void RecordPageStateInNavigationItem() override; - void UpdateHtml5HistoryState() override; + void OnGoToIndexSameDocumentNavigation( + NavigationInitiationType type) override; void WillChangeUserAgentType() override; void LoadCurrentItem() override; void LoadIfNecessary() override;
diff --git a/ios/web/test/fakes/fake_navigation_manager_delegate.mm b/ios/web/test/fakes/fake_navigation_manager_delegate.mm index dc8b801..3bd58c6 100644 --- a/ios/web/test/fakes/fake_navigation_manager_delegate.mm +++ b/ios/web/test/fakes/fake_navigation_manager_delegate.mm
@@ -14,7 +14,8 @@ void FakeNavigationManagerDelegate::ClearTransientContent() {} void FakeNavigationManagerDelegate::RecordPageStateInNavigationItem() {} -void FakeNavigationManagerDelegate::UpdateHtml5HistoryState() {} +void FakeNavigationManagerDelegate::OnGoToIndexSameDocumentNavigation( + NavigationInitiationType type) {} void FakeNavigationManagerDelegate::WillChangeUserAgentType() {} void FakeNavigationManagerDelegate::LoadCurrentItem() {} void FakeNavigationManagerDelegate::LoadIfNecessary() {}
diff --git a/ios/web/test/web_test_suite.mm b/ios/web/test/web_test_suite.mm index a201277..f27819e 100644 --- a/ios/web/test/web_test_suite.mm +++ b/ios/web/test/web_test_suite.mm
@@ -5,7 +5,6 @@ #include "ios/web/public/test/web_test_suite.h" #include "base/memory/ptr_util.h" -#include "base/metrics/statistics_recorder.h" #include "base/path_service.h" #import "ios/web/public/test/fakes/test_web_client.h" #include "ios/web/public/url_schemes.h" @@ -27,11 +26,6 @@ void WebTestSuite::Initialize() { base::TestSuite::Initialize(); - // Initialize the histograms subsystem, so that any histograms hit in tests - // are correctly registered with the statistics recorder and can be queried - // by tests. - base::StatisticsRecorder::Initialize(); - RegisterWebSchemes(false); // Force unittests to run using en-US so if testing string output will work
diff --git a/ios/web/web_state/global_web_state_event_tracker.h b/ios/web/web_state/global_web_state_event_tracker.h index 5622483..00175fd 100644 --- a/ios/web/web_state/global_web_state_event_tracker.h +++ b/ios/web/web_state/global_web_state_event_tracker.h
@@ -46,6 +46,8 @@ void NavigationItemCommitted( WebState* web_state, const LoadCommittedDetails& load_details) override; + void DidStartNavigation(WebState* web_state, + NavigationContext* navigation_context) override; void DidStartLoading(WebState* web_state) override; void DidStopLoading(WebState* web_state) override; void PageLoaded(WebState* web_state,
diff --git a/ios/web/web_state/global_web_state_event_tracker.mm b/ios/web/web_state/global_web_state_event_tracker.mm index 01c0873b..c93e79cf 100644 --- a/ios/web/web_state/global_web_state_event_tracker.mm +++ b/ios/web/web_state/global_web_state_event_tracker.mm
@@ -57,6 +57,13 @@ observer.NavigationItemCommitted(web_state, load_details); } +void GlobalWebStateEventTracker::DidStartNavigation( + WebState* web_state, + NavigationContext* navigation_context) { + for (auto& observer : observer_list_) + observer.WebStateDidStartNavigation(web_state, navigation_context); +} + void GlobalWebStateEventTracker::DidStartLoading(WebState* web_state) { for (auto& observer : observer_list_) observer.WebStateDidStartLoading(web_state);
diff --git a/ios/web/web_state/js/common_js_unittest.mm b/ios/web/web_state/js/common_js_unittest.mm index 48d3f4b3..b04606b 100644 --- a/ios/web/web_state/js/common_js_unittest.mm +++ b/ios/web/web_state/js/common_js_unittest.mm
@@ -193,4 +193,73 @@ } } +// Tests that __gCrWeb.common.updatePluginPlaceholders JavaScript API correctly +// find plugins which are candidates for covering with a placeholder. +// NOTE: Some of the plugins detected here may not actually be covered with a +// placeholder because __gCrWeb.plugin.addPluginPlaceholders also takes into +// account the physical size of the plugin. +TEST_F(CommonJsTest, UpdatePluginPlaceholders) { + struct TestData { + NSString* plugin_source; + BOOL expected_placeholder_installed; + } test_data[] = { + // Applet with fallback data should be untouched. + {@"<html><applet code='Some.class'><p>Fallback text.</p></applet>" + "</body></html>", + NO}, + // Applet without fallback data should be covered. + {@"<html><applet code='Some.class'></applet></body></html>", YES}, + // Object with flash embed fallback should be covered. + {@"<html><body>" + "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" + " codebase='http://download.macromedia.com/pub/shockwave/cabs/'" + "flash/swflash.cab#version=6,0,0,0'>" + " <param name='movie' value='some.swf'>" + " <embed src='some.swf' type='application/x-shockwave-flash'>" + "</object>" + "</body></html>", + YES}, + // Object with undefined embed fallback should be untouched. + {@"<html><body>" + "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'" + " codebase='http://download.macromedia.com/pub/shockwave/cabs/'" + "flash/swflash.cab#version=6,0,0,0'>" + " <param name='movie' value='some.swf'>" + " <embed src='some.swf'>" + "</object>" + "</body></html>", + NO}, + // Object with text fallback should be untouched. + {@"<html><body>" + "<object type='application/x-shockwave-flash' data='some.sfw'>" + " <param name='movie' value='some.swf'>" + " <p>Fallback text.</p>" + "</object>" + "</body></html>", + NO}, + // Object with no fallback should be covered. + {@"<html><body>" + "<object type='application/x-shockwave-flash' data='some.sfw'>" + " <param name='movie' value='some.swf'>" + "</object>" + "</body></html>", + YES}, + // Object displaying an image should be untouched. + {@"<html><body>" + "<object data='foo.png' type='image/png'>" + "</object>" + "</body></html>", + NO}, + }; + for (size_t i = 0; i < arraysize(test_data); i++) { + TestData& data = test_data[i]; + LoadHtml(data.plugin_source); + id result = + ExecuteJavaScript(@"__gCrWeb.common.updatePluginPlaceholders()"); + EXPECT_NSEQ(@(data.expected_placeholder_installed), result) + << " in test " << i << ": " + << base::SysNSStringToUTF8(data.plugin_source); + } +} + } // namespace web
diff --git a/ios/web/web_state/js/resources/common.js b/ios/web/web_state/js/resources/common.js index 0b41262..4cf14d18 100644 --- a/ios/web/web_state/js/resources/common.js +++ b/ios/web/web_state/js/resources/common.js
@@ -705,19 +705,87 @@ }; /** - * Checks whether plugin a node has fallback content. + * Checks whether a node has fallback content, which will be displayed in + * browsers which do not support the required plugin to display the node's + * content. * @param {HTMLElement} node The node to check. - * @return {boolean} Whether the node has fallback. + * @return {boolean} Whether the node has any fallback content. * @private */ - var pluginHasFallbackContent_ = function(node) { - return node.textContent.trim().length > 0 || - node.getElementsByTagName('img').length > 0; + var nodeHasFallbackContent_ = function(node) { + if (node.textContent.trim().length > 0) { + return true; + } + + var childrenCount = node.children.length; + for (var i = 0; i < childrenCount; i++) { + var childNode = /** @type {!HTMLElement} */(node.children[i]); + // Do not consider <param> elements which affect the contents of the + // parent object node as fallback content. + if (childNode.tagName !== 'PARAM') { + return true; + } + } + + return false; }; /** - * Returns a list of plugin elements in the document that have no fallback - * content. For nested plugins, only the innermost plugin element is returned. + * Finds the child embed element of node, if one exists. + * @param {HTMLElement} node The node to check. + * @return {HTMLElement} The embed fallback node, if one exists. + * @private + */ + var getChildEmbedElement_ = function(node) { + var childrenCount = node.children.length; + if (childrenCount == 0) { + return null; + } + for (var i = 0; i < childrenCount; i++) { + var childNode = /** @type {!HTMLElement} */(node.children[i]); + if (childNode.tagName === 'EMBED') { + return childNode; + } + } + return null; + }; + + /** + * Checks if an embed node explicitly defines the content type to be flash. + * @param {HTMLElement} node The node to check. + * @return {boolean} Whether the node is known to be flash content. + * @private + */ + var embedNodeIsKnownFlashContent_ = function(node) { + return node.hasAttribute('type') && + (node.type.indexOf('application/x-shockwave-flash') == 0 || + node.type.indexOf('application/vnd.adobe.flash-movie') == 0); + }; + + /** + * Checks whether a plugin is supported. A supported plugin must have fallback + * content and that fallback content must not be known flash content. + * @param {HTMLElement} node The node to check. + * @return {boolean} Whether the node is supported. + * @private + */ + var pluginNodeIsSupported_ = function(node) { + if (!nodeHasFallbackContent_(node)) { + return false; + } + + var embedChildNode = getChildEmbedElement_(node); + if (embedChildNode && embedNodeIsKnownFlashContent_(embedChildNode)) { + return false; + } + + return true; + }; + + /** + * Returns a list of plugin elements in the document that have either no + * fallback content or have fallback content that is explicitly defined as + * flash. For nested plugins, only the innermost plugin element is returned. * @return {!Array<!HTMLElement>} A list of plugin elements. * @private */ @@ -728,7 +796,7 @@ for (i = 0; i < objectCount; i++) { var object = /** @type {!HTMLElement} */(objects[i]); if (objectNodeIsPlugin_(object) && - !pluginHasFallbackContent_(object)) { + !pluginNodeIsSupported_(object)) { pluginNodes.push(object); } } @@ -736,7 +804,7 @@ var appletsCount = applets.length; for (i = 0; i < appletsCount; i++) { var applet = /** @type {!HTMLElement} */(applets[i]); - if (!pluginHasFallbackContent_(applet)) { + if (!pluginNodeIsSupported_(applet)) { pluginNodes.push(applet); } }
diff --git a/ios/web/web_state/navigation_and_load_callbacks_inttest.mm b/ios/web/web_state/navigation_and_load_callbacks_inttest.mm index a2ff79c6..8888ca4 100644 --- a/ios/web/web_state/navigation_and_load_callbacks_inttest.mm +++ b/ios/web/web_state/navigation_and_load_callbacks_inttest.mm
@@ -553,14 +553,14 @@ EXPECT_CALL(observer_, DidStartNavigation(web_state(), _)) .WillOnce(VerifySameDocumentStartedContext( web_state(), url, &context, - ui::PageTransition::PAGE_TRANSITION_CLIENT_REDIRECT, + ui::PageTransition::PAGE_TRANSITION_FORWARD_BACK, /*renderer_initiated=*/false)); // No ShouldAllowResponse callbacks for same-document back-forward // navigations. EXPECT_CALL(observer_, DidFinishNavigation(web_state(), _)) .WillOnce(VerifySameDocumentFinishedContext( web_state(), url, &context, - ui::PageTransition::PAGE_TRANSITION_CLIENT_REDIRECT, + ui::PageTransition::PAGE_TRANSITION_FORWARD_BACK, /*renderer_initiated=*/false)); EXPECT_CALL(observer_, DidStopLoading(web_state())); ExecuteBlockAndWaitForLoad(url, ^{
diff --git a/ios/web/web_state/ui/crw_web_controller.h b/ios/web/web_state/ui/crw_web_controller.h index 7acee44..13002d46 100644 --- a/ios/web/web_state/ui/crw_web_controller.h +++ b/ios/web/web_state/ui/crw_web_controller.h
@@ -15,6 +15,8 @@ namespace web { +enum class NavigationInitiationType; + // Page load phases. enum LoadPhase { // In the LOAD_REQUESTED phase, the system predicts a page change is going to @@ -186,15 +188,6 @@ // complete it will be handled internally. - (void)restoreStateFromHistory; -// Updates the HTML5 history state of the page using the current NavigationItem. -// For same-document navigations and navigations affected by -// window.history.[push/replace]State(), the URL and serialized state object -// will be updated to the current NavigationItem's values. A popState event -// will be triggered for all same-document navigations. Additionally, a -// hashchange event will be triggered for same-document navigations where the -// only difference between the current and previous URL is the fragment. -- (void)updateHTML5HistoryState; - // Notifies the CRWWebController that it has been shown. - (void)wasShown; @@ -225,6 +218,13 @@ // Returns the native controller (if any) current mananging the content. - (id<CRWNativeContent>)nativeController; + +// Called when NavigationManager has completed go to index same-document +// navigation. Updates HTML5 history state, current document URL and sends +// approprivate navigation and loading WebStateObserver callbacks. +- (void)didFinishGoToIndexSameDocumentNavigationWithType: + (web::NavigationInitiationType)type; + @end #pragma mark Testing
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm index 88a5c1a..7349f541 100644 --- a/ios/web/web_state/ui/crw_web_controller.mm +++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -590,7 +590,7 @@ // Navigates forwards or backwards by |delta| pages. No-op if delta is out of // bounds. Reloads if delta is 0. // TODO(crbug.com/661316): Move this method to NavigationManager. -- (void)goDelta:(int)delta; +- (void)rendererInitiatedGoDelta:(int)delta; // Informs the native controller if web usage is allowed or not. - (void)setNativeControllerWebUsageEnabled:(BOOL)webUsageEnabled; // Acts on a single message from the JS object, parsed from JSON into a @@ -624,6 +624,14 @@ // Maps WKNavigationType to ui::PageTransition. - (ui::PageTransition)pageTransitionFromNavigationType: (WKNavigationType)navigationType; +// Updates the HTML5 history state of the page using the current NavigationItem. +// For same-document navigations and navigations affected by +// window.history.[push/replace]State(), the URL and serialized state object +// will be updated to the current NavigationItem's values. A popState event +// will be triggered for all same-document navigations. Additionally, a +// hashchange event will be triggered for same-document navigations where the +// only difference between the current and previous URL is the fragment. +- (void)updateHTML5HistoryState; // Generates the JavaScript string used to update the UIWebView's URL so that it // matches the URL displayed in the omnibox and sets window.history.state to // stateObject. Needed for history.pushState() and history.replaceState(). @@ -1972,7 +1980,7 @@ _webStateImpl->OnPageLoaded(currentURL, loadSuccess); } -- (void)goDelta:(int)delta { +- (void)rendererInitiatedGoDelta:(int)delta { if (_isBeingDestroyed) return; @@ -1983,7 +1991,8 @@ if (self.navigationManagerImpl->CanGoToOffset(delta)) { int index = self.navigationManagerImpl->GetIndexForOffset(delta); - self.navigationManagerImpl->GoToIndex(index); + self.navigationManagerImpl->GoToIndex( + index, web::NavigationInitiationType::RENDERER_INITIATED); } } @@ -2478,7 +2487,7 @@ context:(NSDictionary*)context { if (![context[kIsMainFrame] boolValue]) return NO; - [self goDelta:-1]; + [self rendererInitiatedGoDelta:-1]; return YES; } @@ -2486,7 +2495,7 @@ context:(NSDictionary*)context { if (![context[kIsMainFrame] boolValue]) return NO; - [self goDelta:1]; + [self rendererInitiatedGoDelta:1]; return YES; } @@ -2496,7 +2505,7 @@ return NO; double delta = 0; if (message->GetDouble("value", &delta)) { - [self goDelta:static_cast<int>(delta)]; + [self rendererInitiatedGoDelta:static_cast<int>(delta)]; return YES; } return NO; @@ -4534,6 +4543,22 @@ } } +- (void)didFinishGoToIndexSameDocumentNavigationWithType: + (web::NavigationInitiationType)type { + GURL URL = _webStateImpl->GetLastCommittedURL(); + std::unique_ptr<web::NavigationContextImpl> context = + web::NavigationContextImpl::CreateNavigationContext( + _webStateImpl, URL, ui::PageTransition::PAGE_TRANSITION_FORWARD_BACK, + type == web::NavigationInitiationType::RENDERER_INITIATED); + context->SetIsSameDocument(true); + _webStateImpl->SetIsLoading(true); + _webStateImpl->OnNavigationStarted(context.get()); + [self updateHTML5HistoryState]; + [self setDocumentURL:URL]; + _webStateImpl->OnNavigationFinished(context.get()); + [self didFinishWithURL:URL loadSuccess:YES]; +} + - (void)webView:(WKWebView*)webView didFinishNavigation:(WKNavigation*)navigation { [self didReceiveWebViewNavigationDelegateCallback];
diff --git a/ios/web/web_state/web_state_impl.h b/ios/web/web_state/web_state_impl.h index 25a5085..1c07fbce 100644 --- a/ios/web/web_state/web_state_impl.h +++ b/ios/web/web_state/web_state_impl.h
@@ -276,7 +276,8 @@ // NavigationManagerDelegate: void ClearTransientContent() override; void RecordPageStateInNavigationItem() override; - void UpdateHtml5HistoryState() override; + void OnGoToIndexSameDocumentNavigation( + NavigationInitiationType type) override; void WillChangeUserAgentType() override; void LoadCurrentItem() override; void LoadIfNecessary() override;
diff --git a/ios/web/web_state/web_state_impl.mm b/ios/web/web_state/web_state_impl.mm index 58d02ce8..f875aab 100644 --- a/ios/web/web_state/web_state_impl.mm +++ b/ios/web/web_state/web_state_impl.mm
@@ -768,8 +768,9 @@ [web_controller_ recordStateInHistory]; } -void WebStateImpl::UpdateHtml5HistoryState() { - [web_controller_ updateHTML5HistoryState]; +void WebStateImpl::OnGoToIndexSameDocumentNavigation( + NavigationInitiationType type) { + [web_controller_ didFinishGoToIndexSameDocumentNavigationWithType:type]; } void WebStateImpl::WillChangeUserAgentType() {
diff --git a/ios/web/web_state/web_state_impl_unittest.mm b/ios/web/web_state/web_state_impl_unittest.mm index fef4bc4..d187bd8 100644 --- a/ios/web/web_state/web_state_impl_unittest.mm +++ b/ios/web/web_state/web_state_impl_unittest.mm
@@ -63,6 +63,7 @@ navigation_item_committed_called_(false), did_start_loading_called_(false), did_stop_loading_called_(false), + did_start_navigation_called_(false), page_loaded_called_with_success_(false), web_state_destroyed_called_(false) {} @@ -79,6 +80,9 @@ } bool did_start_loading_called() const { return did_start_loading_called_; } bool did_stop_loading_called() const { return did_stop_loading_called_; } + bool did_start_navigation_called() const { + return did_start_navigation_called_; + } bool page_loaded_called_with_success() const { return page_loaded_called_with_success_; } @@ -106,6 +110,11 @@ void WebStateDidStopLoading(WebState* web_state) override { did_stop_loading_called_ = true; } + void WebStateDidStartNavigation( + WebState* web_state, + NavigationContext* navigation_context) override { + did_start_navigation_called_ = true; + } void PageLoaded(WebState* web_state, PageLoadCompletionStatus load_completion_status) override { page_loaded_called_with_success_ = @@ -120,6 +129,7 @@ bool navigation_item_committed_called_; bool did_start_loading_called_; bool did_stop_loading_called_; + bool did_start_navigation_called_; bool page_loaded_called_with_success_; bool web_state_destroyed_called_; }; @@ -604,6 +614,12 @@ web_state_->OnNavigationItemCommitted(details); EXPECT_TRUE(observer->navigation_item_committed_called()); + // Test that DidStartNavigation() is called. + EXPECT_FALSE(observer->did_start_navigation_called()); + FakeNavigationContext context; + web_state_->OnNavigationStarted(&context); + EXPECT_TRUE(observer->did_start_navigation_called()); + // Test that WebStateDidStartLoading() is called. EXPECT_FALSE(observer->did_start_loading_called()); web_state_->SetIsLoading(true);
diff --git a/ios/web_view/internal/signin/web_view_signin_error_controller_factory.mm b/ios/web_view/internal/signin/web_view_signin_error_controller_factory.mm index a2f25c7..a807a2ef 100644 --- a/ios/web_view/internal/signin/web_view_signin_error_controller_factory.mm +++ b/ios/web_view/internal/signin/web_view_signin_error_controller_factory.mm
@@ -4,7 +4,8 @@ #include "ios/web_view/internal/signin/web_view_signin_error_controller_factory.h" -#include "base/memory/ptr_util.h" +#include <utility> + #include "base/memory/singleton.h" #include "components/keyed_service/core/service_access_type.h" #include "components/keyed_service/ios/browser_state_dependency_manager.h" @@ -38,7 +39,8 @@ std::unique_ptr<KeyedService> WebViewSigninErrorControllerFactory::BuildServiceInstanceFor( web::BrowserState* context) const { - return base::MakeUnique<SigninErrorController>(); + return std::make_unique<SigninErrorController>( + SigninErrorController::AccountMode::ANY_ACCOUNT); } } // namespace ios_web_view
diff --git a/ios/web_view/internal/signin/web_view_signin_manager_factory.mm b/ios/web_view/internal/signin/web_view_signin_manager_factory.mm index 6369b278c..de59957 100644 --- a/ios/web_view/internal/signin/web_view_signin_manager_factory.mm +++ b/ios/web_view/internal/signin/web_view_signin_manager_factory.mm
@@ -19,6 +19,7 @@ #include "ios/web_view/internal/signin/web_view_gaia_cookie_manager_service_factory.h" #include "ios/web_view/internal/signin/web_view_oauth2_token_service_factory.h" #include "ios/web_view/internal/signin/web_view_signin_client_factory.h" +#include "ios/web_view/internal/signin/web_view_signin_error_controller_factory.h" #include "ios/web_view/internal/web_view_browser_state.h" #if !defined(__has_feature) || !__has_feature(objc_arc) @@ -35,6 +36,7 @@ DependsOn(WebViewGaiaCookieManagerServiceFactory::GetInstance()); DependsOn(WebViewOAuth2TokenServiceFactory::GetInstance()); DependsOn(WebViewAccountTrackerServiceFactory::GetInstance()); + DependsOn(WebViewSigninErrorControllerFactory::GetInstance()); } // static @@ -66,12 +68,12 @@ web::BrowserState* context) const { WebViewBrowserState* browser_state = WebViewBrowserState::FromBrowserState(context); - std::unique_ptr<SigninManager> service(new SigninManager( + std::unique_ptr<SigninManager> service = std::make_unique<SigninManager>( WebViewSigninClientFactory::GetForBrowserState(browser_state), WebViewOAuth2TokenServiceFactory::GetForBrowserState(browser_state), WebViewAccountTrackerServiceFactory::GetForBrowserState(browser_state), - WebViewGaiaCookieManagerServiceFactory::GetForBrowserState( - browser_state))); + WebViewGaiaCookieManagerServiceFactory::GetForBrowserState(browser_state), + WebViewSigninErrorControllerFactory::GetForBrowserState(browser_state)); service->Initialize(ApplicationContext::GetInstance()->GetLocalState()); return service; }
diff --git a/ios/web_view/test/web_view_test_util.mm b/ios/web_view/test/web_view_test_util.mm index cbd93a74..4d67901 100644 --- a/ios/web_view/test/web_view_test_util.mm +++ b/ios/web_view/test/web_view_test_util.mm
@@ -32,7 +32,6 @@ } bool TapWebViewElementWithId(CWVWebView* web_view, NSString* element_id) { - // TODO(crbug.com/725524): Share this script with Chrome. NSString* script = [NSString stringWithFormat:@"(function() {" " var element = document.getElementById('%@');"
diff --git a/ipc/SECURITY_OWNERS b/ipc/SECURITY_OWNERS index 46e858e..9fe4dfb1 100644 --- a/ipc/SECURITY_OWNERS +++ b/ipc/SECURITY_OWNERS
@@ -10,6 +10,7 @@ estark@chromium.org kenrb@chromium.org kerrnel@chromium.org +kinuko@chromium.org meacer@chromium.org mbarbella@chromium.org mkwst@chromium.org @@ -17,5 +18,6 @@ ochang@chromium.org palmer@chromium.org rsesek@chromium.org +sammc@chromium.org tsepez@chromium.org wfh@chromium.org
diff --git a/media/audio/android/opensles_output.cc b/media/audio/android/opensles_output.cc index 81a02db..b4893925 100644 --- a/media/audio/android/opensles_output.cc +++ b/media/audio/android/opensles_output.cc
@@ -23,28 +23,6 @@ } \ } while (0) -// On N MR1+ we want to use high buffer sizes for power saving. Per Android -// audio team, this should be in N MR1+ SDK, but it's not, so use a defined() -// check instead of __API_LEVEL__ check. -#if !defined(SL_ANDROID_KEY_PERFORMANCE_MODE) -#define SL_ANDROID_KEY_PERFORMANCE_MODE \ - ((const SLchar*)"androidPerformanceMode") - -// No specific performance requirement. Allows HW and SW pre/post processing. -#define SL_ANDROID_PERFORMANCE_NONE ((SLuint32)0x00000000) - -// Priority given to latency. No HW or software pre/post processing. This is the -// default if no performance mode is specified. -#define SL_ANDROID_PERFORMANCE_LATENCY ((SLuint32)0x00000001) - -// Priority given to latency while still allowing HW pre and post processing. -#define SL_ANDROID_PERFORMANCE_LATENCY_EFFECTS ((SLuint32)0x00000002) - -// Priority given to power saving if latency is not a concern. Allows HW and SW -// pre/post processing. -#define SL_ANDROID_PERFORMANCE_POWER_SAVING ((SLuint32)0x00000003) -#endif - namespace media { OpenSLESOutputStream::OpenSLESOutputStream(AudioManagerAndroid* manager,
diff --git a/media/audio/android/opensles_output.h b/media/audio/android/opensles_output.h index db9b75e7..86d5a852 100644 --- a/media/audio/android/opensles_output.h +++ b/media/audio/android/opensles_output.h
@@ -21,25 +21,6 @@ #include "media/base/audio_parameters.h" #include "media/base/audio_timestamp_helper.h" -// On L+, we want to use floating point output for better fidelity. -#if __ANDROID_API__ < 21 -#define SL_ANDROID_PCM_REPRESENTATION_SIGNED_INT ((SLuint32)0x00000001) -#define SL_ANDROID_PCM_REPRESENTATION_UNSIGNED_INT ((SLuint32)0x00000002) -#define SL_ANDROID_PCM_REPRESENTATION_FLOAT ((SLuint32)0x00000003) -#define SL_ANDROID_DATAFORMAT_PCM_EX ((SLuint32)0x00000004) - -typedef struct SLAndroidDataFormat_PCM_EX_ { - SLuint32 formatType; - SLuint32 numChannels; - SLuint32 sampleRate; - SLuint32 bitsPerSample; - SLuint32 containerSize; - SLuint32 channelMask; - SLuint32 endianness; - SLuint32 representation; -} SLAndroidDataFormat_PCM_EX; -#endif - namespace media { class AudioManagerAndroid;
diff --git a/media/audio/android/opensles_wrapper.cc b/media/audio/android/opensles_wrapper.cc index 2d49c5805..ba7dba7 100644 --- a/media/audio/android/opensles_wrapper.cc +++ b/media/audio/android/opensles_wrapper.cc
@@ -9,6 +9,16 @@ // proxies for those constants and redefine those when the library is first // loaded. For this, it need to be able to change their content and so import // the headers without const. This is correct because OpenSLES.h is a C API. + +// We include stdint.h here as a workaround for an issue caused by the +// #define const below. The inclusion of OpenSLES headers on newer Android NDK +// versions causes stdint.h to be included, which in turn includes __config. +// This causes the declaration of __sanitizer_annotate_contiguous_container to +// not use const parameters, which causes compile issues when building with +// asan. Including here forces __config to be included while const is still +// untouched. +#include <stdint.h> + #define const #include <SLES/OpenSLES.h> #include <SLES/OpenSLES_Android.h>
diff --git a/media/base/android/BUILD.gn b/media/base/android/BUILD.gn index 7b300257..89867749 100644 --- a/media/base/android/BUILD.gn +++ b/media/base/android/BUILD.gn
@@ -25,6 +25,8 @@ "android_overlay.h", "android_util.cc", "android_util.h", + "jni_hdr_metadata.cc", + "jni_hdr_metadata.h", "media_codec_bridge.h", "media_codec_bridge_impl.cc", "media_codec_bridge_impl.h", @@ -131,7 +133,9 @@ "java/src/org/chromium/media/AudioRecordInput.java", "java/src/org/chromium/media/AudioTrackOutputStream.java", "java/src/org/chromium/media/CodecProfileLevelList.java", + "java/src/org/chromium/media/HdrMetadata.java", "java/src/org/chromium/media/MediaCodecBridge.java", + "java/src/org/chromium/media/MediaCodecBridgeBuilder.java", "java/src/org/chromium/media/MediaCodecUtil.java", "java/src/org/chromium/media/MediaDrmBridge.java", "java/src/org/chromium/media/MediaDrmStorageBridge.java", @@ -169,7 +173,9 @@ "java/src/org/chromium/media/AudioRecordInput.java", "java/src/org/chromium/media/AudioTrackOutputStream.java", "java/src/org/chromium/media/CodecProfileLevelList.java", + "java/src/org/chromium/media/HdrMetadata.java", "java/src/org/chromium/media/MediaCodecBridge.java", + "java/src/org/chromium/media/MediaCodecBridgeBuilder.java", "java/src/org/chromium/media/MediaCodecUtil.java", "java/src/org/chromium/media/MediaCodecEncoder.java", "java/src/org/chromium/media/MediaDrmBridge.java",
diff --git a/media/base/android/java/src/org/chromium/media/HdrMetadata.java b/media/base/android/java/src/org/chromium/media/HdrMetadata.java new file mode 100644 index 0000000..e5e2a012 --- /dev/null +++ b/media/base/android/java/src/org/chromium/media/HdrMetadata.java
@@ -0,0 +1,196 @@ +// Copyright 2017 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.media; + +import android.annotation.TargetApi; +import android.media.MediaFormat; +import android.os.Build; + +import org.chromium.base.Log; +import org.chromium.base.annotations.CalledByNative; +import org.chromium.base.annotations.JNINamespace; +import org.chromium.base.annotations.MainDex; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +@JNINamespace("media") +@MainDex +class HdrMetadata { + private static final String TAG = "HdrMetadata"; + private static final int MAX_CHROMATICITY = 50000; // Defined in CTA-861.3. + + private long mNativeJniHdrMetadata; + private final Object mLock = new Object(); + + @CalledByNative + private static HdrMetadata create(long nativeRef) { + return new HdrMetadata(nativeRef); + } + + private HdrMetadata(long nativeRef) { + assert nativeRef != 0; + mNativeJniHdrMetadata = nativeRef; + } + + @CalledByNative + private void close() { + synchronized (mLock) { + mNativeJniHdrMetadata = 0; + } + } + + @TargetApi(Build.VERSION_CODES.N) + public void addMetadataToFormat(MediaFormat format) { + synchronized (mLock) { + assert mNativeJniHdrMetadata != 0; + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { + Log.e(TAG, "HDR not supported before Android N"); + return; + } + + // TODO(sandv): Use color space matrix when android has support for it. + int colorStandard = getColorStandard(); + if (colorStandard != -1) + format.setInteger(MediaFormat.KEY_COLOR_STANDARD, colorStandard); + + int colorTransfer = getColorTransfer(); + if (colorTransfer != -1) + format.setInteger(MediaFormat.KEY_COLOR_TRANSFER, colorTransfer); + + int colorRange = getColorRange(); + if (colorRange != -1) format.setInteger(MediaFormat.KEY_COLOR_RANGE, colorRange); + + ByteBuffer hdrStaticInfo = ByteBuffer.wrap(new byte[25]); + hdrStaticInfo.order(ByteOrder.LITTLE_ENDIAN); + hdrStaticInfo.put((byte) 0); // Type. + hdrStaticInfo.putShort((short) ((primaryRChromaticityX() * MAX_CHROMATICITY) + 0.5f)); + hdrStaticInfo.putShort((short) ((primaryRChromaticityY() * MAX_CHROMATICITY) + 0.5f)); + hdrStaticInfo.putShort((short) ((primaryGChromaticityX() * MAX_CHROMATICITY) + 0.5f)); + hdrStaticInfo.putShort((short) ((primaryGChromaticityY() * MAX_CHROMATICITY) + 0.5f)); + hdrStaticInfo.putShort((short) ((primaryBChromaticityX() * MAX_CHROMATICITY) + 0.5f)); + hdrStaticInfo.putShort((short) ((primaryBChromaticityY() * MAX_CHROMATICITY) + 0.5f)); + hdrStaticInfo.putShort((short) ((whitePointChromaticityX() * MAX_CHROMATICITY) + 0.5f)); + hdrStaticInfo.putShort((short) ((whitePointChromaticityY() * MAX_CHROMATICITY) + 0.5f)); + hdrStaticInfo.putShort((short) (maxMasteringLuminance() + 0.5f)); + hdrStaticInfo.putShort((short) (minMasteringLuminance() + 0.5f)); + hdrStaticInfo.putShort((short) maxContentLuminance()); + hdrStaticInfo.putShort((short) maxFrameAverageLuminance()); + + hdrStaticInfo.rewind(); + format.setByteBuffer(MediaFormat.KEY_HDR_STATIC_INFO, hdrStaticInfo); + } + } + + private native int nativePrimaries(long nativeJniHdrMetadata); + private int getColorStandard() { + // media/base/video_color_space.h + switch (nativePrimaries(mNativeJniHdrMetadata)) { + case 1: + return MediaFormat.COLOR_STANDARD_BT709; + case 4: // BT.470M. + case 5: // BT.470BG. + case 6: // SMPTE 170M. + case 7: // SMPTE 240M. + return MediaFormat.COLOR_STANDARD_BT601_NTSC; + case 9: + return MediaFormat.COLOR_STANDARD_BT2020; + default: + return -1; + } + } + + private native int nativeColorTransfer(long nativeJniHdrMetadata); + private int getColorTransfer() { + // media/base/video_color_space.h + switch (nativeColorTransfer(mNativeJniHdrMetadata)) { + case 1: // BT.709. + case 6: // SMPTE 170M. + case 7: // SMPTE 240M. + return MediaFormat.COLOR_TRANSFER_SDR_VIDEO; + case 8: + return MediaFormat.COLOR_TRANSFER_LINEAR; + case 16: + return MediaFormat.COLOR_TRANSFER_ST2084; + case 18: + return MediaFormat.COLOR_TRANSFER_HLG; + default: + return -1; + } + } + + private native int nativeRange(long nativeJniHdrMetadata); + private int getColorRange() { + // media/base/video_color_space.h + switch (nativeRange(mNativeJniHdrMetadata)) { + case 1: + return MediaFormat.COLOR_RANGE_LIMITED; + case 2: + return MediaFormat.COLOR_RANGE_FULL; + default: + return -1; + } + } + + private native float nativePrimaryRChromaticityX(long nativeJniHdrMetadata); + private float primaryRChromaticityX() { + return nativePrimaryRChromaticityX(mNativeJniHdrMetadata); + } + + private native float nativePrimaryRChromaticityY(long nativeJniHdrMetadata); + private float primaryRChromaticityY() { + return nativePrimaryRChromaticityY(mNativeJniHdrMetadata); + } + + private native float nativePrimaryGChromaticityX(long nativeJniHdrMetadata); + private float primaryGChromaticityX() { + return nativePrimaryGChromaticityX(mNativeJniHdrMetadata); + } + + private native float nativePrimaryGChromaticityY(long nativeJniHdrMetadata); + private float primaryGChromaticityY() { + return nativePrimaryGChromaticityY(mNativeJniHdrMetadata); + } + + private native float nativePrimaryBChromaticityX(long nativeJniHdrMetadata); + private float primaryBChromaticityX() { + return nativePrimaryBChromaticityX(mNativeJniHdrMetadata); + } + + private native float nativePrimaryBChromaticityY(long nativeJniHdrMetadata); + private float primaryBChromaticityY() { + return nativePrimaryBChromaticityY(mNativeJniHdrMetadata); + } + + private native float nativeWhitePointChromaticityX(long nativeJniHdrMetadata); + private float whitePointChromaticityX() { + return nativeWhitePointChromaticityX(mNativeJniHdrMetadata); + } + + private native float nativeWhitePointChromaticityY(long nativeJniHdrMetadata); + private float whitePointChromaticityY() { + return nativeWhitePointChromaticityY(mNativeJniHdrMetadata); + } + + private native float nativeMaxMasteringLuminance(long nativeJniHdrMetadata); + private float maxMasteringLuminance() { + return nativeMaxMasteringLuminance(mNativeJniHdrMetadata); + } + + private native float nativeMinMasteringLuminance(long nativeJniHdrMetadata); + private float minMasteringLuminance() { + return nativeMinMasteringLuminance(mNativeJniHdrMetadata); + } + + private native int nativeMaxContentLuminance(long nativeJniHdrMetadata); + private int maxContentLuminance() { + return nativeMaxContentLuminance(mNativeJniHdrMetadata); + } + + private native int nativeMaxFrameAverageLuminance(long nativeJniHdrMetadata); + private int maxFrameAverageLuminance() { + return nativeMaxFrameAverageLuminance(mNativeJniHdrMetadata); + } +}
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java index 213b0fa..49991285 100644 --- a/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java +++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridge.java
@@ -22,7 +22,6 @@ import org.chromium.media.MediaCodecUtil.MimeTypes; import java.nio.ByteBuffer; -import java.nio.ByteOrder; /** * A MediaCodec wrapper for adapting the API and catching exceptions. @@ -50,10 +49,9 @@ private static final String KEY_CROP_BOTTOM = "crop-bottom"; private static final String KEY_CROP_TOP = "crop-top"; - private static final int BITRATE_ADJUSTMENT_FPS = 30; - private static final int MAXIMUM_INITIAL_FPS = 30; - - private static final int MAX_CHROMATICITY = 50000; // Defined in CTA-861.3. + // TODO(sanfin): Factor this and other bitrate adjustment logic to a delegate class. + static final int BITRATE_ADJUSTMENT_FPS = 30; + static final int MAXIMUM_INITIAL_FPS = 30; protected MediaCodec mMediaCodec; @@ -62,8 +60,6 @@ private boolean mFlushed; private long mLastPresentationTimeUs; - private String mMime; - private boolean mAdaptivePlaybackSupported; private BitrateAdjustmentTypes mBitrateAdjustmentType = BitrateAdjustmentTypes.NO_ADJUSTMENT; @MainDex @@ -184,49 +180,16 @@ } } - protected MediaCodecBridge(MediaCodec mediaCodec, String mime, - boolean adaptivePlaybackSupported, BitrateAdjustmentTypes bitrateAdjustmentType) { + MediaCodecBridge(MediaCodec mediaCodec, BitrateAdjustmentTypes bitrateAdjustmentType) { assert mediaCodec != null; mMediaCodec = mediaCodec; - mMime = mime; mLastPresentationTimeUs = 0; mFlushed = true; - mAdaptivePlaybackSupported = adaptivePlaybackSupported; mBitrateAdjustmentType = bitrateAdjustmentType; } @CalledByNative - private static MediaCodecBridge create( - String mime, int codecType, int direction, MediaCrypto mediaCrypto) { - MediaCodecUtil.CodecCreationInfo info = new MediaCodecUtil.CodecCreationInfo(); - try { - if (direction == MediaCodecDirection.ENCODER) { - Log.i(TAG, "creat MediaCodec encoder, mime %s", mime); - info = MediaCodecUtil.createEncoder(mime); - } else { - // |codecType| only applies to decoders not encoders. - info = MediaCodecUtil.createDecoder(mime, codecType, mediaCrypto); - } - } catch (Exception e) { - Log.e(TAG, "Failed to create MediaCodec: %s, codecType: %d, direction: %d", mime, - codecType, direction, e); - } - - if (info.mediaCodec == null) return null; - - // Create MediaCodecEncoder for H264 to meet WebRTC requirements to IDR/keyframes. - // See https://crbug.com/761336 for more details. - if (direction == MediaCodecDirection.ENCODER && mime.equals(MimeTypes.VIDEO_H264)) { - return new MediaCodecEncoder(info.mediaCodec, mime, info.supportsAdaptivePlayback, - info.bitrateAdjustmentType); - } - - return new MediaCodecBridge( - info.mediaCodec, mime, info.supportsAdaptivePlayback, info.bitrateAdjustmentType); - } - - @CalledByNative - private void release() { + void release() { try { String codecName = "unknown"; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { @@ -244,9 +207,9 @@ mMediaCodec = null; } + // TODO(sanfin): Move this to constructor or builder. @SuppressWarnings("deprecation") - @CalledByNative - private boolean start() { + boolean start() { try { mMediaCodec.start(); if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) { @@ -453,7 +416,8 @@ Log.d(TAG, "Failed to queue secure input buffer: CryptoException.ERROR_NO_KEY"); return MediaCodecStatus.NO_KEY; } - Log.e(TAG, "Failed to queue secure input buffer, CryptoException with error code " + Log.e(TAG, + "Failed to queue secure input buffer, CryptoException with error code " + e.getErrorCode()); return MediaCodecStatus.ERROR; } catch (IllegalArgumentException e) { @@ -522,17 +486,10 @@ return mMediaCodec.dequeueOutputBuffer(info, timeoutUs); } - @CalledByNative - private boolean configureVideo(MediaFormat format, Surface surface, MediaCrypto crypto, - int flags, boolean allowAdaptivePlayback) { + boolean configureVideo(MediaFormat format, Surface surface, MediaCrypto crypto, int flags, + boolean allowAdaptivePlayback) { try { - // If adaptive playback is turned off by request, then treat it as - // not supported. Note that configureVideo is only called once - // during creation, else this would prevent re-enabling adaptive - // playback later. - if (!allowAdaptivePlayback) mAdaptivePlaybackSupported = false; - - if (mAdaptivePlaybackSupported) { + if (allowAdaptivePlayback) { // The max size is a hint to the codec, and causes it to // allocate more memory up front. It still supports higher // resolutions if they arrive. So, we try to ask only for @@ -542,7 +499,7 @@ format.setInteger( MediaFormat.KEY_MAX_HEIGHT, format.getInteger(MediaFormat.KEY_HEIGHT)); } - maybeSetMaxInputSize(format); + maybeSetMaxInputSize(format, allowAdaptivePlayback); mMediaCodec.configure(format, surface, crypto, flags); return true; } catch (IllegalArgumentException e) { @@ -557,30 +514,20 @@ return false; } - @CalledByNative - private static MediaFormat createAudioFormat(String mime, int sampleRate, int channelCount) { - return MediaFormat.createAudioFormat(mime, sampleRate, channelCount); - } - - @CalledByNative - private static MediaFormat createVideoDecoderFormat(String mime, int width, int height) { - return MediaFormat.createVideoFormat(mime, width, height); - } - // Use some heuristics to set KEY_MAX_INPUT_SIZE (the size of the input buffers). // Taken from exoplayer: // https://github.com/google/ExoPlayer/blob/8595c65678a181296cdf673eacb93d8135479340/library/src/main/java/com/google/android/exoplayer/MediaCodecVideoTrackRenderer.java - private void maybeSetMaxInputSize(MediaFormat format) { + private static void maybeSetMaxInputSize(MediaFormat format, boolean allowAdaptivePlayback) { if (format.containsKey(android.media.MediaFormat.KEY_MAX_INPUT_SIZE)) { // Already set. The source of the format may know better, so do nothing. return; } int maxHeight = format.getInteger(MediaFormat.KEY_HEIGHT); - if (mAdaptivePlaybackSupported && format.containsKey(MediaFormat.KEY_MAX_HEIGHT)) { + if (allowAdaptivePlayback && format.containsKey(MediaFormat.KEY_MAX_HEIGHT)) { maxHeight = Math.max(maxHeight, format.getInteger(MediaFormat.KEY_MAX_HEIGHT)); } int maxWidth = format.getInteger(MediaFormat.KEY_WIDTH); - if (mAdaptivePlaybackSupported && format.containsKey(MediaFormat.KEY_MAX_WIDTH)) { + if (allowAdaptivePlayback && format.containsKey(MediaFormat.KEY_MAX_WIDTH)) { maxWidth = Math.max(maxHeight, format.getInteger(MediaFormat.KEY_MAX_WIDTH)); } int maxPixels; @@ -615,148 +562,6 @@ format.setInteger(MediaFormat.KEY_MAX_INPUT_SIZE, maxInputSize); } - @CalledByNative - private MediaFormat createVideoEncoderFormat(String mime, int width, int height, int bitRate, - int frameRate, int iFrameInterval, int colorFormat) { - if (mBitrateAdjustmentType == BitrateAdjustmentTypes.FRAMERATE_ADJUSTMENT) { - frameRate = BITRATE_ADJUSTMENT_FPS; - } else { - frameRate = Math.min(frameRate, MAXIMUM_INITIAL_FPS); - } - - MediaFormat format = MediaFormat.createVideoFormat(mime, width, height); - format.setInteger(MediaFormat.KEY_BIT_RATE, bitRate); - format.setInteger(MediaFormat.KEY_FRAME_RATE, frameRate); - format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, iFrameInterval); - format.setInteger(MediaFormat.KEY_COLOR_FORMAT, colorFormat); - Log.d(TAG, "video encoder format: " + format); - return format; - } - - @CalledByNative - private boolean isAdaptivePlaybackSupported() { - // If media codec has adaptive playback supported, then the max sizes - // used during creation are only hints. - return mAdaptivePlaybackSupported; - } - - @CalledByNative - private static void setCodecSpecificData(MediaFormat format, int index, byte[] bytes) { - // Codec Specific Data is set in the MediaFormat as ByteBuffer entries with keys csd-0, - // csd-1, and so on. See: http://developer.android.com/reference/android/media/MediaCodec.html - // for details. - String name; - switch (index) { - case 0: - name = "csd-0"; - break; - case 1: - name = "csd-1"; - break; - case 2: - name = "csd-2"; - break; - default: - name = null; - break; - } - if (name != null) { - format.setByteBuffer(name, ByteBuffer.wrap(bytes)); - } - } - - // TODO(sandv): Use color space matrix when android has support for it. - @TargetApi(Build.VERSION_CODES.N) - @CalledByNative - private static void setColorSpace(MediaFormat format, final int primaries, final int transfer, - final int matrix, final int range) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { - Log.e(TAG, "HDR is not support before Android N"); - return; - } - - // media/base/video_color_space.h - - int colorStandard = -1; - switch (primaries) { - case 1: - colorStandard = MediaFormat.COLOR_STANDARD_BT709; - break; - case 4: // BT.470M. - case 5: // BT.470BG. - case 6: // SMPTE 170M. - case 7: // SMPTE 240M. - colorStandard = MediaFormat.COLOR_STANDARD_BT601_NTSC; - break; - case 9: - colorStandard = MediaFormat.COLOR_STANDARD_BT2020; - break; - } - if (colorStandard != -1) format.setInteger(MediaFormat.KEY_COLOR_STANDARD, colorStandard); - - int colorTransfer = -1; - switch (transfer) { - case 1: // BT.709. - case 6: // SMPTE 170M. - case 7: // SMPTE 240M. - colorTransfer = MediaFormat.COLOR_TRANSFER_SDR_VIDEO; - break; - case 8: - colorTransfer = MediaFormat.COLOR_TRANSFER_LINEAR; - break; - case 16: - colorTransfer = MediaFormat.COLOR_TRANSFER_ST2084; - break; - case 18: - colorTransfer = MediaFormat.COLOR_TRANSFER_HLG; - break; - } - if (colorTransfer != -1) format.setInteger(MediaFormat.KEY_COLOR_TRANSFER, colorTransfer); - - int colorRange = -1; - switch (range) { - case 1: - colorRange = MediaFormat.COLOR_RANGE_LIMITED; - break; - case 2: - colorRange = MediaFormat.COLOR_RANGE_FULL; - break; - } - if (colorRange != -1) format.setInteger(MediaFormat.KEY_COLOR_RANGE, colorRange); - } - - @TargetApi(Build.VERSION_CODES.N) - @CalledByNative - private static void setHdrMatadata(MediaFormat format, float primaryRChromaticityX, - float primaryRChromaticityY, float primaryGChromaticityX, float primaryGChromaticityY, - float primaryBChromaticityX, float primaryBChromaticityY, float whitePointChromaticityX, - float whitePointChromaticityY, float maxMasteringLuminance, float minMasteringLuminance, - int maxContentLuminance, int maxFrameAverageLuminance) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { - Log.e(TAG, "HDR not support before Android N"); - return; - } - - ByteBuffer hdrStaticInfo = ByteBuffer.wrap(new byte[25]); - hdrStaticInfo.order(ByteOrder.LITTLE_ENDIAN); - hdrStaticInfo.put((byte) 0); // Type. - hdrStaticInfo.putShort((short) ((primaryRChromaticityX * MAX_CHROMATICITY) + 0.5f)); - hdrStaticInfo.putShort((short) ((primaryRChromaticityY * MAX_CHROMATICITY) + 0.5f)); - hdrStaticInfo.putShort((short) ((primaryGChromaticityX * MAX_CHROMATICITY) + 0.5f)); - hdrStaticInfo.putShort((short) ((primaryGChromaticityY * MAX_CHROMATICITY) + 0.5f)); - hdrStaticInfo.putShort((short) ((primaryBChromaticityX * MAX_CHROMATICITY) + 0.5f)); - hdrStaticInfo.putShort((short) ((primaryBChromaticityY * MAX_CHROMATICITY) + 0.5f)); - hdrStaticInfo.putShort((short) ((whitePointChromaticityX * MAX_CHROMATICITY) + 0.5f)); - hdrStaticInfo.putShort((short) ((whitePointChromaticityY * MAX_CHROMATICITY) + 0.5f)); - hdrStaticInfo.putShort((short) (maxMasteringLuminance + 0.5f)); - hdrStaticInfo.putShort((short) (minMasteringLuminance + 0.5f)); - hdrStaticInfo.putShort((short) maxContentLuminance); - hdrStaticInfo.putShort((short) maxFrameAverageLuminance); - - hdrStaticInfo.rewind(); - format.setByteBuffer(MediaFormat.KEY_HDR_STATIC_INFO, hdrStaticInfo); - } - @TargetApi(Build.VERSION_CODES.M) @CalledByNative private boolean setSurface(Surface surface) { @@ -769,13 +574,7 @@ return true; } - @CalledByNative - private static void setFrameHasADTSHeader(MediaFormat format) { - format.setInteger(MediaFormat.KEY_IS_ADTS, 1); - } - - @CalledByNative - private boolean configureAudio(MediaFormat format, MediaCrypto crypto, int flags) { + boolean configureAudio(MediaFormat format, MediaCrypto crypto, int flags) { try { mMediaCodec.configure(format, null, crypto, flags); return true;
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecBridgeBuilder.java b/media/base/android/java/src/org/chromium/media/MediaCodecBridgeBuilder.java new file mode 100644 index 0000000..8e995a3e2 --- /dev/null +++ b/media/base/android/java/src/org/chromium/media/MediaCodecBridgeBuilder.java
@@ -0,0 +1,197 @@ +// Copyright 2017 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.media; + +import android.media.MediaCodec; +import android.media.MediaCrypto; +import android.media.MediaFormat; +import android.view.Surface; + +import org.chromium.base.Log; +import org.chromium.base.annotations.CalledByNative; +import org.chromium.base.annotations.JNINamespace; +import org.chromium.media.MediaCodecUtil.BitrateAdjustmentTypes; +import org.chromium.media.MediaCodecUtil.CodecCreationInfo; +import org.chromium.media.MediaCodecUtil.MimeTypes; + +import java.nio.ByteBuffer; + +@JNINamespace("media") +class MediaCodecBridgeBuilder { + private static final String TAG = "cr_MediaCodecBridge"; + + private static MediaFormat createVideoDecoderFormat(String mime, int width, int height) { + return MediaFormat.createVideoFormat(mime, width, height); + } + + private static void setCodecSpecificData(MediaFormat format, int index, byte[] bytes) { + // Codec Specific Data is set in the MediaFormat as ByteBuffer entries with keys csd-0, + // csd-1, and so on. See: + // http://developer.android.com/reference/android/media/MediaCodec.html for details. + String name; + switch (index) { + case 0: + name = "csd-0"; + break; + case 1: + name = "csd-1"; + break; + case 2: + name = "csd-2"; + break; + default: + name = null; + return; + } + if (name != null && bytes.length > 0) { + format.setByteBuffer(name, ByteBuffer.wrap(bytes)); + } + } + + @CalledByNative + static MediaCodecBridge createVideoDecoder(String mime, @CodecType int codecType, + MediaCrypto mediaCrypto, int width, int height, Surface surface, byte[] csd0, + byte[] csd1, HdrMetadata hdrMetadata, boolean allowAdaptivePlayback) { + CodecCreationInfo info = new CodecCreationInfo(); + try { + Log.i(TAG, "create MediaCodec video decoder, mime %s", mime); + info = MediaCodecUtil.createDecoder(mime, codecType, mediaCrypto); + } catch (Exception e) { + Log.e(TAG, "Failed to create MediaCodec video decoder: %s, codecType: %d", mime, + codecType, e); + } + + if (info.mediaCodec == null) return null; + + MediaCodecBridge bridge = new MediaCodecBridge(info.mediaCodec, info.bitrateAdjustmentType); + + MediaFormat format = createVideoDecoderFormat(mime, width, height); + if (format == null) return null; + + if (csd0.length > 0) { + setCodecSpecificData(format, 0, csd0); + } + + if (csd1.length > 0) { + setCodecSpecificData(format, 1, csd1); + } + + if (hdrMetadata != null) { + hdrMetadata.addMetadataToFormat(format); + } + + if (!bridge.configureVideo(format, surface, mediaCrypto, 0, + info.supportsAdaptivePlayback && allowAdaptivePlayback)) { + return null; + } + + if (!bridge.start()) { + bridge.release(); + return null; + } + return bridge; + } + + private static MediaFormat createVideoEncoderFormat(String mime, int width, int height, + int bitRate, int frameRate, int iFrameInterval, int colorFormat, + BitrateAdjustmentTypes bitrateAdjustmentType) { + if (bitrateAdjustmentType == BitrateAdjustmentTypes.FRAMERATE_ADJUSTMENT) { + frameRate = MediaCodecBridge.BITRATE_ADJUSTMENT_FPS; + } else { + frameRate = Math.min(frameRate, MediaCodecBridge.MAXIMUM_INITIAL_FPS); + } + + MediaFormat format = MediaFormat.createVideoFormat(mime, width, height); + format.setInteger(MediaFormat.KEY_BIT_RATE, bitRate); + format.setInteger(MediaFormat.KEY_FRAME_RATE, frameRate); + format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, iFrameInterval); + format.setInteger(MediaFormat.KEY_COLOR_FORMAT, colorFormat); + Log.d(TAG, "video encoder format: " + format); + return format; + } + + @CalledByNative + static MediaCodecBridge createVideoEncoder(String mime, int width, int height, int bitRate, + int frameRate, int iFrameInterval, int colorFormat) { + CodecCreationInfo info = new CodecCreationInfo(); + try { + Log.i(TAG, "create MediaCodec video encoder, mime %s", mime); + info = MediaCodecUtil.createEncoder(mime); + } catch (Exception e) { + Log.e(TAG, "Failed to create MediaCodec video encoder: %s", mime, e); + } + + if (info.mediaCodec == null) return null; + + // Create MediaCodecEncoder for H264 to meet WebRTC requirements to IDR/keyframes. + // See https://crbug.com/761336 for more details. + MediaCodecBridge bridge; + if (mime.equals(MimeTypes.VIDEO_H264)) { + bridge = new MediaCodecEncoder(info.mediaCodec, info.bitrateAdjustmentType); + } else { + bridge = new MediaCodecBridge(info.mediaCodec, info.bitrateAdjustmentType); + } + + MediaFormat format = createVideoEncoderFormat(mime, width, height, bitRate, frameRate, + iFrameInterval, colorFormat, info.bitrateAdjustmentType); + + if (!bridge.configureVideo(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE, + info.supportsAdaptivePlayback)) { + return null; + } + + if (!bridge.start()) { + bridge.release(); + return null; + } + return bridge; + } + + private static MediaFormat createAudioFormat(String mime, int sampleRate, int channelCount) { + return MediaFormat.createAudioFormat(mime, sampleRate, channelCount); + } + + @CalledByNative + static MediaCodecBridge createAudioDecoder(String mime, MediaCrypto mediaCrypto, int sampleRate, + int channelCount, byte[] csd0, byte[] csd1, byte[] csd2, boolean frameHasAdtsHeader) { + CodecCreationInfo info = new CodecCreationInfo(); + try { + Log.i(TAG, "create MediaCodec audio decoder, mime %s", mime); + info = MediaCodecUtil.createDecoder(mime, CodecType.ANY, mediaCrypto); + } catch (Exception e) { + Log.e(TAG, "Failed to create MediaCodec audio decoder: %s", mime, e); + } + + if (info.mediaCodec == null) return null; + + MediaCodecBridge bridge = new MediaCodecBridge(info.mediaCodec, info.bitrateAdjustmentType); + + MediaFormat format = createAudioFormat(mime, sampleRate, channelCount); + + if (csd0.length > 0) { + setCodecSpecificData(format, 0, csd0); + } + + if (csd1.length > 0) { + setCodecSpecificData(format, 1, csd1); + } + + if (csd2.length > 0) { + setCodecSpecificData(format, 2, csd2); + } + + if (frameHasAdtsHeader) { + format.setInteger(MediaFormat.KEY_IS_ADTS, 1); + } + + if (!bridge.configureAudio(format, mediaCrypto, 0)) return null; + + if (!bridge.start()) { + bridge.release(); + return null; + } + return bridge; + } +}
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecEncoder.java b/media/base/android/java/src/org/chromium/media/MediaCodecEncoder.java index ac093ff..26b31a6 100644 --- a/media/base/android/java/src/org/chromium/media/MediaCodecEncoder.java +++ b/media/base/android/java/src/org/chromium/media/MediaCodecEncoder.java
@@ -29,9 +29,9 @@ // SPS and PPS NALs (Config frame). private ByteBuffer mConfigData = null; - protected MediaCodecEncoder(MediaCodec mediaCodec, String mime, - boolean adaptivePlaybackSupported, BitrateAdjustmentTypes bitrateAdjustmentType) { - super(mediaCodec, mime, adaptivePlaybackSupported, bitrateAdjustmentType); + protected MediaCodecEncoder( + MediaCodec mediaCodec, BitrateAdjustmentTypes bitrateAdjustmentType) { + super(mediaCodec, bitrateAdjustmentType); } @Override
diff --git a/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java b/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java index 645df16..b6340dea 100644 --- a/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java +++ b/media/base/android/java/src/org/chromium/media/MediaCodecUtil.java
@@ -290,7 +290,8 @@ * @param mediaCrypto Crypto of the media. * @return CodecCreationInfo object */ - static CodecCreationInfo createDecoder(String mime, int codecType, MediaCrypto mediaCrypto) { + static CodecCreationInfo createDecoder( + String mime, @CodecType int codecType, MediaCrypto mediaCrypto) { // Always return a valid CodecCreationInfo, its |mediaCodec| field will be null // if we cannot create the codec.
diff --git a/media/base/android/jni_hdr_metadata.cc b/media/base/android/jni_hdr_metadata.cc new file mode 100644 index 0000000..6b9e7e8 --- /dev/null +++ b/media/base/android/jni_hdr_metadata.cc
@@ -0,0 +1,115 @@ +// Copyright 2017 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 "media/base/android/jni_hdr_metadata.h" + +#include "jni/HdrMetadata_jni.h" +#include "media/base/hdr_metadata.h" +#include "media/base/video_color_space.h" + +namespace media { + +JniHdrMetadata::JniHdrMetadata(const VideoColorSpace& color_space, + const HDRMetadata& hdr_metadata) + : color_space_(color_space), hdr_metadata_(hdr_metadata) { + JNIEnv* env = base::android::AttachCurrentThread(); + jobject_ = Java_HdrMetadata_create(env, reinterpret_cast<jlong>(this)); + base::android::CheckException(env); +} + +JniHdrMetadata::~JniHdrMetadata() { + JNIEnv* env = base::android::AttachCurrentThread(); + Java_HdrMetadata_close(env, obj()); +} + +jint JniHdrMetadata::Primaries( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return static_cast<int>(color_space_.primaries); +} + +jint JniHdrMetadata::ColorTransfer( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return static_cast<int>(color_space_.transfer); +} + +jint JniHdrMetadata::Range(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return static_cast<int>(color_space_.range); +} + +jfloat JniHdrMetadata::PrimaryRChromaticityX( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.primary_r.x(); +} + +jfloat JniHdrMetadata::PrimaryRChromaticityY( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.primary_r.y(); +} + +jfloat JniHdrMetadata::PrimaryGChromaticityX( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.primary_g.x(); +} + +jfloat JniHdrMetadata::PrimaryGChromaticityY( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.primary_g.y(); +} + +jfloat JniHdrMetadata::PrimaryBChromaticityX( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.primary_b.x(); +} + +jfloat JniHdrMetadata::PrimaryBChromaticityY( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.primary_b.y(); +} + +jfloat JniHdrMetadata::WhitePointChromaticityX( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.white_point.x(); +} + +jfloat JniHdrMetadata::WhitePointChromaticityY( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.white_point.y(); +} + +jfloat JniHdrMetadata::MaxMasteringLuminance( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.luminance_max; +} + +jfloat JniHdrMetadata::MinMasteringLuminance( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.mastering_metadata.luminance_min; +} + +jint JniHdrMetadata::MaxContentLuminance( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.max_content_light_level; +} + +jint JniHdrMetadata::MaxFrameAverageLuminance( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj) { + return hdr_metadata_.max_frame_average_light_level; +} + +} // namespace media
diff --git a/media/base/android/jni_hdr_metadata.h b/media/base/android/jni_hdr_metadata.h new file mode 100644 index 0000000..888e920 --- /dev/null +++ b/media/base/android/jni_hdr_metadata.h
@@ -0,0 +1,69 @@ +// Copyright 2017 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 MEDIA_BASE_ANDROID_JNI_HDR_METADATA_H_ +#define MEDIA_BASE_ANDROID_JNI_HDR_METADATA_H_ + +#include "base/android/jni_android.h" +#include "base/macros.h" + +namespace media { + +struct HDRMetadata; +class VideoColorSpace; + +class JniHdrMetadata { + public: + JniHdrMetadata(const VideoColorSpace& color_space, + const HDRMetadata& hdr_metadata); + ~JniHdrMetadata(); + + base::android::ScopedJavaLocalRef<jobject> obj() { return jobject_; } + + // Java HdrMetadata implementation. + + jint Primaries(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); + jint ColorTransfer(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jint Range(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); + + jfloat PrimaryRChromaticityX(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat PrimaryRChromaticityY(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat PrimaryGChromaticityX(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat PrimaryGChromaticityY(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat PrimaryBChromaticityX(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat PrimaryBChromaticityY(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat WhitePointChromaticityX( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat WhitePointChromaticityY( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat MaxMasteringLuminance(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jfloat MinMasteringLuminance(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jint MaxContentLuminance(JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + jint MaxFrameAverageLuminance( + JNIEnv* env, + const base::android::JavaParamRef<jobject>& obj); + + private: + const VideoColorSpace& color_space_; + const HDRMetadata& hdr_metadata_; + base::android::ScopedJavaLocalRef<jobject> jobject_; + + DISALLOW_COPY_AND_ASSIGN(JniHdrMetadata); +}; + +} // namespace media + +#endif // MEDIA_BASE_ANDROID_JNI_HDR_METADATA_H_
diff --git a/media/base/android/media_codec_bridge.h b/media/base/android/media_codec_bridge.h index 5ac9d8ac..96a0ee6 100644 --- a/media/base/android/media_codec_bridge.h +++ b/media/base/android/media_codec_bridge.h
@@ -150,9 +150,6 @@ // Requests that the video encoder insert a key frame. virtual void RequestKeyFrameSoon() = 0; - // Returns whether the codec is configured for adaptive playback. - virtual bool IsAdaptivePlaybackSupported() = 0; - DISALLOW_COPY_AND_ASSIGN(MediaCodecBridge); };
diff --git a/media/base/android/media_codec_bridge_impl.cc b/media/base/android/media_codec_bridge_impl.cc index a7d0f56..d93355a 100644 --- a/media/base/android/media_codec_bridge_impl.cc +++ b/media/base/android/media_codec_bridge_impl.cc
@@ -17,7 +17,9 @@ #include "base/memory/ptr_util.h" #include "base/numerics/safe_conversions.h" #include "base/strings/string_util.h" +#include "jni/MediaCodecBridgeBuilder_jni.h" #include "jni/MediaCodecBridge_jni.h" +#include "media/base/android/jni_hdr_metadata.h" #include "media/base/android/media_codec_util.h" #include "media/base/audio_codecs.h" #include "media/base/bit_reader.h" @@ -29,7 +31,9 @@ using base::android::ConvertUTF8ToJavaString; using base::android::JavaIntArrayToIntVector; using base::android::JavaRef; +using base::android::ScopedJavaGlobalRef; using base::android::ScopedJavaLocalRef; +using base::android::ToJavaByteArray; #define RETURN_ON_ERROR(condition) \ do { \ @@ -48,17 +52,22 @@ kConfigureFlagEncode = 1, // CONFIGURE_FLAG_ENCODE }; -// Parses |extra_data| and sets the appropriate fields of the given MediaFormat. -bool ConfigureMediaFormatForAudio(const JavaRef<jobject>& j_format, - AudioCodec codec, +using CodecSpecificData = std::vector<uint8_t>; + +// Parses |extra_data| to get info to be added to a Java MediaFormat. +bool GetCodecSpecificDataForAudio(AudioCodec codec, const uint8_t* extra_data, size_t extra_data_size, int64_t codec_delay_ns, - int64_t seek_preroll_ns) { + int64_t seek_preroll_ns, + CodecSpecificData* output_csd0, + CodecSpecificData* output_csd1, + CodecSpecificData* output_csd2, + bool* output_frame_has_adts_header) { + *output_frame_has_adts_header = false; if (extra_data_size == 0 && codec != kCodecOpus) return true; - JNIEnv* env = AttachCurrentThread(); switch (codec) { case kCodecVorbis: { if (extra_data[0] != 2) { @@ -92,16 +101,13 @@ } } current_pos++; - // The first header is identification header. - ScopedJavaLocalRef<jbyteArray> first_header = - base::android::ToJavaByteArray(env, current_pos, header_length[0]); - Java_MediaCodecBridge_setCodecSpecificData(env, j_format, 0, - first_header); - // The last header is codec header. - ScopedJavaLocalRef<jbyteArray> last_header = - base::android::ToJavaByteArray(env, extra_data + total_length, - extra_data_size - total_length); - Java_MediaCodecBridge_setCodecSpecificData(env, j_format, 1, last_header); + + // The first header is the identification header. + output_csd0->assign(current_pos, current_pos + header_length[0]); + + // The last header is the codec header. + output_csd1->assign(extra_data + total_length, + extra_data + extra_data_size - total_length); break; } case kCodecAAC: { @@ -133,17 +139,10 @@ return false; } - const size_t kCsdLength = 2; - uint8_t csd[kCsdLength]; - csd[0] = profile << 3 | frequency_index >> 1; - csd[1] = (frequency_index & 0x01) << 7 | channel_config << 3; - ScopedJavaLocalRef<jbyteArray> byte_array = - base::android::ToJavaByteArray(env, csd, kCsdLength); - Java_MediaCodecBridge_setCodecSpecificData(env, j_format, 0, byte_array); - - // TODO(qinmin): pass an extra variable to this function to determine - // whether we need to call this. - Java_MediaCodecBridge_setFrameHasADTSHeader(env, j_format); + output_csd0->push_back(profile << 3 | frequency_index >> 1); + output_csd0->push_back((frequency_index & 0x01) << 7 | channel_config + << 3); + *output_frame_has_adts_header = true; break; } case kCodecOpus: { @@ -154,21 +153,19 @@ } // csd0 - Opus Header - ScopedJavaLocalRef<jbyteArray> csd0 = - base::android::ToJavaByteArray(env, extra_data, extra_data_size); - Java_MediaCodecBridge_setCodecSpecificData(env, j_format, 0, csd0); + output_csd0->assign(extra_data, extra_data + extra_data_size); // csd1 - Codec Delay - ScopedJavaLocalRef<jbyteArray> csd1 = base::android::ToJavaByteArray( - env, reinterpret_cast<const uint8_t*>(&codec_delay_ns), - sizeof(int64_t)); - Java_MediaCodecBridge_setCodecSpecificData(env, j_format, 1, csd1); + const uint8_t* codec_delay_ns_ptr = + reinterpret_cast<const uint8_t*>(&codec_delay_ns); + output_csd1->assign(codec_delay_ns_ptr, + codec_delay_ns_ptr + sizeof(int64_t)); // csd2 - Seek Preroll - ScopedJavaLocalRef<jbyteArray> csd2 = base::android::ToJavaByteArray( - env, reinterpret_cast<const uint8_t*>(&seek_preroll_ns), - sizeof(int64_t)); - Java_MediaCodecBridge_setCodecSpecificData(env, j_format, 2, csd2); + const uint8_t* seek_preroll_ns_ptr = + reinterpret_cast<const uint8_t*>(&seek_preroll_ns); + output_csd2->assign(seek_preroll_ns_ptr, + seek_preroll_ns_ptr + sizeof(int64_t)); break; } default: @@ -196,19 +193,11 @@ if (mime.empty()) return nullptr; - auto bridge = base::WrapUnique(new MediaCodecBridgeImpl( - mime, CodecType::kAny, MediaCodecDirection::DECODER, media_crypto)); - if (bridge->j_bridge_.is_null()) - return nullptr; - JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jstring> j_mime = ConvertUTF8ToJavaString(env, mime); const int channel_count = ChannelLayoutToChannelCount(config.channel_layout()); - ScopedJavaLocalRef<jobject> j_format(Java_MediaCodecBridge_createAudioFormat( - env, j_mime, config.samples_per_second(), channel_count)); - DCHECK(!j_format.is_null()); // It's important that the multiplication is first in this calculation to // reduce the precision loss due to integer truncation. @@ -217,18 +206,29 @@ config.samples_per_second(); const int64_t seek_preroll_ns = config.seek_preroll().InMicroseconds() * base::Time::kNanosecondsPerMicrosecond; - if (!ConfigureMediaFormatForAudio( - j_format, config.codec(), config.extra_data().data(), - config.extra_data().size(), codec_delay_ns, seek_preroll_ns)) { + + CodecSpecificData csd0, csd1, csd2; + bool output_frame_has_adts_header; + if (!GetCodecSpecificDataForAudio(config.codec(), config.extra_data().data(), + config.extra_data().size(), codec_delay_ns, + seek_preroll_ns, &csd0, &csd1, &csd2, + &output_frame_has_adts_header)) { return nullptr; } - if (!Java_MediaCodecBridge_configureAudio(env, bridge->j_bridge_, j_format, - media_crypto, 0)) { - return nullptr; - } + ScopedJavaLocalRef<jbyteArray> j_csd0 = ToJavaByteArray(env, csd0); + ScopedJavaLocalRef<jbyteArray> j_csd1 = ToJavaByteArray(env, csd1); + ScopedJavaLocalRef<jbyteArray> j_csd2 = ToJavaByteArray(env, csd2); - return bridge->Start() ? std::move(bridge) : nullptr; + ScopedJavaGlobalRef<jobject> j_bridge( + Java_MediaCodecBridgeBuilder_createAudioDecoder( + env, j_mime, media_crypto, config.samples_per_second(), channel_count, + j_csd0, j_csd1, j_csd2, output_frame_has_adts_header)); + + if (j_bridge.is_null()) + return nullptr; + + return base::WrapUnique(new MediaCodecBridgeImpl(std::move(j_bridge))); } // static @@ -238,8 +238,8 @@ const gfx::Size& size, const JavaRef<jobject>& surface, const JavaRef<jobject>& media_crypto, - const std::vector<uint8_t>& csd0, - const std::vector<uint8_t>& csd1, + const CodecSpecificData& csd0, + const CodecSpecificData& csd1, const VideoColorSpace& color_space, const base::Optional<HDRMetadata>& hdr_metadata, bool allow_adaptive_playback) { @@ -250,57 +250,31 @@ if (mime.empty()) return nullptr; - std::unique_ptr<MediaCodecBridgeImpl> bridge(new MediaCodecBridgeImpl( - mime, codec_type, MediaCodecDirection::DECODER, media_crypto)); - if (bridge->j_bridge_.is_null()) - return nullptr; - JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jstring> j_mime = ConvertUTF8ToJavaString(env, mime); - ScopedJavaLocalRef<jobject> j_format( - Java_MediaCodecBridge_createVideoDecoderFormat(env, j_mime, size.width(), - size.height())); - DCHECK(!j_format.is_null()); - if (!csd0.empty()) { - ScopedJavaLocalRef<jbyteArray> j_csd0 = - base::android::ToJavaByteArray(env, csd0.data(), csd0.size()); - Java_MediaCodecBridge_setCodecSpecificData(env, j_format, 0, j_csd0); + ScopedJavaLocalRef<jbyteArray> j_csd0 = + ToJavaByteArray(env, csd0.data(), csd0.size()); + ScopedJavaLocalRef<jbyteArray> j_csd1 = + ToJavaByteArray(env, csd1.data(), csd1.size()); + + std::unique_ptr<JniHdrMetadata> jni_hdr_metadata; + if (hdr_metadata.has_value()) { + jni_hdr_metadata.reset( + new JniHdrMetadata(color_space, hdr_metadata.value())); } + ScopedJavaLocalRef<jobject> j_hdr_metadata( + jni_hdr_metadata ? jni_hdr_metadata->obj() : nullptr); - if (!csd1.empty()) { - ScopedJavaLocalRef<jbyteArray> j_csd1 = - base::android::ToJavaByteArray(env, csd1.data(), csd1.size()); - Java_MediaCodecBridge_setCodecSpecificData(env, j_format, 1, j_csd1); - } - - if (hdr_metadata && hdr_metadata.has_value()) { - Java_MediaCodecBridge_setColorSpace(env, j_format, - static_cast<int>(color_space.primaries), - static_cast<int>(color_space.transfer), - static_cast<int>(color_space.matrix), - static_cast<int>(color_space.range)); - - const ::media::HDRMetadata& metadata = hdr_metadata.value(); - const ::media::MasteringMetadata& mastering_metadata = - metadata.mastering_metadata; - Java_MediaCodecBridge_setHdrMatadata( - env, j_format, mastering_metadata.primary_r.x(), - mastering_metadata.primary_r.y(), mastering_metadata.primary_g.x(), - mastering_metadata.primary_g.y(), mastering_metadata.primary_b.x(), - mastering_metadata.primary_b.y(), mastering_metadata.white_point.x(), - mastering_metadata.white_point.y(), mastering_metadata.luminance_max, - mastering_metadata.luminance_min, metadata.max_content_light_level, - metadata.max_frame_average_light_level); - } - - if (!Java_MediaCodecBridge_configureVideo(env, bridge->j_bridge_, j_format, - surface, media_crypto, 0, - allow_adaptive_playback)) { + ScopedJavaGlobalRef<jobject> j_bridge( + Java_MediaCodecBridgeBuilder_createVideoDecoder( + env, j_mime, static_cast<int>(codec_type), media_crypto, size.width(), + size.height(), surface, j_csd0, j_csd1, j_hdr_metadata, + allow_adaptive_playback)); + if (j_bridge.is_null()) return nullptr; - } - return bridge->Start() ? std::move(bridge) : nullptr; + return base::WrapUnique(new MediaCodecBridgeImpl(std::move(j_bridge))); } // static @@ -318,38 +292,23 @@ if (mime.empty()) return nullptr; - std::unique_ptr<MediaCodecBridgeImpl> bridge(new MediaCodecBridgeImpl( - mime, CodecType::kAny, MediaCodecDirection::ENCODER, nullptr)); - if (bridge->j_bridge_.is_null()) - return nullptr; - JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jstring> j_mime = ConvertUTF8ToJavaString(env, mime); - ScopedJavaLocalRef<jobject> j_format( - Java_MediaCodecBridge_createVideoEncoderFormat( - env, bridge->j_bridge_, j_mime, size.width(), size.height(), bit_rate, - frame_rate, i_frame_interval, color_format)); - DCHECK(!j_format.is_null()); - if (!Java_MediaCodecBridge_configureVideo(env, bridge->j_bridge_, j_format, - nullptr, nullptr, - kConfigureFlagEncode, true)) { - return nullptr; - } + ScopedJavaGlobalRef<jobject> j_bridge( + Java_MediaCodecBridgeBuilder_createVideoEncoder( + env, j_mime, size.width(), size.height(), bit_rate, frame_rate, + i_frame_interval, color_format)); - return bridge->Start() ? std::move(bridge) : nullptr; + if (j_bridge.is_null()) + return nullptr; + + return base::WrapUnique(new MediaCodecBridgeImpl(std::move(j_bridge))); } MediaCodecBridgeImpl::MediaCodecBridgeImpl( - const std::string& mime, - CodecType codec_type, - MediaCodecDirection direction, - const JavaRef<jobject>& media_crypto) { - JNIEnv* env = AttachCurrentThread(); - DCHECK(!mime.empty()); - ScopedJavaLocalRef<jstring> j_mime = ConvertUTF8ToJavaString(env, mime); - j_bridge_.Reset( - Java_MediaCodecBridge_create(env, j_mime, static_cast<int>(codec_type), - static_cast<int>(direction), media_crypto)); + ScopedJavaGlobalRef<jobject> j_bridge) + : j_bridge_(std::move(j_bridge)) { + DCHECK(!j_bridge_.is_null()); } MediaCodecBridgeImpl::~MediaCodecBridgeImpl() { @@ -358,11 +317,6 @@ Java_MediaCodecBridge_release(env, j_bridge_); } -bool MediaCodecBridgeImpl::Start() { - JNIEnv* env = AttachCurrentThread(); - return Java_MediaCodecBridge_start(env, j_bridge_); -} - void MediaCodecBridgeImpl::Stop() { JNIEnv* env = AttachCurrentThread(); Java_MediaCodecBridge_stop(env, j_bridge_); @@ -447,9 +401,9 @@ return MEDIA_CODEC_ERROR; JNIEnv* env = AttachCurrentThread(); - ScopedJavaLocalRef<jbyteArray> j_key_id = base::android::ToJavaByteArray( + ScopedJavaLocalRef<jbyteArray> j_key_id = ToJavaByteArray( env, reinterpret_cast<const uint8_t*>(key_id.data()), key_id.size()); - ScopedJavaLocalRef<jbyteArray> j_iv = base::android::ToJavaByteArray( + ScopedJavaLocalRef<jbyteArray> j_iv = ToJavaByteArray( env, reinterpret_cast<const uint8_t*>(iv.data()), iv.size()); // The MediaCodec.CryptoInfo documentation says to pass NULL for |clear_array| @@ -625,11 +579,6 @@ Java_MediaCodecBridge_requestKeyFrameSoon(env, j_bridge_); } -bool MediaCodecBridgeImpl::IsAdaptivePlaybackSupported() { - JNIEnv* env = AttachCurrentThread(); - return Java_MediaCodecBridge_isAdaptivePlaybackSupported(env, j_bridge_); -} - bool MediaCodecBridgeImpl::FillInputBuffer(int index, const uint8_t* data, size_t size) {
diff --git a/media/base/android/media_codec_bridge_impl.h b/media/base/android/media_codec_bridge_impl.h index 88a6fa17..9f7c8c5 100644 --- a/media/base/android/media_codec_bridge_impl.h +++ b/media/base/android/media_codec_bridge_impl.h
@@ -106,16 +106,9 @@ bool SetSurface(const base::android::JavaRef<jobject>& surface) override; void SetVideoBitrate(int bps, int frame_rate) override; void RequestKeyFrameSoon() override; - bool IsAdaptivePlaybackSupported() override; private: - MediaCodecBridgeImpl(const std::string& mime, - CodecType codec_type, - MediaCodecDirection direction, - const base::android::JavaRef<jobject>& media_crypto); - - // Calls MediaCodec#start(). Returns whether it was successful. - bool Start(); + MediaCodecBridgeImpl(base::android::ScopedJavaGlobalRef<jobject> j_bridge); // Fills the given input buffer. Returns false if |data_size| exceeds the // input buffer's capacity (and doesn't touch the input buffer in that case).
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc index f1dffad..1fa7c3d 100644 --- a/media/blink/webmediaplayer_impl.cc +++ b/media/blink/webmediaplayer_impl.cc
@@ -23,6 +23,7 @@ #include "base/single_thread_task_runner.h" #include "base/strings/string_number_conversions.h" #include "base/task_runner_util.h" +#include "base/task_scheduler/post_task.h" #include "base/threading/thread_task_runner_handle.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" @@ -336,10 +337,44 @@ vfc_task_runner_->DeleteSoon(FROM_HERE, std::move(compositor_)); + if (chunk_demuxer_) { + // Continue destruction of |chunk_demuxer_| on the |media_task_runner_| to + // avoid racing other pending tasks on |chunk_demuxer_| on that runner while + // not further blocking |main_task_runner_| to perform the destruction. + media_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&WebMediaPlayerImpl::DemuxerDestructionHelper, + media_task_runner_, std::move(demuxer_))); + } + media_log_->AddEvent( media_log_->CreateEvent(MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); } +// static +void WebMediaPlayerImpl::DemuxerDestructionHelper( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + std::unique_ptr<Demuxer> demuxer) { + DCHECK(task_runner->BelongsToCurrentThread()); + // ChunkDemuxer's streams may contain much buffered, compressed media that may + // need to be paged back in during destruction. Paging delay may exceed the + // renderer hang monitor's threshold on at least Windows while also blocking + // other work on the renderer main thread, so we do the actual destruction in + // the background without blocking WMPI destruction or |task_runner|. On + // advice of task_scheduler OWNERS, MayBlock() is not used because virtual + // memory overhead is not considered blocking I/O; and CONTINUE_ON_SHUTDOWN is + // used to allow process termination to not block on completing the task. + base::PostTaskWithTraits( + FROM_HERE, + {base::TaskPriority::BACKGROUND, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, + base::BindOnce( + [](std::unique_ptr<Demuxer> demuxer_to_destroy) { + SCOPED_UMA_HISTOGRAM_TIMER("Media.MSE.DemuxerDestructionTime"); + demuxer_to_destroy.reset(); + }, + std::move(demuxer))); +} + void WebMediaPlayerImpl::Load(LoadType load_type, const blink::WebMediaPlayerSource& source, CORSMode cors_mode) { @@ -1131,6 +1166,7 @@ format, type, level, premultiply_alpha, flip_y); } +// static void WebMediaPlayerImpl::ComputeFrameUploadMetadata( VideoFrame* frame, int already_uploaded_id, @@ -1386,8 +1422,10 @@ memory_pressure_level == base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL); - // base::Unretained is safe, since chunk_demuxer_ is actually owned by - // |this| via this->demuxer_. + // base::Unretained is safe, since |chunk_demuxer_| is actually owned by + // |this| via this->demuxer_. Note the destruction of |chunk_demuxer_| is done + // from ~WMPI by first hopping to |media_task_runner_| to prevent race with + // this task. media_task_runner_->PostTask( FROM_HERE, base::Bind(&ChunkDemuxer::OnMemoryPressure, base::Unretained(chunk_demuxer_),
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h index 607d5876..0ae21e2 100644 --- a/media/blink/webmediaplayer_impl.h +++ b/media/blink/webmediaplayer_impl.h
@@ -108,6 +108,15 @@ std::unique_ptr<WebMediaPlayerParams> params); ~WebMediaPlayerImpl() override; + // Destroys |demuxer| and records a UMA for the time taken to destroy it. + // |task_runner| is the expected runner on which this method is called, and is + // used as a parameter to ensure a scheduled task bound to this method is run + // (to prevent uncontrolled |demuxer| destruction if |task_runner| has no + // other references before such task is executed.) + static void DemuxerDestructionHelper( + scoped_refptr<base::SingleThreadTaskRunner> task_runner, + std::unique_ptr<Demuxer> demuxer); + // WebSurfaceLayerBridgeObserver implementation. void OnWebLayerUpdated() override; void RegisterContentsLayer(blink::WebLayer* web_layer) override;
diff --git a/media/capture/BUILD.gn b/media/capture/BUILD.gn index 0494eb3..6d54d386 100644 --- a/media/capture/BUILD.gn +++ b/media/capture/BUILD.gn
@@ -262,10 +262,12 @@ "content/capture_resolution_chooser_unittest.cc", "content/smooth_event_sampler_unittest.cc", "content/video_capture_oracle_unittest.cc", + "run_all_unittests.cc", "video/fake_video_capture_device_unittest.cc", "video/linux/camera_config_chromeos_unittest.cc", "video/linux/v4l2_capture_delegate_unittest.cc", "video/mac/video_capture_device_factory_mac_unittest.mm", + "video/shared_memory_handle_provider_unittest.cc", "video/video_capture_device_client_unittest.cc", "video/video_capture_device_unittest.cc", "video_capture_types_unittest.cc", @@ -274,7 +276,6 @@ deps = [ ":capture", ":test_support", - "//base/test:run_all_unittests", "//base/test:test_support", "//media:test_support", "//media/capture/mojo:image_capture",
diff --git a/media/capture/DEPS b/media/capture/DEPS new file mode 100644 index 0000000..d415fec5 --- /dev/null +++ b/media/capture/DEPS
@@ -0,0 +1,3 @@ +specific_include_rules = { + "run_all_unittests.cc": [ "+mojo/edk/embedder" ], +}
diff --git a/media/capture/run_all_unittests.cc b/media/capture/run_all_unittests.cc new file mode 100644 index 0000000..ccf0df3 --- /dev/null +++ b/media/capture/run_all_unittests.cc
@@ -0,0 +1,48 @@ +// Copyright 2018 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 <stdio.h> + +#include "base/bind.h" +#include "base/test/launcher/unit_test_launcher.h" +#include "base/test/test_suite.h" +#include "base/threading/thread.h" +#include "mojo/edk/embedder/embedder.h" +#include "mojo/edk/embedder/scoped_ipc_support.h" +#include "testing/gtest/include/gtest/gtest.h" + +class MojoEnabledTestEnvironment final : public testing::Environment { + public: + MojoEnabledTestEnvironment() : mojo_ipc_thread_("MojoIpcThread") {} + + ~MojoEnabledTestEnvironment() final = default; + + void SetUp() final { + mojo::edk::Init(); + mojo_ipc_thread_.StartWithOptions( + base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); + mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( + mojo_ipc_thread_.task_runner(), + mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST)); + VLOG(1) << "Mojo initialized"; + } + + void TearDown() final { + mojo_ipc_support_.reset(); + VLOG(1) << "Mojo IPC tear down"; + } + + private: + base::Thread mojo_ipc_thread_; + std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; +}; + +int main(int argc, char* argv[]) { + base::TestSuite test_suite(argc, argv); + testing::AddGlobalTestEnvironment(new MojoEnabledTestEnvironment()); + return base::LaunchUnitTests( + argc, argv, + base::BindRepeating(&base::TestSuite::Run, + base::Unretained(&test_suite))); +}
diff --git a/media/capture/video/DEPS b/media/capture/video/DEPS index 77681e1..1ddde61 100644 --- a/media/capture/video/DEPS +++ b/media/capture/video/DEPS
@@ -3,7 +3,3 @@ "+mojo/public/cpp", "+third_party/libyuv", ] - -specific_include_rules = { - "video_capture_device_unittest.cc": [ "+mojo/edk/embedder" ], -}
diff --git a/media/capture/video/shared_memory_handle_provider_unittest.cc b/media/capture/video/shared_memory_handle_provider_unittest.cc new file mode 100644 index 0000000..fffa0a8 --- /dev/null +++ b/media/capture/video/shared_memory_handle_provider_unittest.cc
@@ -0,0 +1,70 @@ +// Copyright (c) 2017 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 "media/capture/video/shared_memory_handle_provider.h" + +#include <stddef.h> +#include <stdint.h> + +#include <memory> +#include <utility> + +#include "base/memory/shared_memory.h" +#include "mojo/public/cpp/system/buffer.h" +#include "mojo/public/cpp/system/platform_handle.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace media { + +namespace { + +const size_t kMemorySize = 1024; + +} // anonymous namespace + +class SharedMemoryHandleProviderTest : public ::testing::Test { + public: + SharedMemoryHandleProviderTest() = default; + ~SharedMemoryHandleProviderTest() override = default; + + void UnwrapAndVerifyMojoHandle(mojo::ScopedSharedBufferHandle buffer_handle, + size_t expected_size, + bool expected_read_only_flag) { + base::SharedMemoryHandle memory_handle; + size_t memory_size = 0; + bool read_only_flag = false; + const MojoResult result = + mojo::UnwrapSharedMemoryHandle(std::move(buffer_handle), &memory_handle, + &memory_size, &read_only_flag); + EXPECT_EQ(MOJO_RESULT_OK, result); + EXPECT_EQ(expected_size, memory_size); + EXPECT_EQ(expected_read_only_flag, read_only_flag); + } + + protected: + SharedMemoryHandleProvider handle_provider_; + + private: + DISALLOW_COPY_AND_ASSIGN(SharedMemoryHandleProviderTest); +}; + +TEST_F(SharedMemoryHandleProviderTest, + VerifyInterProcessTransitHandleForReadOnly) { + handle_provider_.InitForSize(kMemorySize); + + auto mojo_handle = + handle_provider_.GetHandleForInterProcessTransit(true /* read_only */); + UnwrapAndVerifyMojoHandle(std::move(mojo_handle), kMemorySize, true); +} + +TEST_F(SharedMemoryHandleProviderTest, + VerifyInterProcessTransitHandleForReadWrite) { + handle_provider_.InitForSize(kMemorySize); + + auto mojo_handle = + handle_provider_.GetHandleForInterProcessTransit(false /* read_only */); + UnwrapAndVerifyMojoHandle(std::move(mojo_handle), kMemorySize, false); +} + +}; // namespace media
diff --git a/media/capture/video/video_capture_device_unittest.cc b/media/capture/video/video_capture_device_unittest.cc index c9d9cf4..b2af0ba 100644 --- a/media/capture/video/video_capture_device_unittest.cc +++ b/media/capture/video/video_capture_device_unittest.cc
@@ -51,8 +51,6 @@ #include "media/capture/video/chromeos/local_gpu_memory_buffer_manager.h" #include "media/capture/video/chromeos/video_capture_device_arc_chromeos.h" #include "media/capture/video/chromeos/video_capture_device_factory_chromeos.h" -#include "mojo/edk/embedder/embedder.h" -#include "mojo/edk/embedder/scoped_ipc_support.h" #endif #if defined(OS_MACOSX) @@ -226,39 +224,6 @@ mojom::PhotoStatePtr state_; }; -#if defined(OS_CHROMEOS) - -class MojoEnabledTestEnvironment final : public testing::Environment { - public: - MojoEnabledTestEnvironment() : mojo_ipc_thread_("MojoIpcThread") {} - - ~MojoEnabledTestEnvironment() final = default; - - void SetUp() final { - mojo::edk::Init(); - mojo_ipc_thread_.StartWithOptions( - base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); - mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( - mojo_ipc_thread_.task_runner(), - mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST)); - VLOG(1) << "Mojo initialized"; - } - - void TearDown() final { - mojo_ipc_support_.reset(); - VLOG(1) << "Mojo IPC tear down"; - } - - private: - base::Thread mojo_ipc_thread_; - std::unique_ptr<mojo::edk::ScopedIPCSupport> mojo_ipc_support_; -}; - -testing::Environment* const mojo_test_env = - testing::AddGlobalTestEnvironment(new MojoEnabledTestEnvironment()); - -#endif - } // namespace class VideoCaptureDeviceTest : public testing::TestWithParam<gfx::Size> { @@ -336,9 +301,17 @@ DLOG(WARNING) << "No camera found"; return nullptr; } +#if defined(OS_WIN) + // Dump the camera model to help debugging. + // TODO(alaoui.rda@gmail.com): remove after http://crbug.com/730068 is + // fixed. + LOG(INFO) << "Using camera " + << device_descriptors_->front().GetNameAndModel(); +#else DLOG(INFO) << "Using camera " << device_descriptors_->front().GetNameAndModel(); - ; +#endif + return base::MakeUnique<VideoCaptureDeviceDescriptor>( device_descriptors_->front()); }
diff --git a/media/cdm/cdm_proxy.h b/media/cdm/cdm_proxy.h index 34599ba..7ae5856 100644 --- a/media/cdm/cdm_proxy.h +++ b/media/cdm/cdm_proxy.h
@@ -8,6 +8,7 @@ #include <stdint.h> #include <memory> +#include <string> #include <vector> #include "base/callback.h" @@ -115,6 +116,9 @@ DISALLOW_COPY_AND_ASSIGN(CdmProxy); }; +using CdmProxyFactoryCB = base::RepeatingCallback<std::unique_ptr<CdmProxy>( + const std::string& cdm_guid)>; + } // namespace media #endif // MEDIA_CDM_CDM_PROXY_H_
diff --git a/media/cdm/ppapi/clear_key_cdm/BUILD.gn b/media/cdm/ppapi/clear_key_cdm/BUILD.gn index f9f9396..ab00d51 100644 --- a/media/cdm/ppapi/clear_key_cdm/BUILD.gn +++ b/media/cdm/ppapi/clear_key_cdm/BUILD.gn
@@ -32,6 +32,7 @@ defines = [ "CDM_IMPLEMENTATION" ] deps = [ + ":cdm_proxy_common", "//base", "//build/config:exe_and_shlib_deps", "//media", # For media::AudioTimestampHelper @@ -55,3 +56,22 @@ ldflags = [ "-Wl,-install_name,@loader_path/libclearkeycdm.dylib" ] } } + +source_set("clear_key_cdm_proxy") { + sources = [ + "clear_key_cdm_proxy.cc", + "clear_key_cdm_proxy.h", + ] + + deps = [ + ":cdm_proxy_common", + "//base", + "//media", + ] +} + +source_set("cdm_proxy_common") { + sources = [ + "cdm_proxy_common.h", + ] +}
diff --git a/media/cdm/ppapi/clear_key_cdm/cdm_proxy_common.h b/media/cdm/ppapi/clear_key_cdm/cdm_proxy_common.h new file mode 100644 index 0000000..c157778 --- /dev/null +++ b/media/cdm/ppapi/clear_key_cdm/cdm_proxy_common.h
@@ -0,0 +1,21 @@ +// Copyright 2017 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 MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_CDM_PROXY_COMMON_H_ +#define MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_CDM_PROXY_COMMON_H_ + +#include <stdint.h> +#include <array> + +namespace media { + +// Constants used to test CdmProxy stack using ClearKeyCdm and ClearKeyCdmProxy. +constexpr uint32_t kClearKeyCdmProxyCryptoSessionId = 1; +constexpr uint32_t kClearKeyCdmProxyMediaCryptoSessionId = 23; +constexpr std::array<uint8_t, 3> kClearKeyCdmProxyInputData = {4, 5, 6}; +constexpr std::array<uint8_t, 4> kClearKeyCdmProxyOutputData = {7, 8, 9, 10}; + +} // namespace media + +#endif // MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_CDM_PROXY_COMMON_H_
diff --git a/media/cdm/ppapi/clear_key_cdm/cdm_proxy_test.cc b/media/cdm/ppapi/clear_key_cdm/cdm_proxy_test.cc index 9823126..7e2a48d 100644 --- a/media/cdm/ppapi/clear_key_cdm/cdm_proxy_test.cc +++ b/media/cdm/ppapi/clear_key_cdm/cdm_proxy_test.cc
@@ -4,8 +4,13 @@ #include "media/cdm/ppapi/clear_key_cdm/cdm_proxy_test.h" +#include <stdint.h> +#include <algorithm> + #include "base/logging.h" +#include "base/macros.h" #include "media/cdm/ppapi/clear_key_cdm/cdm_host_proxy.h" +#include "media/cdm/ppapi/clear_key_cdm/cdm_proxy_common.h" namespace media { @@ -34,22 +39,46 @@ Protocol protocol, uint32_t crypto_session_id) { DVLOG(1) << __func__ << ": status = " << status; - // Ignore the |status| for now. - // TODO(xhwang): Add a test CdmProxy and test all APIs. - OnTestComplete(true); + + if (status != Status::kOk || + crypto_session_id != kClearKeyCdmProxyCryptoSessionId) { + OnTestComplete(false); + return; + } + + cdm_proxy_->Process(cdm::CdmProxy::kIntelNegotiateCryptoSessionKeyExchange, + crypto_session_id, kClearKeyCdmProxyInputData.data(), + kClearKeyCdmProxyInputData.size(), 0); } + void CdmProxyTest::OnProcessed(Status status, const uint8_t* output_data, uint32_t output_data_size) { DVLOG(1) << __func__ << ": status = " << status; - NOTREACHED(); + + if (status != Status::kOk || + !std::equal(output_data, output_data + output_data_size, + kClearKeyCdmProxyOutputData.begin())) { + OnTestComplete(false); + return; + } + + cdm_proxy_->CreateMediaCryptoSession(kClearKeyCdmProxyInputData.data(), + kClearKeyCdmProxyInputData.size()); } void CdmProxyTest::OnMediaCryptoSessionCreated(Status status, uint32_t crypto_session_id, uint64_t output_data) { DVLOG(1) << __func__ << ": status = " << status; - NOTREACHED(); + + if (status != Status::kOk || + crypto_session_id != kClearKeyCdmProxyMediaCryptoSessionId) { + OnTestComplete(false); + return; + } + + OnTestComplete(true); } void CdmProxyTest::NotifyHardwareReset() {
diff --git a/media/cdm/ppapi/clear_key_cdm/clear_key_cdm.cc b/media/cdm/ppapi/clear_key_cdm/clear_key_cdm.cc index 0551840..216b96c1 100644 --- a/media/cdm/ppapi/clear_key_cdm/clear_key_cdm.cc +++ b/media/cdm/ppapi/clear_key_cdm/clear_key_cdm.cc
@@ -57,8 +57,8 @@ // Variants of External Clear Key key system to test different scenarios. const char kExternalClearKeyDecryptOnlyKeySystem[] = "org.chromium.externalclearkey.decryptonly"; -const char kExternalClearKeyRenewalKeySystem[] = - "org.chromium.externalclearkey.renewal"; +const char kExternalClearKeyMessageTypeTestKeySystem[] = + "org.chromium.externalclearkey.messagetypetest"; const char kExternalClearKeyFileIOTestKeySystem[] = "org.chromium.externalclearkey.fileiotest"; const char kExternalClearKeyOutputProtectionTestKeySystem[] = @@ -84,6 +84,8 @@ // media/test/data/eme_player_js/globals.js. const char kUnitTestResultHeader[] = "UNIT_TEST_RESULT"; +const char kDummyIndividualizationRequest[] = "dummy individualization request"; + static bool g_is_cdm_module_initialized = false; // Copies |input_buffer| into a media::DecoderBuffer. If the |input_buffer| is @@ -256,7 +258,7 @@ std::string key_system_string(key_system, key_system_size); if (key_system_string != kExternalClearKeyKeySystem && key_system_string != kExternalClearKeyDecryptOnlyKeySystem && - key_system_string != kExternalClearKeyRenewalKeySystem && + key_system_string != kExternalClearKeyMessageTypeTestKeySystem && key_system_string != kExternalClearKeyFileIOTestKeySystem && key_system_string != kExternalClearKeyOutputProtectionTestKeySystem && key_system_string != kExternalClearKeyPlatformVerificationTestKeySystem && @@ -358,7 +360,8 @@ template <typename HostInterface> ClearKeyCdm::ClearKeyCdm(HostInterface* host, const std::string& key_system) - : cdm_host_proxy_(new CdmHostProxyImpl<HostInterface>(host)), + : host_interface_version_(HostInterface::kVersion), + cdm_host_proxy_(new CdmHostProxyImpl<HostInterface>(host)), cdm_(new ClearKeyPersistentSessionCdm( cdm_host_proxy_.get(), base::Bind(&ClearKeyCdm::OnSessionMessage, base::Unretained(this)), @@ -477,14 +480,25 @@ // Now create the expiration changed event. cdm::Time expiration = 0.0; // Never expires. - if (key_system_ == kExternalClearKeyRenewalKeySystem) { + if (key_system_ == kExternalClearKeyMessageTypeTestKeySystem) { // For renewal key system, set a non-zero expiration that is approximately // 100 years after 01 January 1970 UTC. expiration = 3153600000.0; // 100 * 365 * 24 * 60 * 60; - if (!renewal_timer_set_) { + if (!has_set_renewal_timer_) { ScheduleNextRenewal(); - renewal_timer_set_ = true; + has_set_renewal_timer_ = true; + } + + // Also send an individualization request if never sent before. Only + // supported on Host_10 and later. + if (host_interface_version_ >= cdm::Host_10::kVersion && + !has_sent_individualization_request_) { + has_sent_individualization_request_ = true; + const std::string request = kDummyIndividualizationRequest; + cdm_host_proxy_->OnSessionMessage(session_id.data(), session_id.length(), + cdm::kIndividualizationRequest, + request.data(), request.size()); } } @@ -544,7 +558,7 @@ void ClearKeyCdm::TimerExpired(void* context) { DVLOG(1) << __func__; - DCHECK(renewal_timer_set_); + DCHECK(has_set_renewal_timer_); std::string renewal_message; if (!next_renewal_message_.empty() && context == &next_renewal_message_[0]) {
diff --git a/media/cdm/ppapi/clear_key_cdm/clear_key_cdm.h b/media/cdm/ppapi/clear_key_cdm/clear_key_cdm.h index 417bc06..e14b64e6 100644 --- a/media/cdm/ppapi/clear_key_cdm/clear_key_cdm.h +++ b/media/cdm/ppapi/clear_key_cdm/clear_key_cdm.h
@@ -141,6 +141,8 @@ void StartCdmProxyTest(); void OnCdmProxyTestComplete(bool success); + int host_interface_version_ = 0; + std::unique_ptr<CdmHostProxy> cdm_host_proxy_; scoped_refptr<ContentDecryptionModule> cdm_; @@ -155,7 +157,9 @@ // Indicates whether a renewal timer has been set to prevent multiple timers // from running. - bool renewal_timer_set_ = false; + bool has_set_renewal_timer_ = false; + + bool has_sent_individualization_request_ = false; #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) std::unique_ptr<FFmpegCdmAudioDecoder> audio_decoder_;
diff --git a/media/cdm/ppapi/clear_key_cdm/clear_key_cdm_proxy.cc b/media/cdm/ppapi/clear_key_cdm/clear_key_cdm_proxy.cc new file mode 100644 index 0000000..c0a04381 --- /dev/null +++ b/media/cdm/ppapi/clear_key_cdm/clear_key_cdm_proxy.cc
@@ -0,0 +1,68 @@ +// Copyright 2017 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 "media/cdm/ppapi/clear_key_cdm/clear_key_cdm_proxy.h" + +#include "base/logging.h" +#include "media/cdm/ppapi/clear_key_cdm/cdm_proxy_common.h" + +namespace media { + +ClearKeyCdmProxy::ClearKeyCdmProxy() {} + +ClearKeyCdmProxy::~ClearKeyCdmProxy() {} + +void ClearKeyCdmProxy::Initialize(Client* client, InitializeCB init_cb) { + DVLOG(1) << __func__; + + std::move(init_cb).Run( + Status::kOk, Protocol::kIntelConvergedSecurityAndManageabilityEngine, + kClearKeyCdmProxyCryptoSessionId); +} + +void ClearKeyCdmProxy::Process(Function function, + uint32_t crypto_session_id, + const std::vector<uint8_t>& input_data, + uint32_t expected_output_data_size, + ProcessCB process_cb) { + DVLOG(1) << __func__; + + if (crypto_session_id != kClearKeyCdmProxyCryptoSessionId || + !std::equal(input_data.begin(), input_data.end(), + kClearKeyCdmProxyInputData.begin(), + kClearKeyCdmProxyInputData.end())) { + std::move(process_cb).Run(Status::kFail, {}); + return; + } + + std::move(process_cb) + .Run(Status::kOk, + std::vector<uint8_t>(kClearKeyCdmProxyOutputData.begin(), + kClearKeyCdmProxyOutputData.end())); +} + +void ClearKeyCdmProxy::CreateMediaCryptoSession( + const std::vector<uint8_t>& input_data, + CreateMediaCryptoSessionCB create_media_crypto_session_cb) { + DVLOG(1) << __func__; + + if (!std::equal(input_data.begin(), input_data.end(), + kClearKeyCdmProxyInputData.begin(), + kClearKeyCdmProxyInputData.end())) { + std::move(create_media_crypto_session_cb).Run(Status::kFail, 0, 0); + return; + } + + std::move(create_media_crypto_session_cb) + .Run(Status::kOk, kClearKeyCdmProxyMediaCryptoSessionId, 0); +} + +void ClearKeyCdmProxy::SetKey(uint32_t crypto_session_id, + const std::vector<uint8_t>& key_id, + const std::vector<uint8_t>& key_blob) {} + +void ClearKeyCdmProxy::RemoveKey(uint32_t crypto_session_id, + const std::vector<uint8_t>& key_id) {} + +} // namespace media
diff --git a/media/cdm/ppapi/clear_key_cdm/clear_key_cdm_proxy.h b/media/cdm/ppapi/clear_key_cdm/clear_key_cdm_proxy.h new file mode 100644 index 0000000..ff4de3e6 --- /dev/null +++ b/media/cdm/ppapi/clear_key_cdm/clear_key_cdm_proxy.h
@@ -0,0 +1,42 @@ +// Copyright 2017 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 MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_CLEAR_KEY_CDM_PROXY_H_ +#define MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_CLEAR_KEY_CDM_PROXY_H_ + +#include "base/callback.h" +#include "base/macros.h" +#include "media/cdm/cdm_proxy.h" + +namespace media { + +// CdmProxy implementation for Clear Key CDM to test CDM Proxy support. +class ClearKeyCdmProxy : public CdmProxy { + public: + ClearKeyCdmProxy(); + ~ClearKeyCdmProxy() final; + + // CdmProxy implementation. + void Initialize(Client* client, InitializeCB init_cb) final; + void Process(Function function, + uint32_t crypto_session_id, + const std::vector<uint8_t>& input_data, + uint32_t expected_output_data_size, + ProcessCB process_cb) final; + void CreateMediaCryptoSession( + const std::vector<uint8_t>& input_data, + CreateMediaCryptoSessionCB create_media_crypto_session_cb) final; + void SetKey(uint32_t crypto_session_id, + const std::vector<uint8_t>& key_id, + const std::vector<uint8_t>& key_blob) final; + void RemoveKey(uint32_t crypto_session_id, + const std::vector<uint8_t>& key_id) final; + + private: + DISALLOW_COPY_AND_ASSIGN(ClearKeyCdmProxy); +}; + +} // namespace media + +#endif // MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_CLEAR_KEY_CDM_PROXY_H_
diff --git a/media/filters/audio_decoder_unittest.cc b/media/filters/audio_decoder_unittest.cc index fec224cb..cf85045 100644 --- a/media/filters/audio_decoder_unittest.cc +++ b/media/filters/audio_decoder_unittest.cc
@@ -586,7 +586,7 @@ // the predefined number of output buffers are produced without draining // (i.e. decoding EOS). do { - Decode(); + ASSERT_NO_FATAL_FAILURE(Decode()); ASSERT_EQ(last_decode_status(), DecodeStatus::OK); } while (decoded_audio_size() < kDecodeRuns);
diff --git a/media/filters/chunk_demuxer_unittest.cc b/media/filters/chunk_demuxer_unittest.cc index 01de632..dcf5f73ed 100644 --- a/media/filters/chunk_demuxer_unittest.cc +++ b/media/filters/chunk_demuxer_unittest.cc
@@ -6,20 +6,22 @@ #include <stddef.h> #include <stdint.h> + #include <algorithm> +#include <queue> #include <utility> #include "base/bind.h" #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/macros.h" -#include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/synchronization/waitable_event.h" #include "base/test/scoped_feature_list.h" +#include "base/test/scoped_task_environment.h" #include "media/base/audio_decoder_config.h" #include "media/base/decoder_buffer.h" #include "media/base/decrypt_config.h" @@ -1335,9 +1337,10 @@ return true; } + base::test::ScopedTaskEnvironment scoped_task_environment_; + StrictMock<MockMediaLog> media_log_; - base::MessageLoop message_loop_; MockDemuxerHost host_; std::unique_ptr<ChunkDemuxer> demuxer_;
diff --git a/media/formats/webm/webm_info_parser.cc b/media/formats/webm/webm_info_parser.cc index c8d6b7a8b..3cd32c1 100644 --- a/media/formats/webm/webm_info_parser.cc +++ b/media/formats/webm/webm_info_parser.cc
@@ -49,6 +49,11 @@ if (id != kWebMIdTimecodeScale) return true; + if (val <= 0) { + DVLOG(1) << "TimeCodeScale of " << val << " is invalid. Must be > 0."; + return false; + } + if (timecode_scale_ != -1) { DVLOG(1) << "Multiple values for id " << std::hex << id << " specified"; return false;
diff --git a/media/gpu/BUILD.gn b/media/gpu/BUILD.gn index e598f1d..5e1fb402 100644 --- a/media/gpu/BUILD.gn +++ b/media/gpu/BUILD.gn
@@ -162,6 +162,7 @@ "//ui/gfx/geometry", ] deps = [ + "//gpu/ipc/service", "//ui/base", "//ui/display/types", "//ui/gl", @@ -511,6 +512,8 @@ "//media:test_support", "//testing/gmock", "//testing/gtest", + "//ui/gl", + "//ui/gl/init", ] } }
diff --git a/media/gpu/gpu_video_encode_accelerator_factory.cc b/media/gpu/gpu_video_encode_accelerator_factory.cc index e7c3443..da15893 100644 --- a/media/gpu/gpu_video_encode_accelerator_factory.cc +++ b/media/gpu/gpu_video_encode_accelerator_factory.cc
@@ -83,12 +83,13 @@ // platform. This list is ordered by priority, from most to least preferred, // if applicable. std::vector<VEAFactoryFunction> vea_factory_functions; + if (gpu_preferences.disable_accelerated_video_encode) + return vea_factory_functions; #if BUILDFLAG(USE_V4L2_CODEC) vea_factory_functions.push_back(&CreateV4L2VEA); #endif #if BUILDFLAG(USE_VAAPI) - if (!gpu_preferences.disable_vaapi_accelerated_video_encode) - vea_factory_functions.push_back(&CreateVaapiVEA); + vea_factory_functions.push_back(&CreateVaapiVEA); #endif #if defined(OS_ANDROID) && BUILDFLAG(ENABLE_WEBRTC) if (!gpu_preferences.disable_web_rtc_hw_encoding)
diff --git a/media/gpu/vaapi/vaapi_wrapper.cc b/media/gpu/vaapi/vaapi_wrapper.cc index d85ea16..e1dde3c3 100644 --- a/media/gpu/vaapi/vaapi_wrapper.cc +++ b/media/gpu/vaapi/vaapi_wrapper.cc
@@ -770,32 +770,6 @@ DestroySurfaces_Locked(); } -scoped_refptr<VASurface> VaapiWrapper::CreateUnownedSurface( - unsigned int va_format, - const gfx::Size& size, - const std::vector<VASurfaceAttrib>& va_attribs) { - base::AutoLock auto_lock(*va_lock_); - - std::vector<VASurfaceAttrib> attribs(va_attribs); - VASurfaceID va_surface_id; - VAStatus va_res = - vaCreateSurfaces(va_display_, va_format, size.width(), size.height(), - &va_surface_id, 1, &attribs[0], attribs.size()); - - scoped_refptr<VASurface> va_surface; - VA_SUCCESS_OR_RETURN(va_res, "Failed to create unowned VASurface", - va_surface); - - // This is safe to use Unretained() here, because the VDA takes care - // of the destruction order. All the surfaces will be destroyed - // before VaapiWrapper. - va_surface = new VASurface( - va_surface_id, size, va_format, - base::Bind(&VaapiWrapper::DestroyUnownedSurface, base::Unretained(this))); - - return va_surface; -} - scoped_refptr<VASurface> VaapiWrapper::CreateVASurfaceForPixmap( const scoped_refptr<gfx::NativePixmap>& pixmap) { // Create a VASurface for a NativePixmap by importing the underlying dmabufs. @@ -1276,6 +1250,32 @@ va_surface_format_ = 0; } +scoped_refptr<VASurface> VaapiWrapper::CreateUnownedSurface( + unsigned int va_format, + const gfx::Size& size, + const std::vector<VASurfaceAttrib>& va_attribs) { + base::AutoLock auto_lock(*va_lock_); + + std::vector<VASurfaceAttrib> attribs(va_attribs); + VASurfaceID va_surface_id; + VAStatus va_res = + vaCreateSurfaces(va_display_, va_format, size.width(), size.height(), + &va_surface_id, 1, &attribs[0], attribs.size()); + + scoped_refptr<VASurface> va_surface; + VA_SUCCESS_OR_RETURN(va_res, "Failed to create unowned VASurface", + va_surface); + + // This is safe to use Unretained() here, because the VDA takes care + // of the destruction order. All the surfaces will be destroyed + // before VaapiWrapper. + va_surface = new VASurface( + va_surface_id, size, va_format, + base::Bind(&VaapiWrapper::DestroyUnownedSurface, base::Unretained(this))); + + return va_surface; +} + void VaapiWrapper::DestroyUnownedSurface(VASurfaceID va_surface_id) { base::AutoLock auto_lock(*va_lock_);
diff --git a/media/gpu/vaapi/vaapi_wrapper.h b/media/gpu/vaapi/vaapi_wrapper.h index 38d4110d..b1b646f 100644 --- a/media/gpu/vaapi/vaapi_wrapper.h +++ b/media/gpu/vaapi/vaapi_wrapper.h
@@ -105,15 +105,6 @@ // Free all memory allocated in CreateSurfaces. virtual void DestroySurfaces(); - // Create a VASurface of |va_format|, |size| and using |va_attribs| - // attributes. The ownership of the surface is transferred to the - // caller. It differs from surfaces created using CreateSurfaces(), - // where VaapiWrapper is the owner of the surfaces. - scoped_refptr<VASurface> CreateUnownedSurface( - unsigned int va_format, - const gfx::Size& size, - const std::vector<VASurfaceAttrib>& va_attribs); - // Create a VASurface for |pixmap|. The ownership of the surface is // transferred to the caller. It differs from surfaces created using // CreateSurfaces(), where VaapiWrapper is the owner of the surfaces. @@ -226,6 +217,15 @@ // Free all memory allocated in CreateSurfaces. void DestroySurfaces_Locked(); + + // Create a VASurface of |va_format|, |size| and using |va_attribs| + // attributes. The ownership of the surface is transferred to the + // caller. It differs from surfaces created using CreateSurfaces(), + // where VaapiWrapper is the owner of the surfaces. + scoped_refptr<VASurface> CreateUnownedSurface( + unsigned int va_format, + const gfx::Size& size, + const std::vector<VASurfaceAttrib>& va_attribs); // Destroys a |va_surface| created using CreateUnownedSurface. void DestroyUnownedSurface(VASurfaceID va_surface_id);
diff --git a/media/gpu/windows/d3d11_h264_accelerator.cc b/media/gpu/windows/d3d11_h264_accelerator.cc index e0d97acf..fc6640f9 100644 --- a/media/gpu/windows/d3d11_h264_accelerator.cc +++ b/media/gpu/windows/d3d11_h264_accelerator.cc
@@ -75,7 +75,8 @@ HRESULT hr; for (;;) { hr = video_context_->DecoderBeginFrame( - video_decoder_.Get(), our_pic->picture->output_view_.Get(), 0, nullptr); + video_decoder_.Get(), our_pic->picture->output_view().Get(), 0, + nullptr); if (hr == E_PENDING || hr == D3DERR_WASSTILLDRAWING) { // Hardware is busy. We should make the call again.
diff --git a/media/gpu/windows/d3d11_picture_buffer.cc b/media/gpu/windows/d3d11_picture_buffer.cc index 978898ad..f766b8c1 100644 --- a/media/gpu/windows/d3d11_picture_buffer.cc +++ b/media/gpu/windows/d3d11_picture_buffer.cc
@@ -4,11 +4,18 @@ #include "media/gpu/windows/d3d11_picture_buffer.h" +#include <d3d11.h> +#include <d3d11_1.h> #include <windows.h> +#include "base/memory/ptr_util.h" +#include "gpu/command_buffer/service/mailbox_manager.h" +#include "gpu/command_buffer/service/texture_manager.h" +#include "media/gpu/gles2_decoder_helper.h" #include "media/gpu/windows/return_on_failure.h" #include "third_party/angle/include/EGL/egl.h" #include "third_party/angle/include/EGL/eglext.h" +#include "ui/gfx/color_space.h" #include "ui/gl/gl_bindings.h" #include "ui/gl/gl_context.h" #include "ui/gl/gl_image_dxgi.h" @@ -17,27 +24,27 @@ namespace media { -D3D11PictureBuffer::D3D11PictureBuffer(PictureBuffer picture_buffer, - size_t level) - : picture_buffer_(picture_buffer), level_(level) {} +namespace { -D3D11PictureBuffer::D3D11PictureBuffer( - PictureBuffer picture_buffer, - size_t level, - const std::vector<scoped_refptr<gpu::gles2::TextureRef>>& texture_refs, - const MailboxHolderArray& mailbox_holders) - : picture_buffer_(picture_buffer), - level_(level), - texture_refs_(texture_refs) { - memcpy(&mailbox_holders_, mailbox_holders, sizeof(mailbox_holders_)); +static bool MakeContextCurrent(gpu::CommandBufferStub* stub) { + return stub && stub->decoder()->MakeCurrent(); } +} // namespace + +D3D11PictureBuffer::D3D11PictureBuffer(GLenum target, + gfx::Size size, + size_t level) + : target_(target), size_(size), level_(level) {} + D3D11PictureBuffer::~D3D11PictureBuffer() {} bool D3D11PictureBuffer::Init( + base::RepeatingCallback<gpu::CommandBufferStub*()> get_stub_cb, Microsoft::WRL::ComPtr<ID3D11VideoDevice> video_device, Microsoft::WRL::ComPtr<ID3D11Texture2D> texture, - const GUID& decoder_guid) { + const GUID& decoder_guid, + int textures_per_picture) { texture_ = texture; D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC view_desc = {}; view_desc.DecodeProfile = decoder_guid; @@ -47,7 +54,72 @@ HRESULT hr = video_device->CreateVideoDecoderOutputView( texture.Get(), &view_desc, output_view_.GetAddressOf()); - CHECK(SUCCEEDED(hr)); + if (!SUCCEEDED(hr)) + return false; + + // Generate mailboxes and holders. + std::vector<gpu::Mailbox> mailboxes; + for (int texture_idx = 0; texture_idx < textures_per_picture; texture_idx++) { + mailboxes.push_back(gpu::Mailbox::Generate()); + mailbox_holders_[texture_idx] = gpu::MailboxHolder( + mailboxes[texture_idx], gpu::SyncToken(), GL_TEXTURE_EXTERNAL_OES); + } + + // Start construction of the GpuResources. + // We send the texture itself, since we assume that we're using the angle + // device for decoding. Sharing seems not to work very well. Otherwise, we + // would create the texture with KEYED_MUTEX and NTHANDLE, then send along + // a handle that we get from |texture| as an IDXGIResource1. + gpu_resources_ = base::MakeUnique<GpuResources>(); + if (!gpu_resources_->Init(std::move(get_stub_cb), level_, + std::move(mailboxes), target_, size_, texture, + textures_per_picture)) + return false; + + return true; +} + +D3D11PictureBuffer::GpuResources::GpuResources() {} + +D3D11PictureBuffer::GpuResources::~GpuResources() {} + +bool D3D11PictureBuffer::GpuResources::Init( + base::RepeatingCallback<gpu::CommandBufferStub*()> get_stub_cb, + int level, + const std::vector<gpu::Mailbox> mailboxes, + GLenum target, + gfx::Size size, + Microsoft::WRL::ComPtr<ID3D11Texture2D> angle_texture, + int textures_per_picture) { + gpu::CommandBufferStub* stub = get_stub_cb.Run(); + + if (!MakeContextCurrent(stub)) + return false; + + // TODO(liberato): see GpuVideoFrameFactory. + // stub_->AddDestructionObserver(this); + + auto decoder_helper = GLES2DecoderHelper::Create(stub->decoder()); + gpu::gles2::ContextGroup* group = stub->decoder()->GetContextGroup(); + gpu::MailboxManager* mailbox_manager = group->mailbox_manager(); + gpu::gles2::TextureManager* texture_manager = group->texture_manager(); + RETURN_ON_FAILURE(!!texture_manager, "No texture manager", false); + if (!texture_manager) + return false; + + // Create the textures and attach them to the mailboxes. + std::vector<uint32_t> service_ids; + for (int texture_idx = 0; texture_idx < textures_per_picture; texture_idx++) { + texture_refs_.push_back(decoder_helper->CreateTexture( + target, GL_RGBA, size.width(), size.height(), GL_RGBA, + GL_UNSIGNED_BYTE)); + service_ids.push_back(texture_refs_[texture_idx]->service_id()); + + mailbox_manager->ProduceTexture(mailboxes[texture_idx], + texture_refs_[texture_idx]->texture()); + } + + // Create the stream for zero-copy use by gl. EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); const EGLint stream_attributes[] = { EGL_CONSUMER_LATENCY_USEC_KHR, @@ -56,16 +128,18 @@ 0, EGL_NONE, }; - stream_ = eglCreateStreamKHR(egl_display, stream_attributes); - RETURN_ON_FAILURE(!!stream_, "Could not create stream", false); - gl_image_ = - base::MakeRefCounted<gl::GLImageDXGI>(picture_buffer_.size(), stream_); + EGLStreamKHR stream = eglCreateStreamKHR(egl_display, stream_attributes); + RETURN_ON_FAILURE(!!stream, "Could not create stream", false); + + // |stream| will be destroyed when the GLImage is. + scoped_refptr<gl::GLImage> gl_image = + base::MakeRefCounted<gl::GLImageDXGI>(size, stream); gl::ScopedActiveTexture texture0(GL_TEXTURE0); - gl::ScopedTextureBinder texture0_binder( - GL_TEXTURE_EXTERNAL_OES, picture_buffer_.service_texture_ids()[0]); + gl::ScopedTextureBinder texture0_binder(GL_TEXTURE_EXTERNAL_OES, + service_ids[0]); gl::ScopedActiveTexture texture1(GL_TEXTURE1); - gl::ScopedTextureBinder texture1_binder( - GL_TEXTURE_EXTERNAL_OES, picture_buffer_.service_texture_ids()[1]); + gl::ScopedTextureBinder texture1_binder(GL_TEXTURE_EXTERNAL_OES, + service_ids[1]); EGLAttrib consumer_attributes[] = { EGL_COLOR_BUFFER_TYPE, @@ -79,30 +153,43 @@ EGL_NONE, }; EGLBoolean result = eglStreamConsumerGLTextureExternalAttribsNV( - egl_display, stream_, consumer_attributes); + egl_display, stream, consumer_attributes); RETURN_ON_FAILURE(result, "Could not set stream consumer", false); EGLAttrib producer_attributes[] = { EGL_NONE, }; - result = eglCreateStreamProducerD3DTextureANGLE(egl_display, stream_, + result = eglCreateStreamProducerD3DTextureANGLE(egl_display, stream, producer_attributes); + RETURN_ON_FAILURE(result, "Could not create stream", false); EGLAttrib frame_attributes[] = { - EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, level_, EGL_NONE, + EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, level, EGL_NONE, }; - result = eglStreamPostD3DTextureANGLE(egl_display, stream_, - static_cast<void*>(texture.Get()), + result = eglStreamPostD3DTextureANGLE(egl_display, stream, + static_cast<void*>(angle_texture.Get()), frame_attributes); RETURN_ON_FAILURE(result, "Could not post texture", false); - result = eglStreamConsumerAcquireKHR(egl_display, stream_); + + result = eglStreamConsumerAcquireKHR(egl_display, stream); + // TODO(liberato): who destroys |stream|? + RETURN_ON_FAILURE(result, "Could not post acquire stream", false); gl::GLImageDXGI* gl_image_dxgi = - static_cast<gl::GLImageDXGI*>(gl_image_.get()); + static_cast<gl::GLImageDXGI*>(gl_image.get()); - gl_image_dxgi->SetTexture(texture, level_); + gl_image_dxgi->SetTexture(angle_texture, level); + + // Bind the image to each texture. + for (size_t texture_idx = 0; texture_idx < texture_refs_.size(); + texture_idx++) { + texture_manager->SetLevelImage(texture_refs_[texture_idx].get(), + GL_TEXTURE_EXTERNAL_OES, 0, gl_image.get(), + gpu::gles2::Texture::ImageState::BOUND); + } + return true; }
diff --git a/media/gpu/windows/d3d11_picture_buffer.h b/media/gpu/windows/d3d11_picture_buffer.h index b6f305e..20ad12ea 100644 --- a/media/gpu/windows/d3d11_picture_buffer.h +++ b/media/gpu/windows/d3d11_picture_buffer.h
@@ -11,62 +11,112 @@ #include <vector> +#include "base/memory/ref_counted.h" + #include "gpu/command_buffer/service/texture_manager.h" +#include "gpu/ipc/service/command_buffer_stub.h" #include "media/base/video_frame.h" +#include "media/gpu/media_gpu_export.h" #include "media/video/picture.h" +#include "third_party/angle/include/EGL/egl.h" +#include "third_party/angle/include/EGL/eglext.h" +#include "ui/gl/gl_image.h" namespace media { -class D3D11H264Accelerator; -// This must be freed on the main thread, since it has things like |gl_image_| -// and |texture_refs_|. -class D3D11PictureBuffer { +// PictureBuffer that owns Chrome Textures to display it, and keep a reference +// to the D3D texture that backs the image. +// +// This is created and owned on the decoder thread. While currently that's the +// gpu main thread, we still keep the decoder parts separate from the chrome GL +// parts, in case that changes. +// +// This is refcounted so that VideoFrame can hold onto it indirectly. While +// the chrome Texture is sufficient to keep the pictures renderable, we still +// need to guarantee that the client has time to use the mailbox. Once it +// does so, it would be fine if this were destroyed. Technically, only the +// GpuResources have to be retained until the mailbox is used, but we just +// retain the whole thing. +class MEDIA_GPU_EXPORT D3D11PictureBuffer + : public base::RefCountedThreadSafe<D3D11PictureBuffer> { public: using MailboxHolderArray = gpu::MailboxHolder[VideoFrame::kMaxPlanes]; - D3D11PictureBuffer(PictureBuffer picture_buffer, size_t level); - D3D11PictureBuffer( - PictureBuffer picture_buffer, - size_t level, - const std::vector<scoped_refptr<gpu::gles2::TextureRef>>& texture_refs, - const MailboxHolderArray& mailbox_holders); - ~D3D11PictureBuffer(); + D3D11PictureBuffer(GLenum target, gfx::Size size, size_t level); - bool Init(Microsoft::WRL::ComPtr<ID3D11VideoDevice> video_device, + bool Init(base::RepeatingCallback<gpu::CommandBufferStub*()> get_stub_cb, + Microsoft::WRL::ComPtr<ID3D11VideoDevice> video_device, Microsoft::WRL::ComPtr<ID3D11Texture2D> texture, - const GUID& decoder_guid); + const GUID& decoder_guid, + int textures_per_picture); + const gfx::Size& size() const { return size_; } size_t level() const { return level_; } + Microsoft::WRL::ComPtr<ID3D11Texture2D> texture() const { return texture_; } - PictureBuffer& picture_buffer() { return picture_buffer_; } - + // Is this PictureBuffer backing a VideoFrame right now? bool in_client_use() const { return in_client_use_; } + + // Is this PictureBuffer holding an image that's in use by the decoder? bool in_picture_use() const { return in_picture_use_; } + void set_in_client_use(bool use) { in_client_use_ = use; } void set_in_picture_use(bool use) { in_picture_use_ = use; } - scoped_refptr<gl::GLImage> gl_image() const { return gl_image_; } - // For D3D11VideoDecoder. + const Microsoft::WRL::ComPtr<ID3D11VideoDecoderOutputView>& output_view() + const { + return output_view_; + } + + // Return the mailbox holders that can be used to create a VideoFrame for us. const MailboxHolderArray& mailbox_holders() const { return mailbox_holders_; } + // Shouldn't be here, but simpler for now. base::TimeDelta timestamp_; private: - friend class D3D11H264Accelerator; + ~D3D11PictureBuffer(); + friend class base::RefCountedThreadSafe<D3D11PictureBuffer>; - PictureBuffer picture_buffer_; - Microsoft::WRL::ComPtr<ID3D11Texture2D> texture_; + GLenum target_; + gfx::Size size_; bool in_picture_use_ = false; bool in_client_use_ = false; size_t level_; - Microsoft::WRL::ComPtr<ID3D11VideoDecoderOutputView> output_view_; - EGLStreamKHR stream_; - scoped_refptr<gl::GLImage> gl_image_; - // For D3D11VideoDecoder. - std::vector<scoped_refptr<gpu::gles2::TextureRef>> texture_refs_; + // TODO(liberato): I don't think that we need to remember |texture_|. The + // GLImage will do so, so it will last long enough for any VideoFrames that + // reference it. + Microsoft::WRL::ComPtr<ID3D11Texture2D> texture_; + Microsoft::WRL::ComPtr<ID3D11VideoDecoderOutputView> output_view_; + MailboxHolderArray mailbox_holders_; + // Things that are to be accessed / freed only on the main thread. In + // addition to setting up the textures to render from a D3D11 texture, + // these also hold the chrome GL Texture objects so that the client + // can use the mailbox. + class GpuResources { + public: + GpuResources(); + ~GpuResources(); + + bool Init(base::RepeatingCallback<gpu::CommandBufferStub*()> get_stub_cb, + int level, + const std::vector<gpu::Mailbox> mailboxes, + GLenum target, + gfx::Size size, + Microsoft::WRL::ComPtr<ID3D11Texture2D> angle_texture, + int textures_per_picture); + + std::vector<scoped_refptr<gpu::gles2::TextureRef>> texture_refs_; + + private: + DISALLOW_COPY_AND_ASSIGN(GpuResources); + }; + + std::unique_ptr<GpuResources> gpu_resources_; + DISALLOW_COPY_AND_ASSIGN(D3D11PictureBuffer); };
diff --git a/media/gpu/windows/d3d11_video_decoder_impl.cc b/media/gpu/windows/d3d11_video_decoder_impl.cc index 7f027069..0e9c469 100644 --- a/media/gpu/windows/d3d11_video_decoder_impl.cc +++ b/media/gpu/windows/d3d11_video_decoder_impl.cc
@@ -46,36 +46,35 @@ CdmContext* cdm_context, const InitCB& init_cb, const OutputCB& output_cb) { + init_cb_ = init_cb; + output_cb_ = output_cb; + stub_ = get_stub_cb_.Run(); if (!MakeContextCurrent(stub_)) { - init_cb.Run(false); + NotifyError("Failed to get decoder stub"); return; } // TODO(liberato): see GpuVideoFrameFactory. // stub_->AddDestructionObserver(this); - decoder_helper_ = GLES2DecoderHelper::Create(stub_->decoder()); - output_cb_ = output_cb; - - // The device is threadsafe. Does GetImmediateContext create a new object? - // If so, then we can just use it on the MCVD thread. All we need to do is - // to share the Texture object, somehow, which is likely trivial. We'd have - // to set up the picturebuffers on the main thread. - // We might need to do the query on the main thread, too, since it probably - // needs the context to be current. + // Use the ANGLE device, rather than create our own. It would be nice if we + // could use our own device, and run on the mojo thread, but texture sharing + // seems to be difficult. device_ = gl::QueryD3D11DeviceObjectFromANGLE(); device_->GetImmediateContext(device_context_.GetAddressOf()); + HRESULT hr; + // TODO(liberato): Handle cleanup better. - HRESULT hr = device_context_.CopyTo(video_context_.GetAddressOf()); + hr = device_context_.CopyTo(video_context_.GetAddressOf()); if (!SUCCEEDED(hr)) { - init_cb.Run(false); + NotifyError("Failed to get device context"); return; } hr = device_.CopyTo(video_device_.GetAddressOf()); if (!SUCCEEDED(hr)) { - init_cb.Run(false); + NotifyError("Failed to get video device"); return; } @@ -99,7 +98,7 @@ } if (!found) { - init_cb.Run(false); + NotifyError("Did not find a supported profile"); return; } } @@ -108,41 +107,49 @@ Microsoft::WRL::ComPtr<ID3D11Multithread> multi_threaded; hr = device_->QueryInterface(IID_PPV_ARGS(&multi_threaded)); if (!SUCCEEDED(hr)) { - init_cb.Run(false); + NotifyError("Failed to query ID3D11Multithread"); + return; } multi_threaded->SetMultithreadProtected(TRUE); D3D11_VIDEO_DECODER_DESC desc = {}; desc.Guid = decoder_guid; + // TODO(liberato): where do these numbers come from? desc.SampleWidth = 1920; desc.SampleHeight = 1088; desc.OutputFormat = DXGI_FORMAT_NV12; UINT config_count = 0; hr = video_device_->GetVideoDecoderConfigCount(&desc, &config_count); if (FAILED(hr) || config_count == 0) { - init_cb.Run(false); + NotifyError("Failed to get video decoder config count"); return; } D3D11_VIDEO_DECODER_CONFIG dec_config = {}; + bool found = false; for (UINT i = 0; i < config_count; i++) { hr = video_device_->GetVideoDecoderConfig(&desc, i, &dec_config); if (FAILED(hr)) { - init_cb.Run(false); + NotifyError("Failed to get decoder config"); return; } - // TODO(liberato): what happens if we don't break on any iteration? - // https://crbug.com/775577 . - if (dec_config.ConfigBitstreamRaw == 2) + if (dec_config.ConfigBitstreamRaw == 2) { + found = true; break; + } } + if (!found) { + NotifyError("Failed to find decoder config"); + return; + } + memcpy(&decoder_guid_, &decoder_guid, sizeof decoder_guid_); Microsoft::WRL::ComPtr<ID3D11VideoDecoder> video_decoder; hr = video_device_->CreateVideoDecoder(&desc, &dec_config, video_decoder.GetAddressOf()); if (!video_decoder.Get()) { - init_cb.Run(false); + NotifyError("Failed to create a video decoder"); return; } @@ -150,19 +157,30 @@ this, video_decoder, video_device_, video_context_)); decoder_.reset(new media::H264Decoder(h264_accelerator_.get())); - init_cb.Run(true); + state_ = State::kRunning; + std::move(init_cb_).Run(true); } void D3D11VideoDecoderImpl::Decode(const scoped_refptr<DecoderBuffer>& buffer, const DecodeCB& decode_cb) { + if (state_ == State::kError) { + // TODO(liberato): consider posting, though it likely doesn't matter. + decode_cb.Run(DecodeStatus::DECODE_ERROR); + return; + } + input_buffer_queue_.push_back(std::make_pair(buffer, decode_cb)); - // TODO(liberato): Why post? + // Post, since we're not supposed to call back before this returns. It + // probably doesn't matter since we're in the gpu process anyway. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&D3D11VideoDecoderImpl::DoDecode, weak_factory_.GetWeakPtr())); } void D3D11VideoDecoderImpl::DoDecode() { + if (state_ != State::kRunning) + return; + if (!current_buffer_) { if (input_buffer_queue_.empty()) { return; @@ -172,9 +190,16 @@ current_timestamp_ = current_buffer_->timestamp(); input_buffer_queue_.pop_front(); if (current_buffer_->end_of_stream()) { - // TODO(liberato): flush, then signal the decode cb once all pictures - // have been output. For now, we approximate this as "do nothing". + // Flush, then signal the decode cb once all pictures have been output. current_buffer_ = nullptr; + if (!decoder_->Flush()) { + // This will also signal error |current_decode_cb_|. + NotifyError("Flush failed"); + return; + } + // Pictures out output synchronously during Flush. Signal the decode + // cb now. + std::move(current_decode_cb_).Run(DecodeStatus::OK); return; } decoder_->SetStream((const uint8_t*)current_buffer_->data(), @@ -182,7 +207,12 @@ } while (true) { + // If we transition to the error state, then stop here. + if (state_ == State::kError) + return; + media::AcceleratedVideoDecoder::DecodeResult result = decoder_->Decode(); + // TODO(liberato): switch + class enum. if (result == media::AcceleratedVideoDecoder::kRanOutOfStreamData) { current_buffer_ = nullptr; std::move(current_decode_cb_).Run(DecodeStatus::OK); @@ -191,15 +221,15 @@ // At this point, we know the picture size. // If we haven't allocated picture buffers yet, then allocate some now. // Otherwise, stop here. We'll restart when a picture comes back. - if (!picture_buffers_.size()) - CreatePictureBuffers(); - else + if (picture_buffers_.size()) return; + CreatePictureBuffers(); } else if (result == media::AcceleratedVideoDecoder::kAllocateNewSurfaces) { CreatePictureBuffers(); } else { LOG(ERROR) << "VDA Error " << result; - CHECK(false); + NotifyError("Accelerated decode failed"); + return; } } @@ -217,6 +247,7 @@ queue_pair.second.Run(DecodeStatus::ABORTED); input_buffer_queue_.clear(); + // TODO(liberato): how do we signal an error? decoder_->Reset(); closure.Run(); } @@ -241,18 +272,9 @@ // the VDA requests 20. const int num_buffers = 20; - // TODO: transition to the error state. - if (!MakeContextCurrent(stub_)) - CHECK(false) << "CreatePictureBuffer failed to make context current"; - gpu::gles2::ContextGroup* group = stub_->decoder()->GetContextGroup(); - if (!group) - CHECK(false) << "CreatePictureBuffer failed to get context group"; - gpu::gles2::TextureManager* texture_manager = group->texture_manager(); - if (!texture_manager) - CHECK(false) << "CreatePictureBuffer failed to get texture manager"; - gfx::Size size = decoder_->GetPicSize(); + // Create an array of |num_buffers| elements to back the PictureBuffers. D3D11_TEXTURE2D_DESC texture_desc = {}; texture_desc.Width = size.width(); texture_desc.Height = size.height(); @@ -267,85 +289,25 @@ Microsoft::WRL::ComPtr<ID3D11Texture2D> out_texture; HRESULT hr = device_->CreateTexture2D(&texture_desc, nullptr, out_texture.GetAddressOf()); - CHECK(SUCCEEDED(hr)); + if (!SUCCEEDED(hr)) { + NotifyError("Failed to create a Texture2D for PictureBuffers"); + return; + } // Drop any old pictures. for (auto& buffer : picture_buffers_) - CHECK(!buffer->in_picture_use()); - - // TODO(liberato): Not sure if this is sufficient for cleanup. - // It's almost sufficient, since any pictures that are in use by the client - // will keep everything around properly. The GLImage is held by the Texture, - // and the Texture is held by the client. However, nothing cleans up the - // D3D11 stuff. Some of it should be cleaned up per-picture. Other stuff - // should be cleaned up by the last PictureBuffer, i think. - // I've also not checked that the DXGI GLImage handles cleanup properly. - // D3D11PictureBuffer doesn't seem to do anything either. + DCHECK(!buffer->in_picture_use()); picture_buffers_.clear(); - // In order to re-use the 264 accelerator, we temporarily create - // PictureBuffers and wrap them up as D3D11PictureBuffers. Once we remove - // the VDA implementation, we can remove the PictureBuffer and put everything - // into D3D11PictureBuffer. However, since the VDA version works right now, - // more or less, I don't want break it. I also don't want to fork the - // implementations, since there will likely be fixes that should be applied - // to both. - // - // We could create VDA and MVD subclasses of D3D11PictureBuffer that hide - // whether a PictureBuffer is used or not. D3D11PictureBuffer would provide - // accessors for all the stuff that the accelerator needs. Our impl would - // just store the TextureRef etc. directly. Seems like too much work for a - // very temporary problem though. - // Create each picture buffer. - // TODO(liberato): We could also do this (and the work in the picture) when - // outputting a new VideoFrame. Then, we could just wait for the GLImage to - // be destructed. This is how MCVD does it. - // - // I think that the stream is connected to the texture directly, so we'd need - // to make a new stream for each frame. i have no idea how expensive that - // is. For now, we watch for the VideoFrame's mailbox to be deleted, and - // re-use the textures / stream. + const int textures_per_picture = 2; // From the VDA for (size_t i = 0; i < num_buffers; i++) { - // Create new Textures. - std::vector<scoped_refptr<gpu::gles2::TextureRef>> texture_refs; - PictureBuffer::TextureIds client_ids; - PictureBuffer::TextureIds service_ids; - const uint32_t target = GL_TEXTURE_EXTERNAL_OES; - const int textures_per_picture = 2; // From the VDA - gpu::MailboxHolder mailbox_holders[VideoFrame::kMaxPlanes]; - for (int texture_idx = 0; texture_idx < textures_per_picture; - texture_idx++) { - texture_refs.push_back(decoder_helper_->CreateTexture( - target, GL_RGBA, size.width(), size.height(), GL_RGBA, - GL_UNSIGNED_BYTE)); - // Nothing uses the client id, which is fortunate since it doesn't exist. - client_ids.push_back(0); - service_ids.push_back(texture_refs[texture_idx]->service_id()); - - // Make a mailbox and holder for each texture. We'll wrap these with a - // VideoFrame later. - gpu::Mailbox mailbox = - decoder_helper_->CreateMailbox(texture_refs[texture_idx].get()); - mailbox_holders[texture_idx] = gpu::MailboxHolder( - mailbox, gpu::SyncToken(), GL_TEXTURE_EXTERNAL_OES); - } - - PictureBuffer buffer(i, size, client_ids, service_ids, target, - PIXEL_FORMAT_NV12); - - picture_buffers_.push_back(base::MakeUnique<D3D11PictureBuffer>( - buffer, i, texture_refs, mailbox_holders)); - - picture_buffers_[i]->Init(video_device_, out_texture, decoder_guid_); - - // Bind the image to each texture. - for (size_t texture_idx = 0; texture_idx < texture_refs.size(); - texture_idx++) { - texture_manager->SetLevelImage(texture_refs[texture_idx].get(), - GL_TEXTURE_EXTERNAL_OES, 0, - picture_buffers_[i]->gl_image().get(), - gpu::gles2::Texture::ImageState::BOUND); + picture_buffers_.push_back( + new D3D11PictureBuffer(GL_TEXTURE_EXTERNAL_OES, size, i)); + if (!picture_buffers_[i]->Init(get_stub_cb_, video_device_, out_texture, + decoder_guid_, textures_per_picture)) { + NotifyError("Unable to allocate PictureBuffer"); + return; } } } @@ -365,27 +327,32 @@ buffer->set_in_client_use(true); // Note: The pixel format doesn't matter. - gfx::Rect visible_rect(buffer->picture_buffer().size()); - gfx::Size natural_size = buffer->picture_buffer().size(); + gfx::Rect visible_rect(buffer->size()); + gfx::Size natural_size = buffer->size(); base::TimeDelta timestamp = buffer->timestamp_; auto frame = VideoFrame::WrapNativeTextures( - buffer->picture_buffer().pixel_format(), buffer->mailbox_holders(), - VideoFrame::ReleaseMailboxCB(), buffer->picture_buffer().size(), - visible_rect, natural_size, timestamp); + PIXEL_FORMAT_NV12, buffer->mailbox_holders(), + VideoFrame::ReleaseMailboxCB(), buffer->size(), visible_rect, + natural_size, timestamp); - frame->SetReleaseMailboxCB(media::BindToCurrentLoop( - base::BindOnce(&D3D11VideoDecoderImpl::OnMailboxReleased, - weak_factory_.GetWeakPtr(), buffer))); + frame->SetReleaseMailboxCB(media::BindToCurrentLoop(base::BindOnce( + &D3D11VideoDecoderImpl::OnMailboxReleased, weak_factory_.GetWeakPtr(), + scoped_refptr<D3D11PictureBuffer>(buffer)))); output_cb_.Run(frame); } void D3D11VideoDecoderImpl::OnMailboxReleased( - D3D11PictureBuffer* buffer, + scoped_refptr<D3D11PictureBuffer> buffer, const gpu::SyncToken& sync_token) { + // Note that |buffer| might no longer be in |picture_buffers_| if we've + // replaced them. That's okay. + // TODO(liberato): what about the sync token? buffer->set_in_client_use(false); // Also re-start decoding in case it was waiting for more pictures. + // TODO(liberato): there might be something pending already. we should + // probably check. base::ThreadTaskRunnerHandle::Get()->PostTask( FROM_HERE, base::Bind(&D3D11VideoDecoderImpl::DoDecode, weak_factory_.GetWeakPtr())); @@ -395,4 +362,17 @@ return weak_factory_.GetWeakPtr(); } +void D3D11VideoDecoderImpl::NotifyError(const char* reason) { + state_ = State::kError; + DLOG(ERROR) << reason; + if (init_cb_) + std::move(init_cb_).Run(false); + + if (current_decode_cb_) + std::move(current_decode_cb_).Run(DecodeStatus::DECODE_ERROR); + + for (auto& queue_pair : input_buffer_queue_) + queue_pair.second.Run(DecodeStatus::DECODE_ERROR); +} + } // namespace media
diff --git a/media/gpu/windows/d3d11_video_decoder_impl.h b/media/gpu/windows/d3d11_video_decoder_impl.h index 45fe5fe0..0a89262 100644 --- a/media/gpu/windows/d3d11_video_decoder_impl.h +++ b/media/gpu/windows/d3d11_video_decoder_impl.h
@@ -53,16 +53,29 @@ base::WeakPtr<D3D11VideoDecoderImpl> GetWeakPtr(); private: + enum class State { + // Initializing resources required to create a codec. + kInitializing, + // Initialization has completed and we're running. This is the only state + // in which |codec_| might be non-null. If |codec_| is null, a codec + // creation is pending. + kRunning, + // A fatal error occurred. A terminal state. + kError + }; + void DoDecode(); void CreatePictureBuffers(); - void OnMailboxReleased(D3D11PictureBuffer* buffer, + void OnMailboxReleased(scoped_refptr<D3D11PictureBuffer> buffer, const gpu::SyncToken& sync_token); + // Enter the kError state. This will fail any pending |init_cb_| and / or + // pending decode as well. + void NotifyError(const char* reason); + base::RepeatingCallback<gpu::CommandBufferStub*()> get_stub_cb_; gpu::CommandBufferStub* stub_ = nullptr; - // A helper for creating textures. Only valid while |stub_| is valid. - std::unique_ptr<GLES2DecoderHelper> decoder_helper_; Microsoft::WRL::ComPtr<ID3D11Device> device_; Microsoft::WRL::ComPtr<ID3D11DeviceContext> device_context_; @@ -80,9 +93,15 @@ DecodeCB current_decode_cb_; base::TimeDelta current_timestamp_; - std::vector<std::unique_ptr<D3D11PictureBuffer>> picture_buffers_; + // During init, these will be set. + InitCB init_cb_; + OutputCB output_cb_; - VideoDecoder::OutputCB output_cb_; + // It would be nice to unique_ptr these, but we give a ref to the VideoFrame + // so that the texture is retained until the mailbox is opened. + std::vector<scoped_refptr<D3D11PictureBuffer>> picture_buffers_; + + State state_ = State::kInitializing; base::WeakPtrFactory<D3D11VideoDecoderImpl> weak_factory_;
diff --git a/media/mojo/clients/BUILD.gn b/media/mojo/clients/BUILD.gn index 716b548..cce0776 100644 --- a/media/mojo/clients/BUILD.gn +++ b/media/mojo/clients/BUILD.gn
@@ -120,6 +120,7 @@ deps += [ "//media/mojo/interfaces:test_interfaces", "//ui/gfx:test_support", + "//ui/gl", ] } }
diff --git a/media/mojo/common/mojo_data_pipe_read_write.cc b/media/mojo/common/mojo_data_pipe_read_write.cc index cd6d152..300313d 100644 --- a/media/mojo/common/mojo_data_pipe_read_write.cc +++ b/media/mojo/common/mojo_data_pipe_read_write.cc
@@ -128,6 +128,10 @@ return consumer_handle_.is_valid(); } +void MojoDataPipeReader::Close() { + consumer_handle_.reset(); +} + // MojoDataPipeWriter MojoDataPipeWriter::MojoDataPipeWriter( @@ -236,4 +240,8 @@ return producer_handle_.is_valid(); } +void MojoDataPipeWriter::Close() { + producer_handle_.reset(); +} + } // namespace media
diff --git a/media/mojo/common/mojo_data_pipe_read_write.h b/media/mojo/common/mojo_data_pipe_read_write.h index 3e224b2c..85b767c 100644 --- a/media/mojo/common/mojo_data_pipe_read_write.h +++ b/media/mojo/common/mojo_data_pipe_read_write.h
@@ -34,6 +34,10 @@ bool IsPipeValid() const; + // Unbind the data pipe if bound. IsPipeValid() will return false after this + // is called. + void Close(); + private: void CompleteCurrentRead(); void TryReadData(MojoResult result); @@ -80,6 +84,10 @@ bool IsPipeValid() const; + // Unbind the data pipe if bound. IsPipeValid() will return false after this + // is called. + void Close(); + private: void TryWriteData(MojoResult result); void OnPipeError(MojoResult result);
diff --git a/media/mojo/interfaces/interface_factory.mojom b/media/mojo/interfaces/interface_factory.mojom index d91d614..3c8e3ee 100644 --- a/media/mojo/interfaces/interface_factory.mojom +++ b/media/mojo/interfaces/interface_factory.mojom
@@ -30,8 +30,10 @@ CreateCdm(string key_system, ContentDecryptionModule& cdm); // Creates a CdmProxy that proxies part of CDM functionalities to a different - // entity, e.g. hardware CDM modules. + // entity, e.g. hardware CDM modules. The created |cdm_proxy| must match the + // type of the CDM, identified by |cdm_guid|. // TODO(crbug.com/676224): Conditionally enable this when EnabledIf attribute // is supported in mojom files. - CreateCdmProxy(CdmProxy& cdm_proxy); + // TODO(xhwang): Add a helper type for GUID to avoid passing string here. + CreateCdmProxy(string cdm_guid, CdmProxy& cdm_proxy); };
diff --git a/media/mojo/interfaces/remoting.mojom b/media/mojo/interfaces/remoting.mojom index 1fafb8ad..fd36afc7 100644 --- a/media/mojo/interfaces/remoting.mojom +++ b/media/mojo/interfaces/remoting.mojom
@@ -17,22 +17,9 @@ // from a data pipe and then sent to the remote endpoint. There is one // RemotingDataStreamSender per data pipe. interface RemotingDataStreamSender { - // Consumes |size| bytes of data from the data pipe, which is a chunk of the - // next frame's data payload starting at the given byte |offset|. - // |total_payload_size| indicates the size of the entire data payload for the - // frame. Before this is called, |size| bytes of data must have been written - // into the data pipe. - // - // Normally, a frame's entire data payload can be pushed through the data pipe - // in one chunk. However, there can be situations where the size of the - // payload exceeds the capacity of the data pipe; and so this API supports - // feeding the frame data through the pipe in multiple chunks. - ConsumeDataChunk(uint32 offset, uint32 size, uint32 total_payload_size); - - // Enqueues another frame for transmission to the remote endpoint. Before this - // is called, ConsumeDataChunk() must have been called one or more times to - // provide all of the frame's data. - SendFrame(); + // Enqueues another frame for transmission to the remote endpoint, whose + // payload is |frame_size| bytes, to be read from the data pipe. + SendFrame(uint32 frame_size); // Cancels the transmission of all in-flight data to the remote, up to and // including the last SendFrame() call; and also discard any data chunks
diff --git a/media/mojo/services/BUILD.gn b/media/mojo/services/BUILD.gn index 4e71898..d0912c9 100644 --- a/media/mojo/services/BUILD.gn +++ b/media/mojo/services/BUILD.gn
@@ -92,6 +92,7 @@ ] deps = [ + "//gpu/ipc/service", "//media:shared_memory_support", "//media/cdm:cdm_manager", "//media/gpu",
diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc index d41c1dc..d3a8d0c 100644 --- a/media/mojo/services/gpu_mojo_media_client.cc +++ b/media/mojo/services/gpu_mojo_media_client.cc
@@ -35,10 +35,6 @@ #include "media/gpu/windows/d3d11_video_decoder.h" #endif // BUILDFLAG(ENABLE_D3D11_VIDEO_DECODER) -#if BUILDFLAG(ENABLE_LIBRARY_CDMS) -#include "media/cdm/cdm_proxy.h" -#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) - namespace media { namespace { @@ -89,11 +85,13 @@ const gpu::GpuPreferences& gpu_preferences, scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner, base::WeakPtr<MediaGpuChannelManager> media_gpu_channel_manager, - AndroidOverlayMojoFactoryCB android_overlay_factory_cb) + AndroidOverlayMojoFactoryCB android_overlay_factory_cb, + CdmProxyFactoryCB cdm_proxy_factory_cb) : gpu_preferences_(gpu_preferences), gpu_task_runner_(std::move(gpu_task_runner)), media_gpu_channel_manager_(std::move(media_gpu_channel_manager)), - android_overlay_factory_cb_(std::move(android_overlay_factory_cb)) {} + android_overlay_factory_cb_(std::move(android_overlay_factory_cb)), + cdm_proxy_factory_cb_(std::move(cdm_proxy_factory_cb)) {} GpuMojoMediaClient::~GpuMojoMediaClient() = default; @@ -148,8 +146,11 @@ } #if BUILDFLAG(ENABLE_LIBRARY_CDMS) -std::unique_ptr<CdmProxy> GpuMojoMediaClient::CreateCdmProxy() { - // TODO(rkuroiwa): Create the CdmProxy here. +std::unique_ptr<CdmProxy> GpuMojoMediaClient::CreateCdmProxy( + const std::string& cdm_guid) { + if (cdm_proxy_factory_cb_) + return cdm_proxy_factory_cb_.Run(cdm_guid); + return nullptr; } #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
diff --git a/media/mojo/services/gpu_mojo_media_client.h b/media/mojo/services/gpu_mojo_media_client.h index cb1f5bf7..eda075d 100644 --- a/media/mojo/services/gpu_mojo_media_client.h +++ b/media/mojo/services/gpu_mojo_media_client.h
@@ -13,6 +13,7 @@ #include "base/single_thread_task_runner.h" #include "gpu/command_buffer/service/gpu_preferences.h" #include "media/base/android_overlay_mojo_factory.h" +#include "media/cdm/cdm_proxy.h" #include "media/mojo/services/mojo_media_client.h" namespace media { @@ -23,11 +24,14 @@ public: // |media_gpu_channel_manager| must only be used on |gpu_task_runner|, which // is expected to be the GPU main thread task runner. + // |cdm_proxy_factory_cb| can be used to create a CdmProxy. May be null if + // CdmProxy is not supported on the platform. GpuMojoMediaClient( const gpu::GpuPreferences& gpu_preferences, scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner, base::WeakPtr<MediaGpuChannelManager> media_gpu_channel_manager, - AndroidOverlayMojoFactoryCB android_overlay_factory_cb); + AndroidOverlayMojoFactoryCB android_overlay_factory_cb, + CdmProxyFactoryCB cdm_proxy_factory_cb); ~GpuMojoMediaClient() final; // MojoMediaClient implementation. @@ -42,7 +46,7 @@ std::unique_ptr<CdmFactory> CreateCdmFactory( service_manager::mojom::InterfaceProvider* interface_provider) final; #if BUILDFLAG(ENABLE_LIBRARY_CDMS) - std::unique_ptr<CdmProxy> CreateCdmProxy() final; + std::unique_ptr<CdmProxy> CreateCdmProxy(const std::string& cdm_guid) final; #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) private: @@ -50,6 +54,7 @@ scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; base::WeakPtr<MediaGpuChannelManager> media_gpu_channel_manager_; AndroidOverlayMojoFactoryCB android_overlay_factory_cb_; + CdmProxyFactoryCB cdm_proxy_factory_cb_; DISALLOW_COPY_AND_ASSIGN(GpuMojoMediaClient); };
diff --git a/media/mojo/services/interface_factory_impl.cc b/media/mojo/services/interface_factory_impl.cc index 04e8836..a486c05 100644 --- a/media/mojo/services/interface_factory_impl.cc +++ b/media/mojo/services/interface_factory_impl.cc
@@ -4,6 +4,7 @@ #include "media/mojo/services/interface_factory_impl.h" +#include "base/guid.h" #include "base/logging.h" #include "base/memory/ptr_util.h" #include "base/single_thread_task_runner.h" @@ -189,9 +190,15 @@ #endif // BUILDFLAG(ENABLE_MOJO_CDM) } -void InterfaceFactoryImpl::CreateCdmProxy(mojom::CdmProxyRequest request) { +void InterfaceFactoryImpl::CreateCdmProxy(const std::string& cdm_guid, + mojom::CdmProxyRequest request) { #if BUILDFLAG(ENABLE_LIBRARY_CDMS) - auto cdm_proxy = mojo_media_client_->CreateCdmProxy(); + if (!base::IsValidGUID(cdm_guid)) { + DLOG(ERROR) << "Invalid CDM GUID: " << cdm_guid; + return; + } + + auto cdm_proxy = mojo_media_client_->CreateCdmProxy(cdm_guid); if (!cdm_proxy) { DLOG(ERROR) << "CdmProxy creation failed."; return;
diff --git a/media/mojo/services/interface_factory_impl.h b/media/mojo/services/interface_factory_impl.h index 7a8af26f..5b49cb0 100644 --- a/media/mojo/services/interface_factory_impl.h +++ b/media/mojo/services/interface_factory_impl.h
@@ -39,7 +39,8 @@ mojom::RendererRequest request) final; void CreateCdm(const std::string& key_system, mojom::ContentDecryptionModuleRequest request) final; - void CreateCdmProxy(mojom::CdmProxyRequest request) final; + void CreateCdmProxy(const std::string& cdm_guid, + mojom::CdmProxyRequest request) final; private: #if BUILDFLAG(ENABLE_MOJO_RENDERER)
diff --git a/media/mojo/services/media_service_factory.cc b/media/mojo/services/media_service_factory.cc index 7cee4e8..0584ada 100644 --- a/media/mojo/services/media_service_factory.cc +++ b/media/mojo/services/media_service_factory.cc
@@ -32,11 +32,13 @@ const gpu::GpuPreferences& gpu_preferences, scoped_refptr<base::SingleThreadTaskRunner> task_runner, base::WeakPtr<MediaGpuChannelManager> media_gpu_channel_manager, - AndroidOverlayMojoFactoryCB android_overlay_factory_cb) { + AndroidOverlayMojoFactoryCB android_overlay_factory_cb, + CdmProxyFactoryCB cdm_proxy_factory_cb) { return std::unique_ptr<service_manager::Service>( new MediaService(base::MakeUnique<GpuMojoMediaClient>( gpu_preferences, task_runner, media_gpu_channel_manager, - std::move(android_overlay_factory_cb)))); + std::move(android_overlay_factory_cb), + std::move(cdm_proxy_factory_cb)))); } std::unique_ptr<service_manager::Service> CreateMediaServiceForTesting() {
diff --git a/media/mojo/services/media_service_factory.h b/media/mojo/services/media_service_factory.h index 4a0dc51..2c0e7ad6 100644 --- a/media/mojo/services/media_service_factory.h +++ b/media/mojo/services/media_service_factory.h
@@ -12,6 +12,7 @@ #include "base/single_thread_task_runner.h" #include "gpu/command_buffer/service/gpu_preferences.h" #include "media/base/android_overlay_mojo_factory.h" +#include "media/cdm/cdm_proxy.h" #include "media/mojo/services/media_mojo_export.h" #include "services/service_manager/public/cpp/service.h" @@ -28,12 +29,15 @@ // Creates a MediaService instance using the GpuMojoMediaClient. // |media_gpu_channel_manager| must only be used on |task_runner|, which is // expected to be the GPU main thread task runner. +// |cdm_proxy_factory_cb| can be used to create a CdmProxy. May be null if +// CdmProxy is not supported on the platform. std::unique_ptr<service_manager::Service> MEDIA_MOJO_EXPORT CreateGpuMediaService( const gpu::GpuPreferences& gpu_preferences, scoped_refptr<base::SingleThreadTaskRunner> task_runner, base::WeakPtr<MediaGpuChannelManager> media_gpu_channel_manager, - AndroidOverlayMojoFactoryCB android_overlay_factory_cb); + AndroidOverlayMojoFactoryCB android_overlay_factory_cb, + CdmProxyFactoryCB cdm_proxy_factory_cb); // Creates a MediaService instance using the TestMojoMediaClient. std::unique_ptr<service_manager::Service> MEDIA_MOJO_EXPORT
diff --git a/media/mojo/services/mojo_media_client.cc b/media/mojo/services/mojo_media_client.cc index 315a3da..d0d2450 100644 --- a/media/mojo/services/mojo_media_client.cc +++ b/media/mojo/services/mojo_media_client.cc
@@ -61,7 +61,8 @@ } #if BUILDFLAG(ENABLE_LIBRARY_CDMS) -std::unique_ptr<CdmProxy> MojoMediaClient::CreateCdmProxy() { +std::unique_ptr<CdmProxy> MojoMediaClient::CreateCdmProxy( + const std::string& cdm_guid) { return nullptr; } #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
diff --git a/media/mojo/services/mojo_media_client.h b/media/mojo/services/mojo_media_client.h index 37ac2779..03976222 100644 --- a/media/mojo/services/mojo_media_client.h +++ b/media/mojo/services/mojo_media_client.h
@@ -86,7 +86,7 @@ #if BUILDFLAG(ENABLE_LIBRARY_CDMS) // Creates a CdmProxy that proxies part of CDM functionalities to a different // entity, e.g. hardware CDM modules. - virtual std::unique_ptr<CdmProxy> CreateCdmProxy(); + virtual std::unique_ptr<CdmProxy> CreateCdmProxy(const std::string& cdm_guid); #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) #if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION)
diff --git a/media/remoting/BUILD.gn b/media/remoting/BUILD.gn index b98c682..b7dfea0 100644 --- a/media/remoting/BUILD.gn +++ b/media/remoting/BUILD.gn
@@ -60,6 +60,7 @@ deps = [ "//base", "//media", + "//media/mojo/common", "//media/mojo/interfaces:remoting", "//mojo/public/cpp/bindings", "//ui/gfx", @@ -92,6 +93,7 @@ "//base", "//base/test:test_support", "//media:test_support", + "//media/mojo/common", "//media/mojo/interfaces:remoting", "//testing/gmock", "//testing/gtest",
diff --git a/media/remoting/demuxer_stream_adapter.cc b/media/remoting/demuxer_stream_adapter.cc index 7eba9d07..e7f2cdd 100644 --- a/media/remoting/demuxer_stream_adapter.cc +++ b/media/remoting/demuxer_stream_adapter.cc
@@ -50,11 +50,9 @@ read_until_count_(0), last_count_(0), pending_flush_(false), - current_pending_frame_offset_(0), pending_frame_is_eos_(false), - write_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::MANUAL), media_status_(DemuxerStream::kOk), - producer_handle_(std::move(producer_handle)), + data_pipe_writer_(std::move(producer_handle)), bytes_written_to_pipe_(0), request_buffer_weak_factory_(this), weak_factory_(this) { @@ -99,8 +97,6 @@ return base::nullopt; // Cleans up pending frame data. - pending_frame_.clear(); - current_pending_frame_offset_ = 0; pending_frame_is_eos_ = false; // Invalidates pending Read() tasks. request_buffer_weak_factory_.InvalidateWeakPtrs(); @@ -193,15 +189,6 @@ main_task_runner_->PostTask( FROM_HERE, base::Bind(&RpcBroker::SendMessageToRemote, rpc_broker_, base::Passed(&rpc))); - - // Starts Mojo watcher. - if (!write_watcher_.IsWatching()) { - DEMUXER_VLOG(2) << "Start Mojo data pipe watcher"; - write_watcher_.Watch(producer_handle_.get(), MOJO_HANDLE_SIGNAL_WRITABLE, - base::Bind(&DemuxerStreamAdapter::TryWriteData, - weak_factory_.GetWeakPtr())); - write_watcher_.ArmOrNotify(); - } } void DemuxerStreamAdapter::ReadUntil(std::unique_ptr<pb::RpcMessage> message) { @@ -297,64 +284,39 @@ case DemuxerStream::kOk: { media_status_ = status; DCHECK(pending_frame_.empty()); - if (!producer_handle_.is_valid()) + if (!data_pipe_writer_.IsPipeValid()) return; // Do not start sending (due to previous fatal error). pending_frame_ = DecoderBufferToByteArray(*input); pending_frame_is_eos_ = input->end_of_stream(); - TryWriteData(MOJO_RESULT_OK); + WriteFrame(); } break; } } -void DemuxerStreamAdapter::TryWriteData(MojoResult result) { +void DemuxerStreamAdapter::WriteFrame() { DCHECK(media_task_runner_->BelongsToCurrentThread()); - // The Mojo watcher will also call TryWriteData() sometimes as a notification - // that data pipe is ready. But that does not necessarily mean the data for a - // read request is ready to be written into the pipe. - if (!is_processing_read_request() || pending_flush_) { - DEMUXER_VLOG(3) << "Skip actions since it's not in the reading state"; - return; - } + DCHECK(!pending_flush_); + DCHECK(is_processing_read_request()); + DCHECK(!pending_frame_.empty()); - if (pending_frame_.empty()) { - DEMUXER_VLOG(3) << "No data available, waiting for demuxer"; - return; - } - - if (!stream_sender_ || !producer_handle_.is_valid()) { + if (!stream_sender_ || !data_pipe_writer_.IsPipeValid()) { DEMUXER_VLOG(1) << "Ignore since data pipe stream sender is invalid"; return; } - uint32_t num_bytes = pending_frame_.size() - current_pending_frame_offset_; - MojoResult mojo_result = producer_handle_->WriteData( - pending_frame_.data() + current_pending_frame_offset_, &num_bytes, - MOJO_WRITE_DATA_FLAG_NONE); - if (mojo_result != MOJO_RESULT_OK && mojo_result != MOJO_RESULT_SHOULD_WAIT) { - DEMUXER_VLOG(1) << "Pipe was closed unexpectedly (or a bug). result:" - << mojo_result; + stream_sender_->SendFrame(pending_frame_.size()); + data_pipe_writer_.Write(pending_frame_.data(), pending_frame_.size(), + base::BindOnce(&DemuxerStreamAdapter::OnFrameWritten, + base::Unretained(this))); +} + +void DemuxerStreamAdapter::OnFrameWritten(bool success) { + if (!success) { OnFatalError(MOJO_PIPE_ERROR); return; } - write_watcher_.ArmOrNotify(); - if (mojo_result != MOJO_RESULT_OK) - return; - - stream_sender_->ConsumeDataChunk(current_pending_frame_offset_, num_bytes, - pending_frame_.size()); - current_pending_frame_offset_ += num_bytes; - bytes_written_to_pipe_ += num_bytes; - - // Checks if all buffer was written to browser process. - if (current_pending_frame_offset_ != pending_frame_.size()) { - // Returns and wait for mojo watcher to notify to write more data. - return; - } - - // Signal mojo remoting service that all frame buffer is written to data pipe. - stream_sender_->SendFrame(); - + bytes_written_to_pipe_ += pending_frame_.size(); // Resets frame buffer variables. bool pending_frame_is_eos = pending_frame_is_eos_; ++last_count_; @@ -424,7 +386,6 @@ void DemuxerStreamAdapter::ResetPendingFrame() { DCHECK(media_task_runner_->BelongsToCurrentThread()); - current_pending_frame_offset_ = 0; pending_frame_.clear(); pending_frame_is_eos_ = false; } @@ -437,10 +398,7 @@ if (error_callback_.is_null()) return; - if (write_watcher_.IsWatching()) { - DEMUXER_VLOG(2) << "Cancel mojo data pipe watcher"; - write_watcher_.Cancel(); - } + data_pipe_writer_.Close(); base::ResetAndReturn(&error_callback_).Run(stop_trigger); }
diff --git a/media/remoting/demuxer_stream_adapter.h b/media/remoting/demuxer_stream_adapter.h index e04a65d..05e8617 100644 --- a/media/remoting/demuxer_stream_adapter.h +++ b/media/remoting/demuxer_stream_adapter.h
@@ -17,6 +17,7 @@ #include "media/base/audio_decoder_config.h" #include "media/base/demuxer_stream.h" #include "media/base/video_decoder_config.h" +#include "media/mojo/common/mojo_data_pipe_read_write.h" #include "media/mojo/interfaces/remoting.mojom.h" #include "media/remoting/rpc_broker.h" #include "media/remoting/triggers.h" @@ -113,7 +114,10 @@ // Callback function when retrieving data from demuxer. void OnNewBuffer(DemuxerStream::Status status, const scoped_refptr<DecoderBuffer>& input); - void TryWriteData(MojoResult result); + // Write the current frame into the mojo data pipe. OnFrameWritten() will be + // called when the writing has finished. + void WriteFrame(); + void OnFrameWritten(bool success); void ResetPendingFrame(); // Callback function when a fatal runtime error occurs. @@ -169,19 +173,15 @@ // Frame buffer and its information that is currently in process of writing to // Mojo data pipe. std::vector<uint8_t> pending_frame_; - uint32_t current_pending_frame_offset_; bool pending_frame_is_eos_; - // Monitor if data pipe is available to write data. - mojo::SimpleWatcher write_watcher_; - // Keeps latest demuxer stream status and audio/video decoder config. DemuxerStream::Status media_status_; AudioDecoderConfig audio_config_; VideoDecoderConfig video_config_; mojom::RemotingDataStreamSenderPtr stream_sender_; - mojo::ScopedDataPipeProducerHandle producer_handle_; + MojoDataPipeWriter data_pipe_writer_; // Tracks the number of bytes written to the pipe. int64_t bytes_written_to_pipe_;
diff --git a/media/remoting/demuxer_stream_adapter_unittest.cc b/media/remoting/demuxer_stream_adapter_unittest.cc index f9c66758..e91d1b1 100644 --- a/media/remoting/demuxer_stream_adapter_unittest.cc +++ b/media/remoting/demuxer_stream_adapter_unittest.cc
@@ -177,6 +177,7 @@ } TEST_F(DemuxerStreamAdapterTest, WriteOneFrameSmallerThanCapacity) { + EXPECT_CALL(*demuxer_stream_, Read(_)).Times(1); // Sends a frame with size 50 bytes, pts = 1 and key frame. demuxer_stream_->CreateFakeFrame(50, true, 1 /* pts */); demuxer_stream_adapter_->FakeReadUntil(1, 999); @@ -184,7 +185,6 @@ // Checks if it's sent to consumer side and data is correct ASSERT_EQ(data_stream_sender_->send_frame_count(), 1U); - ASSERT_EQ(data_stream_sender_->consume_data_chunk_count(), 1U); ASSERT_TRUE(data_stream_sender_->ValidateFrameBuffer(0, 50, true, 1)); pb::RpcMessage* last_rpc = demuxer_stream_adapter_->last_received_rpc(); ASSERT_TRUE(last_rpc); @@ -194,6 +194,7 @@ } TEST_F(DemuxerStreamAdapterTest, WriteOneFrameLargerThanCapacity) { + EXPECT_CALL(*demuxer_stream_, Read(_)).Times(1); // Sends a frame with size 800 bytes, pts = 1 and key frame. demuxer_stream_->CreateFakeFrame(800, true, 1 /* pts */); demuxer_stream_adapter_->FakeReadUntil(1, 999); @@ -201,7 +202,6 @@ // Checks if it's sent to consumer side and data is correct ASSERT_EQ(data_stream_sender_->send_frame_count(), 1U); - ASSERT_EQ(data_stream_sender_->consume_data_chunk_count(), 4U); ASSERT_TRUE(data_stream_sender_->ValidateFrameBuffer(0, 800, true, 1)); pb::RpcMessage* last_rpc = demuxer_stream_adapter_->last_received_rpc(); ASSERT_TRUE(last_rpc); @@ -211,6 +211,7 @@ } TEST_F(DemuxerStreamAdapterTest, SendFrameAndSignalFlushMix) { + EXPECT_CALL(*demuxer_stream_, Read(_)).Times(4); // Sends a frame with size 50 bytes, pts = 1 and key frame. demuxer_stream_->CreateFakeFrame(50, true, 1 /* pts */); // Issues ReadUntil request with frame count up to 1 (fetch #0).
diff --git a/media/remoting/end2end_test_renderer.cc b/media/remoting/end2end_test_renderer.cc index 6c6cb8ee..f93fd1af4 100644 --- a/media/remoting/end2end_test_renderer.cc +++ b/media/remoting/end2end_test_renderer.cc
@@ -8,6 +8,7 @@ #include "base/bind_helpers.h" #include "base/callback.h" #include "base/threading/thread_task_runner_handle.h" +#include "media/mojo/common/mojo_data_pipe_read_write.h" #include "media/mojo/interfaces/remoting.mojom.h" #include "media/remoting/courier_renderer.h" #include "media/remoting/proto_utils.h" @@ -30,35 +31,32 @@ DemuxerStream::Type type, const SendFrameToSinkCallback& callback) : binding_(this, std::move(request)), - consumer_handle_(std::move(handle)), + data_pipe_reader_(std::move(handle)), type_(type), send_frame_to_sink_cb_(callback) {} ~TestStreamSender() override = default; // mojom::RemotingDataStreamSender implementation. - - void ConsumeDataChunk(uint32_t offset, - uint32_t size, - uint32_t total_payload_size) override { - next_frame_data_.resize(total_payload_size); - MojoResult result = - consumer_handle_->ReadData(next_frame_data_.data() + offset, &size, - MOJO_READ_DATA_FLAG_ALL_OR_NONE); - CHECK(result == MOJO_RESULT_OK); - } - - void SendFrame() override { - if (!send_frame_to_sink_cb_.is_null()) - send_frame_to_sink_cb_.Run(next_frame_data_, type_); - next_frame_data_.resize(0); + void SendFrame(uint32_t frame_size) override { + next_frame_data_.resize(frame_size); + data_pipe_reader_.Read( + next_frame_data_.data(), frame_size, + base::BindOnce(&TestStreamSender::OnFrameRead, base::Unretained(this))); } void CancelInFlightData() override { next_frame_data_.resize(0); } private: + void OnFrameRead(bool success) { + DCHECK(success); + if (!send_frame_to_sink_cb_.is_null()) + send_frame_to_sink_cb_.Run(next_frame_data_, type_); + next_frame_data_.resize(0); + } + mojo::Binding<RemotingDataStreamSender> binding_; - mojo::ScopedDataPipeConsumerHandle consumer_handle_; + MojoDataPipeReader data_pipe_reader_; const DemuxerStream::Type type_; const SendFrameToSinkCallback send_frame_to_sink_cb_; std::vector<uint8_t> next_frame_data_;
diff --git a/media/remoting/fake_remoter.cc b/media/remoting/fake_remoter.cc index 10c6257e..d96982e4 100644 --- a/media/remoting/fake_remoter.cc +++ b/media/remoting/fake_remoter.cc
@@ -26,15 +26,13 @@ mojom::RemotingDataStreamSenderRequest request, mojo::ScopedDataPipeConsumerHandle consumer_handle) : binding_(this, std::move(request)), - consumer_handle_(std::move(consumer_handle)), - consume_data_chunk_count_(0), + data_pipe_reader_(std::move(consumer_handle)), send_frame_count_(0), cancel_in_flight_count_(0) {} FakeRemotingDataStreamSender::~FakeRemotingDataStreamSender() = default; void FakeRemotingDataStreamSender::ResetHistory() { - consume_data_chunk_count_ = 0; send_frame_count_ = 0; cancel_in_flight_count_ = 0; next_frame_data_.resize(0); @@ -94,18 +92,17 @@ #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING_RPC) } -void FakeRemotingDataStreamSender::ConsumeDataChunk( - uint32_t offset, - uint32_t size, - uint32_t total_payload_size) { - next_frame_data_.resize(total_payload_size); - MojoResult result = consumer_handle_->ReadData( - next_frame_data_.data() + offset, &size, MOJO_READ_DATA_FLAG_ALL_OR_NONE); - CHECK(result == MOJO_RESULT_OK); - ++consume_data_chunk_count_; +void FakeRemotingDataStreamSender::SendFrame(uint32_t frame_size) { + next_frame_data_.resize(frame_size); + data_pipe_reader_.Read( + next_frame_data_.data(), frame_size, + base::BindOnce(&FakeRemotingDataStreamSender::OnFrameRead, + base::Unretained(this))); } -void FakeRemotingDataStreamSender::SendFrame() { +void FakeRemotingDataStreamSender::OnFrameRead(bool success) { + EXPECT_TRUE(success); + ++send_frame_count_; received_frame_list.push_back(std::move(next_frame_data_)); EXPECT_EQ(send_frame_count_, received_frame_list.size());
diff --git a/media/remoting/fake_remoter.h b/media/remoting/fake_remoter.h index ae8f96c..b3a0fb4f 100644 --- a/media/remoting/fake_remoter.h +++ b/media/remoting/fake_remoter.h
@@ -6,6 +6,7 @@ #define MEDIA_REMOTING_FAKE_REMOTER_H_ #include "media/base/decoder_buffer.h" +#include "media/mojo/common/mojo_data_pipe_read_write.h" #include "media/mojo/interfaces/remoting.mojom.h" #include "mojo/public/cpp/bindings/binding.h" @@ -21,9 +22,6 @@ mojo::ScopedDataPipeConsumerHandle consumer_handle); ~FakeRemotingDataStreamSender() override; - uint32_t consume_data_chunk_count() const { - return consume_data_chunk_count_; - } uint32_t send_frame_count() const { return send_frame_count_; } uint32_t cancel_in_flight_count() const { return cancel_in_flight_count_; } void ResetHistory(); @@ -34,18 +32,16 @@ private: // mojom::RemotingDataStreamSender implementation. - void ConsumeDataChunk(uint32_t offset, - uint32_t size, - uint32_t total_payload_size) final; - void SendFrame() final; + void SendFrame(uint32_t frame_size) final; void CancelInFlightData() final; + void OnFrameRead(bool success); + mojo::Binding<RemotingDataStreamSender> binding_; - mojo::ScopedDataPipeConsumerHandle consumer_handle_; + MojoDataPipeReader data_pipe_reader_; std::vector<uint8_t> next_frame_data_; std::vector<std::vector<uint8_t>> received_frame_list; - uint32_t consume_data_chunk_count_; uint32_t send_frame_count_; uint32_t cancel_in_flight_count_;
diff --git a/media/test/data/eme_player.html b/media/test/data/eme_player.html index 4b73da8..fb7fe54c 100644 --- a/media/test/data/eme_player.html +++ b/media/test/data/eme_player.html
@@ -75,13 +75,6 @@ if (video.currentTime < 1) return; - // Renewal message may be fired around the start of playback; check for it - // after a delay to avoid timing issues. - if (testConfig.keySystem == EXTERNAL_CLEARKEY_RENEWAL && - !video.receivedRenewalMessage) { - Utils.failTest('license-renewal message not received.'); - } - Utils.timeLog('waiting for video to end.'); video.removeEventListener('ended', Utils.failTest); Utils.installTitleEventHandler(video, 'ended');
diff --git a/media/test/data/eme_player_js/clearkey_player.js b/media/test/data/eme_player_js/clearkey_player.js index 2b69199..bf032b4e 100644 --- a/media/test/data/eme_player_js/clearkey_player.js +++ b/media/test/data/eme_player_js/clearkey_player.js
@@ -19,8 +19,6 @@ }; ClearKeyPlayer.prototype.onMessage = function(message) { - Utils.timeLog('MediaKeySession onMessage', message); - const mediaKeySession = message.target; const keyId = Utils.extractFirstLicenseKeyId(message.message); const key = Utils.getDefaultKey(this.testConfig.forceInvalidResponse); @@ -36,12 +34,12 @@ mediaKeySession.update(jwkSet).then(function() { // Check session expiration. // - For CLEARKEY, expiration is not set and is the default value NaN. - // - For EXTERNAL_CLEARKEY_RENEWAL, expiration is set to + // - For MESSAGE_TYPE_TEST_KEYSYSTEM, expiration is set to // ECK_RENEWAL_EXPIRATION milliseconds after 01 January 1970 UTC. // - For other EXTERNAL_CLEARKEY variants, expiration is explicitly set to // NaN. var expiration = mediaKeySession.expiration; - if (keySystem == EXTERNAL_CLEARKEY_RENEWAL) { + if (keySystem == MESSAGE_TYPE_TEST_KEYSYSTEM) { if (isNaN(expiration) || expiration != ECK_RENEWAL_EXPIRATION) { Utils.timeLog('Unexpected expiration: ', expiration); Utils.failTest(error, EME_UPDATE_FAILED);
diff --git a/media/test/data/eme_player_js/globals.js b/media/test/data/eme_player_js/globals.js index 3d9d47b..510d96b 100644 --- a/media/test/data/eme_player_js/globals.js +++ b/media/test/data/eme_player_js/globals.js
@@ -39,7 +39,8 @@ var WIDEVINE_KEYSYSTEM = 'com.widevine.alpha'; var CLEARKEY = 'org.w3.clearkey'; var EXTERNAL_CLEARKEY = 'org.chromium.externalclearkey'; -var EXTERNAL_CLEARKEY_RENEWAL = 'org.chromium.externalclearkey.renewal'; +var MESSAGE_TYPE_TEST_KEYSYSTEM = + 'org.chromium.externalclearkey.messagetypetest'; var FILE_IO_TEST_KEYSYSTEM = 'org.chromium.externalclearkey.fileiotest'; var OUTPUT_PROTECTION_TEST_KEYSYSTEM = 'org.chromium.externalclearkey.outputprotectiontest';
diff --git a/media/test/data/eme_player_js/player_utils.js b/media/test/data/eme_player_js/player_utils.js index f317835..fc7f1405 100644 --- a/media/test/data/eme_player_js/player_utils.js +++ b/media/test/data/eme_player_js/player_utils.js
@@ -48,19 +48,17 @@ // Returns a promise that resolves to the player. PlayerUtils.registerEMEEventListeners = function(player) { player.video.addEventListener('encrypted', function(message) { - function addMediaKeySessionListeners(mediaKeySession) { mediaKeySession.addEventListener('message', function(message) { + Utils.timeLog('MediaKeyMessageEvent: ' + message.messageType); player.video.receivedKeyMessage = true; - if (Utils.isRenewalMessage(message)) { - Utils.timeLog('MediaKeySession onMessage - renewal', message); - player.video.receivedRenewalMessage = true; + if (message.messageType == 'license-request' || + message.messageType == 'license-renewal' || + message.messageType == 'individualization-request') { + player.video.receivedMessageTypes.add(message.messageType); } else { - if (message.messageType != 'license-request') { - Utils.failTest('Unexpected message type "' + message.messageType + - '" received.', - EME_MESSAGE_UNEXPECTED_TYPE); - } + Utils.failTest('Unexpected message type:' + message.messageType, + EME_MESSAGE_UNEXPECTED_TYPE); } player.onMessage(message); }); @@ -180,7 +178,7 @@ this.registerDefaultEventListeners(player); player.video.receivedKeyMessage = false; - player.video.receivedRenewalMessage = false; + player.video.receivedMessageTypes = new Set(); Utils.timeLog('Setting video media keys: ' + player.testConfig.keySystem); var config = { @@ -290,7 +288,7 @@ return WidevinePlayer; case CLEARKEY: case EXTERNAL_CLEARKEY: - case EXTERNAL_CLEARKEY_RENEWAL: + case MESSAGE_TYPE_TEST_KEYSYSTEM: case CRASH_TEST_KEYSYSTEM: return ClearKeyPlayer; case FILE_IO_TEST_KEYSYSTEM:
diff --git a/media/test/data/eme_player_js/utils.js b/media/test/data/eme_player_js/utils.js index c74bfb2..256788d 100644 --- a/media/test/data/eme_player_js/utils.js +++ b/media/test/data/eme_player_js/utils.js
@@ -192,10 +192,6 @@ }, false); }; -Utils.isRenewalMessage = function(message) { - return (message.messageType == 'license-renewal'); -}; - Utils.resetTitleChange = function() { this.titleChanged = false; document.title = '';
diff --git a/media/test/data/eme_player_js/widevine_player.js b/media/test/data/eme_player_js/widevine_player.js index d393720..e0cd01d 100644 --- a/media/test/data/eme_player_js/widevine_player.js +++ b/media/test/data/eme_player_js/widevine_player.js
@@ -19,7 +19,6 @@ }; WidevinePlayer.prototype.onMessage = function(message) { - Utils.timeLog('MediaKeySession onMessage', message); var mediaKeySession = message.target; function onSuccess(response) { var key = new Uint8Array(response);
diff --git a/media/test/pipeline_integration_fuzzertest.cc b/media/test/pipeline_integration_fuzzertest.cc index d2f01da..348cf82 100644 --- a/media/test/pipeline_integration_fuzzertest.cc +++ b/media/test/pipeline_integration_fuzzertest.cc
@@ -12,7 +12,6 @@ #include "base/command_line.h" #include "base/location.h" #include "base/logging.h" -#include "base/metrics/statistics_recorder.h" #include "base/threading/thread_task_runner_handle.h" #include "media/base/bind_to_current_loop.h" #include "media/base/eme_constants.h" @@ -221,11 +220,6 @@ // Media pipeline starts new threads, which needs AtExitManager. base::AtExitManager at_exit; - // Required to avoid leaking histogram memory over long fuzzing runs. Must be - // installed before any histograms are acquired. This is safe to call multiple - // times. - base::StatisticsRecorder::Initialize(); - // Media pipeline checks command line arguments internally. base::CommandLine::Init(0, nullptr);
diff --git a/media/test/run_all_unittests.cc b/media/test/run_all_unittests.cc index ac2abc6..bfd3ed4d 100644 --- a/media/test/run_all_unittests.cc +++ b/media/test/run_all_unittests.cc
@@ -4,7 +4,6 @@ #include "base/bind.h" #include "base/command_line.h" -#include "base/metrics/statistics_recorder.h" #include "base/test/launcher/unit_test_launcher.h" #include "base/test/test_discardable_memory_allocator.h" #include "base/test/test_suite.h" @@ -34,9 +33,6 @@ // Run TestSuite::Initialize first so that logging is initialized. base::TestSuite::Initialize(); - // Ensure histograms hit during tests are registered properly. - base::StatisticsRecorder::Initialize(); - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); command_line->AppendSwitch(switches::kEnableInbandTextTracks);
diff --git a/media/video/gpu_video_accelerator_factories.h b/media/video/gpu_video_accelerator_factories.h index 1beb38f..c4fb0a0 100644 --- a/media/video/gpu_video_accelerator_factories.h +++ b/media/video/gpu_video_accelerator_factories.h
@@ -110,7 +110,10 @@ gfx::BufferUsage usage) = 0; virtual bool ShouldUseGpuMemoryBuffersForVideoFrames() const = 0; + + // The GLContextLock must be taken when calling this. virtual unsigned ImageTextureTarget(gfx::BufferFormat format) = 0; + // Pixel format of the hardware video frames created when GpuMemoryBuffers // video frames are enabled. virtual OutputFormat VideoFrameOutputFormat() = 0;
diff --git a/mojo/edk/system/core.cc b/mojo/edk/system/core.cc index d96cf4b..4863856 100644 --- a/mojo/edk/system/core.cc +++ b/mojo/edk/system/core.cc
@@ -1005,8 +1005,14 @@ MojoResult Core::UnmapBuffer(void* buffer) { RequestContext request_context; - base::AutoLock lock(mapping_table_lock_); - return mapping_table_.RemoveMapping(buffer); + std::unique_ptr<PlatformSharedBufferMapping> mapping; + MojoResult result; + // Destroy |mapping| while not holding the lock. + { + base::AutoLock lock(mapping_table_lock_); + result = mapping_table_.RemoveMapping(buffer, &mapping); + } + return result; } MojoResult Core::WrapPlatformHandle(const MojoPlatformHandle* platform_handle,
diff --git a/mojo/edk/system/mapping_table.cc b/mojo/edk/system/mapping_table.cc index 4b8fa61..4b28282 100644 --- a/mojo/edk/system/mapping_table.cc +++ b/mojo/edk/system/mapping_table.cc
@@ -34,13 +34,14 @@ return MOJO_RESULT_OK; } -MojoResult MappingTable::RemoveMapping(void* address) { +MojoResult MappingTable::RemoveMapping( + void* address, + std::unique_ptr<PlatformSharedBufferMapping>* mapping) { AddressToMappingMap::iterator it = address_to_mapping_map_.find(address); if (it == address_to_mapping_map_.end()) return MOJO_RESULT_INVALID_ARGUMENT; - PlatformSharedBufferMapping* mapping_to_delete = it->second; + mapping->reset(it->second); address_to_mapping_map_.erase(it); - delete mapping_to_delete; return MOJO_RESULT_OK; }
diff --git a/mojo/edk/system/mapping_table.h b/mojo/edk/system/mapping_table.h index 00167e3..81cc56bb 100644 --- a/mojo/edk/system/mapping_table.h +++ b/mojo/edk/system/mapping_table.h
@@ -39,7 +39,9 @@ // Tries to add a mapping. (Takes ownership of the mapping in all cases; on // failure, it will be destroyed.) MojoResult AddMapping(std::unique_ptr<PlatformSharedBufferMapping> mapping); - MojoResult RemoveMapping(void* address); + MojoResult RemoveMapping( + void* address, + std::unique_ptr<PlatformSharedBufferMapping>* mapping); private: friend bool internal::ShutdownCheckNoLeaks(Core*);
diff --git a/mojo/public/c/system/buffer.h b/mojo/public/c/system/buffer.h index 285e0d7b..09f6d285 100644 --- a/mojo/public/c/system/buffer.h +++ b/mojo/public/c/system/buffer.h
@@ -148,8 +148,8 @@ // |*buffer| points to memory with the requested part of the buffer. On // failure |*buffer| it is not modified. // -// A single buffer handle may have multiple active mappings The permissions -// (e.g., writable or executable) of the returned memory depend on th +// A single buffer handle may have multiple active mappings. The permissions +// (e.g., writable or executable) of the returned memory depend on the // properties of the buffer and properties attached to the buffer handle, as // well as |flags|. //
diff --git a/mojo/public/cpp/system/BUILD.gn b/mojo/public/cpp/system/BUILD.gn index 71156a5..e93d7278 100644 --- a/mojo/public/cpp/system/BUILD.gn +++ b/mojo/public/cpp/system/BUILD.gn
@@ -28,7 +28,7 @@ "core.h", "data_pipe.h", "file_data_pipe_producer.cc", - "file_data_pipe_producer.g", + "file_data_pipe_producer.h", "functions.h", "handle.h", "handle_signal_tracker.cc",
diff --git a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java index 44a7f003..7c713bf1 100644 --- a/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java +++ b/net/android/java/src/org/chromium/net/AndroidNetworkLibrary.java
@@ -5,7 +5,6 @@ package org.chromium.net; import android.annotation.TargetApi; -import android.content.ActivityNotFoundException; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -19,7 +18,6 @@ import android.net.wifi.WifiManager; import android.os.Build; import android.os.ParcelFileDescriptor; -import android.security.KeyChain; import android.security.NetworkSecurityPolicy; import android.telephony.TelephonyManager; import android.util.Log; @@ -55,35 +53,6 @@ private static final String TAG = "AndroidNetworkLibrary"; /** - * Stores the key pair through the CertInstaller activity. - * @param publicKey The public key bytes as DER-encoded SubjectPublicKeyInfo (X.509) - * @param privateKey The private key as DER-encoded PrivateKeyInfo (PKCS#8). - * @return: true on success, false on failure. - * - * Note that failure means that the function could not launch the CertInstaller - * activity. Whether the keys are valid or properly installed will be indicated - * by the CertInstaller UI itself. - */ - @CalledByNative - public static boolean storeKeyPair(byte[] publicKey, byte[] privateKey) { - // TODO(digit): Use KeyChain official extra values to pass the public and private - // keys when they're available. The "KEY" and "PKEY" hard-coded constants were taken - // from the platform sources, since there are no official KeyChain.EXTRA_XXX definitions - // for them. b/5859651 - try { - Intent intent = KeyChain.createInstallIntent(); - intent.putExtra("PKEY", privateKey); - intent.putExtra("KEY", publicKey); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - ContextUtils.getApplicationContext().startActivity(intent); - return true; - } catch (ActivityNotFoundException e) { - Log.w(TAG, "could not store key pair: " + e); - } - return false; - } - - /** * @return the mime type (if any) that is associated with the file * extension. Returns null if no corresponding mime type exists. */
diff --git a/net/android/network_library.cc b/net/android/network_library.cc index e2cadfd..494288f 100644 --- a/net/android/network_library.cc +++ b/net/android/network_library.cc
@@ -62,22 +62,6 @@ Java_AndroidNetworkLibrary_clearTestRootCertificates(env); } -bool StoreKeyPair(const uint8_t* public_key, - size_t public_len, - const uint8_t* private_key, - size_t private_len) { - JNIEnv* env = AttachCurrentThread(); - ScopedJavaLocalRef<jbyteArray> public_array = - ToJavaByteArray(env, public_key, public_len); - ScopedJavaLocalRef<jbyteArray> private_array = - ToJavaByteArray(env, private_key, private_len); - jboolean ret = - Java_AndroidNetworkLibrary_storeKeyPair(env, public_array, private_array); - LOG_IF(WARNING, !ret) << - "Call to Java_AndroidNetworkLibrary_storeKeyPair failed"; - return ret; -} - bool IsCleartextPermitted(const std::string& host) { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jstring> host_string = ConvertUTF8ToJavaString(env, host);
diff --git a/net/base/fuzzer_test_support.cc b/net/base/fuzzer_test_support.cc index 8e10957..f2a54d5 100644 --- a/net/base/fuzzer_test_support.cc +++ b/net/base/fuzzer_test_support.cc
@@ -6,7 +6,6 @@ #include "base/command_line.h" #include "base/i18n/icu_util.h" #include "base/logging.h" -#include "base/metrics/statistics_recorder.h" #include "base/test/scoped_task_environment.h" namespace { @@ -26,10 +25,6 @@ // asserting when handling non-ASCII urls. CHECK(base::i18n::InitializeICU()); - // Prevent every call to get a Histogram* from leaking memory. Instead, only - // the fist call to get each Histogram* leaks memory. - base::StatisticsRecorder::Initialize(); - // Disable noisy logging as per "libFuzzer in Chrome" documentation: // testing/libfuzzer/getting_started.md#Disable-noisy-error-message-logging. logging::SetMinLogLevel(logging::LOG_FATAL);
diff --git a/net/base/net_error_list.h b/net/base/net_error_list.h index 38c6ea2a3..d1857c2 100644 --- a/net/base/net_error_list.h +++ b/net/base/net_error_list.h
@@ -732,6 +732,10 @@ // The pushed stream claimed by the request is no longer available. NET_ERROR(SPDY_PUSHED_STREAM_NOT_AVAILABLE, -373) +// A pushed stream was claimed and later reset by the server. When this happens, +// the request should be retried. +NET_ERROR(SPDY_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER, -374) + // The cache does not have the requested entry. NET_ERROR(CACHE_MISS, -400)
diff --git a/net/cert/ct_log_response_parser.cc b/net/cert/ct_log_response_parser.cc index b6067d1..81e0f0a 100644 --- a/net/cert/ct_log_response_parser.cc +++ b/net/cert/ct_log_response_parser.cc
@@ -33,7 +33,7 @@ base::JSONValueConverter<JsonSignedTreeHead>* converted); }; -bool ConvertSHA256RootHash(const base::StringPiece& s, std::string* result) { +bool ConvertSHA256RootHash(base::StringPiece s, std::string* result) { if (!base::Base64Decode(s, result)) { DVLOG(1) << "Failed decoding sha256_root_hash"; return false; @@ -48,8 +48,7 @@ return true; } -bool ConvertTreeHeadSignature(const base::StringPiece& s, - DigitallySigned* result) { +bool ConvertTreeHeadSignature(base::StringPiece s, DigitallySigned* result) { std::string tree_head_signature; if (!base::Base64Decode(s, &tree_head_signature)) { DVLOG(1) << "Failed decoding tree_head_signature";
diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc index 7123aac..65255e5e4 100644 --- a/net/disk_cache/simple/simple_entry_impl.cc +++ b/net/disk_cache/simple/simple_entry_impl.cc
@@ -1213,12 +1213,11 @@ state_ = STATE_IO_PENDING; return; } - PostTaskAndReplyWithResult( - worker_pool_.get(), - FROM_HERE, - base::Bind(&SimpleSynchronousEntry::DoomEntry, path_, entry_hash_), - base::Bind( - &SimpleEntryImpl::DoomOperationComplete, this, callback, state_)); + PostTaskAndReplyWithResult(worker_pool_.get(), FROM_HERE, + base::Bind(&SimpleSynchronousEntry::DoomEntry, + path_, cache_type_, entry_hash_), + base::Bind(&SimpleEntryImpl::DoomOperationComplete, + this, callback, state_)); state_ = STATE_IO_PENDING; }
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc index 74b07f63..bf3da7c4 100644 --- a/net/disk_cache/simple/simple_synchronous_entry.cc +++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -292,8 +292,12 @@ // static int SimpleSynchronousEntry::DoomEntry(const FilePath& path, + net::CacheType cache_type, uint64_t entry_hash) { + base::TimeTicks start = base::TimeTicks::Now(); const bool deleted_well = DeleteFilesForEntryHash(path, entry_hash); + SIMPLE_CACHE_UMA(TIMES, "DiskDoomLatency", cache_type, + base::TimeTicks::Now() - start); return deleted_well ? net::OK : net::ERR_FAILED; } @@ -1461,7 +1465,7 @@ void SimpleSynchronousEntry::Doom() const { DCHECK_EQ(0u, entry_file_key_.doom_generation); - DeleteFilesForEntryHash(path_, entry_file_key_.entry_hash); + DoomEntry(path_, cache_type_, entry_file_key_.entry_hash); } // static
diff --git a/net/disk_cache/simple/simple_synchronous_entry.h b/net/disk_cache/simple/simple_synchronous_entry.h index 38779a7e..b2bdde1 100644 --- a/net/disk_cache/simple/simple_synchronous_entry.h +++ b/net/disk_cache/simple/simple_synchronous_entry.h
@@ -179,7 +179,9 @@ // Deletes an entry from the file system without affecting the state of the // corresponding instance, if any (allowing operations to continue to be // executed through that instance). Returns a net error code. - static int DoomEntry(const base::FilePath& path, uint64_t entry_hash); + static int DoomEntry(const base::FilePath& path, + net::CacheType cache_type, + uint64_t entry_hash); // Like |DoomEntry()| above, except that it truncates the entry files rather // than deleting them. Used when dooming entries after the backend has
diff --git a/net/dns/host_cache.cc b/net/dns/host_cache.cc index c0720125..41cab7cd 100644 --- a/net/dns/host_cache.cc +++ b/net/dns/host_cache.cc
@@ -418,19 +418,12 @@ // static std::unique_ptr<HostCache> HostCache::CreateDefaultCache() { -// Cache capacity is determined by the field trial. #if defined(ENABLE_BUILT_IN_DNS) const size_t kDefaultMaxEntries = 1000; #else const size_t kDefaultMaxEntries = 100; #endif - const size_t kSaneMaxEntries = 1 << 20; - size_t max_entries = 0; - base::StringToSizeT(base::FieldTrialList::FindFullName("HostCacheSize"), - &max_entries); - if ((max_entries == 0) || (max_entries > kSaneMaxEntries)) - max_entries = kDefaultMaxEntries; - return std::make_unique<HostCache>(max_entries); + return std::make_unique<HostCache>(kDefaultMaxEntries); } void HostCache::EvictOneEntry(base::TimeTicks now) {
diff --git a/net/dns/host_resolver.h b/net/dns/host_resolver.h index 9ae23b9..87cf01d5 100644 --- a/net/dns/host_resolver.h +++ b/net/dns/host_resolver.h
@@ -180,6 +180,14 @@ AddressList* addresses, const NetLogWithSource& net_log) = 0; + // Like |ResolveFromCache()|, but can return a stale result if the + // implementation supports it. Fills in |*stale_info| if a response is + // returned to indicate how stale (or not) it is. + virtual int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& source_net_log) = 0; + // Enable or disable the built-in asynchronous DnsClient. virtual void SetDnsClientEnabled(bool enabled);
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h index 704fcbb..58300e55c 100644 --- a/net/dns/host_resolver_impl.h +++ b/net/dns/host_resolver_impl.h
@@ -141,6 +141,10 @@ int ResolveFromCache(const RequestInfo& info, AddressList* addresses, const NetLogWithSource& source_net_log) override; + int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& source_net_log) override; void SetDnsClientEnabled(bool enabled) override; HostCache* GetHostCache() override; @@ -150,13 +154,6 @@ std::unique_ptr<base::Value> GetDnsConfigAsValue() const override; - // Like |ResolveFromCache()|, but can return a stale result if the - // implementation supports it. Fills in |*stale_info| if a response is - // returned to indicate how stale (or not) it is. - int ResolveStaleFromCache(const RequestInfo& info, - AddressList* addresses, - HostCache::EntryStaleness* stale_info, - const NetLogWithSource& source_net_log); // Returns the number of host cache entries that were restored, or 0 if there // is no cache. size_t LastRestoredCacheSize() const;
diff --git a/net/dns/host_resolver_mojo.cc b/net/dns/host_resolver_mojo.cc index 583f1fe..b76cbf0 100644 --- a/net/dns/host_resolver_mojo.cc +++ b/net/dns/host_resolver_mojo.cc
@@ -107,6 +107,15 @@ return ResolveFromCacheInternal(info, CacheKeyForRequest(info), addresses); } +int HostResolverMojo::ResolveStaleFromCache( + const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& net_log) { + NOTREACHED(); + return ERR_UNEXPECTED; +} + HostCache* HostResolverMojo::GetHostCache() { return host_cache_.get(); }
diff --git a/net/dns/host_resolver_mojo.h b/net/dns/host_resolver_mojo.h index 4dc4109..80920d2 100644 --- a/net/dns/host_resolver_mojo.h +++ b/net/dns/host_resolver_mojo.h
@@ -43,6 +43,10 @@ int ResolveFromCache(const RequestInfo& info, AddressList* addresses, const NetLogWithSource& source_net_log) override; + int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& source_net_log) override; HostCache* GetHostCache() override; bool HasCached(base::StringPiece hostname, HostCache::Entry::Source* source_out,
diff --git a/net/dns/mapped_host_resolver.cc b/net/dns/mapped_host_resolver.cc index dcb540b1..2a409fa 100644 --- a/net/dns/mapped_host_resolver.cc +++ b/net/dns/mapped_host_resolver.cc
@@ -43,6 +43,19 @@ return impl_->ResolveFromCache(info, addresses, net_log); } +int MappedHostResolver::ResolveStaleFromCache( + const RequestInfo& original_info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& net_log) { + RequestInfo info = original_info; + int rv = ApplyRules(&info); + if (rv != OK) + return rv; + + return impl_->ResolveStaleFromCache(info, addresses, stale_info, net_log); +} + void MappedHostResolver::SetDnsClientEnabled(bool enabled) { impl_->SetDnsClientEnabled(enabled); }
diff --git a/net/dns/mapped_host_resolver.h b/net/dns/mapped_host_resolver.h index 464edd8..559aa3e 100644 --- a/net/dns/mapped_host_resolver.h +++ b/net/dns/mapped_host_resolver.h
@@ -54,6 +54,10 @@ int ResolveFromCache(const RequestInfo& info, AddressList* addresses, const NetLogWithSource& net_log) override; + int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& source_net_log) override; void SetDnsClientEnabled(bool enabled) override; HostCache* GetHostCache() override;
diff --git a/net/dns/mock_host_resolver.cc b/net/dns/mock_host_resolver.cc index c37f4ce..c146a1f 100644 --- a/net/dns/mock_host_resolver.cc +++ b/net/dns/mock_host_resolver.cc
@@ -149,6 +149,18 @@ return rv; } +int MockHostResolverBase::ResolveStaleFromCache( + const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& net_log) { + num_resolve_from_cache_++; + DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + next_request_id_++; + int rv = ResolveFromIPLiteralOrCache(info, addresses); + return rv; +} + void MockHostResolverBase::DetachRequest(size_t id) { RequestMap::iterator it = requests_.find(id); CHECK(it != requests_.end()); @@ -194,8 +206,10 @@ } } -int MockHostResolverBase::ResolveFromIPLiteralOrCache(const RequestInfo& info, - AddressList* addresses) { +int MockHostResolverBase::ResolveFromIPLiteralOrCache( + const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info) { IPAddress ip_address; if (ip_address.AssignFromIPLiteral(info.hostname())) { // This matches the behavior HostResolverImpl. @@ -214,7 +228,11 @@ HostCache::Key key(info.hostname(), info.address_family(), info.host_resolver_flags()); - const HostCache::Entry* entry = cache_->Lookup(key, base::TimeTicks::Now()); + const HostCache::Entry* entry; + if (stale_info) + entry = cache_->LookupStale(key, base::TimeTicks::Now(), stale_info); + else + entry = cache_->Lookup(key, base::TimeTicks::Now()); if (entry) { rv = entry->error(); if (rv == OK) @@ -511,6 +529,14 @@ return ERR_DNS_CACHE_MISS; } +int HangingHostResolver::ResolveStaleFromCache( + const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& net_log) { + return ERR_DNS_CACHE_MISS; +} + bool HangingHostResolver::HasCached( base::StringPiece hostname, HostCache::Entry::Source* source_out,
diff --git a/net/dns/mock_host_resolver.h b/net/dns/mock_host_resolver.h index 9b5a80a..ce43c8c2 100644 --- a/net/dns/mock_host_resolver.h +++ b/net/dns/mock_host_resolver.h
@@ -91,6 +91,10 @@ int ResolveFromCache(const RequestInfo& info, AddressList* addresses, const NetLogWithSource& net_log) override; + int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& source_net_log) override; HostCache* GetHostCache() override; bool HasCached(base::StringPiece hostname, HostCache::Entry::Source* source_out, @@ -132,8 +136,10 @@ // Resolve as IP or from |cache_| return cached error or // DNS_CACHE_MISS if failed. - int ResolveFromIPLiteralOrCache(const RequestInfo& info, - AddressList* addresses); + int ResolveFromIPLiteralOrCache( + const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info = nullptr); // Resolve via |proc_|. int ResolveProc(const RequestInfo& info, AddressList* addresses); // Resolve request stored in |requests_|. Pass rv to callback. @@ -289,6 +295,10 @@ int ResolveFromCache(const RequestInfo& info, AddressList* addresses, const NetLogWithSource& net_log) override; + int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& source_net_log) override; bool HasCached(base::StringPiece hostname, HostCache::Entry::Source* source_out, HostCache::EntryStaleness* stale_out) const override;
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc index 5aa581ea4..46345079 100644 --- a/net/http/http_network_transaction.cc +++ b/net/http/http_network_transaction.cc
@@ -1562,6 +1562,8 @@ break; case ERR_SPDY_PING_FAILED: case ERR_SPDY_SERVER_REFUSED_STREAM: + case ERR_SPDY_PUSHED_STREAM_NOT_AVAILABLE: + case ERR_SPDY_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER: case ERR_QUIC_HANDSHAKE_FAILED: if (HasExceededMaxRetries()) break;
diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc index caaaa31..a0d7bc75 100644 --- a/net/http/http_stream_factory_impl.cc +++ b/net/http/http_stream_factory_impl.cc
@@ -260,8 +260,6 @@ size_t num_controllers_with_request = 0; size_t num_controllers_for_preconnect = 0; for (const auto& job_controller : job_controller_set_) { - // Additionally log the states of the jobs. - job_controller->LogHistograms(); // For a preconnect controller, it should have exactly the main job. if (job_controller->is_preconnect()) { num_controllers_for_preconnect++;
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc index 1057041..f3a31c63 100644 --- a/net/http/http_stream_factory_impl_job.cc +++ b/net/http/http_stream_factory_impl_job.cc
@@ -177,7 +177,6 @@ io_callback_(base::Bind(&Job::OnIOComplete, base::Unretained(this))), connection_(new ClientSocketHandle), session_(session), - state_(STATE_NONE), next_state_(STATE_NONE), destination_(destination), origin_url_(origin_url), @@ -369,20 +368,6 @@ return proxy_info_; } -void HttpStreamFactoryImpl::Job::LogHistograms() const { - if (job_type_ == MAIN) { - UMA_HISTOGRAM_ENUMERATION("Net.HttpStreamFactoryJob.Main.NextState", - next_state_, STATE_MAX); - UMA_HISTOGRAM_ENUMERATION("Net.HttpStreamFactoryJob.Main.State", state_, - STATE_MAX); - } else if (job_type_ == ALTERNATIVE) { - UMA_HISTOGRAM_ENUMERATION("Net.HttpStreamFactoryJob.Alt.NextState", - next_state_, STATE_MAX); - UMA_HISTOGRAM_ENUMERATION("Net.HttpStreamFactoryJob.Alt.State", state_, - STATE_MAX); - } -} - void HttpStreamFactoryImpl::Job::GetSSLInfo(SSLInfo* ssl_info) { DCHECK(using_ssl_); DCHECK(!establishing_tunnel_); @@ -696,8 +681,6 @@ int rv = result; do { State state = next_state_; - // Added to investigate crbug.com/711721. - state_ = state; next_state_ = STATE_NONE; switch (state) { case STATE_START:
diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h index e02ca44..ae5b449 100644 --- a/net/http/http_stream_factory_impl_job.h +++ b/net/http/http_stream_factory_impl_job.h
@@ -254,10 +254,6 @@ bool should_reconsider_proxy() const { return should_reconsider_proxy_; } - // TODO(xunjieli): Added to investigate crbug.com/711721. Remove when no - // longer needed. - void LogHistograms() const; - NetErrorDetails* net_error_details() { return &net_error_details_; } private: @@ -420,9 +416,6 @@ std::unique_ptr<ClientSocketHandle> connection_; HttpNetworkSession* const session_; - // |state_| is only used for LogHistograms(). - State state_; - State next_state_; // The server we are trying to reach, could be that of the origin or of the
diff --git a/net/http/http_stream_factory_impl_job_controller.cc b/net/http/http_stream_factory_impl_job_controller.cc index c556b3a..1c8c9cf 100644 --- a/net/http/http_stream_factory_impl_job_controller.cc +++ b/net/http/http_stream_factory_impl_job_controller.cc
@@ -681,13 +681,6 @@ return alternative_job_.get() != nullptr; } -void HttpStreamFactoryImpl::JobController::LogHistograms() const { - if (main_job_) - main_job_->LogHistograms(); - if (alternative_job_) - alternative_job_->LogHistograms(); -} - size_t HttpStreamFactoryImpl::JobController::EstimateMemoryUsage() const { return base::trace_event::EstimateMemoryUsage(main_job_) + base::trace_event::EstimateMemoryUsage(alternative_job_);
diff --git a/net/http/http_stream_factory_impl_job_controller.h b/net/http/http_stream_factory_impl_job_controller.h index ddd4dc0..008748a5 100644 --- a/net/http/http_stream_factory_impl_job_controller.h +++ b/net/http/http_stream_factory_impl_job_controller.h
@@ -192,10 +192,6 @@ // Returns true if |this| has a pending alternative job that is not completed. bool HasPendingAltJob() const; - // TODO(xunjieli): Added to investigate crbug.com/711721. Remove when no - // longer needed. - void LogHistograms() const; - // Returns the estimated memory usage in bytes. size_t EstimateMemoryUsage() const;
diff --git a/net/proxy/proxy_resolver_v8_tracing_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_unittest.cc index e3ae62b..ceb9216 100644 --- a/net/proxy/proxy_resolver_v8_tracing_unittest.cc +++ b/net/proxy/proxy_resolver_v8_tracing_unittest.cc
@@ -725,6 +725,14 @@ return ERR_DNS_CACHE_MISS; } + int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& net_log) override { + NOTREACHED(); + return ERR_DNS_CACHE_MISS; + } + bool HasCached(base::StringPiece hostname, HostCache::Entry::Source* source_out, HostCache::EntryStaleness* stale_out) const override {
diff --git a/net/proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc b/net/proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc index 271b8d5..0128610 100644 --- a/net/proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc +++ b/net/proxy/proxy_resolver_v8_tracing_wrapper_unittest.cc
@@ -822,6 +822,14 @@ return ERR_DNS_CACHE_MISS; } + int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& net_log) override { + NOTREACHED(); + return ERR_DNS_CACHE_MISS; + } + bool HasCached(base::StringPiece hostname, HostCache::Entry::Source* source_out, HostCache::EntryStaleness* stale_out) const override {
diff --git a/net/quic/core/quic_crypto_stream_test.cc b/net/quic/core/quic_crypto_stream_test.cc index 3488d8eb4..59726408 100644 --- a/net/quic/core/quic_crypto_stream_test.cc +++ b/net/quic/core/quic_crypto_stream_test.cc
@@ -138,13 +138,13 @@ EXPECT_EQ(ENCRYPTION_NONE, connection_->encryption_level()); string data(1350, 'a'); EXPECT_CALL(session_, WritevData(_, kCryptoStreamId, 1350, 0, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_.WriteOrBufferData(data, false, nullptr); // Send [1350, 2700) in ENCRYPTION_INITIAL. connection_->SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); EXPECT_EQ(ENCRYPTION_INITIAL, connection_->encryption_level()); EXPECT_CALL(session_, WritevData(_, kCryptoStreamId, 1350, 1350, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_.WriteOrBufferData(data, false, nullptr); connection_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE); EXPECT_EQ(ENCRYPTION_FORWARD_SECURE, connection_->encryption_level()); @@ -155,13 +155,13 @@ // Lost [1200, 2000). stream_.OnStreamFrameLost(1200, 800, false); EXPECT_CALL(session_, WritevData(_, kCryptoStreamId, 1000, 0, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); // Verify [1200, 2000) are sent in [1200, 1350) and [1350, 2000) because of // they are in different encryption levels. EXPECT_CALL(session_, WritevData(_, kCryptoStreamId, 150, 1200, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); EXPECT_CALL(session_, WritevData(_, kCryptoStreamId, 650, 1350, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_.OnCanWrite(); EXPECT_FALSE(stream_.HasPendingRetransmission()); // Verify connection's encryption level has restored. @@ -176,13 +176,13 @@ EXPECT_EQ(ENCRYPTION_NONE, connection_->encryption_level()); string data(1350, 'a'); EXPECT_CALL(session_, WritevData(_, kCryptoStreamId, 1350, 0, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_.WriteOrBufferData(data, false, nullptr); // Send [1350, 2700) in ENCRYPTION_INITIAL. connection_->SetDefaultEncryptionLevel(ENCRYPTION_INITIAL); EXPECT_EQ(ENCRYPTION_INITIAL, connection_->encryption_level()); EXPECT_CALL(session_, WritevData(_, kCryptoStreamId, 1350, 1350, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_.WriteOrBufferData(data, false, nullptr); // Lost [0, 1350).
diff --git a/net/quic/core/quic_flags_list.h b/net/quic/core/quic_flags_list.h index c115dd4..c5f8d924 100644 --- a/net/quic/core/quic_flags_list.h +++ b/net/quic/core/quic_flags_list.h
@@ -164,3 +164,7 @@ QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_allow_receiving_overlapping_data, false) + +// If true, QuicStreamSendBuffer keeps track of the slice which next write +// should get data from if writing new data. +QUIC_FLAG(bool, FLAGS_quic_reloadable_flag_quic_use_write_index, false)
diff --git a/net/quic/core/quic_headers_stream_test.cc b/net/quic/core/quic_headers_stream_test.cc index 4a50c19..ffe19ab 100644 --- a/net/quic/core/quic_headers_stream_test.cc +++ b/net/quic/core/quic_headers_stream_test.cc
@@ -839,7 +839,7 @@ TEST_P(QuicHeadersStreamTest, AckSentData) { EXPECT_CALL(session_, WritevData(headers_stream_, kHeadersStreamId, _, _, NO_FIN)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); if (!GetQuicReloadableFlag(quic_allow_multiple_acks_for_data2)) { EXPECT_CALL(*connection_, CloseConnection(QUIC_INTERNAL_ERROR, _, _)); } @@ -897,7 +897,7 @@ // In this test, a stream frame can contain multiple headers. EXPECT_CALL(session_, WritevData(headers_stream_, kHeadersStreamId, _, _, NO_FIN)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); InSequence s; QuicReferenceCountedPointer<MockAckListener> ack_listener1( new MockAckListener()); @@ -939,7 +939,7 @@ } EXPECT_CALL(session_, WritevData(headers_stream_, kHeadersStreamId, _, _, NO_FIN)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); InSequence s; QuicReferenceCountedPointer<MockAckListener> ack_listener1( new MockAckListener());
diff --git a/net/quic/core/quic_spdy_stream_test.cc b/net/quic/core/quic_spdy_stream_test.cc index e89ee63..3e2c4cb7 100644 --- a/net/quic/core/quic_spdy_stream_test.cc +++ b/net/quic/core/quic_spdy_stream_test.cc
@@ -845,7 +845,7 @@ Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Write the initial headers, without a FIN. EXPECT_CALL(*session_, WriteHeadersMock(_, _, _, _, _)); @@ -865,7 +865,7 @@ Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Write the initial headers. EXPECT_CALL(*session_, WriteHeadersMock(_, _, _, _, _)); @@ -893,7 +893,7 @@ Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Write the initial headers. EXPECT_CALL(*session_, WriteHeadersMock(_, _, _, _, _)); @@ -917,7 +917,7 @@ Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Write the initial headers. EXPECT_CALL(*session_, WriteHeadersMock(_, _, _, _, _)); @@ -949,7 +949,7 @@ Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Write the initial headers, with a FIN. EXPECT_CALL(*session_, WriteHeadersMock(_, _, _, _, _)); @@ -966,7 +966,7 @@ Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); testing::InSequence s; QuicReferenceCountedPointer<MockAckListener> ack_listener1( new MockAckListener()); @@ -1005,7 +1005,7 @@ Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); QuicStreamPeer::CloseReadSide(stream_); // This write causes stream to be closed. stream_->WriteOrBufferData("Test1", true, nullptr);
diff --git a/net/quic/core/quic_stream.cc b/net/quic/core/quic_stream.cc index 82a88d88..53fae61 100644 --- a/net/quic/core/quic_stream.cc +++ b/net/quic/core/quic_stream.cc
@@ -628,6 +628,8 @@ QuicByteCount data_length, QuicDataWriter* writer) { DCHECK_LT(0u, data_length); + QUIC_DVLOG(2) << ENDPOINT << "Write stream " << id_ << " data from offset " + << offset << " length " << data_length; return send_buffer_.WriteStreamData(offset, data_length, writer); }
diff --git a/net/quic/core/quic_stream_send_buffer.cc b/net/quic/core/quic_stream_send_buffer.cc index d905b8c..7671245 100644 --- a/net/quic/core/quic_stream_send_buffer.cc +++ b/net/quic/core/quic_stream_send_buffer.cc
@@ -37,7 +37,10 @@ allocator_(allocator), stream_bytes_written_(0), stream_bytes_outstanding_(0), - allow_multiple_acks_for_data_(allow_multiple_acks_for_data) {} + allow_multiple_acks_for_data_(allow_multiple_acks_for_data), + write_index_(-1), + use_write_index_(allow_multiple_acks_for_data_ && + GetQuicReloadableFlag(quic_use_write_index)) {} QuicStreamSendBuffer::~QuicStreamSendBuffer() {} @@ -61,12 +64,17 @@ } void QuicStreamSendBuffer::SaveMemSlice(QuicMemSlice slice) { + QUIC_DVLOG(2) << "Save slice offset " << stream_offset_ << " length " + << slice.length(); if (slice.empty()) { QUIC_BUG << "Try to save empty MemSlice to send buffer."; return; } size_t length = slice.length(); buffered_slices_.emplace_back(std::move(slice), stream_offset_); + if (write_index_ == -1) { + write_index_ = buffered_slices_.size() - 1; + } stream_offset_ += length; } @@ -78,8 +86,11 @@ bool QuicStreamSendBuffer::WriteStreamData(QuicStreamOffset offset, QuicByteCount data_length, QuicDataWriter* writer) { + if (use_write_index_) { + return WriteStreamDataWithIndex(offset, data_length, writer); + } for (const BufferedSlice& slice : buffered_slices_) { - if (offset < slice.offset) { + if (data_length == 0 || offset < slice.offset) { break; } if (offset >= slice.offset + slice.slice.length()) { @@ -98,6 +109,66 @@ return data_length == 0; } +bool QuicStreamSendBuffer::WriteStreamDataWithIndex(QuicStreamOffset offset, + QuicByteCount data_length, + QuicDataWriter* writer) { + bool write_index_hit = false; + QuicDeque<BufferedSlice>::iterator slice_it = + write_index_ == -1 + ? buffered_slices_.begin() + // Assume with write_index, write mostly starts from indexed slice. + : buffered_slices_.begin() + write_index_; + if (write_index_ != -1) { + if (offset >= slice_it->offset + slice_it->slice.length()) { + QUIC_BUG << "Tried to write data out of sequence."; + return false; + } + // Determine if write actually happens at indexed slice. + if (offset >= slice_it->offset) { + write_index_hit = true; + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_use_write_index, 1, 2); + } else { + // Write index missed, move iterator to the beginning. + slice_it = buffered_slices_.begin(); + } + } + + for (; slice_it != buffered_slices_.end(); ++slice_it) { + if (data_length == 0 || offset < slice_it->offset) { + break; + } + if (offset >= slice_it->offset + slice_it->slice.length()) { + continue; + } + QuicByteCount slice_offset = offset - slice_it->offset; + QuicByteCount available_bytes_in_slice = + slice_it->slice.length() - slice_offset; + QuicByteCount copy_length = std::min(data_length, available_bytes_in_slice); + if (!writer->WriteBytes(slice_it->slice.data() + slice_offset, + copy_length)) { + QUIC_BUG << "Writer fails to write."; + return false; + } + offset += copy_length; + data_length -= copy_length; + + if (write_index_hit && copy_length == available_bytes_in_slice) { + // Finished writing all data in current slice, advance write index for + // next write. + ++write_index_; + } + } + + if (write_index_hit && + static_cast<size_t>(write_index_) == buffered_slices_.size()) { + // Already write to the end off buffer. + DVLOG(2) << "Finish writing out all buffered data."; + write_index_ = -1; + } + + return data_length == 0; +} + bool QuicStreamSendBuffer::OnStreamDataAcked( QuicStreamOffset offset, QuicByteCount data_length, @@ -126,6 +197,20 @@ buffered_slices_.front().slice.length())) { // Remove data which stops waiting for acks. Please note, data can be // acked out of order, but send buffer is cleaned up in order. + if (use_write_index_) { + QUIC_FLAG_COUNT_N(quic_reloadable_flag_quic_use_write_index, 2, 2); + QUIC_BUG_IF(write_index_ == 0) + << "Fail to advance current_write_slice_. It points to the slice " + "whose data has all be written and ACK'ed or ignored. " + "current_write_slice_ offset " + << buffered_slices_[write_index_].offset << " length " + << buffered_slices_[write_index_].slice.length(); + if (write_index_ > 0) { + // If write index is pointing to any slice, reduce the index as the + // slices are all shifted to the left by one. + --write_index_; + } + } buffered_slices_.pop_front(); } return true;
diff --git a/net/quic/core/quic_stream_send_buffer.h b/net/quic/core/quic_stream_send_buffer.h index 3e1a69f..c9a7b4a 100644 --- a/net/quic/core/quic_stream_send_buffer.h +++ b/net/quic/core/quic_stream_send_buffer.h
@@ -128,6 +128,15 @@ friend class test::QuicStreamSendBufferPeer; friend class test::QuicStreamPeer; + // Another version of WriteStreamData() to be able to start writing from + // write_index_ points to instead of searching through the slices to find the + // place to write. + // TODO(danzh): inline this method into WriteStreamData() after + // quic_reloadable_flag_quic_use_write_index is deprecated. + bool WriteStreamDataWithIndex(QuicStreamOffset offset, + QuicByteCount data_length, + QuicDataWriter* writer); + QuicDeque<BufferedSlice> buffered_slices_; // Offset of next inserted byte. @@ -149,6 +158,14 @@ // Data considered as lost and needs to be retransmitted. QuicIntervalSet<QuicStreamOffset> pending_retransmissions_; + + // Index of slice which contains data waiting to be written for the first + // time. -1 if send buffer is empty or all data has been written. + int32_t write_index_; + + // True if quic_reloadable_flag_quic_stream_send_buffer_write_index and + // allow_multiple_acks_for_data_ are both true. + const bool use_write_index_; }; } // namespace net
diff --git a/net/quic/core/quic_stream_send_buffer_test.cc b/net/quic/core/quic_stream_send_buffer_test.cc index 1e9b22f..f4e092f 100644 --- a/net/quic/core/quic_stream_send_buffer_test.cc +++ b/net/quic/core/quic_stream_send_buffer_test.cc
@@ -9,6 +9,7 @@ #include "net/quic/core/quic_utils.h" #include "net/quic/platform/api/quic_flags.h" #include "net/quic/platform/api/quic_test.h" +#include "net/quic/test_tools/quic_stream_send_buffer_peer.h" #include "net/quic/test_tools/quic_test_utils.h" using std::string; @@ -41,7 +42,11 @@ QuicMemSlice slice1(&allocator_, 1024); memset(const_cast<char*>(slice1.data()), 'c', 1024); QuicMemSlice slice2(&allocator_, 768); - memset(const_cast<char*>(slice2.data()), 'c', 768); + memset(const_cast<char*>(slice2.data()), 'd', 768); + + // Index starts from not pointing to any slice. + EXPECT_EQ(nullptr, + QuicStreamSendBufferPeer::CurrentWriteSlice(&send_buffer_)); // Save all data. SetQuicFlag(&FLAGS_quic_send_buffer_max_data_slice_size, 1024); @@ -50,12 +55,22 @@ EXPECT_TRUE(slice1.empty()); send_buffer_.SaveMemSlice(std::move(slice2)); EXPECT_TRUE(slice2.empty()); - // Write all data. - send_buffer_.OnStreamDataConsumed(3840); - EXPECT_EQ(3840u, send_buffer_.stream_bytes_written()); - EXPECT_EQ(3840u, send_buffer_.stream_bytes_outstanding()); EXPECT_EQ(4u, send_buffer_.size()); + // At this point, the whole buffer looks like: + // | a * 1536 |b * 256| c * 1280 | d * 768 | + // | slice1 | slice2 | slice3 | slice4 | + } + + void WriteAllData() { + // Write all data. + char buf[4000]; + QuicDataWriter writer(4000, buf, HOST_BYTE_ORDER); + send_buffer_.WriteStreamData(0, 3840u, &writer); + + send_buffer_.OnStreamDataConsumed(3840u); + EXPECT_EQ(3840u, send_buffer_.stream_bytes_written()); + EXPECT_EQ(3840u, send_buffer_.stream_bytes_outstanding()); } SimpleBufferAllocator allocator_; @@ -68,7 +83,7 @@ string copy1(1024, 'a'); string copy2 = string(512, 'a') + string(256, 'b') + string(256, 'c'); string copy3(1024, 'c'); - string copy4(768, 'c'); + string copy4(768, 'd'); ASSERT_TRUE(send_buffer_.WriteStreamData(0, 1024, &writer)); EXPECT_EQ(copy1, QuicStringPiece(buf, 1024)); @@ -76,7 +91,7 @@ EXPECT_EQ(copy2, QuicStringPiece(buf + 1024, 1024)); ASSERT_TRUE(send_buffer_.WriteStreamData(2048, 1024, &writer)); EXPECT_EQ(copy3, QuicStringPiece(buf + 2048, 1024)); - ASSERT_TRUE(send_buffer_.WriteStreamData(2048, 768, &writer)); + ASSERT_TRUE(send_buffer_.WriteStreamData(3072, 768, &writer)); EXPECT_EQ(copy4, QuicStringPiece(buf + 3072, 768)); // Test data piece across boundries. @@ -85,15 +100,28 @@ ASSERT_TRUE(send_buffer_.WriteStreamData(1000, 1024, &writer2)); EXPECT_EQ(copy5, QuicStringPiece(buf, 1024)); ASSERT_TRUE(send_buffer_.WriteStreamData(2500, 1024, &writer2)); - EXPECT_EQ(copy3, QuicStringPiece(buf + 1024, 1024)); + string copy6 = string(572, 'c') + string(452, 'd'); + EXPECT_EQ(copy6, QuicStringPiece(buf + 1024, 1024)); // Invalid data copy. QuicDataWriter writer3(4000, buf, HOST_BYTE_ORDER); EXPECT_FALSE(send_buffer_.WriteStreamData(3000, 1024, &writer3)); - EXPECT_FALSE(send_buffer_.WriteStreamData(0, 4000, &writer3)); + if (GetQuicReloadableFlag(quic_use_write_index) && + GetQuicReloadableFlag(quic_allow_multiple_acks_for_data2)) { + EXPECT_DFATAL(send_buffer_.WriteStreamData(0, 4000, &writer3), + "Writer fails to write."); + } else { + EXPECT_FALSE(send_buffer_.WriteStreamData(0, 4000, &writer3)); + } + + send_buffer_.OnStreamDataConsumed(3840); + EXPECT_EQ(3840u, send_buffer_.stream_bytes_written()); + EXPECT_EQ(3840u, send_buffer_.stream_bytes_outstanding()); } TEST_F(QuicStreamSendBufferTest, RemoveStreamFrame) { + WriteAllData(); + QuicByteCount newly_acked_length; EXPECT_TRUE(send_buffer_.OnStreamDataAcked(1024, 1024, &newly_acked_length)); EXPECT_EQ(1024u, newly_acked_length); @@ -114,6 +142,8 @@ } TEST_F(QuicStreamSendBufferTest, RemoveStreamFrameAcrossBoundries) { + WriteAllData(); + QuicByteCount newly_acked_length; EXPECT_TRUE(send_buffer_.OnStreamDataAcked(2024, 576, &newly_acked_length)); EXPECT_EQ(576u, newly_acked_length); @@ -141,6 +171,7 @@ if (!GetQuicReloadableFlag(quic_allow_multiple_acks_for_data2)) { return; } + WriteAllData(); QuicByteCount newly_acked_length; EXPECT_TRUE(send_buffer_.OnStreamDataAcked(100, 1500, &newly_acked_length)); EXPECT_EQ(1500u, newly_acked_length); @@ -166,6 +197,7 @@ if (!FLAGS_quic_reloadable_flag_quic_allow_multiple_acks_for_data2) { return; } + WriteAllData(); EXPECT_TRUE(send_buffer_.IsStreamDataOutstanding(0, 3840)); EXPECT_FALSE(send_buffer_.HasPendingRetransmission()); // Lost data [0, 1200). @@ -205,6 +237,45 @@ EXPECT_TRUE(send_buffer_.IsStreamDataOutstanding(400, 800)); } +TEST_F(QuicStreamSendBufferTest, CurrentWriteIndex) { + if (!GetQuicReloadableFlag(quic_use_write_index) || + !GetQuicReloadableFlag(quic_allow_multiple_acks_for_data2)) { + return; + } + char buf[4000]; + QuicDataWriter writer(4000, buf, HOST_BYTE_ORDER); + // With data buffered, index points to the 1st slice of data. + EXPECT_EQ(0u, + QuicStreamSendBufferPeer::CurrentWriteSlice(&send_buffer_)->offset); + ASSERT_TRUE(send_buffer_.WriteStreamData(0, 1024, &writer)); + // Wrote all data on 1st slice, index points to next slice. + EXPECT_EQ(1024u, + QuicStreamSendBufferPeer::CurrentWriteSlice(&send_buffer_)->offset); + ASSERT_TRUE(send_buffer_.WriteStreamData(1024, 512, &writer)); + // Last write didn't finish a whole slice. Index remains. + EXPECT_EQ(1024u, + QuicStreamSendBufferPeer::CurrentWriteSlice(&send_buffer_)->offset); + send_buffer_.OnStreamDataConsumed(1024); + + // If data in 1st slice gets ACK'ed, it shouldn't change the indexed slice + QuicByteCount newly_acked_length; + EXPECT_TRUE(send_buffer_.OnStreamDataAcked(0, 1024, &newly_acked_length)); + EXPECT_EQ(1024u, + QuicStreamSendBufferPeer::CurrentWriteSlice(&send_buffer_)->offset); + + ASSERT_TRUE( + send_buffer_.WriteStreamData(1024 + 512, 3840 - 1024 - 512, &writer)); + // After writing all buffered data, index become invalid again. + EXPECT_EQ(nullptr, + QuicStreamSendBufferPeer::CurrentWriteSlice(&send_buffer_)); + QuicMemSlice slice(&allocator_, 60); + memset(const_cast<char*>(slice.data()), 'e', 60); + send_buffer_.SaveMemSlice(std::move(slice)); + // With new data, index points to the new data. + EXPECT_EQ(3840u, + QuicStreamSendBufferPeer::CurrentWriteSlice(&send_buffer_)->offset); +} + } // namespace } // namespace test } // namespace net
diff --git a/net/quic/core/quic_stream_test.cc b/net/quic/core/quic_stream_test.cc index 6b2c734..ef3667af 100644 --- a/net/quic/core/quic_stream_test.cc +++ b/net/quic/core/quic_stream_test.cc
@@ -27,13 +27,14 @@ #include "testing/gmock_mutant.h" using std::string; +using testing::_; using testing::AnyNumber; using testing::AtLeast; using testing::InSequence; using testing::Invoke; +using testing::InvokeWithoutArgs; using testing::Return; using testing::StrictMock; -using testing::_; namespace net { namespace test { @@ -170,7 +171,7 @@ connection_->SetMaxPacketLength(length); EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _)) - .WillOnce(Return(QuicConsumedData(kDataLen, true))); + .WillOnce(Invoke(&(MockQuicSession::ConsumeData))); stream_->WriteOrBufferData(kData1, false, nullptr); EXPECT_FALSE(HasWriteBlockedStreams()); } @@ -191,7 +192,9 @@ // Write some data and no fin. If we consume some but not all of the data, // we should be write blocked a not all the data was consumed. EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _)) - .WillOnce(Return(QuicConsumedData(1, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 1u, 0u, NO_FIN))); stream_->WriteOrBufferData(QuicStringPiece(kData1, 2), false, nullptr); ASSERT_EQ(1u, write_blocked_list_->NumBlockedStreams()); EXPECT_EQ(1u, stream_->BufferedDataBytes()); @@ -205,7 +208,9 @@ // (This should never actually happen as the fin should be sent out with the // last data) EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _)) - .WillOnce(Return(QuicConsumedData(2, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 2u, 0u, NO_FIN))); stream_->WriteOrBufferData(QuicStringPiece(kData1, 2), true, nullptr); ASSERT_EQ(1u, write_blocked_list_->NumBlockedStreams()); } @@ -245,7 +250,9 @@ connection_->SetMaxPacketLength(length); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(kDataLen - 1, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), kDataLen - 1, 0u, NO_FIN))); stream_->WriteOrBufferData(kData1, false, nullptr); EXPECT_EQ(1u, stream_->BufferedDataBytes()); EXPECT_TRUE(HasWriteBlockedStreams()); @@ -256,12 +263,16 @@ // Make sure we get the tail of the first write followed by the bytes_consumed InSequence s; EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(kDataLen - 1, false))); + .WillOnce(InvokeWithoutArgs(testing::CreateFunctor( + &(MockQuicSession::ConsumeData), stream_, stream_->id(), kDataLen - 1, + kDataLen - 1, NO_FIN))); stream_->OnCanWrite(); // And finally the end of the bytes_consumed. EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(2, true))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 2u, 2 * kDataLen - 2, FIN))); stream_->OnCanWrite(); } @@ -272,7 +283,7 @@ QuicStreamPeer::SetStreamBytesWritten(kMaxStreamLength - data.length(), stream_); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(data.length(), false))); + .WillOnce(Invoke(&(MockQuicSession::ConsumeData))); stream_->WriteOrBufferData(data, false, nullptr); EXPECT_CALL(*connection_, CloseConnection(QUIC_STREAM_LENGTH_OVERFLOW, _, _)); EXPECT_DFATAL(stream_->WriteOrBufferData("a", false, nullptr), @@ -303,7 +314,9 @@ // Write some data, with no FIN. EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _)) - .WillOnce(Return(QuicConsumedData(1, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 1u, 0u, NO_FIN))); stream_->WriteOrBufferData(QuicStringPiece(kData1, 1), false, nullptr); EXPECT_FALSE(fin_sent()); EXPECT_FALSE(rst_sent()); @@ -326,7 +339,9 @@ // Write some data, with FIN. EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _)) - .WillOnce(Return(QuicConsumedData(1, true))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 1u, 0u, FIN))); stream_->WriteOrBufferData(QuicStringPiece(kData1, 1), true, nullptr); EXPECT_TRUE(fin_sent()); EXPECT_FALSE(rst_sent()); @@ -581,7 +596,9 @@ // Outgoing data with FIN. EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _)) - .WillOnce(Return(QuicConsumedData(2, true))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 2u, 0u, FIN))); stream_->WriteOrBufferData(QuicStringPiece(kData1, 2), true, nullptr); EXPECT_TRUE(stream_->write_side_closed()); @@ -596,7 +613,9 @@ // Outgoing data with FIN. EXPECT_CALL(*session_, WritevData(stream_, kTestStreamId, _, _, _)) - .WillOnce(Return(QuicConsumedData(2, true))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 2u, 0u, FIN))); stream_->WriteOrBufferData(QuicStringPiece(kData1, 2), true, nullptr); EXPECT_TRUE(stream_->write_side_closed()); @@ -623,7 +642,7 @@ Initialize(kShouldProcessData); EXPECT_CALL(*connection_, CloseConnection(_, _, _)).Times(0); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Receive data for the request. QuicStreamFrame frame1(stream_->id(), false, 0, QuicStringPiece("Start")); @@ -647,7 +666,7 @@ new StrictMock<MockAckListener>); stream_->set_ack_listener(mock_ack_listener); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Stream is not waiting for acks initially. EXPECT_FALSE(stream_->IsWaitingForAcks()); EXPECT_EQ(0u, QuicStreamPeer::SendBuffer(stream_).size()); @@ -692,7 +711,7 @@ TEST_F(QuicStreamTest, StreamDataGetAckedOutOfOrder) { Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Send data. stream_->WriteOrBufferData(kData1, false, nullptr); stream_->WriteOrBufferData(kData1, false, nullptr); @@ -716,7 +735,7 @@ TEST_F(QuicStreamTest, CancelStream) { Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); EXPECT_FALSE(stream_->IsWaitingForAcks()); EXPECT_EQ(0u, QuicStreamPeer::SendBuffer(stream_).size()); @@ -739,7 +758,7 @@ TEST_F(QuicStreamTest, RstFrameReceivedStreamNotFinishSending) { Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); EXPECT_FALSE(stream_->IsWaitingForAcks()); EXPECT_EQ(0u, QuicStreamPeer::SendBuffer(stream_).size()); @@ -762,7 +781,7 @@ TEST_F(QuicStreamTest, RstFrameReceivedStreamFinishSending) { Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); EXPECT_FALSE(stream_->IsWaitingForAcks()); EXPECT_EQ(0u, QuicStreamPeer::SendBuffer(stream_).size()); @@ -782,7 +801,7 @@ TEST_F(QuicStreamTest, ConnectionClosed) { Initialize(kShouldProcessData); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); EXPECT_FALSE(stream_->IsWaitingForAcks()); EXPECT_EQ(0u, QuicStreamPeer::SendBuffer(stream_).size()); @@ -810,7 +829,9 @@ // Testing WriteOrBufferData. EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(100, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 100u, 0u, NO_FIN))); stream_->WriteOrBufferData(data, false, nullptr); stream_->WriteOrBufferData(data, false, nullptr); stream_->WriteOrBufferData(data, false, nullptr); @@ -818,7 +839,9 @@ EXPECT_EQ(3 * data.length() - 100, stream_->BufferedDataBytes()); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(100, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 100, 100u, NO_FIN))); // Buffered data size > threshold, do not ask upper layer for more data. EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(0); stream_->OnCanWrite(); @@ -826,11 +849,12 @@ EXPECT_FALSE(stream_->CanWriteNewData()); // Send buffered data to make buffered data size < threshold. + size_t data_to_write = 3 * data.length() - 200 - + GetQuicFlag(FLAGS_quic_buffered_data_threshold) + 1; EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData( - 3 * data.length() - 200 - - GetQuicFlag(FLAGS_quic_buffered_data_threshold) + 1, - false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), data_to_write, 200u, NO_FIN))); // Buffered data size < threshold, ask upper layer for more data. EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(1); stream_->OnCanWrite(); @@ -840,7 +864,7 @@ // Flush all buffered data. EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(1); stream_->OnCanWrite(); EXPECT_EQ(0u, stream_->BufferedDataBytes()); @@ -866,9 +890,13 @@ EXPECT_FALSE(consumed.fin_consumed); EXPECT_EQ(data.length(), stream_->BufferedDataBytes()); + data_to_write = + data.length() - GetQuicFlag(FLAGS_quic_buffered_data_threshold) + 1; EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData( - data.length() - FLAGS_quic_buffered_data_threshold + 1, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), data_to_write, 0u, NO_FIN))); + EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(1); stream_->OnCanWrite(); EXPECT_EQ(GetQuicFlag(FLAGS_quic_buffered_data_threshold) - 1, @@ -892,7 +920,7 @@ QuicStreamPeer::SetStreamBytesWritten(kMaxStreamLength - data.length(), stream_); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(data.length(), false))); + .WillOnce(Invoke(&(MockQuicSession::ConsumeData))); struct iovec iov = {const_cast<char*>(data.data()), 5u}; QuicConsumedData consumed = stream_->WritevData(&iov, 1u, false); EXPECT_EQ(data.length(), consumed.bytes_consumed); @@ -922,7 +950,9 @@ QuicMemSliceSpan span2 = vector2.span(); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(100, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 100u, 0u, NO_FIN))); // There is no buffered data before, all data should be consumed. QuicConsumedData consumed = stream_->WriteMemSlices(span1, false); EXPECT_EQ(2048u, consumed.bytes_consumed); @@ -938,11 +968,12 @@ EXPECT_EQ(2 * QUIC_ARRAYSIZE(data) - 100, stream_->BufferedDataBytes()); EXPECT_FALSE(stream_->fin_buffered()); + size_t data_to_write = 2 * QUIC_ARRAYSIZE(data) - 100 - + GetQuicFlag(FLAGS_quic_buffered_data_threshold) + 1; EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData( - 2 * QUIC_ARRAYSIZE(data) - 100 - - GetQuicFlag(FLAGS_quic_buffered_data_threshold) + 1, - false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), data_to_write, 100u, NO_FIN))); EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(1); stream_->OnCanWrite(); EXPECT_EQ(GetQuicFlag(FLAGS_quic_buffered_data_threshold) - 1, @@ -959,7 +990,7 @@ // Flush all buffered data. EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_->OnCanWrite(); EXPECT_CALL(*stream_, OnCanWriteNewData()).Times(0); EXPECT_FALSE(stream_->HasBufferedData()); @@ -979,7 +1010,9 @@ QuicTestMemSliceVector vector1(buffers); QuicMemSliceSpan span1 = vector1.span(); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(5u, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 5u, 0u, NO_FIN))); // There is no buffered data before, all data should be consumed. QuicConsumedData consumed = stream_->WriteMemSlices(span1, false); EXPECT_EQ(5u, consumed.bytes_consumed); @@ -1000,7 +1033,7 @@ new StrictMock<MockAckListener>); stream_->set_ack_listener(mock_ack_listener); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); // Send [0, 27) and fin. stream_->WriteOrBufferData(kData1, false, nullptr); stream_->WriteOrBufferData(kData1, false, nullptr); @@ -1052,7 +1085,7 @@ // Send [0, 9). EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_->WriteOrBufferData(kData1, false, nullptr); EXPECT_FALSE(stream_->HasBufferedData()); @@ -1069,20 +1102,20 @@ stream_->OnStreamFrameLost(0, 9, false); EXPECT_TRUE(stream_->HasPendingRetransmission()); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_->OnCanWrite(); EXPECT_FALSE(stream_->HasPendingRetransmission()); EXPECT_TRUE(stream_->HasBufferedData()); // This OnCanWrite causes [9, 27) to be sent. EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_->OnCanWrite(); EXPECT_FALSE(stream_->HasBufferedData()); // Send a fin only frame. EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); stream_->WriteOrBufferData("", true, nullptr); // Lost [9, 27) and fin. @@ -1096,7 +1129,9 @@ // This OnCanWrite causes [18, 27) and fin to be retransmitted. Verify fin can // be bundled with data. EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(9, true))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 9, 18u, FIN))); stream_->OnCanWrite(); EXPECT_FALSE(stream_->HasPendingRetransmission()); // Lost [9, 18) again, but it is not considered as lost because kData2 @@ -1110,7 +1145,7 @@ // Send [0, 18) and fin. EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); stream_->WriteOrBufferData(kData1, false, nullptr); stream_->WriteOrBufferData(kData2, true, nullptr); @@ -1122,7 +1157,9 @@ // frames. InSequence s; EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) - .WillOnce(Return(QuicConsumedData(9, false))); + .WillOnce(InvokeWithoutArgs( + testing::CreateFunctor(&(MockQuicSession::ConsumeData), stream_, + stream_->id(), 9, 0u, NO_FIN))); EXPECT_CALL(*session_, WritevData(_, _, _, _, _)) .WillOnce(Return(QuicConsumedData(0, true))); stream_->OnCanWrite();
diff --git a/net/quic/test_tools/quic_stream_send_buffer_peer.cc b/net/quic/test_tools/quic_stream_send_buffer_peer.cc index 7e6dbc4..5ca41adb 100644 --- a/net/quic/test_tools/quic_stream_send_buffer_peer.cc +++ b/net/quic/test_tools/quic_stream_send_buffer_peer.cc
@@ -15,6 +15,14 @@ send_buffer->stream_offset_ = stream_offset; } +// static +const BufferedSlice* QuicStreamSendBufferPeer::CurrentWriteSlice( + QuicStreamSendBuffer* send_buffer) { + if (send_buffer->write_index_ == -1) { + return nullptr; + } + return &send_buffer->buffered_slices_[send_buffer->write_index_]; +} } // namespace test } // namespace net
diff --git a/net/quic/test_tools/quic_stream_send_buffer_peer.h b/net/quic/test_tools/quic_stream_send_buffer_peer.h index 2b1ec772..6b8b115 100644 --- a/net/quic/test_tools/quic_stream_send_buffer_peer.h +++ b/net/quic/test_tools/quic_stream_send_buffer_peer.h
@@ -15,6 +15,9 @@ public: static void SetStreamOffset(QuicStreamSendBuffer* send_buffer, QuicStreamOffset stream_offset); + + static const BufferedSlice* CurrentWriteSlice( + QuicStreamSendBuffer* send_buffer); }; } // namespace test
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc index b207756..3725ca9 100644 --- a/net/quic/test_tools/quic_test_utils.cc +++ b/net/quic/test_tools/quic_test_utils.cc
@@ -383,11 +383,18 @@ } // static -QuicConsumedData MockQuicSession::ConsumeAllData(QuicStream* /*stream*/, - QuicStreamId /*id*/, - size_t write_length, - QuicStreamOffset /*offset*/, - StreamSendingState state) { +QuicConsumedData MockQuicSession::ConsumeData(QuicStream* stream, + QuicStreamId /*id*/, + size_t write_length, + QuicStreamOffset offset, + StreamSendingState state) { + if (write_length > 0) { + auto buf = QuicMakeUnique<char[]>(write_length); + QuicDataWriter writer(write_length, buf.get(), HOST_BYTE_ORDER); + stream->WriteStreamData(offset, write_length, &writer); + } else { + DCHECK(state != NO_FIN); + } return QuicConsumedData(write_length, state != NO_FIN); }
diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h index 2095527..375ad0e1 100644 --- a/net/quic/test_tools/quic_test_utils.h +++ b/net/quic/test_tools/quic_test_utils.h
@@ -535,11 +535,11 @@ // Returns a QuicConsumedData that indicates all of |write_length| (and |fin| // if set) has been consumed. - static QuicConsumedData ConsumeAllData(QuicStream* stream, - QuicStreamId id, - size_t write_length, - QuicStreamOffset offset, - StreamSendingState state); + static QuicConsumedData ConsumeData(QuicStream* stream, + QuicStreamId id, + size_t write_length, + QuicStreamOffset offset, + StreamSendingState state); private: std::unique_ptr<QuicCryptoStream> crypto_stream_;
diff --git a/net/socket/socks_client_socket_unittest.cc b/net/socket/socks_client_socket_unittest.cc index 0e94e27..f866f24 100644 --- a/net/socket/socks_client_socket_unittest.cc +++ b/net/socket/socks_client_socket_unittest.cc
@@ -132,6 +132,14 @@ return ERR_UNEXPECTED; } + int ResolveStaleFromCache(const RequestInfo& info, + AddressList* addresses, + HostCache::EntryStaleness* stale_info, + const NetLogWithSource& net_log) override { + NOTIMPLEMENTED(); + return ERR_UNEXPECTED; + } + bool HasCached(base::StringPiece hostname, HostCache::Entry::Source* source_out, HostCache::EntryStaleness* stale_out) const override {
diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc index 1a7906e..f67eff82 100644 --- a/net/socket/udp_socket_posix.cc +++ b/net/socket/udp_socket_posix.cc
@@ -41,8 +41,6 @@ #if defined(OS_ANDROID) #include <dlfcn.h> -// This was added in Lollipop to dlfcn.h -#define RTLD_NOLOAD 4 #include "base/android/build_info.h" #include "base/native_library.h" #include "base/strings/utf_string_conversions.h"
diff --git a/net/spdy/chromium/spdy_network_transaction_unittest.cc b/net/spdy/chromium/spdy_network_transaction_unittest.cc index edcde944..ee666d93 100644 --- a/net/spdy/chromium/spdy_network_transaction_unittest.cc +++ b/net/spdy/chromium/spdy_network_transaction_unittest.cc
@@ -22,6 +22,7 @@ #include "net/base/test_proxy_delegate.h" #include "net/base/upload_bytes_element_reader.h" #include "net/base/upload_file_element_reader.h" +#include "net/dns/mock_host_resolver.h" #include "net/http/http_auth_scheme.h" #include "net/http/http_network_session.h" #include "net/http/http_network_session_peer.h" @@ -535,6 +536,11 @@ url, session.get()) != kNoPushedStreamFound; } + static SpdyStreamId spdy_stream_hi_water_mark( + base::WeakPtr<SpdySession> session) { + return session->stream_hi_water_mark_; + } + const GURL default_url_; const HostPortPair host_port_pair_; HttpRequestInfo request_; @@ -3031,29 +3037,37 @@ } TEST_F(SpdyNetworkTransactionTest, ServerCancelsPush) { - SpdySerializedFrame req( + SpdySerializedFrame req1( spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); SpdySerializedFrame priority( spdy_util_.ConstructSpdyPriority(2, 1, IDLE, true)); - MockWrite writes[] = {CreateMockWrite(req, 0), CreateMockWrite(priority, 3)}; + spdy_util_.UpdateWithStreamDestruction(1); + SpdySerializedFrame req2(spdy_util_.ConstructSpdyGet( + GetDefaultUrlWithPath("/foo.dat").c_str(), 3, LOWEST)); + MockWrite writes1[] = {CreateMockWrite(req1, 0), CreateMockWrite(priority, 3), + CreateMockWrite(req2, 6)}; - SpdySerializedFrame reply(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); + SpdySerializedFrame reply1(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); SpdySerializedFrame push(spdy_util_.ConstructSpdyPush( nullptr, 0, 2, 1, GetDefaultUrlWithPath("/foo.dat").c_str())); - SpdySerializedFrame body(spdy_util_.ConstructSpdyDataFrame(1, true)); + SpdySerializedFrame body1(spdy_util_.ConstructSpdyDataFrame(1, true)); SpdySerializedFrame rst( spdy_util_.ConstructSpdyRstStream(2, ERROR_CODE_INTERNAL_ERROR)); - MockRead reads[] = {CreateMockRead(reply, 1), CreateMockRead(push, 2), - CreateMockRead(body, 4), CreateMockRead(rst, 5), - MockRead(ASYNC, 0, 6)}; + SpdySerializedFrame reply2(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 3)); + SpdySerializedFrame body2(spdy_util_.ConstructSpdyDataFrame(3, true)); + MockRead reads1[] = {CreateMockRead(reply1, 1), CreateMockRead(push, 2), + CreateMockRead(body1, 4), CreateMockRead(rst, 5), + CreateMockRead(reply2, 7), CreateMockRead(body2, 8), + MockRead(ASYNC, 0, 9)}; - SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes)); + SequencedSocketData data(reads1, arraysize(reads1), writes1, + arraysize(writes1)); NormalSpdyTransactionHelper helper(request_, DEFAULT_PRIORITY, log_, nullptr); helper.RunPreTestSetup(); helper.AddData(&data); - // First request to open up connection. + // First request opens up connection. HttpNetworkTransaction* trans1 = helper.trans(); TestCompletionCallback callback1; int rv = trans1->Start(&request_, callback1.callback(), log_); @@ -3062,29 +3076,174 @@ // Read until response body arrives. PUSH_PROMISE comes earlier. rv = callback1.WaitForResult(); EXPECT_THAT(rv, IsOk()); - HttpResponseInfo response = *trans1->GetResponseInfo(); - EXPECT_TRUE(response.headers); - EXPECT_EQ("HTTP/1.1 200", response.headers->GetStatusLine()); - SpdyString result; - ReadResult(trans1, &result); - EXPECT_EQ("hello!", result); + const HttpResponseInfo* response = trans1->GetResponseInfo(); + EXPECT_TRUE(response->headers); + EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine()); + std::string result1; + ReadResult(trans1, &result1); + EXPECT_EQ("hello!", result1); + + SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); + SpdySessionKey key(host_port_pair_, ProxyServer::Direct(), + PRIVACY_MODE_DISABLED); + base::WeakPtr<SpdySession> spdy_session = + spdy_session_pool->FindAvailableSession( + key, /* enable_ip_based_pooling = */ true, log_); + EXPECT_EQ(1u, num_unclaimed_pushed_streams(spdy_session)); // Create request matching pushed stream. - HttpRequestInfo request = CreateGetPushRequest(); HttpNetworkTransaction trans2(DEFAULT_PRIORITY, helper.session()); + HttpRequestInfo request2 = CreateGetPushRequest(); TestCompletionCallback callback2; - rv = trans2.Start(&request, callback2.callback(), log_); + rv = trans2.Start(&request2, callback2.callback(), log_); EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); - // Read RST_STREAM from server closing pushed stream. + // Pushed stream is now claimed by second request. + EXPECT_EQ(0u, num_unclaimed_pushed_streams(spdy_session)); + + // Second request receives RST_STREAM and is retried on the same connection. rv = callback2.WaitForResult(); - EXPECT_THAT(rv, IsError(ERR_SPDY_PUSHED_STREAM_NOT_AVAILABLE)); + EXPECT_THAT(rv, IsOk()); + response = trans2.GetResponseInfo(); + EXPECT_TRUE(response->headers); + EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine()); + std::string result2; + ReadResult(&trans2, &result2); + EXPECT_EQ("hello!", result2); // Read EOF. base::RunLoop().RunUntilIdle(); - EXPECT_TRUE(data.AllReadDataConsumed()); - EXPECT_TRUE(data.AllWriteDataConsumed()); + helper.VerifyDataConsumed(); +} + +// Regression test for https://crbug.com/776415. +// A client-initiated request can only pool to an existing HTTP/2 connection if +// the IP address matches. However, a resource can be pushed by the server on a +// connection even if the IP address does not match. This test verifies that if +// the request binds to such a pushed stream, and after that the server resets +// the stream before SpdySession::GetPushedStream() is called, then the retry +// (using a client-initiated stream) does not pool to this connection. +TEST_F(SpdyNetworkTransactionTest, ServerCancelsCrossOriginPush) { + const char* kUrl1 = "https://www.example.org"; + const char* kUrl2 = "https://mail.example.org"; + + auto resolver = std::make_unique<MockHostResolver>(); + resolver->rules()->ClearRules(); + resolver->rules()->AddRule("www.example.org", "127.0.0.1"); + resolver->rules()->AddRule("mail.example.org", "127.0.0.2"); + + auto session_deps = std::make_unique<SpdySessionDependencies>(); + session_deps->host_resolver = std::move(resolver); + NormalSpdyTransactionHelper helper(request_, DEFAULT_PRIORITY, log_, + std::move(session_deps)); + + SpdySerializedFrame req1(spdy_util_.ConstructSpdyGet(kUrl1, 1, LOWEST)); + SpdySerializedFrame priority( + spdy_util_.ConstructSpdyPriority(2, 1, IDLE, true)); + MockWrite writes1[] = {CreateMockWrite(req1, 0), + CreateMockWrite(priority, 3)}; + + SpdySerializedFrame reply1(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); + SpdySerializedFrame push( + spdy_util_.ConstructSpdyPush(nullptr, 0, 2, 1, kUrl2)); + SpdySerializedFrame body1(spdy_util_.ConstructSpdyDataFrame(1, true)); + SpdySerializedFrame rst( + spdy_util_.ConstructSpdyRstStream(2, ERROR_CODE_INTERNAL_ERROR)); + MockRead reads1[] = { + CreateMockRead(reply1, 1), CreateMockRead(push, 2), + CreateMockRead(body1, 4), CreateMockRead(rst, 5), + MockRead(ASYNC, ERR_IO_PENDING, 6), MockRead(ASYNC, 0, 7)}; + + SequencedSocketData data1(reads1, arraysize(reads1), writes1, + arraysize(writes1)); + + SpdyTestUtil spdy_util2; + SpdySerializedFrame req2(spdy_util2.ConstructSpdyGet(kUrl2, 1, LOWEST)); + MockWrite writes2[] = {CreateMockWrite(req2, 0)}; + + SpdySerializedFrame reply2(spdy_util2.ConstructSpdyGetReply(nullptr, 0, 1)); + base::StringPiece kData("Response on the second connection."); + SpdySerializedFrame body2( + spdy_util2.ConstructSpdyDataFrame(1, kData.data(), kData.size(), true)); + MockRead reads2[] = {CreateMockRead(reply2, 1), CreateMockRead(body2, 2), + MockRead(ASYNC, 0, 3)}; + + SequencedSocketData data2(reads2, arraysize(reads2), writes2, + arraysize(writes2)); + + helper.RunPreTestSetup(); + helper.AddData(&data1); + helper.AddData(&data2); + + // First request opens up connection to www.example.org. + HttpNetworkTransaction* trans1 = helper.trans(); + HttpRequestInfo request1; + request1.method = "GET"; + request1.url = GURL(kUrl1); + TestCompletionCallback callback1; + int rv = trans1->Start(&request1, callback1.callback(), log_); + EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); + + // Read until response body arrives. PUSH_PROMISE comes earlier. + rv = callback1.WaitForResult(); + EXPECT_THAT(rv, IsOk()); + const HttpResponseInfo* response = trans1->GetResponseInfo(); + EXPECT_TRUE(response->headers); + EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine()); + std::string result1; + ReadResult(trans1, &result1); + EXPECT_EQ("hello!", result1); + + SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); + SpdySessionKey key1(HostPortPair::FromURL(GURL(kUrl1)), ProxyServer::Direct(), + PRIVACY_MODE_DISABLED); + base::WeakPtr<SpdySession> spdy_session1 = + spdy_session_pool->FindAvailableSession( + key1, /* enable_ip_based_pooling = */ true, log_); + EXPECT_EQ(1u, num_unclaimed_pushed_streams(spdy_session1)); + + // While cross-origin push for kUrl2 is allowed on spdy_session1, + // a client-initiated request would not pool to this connection, + // because the IP address does not match. + SpdySessionKey key2(HostPortPair::FromURL(GURL(kUrl2)), ProxyServer::Direct(), + PRIVACY_MODE_DISABLED); + EXPECT_FALSE(spdy_session_pool->FindAvailableSession( + key2, /* enable_ip_based_pooling = */ true, log_)); + + // Create request matching pushed stream. + HttpNetworkTransaction trans2(DEFAULT_PRIORITY, helper.session()); + HttpRequestInfo request2; + request2.method = "GET"; + request2.url = GURL(kUrl2); + TestCompletionCallback callback2; + rv = trans2.Start(&request2, callback2.callback(), log_); + EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); + + // Pushed stream is now claimed by second request. + EXPECT_EQ(0u, num_unclaimed_pushed_streams(spdy_session1)); + + // Second request receives RST_STREAM and is retried on a new connection. + rv = callback2.WaitForResult(); + EXPECT_THAT(rv, IsOk()); + response = trans2.GetResponseInfo(); + EXPECT_TRUE(response->headers); + EXPECT_EQ("HTTP/1.1 200", response->headers->GetStatusLine()); + std::string result2; + ReadResult(&trans2, &result2); + EXPECT_EQ("Response on the second connection.", result2); + + // Make sure that the first connection is still open. This is important in + // order to test that the retry created its own connection (because the IP + // address does not match), instead of using the connection of the cancelled + // pushed stream. + EXPECT_TRUE(spdy_session1); + + // Read EOF. + data1.Resume(); + base::RunLoop().RunUntilIdle(); + + helper.VerifyDataConsumed(); } // Regression test for https://crbug.com/727653. @@ -6633,4 +6792,101 @@ EXPECT_TRUE(raw_headers.request_line().empty()); } +// A request that has adopted a push promise and later got reset by the server +// should be retried on a new stream. +// Regression test for https://crbug.com/798508. +TEST_F(SpdyNetworkTransactionTest, PushCanceledByServerAfterClaimed) { + const char pushed_url[] = "https://www.example.org/a.dat"; + // Construct a request to the default URL on stream 1. + SpdySerializedFrame req( + spdy_util_.ConstructSpdyGet(nullptr, 0, 1, LOWEST, true)); + SpdySerializedFrame req2(spdy_util_.ConstructSpdyGet(pushed_url, 3, LOWEST)); + // Construct a priority frame for stream 2. + SpdySerializedFrame priority( + spdy_util_.ConstructSpdyPriority(2, 1, IDLE, true)); + MockWrite writes[] = {CreateMockWrite(req, 0), CreateMockWrite(priority, 3), + CreateMockWrite(req2, 6)}; + + // Construct a Push Promise frame, with no response. + SpdySerializedFrame push_promise(spdy_util_.ConstructInitialSpdyPushFrame( + spdy_util_.ConstructGetHeaderBlock(pushed_url), 2, 1)); + // Construct a RST frame, canceling stream 2. + SpdySerializedFrame rst_server( + spdy_util_.ConstructSpdyRstStream(2, ERROR_CODE_CANCEL)); + // Construct response headers and bodies. + SpdySerializedFrame resp1(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 1)); + SpdySerializedFrame body1(spdy_util_.ConstructSpdyDataFrame(1, true)); + SpdySerializedFrame resp2(spdy_util_.ConstructSpdyGetReply(nullptr, 0, 3)); + SpdySerializedFrame body2(spdy_util_.ConstructSpdyDataFrame(3, true)); + MockRead reads[] = { + CreateMockRead(push_promise, 1), MockRead(ASYNC, ERR_IO_PENDING, 2), + CreateMockRead(rst_server, 4), MockRead(ASYNC, ERR_IO_PENDING, 5), + CreateMockRead(resp1, 7), CreateMockRead(body1, 8), + CreateMockRead(resp2, 9), CreateMockRead(body2, 10), + MockRead(ASYNC, 0, 11)}; + + SequencedSocketData data(reads, arraysize(reads), writes, arraysize(writes)); + + NormalSpdyTransactionHelper helper(request_, DEFAULT_PRIORITY, log_, nullptr); + + helper.RunPreTestSetup(); + helper.AddData(&data); + + HttpNetworkTransaction* trans = helper.trans(); + + // First request to start the connection. + TestCompletionCallback callback1; + int rv = trans->Start(&request_, callback1.callback(), log_); + EXPECT_THAT(rv, IsError(ERR_IO_PENDING)); + + data.RunUntilPaused(); + + // Get a SpdySession. + SpdySessionKey key(HostPortPair::FromURL(request_.url), ProxyServer::Direct(), + PRIVACY_MODE_DISABLED); + HttpNetworkSession* session = helper.session(); + base::WeakPtr<SpdySession> spdy_session = + session->spdy_session_pool()->FindAvailableSession( + key, /* enable_ip_based_pooling = */ true, log_); + + // Verify that there is one unclaimed push stream. + EXPECT_EQ(1u, num_unclaimed_pushed_streams(spdy_session)); + + // Claim the pushed stream. + HttpNetworkTransaction transaction2(DEFAULT_PRIORITY, session); + TestCompletionCallback callback2; + HttpRequestInfo request2; + request2.method = "GET"; + request2.url = GURL(pushed_url); + transaction2.Start(&request2, callback2.callback(), log_); + base::RunLoop().RunUntilIdle(); + EXPECT_EQ(3u, spdy_stream_hi_water_mark(spdy_session)); + + EXPECT_EQ(0u, num_unclaimed_pushed_streams(spdy_session)); + + // Continue reading and get the RST. + data.Resume(); + base::RunLoop().RunUntilIdle(); + + // Make sure we got the RST and retried the request. + EXPECT_EQ(2u, num_active_streams(spdy_session)); + EXPECT_EQ(0u, num_unclaimed_pushed_streams(spdy_session)); + EXPECT_EQ(5u, spdy_stream_hi_water_mark(spdy_session)); + + data.Resume(); + + // Test that transactions succeeded. + rv = callback1.WaitForResult(); + ASSERT_THAT(rv, IsOk()); + + rv = callback2.WaitForResult(); + ASSERT_THAT(rv, IsOk()); + + // Read EOF. + base::RunLoop().RunUntilIdle(); + + // Verify that all data was read and written. + helper.VerifyDataConsumed(); +} + } // namespace net
diff --git a/net/spdy/chromium/spdy_session.cc b/net/spdy/chromium/spdy_session.cc index 0043b4cb..fae4c5b9 100644 --- a/net/spdy/chromium/spdy_session.cc +++ b/net/spdy/chromium/spdy_session.cc
@@ -2639,9 +2639,13 @@ return; } + DCHECK(it->second); CHECK_EQ(it->second->stream_id(), stream_id); - if (error_code == ERROR_CODE_NO_ERROR) { + if (it->second->ShouldRetryRSTPushStream()) { + CloseActiveStreamIterator(it, + ERR_SPDY_CLAIMED_PUSHED_STREAM_RESET_BY_SERVER); + } else if (error_code == ERROR_CODE_NO_ERROR) { CloseActiveStreamIterator(it, ERR_SPDY_RST_STREAM_NO_ERROR_RECEIVED); } else if (error_code == ERROR_CODE_REFUSED_STREAM) { CloseActiveStreamIterator(it, ERR_SPDY_SERVER_REFUSED_STREAM);
diff --git a/net/spdy/chromium/spdy_stream.cc b/net/spdy/chromium/spdy_stream.cc index decec4b2..41e08ed 100644 --- a/net/spdy/chromium/spdy_stream.cc +++ b/net/spdy/chromium/spdy_stream.cc
@@ -455,6 +455,12 @@ } } +bool SpdyStream::ShouldRetryRSTPushStream() { + // Retry if the stream is a pushed stream, has been claimed, but did not yet + // receive response headers + return (response_headers_.empty() && type_ == SPDY_PUSH_STREAM && delegate_); +} + void SpdyStream::OnPushPromiseHeadersReceived(SpdyHeaderBlock headers) { CHECK(!request_headers_valid_); CHECK_EQ(io_state_, STATE_IDLE);
diff --git a/net/spdy/chromium/spdy_stream.h b/net/spdy/chromium/spdy_stream.h index 7ba0ff6..c8b2e38 100644 --- a/net/spdy/chromium/spdy_stream.h +++ b/net/spdy/chromium/spdy_stream.h
@@ -370,6 +370,7 @@ int64_t raw_received_bytes() const { return raw_received_bytes_; } int64_t raw_sent_bytes() const { return raw_sent_bytes_; } int recv_bytes() const { return recv_bytes_; } + bool ShouldRetryRSTPushStream(); bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const;
diff --git a/net/test/run_all_unittests.cc b/net/test/run_all_unittests.cc index 7ba6b98..635c4099 100644 --- a/net/test/run_all_unittests.cc +++ b/net/test/run_all_unittests.cc
@@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <iostream> + #include "base/build_time.h" -#include "base/metrics/statistics_recorder.h" #include "base/test/launcher/unit_test_launcher.h" #include "build/build_config.h" #include "crypto/nss_util.h" @@ -50,9 +51,6 @@ } // namespace int main(int argc, char** argv) { - // Record histograms, so we can get histograms data in tests. - base::StatisticsRecorder::Initialize(); - if (!VerifyBuildIsTimely()) return 1;
diff --git a/net/test/spawned_test_server/base_test_server.cc b/net/test/spawned_test_server/base_test_server.cc index 4171bbc..75a4cf8 100644 --- a/net/test/spawned_test_server/base_test_server.cc +++ b/net/test/spawned_test_server/base_test_server.cc
@@ -508,6 +508,12 @@ arguments->Set("no-anonymous-ftp-user", std::make_unique<base::Value>()); } + if (redirect_connect_to_localhost_) { + DCHECK_EQ(TYPE_BASIC_AUTH_PROXY, type_); + arguments->Set("redirect-connect-to-localhost", + std::make_unique<base::Value>()); + } + if (UsingSSL(type_)) { // Check the certificate arguments of the HTTPS server. base::FilePath certificate_path(certificates_dir_);
diff --git a/net/test/spawned_test_server/base_test_server.h b/net/test/spawned_test_server/base_test_server.h index a3592ac4..c279b6c 100644 --- a/net/test/spawned_test_server/base_test_server.h +++ b/net/test/spawned_test_server/base_test_server.h
@@ -370,6 +370,11 @@ no_anonymous_ftp_user_ = no_anonymous_ftp_user; } + // Redirect proxied CONNECT requests to localhost. + void set_redirect_connect_to_localhost(bool redirect_connect_to_localhost) { + redirect_connect_to_localhost_ = redirect_connect_to_localhost; + } + // Marks the root certificate of an HTTPS test server as trusted for // the duration of tests. bool LoadTestRootCert() const WARN_UNUSED_RESULT; @@ -454,6 +459,9 @@ // Disable creation of anonymous FTP user? bool no_anonymous_ftp_user_ = false; + // Redirect proxied CONNECT requests to localhost? + bool redirect_connect_to_localhost_ = false; + std::unique_ptr<ScopedPortException> allowed_port_; DISALLOW_COPY_AND_ASSIGN(BaseTestServer);
diff --git a/net/tools/quic/quic_simple_server_stream_test.cc b/net/tools/quic/quic_simple_server_stream_test.cc index deb696c..1d119ac 100644 --- a/net/tools/quic/quic_simple_server_stream_test.cc +++ b/net/tools/quic/quic_simple_server_stream_test.cc
@@ -239,7 +239,7 @@ TEST_P(QuicSimpleServerStreamTest, TestFraming) { EXPECT_CALL(session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); stream_->OnStreamHeaderList(false, kFakeFrameLen, header_list_); stream_->OnStreamFrame( QuicStreamFrame(stream_->id(), /*fin=*/false, /*offset=*/0, body_)); @@ -252,7 +252,7 @@ TEST_P(QuicSimpleServerStreamTest, TestFramingOnePacket) { EXPECT_CALL(session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); stream_->OnStreamHeaderList(false, kFakeFrameLen, header_list_); stream_->OnStreamFrame( @@ -266,7 +266,7 @@ TEST_P(QuicSimpleServerStreamTest, SendQuicRstStreamNoErrorInStopReading) { EXPECT_CALL(session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); EXPECT_FALSE(stream_->fin_received()); EXPECT_FALSE(stream_->rst_received()); @@ -284,7 +284,7 @@ // We'll automatically write out an error (headers + body) EXPECT_CALL(session_, WriteHeadersMock(_, _, _, _, _)); EXPECT_CALL(session_, WritevData(_, _, _, _, _)) - .WillOnce(Invoke(MockQuicSession::ConsumeAllData)); + .WillOnce(Invoke(MockQuicSession::ConsumeData)); EXPECT_CALL(session_, SendRstStream(_, QUIC_STREAM_NO_ERROR, _)).Times(0); stream_->OnStreamHeaderList(false, kFakeFrameLen, header_list_); @@ -528,7 +528,7 @@ EXPECT_CALL(session_, WriteHeadersMock(_, _, _, _, _)); EXPECT_CALL(session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); stream_->OnStreamHeaderList(true, kFakeFrameLen, header_list_); EXPECT_TRUE(QuicStreamPeer::read_side_closed(stream_)); @@ -546,7 +546,7 @@ EXPECT_CALL(session_, WriteHeadersMock(_, _, _, _, _)); EXPECT_CALL(session_, WritevData(_, _, _, _, _)) .Times(AnyNumber()) - .WillRepeatedly(Invoke(MockQuicSession::ConsumeAllData)); + .WillRepeatedly(Invoke(MockQuicSession::ConsumeData)); stream_->OnStreamHeaderList(true, kFakeFrameLen, header_list_); EXPECT_TRUE(QuicStreamPeer::read_side_closed(stream_));
diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py index 634b41e..0576ac6 100755 --- a/net/tools/testserver/testserver.py +++ b/net/tools/testserver/testserver.py
@@ -1765,6 +1765,7 @@ """ _AUTH_CREDENTIAL = 'Basic Zm9vOmJhcg==' # foo:bar + redirect_connect_to_localhost = False; def parse_request(self): """Overrides parse_request to check credential.""" @@ -1850,6 +1851,9 @@ self.send_response(400) self.end_headers() + if BasicAuthProxyRequestHandler.redirect_connect_to_localhost: + host = "127.0.0.1" + try: sock = socket.create_connection((host, port)) self.send_response(200, 'Connection established') @@ -2108,6 +2112,8 @@ print 'Echo UDP server started on port %d...' % server.server_port server_data['port'] = server.server_port elif self.options.server_type == SERVER_BASIC_AUTH_PROXY: + BasicAuthProxyRequestHandler.redirect_connect_to_localhost = \ + self.options.redirect_connect_to_localhost server = HTTPServer((host, port), BasicAuthProxyRequestHandler) print 'BasicAuthProxy server started on port %d...' % server.server_port server_data['port'] = server.server_port @@ -2323,6 +2329,12 @@ action='store_true') self.option_parser.add_option('--token-binding-params', action='append', default=[], type='int') + self.option_parser.add_option('--redirect-connect-to-localhost', + dest='redirect_connect_to_localhost', + default=False, action='store_true', + help='If set, the Proxy server will connect ' + 'to localhost instead of the requested URL ' + 'on CONNECT requests') if __name__ == '__main__':
diff --git a/printing/print_settings.cc b/printing/print_settings.cc index 28967e8..b95ba27 100644 --- a/printing/print_settings.cc +++ b/printing/print_settings.cc
@@ -171,8 +171,7 @@ device_name_.clear(); requested_media_ = RequestedMedia(); page_setup_device_units_.Clear(); - dpi_[0] = 0; - dpi_[1] = 0; + dpi_ = gfx::Size(); scale_factor_ = 1.0f; rasterize_pdf_ = false; landscape_ = false;
diff --git a/printing/print_settings.h b/printing/print_settings.h index 68f793b..354b5377 100644 --- a/printing/print_settings.h +++ b/printing/print_settings.h
@@ -14,6 +14,7 @@ #include "printing/print_job_constants.h" #include "printing/printing_export.h" #include "ui/gfx/geometry/rect.h" +#include "ui/gfx/geometry/size.h" namespace printing { @@ -101,17 +102,14 @@ } const base::string16& device_name() const { return device_name_; } - void set_dpi(int dpi) { - dpi_[0] = dpi; - dpi_[1] = dpi; - } + void set_dpi(int dpi) { dpi_ = gfx::Size(dpi, dpi); } void set_dpi_xy(int dpi_horizontal, int dpi_vertical) { - dpi_[0] = dpi_horizontal; - dpi_[1] = dpi_vertical; + dpi_ = gfx::Size(dpi_horizontal, dpi_vertical); } - int dpi() const { return std::max(dpi_[0], dpi_[1]); } - int dpi_horizontal() const { return dpi_[0]; } - int dpi_vertical() const { return dpi_[1]; } + + int dpi() const { return std::max(dpi_.width(), dpi_.height()); } + int dpi_horizontal() const { return dpi_.width(); } + int dpi_vertical() const { return dpi_.height(); } void set_scale_factor(double scale_factor) { scale_factor_ = scale_factor; } double scale_factor() const { return scale_factor_; } @@ -238,7 +236,7 @@ // Printer's device effective dots per inch in both axes. The two values will // generally be identical. However, on Windows, there are a few rare printers // that support resolutions with different DPI in different dimensions. - int dpi_[2]; + gfx::Size dpi_; // Scale factor double scale_factor_;
diff --git a/remoting/host/chromoting_host_context.cc b/remoting/host/chromoting_host_context.cc index aff123e..9d2e45dc 100644 --- a/remoting/host/chromoting_host_context.cc +++ b/remoting/host/chromoting_host_context.cc
@@ -19,7 +19,8 @@ void DisallowBlockingOperations() { base::ThreadRestrictions::SetIOAllowed(false); - base::ThreadRestrictions::DisallowWaiting(); + // TODO(crbug.com/793486): Re-enable after the underlying issue is fixed. + // base::ThreadRestrictions::DisallowBaseSyncPrimitives(); } } // namespace
diff --git a/rlz/lib/financial_ping.cc b/rlz/lib/financial_ping.cc index edcc842..bc9827a 100644 --- a/rlz/lib/financial_ping.cc +++ b/rlz/lib/financial_ping.cc
@@ -242,7 +242,7 @@ } private: - ~RefCountedWaitableEvent() {} + ~RefCountedWaitableEvent() = default; friend class base::RefCountedThreadSafe<RefCountedWaitableEvent>; base::WaitableEvent event_;
diff --git a/rlz/lib/rlz_lib_test.cc b/rlz/lib/rlz_lib_test.cc index 2b106b8..95868f8 100644 --- a/rlz/lib/rlz_lib_test.cc +++ b/rlz/lib/rlz_lib_test.cc
@@ -57,8 +57,8 @@ } private: - MachineDealCodeHelper() {} - ~MachineDealCodeHelper() {} + MachineDealCodeHelper() = default; + ~MachineDealCodeHelper() = default; }; class RlzLibTest : public RlzLibTestBase {
diff --git a/sandbox/linux/syscall_broker/broker_command.cc b/sandbox/linux/syscall_broker/broker_command.cc index 36e29dd3..46533d3 100644 --- a/sandbox/linux/syscall_broker/broker_command.cc +++ b/sandbox/linux/syscall_broker/broker_command.cc
@@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <unistd.h> + #include "sandbox/linux/syscall_broker/broker_command.h" #include "sandbox/linux/syscall_broker/broker_permission_list.h"
diff --git a/sandbox/linux/syscall_broker/broker_file_permission.cc b/sandbox/linux/syscall_broker/broker_file_permission.cc index 46126942..05c7830 100644 --- a/sandbox/linux/syscall_broker/broker_file_permission.cc +++ b/sandbox/linux/syscall_broker/broker_file_permission.cc
@@ -7,6 +7,7 @@ #include <fcntl.h> #include <stddef.h> #include <string.h> +#include <unistd.h> #include <string>
diff --git a/sandbox/linux/syscall_broker/broker_host.cc b/sandbox/linux/syscall_broker/broker_host.cc index 5cb4517e..bdfa875 100644 --- a/sandbox/linux/syscall_broker/broker_host.cc +++ b/sandbox/linux/syscall_broker/broker_host.cc
@@ -197,6 +197,12 @@ write_pickle->WriteData(reinterpret_cast<char*>(&sb), sizeof(sb)); } else { DCHECK(command_type == COMMAND_STAT64); +#if defined(__ANDROID_API__) && __ANDROID_API__ < 21 + // stat64 is not defined for older Android API versions in newer NDK + // versions. + write_pickle->WriteInt(-ENOSYS); + return; +#else struct stat64 sb; if (stat64(file_to_access, &sb) < 0) { write_pickle->WriteInt(-errno); @@ -204,6 +210,7 @@ } write_pickle->WriteInt(0); write_pickle->WriteData(reinterpret_cast<char*>(&sb), sizeof(sb)); +#endif // defined(__ANDROID_API__) && __ANDROID_API__ < 21 } }
diff --git a/sandbox/mac/seatbelt_exec.cc b/sandbox/mac/seatbelt_exec.cc index 52af21e..53a5e79 100644 --- a/sandbox/mac/seatbelt_exec.cc +++ b/sandbox/mac/seatbelt_exec.cc
@@ -4,6 +4,7 @@ #include "sandbox/mac/seatbelt_exec.h" +#include <fcntl.h> #include <stdarg.h> #include <stdio.h> #include <sys/socket.h> @@ -22,6 +23,13 @@ SeatbeltExecClient::SeatbeltExecClient() { if (pipe(pipe_) != 0) logging::PFatal("SeatbeltExecClient: pipe failed"); + + int pipe_flags = fcntl(pipe_[1], F_GETFL); + if (pipe_flags == -1) + logging::PFatal("SeatbeltExecClient: fctnl(F_GETFL) failed"); + + if (fcntl(pipe_[1], F_SETFL, pipe_flags | O_NONBLOCK) == -1) + logging::PFatal("SeatbeltExecClient: fcntl(F_SETFL) failed"); } SeatbeltExecClient::~SeatbeltExecClient() {
diff --git a/services/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java b/services/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java index dcc93eb7..48733188 100644 --- a/services/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java +++ b/services/device/generic_sensor/android/junit/src/org/chromium/device/sensors/PlatformSensorAndProviderTest.java
@@ -299,6 +299,28 @@ } /** + * Test that shared buffer is correctly populated from SensorEvent for sensors with more + * than one value. + */ + @Test + @Feature({"PlatformSensor"}) + public void testSensorReadingFromEventMoreValues() { + TestPlatformSensor sensor = createTestPlatformSensor( + 50000, Sensor.TYPE_ROTATION_VECTOR, 4, Sensor.REPORTING_MODE_ON_CHANGE); + initPlatformSensor(sensor); + TestPlatformSensor spySensor = spy(sensor); + SensorEvent event = createFakeEvent(4); + assertNotNull(event); + spySensor.onSensorChanged(event); + + double timestamp = PLATFORM_SENSOR_TIMESTAMP * SECONDS_IN_NANOSECOND; + + verify(spySensor, times(1)) + .updateSensorReading(timestamp, getFakeReadingValue(1), getFakeReadingValue(2), + getFakeReadingValue(3), getFakeReadingValue(4)); + } + + /** * Test that PlatformSensor notifies client when there is an error. */ @Test
diff --git a/services/metrics/public/cpp/ukm_recorder.h b/services/metrics/public/cpp/ukm_recorder.h index 9260284..808148f 100644 --- a/services/metrics/public/cpp/ukm_recorder.h +++ b/services/metrics/public/cpp/ukm_recorder.h
@@ -47,6 +47,7 @@ } namespace content { +class CrossSiteDocumentResourceHandler; class WebContentsImpl; class PluginServiceImpl; } // namespace content @@ -130,6 +131,7 @@ friend blink::AutoplayUmaHelper; friend blink::Document; friend cc::UkmManager; + friend content::CrossSiteDocumentResourceHandler; friend content::PluginServiceImpl; friend content::WebContentsImpl; friend internal::SourceUrlRecorderWebContentsObserver;
diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn index 6bf8dfa..6b6bb47 100644 --- a/services/network/public/cpp/BUILD.gn +++ b/services/network/public/cpp/BUILD.gn
@@ -24,6 +24,7 @@ public_deps = [ "//services/network/public/interfaces", + "//url/ipc:url_ipc", ] deps = [
diff --git a/services/network/public/cpp/network_param_ipc_traits.cc b/services/network/public/cpp/network_param_ipc_traits.cc index 70b73e4e5..290a814 100644 --- a/services/network/public/cpp/network_param_ipc_traits.cc +++ b/services/network/public/cpp/network_param_ipc_traits.cc
@@ -152,6 +152,7 @@ WriteParam(m, p.ct_policy_compliance); WriteParam(m, p.ocsp_result.response_status); WriteParam(m, p.ocsp_result.revocation_status); + WriteParam(m, p.is_fatal_cert_error); } bool ParamTraits<net::SSLInfo>::Read(const base::Pickle* m, @@ -180,7 +181,8 @@ ReadParam(m, iter, &r->signed_certificate_timestamps) && ReadParam(m, iter, &r->ct_policy_compliance) && ReadParam(m, iter, &r->ocsp_result.response_status) && - ReadParam(m, iter, &r->ocsp_result.revocation_status); + ReadParam(m, iter, &r->ocsp_result.revocation_status) && + ReadParam(m, iter, &r->is_fatal_cert_error); } void ParamTraits<net::SSLInfo>::Log(const param_type& p, std::string* l) {
diff --git a/services/network/public/cpp/network_param_ipc_traits.h b/services/network/public/cpp/network_param_ipc_traits.h index 5711ffc..e7eb41b 100644 --- a/services/network/public/cpp/network_param_ipc_traits.h +++ b/services/network/public/cpp/network_param_ipc_traits.h
@@ -16,8 +16,10 @@ #include "net/cert/signed_certificate_timestamp_and_status.h" #include "net/http/http_request_headers.h" #include "net/ssl/ssl_info.h" +#include "net/url_request/redirect_info.h" #include "services/network/public/cpp/cors_error_status.h" #include "services/network/public/cpp/url_loader_completion_status.h" +#include "url/ipc/url_param_traits.h" #ifndef INTERNAL_SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_ #define INTERNAL_SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_ @@ -25,7 +27,8 @@ // services/network/public/cpp is currently packaged as a static library, // so there's no need for export defines; it's linked directly into whatever // other components need it. -// This redefinition is present for the IPC macros below. +// This redefinition is present for the IPC macros below, including in the +// included header files. #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT @@ -154,4 +157,17 @@ IPC_STRUCT_TRAITS_MEMBER(blocked_cross_site_document) IPC_STRUCT_TRAITS_END() +IPC_ENUM_TRAITS_MAX_VALUE(net::URLRequest::ReferrerPolicy, + net::URLRequest::MAX_REFERRER_POLICY - 1) + +IPC_STRUCT_TRAITS_BEGIN(net::RedirectInfo) + IPC_STRUCT_TRAITS_MEMBER(status_code) + IPC_STRUCT_TRAITS_MEMBER(new_method) + IPC_STRUCT_TRAITS_MEMBER(new_url) + IPC_STRUCT_TRAITS_MEMBER(new_site_for_cookies) + IPC_STRUCT_TRAITS_MEMBER(new_referrer) + IPC_STRUCT_TRAITS_MEMBER(new_referrer_policy) + IPC_STRUCT_TRAITS_MEMBER(referred_token_binding_host) +IPC_STRUCT_TRAITS_END() + #endif // SERVICES_NETWORK_PUBLIC_CPP_NETWORK_PARAM_IPC_TRAITS_H_
diff --git a/services/network/public/cpp/proxy_resolving_client_socket.cc b/services/network/public/cpp/proxy_resolving_client_socket.cc index 2e95253..bb8522be 100644 --- a/services/network/public/cpp/proxy_resolving_client_socket.cc +++ b/services/network/public/cpp/proxy_resolving_client_socket.cc
@@ -36,7 +36,6 @@ : ssl_config_(ssl_config), pac_request_(NULL), url_(url), - tried_direct_connect_fallback_(false), net_log_(net::NetLogWithSource::Make( request_context_getter->GetURLRequestContext()->net_log(), net::NetLogSourceType::SOCKET)), @@ -141,8 +140,6 @@ const net::CompletionCallback& callback) { DCHECK(user_connect_callback_.is_null()); - tried_direct_connect_fallback_ = false; - // First try to resolve the proxy. // TODO(xunjieli): Having a null ProxyDelegate is bad. Figure out how to // interact with the new interface for proxy delegate. @@ -280,18 +277,10 @@ } } - // TODO(xunjieli): This results in retrying "Direct" twice, because of - // ReconsiderProxyAfterError() path. https://crbug.com/793076. - // Try falling back to a direct connection if we have not tried that before. if (net_error != net::OK) { - if (!tried_direct_connect_fallback_) { - tried_direct_connect_fallback_ = true; - proxy_info_.UseDirect(); - } else { - CloseTransportSocket(); - base::ResetAndReturn(&user_connect_callback_).Run(net_error); - return; - } + CloseTransportSocket(); + base::ResetAndReturn(&user_connect_callback_).Run(net_error); + return; } transport_.reset(new net::ClientSocketHandle);
diff --git a/services/network/public/cpp/proxy_resolving_client_socket.h b/services/network/public/cpp/proxy_resolving_client_socket.h index 3a119f7..bf77197 100644 --- a/services/network/public/cpp/proxy_resolving_client_socket.h +++ b/services/network/public/cpp/proxy_resolving_client_socket.h
@@ -110,7 +110,6 @@ net::ProxyService::PacRequest* pac_request_; net::ProxyInfo proxy_info_; const GURL url_; - bool tried_direct_connect_fallback_; net::NetLogWithSource net_log_; // The callback passed to Connect().
diff --git a/services/network/public/cpp/proxy_resolving_client_socket_unittest.cc b/services/network/public/cpp/proxy_resolving_client_socket_unittest.cc index 12679e0..5e372a8 100644 --- a/services/network/public/cpp/proxy_resolving_client_socket_unittest.cc +++ b/services/network/public/cpp/proxy_resolving_client_socket_unittest.cc
@@ -94,14 +94,6 @@ socket_data.set_connect_data(net::MockConnect( test.is_error_sync ? net::SYNCHRONOUS : net::ASYNC, net::ERR_FAILED)); socket_factory.AddSocketDataProvider(&socket_data); - net::StaticSocketDataProvider socket_data2; - if (!test.is_direct) { - // TODO(xunjieli): https://crbug.com/793076. When net::ERR_FAILED is - // reported with proxy, this should not be retried. - socket_data2.set_connect_data(net::MockConnect( - test.is_error_sync ? net::SYNCHRONOUS : net::ASYNC, net::ERR_FAILED)); - socket_factory.AddSocketDataProvider(&socket_data2); - } ProxyResolvingClientSocket proxy_resolving_socket( &socket_factory, context_getter, net::SSLConfig(), kDestination); @@ -109,13 +101,13 @@ int status = proxy_resolving_socket.Connect(callback.callback()); EXPECT_EQ(net::ERR_IO_PENDING, status); status = callback.WaitForResult(); - EXPECT_EQ(net::ERR_FAILED, status); + if (test.is_direct) { + EXPECT_EQ(net::ERR_FAILED, status); + } else { + EXPECT_EQ(net::ERR_PROXY_CONNECTION_FAILED, status); + } EXPECT_TRUE(socket_data.AllReadDataConsumed()); EXPECT_TRUE(socket_data.AllWriteDataConsumed()); - if (!test.is_direct) { - EXPECT_TRUE(socket_data2.AllReadDataConsumed()); - EXPECT_TRUE(socket_data2.AllWriteDataConsumed()); - } } }
diff --git a/services/preferences/tracked/pref_hash_filter_unittest.cc b/services/preferences/tracked/pref_hash_filter_unittest.cc index 1f85f718..f3912dd8 100644 --- a/services/preferences/tracked/pref_hash_filter_unittest.cc +++ b/services/preferences/tracked/pref_hash_filter_unittest.cc
@@ -549,7 +549,6 @@ reset_recorded_(false) {} void SetUp() override { - base::StatisticsRecorder::Initialize(); Reset(); }
diff --git a/services/resource_coordinator/memory_instrumentation/coordinator_impl.cc b/services/resource_coordinator/memory_instrumentation/coordinator_impl.cc index 81002daf..56d6bf2 100644 --- a/services/resource_coordinator/memory_instrumentation/coordinator_impl.cc +++ b/services/resource_coordinator/memory_instrumentation/coordinator_impl.cc
@@ -95,7 +95,33 @@ callback.Run(success, std::move(global_memory_dump)); }; - QueuedRequest::Args args(dump_type, level_of_detail, false /* addToTrace */); + QueuedRequest::Args args(dump_type, level_of_detail, false /* add_to_trace */, + base::kNullProcessId); + RequestGlobalMemoryDumpInternal(args, base::BindRepeating(adapter, callback)); +} + +void CoordinatorImpl::RequestGlobalMemoryDumpForPid( + base::ProcessId pid, + const RequestGlobalMemoryDumpForPidCallback& callback) { + // Error out early if process id is null to avoid confusing with global + // dump for all processes case when pid is kNullProcessId. + if (pid == base::kNullProcessId) { + callback.Run(false, nullptr); + return; + } + + // This merely strips out the |dump_guid| argument; this is not relevant + // as we are not adding to trace. + auto adapter = [](const RequestGlobalMemoryDumpForPidCallback& callback, + bool success, uint64_t, + mojom::GlobalMemoryDumpPtr global_memory_dump) { + callback.Run(success, std::move(global_memory_dump)); + }; + + QueuedRequest::Args args( + base::trace_event::MemoryDumpType::SUMMARY_ONLY, + base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND, + false /* addToTrace */, pid); RequestGlobalMemoryDumpInternal(args, base::BindRepeating(adapter, callback)); } @@ -109,7 +135,8 @@ bool success, uint64_t dump_guid, mojom::GlobalMemoryDumpPtr) { callback.Run(success, dump_guid); }; - QueuedRequest::Args args(dump_type, level_of_detail, true /* addToTrace */); + QueuedRequest::Args args(dump_type, level_of_detail, true /* add_to_trace */, + base::kNullProcessId); RequestGlobalMemoryDumpInternal(args, base::BindRepeating(adapter, callback)); }
diff --git a/services/resource_coordinator/memory_instrumentation/coordinator_impl.h b/services/resource_coordinator/memory_instrumentation/coordinator_impl.h index 14680739..1b09a0d 100644 --- a/services/resource_coordinator/memory_instrumentation/coordinator_impl.h +++ b/services/resource_coordinator/memory_instrumentation/coordinator_impl.h
@@ -55,6 +55,9 @@ void RequestGlobalMemoryDump(base::trace_event::MemoryDumpType, base::trace_event::MemoryDumpLevelOfDetail, const RequestGlobalMemoryDumpCallback&) override; + void RequestGlobalMemoryDumpForPid( + base::ProcessId, + const RequestGlobalMemoryDumpForPidCallback&) override; void RequestGlobalMemoryDumpAndAppendToTrace( base::trace_event::MemoryDumpType, base::trace_event::MemoryDumpLevelOfDetail,
diff --git a/services/resource_coordinator/memory_instrumentation/coordinator_impl_unittest.cc b/services/resource_coordinator/memory_instrumentation/coordinator_impl_unittest.cc index 4e52eae..512e9a2 100644 --- a/services/resource_coordinator/memory_instrumentation/coordinator_impl_unittest.cc +++ b/services/resource_coordinator/memory_instrumentation/coordinator_impl_unittest.cc
@@ -44,6 +44,8 @@ CoordinatorImpl::RequestGlobalMemoryDumpAndAppendToTraceCallback; using RequestGlobalMemoryDumpCallback = memory_instrumentation::CoordinatorImpl::RequestGlobalMemoryDumpCallback; +using RequestGlobalMemoryDumpForPidCallback = memory_instrumentation:: + CoordinatorImpl::RequestGlobalMemoryDumpForPidCallback; using base::trace_event::MemoryAllocatorDump; using base::trace_event::MemoryDumpArgs; using base::trace_event::MemoryDumpLevelOfDetail; @@ -136,6 +138,12 @@ coordinator_->RequestGlobalMemoryDump(dump_type, level_of_detail, callback); } + void RequestGlobalMemoryDumpForPid( + base::ProcessId pid, + RequestGlobalMemoryDumpForPidCallback callback) { + coordinator_->RequestGlobalMemoryDumpForPid(pid, callback); + } + void RequestGlobalMemoryDumpAndAppendToTrace( RequestGlobalMemoryDumpAndAppendToTraceCallback callback) { coordinator_->RequestGlobalMemoryDumpAndAppendToTrace( @@ -228,8 +236,8 @@ } RequestGlobalMemoryDumpCallback Get() { - return base::Bind(&MockGlobalMemoryDumpCallback::Run, - base::Unretained(this)); + return base::BindRepeating(&MockGlobalMemoryDumpCallback::Run, + base::Unretained(this)); } }; @@ -241,8 +249,9 @@ void Run(bool success, uint64_t dump_guid) { OnCall(success, dump_guid); } RequestGlobalMemoryDumpAndAppendToTraceCallback Get() { - return base::Bind(&MockGlobalMemoryDumpAndAppendToTraceCallback::Run, - base::Unretained(this)); + return base::BindRepeating( + &MockGlobalMemoryDumpAndAppendToTraceCallback::Run, + base::Unretained(this)); } }; @@ -793,8 +802,9 @@ std::unique_ptr<trace_analyzer::TraceAnalyzer> analyzer = GetDeserializedTrace(); trace_analyzer::TraceEventVector events; - analyzer->FindEvents(Query::EventPhaseIs(TRACE_EVENT_PHASE_MEMORY_DUMP), - &events); + analyzer->FindEvents( + trace_analyzer::Query::EventPhaseIs(TRACE_EVENT_PHASE_MEMORY_DUMP), + &events); ASSERT_EQ(0u, events.size()); } @@ -806,7 +816,6 @@ NiceMock<MockClientProcess> client_process(this, 1, mojom::ProcessType::BROWSER); - EXPECT_CALL(client_process, RequestChromeMemoryDump(_, _)) .WillOnce( Invoke([](const MemoryDumpRequestArgs& args, @@ -831,13 +840,118 @@ std::unique_ptr<trace_analyzer::TraceAnalyzer> analyzer = GetDeserializedTrace(); trace_analyzer::TraceEventVector events; - analyzer->FindEvents(Query::EventPhaseIs(TRACE_EVENT_PHASE_MEMORY_DUMP), - &events); + analyzer->FindEvents( + trace_analyzer::Query::EventPhaseIs(TRACE_EVENT_PHASE_MEMORY_DUMP), + &events); ASSERT_EQ(1u, events.size()); ASSERT_TRUE(trace_analyzer::CountMatches( - events, Query::EventNameIs(MemoryDumpTypeToString( + events, trace_analyzer::Query::EventNameIs(MemoryDumpTypeToString( MemoryDumpType::EXPLICITLY_TRIGGERED)))); } +TEST_F(CoordinatorImplTest, DumpByPidSuccess) { + static constexpr base::ProcessId kBrowserPid = 1; + static constexpr base::ProcessId kRendererPid = 2; + static constexpr base::ProcessId kGpuPid = 3; + + NiceMock<MockClientProcess> client_process_1(this, kBrowserPid, + mojom::ProcessType::BROWSER); + NiceMock<MockClientProcess> client_process_2(this, kRendererPid, + mojom::ProcessType::RENDERER); + NiceMock<MockClientProcess> client_process_3(this, kGpuPid, + mojom::ProcessType::GPU); + +// This ifdef is here to match the sandboxing behavior of the client. +// On Linux, all memory dumps come from the browser client. On all other +// platforms, they are expected to come from each individual client. +#if defined(OS_LINUX) + EXPECT_CALL(client_process_1, RequestOSMemoryDump(_, _, _)) + .WillOnce(Invoke( + [](bool want_mmaps, const std::vector<base::ProcessId>& pids, + const MockClientProcess::RequestOSMemoryDumpCallback& callback) { + std::unordered_map<base::ProcessId, mojom::RawOSMemDumpPtr> results; + results[kBrowserPid] = FillRawOSDump(kBrowserPid); + callback.Run(true, std::move(results)); + })) + .WillOnce(Invoke( + [](bool want_mmaps, const std::vector<base::ProcessId>& pids, + const MockClientProcess::RequestOSMemoryDumpCallback& callback) { + std::unordered_map<base::ProcessId, mojom::RawOSMemDumpPtr> results; + results[kRendererPid] = FillRawOSDump(kRendererPid); + callback.Run(true, std::move(results)); + })) + .WillOnce(Invoke( + [](bool want_mmaps, const std::vector<base::ProcessId>& pids, + const MockClientProcess::RequestOSMemoryDumpCallback& callback) { + std::unordered_map<base::ProcessId, mojom::RawOSMemDumpPtr> results; + results[kGpuPid] = FillRawOSDump(kGpuPid); + callback.Run(true, std::move(results)); + })); +#else + EXPECT_CALL(client_process_1, RequestOSMemoryDump(_, Contains(0), _)) + .WillOnce(Invoke( + [](bool want_mmaps, const std::vector<base::ProcessId>& pids, + const MockClientProcess::RequestOSMemoryDumpCallback& callback) { + std::unordered_map<base::ProcessId, mojom::RawOSMemDumpPtr> results; + results[0] = FillRawOSDump(kBrowserPid); + callback.Run(true, std::move(results)); + })); + EXPECT_CALL(client_process_2, RequestOSMemoryDump(_, Contains(0), _)) + .WillOnce(Invoke( + [](bool want_mmaps, const std::vector<base::ProcessId>& pids, + const MockClientProcess::RequestOSMemoryDumpCallback& callback) { + std::unordered_map<base::ProcessId, mojom::RawOSMemDumpPtr> results; + results[0] = FillRawOSDump(kRendererPid); + callback.Run(true, std::move(results)); + })); + EXPECT_CALL(client_process_3, RequestOSMemoryDump(_, Contains(0), _)) + .WillOnce(Invoke( + [](bool want_mmaps, const std::vector<base::ProcessId>& pids, + const MockClientProcess::RequestOSMemoryDumpCallback& callback) { + std::unordered_map<base::ProcessId, mojom::RawOSMemDumpPtr> results; + results[0] = FillRawOSDump(kGpuPid); + callback.Run(true, std::move(results)); + })); +#endif // defined(OS_LINUX) + + base::RunLoop run_loop; + + MockGlobalMemoryDumpCallback callback; + EXPECT_CALL(callback, OnCall(true, Ne(nullptr))) + .WillOnce(Invoke([](bool success, GlobalMemoryDump* global_dump) { + EXPECT_EQ(1U, global_dump->process_dumps.size()); + EXPECT_EQ(global_dump->process_dumps[0]->pid, kBrowserPid); + })) + .WillOnce(Invoke([](bool success, GlobalMemoryDump* global_dump) { + EXPECT_EQ(1U, global_dump->process_dumps.size()); + EXPECT_EQ(global_dump->process_dumps[0]->pid, kRendererPid); + })) + .WillOnce( + Invoke([&run_loop](bool success, GlobalMemoryDump* global_dump) { + EXPECT_EQ(1U, global_dump->process_dumps.size()); + EXPECT_EQ(global_dump->process_dumps[0]->pid, kGpuPid); + run_loop.Quit(); + })); + + RequestGlobalMemoryDumpForPid(kBrowserPid, callback.Get()); + RequestGlobalMemoryDumpForPid(kRendererPid, callback.Get()); + RequestGlobalMemoryDumpForPid(kGpuPid, callback.Get()); + run_loop.Run(); +} + +TEST_F(CoordinatorImplTest, DumpByPidFailure) { + NiceMock<MockClientProcess> client_process_1(this, 1, + mojom::ProcessType::BROWSER); + + base::RunLoop run_loop; + + MockGlobalMemoryDumpCallback callback; + EXPECT_CALL(callback, OnCall(false, nullptr)) + .WillOnce(RunClosure(run_loop.QuitClosure())); + + RequestGlobalMemoryDumpForPid(2, callback.Get()); + run_loop.Run(); +} + } // namespace memory_instrumentation
diff --git a/services/resource_coordinator/memory_instrumentation/queued_request.cc b/services/resource_coordinator/memory_instrumentation/queued_request.cc index a6f8271d..115893f 100644 --- a/services/resource_coordinator/memory_instrumentation/queued_request.cc +++ b/services/resource_coordinator/memory_instrumentation/queued_request.cc
@@ -8,10 +8,12 @@ QueuedRequest::Args::Args(MemoryDumpType dump_type, MemoryDumpLevelOfDetail level_of_detail, - bool add_to_trace) + bool add_to_trace, + base::ProcessId pid) : dump_type(dump_type), level_of_detail(level_of_detail), - add_to_trace(add_to_trace) {} + add_to_trace(add_to_trace), + pid(pid) {} QueuedRequest::Args::~Args() {} QueuedRequest::Response::Response() {} @@ -19,7 +21,7 @@ QueuedRequest::QueuedRequest( const Args& args, - const uint64_t dump_guid, + uint64_t dump_guid, const RequestGlobalMemoryDumpInternalCallback& callback) : args(args), dump_guid(dump_guid), callback(callback) {}
diff --git a/services/resource_coordinator/memory_instrumentation/queued_request.h b/services/resource_coordinator/memory_instrumentation/queued_request.h index 5cb9f36c..0d97542b 100644 --- a/services/resource_coordinator/memory_instrumentation/queued_request.h +++ b/services/resource_coordinator/memory_instrumentation/queued_request.h
@@ -30,12 +30,14 @@ struct Args { Args(MemoryDumpType dump_type, MemoryDumpLevelOfDetail level_of_detail, - bool add_to_trace); + bool add_to_trace, + base::ProcessId pid); ~Args(); const MemoryDumpType dump_type; const MemoryDumpLevelOfDetail level_of_detail; const bool add_to_trace; + const base::ProcessId pid; }; struct PendingResponse { @@ -62,7 +64,7 @@ }; QueuedRequest(const Args& args, - const uint64_t dump_guid, + uint64_t dump_guid, const RequestGlobalMemoryDumpInternalCallback& callback); ~QueuedRequest();
diff --git a/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc b/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc index d8a8de35..080e6d1 100644 --- a/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc +++ b/services/resource_coordinator/memory_instrumentation/queued_request_dispatcher.cc
@@ -233,6 +233,14 @@ for (const auto& client_info : clients) { mojom::ClientProcess* client = client_info.client; + + // If we're only looking for a single pid process, then ignore clients + // with different pid. + if (request->args.pid != base::kNullProcessId && + request->args.pid != client_info.pid) { + continue; + } + request->responses[client].process_id = client_info.pid; request->responses[client].process_type = client_info.process_type; @@ -251,6 +259,11 @@ client->RequestOSMemoryDump(request->wants_mmaps(), {base::kNullProcessId}, base::Bind(os_callback, client)); #endif // !defined(OS_LINUX) + + // If we are in the single pid case, then we've already found the only + // process we're looking for. + if (request->args.pid != base::kNullProcessId) + break; } // In some cases, OS stats can only be dumped from a privileged process to @@ -258,23 +271,33 @@ #if defined(OS_LINUX) std::vector<base::ProcessId> pids; mojom::ClientProcess* browser_client = nullptr; - pids.reserve(clients.size()); + pids.reserve(request->args.pid == base::kNullProcessId ? clients.size() : 1); for (const auto& client_info : clients) { - pids.push_back(client_info.pid); + if (request->args.pid == base::kNullProcessId || + client_info.pid == request->args.pid) { + pids.push_back(client_info.pid); + } if (client_info.process_type == mojom::ProcessType::BROWSER) { browser_client = client_info.client; } } - if (clients.size() > 0) { DCHECK(browser_client); } - if (browser_client) { + if (browser_client && pids.size() > 0) { request->pending_responses.insert({browser_client, ResponseType::kOSDump}); const auto callback = base::Bind(os_callback, browser_client); browser_client->RequestOSMemoryDump(request->wants_mmaps(), pids, callback); } #endif // defined(OS_LINUX) + + // In this case, we have not found the pid we are looking for so increment + // the failed dump count and exit. + if (request->args.pid != base::kNullProcessId && + request->pending_responses.empty()) { + request->failed_memory_dump_count++; + return; + } } void QueuedRequestDispatcher::Finalize(QueuedRequest* request, @@ -356,6 +379,11 @@ for (const auto& response : request->responses) { base::ProcessId pid = response.second.process_id; + // On Linux, we may also have the browser process as a response. + // Just ignore it if we are looking for the single pid case. + if (request->args.pid != base::kNullProcessId && pid != request->args.pid) + continue; + // These pointers are owned by |request|. mojom::RawOSMemDump* raw_os_dump = pid_to_os_dump[pid]; auto* raw_chrome_dump = pid_to_pmd[pid]; @@ -394,6 +422,7 @@ (!request->wants_chrome_dumps() || raw_chrome_dump) && (!request->wants_mmaps() || (raw_os_dump && !raw_os_dump->memory_maps.empty())); + if (!valid) continue; @@ -418,8 +447,14 @@ global_dump->process_dumps.push_back(std::move(pmd)); } - const auto& callback = request->callback; const bool global_success = request->failed_memory_dump_count == 0; + + // In the single process-case, we want to ensure that global_success + // is true if and only if global_dump is not nullptr. + if (request->args.pid != base::kNullProcessId && !global_success) { + global_dump = nullptr; + } + const auto& callback = request->callback; callback.Run(global_success, request->dump_guid, std::move(global_dump)); UMA_HISTOGRAM_MEDIUM_TIMES("Memory.Experimental.Debug.GlobalDumpDuration", base::Time::Now() - request->start_time);
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.cc index 0867f5a..52392ea 100644 --- a/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.cc +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.cc
@@ -52,6 +52,13 @@ callback); } +void MemoryInstrumentation::RequestGlobalDumpForPid( + base::ProcessId pid, + RequestGlobalDumpCallback callback) { + const auto& coordinator = GetCoordinatorBindingForCurrentThread(); + coordinator->RequestGlobalMemoryDumpForPid(pid, callback); +} + void MemoryInstrumentation::RequestGlobalDumpAndAppendToTrace( MemoryDumpType dump_type, MemoryDumpLevelOfDetail level_of_detail,
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h b/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h index 98fca71..806998ce 100644 --- a/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/memory_instrumentation.h
@@ -30,9 +30,9 @@ using MemoryDumpType = base::trace_event::MemoryDumpType; using MemoryDumpLevelOfDetail = base::trace_event::MemoryDumpLevelOfDetail; using RequestGlobalDumpCallback = - base::Callback<void(bool success, mojom::GlobalMemoryDumpPtr)>; + base::RepeatingCallback<void(bool success, mojom::GlobalMemoryDumpPtr)>; using RequestGlobalMemoryDumpAndAppendToTraceCallback = - base::Callback<void(bool success, uint64_t dump_id)>; + base::RepeatingCallback<void(bool success, uint64_t dump_id)>; static void CreateInstance(service_manager::Connector*, const std::string& service_name); @@ -46,6 +46,14 @@ // RequestGlobalDump() call. void RequestGlobalDump(RequestGlobalDumpCallback); + // Requests a global memory dump. + // Returns asynchronously, via the callback argument, the global memory + // dump with the process memory dump for the given pid or null if the dump + // failed. + // The callback (if not null), will be posted on the same thread of the + // RequestGlobalDumpForPid() call. + void RequestGlobalDumpForPid(base::ProcessId pid, RequestGlobalDumpCallback); + // Requests a global memory dump and serializes the result into the trace. // This requires that both tracing and the memory-infra category have been // previousy enabled. Will just gracefully fail otherwise.
diff --git a/services/resource_coordinator/public/cpp/memory_instrumentation/tracing_integration_unittest.cc b/services/resource_coordinator/public/cpp/memory_instrumentation/tracing_integration_unittest.cc index a3193ae1..9607525 100644 --- a/services/resource_coordinator/public/cpp/memory_instrumentation/tracing_integration_unittest.cc +++ b/services/resource_coordinator/public/cpp/memory_instrumentation/tracing_integration_unittest.cc
@@ -119,6 +119,10 @@ MemoryDumpLevelOfDetail level_of_detail, const RequestGlobalMemoryDumpCallback&) override; + void RequestGlobalMemoryDumpForPid( + base::ProcessId pid, + const RequestGlobalMemoryDumpForPidCallback&) override {} + void RequestGlobalMemoryDumpAndAppendToTrace( MemoryDumpType dump_type, MemoryDumpLevelOfDetail level_of_detail,
diff --git a/services/resource_coordinator/public/interfaces/memory_instrumentation/memory_instrumentation.mojom b/services/resource_coordinator/public/interfaces/memory_instrumentation/memory_instrumentation.mojom index d7070bf..1f27be8 100644 --- a/services/resource_coordinator/public/interfaces/memory_instrumentation/memory_instrumentation.mojom +++ b/services/resource_coordinator/public/interfaces/memory_instrumentation/memory_instrumentation.mojom
@@ -232,6 +232,11 @@ RequestGlobalMemoryDump(DumpType dump_type, LevelOfDetail level_of_detail) => (bool success, GlobalMemoryDump? global_memory_dump); + // Sends a dump request to the client process given by the specified pid and + // returns a summarized dump back or null if there was a failure. + RequestGlobalMemoryDumpForPid(mojo.common.mojom.ProcessId pid) => + (bool success, GlobalMemoryDump? global_memory_dump); + // Broadcasts a dump request to all registered client processes and injects the // dump in the trace buffer (if tracing is enabled). RequestGlobalMemoryDumpAndAppendToTrace(DumpType dump_type,
diff --git a/services/service_manager/sandbox/linux/sandbox_seccomp_bpf_linux.h b/services/service_manager/sandbox/linux/sandbox_seccomp_bpf_linux.h index 73ebc10b..62a9f939 100644 --- a/services/service_manager/sandbox/linux/sandbox_seccomp_bpf_linux.h +++ b/services/service_manager/sandbox/linux/sandbox_seccomp_bpf_linux.h
@@ -31,7 +31,7 @@ // Options for GPU's PreSandboxHook. bool accelerated_video_decode_enabled = false; - bool vaapi_accelerated_video_encode_enabled = false; + bool accelerated_video_encode_enabled = false; }; // This is the API to enable a seccomp-bpf sandbox for content/
diff --git a/services/ui/main.cc b/services/ui/main.cc index 27c9ab5..2f3f812 100644 --- a/services/ui/main.cc +++ b/services/ui/main.cc
@@ -8,8 +8,9 @@ #include "services/ui/service.h" MojoResult ServiceMain(MojoHandle service_request_handle) { - ui::Service* ui_service = new ui::Service; - ui_service->set_running_standalone(true); + ui::Service::InitParams params; + params.running_standalone = true; + ui::Service* ui_service = new ui::Service(params); service_manager::ServiceRunner runner(ui_service); runner.set_message_loop_type(base::MessageLoop::TYPE_UI); return runner.Run(service_request_handle);
diff --git a/services/ui/public/cpp/gpu/BUILD.gn b/services/ui/public/cpp/gpu/BUILD.gn index b310e4c..d8e7c0b 100644 --- a/services/ui/public/cpp/gpu/BUILD.gn +++ b/services/ui/public/cpp/gpu/BUILD.gn
@@ -48,5 +48,6 @@ "//mojo/public/cpp/system", "//services/service_manager/public/cpp", "//services/ui/public/interfaces", + "//ui/gl", ] }
diff --git a/services/ui/public/interfaces/BUILD.gn b/services/ui/public/interfaces/BUILD.gn index a0d5b567..9978dc5 100644 --- a/services/ui/public/interfaces/BUILD.gn +++ b/services/ui/public/interfaces/BUILD.gn
@@ -6,6 +6,14 @@ import("//testing/test.gni") mojom("interfaces") { + # The window service runs in the browser process for --mus and in the + # ash_and_ui process for --mash. Allow IPC serialization to be skipped for + # the common case of in-process mojo calls. This causes a ~130KB size + # increase on 64-bit Intel builds. + if (is_chromeos) { + support_lazy_serialization = true + } + sources = [ "accessibility_manager.mojom", "clipboard.mojom",
diff --git a/services/ui/public/interfaces/ime/BUILD.gn b/services/ui/public/interfaces/ime/BUILD.gn index e3cb247b..f709bc274 100644 --- a/services/ui/public/interfaces/ime/BUILD.gn +++ b/services/ui/public/interfaces/ime/BUILD.gn
@@ -5,6 +5,11 @@ import("//mojo/public/tools/bindings/mojom.gni") mojom("ime") { + # See //services/ui/public/interfaces/BUILD.gn + if (is_chromeos) { + support_lazy_serialization = true + } + sources = [ "ime.mojom", ]
diff --git a/services/ui/service.cc b/services/ui/service.cc index f49ef3c..270c58c 100644 --- a/services/ui/service.cc +++ b/services/ui/service.cc
@@ -80,27 +80,22 @@ class ThreadedImageCursorsFactoryImpl : public ws::ThreadedImageCursorsFactory { public: - // Uses the same InProcessConfig as the UI Service. |config| will be null when - // the UI Service runs in it's own separate process as opposed to the WM's - // process. - explicit ThreadedImageCursorsFactoryImpl( - const Service::InProcessConfig* config) { - if (config) { - resource_runner_ = config->resource_runner; - image_cursors_set_weak_ptr_ = config->image_cursors_set_weak_ptr; - DCHECK(resource_runner_); + explicit ThreadedImageCursorsFactoryImpl(const Service::InitParams& params) { + // When running in-process use |resource_runner_| to load cursors. + if (params.resource_runner) { + resource_runner_ = params.resource_runner; + // |params.image_cursors_set_weak_ptr| must be set, but don't DCHECK + // because it can only be dereferenced on |resource_runner_|. + image_cursors_set_weak_ptr_ = params.image_cursors_set_weak_ptr; } } - ~ThreadedImageCursorsFactoryImpl() override {} + ~ThreadedImageCursorsFactoryImpl() override = default; // ws::ThreadedImageCursorsFactory: std::unique_ptr<ws::ThreadedImageCursors> CreateCursors() override { - // |resource_runner_| will not be initialized if and only if UI Service runs - // in it's own separate process. In this case we can (lazily) initialize it - // to the current thread (i.e. the UI Services's thread). We also initialize - // the local |image_cursors_set_| and make |image_cursors_set_weak_ptr_| - // point to it. + // When running out-of-process lazily initialize the resource runner to the + // UI service's thread. if (!resource_runner_) { resource_runner_ = base::ThreadTaskRunnerHandle::Get(); image_cursors_set_ = std::make_unique<ui::ImageCursorsSet>(); @@ -135,19 +130,21 @@ std::unique_ptr<ws::WindowTreeHostFactory> window_tree_host_factory; }; -Service::InProcessConfig::InProcessConfig() = default; +Service::InitParams::InitParams() = default; -Service::InProcessConfig::~InProcessConfig() = default; +Service::InitParams::~InitParams() = default; -Service::Service(const InProcessConfig* config) - : is_in_process_(config != nullptr), +Service::Service(const InitParams& params) + : running_standalone_(params.running_standalone), threaded_image_cursors_factory_( - std::make_unique<ThreadedImageCursorsFactoryImpl>(config)), + std::make_unique<ThreadedImageCursorsFactoryImpl>(params)), test_config_(false), ime_registrar_(&ime_driver_), - discardable_shared_memory_manager_(config ? config->memory_manager - : nullptr), - should_host_viz_(!config || config->should_host_viz) {} + discardable_shared_memory_manager_(params.memory_manager), + should_host_viz_(params.should_host_viz) { + // UI service must host viz when running in its own process. + DCHECK(!running_standalone_ || should_host_viz_); +} Service::~Service() { in_destructor_ = true; @@ -171,7 +168,7 @@ } bool Service::InitializeResources(service_manager::Connector* connector) { - if (is_in_process() || ui::ResourceBundle::HasSharedInstance()) + if (!running_standalone_ || ui::ResourceBundle::HasSharedInstance()) return true; std::set<std::string> resource_paths; @@ -187,8 +184,7 @@ return false; } - if (running_standalone_) - ui::RegisterPathProvider(); + ui::RegisterPathProvider(); // Initialize resource bundle with 1x and 2x cursor bitmaps. ui::ResourceBundle::InitSharedInstanceWithPakFileRegion( @@ -256,7 +252,7 @@ ui::KeyboardLayoutEngineManager::GetKeyboardLayoutEngine() ->SetCurrentLayoutByName("us"); - if (!is_in_process()) { + if (running_standalone_) { client_native_pixmap_factory_ = ui::CreateClientNativePixmapFactoryOzone(); gfx::ClientNativePixmapFactory::SetInstance( client_native_pixmap_factory_.get()); @@ -411,8 +407,9 @@ ws::DisplayCreationConfig::MANUAL) { #if defined(OS_CHROMEOS) display::ScreenManagerForwarding::Mode mode = - is_in_process() ? display::ScreenManagerForwarding::Mode::IN_WM_PROCESS - : display::ScreenManagerForwarding::Mode::OWN_PROCESS; + running_standalone_ + ? display::ScreenManagerForwarding::Mode::OWN_PROCESS + : display::ScreenManagerForwarding::Mode::IN_WM_PROCESS; screen_manager_ = std::make_unique<display::ScreenManagerForwarding>(mode); #else CHECK(false);
diff --git a/services/ui/service.h b/services/ui/service.h index 936455d..4544987 100644 --- a/services/ui/service.h +++ b/services/ui/service.h
@@ -74,11 +74,12 @@ class Service : public service_manager::Service, public ws::WindowServerDelegate { public: - // Contains the configuration necessary to run the UI Service inside the - // Window Manager's process. - struct InProcessConfig { - InProcessConfig(); - ~InProcessConfig(); + struct InitParams { + InitParams(); + ~InitParams(); + + // UI service runs in its own process (i.e. not embedded in browser or ash). + bool running_standalone = false; // Can be used to load resources. scoped_refptr<base::SingleThreadTaskRunner> resource_runner = nullptr; @@ -95,17 +96,12 @@ bool should_host_viz = true; private: - DISALLOW_COPY_AND_ASSIGN(InProcessConfig); + DISALLOW_COPY_AND_ASSIGN(InitParams); }; - // |config| should be null when UI Service runs in it's own separate process, - // as opposed to inside the Window Manager's process. - explicit Service(const InProcessConfig* config = nullptr); + explicit Service(const InitParams& params); ~Service() override; - // Call if the ui::Service is being run as a standalone process. - void set_running_standalone(bool value) { running_standalone_ = value; } - private: // Holds InterfaceRequests received before the first WindowTreeHost Display // has been established. @@ -114,8 +110,6 @@ using UserIdToUserState = std::map<ws::UserId, std::unique_ptr<UserState>>; - bool is_in_process() const { return is_in_process_; } - // Attempts to initialize the resource bundle. Returns true if successful, // otherwise false if resources cannot be loaded. bool InitializeResources(service_manager::Connector* connector); @@ -204,9 +198,9 @@ // and must outlive |registry_|. InputDeviceServer input_device_server_; - // True if the UI Service runs inside WM's process, false if it runs inside - // its own process. - const bool is_in_process_; + // True if the UI Service runs runs inside its own process, false if it is + // embedded in another process. + const bool running_standalone_; std::unique_ptr<ws::ThreadedImageCursorsFactory> threaded_image_cursors_factory_; @@ -248,8 +242,6 @@ bool in_destructor_ = false; - bool running_standalone_ = false; - DISALLOW_COPY_AND_ASSIGN(Service); };
diff --git a/services/ui/ws/BUILD.gn b/services/ui/ws/BUILD.gn index 36af449b..7b5ffbc8 100644 --- a/services/ui/ws/BUILD.gn +++ b/services/ui/ws/BUILD.gn
@@ -318,6 +318,7 @@ "//ui/gfx/geometry", "//ui/gfx/geometry/mojo", "//ui/gl", + "//ui/gl/init", ] }
diff --git a/services/ui/ws/server_window.cc b/services/ui/ws/server_window.cc index 8cda2618..14f1f43 100644 --- a/services/ui/ws/server_window.cc +++ b/services/ui/ws/server_window.cc
@@ -105,8 +105,7 @@ // or Android. We should instead use GpuSurfaceTracker here on those // platforms. delegate_->GetVizHostProxy()->CreateRootCompositorFrameSink( - frame_sink_id_, widget, - viz::CreateRendererSettings(viz::BufferUsageAndFormatList()), + frame_sink_id_, widget, viz::CreateRendererSettings(), std::move(sink_request), std::move(client), std::move(display_request), std::move(display_client)); }
diff --git a/services/viz/privileged/interfaces/compositing/BUILD.gn b/services/viz/privileged/interfaces/compositing/BUILD.gn index bac1877f..c2726bd 100644 --- a/services/viz/privileged/interfaces/compositing/BUILD.gn +++ b/services/viz/privileged/interfaces/compositing/BUILD.gn
@@ -8,11 +8,14 @@ sources = [ "display_private.mojom", "frame_sink_manager.mojom", + "frame_sink_video_capture.mojom", "renderer_settings.mojom", ] public_deps = [ "//gpu/ipc/common:interfaces", + "//media/capture/mojo:capture_types", + "//media/mojo/interfaces:interfaces", "//mojo/common:common_custom_types", "//services/viz/public/interfaces", "//ui/gfx/geometry/mojo",
diff --git a/services/viz/privileged/interfaces/compositing/frame_sink_manager.mojom b/services/viz/privileged/interfaces/compositing/frame_sink_manager.mojom index 8046a4a..28bda406 100644 --- a/services/viz/privileged/interfaces/compositing/frame_sink_manager.mojom +++ b/services/viz/privileged/interfaces/compositing/frame_sink_manager.mojom
@@ -7,6 +7,7 @@ import "gpu/ipc/common/surface_handle.mojom"; import "mojo/common/time.mojom"; import "services/viz/privileged/interfaces/compositing/display_private.mojom"; +import "services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom"; import "services/viz/privileged/interfaces/compositing/renderer_settings.mojom"; import "services/viz/public/interfaces/compositing/compositor_frame_sink.mojom"; import "services/viz/public/interfaces/compositing/frame_sink_id.mojom"; @@ -91,6 +92,9 @@ // Requests viz to notify |observer| whenever video activity is detected in // one of the clients. See viz::VideoDetector. AddVideoDetectorObserver(VideoDetectorObserver observer); + + // Creates a FrameSinkVideoCapturer instance. + CreateVideoCapturer(FrameSinkVideoCapturer& request); }; // The FrameSinkManagerClient interface is implemented by the Display
diff --git a/services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom b/services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom new file mode 100644 index 0000000..66e2bf9 --- /dev/null +++ b/services/viz/privileged/interfaces/compositing/frame_sink_video_capture.mojom
@@ -0,0 +1,118 @@ +// Copyright 2017 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 viz.mojom; + +import "media/capture/mojo/video_capture_types.mojom"; +import "media/mojo/interfaces/media_types.mojom"; +import "mojo/common/time.mojom"; +import "services/viz/public/interfaces/compositing/frame_sink_id.mojom"; +import "ui/gfx/geometry/mojo/geometry.mojom"; + +// Provided with each call to FrameSinkVideoConsumer::OnFrameCaptured() so that +// the consumer can notify the capturer the instant it is done consuming the +// frame, and then later (optionally) provide utilization feedback. +interface FrameSinkVideoConsumerFrameCallbacks { + // Informs the capturer that the consumer is done reading the content of the + // video frame. + Done(); + + // Reports that the frame incurred some fractional |utilization| of the + // downstream pipeline's per-frame processing capacity. See code comments in + // media::base::VideoFrameMetadata for a discussion of how |utilization| is + // interpreted. The capturer uses this information to auto-adjust the capture + // resolution based on performance variances in the live system environment. + ProvideFeedback(double utilization); +}; + +// Interface for a consumer that receives frames and notifications related to +// capture of the source content. An instance that implements this interface is +// provided to FrameSinkVideoCapturer.Start(). +interface FrameSinkVideoConsumer { + // Called to deliver each frame to the consumer. |buffer| and |buffer_size| + // are provided to access the video data. |info| is used to interpret the + // format/layout of the data, and also contains the frame timestamps and other + // metadata (the following media::VideoFrameMetadata keys are set: + // CAPTURE_BEGIN_TIME, CAPTURE_END_TIME, COLOR_SPACE, FRAME_DURATION, + // INTERACTIVE_CONTENT, REFERENCE_TIME). |update_rect| is the region of the + // frame that has changed since the last frame. |content_rect| is the region + // of the frame that contains the captured content, with the rest of the frame + // having been letterboxed to adhere to resolution constraints. + OnFrameCaptured(handle<shared_buffer> buffer, + uint32 buffer_size, + media.mojom.VideoFrameInfo info, + gfx.mojom.Rect update_rect, + gfx.mojom.Rect content_rect, + FrameSinkVideoConsumerFrameCallbacks callbacks); + + // Indicates the video capture target (a frame sink) has gone away. A consumer + // should use this to determine whether to change to a different target or + // shutdown. + OnTargetLost(FrameSinkId frame_sink_id); + + // Indicates that OnFrameCaptured() will not be called again, an end-of-stream + // signal. + OnStopped(); +}; + +// Interface to an implementation that captures the frames of a +// CompositorFrameSink's surface as a video stream. During operation, the +// "target" frame sink can be changed, as needed, to continue capturing the +// desired content (e.g., a new web page in the same browser tab). +// +// The SetXYZ() methods set or change the video capture parameters and +// constraints. They may be called any time before and/or after a Start() call. +// Note that the consumer must not assume any changes have taken effect until +// this is reflected in some later delivered frame. +// +// General usage: A capturer is created, its SetXYZ() methods are called, +// followed by ChangeTarget() and then Start(). Then, later, when video capture +// should suspend, Stop() is called. After that point, Start() can be called +// again to resume capture; or the mojo binding can be dropped to auto-terminate +// the capturer. +interface FrameSinkVideoCapturer { + // Specifies the pixel format and color space to use. + // + // Default, if never called: PIXEL_FORMAT_I420, COLOR_SPACE_HD_REC709 + SetFormat(media.mojom.VideoPixelFormat format, + media.mojom.ColorSpace color_space); + + // Specifies the maximum rate of capture in terms of a minimum time period + // (min_period = 1/max_frame_rate). + // + // Default, if never called: a very conservative 1/5 second (for 5 FPS + // max). Usually 30-60 FPS is desired for frame sinks that may contain video + // content. + SetMinCapturePeriod(mojo.common.mojom.TimeDelta min_period); + + // Specifies the range (if any) of acceptable capture resolutions and whether + // a fixed aspect ratio is required. When |min_size| is equal to |max_size|, + // capture resolution will be held constant. Otherwise, capture resolution + // will dynamically adapt over time as the source content size and system + // resource utilization change. If a fixed aspect ratio is required, the + // aspect ratio of |max_size| is used and the implementation will letterbox + // around the captured content when needed. + // + // Default, if never called: Fixed at 640x360 (standard definition, 16:9). + // Usually, 320x180↔3840x2160 (auto-adapt, 16:9) is desired when the consumer + // can handle variable frame resolutions. + SetResolutionConstraints(gfx.mojom.Size min_size, gfx.mojom.Size max_size, + bool use_fixed_aspect_ratio); + + // Targets a different compositor frame sink. This may be called anytime, + // before or after Start(). + ChangeTarget(FrameSinkId frame_sink_id); + + // Starts emitting video frames to the given |consumer|. + Start(FrameSinkVideoConsumer consumer); + + // Stops capturing "soon." Meaning, no new frame captures will be started, but + // there may already be some in-flight for delivery. Wait for the "end of + // stream" signal provided by FrameSinkVideoConsumer.OnStopped(). + Stop(); + + // Requests the capturer send a duplicate of the last frame. This is used to + // resolve occasional "picture loss" issues consumer-side. + RequestRefreshFrame(); +};
diff --git a/services/viz/privileged/interfaces/struct_traits_unittest.cc b/services/viz/privileged/interfaces/struct_traits_unittest.cc index af5b931a..7f5eeb9 100644 --- a/services/viz/privileged/interfaces/struct_traits_unittest.cc +++ b/services/viz/privileged/interfaces/struct_traits_unittest.cc
@@ -25,8 +25,6 @@ ResourceSettings arbitrary_resource_settings; arbitrary_resource_settings.texture_id_allocation_chunk_size = kArbitrarySize; arbitrary_resource_settings.use_gpu_memory_buffer_resources = kArbitraryBool; - arbitrary_resource_settings.texture_target_exception_list.push_back( - std::make_pair(gfx::BufferUsage::SCANOUT, gfx::BufferFormat::BGRX_8888)); RendererSettings input; @@ -53,8 +51,6 @@ output.resource_settings.texture_id_allocation_chunk_size); EXPECT_EQ(input.resource_settings.use_gpu_memory_buffer_resources, output.resource_settings.use_gpu_memory_buffer_resources); - EXPECT_EQ(input.resource_settings.texture_target_exception_list, - output.resource_settings.texture_target_exception_list); EXPECT_EQ(input.allow_antialiasing, output.allow_antialiasing); EXPECT_EQ(input.force_antialiasing, output.force_antialiasing); EXPECT_EQ(input.force_blending_with_shaders,
diff --git a/services/viz/public/cpp/compositing/resource_settings_struct_traits.cc b/services/viz/public/cpp/compositing/resource_settings_struct_traits.cc index d085f28..9b7f173 100644 --- a/services/viz/public/cpp/compositing/resource_settings_struct_traits.cc +++ b/services/viz/public/cpp/compositing/resource_settings_struct_traits.cc
@@ -7,14 +7,6 @@ namespace mojo { // static -bool StructTraits<viz::mojom::BufferUsageAndFormatDataView, - viz::BufferUsageAndFormat>:: - Read(viz::mojom::BufferUsageAndFormatDataView data, - viz::BufferUsageAndFormat* out) { - return data.ReadUsage(&out->first) && data.ReadFormat(&out->second); -} - -// static bool StructTraits<viz::mojom::ResourceSettingsDataView, viz::ResourceSettings>:: Read(viz::mojom::ResourceSettingsDataView data, viz::ResourceSettings* out) { @@ -22,20 +14,6 @@ data.texture_id_allocation_chunk_size(); out->use_gpu_memory_buffer_resources = data.use_gpu_memory_buffer_resources(); - mojo::ArrayDataView<viz::mojom::BufferUsageAndFormatDataView> - usage_and_format_list; - data.GetTextureTargetExceptionListDataView(&usage_and_format_list); - for (size_t i = 0; i < usage_and_format_list.size(); ++i) { - viz::mojom::BufferUsageAndFormatDataView usage_format_view; - usage_and_format_list.GetDataView(i, &usage_format_view); - viz::BufferUsageAndFormat usage_format; - if (!usage_format_view.ReadUsage(&usage_format.first) || - !usage_format_view.ReadFormat(&usage_format.second)) - return false; - - out->texture_target_exception_list.push_back(usage_format); - } - return true; }
diff --git a/services/viz/public/cpp/compositing/resource_settings_struct_traits.h b/services/viz/public/cpp/compositing/resource_settings_struct_traits.h index 6dac8538..44e3493 100644 --- a/services/viz/public/cpp/compositing/resource_settings_struct_traits.h +++ b/services/viz/public/cpp/compositing/resource_settings_struct_traits.h
@@ -27,30 +27,10 @@ return input.use_gpu_memory_buffer_resources; } - static const viz::BufferUsageAndFormatList& texture_target_exception_list( - const viz::ResourceSettings& input) { - return input.texture_target_exception_list; - } - static bool Read(viz::mojom::ResourceSettingsDataView data, viz::ResourceSettings* out); }; -template <> -struct StructTraits<viz::mojom::BufferUsageAndFormatDataView, - viz::BufferUsageAndFormat> { - static gfx::BufferUsage usage(const viz::BufferUsageAndFormat& input) { - return input.first; - } - - static gfx::BufferFormat format(const viz::BufferUsageAndFormat& input) { - return input.second; - } - - static bool Read(viz::mojom::BufferUsageAndFormatDataView data, - viz::BufferUsageAndFormat* out); -}; - } // namespace mojo #endif // SERVICES_VIZ_PUBLIC_CPP_COMPOSITING_RESOURCE_SETTINGS_STRUCT_TRAITS_H_
diff --git a/services/viz/public/cpp/compositing/struct_traits_unittest.cc b/services/viz/public/cpp/compositing/struct_traits_unittest.cc index 8bb84dd..cd90bf3 100644 --- a/services/viz/public/cpp/compositing/struct_traits_unittest.cc +++ b/services/viz/public/cpp/compositing/struct_traits_unittest.cc
@@ -390,8 +390,6 @@ ResourceSettings input; input.texture_id_allocation_chunk_size = kArbitrarySize; input.use_gpu_memory_buffer_resources = kArbitraryBool; - input.texture_target_exception_list.push_back( - std::make_pair(gfx::BufferUsage::SCANOUT, gfx::BufferFormat::BGRX_8888)); ResourceSettings output; SerializeAndDeserialize<mojom::ResourceSettings>(input, &output); @@ -400,8 +398,6 @@ output.texture_id_allocation_chunk_size); EXPECT_EQ(input.use_gpu_memory_buffer_resources, output.use_gpu_memory_buffer_resources); - EXPECT_EQ(input.texture_target_exception_list, - output.texture_target_exception_list); } TEST_F(StructTraitsTest, Selection) {
diff --git a/services/viz/public/interfaces/compositing/resource_settings.mojom b/services/viz/public/interfaces/compositing/resource_settings.mojom index 35446e2..62e571e 100644 --- a/services/viz/public/interfaces/compositing/resource_settings.mojom +++ b/services/viz/public/interfaces/compositing/resource_settings.mojom
@@ -4,17 +4,9 @@ module viz.mojom; -import "ui/gfx/mojo/buffer_types.mojom"; - -struct BufferUsageAndFormat { - gfx.mojom.BufferUsage usage; - gfx.mojom.BufferFormat format; -}; - // Corresponds to |viz::ResourceSettings| in // components/viz/common/resources/resource_settings.h struct ResourceSettings { uint32 texture_id_allocation_chunk_size; bool use_gpu_memory_buffer_resources; - array<BufferUsageAndFormat> texture_target_exception_list; };
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h index 60827e57..48933f5 100644 --- a/skia/config/SkUserConfig.h +++ b/skia/config/SkUserConfig.h
@@ -241,6 +241,10 @@ #define SK_SUPPORT_LEGACY_CONTAINED_IN_CLIP #endif +#ifndef SK_SUPPORT_LEGACY_2PT_CONICAL +#define SK_SUPPORT_LEGACY_2PT_CONICAL +#endif + ///////////////////////// Imported from BUILD.gn and skia_common.gypi /* In some places Skia can use static initializers for global initialization,
diff --git a/skia/ext/SkMemory_new_handler.cpp b/skia/ext/SkMemory_new_handler.cpp index c90a8921..42ce498 100644 --- a/skia/ext/SkMemory_new_handler.cpp +++ b/skia/ext/SkMemory_new_handler.cpp
@@ -8,6 +8,7 @@ #include "base/process/memory.h" #include "build/build_config.h" #include "third_party/skia/include/core/SkTypes.h" +#include "third_party/skia/include/private/SkMalloc.h" #if defined(OS_WIN) #include <windows.h> @@ -60,14 +61,14 @@ return p; } -void* sk_malloc_throw(size_t size) { - return prevent_overcommit(0x42, size, throw_on_failure(size, malloc(size))); +static void* malloc_throw(size_t size) { + return prevent_overcommit(0x42, size, throw_on_failure(size, malloc(size))); } -static void* sk_malloc_nothrow(size_t size) { - // TODO(b.kelemen): we should always use UncheckedMalloc but currently it - // doesn't work as intended everywhere. - void* result; +static void* malloc_nothrow(size_t size) { + // TODO(b.kelemen): we should always use UncheckedMalloc but currently it + // doesn't work as intended everywhere. + void* result; #if defined(OS_IOS) result = malloc(size); #else @@ -80,21 +81,14 @@ return result; } -void* sk_malloc_flags(size_t size, unsigned flags) { - if (flags & SK_MALLOC_THROW) { - return sk_malloc_throw(size); - } - return sk_malloc_nothrow(size); +static void* calloc_throw(size_t size) { + return prevent_overcommit(0, size, throw_on_failure(size, calloc(size, 1))); } -void* sk_calloc_throw(size_t size) { - return prevent_overcommit(0, size, throw_on_failure(size, calloc(size, 1))); -} - -void* sk_calloc(size_t size) { - // TODO(b.kelemen): we should always use UncheckedCalloc but currently it - // doesn't work as intended everywhere. - void* result; +static void* calloc_nothrow(size_t size) { + // TODO(b.kelemen): we should always use UncheckedCalloc but currently it + // doesn't work as intended everywhere. + void* result; #if defined(OS_IOS) result = calloc(1, size); #else @@ -106,3 +100,19 @@ } return result; } + +void* sk_malloc_flags(size_t size, unsigned flags) { + if (flags & SK_MALLOC_ZERO_INITIALIZE) { + if (flags & SK_MALLOC_THROW) { + return calloc_throw(size); + } else { + return calloc_nothrow(size); + } + } else { + if (flags & SK_MALLOC_THROW) { + return malloc_throw(size); + } else { + return malloc_nothrow(size); + } + } +}
diff --git a/skia/ext/raster_handle_allocator_win.cc b/skia/ext/raster_handle_allocator_win.cc index 1f136bd..08f3206 100644 --- a/skia/ext/raster_handle_allocator_win.cc +++ b/skia/ext/raster_handle_allocator_win.cc
@@ -57,7 +57,7 @@ size_t row_bytes = skia::PlatformCanvasStrideForWidth(width); if (do_clear) - sk_bzero(pixels, row_bytes * height); + bzero(pixels, row_bytes * height); HDC hdc = CreateCompatibleDC(nullptr); if (!hdc) {
diff --git a/sql/test/sql_test_suite.cc b/sql/test/sql_test_suite.cc index e774328..2b6d750a 100644 --- a/sql/test/sql_test_suite.cc +++ b/sql/test/sql_test_suite.cc
@@ -4,7 +4,6 @@ #include "sql/test/sql_test_suite.h" -#include "base/metrics/statistics_recorder.h" #include "sql/test/paths.h" namespace sql { @@ -16,12 +15,6 @@ void SQLTestSuite::Initialize() { base::TestSuite::Initialize(); - - // Initialize the histograms subsystem, so that any histograms hit in tests - // are correctly registered with the statistics recorder and can be queried - // by tests. - base::StatisticsRecorder::Initialize(); - sql::test::RegisterPathProvider(); }
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 3abde81..4fb4ed9 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -4220,6 +4220,29 @@ }, { "args": [ + "--xvfb", + "--extra-browser-args=--enable-viz", + "--skip=contrib.cluster_telemetry.screenshot_unittest.ScreenshotUnitTest.testScreenshot", + "--skip=measurements.tab_switching_unittest.TabSwitchingUnittest.testTabSwitching" + ], + "isolate_name": "telemetry_perf_unittests", + "name": "telemetry_perf_unittests_viz", + "swarming": { + "can_use_on_swarming_builders": true, + "hard_timeout": 960, + "shards": 12 + } + }, + { + "isolate_name": "telemetry_unittests", + "name": "telemetry_unittests", + "swarming": { + "can_use_on_swarming_builders": true, + "shards": 4 + } + }, + { + "args": [ "--extra-browser-args=--enable-viz", "--skip=telemetry.internal.actions.scroll_unittest.ScrollActionTest.testWheelScrollDistanceWhileZoomed", "--skip=telemetry.internal.backends.chrome_inspector.inspector_page_unittest.InspectorPageTest.testCaptureScreenshot", @@ -4228,7 +4251,7 @@ "--skip=telemetry.page.cache_temperature_unittest.CacheTemperatureTests.testEnsureHotAfterColdRun" ], "isolate_name": "telemetry_unittests", - "name": "telemetry_unittests", + "name": "telemetry_unittests_viz", "swarming": { "can_use_on_swarming_builders": true, "shards": 4 @@ -4370,6 +4393,21 @@ } ] }, + "Mojo Android": { + "gtest_tests": [ + { + "args": [ + "--enable-features=NetworkService", + "--test-launcher-filter-file=../../testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter" + ], + "name": "network_service_content_browsertests", + "swarming": { + "can_use_on_swarming_builders": true + }, + "test": "content_browsertests" + } + ] + }, "Mojo ChromiumOS": { "additional_compile_targets": [ "mash:all"
diff --git a/testing/buildbot/chromium.gpu.fyi.json b/testing/buildbot/chromium.gpu.fyi.json index 3235883..080bc65 100644 --- a/testing/buildbot/chromium.gpu.fyi.json +++ b/testing/buildbot/chromium.gpu.fyi.json
@@ -913,68 +913,6 @@ } ] }, - "test": "gl_tests", - "use_xvfb": false - }, - { - "swarming": { - "can_use_on_swarming_builders": true, - "cipd_packages": [ - { - "cipd_package": "infra/tools/luci/logdog/butler/${platform}", - "location": "bin", - "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" - } - ], - "dimension_sets": [ - { - "device_os": "MMB29Q", - "device_type": "bullhead", - "os": "Android" - } - ], - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ] - }, - "test": "gl_unittests", - "use_xvfb": false - }, - { - "swarming": { - "can_use_on_swarming_builders": true, - "cipd_packages": [ - { - "cipd_package": "infra/tools/luci/logdog/butler/${platform}", - "location": "bin", - "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" - } - ], - "dimension_sets": [ - { - "device_os": "MMB29Q", - "device_type": "bullhead", - "os": "Android" - } - ], - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ] - }, "test": "gpu_unittests", "use_xvfb": false } @@ -12480,7 +12418,7 @@ "--enable-gpu", "--test-launcher-bot-mode", "--test-launcher-jobs=1", - "--gtest_filter=VrBrowserTest.*", + "--gtest_filter=VrBrowserTest*", "--gtest_also_run_disabled_tests" ], "name": "vr_browser_tests",
diff --git a/testing/buildbot/chromium.gpu.json b/testing/buildbot/chromium.gpu.json index e3dab6ba..ca67390 100644 --- a/testing/buildbot/chromium.gpu.json +++ b/testing/buildbot/chromium.gpu.json
@@ -33,68 +33,6 @@ }, "test": "angle_unittests", "use_xvfb": false - }, - { - "swarming": { - "can_use_on_swarming_builders": true, - "cipd_packages": [ - { - "cipd_package": "infra/tools/luci/logdog/butler/${platform}", - "location": "bin", - "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" - } - ], - "dimension_sets": [ - { - "device_os": "MMB29Q", - "device_type": "bullhead", - "os": "Android" - } - ], - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ] - }, - "test": "gl_tests", - "use_xvfb": false - }, - { - "swarming": { - "can_use_on_swarming_builders": true, - "cipd_packages": [ - { - "cipd_package": "infra/tools/luci/logdog/butler/${platform}", - "location": "bin", - "revision": "git_revision:ff387eadf445b24c935f1cf7d6ddd279f8a6b04c" - } - ], - "dimension_sets": [ - { - "device_os": "MMB29Q", - "device_type": "bullhead", - "os": "Android" - } - ], - "output_links": [ - { - "link": [ - "https://luci-logdog.appspot.com/v/?s", - "=android%2Fswarming%2Flogcats%2F", - "${TASK_ID}%2F%2B%2Funified_logcats" - ], - "name": "shard #${SHARD_INDEX} logcats" - } - ] - }, - "test": "gl_unittests", - "use_xvfb": false } ], "isolated_scripts": [
diff --git a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter index bd950c0..b64053c 100644 --- a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter +++ b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter
@@ -150,28 +150,6 @@ -SafeBrowsingServiceTest.Prefetch -SafeBrowsingTriggeredPopupBlockerBrowserTest.NoFeature_AllowCreatingNewWindows -SafeBrowsingTriggeredPopupBlockerBrowserTest.NoFeature_NoMessages --SaveCardBubbleViewsFullFormBrowserTest.Local_ClickingLearnMoreClosesBubble --SaveCardBubbleViewsFullFormBrowserTest.Local_ClickingNoThanksClosesBubbleIfSecondaryUiMdExpOff --SaveCardBubbleViewsFullFormBrowserTest.Local_ClickingSaveClosesBubble --SaveCardBubbleViewsFullFormBrowserTest.Local_ShouldNotHaveNoThanksButtonIfSecondaryUiMdExpOn --SaveCardBubbleViewsFullFormBrowserTest.Local_SubmittingFormShowsBubbleIfGetUploadDetailsRpcFails --SaveCardBubbleViewsFullFormBrowserTest.Logic_ShouldAttemptToOfferToSaveIfEverythingFound --SaveCardBubbleViewsFullFormBrowserTest.Logic_ShouldNotOfferToSaveIfAddressNotFound --SaveCardBubbleViewsFullFormBrowserTest.Logic_ShouldNotOfferToSaveIfCvcNotFoundAndCvcExpOff --SaveCardBubbleViewsFullFormBrowserTest.Logic_ShouldNotOfferToSaveIfInvalidCvcFoundAndCvcExpOff --SaveCardBubbleViewsFullFormBrowserTest.Logic_ShouldNotOfferToSaveIfNameNotFound --SaveCardBubbleViewsFullFormBrowserTest.Upload_ClickingNoThanksClosesBubbleIfSecondaryUiMdExpOff --SaveCardBubbleViewsFullFormBrowserTest.Upload_ClickingSaveClosesBubble --SaveCardBubbleViewsFullFormBrowserTest.Upload_ConfirmButtonIsDisabledIfInvalidCvcAndCvcExpOn --SaveCardBubbleViewsFullFormBrowserTest.Upload_ConfirmButtonIsDisabledIfNoCvcAndCvcExpOn --SaveCardBubbleViewsFullFormBrowserTest.Upload_Entering3DigitCvcAndClickingConfirmClosesBubbleIfNoCvcAndCvcExpOn --SaveCardBubbleViewsFullFormBrowserTest.Upload_Entering4DigitCvcAndClickingConfirmClosesBubbleIfNoCvcAndCvcExpOn --SaveCardBubbleViewsFullFormBrowserTest.Upload_ShouldNotHaveLearnMoreLinkIfNewUiExperimentOn --SaveCardBubbleViewsFullFormBrowserTest.Upload_ShouldNotHaveNoThanksButtonIfSecondaryUiMdExpOn --SaveCardBubbleViewsFullFormBrowserTest.Upload_SubmittingFormWithInvalidCvcShowsBubbleIfCvcExpOn --SaveCardBubbleViewsFullFormWithShippingBrowserTest.Logic_ShouldAttemptToOfferToSaveIfStreetAddressesConflict --SaveCardBubbleViewsFullFormWithShippingBrowserTest.Logic_ShouldNotOfferToSaveIfNamesConflict --SaveCardBubbleViewsFullFormWithShippingBrowserTest.Logic_ShouldNotOfferToSaveIfPostalCodesConflict -SecurityStateTabHelperTest.BrokenHTTPS -SecurityStateTabHelperTest.MixedContentWithSHA1Cert -SecurityStateTabHelperTest.PasswordSecurityLevelDowngradedOnFilesystemUrl @@ -669,20 +647,12 @@ # If prerender is completely turned down before we plan on canary, no need to # convert. See http://crbug.com/678332 and http://crbug.com/683142 --PrerenderBrowserTest.FirstContentfulPaintHiddenNoCommit --PrerenderBrowserTest.FirstContentfulPaintTimingNoCommit --PrerenderBrowserTest.FirstContentfulPaintTimingReuse --PrerenderBrowserTest.PrerenderBeforeUnload -PrerenderBrowserTest.PrerenderCancelSubresourceRedirectUnsupportedScheme -PrerenderBrowserTest.PrerenderCancelSubresourceUnsupportedScheme -PrerenderBrowserTest.PrerenderDeferredImage -PrerenderBrowserTest.PrerenderDeferredImageAfterRedirect -PrerenderBrowserTest.PrerenderDeferredSynchronousXHR -PrerenderBrowserTest.PrerenderLocationReplaceGWSHistograms --PrerenderBrowserTest.PrerenderNoCommitNoSwap --PrerenderBrowserTest.PrerenderNoCommitNoSwap2 --PrerenderBrowserTest.PrerenderPing --PrerenderBrowserTest.PrerenderUnload -PrerenderBrowserTest.PrerenderXhrDelete -PrerenderBrowserTest.PrerenderXhrPut -PrerenderBrowserTest.ResourcePriority
diff --git a/testing/buildbot/test_suite_exceptions.pyl b/testing/buildbot/test_suite_exceptions.pyl index 5e04423..8a3765b 100644 --- a/testing/buildbot/test_suite_exceptions.pyl +++ b/testing/buildbot/test_suite_exceptions.pyl
@@ -3486,45 +3486,6 @@ }, 'telemetry_unittests': { 'modifications': { - 'Linux Tests SANDBOX': { - 'args': [ - '--jobs=1', - ], - 'swarming': { - 'shards': 4, - }, - }, - 'Linux Tests': { - 'args': [ - '--jobs=1', - ], - 'swarming': { - 'shards': 4, - }, - }, - 'Linux Tests (dbg)(1)': { - 'args': [ - '--jobs=1', - ], - 'swarming': { - 'shards': 4, - }, - }, - 'Linux Tests (dbg)(1)(32)': { - 'args': [ - '--jobs=1', - ], - 'swarming': { - 'shards': 4, - }, - }, - # TODO(kbr): this looks like an accident while removing parallelism from - # telemetry_perf_unittests. - 'Mac10.12 Tests': { - 'args': [ - '--jobs=1', - ], - }, 'Out of Process Profiling Mac': { 'swarming': { 'shards': 2,
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 040055f..7d647212 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -974,14 +974,28 @@ 'linux_viz_isolated_scripts': { 'telemetry_perf_unittests': { 'args': [ - "--xvfb", + '--xvfb', ], 'swarming': { 'hard_timeout': 960, 'shards': 12, }, }, - 'telemetry_unittests': { + 'telemetry_perf_unittests_viz': { + 'isolate_name': 'telemetry_perf_unittests', + 'args': [ + '--xvfb', + '--extra-browser-args=--enable-viz', + '--skip=contrib.cluster_telemetry.screenshot_unittest.ScreenshotUnitTest.testScreenshot', + '--skip=measurements.tab_switching_unittest.TabSwitchingUnittest.testTabSwitching', + ], + 'swarming': { + 'hard_timeout': 960, + 'shards': 12, + }, + }, + 'telemetry_unittests_viz': { + 'isolate_name': 'telemetry_unittests', 'args': [ '--extra-browser-args=--enable-viz', '--skip=telemetry.internal.actions.scroll_unittest.ScrollActionTest.testWheelScrollDistanceWhileZoomed', @@ -994,6 +1008,11 @@ 'shards': 4, }, }, + 'telemetry_unittests': { + 'swarming': { + 'shards': 4, + }, + }, }, 'mash_chromium_gtests': { @@ -1155,6 +1174,16 @@ }, }, + 'network_service_android_gtests': { + 'network_service_content_browsertests': { + 'args': [ + '--enable-features=NetworkService', + '--test-launcher-filter-file=../../testing/buildbot/filters/mojo.fyi.network_content_browsertests.filter', + ], + 'test': 'content_browsertests', + }, + }, + 'network_service_gtests': { 'network_service_browser_tests': { 'args': [ @@ -2227,6 +2256,10 @@ 'win_specific_chromium_gtests', ], + 'mojo_android_gtests': [ + 'network_service_android_gtests', + ], + 'mojo_windows_gtests': [ 'mojo_windows_specific_gtests', 'viz_fyi_gtests',
diff --git a/testing/buildbot/tryserver.webrtc.json b/testing/buildbot/tryserver.webrtc.json new file mode 100644 index 0000000..e38b093 --- /dev/null +++ b/testing/buildbot/tryserver.webrtc.json
@@ -0,0 +1,24 @@ +{ + "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {}, + "AAAAA2 See generate_buildbot_json.py to make changes": {}, + "android_webrtc_compile_rel": { + "additional_compile_targets": [ + "all" + ] + }, + "linux_chromium_webrtc_compile_rel_ng": { + "additional_compile_targets": [ + "all" + ] + }, + "mac_chromium_webrtc_compile_rel_ng": { + "additional_compile_targets": [ + "all" + ] + }, + "win_chromium_webrtc_compile_rel_ng": { + "additional_compile_targets": [ + "all" + ] + } +}
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index 801e2767..bca1aba4b 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -1118,6 +1118,11 @@ 'gtest_tests': 'goma_gtests', }, }, + 'Mojo Android': { + 'test_suites': { + 'gtest_tests': 'mojo_android_gtests', + }, + }, 'Mojo ChromiumOS': { 'additional_compile_targets': [ 'mash:all', @@ -2028,4 +2033,29 @@ 'name': 'client.v8.branches', 'machines': {}, }, + { + 'name': 'tryserver.webrtc', + 'machines': { + 'win_chromium_webrtc_compile_rel_ng': { + 'additional_compile_targets': [ + 'all', + ], + }, + 'mac_chromium_webrtc_compile_rel_ng': { + 'additional_compile_targets': [ + 'all', + ], + }, + 'linux_chromium_webrtc_compile_rel_ng': { + 'additional_compile_targets': [ + 'all', + ], + }, + 'android_webrtc_compile_rel': { + 'additional_compile_targets': [ + 'all', + ], + }, + }, + }, ]
diff --git a/testing/libfuzzer/fuzzers/language_detection_fuzzer.cc b/testing/libfuzzer/fuzzers/language_detection_fuzzer.cc index c87e07ef..1545f76a 100644 --- a/testing/libfuzzer/fuzzers/language_detection_fuzzer.cc +++ b/testing/libfuzzer/fuzzers/language_detection_fuzzer.cc
@@ -7,7 +7,6 @@ #include <string> -#include "base/metrics/statistics_recorder.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "components/translate/core/language_detection/language_detection_util.h" @@ -36,11 +35,3 @@ &is_cld_reliable); return 0; } - -struct Environment { - Environment() { - base::StatisticsRecorder::Initialize(); - } -}; - -Environment* env = new Environment();
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index d4571b8..78030c9 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -507,25 +507,6 @@ ] } ], - "AutofillUpstreamSendPanFirstSix": [ - { - "platforms": [ - "android", - "chromeos", - "linux", - "mac", - "win" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "AutofillUpstreamSendPanFirstSix" - ] - } - ] - } - ], "AutomaticTabDiscarding": [ { "platforms": [ @@ -1173,6 +1154,21 @@ ] } ], + "DefaultPassthroughCommandDecoder": [ + { + "platforms": [ + "win" + ], + "experiments": [ + { + "name": "DefaultPassthroughCommandDecoder", + "enable_features": [ + "DefaultPassthroughCommandDecoder" + ] + } + ] + } + ], "DesktopIOSPromotion": [ { "platforms": [ @@ -2843,25 +2839,6 @@ ] } ], - "RendererSideResourceScheduler": [ - { - "platforms": [ - "win", - "mac", - "linux", - "chromeos", - "android" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "RendererSideResourceScheduler" - ] - } - ] - } - ], "ReportCertificateErrors": [ { "platforms": [ @@ -3058,23 +3035,23 @@ ] } ], - "SafeBrowsingAdSamplerPerformance": [ + "SafeBrowsingAdSamplerTrigger": [ { "platforms": [ "android", + "chromeos", "linux", "mac", "win" ], "experiments": [ { - "name": "AllAdSamples_NoReportsSent", + "name": "AdSampler_NormalRate", "params": { - "safe_browsing_ad_sampler_frequency_denominator": "1", - "trigger_type_and_quota_csv": "2,10000" + "safe_browsing_ad_sampler_frequency_denominator": "1000", + "trigger_type_and_quota_csv": "2,10" }, "enable_features": [ - "SafeBrowsingAdSamplerCollectButDontSend", "SafeBrowsingAdSamplerTrigger", "SafeBrowsingTriggerThrottlerDailyQuota" ] @@ -3082,7 +3059,6 @@ { "name": "Control", "disable_features": [ - "SafeBrowsingAdSamplerCollectButDontSend", "SafeBrowsingAdSamplerTrigger", "SafeBrowsingTriggerThrottlerDailyQuota" ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index a3a44e4..b4198121 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -159,6 +159,7 @@ crbug.com/591099 compositing/animation/state-at-end-event-transform-layer.html [ Failure ] crbug.com/714962 compositing/background-color/view-blending-base-background.html [ Failure ] crbug.com/591099 compositing/child-transform-layer-requires-box.html [ Failure ] +crbug.com/591099 compositing/clip-path-with-composited-descendants.html [ Failure ] crbug.com/591099 compositing/color-matching/image-color-matching.html [ Failure ] crbug.com/591099 compositing/compositing-visible-descendant.html [ Failure ] crbug.com/591099 compositing/contents-opaque/body-background-painted.html [ Failure ] @@ -277,7 +278,7 @@ crbug.com/591099 compositing/overflow/composited-scroll-with-fractional-translation.html [ Pass ] crbug.com/591099 compositing/overflow/do-not-crash-use-after-free-update-widget-positions.html [ Crash ] crbug.com/591099 compositing/overflow/fixed-position-ancestor-clip.html [ Failure ] -crbug.com/591099 compositing/overflow/get-transform-from-non-box-container.html [ Crash Failure ] +crbug.com/591099 compositing/overflow/get-transform-from-non-box-container.html [ Failure ] crbug.com/591099 compositing/overflow/grandchild-composited-with-border-radius-ancestor.html [ Failure ] crbug.com/591099 compositing/overflow/grandchild-with-border-radius-ancestor.html [ Failure ] crbug.com/714962 compositing/overflow/image-load-overflow-scrollbars.html [ Failure ] @@ -2156,7 +2157,6 @@ crbug.com/591099 external/wpt/WebCryptoAPI/import_export/rsa_importKey.worker.html [ Timeout ] crbug.com/709227 external/wpt/WebCryptoAPI/import_export/symmetric_importKey.worker.html [ Failure ] crbug.com/714962 external/wpt/WebCryptoAPI/import_export/test_rsa_importKey.https.html [ Pass Timeout ] -crbug.com/591099 external/wpt/XMLHttpRequest/send-authentication-prompt-2-manual.htm [ Failure ] crbug.com/591099 external/wpt/acid/acid3/test.html [ Crash ] crbug.com/591099 external/wpt/compat/webkit-text-fill-color-property-005.html [ Failure ] crbug.com/591099 external/wpt/credential-management/federatedcredential-framed-get.sub.https.html [ Pass ] @@ -2199,7 +2199,8 @@ crbug.com/591099 external/wpt/css/css-backgrounds/scroll-positioned-multiple-background-images.html [ Failure Pass ] crbug.com/714962 external/wpt/css/css-display/display-contents-dynamic-before-after-001.html [ Failure ] crbug.com/714962 external/wpt/css/css-display/display-contents-dynamic-before-after-first-letter-001.html [ Failure ] -crbug.com/591099 external/wpt/css/css-display/display-contents-dynamic-table-001-inline.html [ Failure ] +crbug.com/591099 external/wpt/css/css-display/display-contents-dynamic-table-001-inline.html [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-display/display-contents-dynamic-table-002-inline.html [ Crash Pass ] crbug.com/591099 external/wpt/css/css-display/display-contents-dynamic-table-002-none.html [ Crash ] crbug.com/591099 external/wpt/css/css-display/display-contents-text-inherit.html [ Pass ] crbug.com/591099 external/wpt/css/css-display/display-flow-root-001.html [ Failure ] @@ -2294,7 +2295,6 @@ crbug.com/591099 external/wpt/css/css-multicol/multicol-margin-002.xht [ Failure ] crbug.com/591099 external/wpt/css/css-multicol/multicol-nested-002.xht [ Failure ] crbug.com/591099 external/wpt/css/css-multicol/multicol-nested-005.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-multicol/multicol-nested-column-rule-001.xht [ Failure ] crbug.com/591099 external/wpt/css/css-multicol/multicol-nested-margin-002.xht [ Failure ] crbug.com/591099 external/wpt/css/css-multicol/multicol-nested-margin-003.xht [ Failure ] crbug.com/591099 external/wpt/css/css-multicol/multicol-nested-margin-004.xht [ Failure ] @@ -2359,14 +2359,6 @@ crbug.com/591099 external/wpt/css/css-multicol/multicol-zero-height-001.xht [ Failure ] crbug.com/714962 external/wpt/css/css-paint-api/style-before-pseudo.https.html [ Failure ] crbug.com/714962 external/wpt/css/css-paint-api/style-first-letter-pseudo.https.html [ Failure ] -crbug.com/591099 external/wpt/css/css-position/position-relative-table-tbody-left-absolute-child.html [ Crash ] -crbug.com/591099 external/wpt/css/css-position/position-relative-table-tbody-top-absolute-child.html [ Crash ] -crbug.com/591099 external/wpt/css/css-position/position-relative-table-tfoot-left-absolute-child.html [ Crash ] -crbug.com/591099 external/wpt/css/css-position/position-relative-table-tfoot-top-absolute-child.html [ Crash ] -crbug.com/591099 external/wpt/css/css-position/position-relative-table-thead-left-absolute-child.html [ Crash ] -crbug.com/591099 external/wpt/css/css-position/position-relative-table-thead-top-absolute-child.html [ Crash ] -crbug.com/591099 external/wpt/css/css-position/position-relative-table-tr-left-absolute-child.html [ Crash ] -crbug.com/591099 external/wpt/css/css-position/position-relative-table-tr-top-absolute-child.html [ Crash ] crbug.com/591099 external/wpt/css/css-position/position-sticky-nested-inline.html [ Crash ] crbug.com/591099 external/wpt/css/css-position/position-sticky-writing-modes.html [ Failure ] crbug.com/591099 external/wpt/css/css-rhythm/line-height-step-basic-001.html [ Failure ] @@ -2570,12 +2562,12 @@ crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-020.xht [ Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-030.xht [ Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-003.xht [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-005.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-005.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-007.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-009.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-011.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-013.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-015.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-015.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-017.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-019.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-021.xht [ Failure Pass ] @@ -2587,27 +2579,27 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-033.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-035.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-037.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-039.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-039.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-041.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-043.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-045.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-047.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-049.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-051.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-051.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-053.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-055.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-057.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-059.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-061.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-063.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-065.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-067.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-063.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-065.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-067.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-069.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-071.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-073.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-075.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-077.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-079.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-075.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-077.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-079.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-081.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-083.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-085.xht [ Failure Pass ] @@ -2618,26 +2610,26 @@ crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-095.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-097.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-103.xht [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-105.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-105.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-107.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-109.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-111.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-113.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-115.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-117.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-117.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-119.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-121.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-123.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-125.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-125.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-127.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-129.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-131.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-133.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-135.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-137.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-135.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-137.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-139.xht [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-141.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-143.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-141.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-143.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-145.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-147.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-149.xht [ Failure Pass ] @@ -2649,28 +2641,28 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-161.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-163.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-165.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-167.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-167.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-169.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-171.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-173.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-175.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-177.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-179.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-177.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-179.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-181.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-183.xht [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-185.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-187.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-185.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-187.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-189.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-191.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-193.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-195.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-197.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-197.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-199.xht [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-201.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-201.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-203.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-205.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-207.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-209.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-207.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-209.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-211.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-213.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-215.xht [ Failure Pass ] @@ -2678,8 +2670,8 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-219.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-221.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-223.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-227.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-227.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-229.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-002.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-004.xht [ Failure Pass ] @@ -2703,7 +2695,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-040.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-042.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-044.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-046.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-046.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-048.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-050.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-052.xht [ Failure ] @@ -2724,7 +2716,7 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-082.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-084.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-086.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-088.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-088.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-090.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-092.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-094.xht [ Failure Pass ] @@ -2742,7 +2734,7 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-122.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-124.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-126.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-128.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-128.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-130.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-132.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-134.xht [ Failure ] @@ -2750,30 +2742,30 @@ crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-138.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-140.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-142.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-144.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-144.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-146.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-148.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-150.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-152.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-152.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-154.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-156.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-158.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-160.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-162.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-164.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-166.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-166.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-168.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-170.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-172.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-174.xht [ Failure ] -crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-176.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-174.xht [ Failure Pass ] +crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-176.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-178.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-180.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-182.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-184.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-182.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-184.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-186.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-188.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-190.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-190.xht [ Failure Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-192.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-194.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-196.xht [ Failure Pass ] @@ -2892,19 +2884,19 @@ crbug.com/591099 external/wpt/css/css-writing-modes/table-column-order-004.xht [ Pass ] crbug.com/591099 external/wpt/css/css-writing-modes/table-column-order-005.xht [ Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-003.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-005.xht [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-007.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-005.xht [ Failure Pass ] +crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-007.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-009.xht [ Failure Pass ] -crbug.com/591099 external/wpt/css/css-writing-modes/text-align-vlr-011.xht [ Failure ] +crbug.com/591099 external/wpt/css/css-writing-modes/text-align-vlr-011.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-013.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-015.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-017.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-019.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-002.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-004.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-006.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-006.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-008.xht [ Failure Pass ] -crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-010.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-010.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-012.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-014.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-016.xht [ Failure ] @@ -2913,7 +2905,7 @@ crbug.com/591099 external/wpt/css/css-writing-modes/text-baseline-vrl-006.xht [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/text-combine-upright-decorations-001.html [ Failure ] crbug.com/591099 external/wpt/css/css-writing-modes/text-combine-upright-layout-rules-001.html [ Failure ] -crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-003.xht [ Failure ] +crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-003.xht [ Failure Pass ] crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-005.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-011.xht [ Failure ] crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-013.xht [ Failure ] @@ -2960,6 +2952,7 @@ crbug.com/591099 external/wpt/css/cssom-view/elementFromPoint.html [ Failure ] crbug.com/591099 external/wpt/css/cssom-view/elementsFromPoint-svg.html [ Failure ] crbug.com/714962 external/wpt/css/cssom/medialist-dynamic-001.html [ Failure ] +crbug.com/626703 external/wpt/css/cssom/stylesheet-replacedata-dynamic.html [ Failure ] crbug.com/591099 external/wpt/css/geometry/interfaces.html [ Pass Timeout ] crbug.com/591099 external/wpt/css/geometry/interfaces.worker.html [ Pass Timeout ] crbug.com/714962 external/wpt/css/selectors/focus-within-001.html [ Failure ] @@ -2967,7 +2960,7 @@ crbug.com/714962 external/wpt/css/selectors/focus-within-007.html [ Failure ] crbug.com/714962 external/wpt/css/selectors/focus-within-008.html [ Failure ] crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-content-vert-001a.xhtml [ Failure ] -crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-item-vert-001b.html [ Failure ] +crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-item-vert-001b.html [ Failure Pass ] crbug.com/714962 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-basic-fieldset-horiz-001.xhtml [ Failure ] crbug.com/714962 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-basic-img-horiz-001.xhtml [ Failure ] crbug.com/714962 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-basic-textarea-horiz-001.xhtml [ Failure ] @@ -3007,14 +3000,14 @@ crbug.com/591099 external/wpt/dom/ranges/Range-set.html [ Timeout ] crbug.com/591099 external/wpt/dom/ranges/Range-surroundContents.html [ Timeout ] crbug.com/591099 external/wpt/domxpath/xml_xpath_runner.html [ Pass Timeout ] -crbug.com/591099 external/wpt/editing/run/backcolor.html [ Timeout ] +crbug.com/591099 external/wpt/editing/run/backcolor.html [ Pass Timeout ] crbug.com/591099 external/wpt/editing/run/bold.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/fontname.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/fontsize.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/forecolor.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/formatblock.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/forwarddelete.html [ Timeout ] -crbug.com/591099 external/wpt/editing/run/hilitecolor.html [ Timeout ] +crbug.com/591099 external/wpt/editing/run/hilitecolor.html [ Pass Timeout ] crbug.com/591099 external/wpt/editing/run/indent.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/inserthorizontalrule.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/inserthtml.html [ Timeout ] @@ -3033,7 +3026,7 @@ crbug.com/591099 external/wpt/editing/run/removeformat.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/strikethrough.html [ Timeout ] crbug.com/591099 external/wpt/editing/run/subscript.html [ Timeout ] -crbug.com/591099 external/wpt/editing/run/superscript.html [ Timeout ] +crbug.com/591099 external/wpt/editing/run/superscript.html [ Pass Timeout ] crbug.com/591099 external/wpt/editing/run/underline.html [ Timeout ] crbug.com/591099 external/wpt/encoding/api-invalid-label.html [ Timeout ] crbug.com/591099 external/wpt/encoding/legacy-mb-japanese/euc-jp/eucjp-decode-cseucpkdfmtjapanese.html [ Timeout ] @@ -3132,7 +3125,7 @@ crbug.com/591099 external/wpt/feature-policy/autoplay-allowed-by-feature-policy.https.sub.html [ Failure ] crbug.com/591099 external/wpt/feature-policy/payment-allowed-by-feature-policy.https.sub.html [ Pass ] crbug.com/591099 external/wpt/feature-policy/payment-disabled-by-feature-policy.https.sub.html [ Pass ] -crbug.com/591099 external/wpt/geolocation-API/PositionOptions.https.html [ Failure ] +crbug.com/591099 external/wpt/geolocation-API/PositionOptions.https.html [ Failure Pass ] crbug.com/591099 external/wpt/html-media-capture/capture_audio_cancel-manual.html [ Failure ] crbug.com/591099 external/wpt/html-media-capture/capture_image_cancel-manual.html [ Failure ] crbug.com/591099 external/wpt/html-media-capture/capture_video_cancel-manual.html [ Failure ] @@ -3143,6 +3136,8 @@ crbug.com/591099 external/wpt/html/dom/documents/resource-metadata-management/document-lastModified-01.html [ Pass ] crbug.com/591099 external/wpt/html/dom/interfaces.html [ Timeout ] crbug.com/591099 external/wpt/html/editing/focus/tabindex-focus-flag.html [ Crash ] +crbug.com/626703 external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html [ Failure ] +crbug.com/591099 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.html [ Pass ] crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html [ Timeout ] crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html [ Timeout ] crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html [ Crash Timeout ] @@ -3231,7 +3226,7 @@ crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-inherit_child-pan-x-child-pan-y_touch-manual.html [ Timeout ] crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-inherit_parent-none_touch-manual.html [ Timeout ] crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-keyboard-manual.html [ Timeout ] -crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-mouse-manual.html [ Timeout ] +crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-mouse-manual.html [ Pass Timeout ] crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-none-css_touch-manual.html [ Timeout ] crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-pan-down-css_touch-manual.html [ Timeout ] crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-pan-left-css_touch-manual.html [ Timeout ] @@ -3244,8 +3239,9 @@ crbug.com/591099 external/wpt/pointerevents/pointerevent_touch-action-span-test_touch-manual.html [ Timeout ] crbug.com/591099 external/wpt/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html [ Timeout ] crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-table-test_touch-manual.html [ Timeout ] -crbug.com/591099 external/wpt/quirks-mode/line-height-calculation.html [ Failure ] -crbug.com/591099 external/wpt/quirks-mode/table-cell-width-calculation.html [ Pass ] +crbug.com/591099 external/wpt/quirks/line-height-calculation.html [ Failure ] +crbug.com/591099 external/wpt/quirks/table-cell-width-calculation.html [ Pass ] +crbug.com/591099 external/wpt/resource-timing/test_resource_timing.html [ Failure Pass ] crbug.com/591099 external/wpt/selection/addRange-00.html [ Timeout ] crbug.com/591099 external/wpt/selection/addRange-04.html [ Timeout ] crbug.com/591099 external/wpt/selection/addRange-12.html [ Pass Timeout ] @@ -3354,6 +3350,7 @@ crbug.com/591099 external/wpt/webvtt/rendering/cues-with-video/processing-model/track-cue-rendering-position-align-rtl-line-left.html [ Failure ] crbug.com/591099 external/wpt/webvtt/rendering/cues-with-video/processing-model/track-cue-rendering-position-align-rtl-line-right.html [ Failure ] crbug.com/591099 external/wpt/workers/Worker_terminate_event_queue.htm [ Timeout ] +crbug.com/591099 external/wpt/xhr/send-authentication-prompt-2-manual.htm [ Failure ] crbug.com/591099 fast/animation/scroll-animations/scrolltimeline-currenttime.html [ Failure ] crbug.com/591099 fast/autoresize/basic.html [ Failure ] crbug.com/591099 fast/autoresize/turn-off-autoresize.html [ Failure ] @@ -3515,7 +3512,6 @@ crbug.com/591099 fast/block/positioning/vertical-rl/001.html [ Failure ] crbug.com/591099 fast/block/positioning/vertical-rl/002.html [ Failure ] crbug.com/591099 fast/block/scrollbar-wider-than-border-box.html [ Failure ] -crbug.com/591099 fast/block/sticky-position-containing-block-crash.html [ Crash ] crbug.com/591099 fast/body-propagation/background-color/001-xhtml.xhtml [ Failure ] crbug.com/591099 fast/body-propagation/background-color/001.html [ Failure ] crbug.com/591099 fast/body-propagation/background-color/002-xhtml.xhtml [ Failure ] @@ -3626,7 +3622,6 @@ crbug.com/591099 fast/borders/rtl-border-01.html [ Failure ] crbug.com/591099 fast/borders/rtl-border-02.html [ Failure ] crbug.com/591099 fast/borders/rtl-border-03.html [ Failure ] -crbug.com/591099 fast/borders/rtl-border-04.html [ Failure ] crbug.com/591099 fast/borders/rtl-border-05.html [ Failure ] crbug.com/714962 fast/borders/table-borders.html [ Failure ] crbug.com/591099 fast/box-decoration-break/box-decoration-break-rendering.html [ Failure ] @@ -3643,7 +3638,7 @@ crbug.com/591099 fast/box-shadow/scaled-box-shadow.html [ Failure ] crbug.com/591099 fast/box-shadow/spread.html [ Failure ] crbug.com/591099 fast/box-shadow/transform-fringing.html [ Failure ] -crbug.com/591099 fast/box-sizing/replaced.html [ Failure ] +crbug.com/591099 fast/box-sizing/replaced.html [ Failure Pass ] crbug.com/714962 fast/canvas-api/canvas-scroll-path-into-view.html [ Failure ] crbug.com/591099 fast/canvas-api/fallback-content.html [ Crash ] crbug.com/591099 fast/canvas-api/toDataURL-supportedTypes.html [ Failure ] @@ -4167,7 +4162,6 @@ crbug.com/591099 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-indent/negative-text-indent-leading-out-of-flow-text-align-left-and-right.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-indent/negative-text-indent-leading-out-of-flow.html [ Failure ] -crbug.com/591099 fast/css3-text/css3-text-indent/text-indent-each-line-hanging.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-indent/text-indent-leading-out-of-flow.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-indent/text-indent-out-of-flow-each-line-hanging.html [ Failure ] crbug.com/591099 fast/css3-text/css3-text-justify/text-justify-distribute.html [ Failure ] @@ -4618,7 +4612,6 @@ crbug.com/714962 fast/forms/file/file-input-empty-validation.html [ Timeout ] crbug.com/714962 fast/forms/file/file-input-reset-validation.html [ Timeout ] crbug.com/714962 fast/forms/file/file-input-reset.html [ Failure ] -crbug.com/714962 fast/forms/file/file-reset-in-change.html [ Failure Pass ] crbug.com/591099 fast/forms/file/get-file-upload.html [ Failure ] crbug.com/714962 fast/forms/file/input-file-entries.html [ Timeout ] crbug.com/591099 fast/forms/file/input-file-re-render.html [ Failure ] @@ -5173,7 +5166,7 @@ crbug.com/591099 fast/js/toString-and-valueOf-override.html [ Failure ] crbug.com/591099 fast/js/webidl-type-mapping.html [ Timeout ] crbug.com/591099 fast/layers/add-layer-with-nested-stacking.html [ Failure ] -crbug.com/591099 fast/layers/inline-dirty-z-order-lists.html [ Crash Failure ] +crbug.com/591099 fast/layers/inline-dirty-z-order-lists.html [ Failure ] crbug.com/591099 fast/layers/layer-content-visibility-change.html [ Failure ] crbug.com/591099 fast/layers/layer-visibility-sublayer.html [ Failure ] crbug.com/591099 fast/layers/layer-visibility.html [ Failure ] @@ -5249,8 +5242,7 @@ crbug.com/591099 fast/multicol/abspos-after-break-after.html [ Failure ] crbug.com/591099 fast/multicol/abspos-new-width-rebalance.html [ Failure ] crbug.com/591099 fast/multicol/anonymous-block-split-crash.html [ Crash ] -crbug.com/591099 fast/multicol/balance-break-inside-avoid.html [ Failure ] -crbug.com/591099 fast/multicol/balance-breakafter-before-nested-block.html [ Failure ] +crbug.com/798844 fast/multicol/auto-height-forced-break-complex-margin-collapsing.html [ Failure ] crbug.com/591099 fast/multicol/balance-float-after-forced-break.html [ Failure ] crbug.com/591099 fast/multicol/balance-float-in-inline.html [ Failure ] crbug.com/591099 fast/multicol/balance-float-with-margin-top-and-line-after-break-2.html [ Failure ] @@ -5261,11 +5253,8 @@ crbug.com/591099 fast/multicol/balance-line-overflow.html [ Failure ] crbug.com/591099 fast/multicol/balance-line-underflow-2.html [ Failure ] crbug.com/591099 fast/multicol/balance-repeating-table-headers.html [ Failure ] -crbug.com/591099 fast/multicol/balance-short-trailing-empty-block.html [ Failure ] crbug.com/591099 fast/multicol/balance-table-with-border-spacing.html [ Failure ] -crbug.com/591099 fast/multicol/balance-trailing-border-after-break.html [ Failure ] crbug.com/591099 fast/multicol/balance-trailing-border.html [ Failure ] -crbug.com/591099 fast/multicol/balance-unbreakable.html [ Failure ] crbug.com/591099 fast/multicol/basic-rtl.html [ Failure ] crbug.com/591099 fast/multicol/border-radius-clipped-layer-second-column.html [ Failure ] crbug.com/591099 fast/multicol/border-radius-clipped-layer.html [ Failure ] @@ -5273,7 +5262,6 @@ crbug.com/591099 fast/multicol/break-after-empty-set-crash.html [ Crash ] crbug.com/591099 fast/multicol/break-before-first-line-in-first-child.html [ Failure ] crbug.com/591099 fast/multicol/break-in-scrollable.html [ Failure ] -crbug.com/591099 fast/multicol/break-properties.html [ Failure ] crbug.com/591099 fast/multicol/caret-range-anonymous-block-rtl.html [ Failure ] crbug.com/591099 fast/multicol/caret-range-anonymous-block.html [ Failure ] crbug.com/591099 fast/multicol/caret-range-outside-columns-rtl.html [ Failure ] @@ -5468,12 +5456,8 @@ crbug.com/591099 fast/multicol/newmulticol/balance3.html [ Failure ] crbug.com/591099 fast/multicol/newmulticol/balance4.html [ Failure ] crbug.com/714962 fast/multicol/newmulticol/balance5.html [ Failure ] -crbug.com/591099 fast/multicol/newmulticol/balance7.html [ Failure ] -crbug.com/591099 fast/multicol/newmulticol/balance8.html [ Failure ] -crbug.com/591099 fast/multicol/newmulticol/balance9.html [ Failure ] crbug.com/591099 fast/multicol/newmulticol/break-before.html [ Failure ] crbug.com/591099 fast/multicol/newmulticol/breaks-2-columns-3-no-balancing.html [ Failure ] -crbug.com/591099 fast/multicol/newmulticol/breaks-2-columns-3.html [ Failure ] crbug.com/591099 fast/multicol/newmulticol/breaks-3-columns-3.html [ Failure ] crbug.com/591099 fast/multicol/newmulticol/fixed-height-fill-balance-2.html [ Failure ] crbug.com/591099 fast/multicol/newmulticol/hide-box-vertical-lr.html [ Failure ] @@ -5617,10 +5601,7 @@ crbug.com/714962 fast/multicol/unbreakable-content-taller-than-height-crash.html [ Failure ] crbug.com/591099 fast/multicol/unforced-break-after-complex-margin-collapsing.html [ Failure ] crbug.com/591099 fast/multicol/vertical-lr/abspos-auto-position-on-line.html [ Crash Failure ] -crbug.com/591099 fast/multicol/vertical-lr/balancing/balance-short-trailing-empty-block.html [ Failure ] -crbug.com/591099 fast/multicol/vertical-lr/balancing/balance-trailing-border-after-break.html [ Failure ] crbug.com/591099 fast/multicol/vertical-lr/balancing/balance-trailing-border.html [ Failure ] -crbug.com/591099 fast/multicol/vertical-lr/balancing/balance-unbreakable.html [ Failure ] crbug.com/591099 fast/multicol/vertical-lr/break-properties.html [ Failure ] crbug.com/591099 fast/multicol/vertical-lr/caret-range-anonymous-block-rtl.html [ Failure ] crbug.com/591099 fast/multicol/vertical-lr/caret-range-anonymous-block.html [ Failure ] @@ -5646,10 +5627,7 @@ crbug.com/591099 fast/multicol/vertical-lr/offset-top-and-left-nested.html [ Failure ] crbug.com/591099 fast/multicol/vertical-lr/unsplittable-inline-block.html [ Failure ] crbug.com/591099 fast/multicol/vertical-rl/abspos-auto-position-on-line.html [ Crash Failure ] -crbug.com/591099 fast/multicol/vertical-rl/balancing/balance-short-trailing-empty-block.html [ Failure ] -crbug.com/591099 fast/multicol/vertical-rl/balancing/balance-trailing-border-after-break.html [ Failure ] crbug.com/591099 fast/multicol/vertical-rl/balancing/balance-trailing-border.html [ Failure ] -crbug.com/591099 fast/multicol/vertical-rl/balancing/balance-unbreakable.html [ Failure ] crbug.com/591099 fast/multicol/vertical-rl/break-properties.html [ Failure ] crbug.com/591099 fast/multicol/vertical-rl/caret-range-anonymous-block-rtl.html [ Failure ] crbug.com/591099 fast/multicol/vertical-rl/caret-range-anonymous-block.html [ Failure ] @@ -5676,7 +5654,6 @@ crbug.com/591099 fast/multicol/vertical-rl/unsplittable-inline-block.html [ Failure ] crbug.com/591099 fast/multicol/widows-and-orphans.html [ Failure ] crbug.com/591099 fast/multicol/widows.html [ Failure ] -crbug.com/591099 fast/multicol/widows2.html [ Failure ] crbug.com/714962 fast/overflow/001.html [ Failure ] crbug.com/714962 fast/overflow/002.html [ Failure ] crbug.com/714962 fast/overflow/005.html [ Failure ] @@ -6040,6 +6017,7 @@ crbug.com/714962 fast/spatial-navigation/snav-textarea.html [ Failure ] crbug.com/714962 fast/spatial-navigation/snav-tiny-table-traversal.html [ Failure ] crbug.com/714962 fast/spatial-navigation/snav-two-elements-one-line.html [ Failure ] +crbug.com/591099 fast/spatial-navigation/snav-use-visual-viewport.html [ Failure ] crbug.com/714962 fast/spatial-navigation/snav-zero-margin-content.html [ Failure ] crbug.com/591099 fast/sub-pixel/computedstylemargin.html [ Failure ] crbug.com/591099 fast/sub-pixel/float-wrap-zoom.html [ Failure ] @@ -6306,6 +6284,7 @@ crbug.com/591099 fast/text/international/bidi-linebreak-003.html [ Failure ] crbug.com/714962 fast/text/international/bidi-override.html [ Failure ] crbug.com/714962 fast/text/international/cjk-segmentation.html [ Failure ] +crbug.com/591099 fast/text/international/danda-space.html [ Failure ] crbug.com/714962 fast/text/international/hindi-whitespace.html [ Failure ] crbug.com/591099 fast/text/international/inline-plaintext-is-isolated.html [ Failure ] crbug.com/714962 fast/text/international/iso-8859-8.html [ Failure ] @@ -6384,8 +6363,6 @@ crbug.com/591099 fast/text/whitespace/reattach-before-pseudo-slot-fallback-whitespace.html [ Failure ] crbug.com/591099 fast/text/whitespace/reattach-before-pseudo.html [ Failure ] crbug.com/591099 fast/text/whitespace/reattach-slotted-whitespace.html [ Failure ] -crbug.com/636993 fast/text/whitespace/text-align-justify-and-whitespace-pre.html [ Failure ] -crbug.com/591099 fast/text/whitespace/whitespace-in-pre.html [ Failure ] crbug.com/591099 fast/text/writing-root-with-overflow-clip-baseline.html [ Crash ] crbug.com/591099 fast/text/zero-width-characters-complex-script.html [ Failure ] crbug.com/591099 fast/text/zero-width-characters.html [ Failure ] @@ -6559,7 +6536,7 @@ crbug.com/591099 fullscreen/full-screen-element-stack.html [ Crash ] crbug.com/591099 fullscreen/full-screen-iframe-not-allowed.html [ Failure ] crbug.com/591099 fullscreen/full-screen-remove-ancestor-after.html [ Crash Pass ] -crbug.com/591099 fullscreen/full-screen-ruleset-crash.html [ Crash ] +crbug.com/591099 fullscreen/full-screen-ruleset-crash.html [ Crash Pass ] crbug.com/591099 fullscreen/full-screen-twice-newapi.html [ Crash ] crbug.com/591099 fullscreen/full-screen-with-css-reference-filter.html [ Crash ] crbug.com/591099 fullscreen/full-screen-with-flex-item.html [ Crash ] @@ -6569,7 +6546,7 @@ crbug.com/591099 fullscreen/model/fully-exit-fullscreen-nested-iframe.html [ Crash ] crbug.com/591099 fullscreen/non-ancestor-iframe.html [ Crash ] crbug.com/591099 hittesting/border-hittest-inlineFlowBox.html [ Failure ] -crbug.com/714962 hittesting/border-hittest-with-image-fallback.html [ Failure ] +crbug.com/714962 hittesting/border-hittest-with-image-fallback.html [ Failure Pass ] crbug.com/714962 hittesting/culled-inline.html [ Failure ] crbug.com/591099 hittesting/image-with-border-radius.html [ Failure ] crbug.com/714962 hittesting/image-with-clip-path.html [ Failure ] @@ -6712,8 +6689,8 @@ crbug.com/591099 http/tests/devtools/animation/animation-web-anim-negative-start-time.js [ Crash Pass ] crbug.com/591099 http/tests/devtools/audits2/audits2-limited-run.js [ Crash ] crbug.com/591099 http/tests/devtools/audits2/audits2-successful-run.js [ Crash ] -crbug.com/591099 http/tests/devtools/console/console-format.js [ Failure ] crbug.com/591099 http/tests/devtools/console/console-functions.js [ Failure ] +crbug.com/591099 http/tests/devtools/console/console-search.js [ Timeout ] crbug.com/591099 http/tests/devtools/console/console-uncaught-promise.js [ Failure ] crbug.com/591099 http/tests/devtools/console/shadow-element.js [ Timeout ] crbug.com/591099 http/tests/devtools/editor/text-editor-ctrl-d-1.js [ Timeout ] @@ -6769,8 +6746,10 @@ crbug.com/714962 http/tests/devtools/elements/styles-1/add-new-rule-with-style-after-body.js [ Crash Pass ] crbug.com/714962 http/tests/devtools/elements/styles-1/edit-value-url-with-color.js [ Crash ] crbug.com/714962 http/tests/devtools/elements/styles-2/force-pseudo-state.js [ Crash Pass ] +crbug.com/591099 http/tests/devtools/elements/styles-2/inject-stylesheet.js [ Crash Pass ] crbug.com/714962 http/tests/devtools/elements/styles-2/paste-property.js [ Crash Pass ] crbug.com/714962 http/tests/devtools/elements/styles-2/pseudo-elements.js [ Crash ] +crbug.com/591099 http/tests/devtools/elements/styles-3/shadow-dom-rules.js [ Crash Pass ] crbug.com/591099 http/tests/devtools/elements/styles-3/style-rule-from-imported-stylesheet.js [ Crash Pass ] crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-blank-property.js [ Crash ] crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-invalid-property.js [ Crash ] @@ -6786,7 +6765,7 @@ crbug.com/714962 http/tests/devtools/elements/styles-4/undo-add-new-rule.js [ Crash ] crbug.com/714962 http/tests/devtools/elements/styles-4/undo-add-property.js [ Crash ] crbug.com/591099 http/tests/devtools/elements/styles/selector-line-deprecated.js [ Crash Pass ] -crbug.com/714962 http/tests/devtools/elements/styles/stylesheet-tracking.js [ Crash ] +crbug.com/714962 http/tests/devtools/elements/styles/stylesheet-tracking.js [ Crash Pass ] crbug.com/714962 http/tests/devtools/elements/styles/undo-change-property.js [ Crash Pass ] crbug.com/714962 http/tests/devtools/elements/styles/undo-property-toggle.js [ Crash Pass ] crbug.com/714962 http/tests/devtools/elements/styles/undo-set-selector-text.js [ Crash ] @@ -6795,9 +6774,8 @@ crbug.com/591099 http/tests/devtools/inspect-element.js [ Crash Pass ] crbug.com/714962 http/tests/devtools/jump-to-previous-editing-location.js [ Failure ] crbug.com/714962 http/tests/devtools/layers/layer-canvas-log.js [ Failure ] -crbug.com/591099 http/tests/devtools/network/network-columns-visible.js [ Failure ] crbug.com/591099 http/tests/devtools/network/network-datareceived.js [ Failure ] -crbug.com/591099 http/tests/devtools/persistence/persistence-tabbed-editor-opens-filesystem-uisourcecode.js [ Failure ] +crbug.com/591099 http/tests/devtools/persistence/persistence-tabbed-editor-opens-filesystem-uisourcecode.js [ Failure Pass Timeout ] crbug.com/591099 http/tests/devtools/runtime/runtime-getProperties.js [ Failure ] crbug.com/714962 http/tests/devtools/service-workers/service-workers-view.js [ Failure ] crbug.com/591099 http/tests/devtools/sources/debugger-pause/debugger-pause-in-internal.js [ Failure ] @@ -7145,7 +7123,7 @@ crbug.com/714962 inspector-protocol/accessibility/accessibility-ignoredNodesModal.js [ Failure ] crbug.com/591099 inspector-protocol/accessibility/accessibility-modal.js [ Crash ] crbug.com/714962 inspector-protocol/accessibility/accessibility-nameSources-buttons.js [ Failure ] -crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-img-figure.js [ Timeout ] +crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-img-figure.js [ Pass Timeout ] crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-input-buttons.js [ Timeout ] crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-input.js [ Timeout ] crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-labelledby.js [ Timeout ] @@ -7891,6 +7869,7 @@ crbug.com/591099 paint/markers/ellipsis-mixed-text-in-rtl-flow-with-markers.html [ Failure ] crbug.com/591099 paint/markers/ellipsis-rtl-text-in-ltr-flow-with-markers.html [ Failure ] crbug.com/591099 paint/markers/ellipsis-rtl-text-in-rtl-flow-with-markers.html [ Failure ] +crbug.com/591099 paint/markers/first-letter.html [ Failure ] crbug.com/591099 paint/markers/inline-spelling-markers-hidpi-composited.html [ Failure ] crbug.com/591099 paint/markers/inline-spelling-markers-hidpi.html [ Failure ] crbug.com/591099 paint/markers/inline_spelling_markers.html [ Failure ] @@ -7898,6 +7877,7 @@ crbug.com/591099 paint/markers/suggestion-marker-basic.html [ Failure ] crbug.com/591099 paint/markers/suggestion-marker-split.html [ Failure ] crbug.com/591099 paint/overflow/composited-rounded-clip-floating-element.html [ Failure ] +crbug.com/591099 paint/overflow/composited-scroll-vertical-rl.html [ Failure ] crbug.com/591099 paint/overflow/fixed-background-scroll-window.html [ Failure ] crbug.com/591099 paint/overflow/non-composited-fixed-position-descendant.html [ Failure ] crbug.com/591099 paint/pagination/composited-paginated-inline.html [ Failure ] @@ -8802,11 +8782,13 @@ crbug.com/591099 virtual/gpu-rasterization/images/rendering-broken-images.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/sprite-no-bleed.html [ Failure ] crbug.com/591099 virtual/gpu-rasterization/images/webp-flip.html [ Failure ] +crbug.com/591099 virtual/gpu/fast/canvas/OffscreenCanvas-filter-in-worker.html [ Pass Timeout ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-createImageBitmap-colorClamping.html [ Pass ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-createImageBitmap-drawImage.html [ Timeout ] crbug.com/714962 virtual/gpu/fast/canvas/canvas-css-clip-path.html [ Failure ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-drawImage-animated-images.html [ Failure ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-drawImage-video-imageSmoothingEnabled.html [ Pass ] +crbug.com/591099 virtual/gpu/fast/canvas/canvas-filter-origin-clean.html [ Crash Pass ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-imageSmoothingQuality.html [ Pass ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-measure-bidi-text.html [ Failure ] crbug.com/591099 virtual/gpu/fast/canvas/canvas-shadow-source-in.html [ Failure ] @@ -8824,7 +8806,6 @@ crbug.com/714962 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/styles/test-008.html [ Failure ] crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/user-interaction/ranges-and-selections/test-002.html [ Pass ] crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/content-pseudo-element-dynamic-attribute-change.html [ Failure ] -crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/content-pseudo-element-nested.html [ Crash ] crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/cppevent-input-in-shadow.html [ Failure ] crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/drop-event-for-input-in-shadow.html [ Crash Failure ] crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/focus-navigation-with-distributed-nodes.html [ Crash ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService b/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService index a52a0db..0a7b6d3 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-features=NetworkService
@@ -7,8 +7,8 @@ Bug(none) virtual/mojo-blobs [ Skip ] Bug(none) external/wpt/clear-site-data/storage.https.html [ Failure ] -Bug(none) external/wpt/XMLHttpRequest/overridemimetype-blob.html [ Failure ] -Bug(none) external/wpt/XMLHttpRequest/anonymous-mode-unsupported.htm [ Failure Pass ] +Bug(none) external/wpt/xhr/overridemimetype-blob.html [ Failure ] +Bug(none) external/wpt/xhr/anonymous-mode-unsupported.htm [ Failure Pass ] Bug(none) external/wpt/clear-site-data/navigation.https.html [ Timeout ] Bug(none) external/wpt/content-security-policy/generic/filesystem-urls-match-filesystem.sub.html [ Failure ] Bug(none) external/wpt/content-security-policy/inside-worker/dedicated-inheritance.html [ Failure Timeout ] @@ -22,7 +22,6 @@ Bug(none) external/wpt/html/browsers/offline/appcache/workers/appcache-worker.html [ Timeout ] Bug(none) external/wpt/html/semantics/embedded-content/the-iframe-element/iframe-load-event.html [ Crash Failure Timeout ] Bug(none) external/wpt/navigation-timing/nav2_test_attributes_values.html [ Failure Timeout ] -Bug(none) external/wpt/preload/fetch-destination.https.html [ Crash Failure Timeout ] Bug(none) external/wpt/resource-timing/test_resource_timing.html [ Failure Timeout ] Bug(none) external/wpt/service-workers/service-worker/claim-shared-worker-fetch.https.html [ Failure ] Bug(none) external/wpt/service-workers/service-worker/client-navigate.https.html [ Pass Crash Failure ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 index f23b0c6..e6759430 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -664,6 +664,7 @@ Bug(none) paint/invalidation/svg/resize-svg-invalidate-children.html [ Failure ] crbug.com/769942 svg/clip-path/ [ Skip ] +crbug.com/769942 compositing/clip-path-with-composited-descendants.html [ Failure ] crbug.com/769942 compositing/overflow/ancestor-with-clip-path.html [ Failure ] crbug.com/769942 compositing/overflow/descendant-with-clip-path.html [ Failure ] crbug.com/769942 fast/canvas/canvas-css-clip-path.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process b/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process index eb1f3266d..0b2ffeb 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process +++ b/third_party/WebKit/LayoutTests/FlagExpectations/site-per-process
@@ -139,7 +139,7 @@ # TODO(lukasza, alexmos): Triage these failures. Bug(none) external/wpt/FileAPI/url/multi-global-origin-serialization.sub.html [ Failure ] Bug(none) external/wpt/IndexedDB/interleaved-cursors.html [ Timeout ] -Bug(none) external/wpt/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html [ Timeout ] +Bug(none) external/wpt/xhr/xmlhttprequest-sync-default-feature-policy.sub.html [ Timeout ] Bug(none) external/wpt/content-security-policy/frame-ancestors/frame-ancestors-nested-cross-in-cross-none-block.html [ Timeout ] Bug(none) external/wpt/content-security-policy/frame-ancestors/frame-ancestors-nested-cross-in-cross-star-allow.html [ Timeout ] Bug(none) external/wpt/content-security-policy/frame-ancestors/frame-ancestors-nested-cross-in-same-star-allow.html [ Timeout ]
diff --git a/third_party/WebKit/LayoutTests/MSANExpectations b/third_party/WebKit/LayoutTests/MSANExpectations index 47e774b..fe405627 100644 --- a/third_party/WebKit/LayoutTests/MSANExpectations +++ b/third_party/WebKit/LayoutTests/MSANExpectations
@@ -82,3 +82,4 @@ # Timing out consistenly on WebKit Linux Trusty MSAN crbug.com/798957 [ Linux ] http/tests/devtools/audits2/audits2-limited-run.js [ Skip ] +crbug.com/798957 [ Linux ] http/tests/devtools/audits2/audits2-successful-run.js [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/NeverFixTests b/third_party/WebKit/LayoutTests/NeverFixTests index d37be5e..61644891 100644 --- a/third_party/WebKit/LayoutTests/NeverFixTests +++ b/third_party/WebKit/LayoutTests/NeverFixTests
@@ -1005,7 +1005,7 @@ external/wpt/web-share/share-url-relative-manual.html [ WontFix ] external/wpt/webstorage/storage_local-manual.html [ WontFix ] external/wpt/webstorage/storage_session-manual.html [ WontFix ] -external/wpt/XMLHttpRequest/send-authentication-existing-session-manual.htm [ WontFix ] +external/wpt/xhr/send-authentication-existing-session-manual.htm [ WontFix ] virtual/feature-policy-permissions/external/wpt/mediacapture-streams/MediaStreamTrack-end-manual.https.html [ WontFix ] virtual/layout_ng/external/wpt/css/CSS2/linebox/inline-formatting-context-010b.xht [ WontFix ] virtual/layout_ng/external/wpt/css/CSS2/normal-flow/inline-block-replaced-height-008.xht [ WontFix ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 3b99651c..c3f17b0 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -56,7 +56,7 @@ # Slimming paint V1.75 crbug.com/771643 [ Mac Win Android ] virtual/spv175/ [ Skip ] -crbug.com/769942 virtual/spv175/compositing/clip-path-with-composited-descendent.html [ Failure ] +crbug.com/769942 virtual/spv175/compositing/clip-path-with-composited-descendants.html [ Failure ] crbug.com/769942 virtual/spv175/compositing/images/direct-image-clip-path.html [ Failure ] crbug.com/769942 virtual/spv175/compositing/images/direct-image-dynamic-clip-path.html [ Failure ] crbug.com/769942 virtual/spv175/compositing/overflow/accelerated-scrolling-with-clip-path-text.html [ Failure ] @@ -180,6 +180,9 @@ crbug.com/736052 virtual/spv175/compositing/overflow/composited-scroll-with-fractional-translation.html [ Skip ] crbug.com/736052 virtual/prefer_compositing_to_lcd_text/compositing/overflow/composited-scroll-with-fractional-translation.html [ Failure ] +# Will be fixed in slimming-paint-v175. +crbug.com/798638 fragmentation/repeating-thead-tfoot-different-fragment-height.html [ Failure ] + # ====== Paint team owned tests to here ====== # ====== Layout team owned tests from here ====== @@ -879,8 +882,6 @@ crbug.com/417782 virtual/rootlayerscrolls/fast/scrolling/scrollbar-prevent-default.html [ Timeout Failure ] crbug.com/280342 [ Linux Win ] http/tests/media/progress-events-generated-correctly.html [ Failure Pass ] -crbug.com/520739 [ Mac ] http/tests/websocket/close-code-and-reason.html [ Failure Pass Timeout ] -crbug.com/520737 [ Mac ] external/wpt/css/css-writing-modes/writing-mode-vertical-rl-001.xht [ Failure Pass Timeout ] crbug.com/520736 [ Win7 ] media/W3C/video/networkState/networkState_during_progress.html [ Failure Pass ] # gpuBenchmarking.pinchBy is busted on desktops @@ -927,7 +928,6 @@ crbug.com/518883 crbug.com/390452 http/tests/security/isolatedWorld/media-query-wrapper-leaks.html [ Failure Pass Timeout ] crbug.com/518987 http/tests/xmlhttprequest/navigation-abort-detaches-frame.html [ Pass Timeout ] -crbug.com/518989 [ Mac ] external/wpt/css/css-writing-modes/writing-mode-vertical-rl-002.xht [ Failure Pass Timeout ] # These performance-sensitive user-timing tests are flaky in debug on all platforms, and flaky on all configurations of windows. # See: crbug.com/567965, crbug.com/518992, and crbug.com/518993 @@ -1700,7 +1700,6 @@ crbug.com/548765 http/tests/devtools/console-fetch-logging.js [ Failure Pass ] -crbug.com/564109 [ Win ] external/wpt/css/css-fonts/font-display/font-display.html [ Failure Pass Timeout ] crbug.com/564109 [ Win ] http/tests/webfont/font-display-intervention.html [ Pass Failure Timeout ] crbug.com/399951 http/tests/mime/javascript-mimetype-usecounters.html [ Pass Failure ] @@ -1755,11 +1754,11 @@ crbug.com/637930 http/tests/media/video-buffered.html [ Pass Failure ] -crbug.com/613659 external/wpt/quirks-mode/percentage-height-calculation.html [ Failure ] -crbug.com/613661 external/wpt/quirks-mode/table-cell-nowrap-minimum-width-calculation.html [ Failure ] -crbug.com/613663 external/wpt/quirks-mode/table-cell-width-calculation.html [ Failure ] +crbug.com/613659 external/wpt/quirks/percentage-height-calculation.html [ Failure ] +crbug.com/613661 external/wpt/quirks/table-cell-nowrap-minimum-width-calculation.html [ Failure ] +crbug.com/613663 external/wpt/quirks/table-cell-width-calculation.html [ Failure ] -crbug.com/646133 external/wpt/quirks-mode/unitless-length.html [ Pass Timeout ] +crbug.com/646133 external/wpt/quirks/unitless-length.html [ Pass Timeout ] # Note: this test was previously marked as slow on Debug builds. Skipping until crash is fixed crbug.com/619978 fast/css/giant-stylesheet-crash.html [ Skip ] @@ -1899,6 +1898,15 @@ crbug.com/751952 virtual/origin-trials-runtimeflags-disabled/http/tests/origin_trials/webexposed/budget-api-origin-trial-interfaces.html [ Pass Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Linux Mac ] virtual/mojo-blobs/external/wpt/FileAPI/FileReader/test_securityerrors-manual.html [ Skip ] +crbug.com/626703 external/wpt/FileAPI/FileReader/test_notreadableerrors-manual.html [ Skip ] +crbug.com/626703 [ Linux Mac ] virtual/mojo-blobs/external/wpt/FileAPI/FileReader/test_notreadableerrors-manual.html [ Skip ] +crbug.com/626703 external/wpt/FileAPI/FileReader/test_securityerrors-manual.html [ Skip ] +crbug.com/626703 external/wpt/css/css-tables/fixup-dynamic-anonymous-inline-table-002.html [ Failure ] +crbug.com/626703 external/wpt/quirks/active-and-hover-manual.html [ Skip ] +crbug.com/626703 external/wpt/css/css-tables/fixup-dynamic-anonymous-table-001.html [ Failure ] +crbug.com/626703 external/wpt/css/css-tables/fixup-dynamic-anonymous-inline-table-001.html [ Failure ] +crbug.com/626703 external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-cr.html [ Failure ] crbug.com/626703 external/wpt/svg/path/bearing/zero.svg [ Failure ] crbug.com/626703 external/wpt/svg/path/bearing/relative.svg [ Failure ] crbug.com/626703 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-integrity-classic.html [ Skip ] @@ -2300,13 +2308,12 @@ crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/too_many_cues.html [ Failure ] crbug.com/626703 external/wpt/webvtt/rendering/cues-with-video/processing-model/too_many_cues_wrapped.html [ Failure ] crbug.com/626703 external/wpt/workers/name-property.html [ Timeout ] -crbug.com/626703 external/wpt/XMLHttpRequest/abort-after-stop.htm [ Timeout ] -crbug.com/626703 external/wpt/XMLHttpRequest/event-readystatechange-loaded.htm [ Failure Timeout ] -crbug.com/626703 external/wpt/XMLHttpRequest/open-url-redirected-worker-origin.htm [ Failure ] -crbug.com/626703 external/wpt/XMLHttpRequest/preserve-ua-header-on-redirect.htm [ Failure ] -crbug.com/626703 external/wpt/XMLHttpRequest/send-entity-body-document.htm [ Failure ] -crbug.com/626703 external/wpt/XMLHttpRequest/setrequestheader-header-allowed.htm [ Failure ] -crbug.com/626703 [ Linux ] external/wpt/XMLHttpRequest/send-content-type-string.htm [ Failure ] +crbug.com/626703 external/wpt/xhr/abort-after-stop.htm [ Timeout ] +crbug.com/626703 external/wpt/xhr/event-readystatechange-loaded.htm [ Failure Timeout ] +crbug.com/626703 external/wpt/xhr/open-url-redirected-worker-origin.htm [ Failure ] +crbug.com/626703 external/wpt/xhr/preserve-ua-header-on-redirect.htm [ Failure ] +crbug.com/626703 external/wpt/xhr/send-entity-body-document.htm [ Failure ] +crbug.com/626703 external/wpt/xhr/setrequestheader-header-allowed.htm [ Failure ] crbug.com/626703 [ Linux Win ] external/wpt/css/selectors/selector-placeholder-shown-type-change-001.html [ Failure ] crbug.com/626703 [ Linux Win ] external/wpt/css/selectors/selector-read-write-type-change-002.html [ Failure ] crbug.com/626703 [ Linux Win ] external/wpt/css/selectors/selector-required-type-change-002.html [ Failure ] @@ -2420,8 +2427,6 @@ crbug.com/697971 [ Mac10.12 ] fast/text/selection/flexbox-selection-nested.html [ Skip ] crbug.com/697971 [ Mac10.12 ] fast/text/selection/flexbox-selection.html [ Skip ] -crbug.com/678481 http/tests/devtools/appcache/appcache-manifest-with-non-existing-file.js [ Timeout Failure Pass ] -crbug.com/678481 http/tests/devtools/appcache/appcache-iframe-manifests.js [ Timeout Failure Pass ] crbug.com/701047 [ Mac10.12 ] editing/caret/caret-color.html [ Failure ] crbug.com/701047 [ Mac10.12 ] editing/deleting/delete-at-paragraph-boundaries-011.html [ Failure ] @@ -2769,14 +2774,13 @@ # Crashes crbug.com/709227 external/wpt/offscreen-canvas/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.html [ Crash ] -crbug.com/786249 http/tests/inspector-protocol/network/response-interception-no-change-content-not-ready.js [ Crash ] -crbug.com/786249 http/tests/inspector-protocol/network/response-interception-request-completes-network-closes.js [ Crash ] # ====== Tests from enabling .any.js/.worker.js tests end here ======== # ====== Begin of display: contents tests ====== crbug.com/795217 external/wpt/css/css-display/display-contents-details.html [ Failure ] +crbug.com/181374 external/wpt/css/css-display/display-contents-dynamic-table-001-inline.html [ Failure ] # ====== End of display: contents tests ====== @@ -2822,18 +2826,34 @@ # This test has device ID strings in failure messages which change on every test run. crbug.com/679742 external/wpt/mediacapture-streams/MediaStreamTrack-getSettings.https.html [ Failure ] -crbug.com/765116 external/wpt/XMLHttpRequest/responsexml-document-properties.htm [ Failure ] +crbug.com/765116 external/wpt/xhr/responsexml-document-properties.htm [ Failure ] # This is a manual test. -crbug.com/711493 external/wpt/XMLHttpRequest/send-authentication-prompt-2-manual.htm [ Failure ] +crbug.com/711493 external/wpt/xhr/send-authentication-prompt-2-manual.htm [ Failure ] # Sheriff failures 2017-02-03 crbug.com/688515 fast/spatial-navigation/snav-div-overflow-scrol-hidden.html [ Pass Failure ] -crbug.com/716320 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.html [ Timeout ] -crbug.com/716320 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.html [ Timeout ] -crbug.com/716320 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.html [ Timeout ] -crbug.com/716320 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.html [ Timeout ] +crbug.com/716320 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success-and-failure.html [ Failure Timeout ] +crbug.com/716320 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/broadcastchannel-success.html [ Failure Timeout ] +crbug.com/716320 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-messagechannel-success.html [ Failure Timeout ] +crbug.com/716320 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-sharedworker-failure.html [ Failure Timeout ] + +# Disabling SharedArrayBuffer +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/identity-not-preserved.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/no-transferring.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-history.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-notifications-api.any.worker.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-domain-success.sub.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-serviceworker-failure.https.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-similar-but-cross-origin-success.sub.html [ Failure ] +crbug.com/798864 external/wpt/html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/window-simple-success.html [ Failure ] +crbug.com/798864 external/wpt/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/canblock-dedicatedworker.html [ Failure ] +crbug.com/798864 external/wpt/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/canblock-serviceworker.https.html [ Failure ] +crbug.com/798864 external/wpt/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/canblock-sharedworker.html [ Failure ] +crbug.com/798864 external/wpt/html/webappapis/scripting/processing-model-2/integration-with-the-javascript-agent-formalism/canblock-window.html [ Failure ] # Flaky on trybots crbug.com/688486 external/wpt/service-workers/service-worker/fetch-request-resources.https.html [ Failure Pass ] @@ -2872,8 +2892,7 @@ crbug.com/715718 external/wpt/media-source/mediasource-activesourcebuffers.html [ Failure Pass ] crbug.com/715718 external/wpt/media-source/mediasource-remove.html [ Failure Pass ] -crbug.com/715718 [ Win ] external/wpt/XMLHttpRequest/FormData-append.html [ Failure Pass ] -crbug.com/715718 [ Win ] external/wpt/XMLHttpRequest/timeout-multiple-fetches.html [ Failure Pass ] +crbug.com/715718 [ Win ] external/wpt/xhr/FormData-append.html [ Failure Pass ] crbug.com/715718 [ Win ] external/wpt/css/css-flexbox/align-items-004.htm [ Failure Pass ] crbug.com/715718 [ Win ] external/wpt/css/css-flexbox/flex-minimum-width-flex-items-001.xht [ Failure Pass ] crbug.com/715718 [ Win ] external/wpt/css/css-flexbox/flex-minimum-width-flex-items-003.xht [ Failure Pass ] @@ -2916,8 +2935,6 @@ # Failures when using libc++. Rebaseline after landing https://codereview.chromium.org/2933573002/ crbug.com/734873 [ Linux ] fast/backgrounds/size/contain-and-cover.html [ Pass Failure ] -crbug.com/729836 [ Win ] fast/workers/chromium/worker-document-leak.html [ Pass Failure ] - # More flaky tests on Mac crbug.com/731111 [ Mac ] http/tests/media/progress-events-generated-correctly.html [ Failure Pass Timeout ] crbug.com/731111 [ Mac ] http/tests/media/video-load-metadata-decode-error.html [ Failure Pass Timeout ] @@ -2927,7 +2944,7 @@ crbug.com/731509 [ Win ] css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html [ Failure Pass Timeout ] -crbug.com/731535 [ Win ] fast/dom/Window/window-resize-contents.html [ Failure Pass Timeout ] +crbug.com/731535 [ Win7 ] fast/dom/Window/window-resize-contents.html [ Failure Pass ] crbug.com/732103 [ Mac ] http/tests/shapedetection/shapedetection-cross-origin.html [ Failure Pass Timeout ] @@ -3059,14 +3076,14 @@ # Sheriff failure 2017-08-29 crbug.com/727252 [ Win7 ] external/wpt/media-source/mediasource-endofstream.html [ Pass Timeout ] -crbug.com/746904 [ Win ] fast/text/ellipsis-in-relative-inline.html [ Failure Pass ] - crbug.com/731018 [ Mac ] sensor/accelerometer.html [ Failure Pass Crash ] crbug.com/731018 [ Mac ] sensor/ambient-light-sensor.html [ Failure Pass Crash ] crbug.com/731018 [ Mac ] sensor/gyroscope.html [ Failure Pass Crash ] crbug.com/731018 [ Mac ] sensor/magnetometer.html [ Failure Pass Crash ] crbug.com/731018 [ Mac ] sensor/orientation-sensor.html [ Failure Pass Crash ] +crbug.com/746904 [ Win7 ] fast/text/ellipsis-in-relative-inline.html [ Failure Pass ] + # Tests failing on Android after https://chromium-review.googlesource.com/612442 crbug.com/755405 [ Android ] compositing/rendering-contexts.html [ Failure ] crbug.com/755405 [ Android ] compositing/contents-opaque/body-background-painted.html [ Failure ] @@ -3197,51 +3214,35 @@ crbug.com/757165 [ Win ] external/wpt/preload/preload-default-csp.sub.html [ Skip ] crbug.com/757165 [ Win ] external/wpt/service-workers/service-worker/navigation-redirect.https.html [ Skip ] crbug.com/757165 [ Win ] fast/forms/file/recover-file-input-in-unposted-form.html [ Skip ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-1st-stop.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-aligned-not-aligned.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-clipped-overflowed-content.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-container-only-white-space.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-container-white-space.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-date.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-display-contents-crash.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-div-in-anchor-and-img-crash.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-div-in-anchor.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-div-scrollable-but-without-focusable-content.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-fully-aligned-horizontally.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-fully-aligned-vertically.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-hidden-focusable-element.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-hidden-iframe.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-hidden-iframe-zero-size.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-iframe-nested.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-iframe-no-focusable-content.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-iframe-no-scrollable-content.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-iframe-recursive-offset-parent.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-imagemap-area-not-focusable.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-imagemap-area-without-image.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-imagemap-overlapped-areas.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-imagemap-simple.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-input.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-media-elements.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-multiple-select-focusring.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-multiple-select.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-not-below.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-not-rightof.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-offscreen-content.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-only-clipped-overflow-content.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-overlapping-elements.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-radio-group.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-radio.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-simple-content-overflow.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-single-select.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-single-select-list.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-symmetrically-positioned.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-table-traversal.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-textarea.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-tiny-table-traversal.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-two-elements-one-line.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-unit-overflow-and-scroll-in-direction.html [ Pass Failure Timeout Crash ] -crbug.com/757165 [ Win ] fast/spatial-navigation/snav-zero-margin-content.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] fast/spatial-navigation/snav-z-index.html [ Pass Failure Timeout Crash ] crbug.com/757165 [ Win ] http/tests/devtools/console/console-filter-test.js [ Skip ] crbug.com/757165 [ Win ] http/tests/devtools/console/console-links-in-errors-with-trace.js [ Skip ] @@ -3278,10 +3279,10 @@ crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-shadow.html [ Skip ] crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-text.html [ Skip ] crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-blending-transforms.html [ Skip ] -#These are currently skipped on all OSes due to crbug.com/785931 +# These are currently skipped on all OSes due to crbug.com/785931 #crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-composite-video-shadow.html [ Skip ] #crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-composite-video.html [ Skip ] -#This is currently skipped on all OSes due to crbug.com/775957 +# This is currently skipped on all OSes due to crbug.com/775957 #crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-incremental-repaint.html [ Skip ] crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-scale-drawImage-shadow.html [ Skip ] crbug.com/757165 [ Win ] virtual/gpu/fast/canvas/canvas-strokeRect-alpha-shadow.html [ Skip ] @@ -3350,14 +3351,11 @@ # Sheriff failure 2017-09-18 crbug.com/766404 [ Mac ] plugins/keyboard-events.html [ Pass Failure ] -#Layout test corrupted after Skia rect tessellation change due to apparent SwiftShader bug. -#This was previously skipped on Windows in the section for crbug.com/757165 +# Layout test corrupted after Skia rect tessellation change due to apparent SwiftShader bug. +# This was previously skipped on Windows in the section for crbug.com/757165 crbug.com/775957 virtual/gpu/fast/canvas/canvas-incremental-repaint.html [ Skip ] # Sheriff failures 2017-09-20 -# Timeouts flakily on chromium.webkit/WebKit Win7 and WebKit Win10 -# Fails flakily on chromium.mac/Mac10.12 Tests and WebKit Mac10.12. -crbug.com/767040 [ Mac10.12 ] external/wpt/clear-site-data/storage.https.html [ Pass Failure ] # Fails reliably on last 3 builds of this bot. crbug.com/767091 [ Mac10.12 ] http/tests/security/link-crossorigin-preload-use-credentials.html [ Failure ] @@ -3365,10 +3363,6 @@ crbug.com/767469 http/tests/navigation/start-load-during-provisional-loader-detach.html [ Pass Failure ] crbug.com/767469 virtual/stable/http/tests/navigation/start-load-during-provisional-loader-detach.html [ Pass Failure ] -# Sheriff failures 2017-09-22 - -# Sheriff failures 2017-09-29 - # Sheriff failures 2017-10-02 crbug.com/770971 [ Win7 ] fast/forms/suggested-value.html [ Pass Failure ] crbug.com/771492 [ Win Linux Mac ] external/wpt/css/css-tables/table-model-fixup-2.html [ Failure ] @@ -3390,8 +3384,6 @@ crbug.com/773122 [ Win7 ] fast/text/word-break.html [ Failure Pass ] crbug.com/773122 [ Win7 ] virtual/gpu/fast/canvas/canvas-lost-gpu-context.html [ Failure Pass ] -# Sheriff failures 2017-10-11 - # Sheriff failures 2017-10-13 crbug.com/774437 paint/invalidation/selection/selection-partial-invalidation-between-blocks.html [ Pass Failure ] crbug.com/774437 virtual/spv175/paint/invalidation/selection/selection-partial-invalidation-between-blocks.html [ Skip ] @@ -3478,7 +3470,7 @@ crbug.com/795542 http/tests/devtools/elements/elements-panel-selection-after-delete.js [ Timeout Pass ] # Sheriff failures 2017-11-16 -crbug.com/785980 [ Win7 Win10 ] http/tests/devtools/network/network-xhr-same-url-as-main-resource.js [ Failure Pass ] +crbug.com/785980 [ Win ] http/tests/devtools/network/network-xhr-same-url-as-main-resource.js [ Failure Pass ] # Sheriff failures 2017-11-17 crbug.com/786235 http/tests/misc/resource-timing-sizes-tags.html [ Failure Pass ] @@ -3490,12 +3482,14 @@ crbug.com/789111 http/tests/devtools/service-workers/service-worker-v8-cache.js [ Pass Failure Timeout ] crbug.com/789139 [ Linux ] http/tests/devtools/sources/debugger/live-edit-no-reveal.js [ Pass Failure ] crbug.com/785179 [ Mac10.11 ] http/tests/devtools/console/console-viewport-stick-to-bottom.js [ Pass Failure ] + # Sheriff failures 2017-11-29 crbug.com/789567 virtual/rootlayerscrolls/scrollbars/custom-scrollbar-inactive-pseudo.html [ Failure Pass ] crbug.com/789567 virtual/rootlayerscrolls/scrollbars/custom-scrollbar-adjust-on-inactive-pseudo.html [ Failure Pass ] crbug.com/789567 virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-inactive-pseudo.html [ Failure Pass ] crbug.com/789478 virtual/prefer_compositing_to_lcd_text/scrollbars/custom-scrollbar-adjust-on-inactive-pseudo.html [ Pass Failure ] crbug.com/789533 virtual/gpu/fast/canvas/OffscreenCanvas-2d-imageSmoothing.html [ Pass Failure Timeout ] + # Sheriff failures 2017-11-30 crbug.com/789921 [ Win7 ] media/video-controls-overflow-menu-last-button-visible.html [ Pass Failure ] crbug.com/789111 virtual/pwa-full-code-cache/http/tests/devtools/service-workers/service-worker-v8-cache.js [ Pass Failure Timeout ] @@ -3539,7 +3533,9 @@ # Sheriff failures 2017-12-15 crbug.com/795250 [ Win7 Linux ] virtual/scroll_customization/fast/events/touch/gesture/gesture-tap-hover-state-iframe.html [ Pass Failure ] -crbug.com/795250 [ Win7 ] virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-tap-hover-state-iframe.html [ Pass Failure ] + +# Sheriff 2017-12-21 +crbug.com/796926 [ Win10 ] inspector-protocol/layout-fonts/fallback-pua-last-resort.js [ Pass Failure ] # Does not work on Mac crbug.com/793771 [ Mac ] virtual/modern-media-controls/media/controls/modern/scrubbing.html [ Skip ] @@ -3547,6 +3543,8 @@ crbug.com/797138 external/wpt/credential-management/federatedcredential-framed-get.sub.https.html [ Crash ] crbug.com/797138 external/wpt/credential-management/passwordcredential-framed-get.sub.https.html [ Crash ] +# Pixel values changes insignificantly due to using a different SkMatrix method to compute texture coords +crbug.com/799666 virtual/gpu/fast/canvas/canvas-imageSmoothingEnabled-patterns.html [ NeedsManualRebaseline ] # Sheriff failures 2018-01-02 crbug.com/798527 [ Linux ] virtual/spv175/compositing/gestures/gesture-tapHighlight-with-box-shadow.html [ Pass Failure ] @@ -3554,3 +3552,14 @@ # Sheriff failures 2018-01-03 crbug.com/798680 external/wpt/pointerevents/pointerlock/pointerevent_pointerlock_supercedes_capture-manual.html [ Pass Timeout ] +crbug.com/799127 [ Mac ] external/wpt/resource-timing/test_resource_timing.html [ Failure ] +crbug.com/799127 [ Mac ] external/wpt/dom/events/Event-timestamp-high-resolution.html [ Failure ] +crbug.com/799137 [ Mac ] virtual/modern-media-controls/media/controls/modern/doubletap-to-jump-backwards-at-start.html [ Pass Timeout ] +crbug.com/799164 [ Win7 ] http/tests/devtools/startup/dom-storage-open.js [ Pass Timeout ] + +# Sheriff failures 2018-01-05 +crbug.com/799547 [ Mac ] external/wpt/WebCryptoAPI/generateKey/failures_RSA-PSS.https.worker.html [ Pass Timeout ] + +# Sheriff failures 2018-01-08 +# This test fails consistently on Nexus4 - see bug for info. +crbug.com/799814 [ Android ] fast/beacon/beacon-basic.html [ Pass Failure ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites index aaf0528..043e057 100644 --- a/third_party/WebKit/LayoutTests/VirtualTestSuites +++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -297,6 +297,12 @@ "references_use_default_args": true }, { + "prefix": "spv175", + "base": "fast/pagination", + "args": ["--enable-slimming-paint-v175", "--root-layer-scrolls"], + "references_use_default_args": true + }, + { "prefix": "scalefactor200", "base": "fast/hidpi/static", "args": ["--force-device-scale-factor=2"]
diff --git a/third_party/WebKit/LayoutTests/accessibility/idref-newlines.html b/third_party/WebKit/LayoutTests/accessibility/idref-newlines.html new file mode 100644 index 0000000..a3257322 --- /dev/null +++ b/third_party/WebKit/LayoutTests/accessibility/idref-newlines.html
@@ -0,0 +1,29 @@ +<!DOCTYPE HTML> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> + +<style> + .hideAllContainers .container { display: none; } +</style> + +<div class="container"> + <input + id="chk1" + type="checkbox" + aria-labelledby="label-1 + label-2"> + <span id="label-1">nacho</span> + <span id="label-2">cheese</span> +</div> + +<script> +test(function(t) { + var axCheckbox = accessibilityController.accessibleElementById("chk1"); + assert_equals(axCheckbox.name, "nacho cheese"); +}); +</script> + +<script> + if (window.testRunner) + document.body.className = "hideAllContainers"; +</script>
diff --git a/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendants-expected.html b/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendants-expected.html new file mode 100644 index 0000000..77b4487 --- /dev/null +++ b/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendants-expected.html
@@ -0,0 +1,2 @@ +<!DOCTYPE html> +<div style="position:relative; left:10px; top:10px; width:80px; height:80px; background:green;"></div> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendants.html b/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendants.html new file mode 100644 index 0000000..04b9198 --- /dev/null +++ b/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendants.html
@@ -0,0 +1,4 @@ +<!DOCTYPE html> +<div style="clip-path:inset(10px); width:100px; height:100px;"> + <div style="background:green; width:100px; height:100px; will-change:transform;"></div> +</div> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendent-expected.html b/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendent-expected.html deleted file mode 100644 index e28e7c3..0000000 --- a/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendent-expected.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> - -<style type="text/css" media="screen"> -#parent { - position: absolute; - height: 256px; - width: 256px; - -webkit-clip-path: circle(128px at center); - clip-path: circle(128px at center); - background: #eee; - will-change: transform; -} -#child { - background: #222; - width: 64px; - height: 64px; - will-change: transform; -} -</style> - -<div id="parent"> - <div id="child"></div> -</div>
diff --git a/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendent.html b/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendent.html deleted file mode 100644 index eefec6d6..0000000 --- a/third_party/WebKit/LayoutTests/compositing/clip-path-with-composited-descendent.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> - -<style type="text/css" media="screen"> -#parent { - position: absolute; - height: 256px; - width: 256px; - -webkit-clip-path: circle(128px at center); - clip-path: circle(128px at center); - background: #eee; -} -#child { - background: #222; - width: 64px; - height: 64px; - will-change: transform; -} -</style> - -<div id="parent"> - <div id="child"></div> -</div>
diff --git a/third_party/WebKit/LayoutTests/compositing/images/direct-image-clip-path-expected.png b/third_party/WebKit/LayoutTests/compositing/images/direct-image-clip-path-expected.png index 133a1af..21577b4 100644 --- a/third_party/WebKit/LayoutTests/compositing/images/direct-image-clip-path-expected.png +++ b/third_party/WebKit/LayoutTests/compositing/images/direct-image-clip-path-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/compositing/images/direct-image-dynamic-clip-path-expected.png b/third_party/WebKit/LayoutTests/compositing/images/direct-image-dynamic-clip-path-expected.png index 133a1af..21577b4 100644 --- a/third_party/WebKit/LayoutTests/compositing/images/direct-image-dynamic-clip-path-expected.png +++ b/third_party/WebKit/LayoutTests/compositing/images/direct-image-dynamic-clip-path-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/crypto/random-values-expected.txt b/third_party/WebKit/LayoutTests/crypto/random-values-expected.txt index 1334f1f..b0012025 100644 --- a/third_party/WebKit/LayoutTests/crypto/random-values-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/random-values-expected.txt
@@ -7,7 +7,6 @@ PASS 'getRandomValues' in self.crypto is true PASS self.crypto.__proto__.hasOwnProperty('getRandomValues') is true PASS matchingBytes < 100 is true -PASS crypto.getRandomValues(new Uint8Array(new SharedArrayBuffer(100))) threw exception TypeError: Failed to execute 'getRandomValues' on 'Crypto': The provided ArrayBufferView value must not be shared.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt b/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt index f3e09a7..73949bf 100644 --- a/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/subtle/importKey-badParameters-expected.txt
@@ -11,7 +11,7 @@ error is: TypeError: Invalid keyFormat argument error is: TypeError: HmacImportParams: hash: Missing or not an AlgorithmIdentifier error is: NotSupportedError: SHA-1: Unsupported operation: importKey -error is: TypeError: Failed to execute 'importKey' on 'SubtleCrypto': The provided ArrayBufferView value must not be shared. +error is: SharedArrayBuffers not enabled. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/crypto/worker-random-values-expected.txt b/third_party/WebKit/LayoutTests/crypto/worker-random-values-expected.txt index 47f33e1..382e3ee3 100644 --- a/third_party/WebKit/LayoutTests/crypto/worker-random-values-expected.txt +++ b/third_party/WebKit/LayoutTests/crypto/worker-random-values-expected.txt
@@ -8,7 +8,6 @@ PASS [Worker] 'getRandomValues' in self.crypto is true PASS [Worker] self.crypto.__proto__.hasOwnProperty('getRandomValues') is true PASS [Worker] matchingBytes < 100 is true -PASS [Worker] crypto.getRandomValues(new Uint8Array(new SharedArrayBuffer(100))) threw exception TypeError: Failed to execute 'getRandomValues' on 'Crypto': The provided ArrayBufferView value must not be shared.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/css3/filters/filter-property-computed-style.html b/third_party/WebKit/LayoutTests/css3/filters/filter-property-computed-style.html index c1b0dcb..1f7eb352 100644 --- a/third_party/WebKit/LayoutTests/css3/filters/filter-property-computed-style.html +++ b/third_party/WebKit/LayoutTests/css3/filters/filter-property-computed-style.html
@@ -52,7 +52,7 @@ assert_computed_style("filter", "invert(1)"); // Integer value assert_computed_style("filter", "invert(1.0)", "invert(1)"); // Float value converts to integer assert_computed_style("filter", "invert(0)"); // Zero value -assert_computed_style("filter", "invert()", "invert(1)"); // No arguments +assert_computed_style("filter", "invert()", "invert(0)"); // No arguments assert_computed_style("filter", "invert(0.5) invert(0.25)"); // Multiple values assert_computed_style("filter", "opacity(1)"); // Integer value
diff --git a/third_party/WebKit/LayoutTests/css3/filters/nested-filters.html b/third_party/WebKit/LayoutTests/css3/filters/nested-filters.html index b8b1651b..b23f903 100644 --- a/third_party/WebKit/LayoutTests/css3/filters/nested-filters.html +++ b/third_party/WebKit/LayoutTests/css3/filters/nested-filters.html
@@ -10,7 +10,7 @@ left: 20px; background-color: black; outline: 4px solid gray; - filter: invert(); + filter: invert(1); } </style>
diff --git a/third_party/WebKit/LayoutTests/css3/filters/unprefixed.html b/third_party/WebKit/LayoutTests/css3/filters/unprefixed.html index 2f45d165..2168566 100644 --- a/third_party/WebKit/LayoutTests/css3/filters/unprefixed.html +++ b/third_party/WebKit/LayoutTests/css3/filters/unprefixed.html
@@ -54,7 +54,7 @@ assert_prefixed_computed_style("filter", "invert(1)"); // Integer value assert_prefixed_computed_style("filter", "invert(1.0)", "invert(1)"); // Float value converts to integer assert_prefixed_computed_style("filter", "invert(0)"); // Zero value -assert_prefixed_computed_style("filter", "invert()", "invert(1)"); // No arguments +assert_prefixed_computed_style("filter", "invert()", "invert(0)"); // No arguments assert_prefixed_computed_style("filter", "invert(0.5) invert(0.25)"); // Multiple values assert_prefixed_computed_style("filter", "opacity(1)"); // Integer value
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index baa92a1..3ed31346 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -55,30 +55,24 @@ {} ] ], + "FileAPI/FileReader/test_notreadableerrors-manual.html": [ + [ + "/FileAPI/FileReader/test_notreadableerrors-manual.html", + {} + ] + ], + "FileAPI/FileReader/test_securityerrors-manual.html": [ + [ + "/FileAPI/FileReader/test_securityerrors-manual.html", + {} + ] + ], "FileAPI/url/url_createobjecturl_file_img-manual.html": [ [ "/FileAPI/url/url_createobjecturl_file_img-manual.html", {} ] ], - "XMLHttpRequest/send-authentication-existing-session-manual.htm": [ - [ - "/XMLHttpRequest/send-authentication-existing-session-manual.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-prompt-2-manual.htm": [ - [ - "/XMLHttpRequest/send-authentication-prompt-2-manual.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-prompt-manual.htm": [ - [ - "/XMLHttpRequest/send-authentication-prompt-manual.htm", - {} - ] - ], "accelerometer/Accelerometer_onerror-manual.https.html": [ [ "/accelerometer/Accelerometer_onerror-manual.https.html", @@ -4801,6 +4795,12 @@ {} ] ], + "quirks/active-and-hover-manual.html": [ + [ + "/quirks/active-and-hover-manual.html", + {} + ] + ], "screen-orientation/page-visibility-manual.html": [ [ "/screen-orientation/page-visibility-manual.html", @@ -5148,6 +5148,24 @@ "/webstorage/storage_session-manual.html", {} ] + ], + "xhr/send-authentication-existing-session-manual.htm": [ + [ + "/xhr/send-authentication-existing-session-manual.htm", + {} + ] + ], + "xhr/send-authentication-prompt-2-manual.htm": [ + [ + "/xhr/send-authentication-prompt-2-manual.htm", + {} + ] + ], + "xhr/send-authentication-prompt-manual.htm": [ + [ + "/xhr/send-authentication-prompt-manual.htm", + {} + ] ] }, "reftest": { @@ -10051,6 +10069,18 @@ {} ] ], + "css/CSS2/linebox/line-height-oof-descendants-001.html": [ + [ + "/css/CSS2/linebox/line-height-oof-descendants-001.html", + [ + [ + "/css/CSS2/linebox/line-height-oof-descendants-001-ref.html", + "==" + ] + ], + {} + ] + ], "css/CSS2/linebox/vertical-align-004.xht": [ [ "/css/CSS2/linebox/vertical-align-004.xht", @@ -27683,6 +27713,18 @@ {} ] ], + "css/css-backgrounds/background-repeat/gradient-repeat-spaced-with-borders.html": [ + [ + "/css/css-backgrounds/background-repeat/gradient-repeat-spaced-with-borders.html", + [ + [ + "/css/css-backgrounds/background-repeat/reference/gradient-repeat-spaced-with-borders.html", + "==" + ] + ], + {} + ] + ], "css/css-backgrounds/background-size-002.html": [ [ "/css/css-backgrounds/background-size-002.html", @@ -47503,6 +47545,54 @@ {} ] ], + "css/css-tables/fixup-dynamic-anonymous-inline-table-001.html": [ + [ + "/css/css-tables/fixup-dynamic-anonymous-inline-table-001.html", + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], + "css/css-tables/fixup-dynamic-anonymous-inline-table-002.html": [ + [ + "/css/css-tables/fixup-dynamic-anonymous-inline-table-002.html", + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], + "css/css-tables/fixup-dynamic-anonymous-inline-table-003.html": [ + [ + "/css/css-tables/fixup-dynamic-anonymous-inline-table-003.html", + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], + "css/css-tables/fixup-dynamic-anonymous-table-001.html": [ + [ + "/css/css-tables/fixup-dynamic-anonymous-table-001.html", + [ + [ + "/css/reference/ref-filled-green-100px-square-only.html", + "==" + ] + ], + {} + ] + ], "css/css-tables/floats/floats-wrap-bfc-006b.xht": [ [ "/css/css-tables/floats/floats-wrap-bfc-006b.xht", @@ -77279,6 +77369,18 @@ {} ] ], + "css/cssom-view/scrollTop-display-change.html": [ + [ + "/css/cssom-view/scrollTop-display-change.html", + [ + [ + "/css/cssom-view/scrollTop-display-change-ref.html", + "==" + ] + ], + {} + ] + ], "css/cssom-view/scrollingElement-quirks-dynamic-001.html": [ [ "/css/cssom-view/scrollingElement-quirks-dynamic-001.html", @@ -77327,6 +77429,18 @@ {} ] ], + "css/cssom/stylesheet-replacedata-dynamic.html": [ + [ + "/css/cssom/stylesheet-replacedata-dynamic.html", + [ + [ + "/css/cssom/stylesheet-replacedata-dynamic-ref.html", + "==" + ] + ], + {} + ] + ], "css/mediaqueries/aspect-ratio-001.html": [ [ "/css/mediaqueries/aspect-ratio-001.html", @@ -78023,6 +78137,18 @@ {} ] ], + "css/selectors/selectors-attr-white-space-001.html": [ + [ + "/css/selectors/selectors-attr-white-space-001.html", + [ + [ + "/css/selectors/selectors-attr-white-space-001-ref.html", + "==" + ] + ], + {} + ] + ], "css/selectors/selectors-dir-selector-ltr-001.html": [ [ "/css/selectors/selectors-dir-selector-ltr-001.html", @@ -83699,6 +83825,78 @@ {} ] ], + "html/form-elements/the-textarea-element/multiline-placeholder-cr.html": [ + [ + "/html/form-elements/the-textarea-element/multiline-placeholder-cr.html", + [ + [ + "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html", + "==" + ] + ], + {} + ] + ], + "html/form-elements/the-textarea-element/multiline-placeholder-crlf.html": [ + [ + "/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html", + [ + [ + "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html", + "==" + ] + ], + {} + ] + ], + "html/form-elements/the-textarea-element/multiline-placeholder.html": [ + [ + "/html/form-elements/the-textarea-element/multiline-placeholder.html", + [ + [ + "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html", + "==" + ] + ], + {} + ] + ], + "html/input/the-placeholder-attribute/multiline-cr.html": [ + [ + "/html/input/the-placeholder-attribute/multiline-cr.html", + [ + [ + "/html/input/the-placeholder-attribute/multiline-ref.html", + "==" + ] + ], + {} + ] + ], + "html/input/the-placeholder-attribute/multiline-crlf.html": [ + [ + "/html/input/the-placeholder-attribute/multiline-crlf.html", + [ + [ + "/html/input/the-placeholder-attribute/multiline-ref.html", + "==" + ] + ], + {} + ] + ], + "html/input/the-placeholder-attribute/multiline.html": [ + [ + "/html/input/the-placeholder-attribute/multiline.html", + [ + [ + "/html/input/the-placeholder-attribute/multiline-ref.html", + "==" + ] + ], + {} + ] + ], "html/rendering/bindings/the-button-element/button-type-menu-historical.html": [ [ "/html/rendering/bindings/the-button-element/button-type-menu-historical.html", @@ -85799,12 +85997,12 @@ {} ] ], - "quirks-mode/historical/list-item-bullet-size.html": [ + "quirks/historical/list-item-bullet-size.html": [ [ - "/quirks-mode/historical/list-item-bullet-size.html", + "/quirks/historical/list-item-bullet-size.html", [ [ - "/quirks-mode/historical/list-item-bullet-size-ref.html", + "/quirks/historical/list-item-bullet-size-ref.html", "==" ] ], @@ -91903,681 +92101,6 @@ {} ] ], - "XMLHttpRequest/README.md": [ - [ - {} - ] - ], - "XMLHttpRequest/abort-after-send-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/abort-during-open.js": [ - [ - {} - ] - ], - "XMLHttpRequest/abort-during-upload-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/abort-event-order-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/access-control-and-redirects-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/data-uri-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/event-error-order.sub-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/event-loadstart-upload-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/event-timeout-order-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/event-upload-progress-crossorigin-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/folder.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/getallresponseheaders-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/headers-normalize-response-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/no-utf16-json-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-2-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-3-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-4-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-5-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-6-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/accept-language.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/accept.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-allow-lists.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-allow-with-body.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-auth-basic.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-allow-no-credentials.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-allow-star.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-allow.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-cors-safelisted-request-headers.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-denied.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-options-not-supported.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-preflight-cache.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-put-allow.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-basic-whitelist-response-headers.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-cookie.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-origin-header.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-preflight-denied.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-preflight-request-header-lowercase.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-preflight-request-header-sorted.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-preflight-request-headers-origin.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-preflight-request-invalid-status.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-preflight-request-must-not-contain-cookie.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/access-control-sandboxed-iframe.html": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth1/auth.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth2/auth.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth2/corsenabled.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth3/auth.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth4/auth.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth5/auth.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth6/auth.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth7/corsenabled.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth8/corsenabled-no-authorize.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/auth9/auth.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/authentication.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/base.xml": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/chunked.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/conditional.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/content.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/corsenabled.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/delay.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/echo-headers.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/echo-method.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/empty-div-utf8-html.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/folder.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/form.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/gzip.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/header-content-length.asis": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/headers-basic.asis": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/headers.asis": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/headers.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/image.gif": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/img-utf8-html.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/img.jpg": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/infinite-redirects.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/init.htm": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/inspect-headers.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/invalid-utf8-html.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/last-modified.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/no-custom-header-on-preflight.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/nocors/folder.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/parse-headers.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/pass.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/redirect-cors.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/redirect.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/requri.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/reset-token.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/responseType-document-in-worker.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/responseXML-unavailable-in-worker.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/send-after-setting-document-domain-window-1.htm": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/send-after-setting-document-domain-window-2.htm": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/send-after-setting-document-domain-window-helper.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/shift-jis-html.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/status.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/trickle.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/upload.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/utf16-bom.json": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/utf16.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/well-formed.xml": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/win-1252-html.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/win-1252-xml.py": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/workerxhr-origin-referrer.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/workerxhr-simple.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-event-order.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-aborted.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-abortedonmain.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-overrides.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-overridesexpires.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-runner.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout.js": [ - [ - {} - ] - ], - "XMLHttpRequest/resources/zlib.py": [ - [ - {} - ] - ], - "XMLHttpRequest/response-data-progress-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/response-json-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/responseType-document-in-worker-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/responseXML-unavailable-in-worker-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/responsexml-media-type-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/security-consideration.sub-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/send-authentication-prompt-manual-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/send-content-type-charset-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/send-content-type-string-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/send-no-response-event-order-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/send-response-event-order-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/send-send.js": [ - [ - {} - ] - ], - "XMLHttpRequest/send-sync-response-event-order-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/setrequestheader-content-type-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html": [ - [ - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt": [ - [ - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html": [ - [ - {} - ] - ], "accelerometer/Accelerometer-disabled-by-feature-policy.https-expected.txt": [ [ {} @@ -93873,11 +93396,6 @@ {} ] ], - "content-security-policy/securitypolicyviolation/idl-expected.txt": [ - [ - {} - ] - ], "content-security-policy/securitypolicyviolation/img-src-redirect-upgrade-reporting.https.html.headers": [ [ {} @@ -95893,6 +95411,11 @@ {} ] ], + "css/CSS2/linebox/line-height-oof-descendants-001-ref.html": [ + [ + {} + ] + ], "css/CSS2/linebox/support/1x1-green.png": [ [ {} @@ -98838,6 +98361,11 @@ {} ] ], + "css/css-backgrounds/background-repeat/reference/gradient-repeat-spaced-with-borders.html": [ + [ + {} + ] + ], "css/css-backgrounds/background-repeat/reference/support/rectangle-96x60.png": [ [ {} @@ -117663,6 +117191,11 @@ {} ] ], + "css/css-values/calc-serialization-expected.txt": [ + [ + {} + ] + ], "css/css-values/ex-calc-expression-001-ref.html": [ [ {} @@ -120728,6 +120261,11 @@ {} ] ], + "css/cssom-view/scrollTop-display-change-ref.html": [ + [ + {} + ] + ], "css/cssom-view/scrollingElement-quirks-dynamic-001-ref.html": [ [ {} @@ -121058,6 +120596,11 @@ {} ] ], + "css/cssom/stylesheet-replacedata-dynamic-ref.html": [ + [ + {} + ] + ], "css/cssom/stylesheet-same-origin.css": [ [ {} @@ -123573,6 +123116,11 @@ {} ] ], + "css/selectors/selectors-attr-white-space-001-ref.html": [ + [ + {} + ] + ], "css/selectors/selectors-empty-001-ref.xml": [ [ {} @@ -123588,6 +123136,11 @@ {} ] ], + "css/selectors/user-invalid-expected.txt": [ + [ + {} + ] + ], "css/selectors/utils/generators.pm": [ [ {} @@ -127488,16 +127041,6 @@ {} ] ], - "fetch/api/policies/referrer-origin-expected.txt": [ - [ - {} - ] - ], - "fetch/api/policies/referrer-origin-service-worker.https-expected.txt": [ - [ - {} - ] - ], "fetch/api/policies/referrer-origin-when-cross-origin.html.headers": [ [ {} @@ -127513,11 +127056,6 @@ {} ] ], - "fetch/api/policies/referrer-origin-worker-expected.txt": [ - [ - {} - ] - ], "fetch/api/policies/referrer-origin.html.headers": [ [ {} @@ -127593,6 +127131,86 @@ {} ] ], + "fetch/api/request/destination/fetch-destination.https-expected.txt": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy.es": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy.es.headers": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy.html": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy.png": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy.ttf": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy_audio.mp3": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy_audio.oga": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy_video.mp4": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/dummy_video.ogv": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/empty.https.html": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/fetch-destination-worker-iframe.js": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/fetch-destination-worker-no-load-event.js": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/fetch-destination-worker.js": [ + [ + {} + ] + ], + "fetch/api/request/destination/resources/importer.js": [ + [ + {} + ] + ], "fetch/api/request/multi-globals/current/current.html": [ [ {} @@ -127633,21 +127251,11 @@ {} ] ], - "fetch/api/request/request-init-001.sub-expected.txt": [ - [ - {} - ] - ], "fetch/api/request/request-keepalive-expected.txt": [ [ {} ] ], - "fetch/api/request/request-structure-expected.txt": [ - [ - {} - ] - ], "fetch/api/request/resources/cache.py": [ [ {} @@ -135113,6 +134721,16 @@ {} ] ], + "html/form-elements/the-textarea-element/multiline-placeholder-ref.html": [ + [ + {} + ] + ], + "html/form-elements/the-textarea-element/support/placeholder.css": [ + [ + {} + ] + ], "html/iana/.gitkeep": [ [ {} @@ -135638,6 +135256,11 @@ {} ] ], + "html/input/the-placeholder-attribute/multiline-ref.html": [ + [ + {} + ] + ], "html/introduction/.gitkeep": [ [ {} @@ -137078,6 +136701,11 @@ {} ] ], + "html/semantics/embedded-content/media-elements/track/track-element/resources/large-timestamp.vtt": [ + [ + {} + ] + ], "html/semantics/embedded-content/media-elements/track/track-element/resources/line-position-bad.vtt": [ [ {} @@ -137103,6 +136731,11 @@ {} ] ], + "html/semantics/embedded-content/media-elements/track/track-element/resources/metadata.vtt": [ + [ + {} + ] + ], "html/semantics/embedded-content/media-elements/track/track-element/resources/missed-cues.vtt": [ [ {} @@ -139143,6 +138776,11 @@ {} ] ], + "html/semantics/scripting-1/the-script-element/module/export-default.js": [ + [ + {} + ] + ], "html/semantics/scripting-1/the-script-element/module/export-something-nested.js": [ [ {} @@ -139228,6 +138866,16 @@ {} ] ], + "html/semantics/scripting-1/the-script-element/module/instantiation-error-3-expected.txt": [ + [ + {} + ] + ], + "html/semantics/scripting-1/the-script-element/module/instantiation-error-4-expected.txt": [ + [ + {} + ] + ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-4a.js": [ [ {} @@ -139248,6 +138896,11 @@ {} ] ], + "html/semantics/scripting-1/the-script-element/module/instantiation-error-5-expected.txt": [ + [ + {} + ] + ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-5a.js": [ [ {} @@ -143438,11 +143091,6 @@ {} ] ], - "preload/resources/fetch-destination-worker.js": [ - [ - {} - ] - ], "preload/resources/foo.vtt": [ [ {} @@ -143623,7 +143271,7 @@ {} ] ], - "quirks-mode/historical/list-item-bullet-size-ref.html": [ + "quirks/historical/list-item-bullet-size-ref.html": [ [ {} ] @@ -147383,12 +147031,12 @@ {} ] ], - "service-workers/service-worker/resources/fetch-event-respond-with-partial-stream-worker.js": [ + "service-workers/service-worker/resources/fetch-event-respond-with-custom-response-worker.js": [ [ {} ] ], - "service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-iframe.html": [ + "service-workers/service-worker/resources/fetch-event-respond-with-partial-stream-worker.js": [ [ {} ] @@ -147513,6 +147161,11 @@ {} ] ], + "service-workers/service-worker/resources/fetch-request-no-freshness-headers-script.py": [ + [ + {} + ] + ], "service-workers/service-worker/resources/fetch-request-no-freshness-headers-worker.js": [ [ {} @@ -147858,6 +147511,11 @@ {} ] ], + "service-workers/service-worker/resources/pass.txt": [ + [ + {} + ] + ], "service-workers/service-worker/resources/performance-timeline-worker.js": [ [ {} @@ -153783,6 +153441,11 @@ {} ] ], + "workers/support/WorkerSendingPerformanceNow.js": [ + [ + {} + ] + ], "workers/support/WorkerTerminate.js": [ [ {} @@ -153793,6 +153456,11 @@ {} ] ], + "workers/support/iframe_sw_dataUrl.html": [ + [ + {} + ] + ], "workers/support/name-as-accidental-global.js": [ [ {} @@ -154007,6 +153675,681 @@ [ {} ] + ], + "xhr/README.md": [ + [ + {} + ] + ], + "xhr/abort-after-send-expected.txt": [ + [ + {} + ] + ], + "xhr/abort-during-open.js": [ + [ + {} + ] + ], + "xhr/abort-during-upload-expected.txt": [ + [ + {} + ] + ], + "xhr/abort-event-order-expected.txt": [ + [ + {} + ] + ], + "xhr/access-control-and-redirects-expected.txt": [ + [ + {} + ] + ], + "xhr/data-uri-expected.txt": [ + [ + {} + ] + ], + "xhr/event-error-order.sub-expected.txt": [ + [ + {} + ] + ], + "xhr/event-loadstart-upload-expected.txt": [ + [ + {} + ] + ], + "xhr/event-timeout-order-expected.txt": [ + [ + {} + ] + ], + "xhr/event-upload-progress-crossorigin-expected.txt": [ + [ + {} + ] + ], + "xhr/folder.txt": [ + [ + {} + ] + ], + "xhr/getallresponseheaders-expected.txt": [ + [ + {} + ] + ], + "xhr/headers-normalize-response-expected.txt": [ + [ + {} + ] + ], + "xhr/no-utf16-json-expected.txt": [ + [ + {} + ] + ], + "xhr/open-url-multi-window-2-expected.txt": [ + [ + {} + ] + ], + "xhr/open-url-multi-window-3-expected.txt": [ + [ + {} + ] + ], + "xhr/open-url-multi-window-4-expected.txt": [ + [ + {} + ] + ], + "xhr/open-url-multi-window-5-expected.txt": [ + [ + {} + ] + ], + "xhr/open-url-multi-window-6-expected.txt": [ + [ + {} + ] + ], + "xhr/resources/accept-language.py": [ + [ + {} + ] + ], + "xhr/resources/accept.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-allow-lists.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-allow-with-body.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-auth-basic.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-allow-no-credentials.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-allow-star.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-allow.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-cors-safelisted-request-headers.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-denied.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-options-not-supported.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-preflight-cache-invalidation.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-preflight-cache-timeout.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-preflight-cache.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-put-allow.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-basic-whitelist-response-headers.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-cookie.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-origin-header.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-preflight-denied.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-preflight-request-header-lowercase.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-preflight-request-header-sorted.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-preflight-request-headers-origin.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-preflight-request-invalid-status.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-preflight-request-must-not-contain-cookie.py": [ + [ + {} + ] + ], + "xhr/resources/access-control-sandboxed-iframe.html": [ + [ + {} + ] + ], + "xhr/resources/auth1/auth.py": [ + [ + {} + ] + ], + "xhr/resources/auth2/auth.py": [ + [ + {} + ] + ], + "xhr/resources/auth2/corsenabled.py": [ + [ + {} + ] + ], + "xhr/resources/auth3/auth.py": [ + [ + {} + ] + ], + "xhr/resources/auth4/auth.py": [ + [ + {} + ] + ], + "xhr/resources/auth5/auth.py": [ + [ + {} + ] + ], + "xhr/resources/auth6/auth.py": [ + [ + {} + ] + ], + "xhr/resources/auth7/corsenabled.py": [ + [ + {} + ] + ], + "xhr/resources/auth8/corsenabled-no-authorize.py": [ + [ + {} + ] + ], + "xhr/resources/auth9/auth.py": [ + [ + {} + ] + ], + "xhr/resources/authentication.py": [ + [ + {} + ] + ], + "xhr/resources/base.xml": [ + [ + {} + ] + ], + "xhr/resources/chunked.py": [ + [ + {} + ] + ], + "xhr/resources/conditional.py": [ + [ + {} + ] + ], + "xhr/resources/content.py": [ + [ + {} + ] + ], + "xhr/resources/corsenabled.py": [ + [ + {} + ] + ], + "xhr/resources/delay.py": [ + [ + {} + ] + ], + "xhr/resources/echo-headers.py": [ + [ + {} + ] + ], + "xhr/resources/echo-method.py": [ + [ + {} + ] + ], + "xhr/resources/empty-div-utf8-html.py": [ + [ + {} + ] + ], + "xhr/resources/folder.txt": [ + [ + {} + ] + ], + "xhr/resources/form.py": [ + [ + {} + ] + ], + "xhr/resources/gzip.py": [ + [ + {} + ] + ], + "xhr/resources/header-content-length.asis": [ + [ + {} + ] + ], + "xhr/resources/headers-basic.asis": [ + [ + {} + ] + ], + "xhr/resources/headers.asis": [ + [ + {} + ] + ], + "xhr/resources/headers.py": [ + [ + {} + ] + ], + "xhr/resources/image.gif": [ + [ + {} + ] + ], + "xhr/resources/img-utf8-html.py": [ + [ + {} + ] + ], + "xhr/resources/img.jpg": [ + [ + {} + ] + ], + "xhr/resources/infinite-redirects.py": [ + [ + {} + ] + ], + "xhr/resources/init.htm": [ + [ + {} + ] + ], + "xhr/resources/inspect-headers.py": [ + [ + {} + ] + ], + "xhr/resources/invalid-utf8-html.py": [ + [ + {} + ] + ], + "xhr/resources/last-modified.py": [ + [ + {} + ] + ], + "xhr/resources/no-custom-header-on-preflight.py": [ + [ + {} + ] + ], + "xhr/resources/nocors/folder.txt": [ + [ + {} + ] + ], + "xhr/resources/parse-headers.py": [ + [ + {} + ] + ], + "xhr/resources/pass.txt": [ + [ + {} + ] + ], + "xhr/resources/redirect-cors.py": [ + [ + {} + ] + ], + "xhr/resources/redirect.py": [ + [ + {} + ] + ], + "xhr/resources/requri.py": [ + [ + {} + ] + ], + "xhr/resources/reset-token.py": [ + [ + {} + ] + ], + "xhr/resources/responseType-document-in-worker.js": [ + [ + {} + ] + ], + "xhr/resources/responseXML-unavailable-in-worker.js": [ + [ + {} + ] + ], + "xhr/resources/send-after-setting-document-domain-window-1.htm": [ + [ + {} + ] + ], + "xhr/resources/send-after-setting-document-domain-window-2.htm": [ + [ + {} + ] + ], + "xhr/resources/send-after-setting-document-domain-window-helper.js": [ + [ + {} + ] + ], + "xhr/resources/shift-jis-html.py": [ + [ + {} + ] + ], + "xhr/resources/status.py": [ + [ + {} + ] + ], + "xhr/resources/trickle.py": [ + [ + {} + ] + ], + "xhr/resources/upload.py": [ + [ + {} + ] + ], + "xhr/resources/utf16-bom.json": [ + [ + {} + ] + ], + "xhr/resources/utf16.txt": [ + [ + {} + ] + ], + "xhr/resources/well-formed.xml": [ + [ + {} + ] + ], + "xhr/resources/win-1252-html.py": [ + [ + {} + ] + ], + "xhr/resources/win-1252-xml.py": [ + [ + {} + ] + ], + "xhr/resources/workerxhr-origin-referrer.js": [ + [ + {} + ] + ], + "xhr/resources/workerxhr-simple.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-event-order.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-aborted.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-abortedonmain.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-overrides.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-overridesexpires.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-runner.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-simple.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-synconmain.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-synconworker.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout-twice.js": [ + [ + {} + ] + ], + "xhr/resources/xmlhttprequest-timeout.js": [ + [ + {} + ] + ], + "xhr/resources/zlib.py": [ + [ + {} + ] + ], + "xhr/response-data-progress-expected.txt": [ + [ + {} + ] + ], + "xhr/response-json-expected.txt": [ + [ + {} + ] + ], + "xhr/responseType-document-in-worker-expected.txt": [ + [ + {} + ] + ], + "xhr/responseXML-unavailable-in-worker-expected.txt": [ + [ + {} + ] + ], + "xhr/responsexml-media-type-expected.txt": [ + [ + {} + ] + ], + "xhr/security-consideration.sub-expected.txt": [ + [ + {} + ] + ], + "xhr/send-authentication-competing-names-passwords-expected.txt": [ + [ + {} + ] + ], + "xhr/send-authentication-cors-setrequestheader-no-cred-expected.txt": [ + [ + {} + ] + ], + "xhr/send-authentication-prompt-manual-expected.txt": [ + [ + {} + ] + ], + "xhr/send-content-type-charset-expected.txt": [ + [ + {} + ] + ], + "xhr/send-content-type-string-expected.txt": [ + [ + {} + ] + ], + "xhr/send-no-response-event-order-expected.txt": [ + [ + {} + ] + ], + "xhr/send-response-event-order-expected.txt": [ + [ + {} + ] + ], + "xhr/send-send.js": [ + [ + {} + ] + ], + "xhr/send-sync-response-event-order-expected.txt": [ + [ + {} + ] + ], + "xhr/setrequestheader-content-type-expected.txt": [ + [ + {} + ] + ], + "xhr/xmlhttprequest-sync-block-defer-scripts-subframe.html": [ + [ + {} + ] + ], + "xhr/xmlhttprequest-sync-default-feature-policy.sub-expected.txt": [ + [ + {} + ] + ], + "xhr/xmlhttprequest-sync-not-hang-scriptloader-subframe.html": [ + [ + {} + ] ] }, "testharness": { @@ -161866,1708 +162209,6 @@ {} ] ], - "XMLHttpRequest/FormData-append.html": [ - [ - "/XMLHttpRequest/FormData-append.html", - {} - ] - ], - "XMLHttpRequest/XMLHttpRequest-withCredentials.any.js": [ - [ - "/XMLHttpRequest/XMLHttpRequest-withCredentials.any.html", - {} - ], - [ - "/XMLHttpRequest/XMLHttpRequest-withCredentials.any.worker.html", - {} - ] - ], - "XMLHttpRequest/abort-after-receive.htm": [ - [ - "/XMLHttpRequest/abort-after-receive.htm", - {} - ] - ], - "XMLHttpRequest/abort-after-send.htm": [ - [ - "/XMLHttpRequest/abort-after-send.htm", - {} - ] - ], - "XMLHttpRequest/abort-after-stop.htm": [ - [ - "/XMLHttpRequest/abort-after-stop.htm", - {} - ] - ], - "XMLHttpRequest/abort-after-timeout.htm": [ - [ - "/XMLHttpRequest/abort-after-timeout.htm", - {} - ] - ], - "XMLHttpRequest/abort-during-done.htm": [ - [ - "/XMLHttpRequest/abort-during-done.htm", - {} - ] - ], - "XMLHttpRequest/abort-during-headers-received.htm": [ - [ - "/XMLHttpRequest/abort-during-headers-received.htm", - {} - ] - ], - "XMLHttpRequest/abort-during-loading.htm": [ - [ - "/XMLHttpRequest/abort-during-loading.htm", - {} - ] - ], - "XMLHttpRequest/abort-during-open.htm": [ - [ - "/XMLHttpRequest/abort-during-open.htm", - {} - ] - ], - "XMLHttpRequest/abort-during-open.worker.js": [ - [ - "/XMLHttpRequest/abort-during-open.worker.html", - {} - ] - ], - "XMLHttpRequest/abort-during-unsent.htm": [ - [ - "/XMLHttpRequest/abort-during-unsent.htm", - {} - ] - ], - "XMLHttpRequest/abort-during-upload.htm": [ - [ - "/XMLHttpRequest/abort-during-upload.htm", - {} - ] - ], - "XMLHttpRequest/abort-event-abort.htm": [ - [ - "/XMLHttpRequest/abort-event-abort.htm", - {} - ] - ], - "XMLHttpRequest/abort-event-listeners.htm": [ - [ - "/XMLHttpRequest/abort-event-listeners.htm", - {} - ] - ], - "XMLHttpRequest/abort-event-loadend.htm": [ - [ - "/XMLHttpRequest/abort-event-loadend.htm", - {} - ] - ], - "XMLHttpRequest/abort-event-order.htm": [ - [ - "/XMLHttpRequest/abort-event-order.htm", - {} - ] - ], - "XMLHttpRequest/abort-upload-event-abort.htm": [ - [ - "/XMLHttpRequest/abort-upload-event-abort.htm", - {} - ] - ], - "XMLHttpRequest/abort-upload-event-loadend.htm": [ - [ - "/XMLHttpRequest/abort-upload-event-loadend.htm", - {} - ] - ], - "XMLHttpRequest/access-control-and-redirects-async-same-origin.htm": [ - [ - "/XMLHttpRequest/access-control-and-redirects-async-same-origin.htm", - {} - ] - ], - "XMLHttpRequest/access-control-and-redirects-async.htm": [ - [ - "/XMLHttpRequest/access-control-and-redirects-async.htm", - {} - ] - ], - "XMLHttpRequest/access-control-and-redirects.htm": [ - [ - "/XMLHttpRequest/access-control-and-redirects.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-async.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-async.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-preflight-cache.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-preflight-cache.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow-star.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow-star.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-allow.htm": [ - [ - "/XMLHttpRequest/access-control-basic-allow.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm": [ - [ - "/XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm": [ - [ - "/XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-denied.htm": [ - [ - "/XMLHttpRequest/access-control-basic-denied.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-get-fail-non-simple.htm": [ - [ - "/XMLHttpRequest/access-control-basic-get-fail-non-simple.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm": [ - [ - "/XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-post-success-no-content-type.htm": [ - [ - "/XMLHttpRequest/access-control-basic-post-success-no-content-type.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-post-with-non-cors-safelisted-content-type.htm": [ - [ - "/XMLHttpRequest/access-control-basic-post-with-non-cors-safelisted-content-type.htm", - {} - ] - ], - "XMLHttpRequest/access-control-basic-preflight-denied.htm": [ - [ - "/XMLHttpRequest/access-control-basic-preflight-denied.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-async-header-denied.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-async-header-denied.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-async-method-denied.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-async-method-denied.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-async-not-supported.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-async-not-supported.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-credential-async.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-credential-async.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-credential-sync.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-credential-sync.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-headers-async.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-headers-async.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-headers-sync.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-headers-sync.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-request-header-lowercase.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-request-header-lowercase.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-request-header-sorted.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-request-header-sorted.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-request-headers-origin.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-request-headers-origin.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-request-invalid-status-301.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-request-invalid-status-301.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-request-invalid-status-400.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-request-invalid-status-400.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-request-invalid-status-501.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-request-invalid-status-501.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-request-must-not-contain-cookie.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-request-must-not-contain-cookie.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-sync-header-denied.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-sync-header-denied.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-sync-method-denied.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-sync-method-denied.htm", - {} - ] - ], - "XMLHttpRequest/access-control-preflight-sync-not-supported.htm": [ - [ - "/XMLHttpRequest/access-control-preflight-sync-not-supported.htm", - {} - ] - ], - "XMLHttpRequest/access-control-recursive-failed-request.htm": [ - [ - "/XMLHttpRequest/access-control-recursive-failed-request.htm", - {} - ] - ], - "XMLHttpRequest/access-control-response-with-body-sync.htm": [ - [ - "/XMLHttpRequest/access-control-response-with-body-sync.htm", - {} - ] - ], - "XMLHttpRequest/access-control-response-with-body.htm": [ - [ - "/XMLHttpRequest/access-control-response-with-body.htm", - {} - ] - ], - "XMLHttpRequest/access-control-response-with-exposed-headers.htm": [ - [ - "/XMLHttpRequest/access-control-response-with-exposed-headers.htm", - {} - ] - ], - "XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm": [ - [ - "/XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm", - {} - ] - ], - "XMLHttpRequest/access-control-sandboxed-iframe-allow.htm": [ - [ - "/XMLHttpRequest/access-control-sandboxed-iframe-allow.htm", - {} - ] - ], - "XMLHttpRequest/access-control-sandboxed-iframe-denied-without-wildcard.htm": [ - [ - "/XMLHttpRequest/access-control-sandboxed-iframe-denied-without-wildcard.htm", - {} - ] - ], - "XMLHttpRequest/access-control-sandboxed-iframe-denied.htm": [ - [ - "/XMLHttpRequest/access-control-sandboxed-iframe-denied.htm", - {} - ] - ], - "XMLHttpRequest/allow-lists-starting-with-comma.htm": [ - [ - "/XMLHttpRequest/allow-lists-starting-with-comma.htm", - {} - ] - ], - "XMLHttpRequest/anonymous-mode-unsupported.htm": [ - [ - "/XMLHttpRequest/anonymous-mode-unsupported.htm", - {} - ] - ], - "XMLHttpRequest/data-uri.htm": [ - [ - "/XMLHttpRequest/data-uri.htm", - {} - ] - ], - "XMLHttpRequest/event-abort.htm": [ - [ - "/XMLHttpRequest/event-abort.htm", - {} - ] - ], - "XMLHttpRequest/event-error-order.sub.html": [ - [ - "/XMLHttpRequest/event-error-order.sub.html", - {} - ] - ], - "XMLHttpRequest/event-error.sub.html": [ - [ - "/XMLHttpRequest/event-error.sub.html", - {} - ] - ], - "XMLHttpRequest/event-load.htm": [ - [ - "/XMLHttpRequest/event-load.htm", - {} - ] - ], - "XMLHttpRequest/event-loadend.htm": [ - [ - "/XMLHttpRequest/event-loadend.htm", - {} - ] - ], - "XMLHttpRequest/event-loadstart-upload.htm": [ - [ - "/XMLHttpRequest/event-loadstart-upload.htm", - {} - ] - ], - "XMLHttpRequest/event-loadstart.htm": [ - [ - "/XMLHttpRequest/event-loadstart.htm", - {} - ] - ], - "XMLHttpRequest/event-progress.htm": [ - [ - "/XMLHttpRequest/event-progress.htm", - {} - ] - ], - "XMLHttpRequest/event-readystate-sync-open.htm": [ - [ - "/XMLHttpRequest/event-readystate-sync-open.htm", - {} - ] - ], - "XMLHttpRequest/event-readystatechange-loaded.htm": [ - [ - "/XMLHttpRequest/event-readystatechange-loaded.htm", - {} - ] - ], - "XMLHttpRequest/event-timeout-order.htm": [ - [ - "/XMLHttpRequest/event-timeout-order.htm", - {} - ] - ], - "XMLHttpRequest/event-timeout.htm": [ - [ - "/XMLHttpRequest/event-timeout.htm", - {} - ] - ], - "XMLHttpRequest/event-upload-progress-crossorigin.htm": [ - [ - "/XMLHttpRequest/event-upload-progress-crossorigin.htm", - {} - ] - ], - "XMLHttpRequest/event-upload-progress.htm": [ - [ - "/XMLHttpRequest/event-upload-progress.htm", - {} - ] - ], - "XMLHttpRequest/firing-events-http-content-length.html": [ - [ - "/XMLHttpRequest/firing-events-http-content-length.html", - {} - ] - ], - "XMLHttpRequest/firing-events-http-no-content-length.html": [ - [ - "/XMLHttpRequest/firing-events-http-no-content-length.html", - {} - ] - ], - "XMLHttpRequest/formdata-blob.htm": [ - [ - "/XMLHttpRequest/formdata-blob.htm", - {} - ] - ], - "XMLHttpRequest/formdata-delete.htm": [ - [ - "/XMLHttpRequest/formdata-delete.htm", - {} - ] - ], - "XMLHttpRequest/formdata-foreach.html": [ - [ - "/XMLHttpRequest/formdata-foreach.html", - {} - ] - ], - "XMLHttpRequest/formdata-get.htm": [ - [ - "/XMLHttpRequest/formdata-get.htm", - {} - ] - ], - "XMLHttpRequest/formdata-has.htm": [ - [ - "/XMLHttpRequest/formdata-has.htm", - {} - ] - ], - "XMLHttpRequest/formdata-set.htm": [ - [ - "/XMLHttpRequest/formdata-set.htm", - {} - ] - ], - "XMLHttpRequest/formdata.htm": [ - [ - "/XMLHttpRequest/formdata.htm", - {} - ] - ], - "XMLHttpRequest/getallresponseheaders-cookies.htm": [ - [ - "/XMLHttpRequest/getallresponseheaders-cookies.htm", - {} - ] - ], - "XMLHttpRequest/getallresponseheaders-status.htm": [ - [ - "/XMLHttpRequest/getallresponseheaders-status.htm", - {} - ] - ], - "XMLHttpRequest/getallresponseheaders.htm": [ - [ - "/XMLHttpRequest/getallresponseheaders.htm", - {} - ] - ], - "XMLHttpRequest/getresponseheader-case-insensitive.htm": [ - [ - "/XMLHttpRequest/getresponseheader-case-insensitive.htm", - {} - ] - ], - "XMLHttpRequest/getresponseheader-chunked-trailer.htm": [ - [ - "/XMLHttpRequest/getresponseheader-chunked-trailer.htm", - {} - ] - ], - "XMLHttpRequest/getresponseheader-cookies-and-more.htm": [ - [ - "/XMLHttpRequest/getresponseheader-cookies-and-more.htm", - {} - ] - ], - "XMLHttpRequest/getresponseheader-error-state.htm": [ - [ - "/XMLHttpRequest/getresponseheader-error-state.htm", - {} - ] - ], - "XMLHttpRequest/getresponseheader-server-date.htm": [ - [ - "/XMLHttpRequest/getresponseheader-server-date.htm", - {} - ] - ], - "XMLHttpRequest/getresponseheader-special-characters.htm": [ - [ - "/XMLHttpRequest/getresponseheader-special-characters.htm", - {} - ] - ], - "XMLHttpRequest/getresponseheader-unsent-opened-state.htm": [ - [ - "/XMLHttpRequest/getresponseheader-unsent-opened-state.htm", - {} - ] - ], - "XMLHttpRequest/headers-normalize-response.htm": [ - [ - "/XMLHttpRequest/headers-normalize-response.htm", - {} - ] - ], - "XMLHttpRequest/historical.html": [ - [ - "/XMLHttpRequest/historical.html", - {} - ] - ], - "XMLHttpRequest/interfaces.html": [ - [ - "/XMLHttpRequest/interfaces.html", - {} - ] - ], - "XMLHttpRequest/loadstart-and-state.html": [ - [ - "/XMLHttpRequest/loadstart-and-state.html", - {} - ] - ], - "XMLHttpRequest/no-utf16-json.htm": [ - [ - "/XMLHttpRequest/no-utf16-json.htm", - {} - ] - ], - "XMLHttpRequest/open-after-abort.htm": [ - [ - "/XMLHttpRequest/open-after-abort.htm", - {} - ] - ], - "XMLHttpRequest/open-after-setrequestheader.htm": [ - [ - "/XMLHttpRequest/open-after-setrequestheader.htm", - {} - ] - ], - "XMLHttpRequest/open-during-abort-event.htm": [ - [ - "/XMLHttpRequest/open-during-abort-event.htm", - {} - ] - ], - "XMLHttpRequest/open-during-abort-processing.htm": [ - [ - "/XMLHttpRequest/open-during-abort-processing.htm", - {} - ] - ], - "XMLHttpRequest/open-during-abort.htm": [ - [ - "/XMLHttpRequest/open-during-abort.htm", - {} - ] - ], - "XMLHttpRequest/open-method-bogus.htm": [ - [ - "/XMLHttpRequest/open-method-bogus.htm", - {} - ] - ], - "XMLHttpRequest/open-method-case-insensitive.htm": [ - [ - "/XMLHttpRequest/open-method-case-insensitive.htm", - {} - ] - ], - "XMLHttpRequest/open-method-case-sensitive.htm": [ - [ - "/XMLHttpRequest/open-method-case-sensitive.htm", - {} - ] - ], - "XMLHttpRequest/open-method-insecure.htm": [ - [ - "/XMLHttpRequest/open-method-insecure.htm", - {} - ] - ], - "XMLHttpRequest/open-method-responsetype-set-sync.htm": [ - [ - "/XMLHttpRequest/open-method-responsetype-set-sync.htm", - {} - ] - ], - "XMLHttpRequest/open-open-send.htm": [ - [ - "/XMLHttpRequest/open-open-send.htm", - {} - ] - ], - "XMLHttpRequest/open-open-sync-send.htm": [ - [ - "/XMLHttpRequest/open-open-sync-send.htm", - {} - ] - ], - "XMLHttpRequest/open-referer.htm": [ - [ - "/XMLHttpRequest/open-referer.htm", - {} - ] - ], - "XMLHttpRequest/open-send-during-abort.htm": [ - [ - "/XMLHttpRequest/open-send-during-abort.htm", - {} - ] - ], - "XMLHttpRequest/open-send-open.htm": [ - [ - "/XMLHttpRequest/open-send-open.htm", - {} - ] - ], - "XMLHttpRequest/open-sync-open-send.htm": [ - [ - "/XMLHttpRequest/open-sync-open-send.htm", - {} - ] - ], - "XMLHttpRequest/open-url-about-blank-window.htm": [ - [ - "/XMLHttpRequest/open-url-about-blank-window.htm", - {} - ] - ], - "XMLHttpRequest/open-url-base-inserted-after-open.htm": [ - [ - "/XMLHttpRequest/open-url-base-inserted-after-open.htm", - {} - ] - ], - "XMLHttpRequest/open-url-base-inserted.htm": [ - [ - "/XMLHttpRequest/open-url-base-inserted.htm", - {} - ] - ], - "XMLHttpRequest/open-url-base.htm": [ - [ - "/XMLHttpRequest/open-url-base.htm", - {} - ] - ], - "XMLHttpRequest/open-url-encoding.htm": [ - [ - "/XMLHttpRequest/open-url-encoding.htm", - {} - ] - ], - "XMLHttpRequest/open-url-fragment.htm": [ - [ - "/XMLHttpRequest/open-url-fragment.htm", - {} - ] - ], - "XMLHttpRequest/open-url-javascript-window-2.htm": [ - [ - "/XMLHttpRequest/open-url-javascript-window-2.htm", - {} - ] - ], - "XMLHttpRequest/open-url-javascript-window.htm": [ - [ - "/XMLHttpRequest/open-url-javascript-window.htm", - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-2.htm": [ - [ - "/XMLHttpRequest/open-url-multi-window-2.htm", - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-3.htm": [ - [ - "/XMLHttpRequest/open-url-multi-window-3.htm", - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-4.htm": [ - [ - "/XMLHttpRequest/open-url-multi-window-4.htm", - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-5.htm": [ - [ - "/XMLHttpRequest/open-url-multi-window-5.htm", - {} - ] - ], - "XMLHttpRequest/open-url-multi-window-6.htm": [ - [ - "/XMLHttpRequest/open-url-multi-window-6.htm", - {} - ] - ], - "XMLHttpRequest/open-url-multi-window.htm": [ - [ - "/XMLHttpRequest/open-url-multi-window.htm", - {} - ] - ], - "XMLHttpRequest/open-url-redirected-worker-origin.htm": [ - [ - "/XMLHttpRequest/open-url-redirected-worker-origin.htm", - {} - ] - ], - "XMLHttpRequest/open-url-worker-origin.htm": [ - [ - "/XMLHttpRequest/open-url-worker-origin.htm", - {} - ] - ], - "XMLHttpRequest/open-url-worker-simple.htm": [ - [ - "/XMLHttpRequest/open-url-worker-simple.htm", - {} - ] - ], - "XMLHttpRequest/open-user-password-non-same-origin.htm": [ - [ - "/XMLHttpRequest/open-user-password-non-same-origin.htm", - {} - ] - ], - "XMLHttpRequest/overridemimetype-blob.html": [ - [ - "/XMLHttpRequest/overridemimetype-blob.html", - {} - ] - ], - "XMLHttpRequest/overridemimetype-done-state.htm": [ - [ - "/XMLHttpRequest/overridemimetype-done-state.htm", - {} - ] - ], - "XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis.htm": [ - [ - "/XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis.htm", - {} - ] - ], - "XMLHttpRequest/overridemimetype-invalid-mime-type.htm": [ - [ - "/XMLHttpRequest/overridemimetype-invalid-mime-type.htm", - {} - ] - ], - "XMLHttpRequest/overridemimetype-loading-state.htm": [ - [ - "/XMLHttpRequest/overridemimetype-loading-state.htm", - {} - ] - ], - "XMLHttpRequest/overridemimetype-open-state-force-utf-8.htm": [ - [ - "/XMLHttpRequest/overridemimetype-open-state-force-utf-8.htm", - {} - ] - ], - "XMLHttpRequest/overridemimetype-open-state-force-xml.htm": [ - [ - "/XMLHttpRequest/overridemimetype-open-state-force-xml.htm", - {} - ] - ], - "XMLHttpRequest/overridemimetype-unsent-state-force-shiftjis.htm": [ - [ - "/XMLHttpRequest/overridemimetype-unsent-state-force-shiftjis.htm", - {} - ] - ], - "XMLHttpRequest/preserve-ua-header-on-redirect.htm": [ - [ - "/XMLHttpRequest/preserve-ua-header-on-redirect.htm", - {} - ] - ], - "XMLHttpRequest/progress-events-response-data-gzip.htm": [ - [ - "/XMLHttpRequest/progress-events-response-data-gzip.htm", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/progressevent-constructor.html": [ - [ - "/XMLHttpRequest/progressevent-constructor.html", - {} - ] - ], - "XMLHttpRequest/progressevent-interface.html": [ - [ - "/XMLHttpRequest/progressevent-interface.html", - {} - ] - ], - "XMLHttpRequest/response-data-arraybuffer.htm": [ - [ - "/XMLHttpRequest/response-data-arraybuffer.htm", - {} - ] - ], - "XMLHttpRequest/response-data-blob.htm": [ - [ - "/XMLHttpRequest/response-data-blob.htm", - {} - ] - ], - "XMLHttpRequest/response-data-deflate.htm": [ - [ - "/XMLHttpRequest/response-data-deflate.htm", - {} - ] - ], - "XMLHttpRequest/response-data-gzip.htm": [ - [ - "/XMLHttpRequest/response-data-gzip.htm", - {} - ] - ], - "XMLHttpRequest/response-data-progress.htm": [ - [ - "/XMLHttpRequest/response-data-progress.htm", - {} - ] - ], - "XMLHttpRequest/response-invalid-responsetype.htm": [ - [ - "/XMLHttpRequest/response-invalid-responsetype.htm", - {} - ] - ], - "XMLHttpRequest/response-json.htm": [ - [ - "/XMLHttpRequest/response-json.htm", - {} - ] - ], - "XMLHttpRequest/response-method.htm": [ - [ - "/XMLHttpRequest/response-method.htm", - {} - ] - ], - "XMLHttpRequest/responseText-status.html": [ - [ - "/XMLHttpRequest/responseText-status.html", - {} - ] - ], - "XMLHttpRequest/responseType-document-in-worker.html": [ - [ - "/XMLHttpRequest/responseType-document-in-worker.html", - {} - ] - ], - "XMLHttpRequest/responseXML-unavailable-in-worker.html": [ - [ - "/XMLHttpRequest/responseXML-unavailable-in-worker.html", - {} - ] - ], - "XMLHttpRequest/responsedocument-decoding.htm": [ - [ - "/XMLHttpRequest/responsedocument-decoding.htm", - {} - ] - ], - "XMLHttpRequest/responsetext-decoding.htm": [ - [ - "/XMLHttpRequest/responsetext-decoding.htm", - {} - ] - ], - "XMLHttpRequest/responsetype.html": [ - [ - "/XMLHttpRequest/responsetype.html", - {} - ] - ], - "XMLHttpRequest/responseurl.html": [ - [ - "/XMLHttpRequest/responseurl.html", - {} - ] - ], - "XMLHttpRequest/responsexml-basic.htm": [ - [ - "/XMLHttpRequest/responsexml-basic.htm", - {} - ] - ], - "XMLHttpRequest/responsexml-document-properties.htm": [ - [ - "/XMLHttpRequest/responsexml-document-properties.htm", - {} - ] - ], - "XMLHttpRequest/responsexml-get-twice.htm": [ - [ - "/XMLHttpRequest/responsexml-get-twice.htm", - {} - ] - ], - "XMLHttpRequest/responsexml-media-type.htm": [ - [ - "/XMLHttpRequest/responsexml-media-type.htm", - {} - ] - ], - "XMLHttpRequest/responsexml-non-document-types.htm": [ - [ - "/XMLHttpRequest/responsexml-non-document-types.htm", - {} - ] - ], - "XMLHttpRequest/responsexml-non-well-formed.htm": [ - [ - "/XMLHttpRequest/responsexml-non-well-formed.htm", - {} - ] - ], - "XMLHttpRequest/security-consideration.sub.html": [ - [ - "/XMLHttpRequest/security-consideration.sub.html", - {} - ] - ], - "XMLHttpRequest/send-accept-language.htm": [ - [ - "/XMLHttpRequest/send-accept-language.htm", - {} - ] - ], - "XMLHttpRequest/send-accept.htm": [ - [ - "/XMLHttpRequest/send-accept.htm", - {} - ] - ], - "XMLHttpRequest/send-after-setting-document-domain.htm": [ - [ - "/XMLHttpRequest/send-after-setting-document-domain.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm": [ - [ - "/XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-basic-cors.htm": [ - [ - "/XMLHttpRequest/send-authentication-basic-cors.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-basic-repeat-no-args.htm": [ - [ - "/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-basic-setrequestheader-and-arguments.htm": [ - [ - "/XMLHttpRequest/send-authentication-basic-setrequestheader-and-arguments.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-basic-setrequestheader-existing-session.htm": [ - [ - "/XMLHttpRequest/send-authentication-basic-setrequestheader-existing-session.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-basic-setrequestheader.htm": [ - [ - "/XMLHttpRequest/send-authentication-basic-setrequestheader.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-basic.htm": [ - [ - "/XMLHttpRequest/send-authentication-basic.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-competing-names-passwords.htm": [ - [ - "/XMLHttpRequest/send-authentication-competing-names-passwords.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-cors-basic-setrequestheader.htm": [ - [ - "/XMLHttpRequest/send-authentication-cors-basic-setrequestheader.htm", - {} - ] - ], - "XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred.htm": [ - [ - "/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred.htm", - {} - ] - ], - "XMLHttpRequest/send-blob-with-no-mime-type.html": [ - [ - "/XMLHttpRequest/send-blob-with-no-mime-type.html", - {} - ] - ], - "XMLHttpRequest/send-conditional-cors.htm": [ - [ - "/XMLHttpRequest/send-conditional-cors.htm", - {} - ] - ], - "XMLHttpRequest/send-conditional.htm": [ - [ - "/XMLHttpRequest/send-conditional.htm", - {} - ] - ], - "XMLHttpRequest/send-content-type-charset.htm": [ - [ - "/XMLHttpRequest/send-content-type-charset.htm", - {} - ] - ], - "XMLHttpRequest/send-content-type-string.htm": [ - [ - "/XMLHttpRequest/send-content-type-string.htm", - {} - ] - ], - "XMLHttpRequest/send-data-arraybuffer.htm": [ - [ - "/XMLHttpRequest/send-data-arraybuffer.htm", - {} - ] - ], - "XMLHttpRequest/send-data-arraybufferview.htm": [ - [ - "/XMLHttpRequest/send-data-arraybufferview.htm", - {} - ] - ], - "XMLHttpRequest/send-data-blob.htm": [ - [ - "/XMLHttpRequest/send-data-blob.htm", - {} - ] - ], - "XMLHttpRequest/send-data-es-object.htm": [ - [ - "/XMLHttpRequest/send-data-es-object.htm", - {} - ] - ], - "XMLHttpRequest/send-data-formdata.htm": [ - [ - "/XMLHttpRequest/send-data-formdata.htm", - {} - ] - ], - "XMLHttpRequest/send-data-unexpected-tostring.htm": [ - [ - "/XMLHttpRequest/send-data-unexpected-tostring.htm", - {} - ] - ], - "XMLHttpRequest/send-entity-body-basic.htm": [ - [ - "/XMLHttpRequest/send-entity-body-basic.htm", - {} - ] - ], - "XMLHttpRequest/send-entity-body-document-bogus.htm": [ - [ - "/XMLHttpRequest/send-entity-body-document-bogus.htm", - {} - ] - ], - "XMLHttpRequest/send-entity-body-document.htm": [ - [ - "/XMLHttpRequest/send-entity-body-document.htm", - {} - ] - ], - "XMLHttpRequest/send-entity-body-empty.htm": [ - [ - "/XMLHttpRequest/send-entity-body-empty.htm", - {} - ] - ], - "XMLHttpRequest/send-entity-body-get-head-async.htm": [ - [ - "/XMLHttpRequest/send-entity-body-get-head-async.htm", - {} - ] - ], - "XMLHttpRequest/send-entity-body-get-head.htm": [ - [ - "/XMLHttpRequest/send-entity-body-get-head.htm", - {} - ] - ], - "XMLHttpRequest/send-entity-body-none.htm": [ - [ - "/XMLHttpRequest/send-entity-body-none.htm", - {} - ] - ], - "XMLHttpRequest/send-network-error-async-events.sub.htm": [ - [ - "/XMLHttpRequest/send-network-error-async-events.sub.htm", - {} - ] - ], - "XMLHttpRequest/send-network-error-sync-events.sub.htm": [ - [ - "/XMLHttpRequest/send-network-error-sync-events.sub.htm", - {} - ] - ], - "XMLHttpRequest/send-no-response-event-loadend.htm": [ - [ - "/XMLHttpRequest/send-no-response-event-loadend.htm", - {} - ] - ], - "XMLHttpRequest/send-no-response-event-loadstart.htm": [ - [ - "/XMLHttpRequest/send-no-response-event-loadstart.htm", - {} - ] - ], - "XMLHttpRequest/send-no-response-event-order.htm": [ - [ - "/XMLHttpRequest/send-no-response-event-order.htm", - {} - ] - ], - "XMLHttpRequest/send-non-same-origin.htm": [ - [ - "/XMLHttpRequest/send-non-same-origin.htm", - {} - ] - ], - "XMLHttpRequest/send-receive-utf16.htm": [ - [ - "/XMLHttpRequest/send-receive-utf16.htm", - {} - ] - ], - "XMLHttpRequest/send-redirect-bogus-sync.htm": [ - [ - "/XMLHttpRequest/send-redirect-bogus-sync.htm", - {} - ] - ], - "XMLHttpRequest/send-redirect-bogus.htm": [ - [ - "/XMLHttpRequest/send-redirect-bogus.htm", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/send-redirect-infinite-sync.htm": [ - [ - "/XMLHttpRequest/send-redirect-infinite-sync.htm", - {} - ] - ], - "XMLHttpRequest/send-redirect-infinite.htm": [ - [ - "/XMLHttpRequest/send-redirect-infinite.htm", - {} - ] - ], - "XMLHttpRequest/send-redirect-no-location.htm": [ - [ - "/XMLHttpRequest/send-redirect-no-location.htm", - {} - ] - ], - "XMLHttpRequest/send-redirect-post-upload.htm": [ - [ - "/XMLHttpRequest/send-redirect-post-upload.htm", - {} - ] - ], - "XMLHttpRequest/send-redirect-to-cors.htm": [ - [ - "/XMLHttpRequest/send-redirect-to-cors.htm", - {} - ] - ], - "XMLHttpRequest/send-redirect-to-non-cors.htm": [ - [ - "/XMLHttpRequest/send-redirect-to-non-cors.htm", - {} - ] - ], - "XMLHttpRequest/send-redirect.htm": [ - [ - "/XMLHttpRequest/send-redirect.htm", - {} - ] - ], - "XMLHttpRequest/send-response-event-order.htm": [ - [ - "/XMLHttpRequest/send-response-event-order.htm", - {} - ] - ], - "XMLHttpRequest/send-response-upload-event-loadend.htm": [ - [ - "/XMLHttpRequest/send-response-upload-event-loadend.htm", - {} - ] - ], - "XMLHttpRequest/send-response-upload-event-loadstart.htm": [ - [ - "/XMLHttpRequest/send-response-upload-event-loadstart.htm", - {} - ] - ], - "XMLHttpRequest/send-response-upload-event-progress.htm": [ - [ - "/XMLHttpRequest/send-response-upload-event-progress.htm", - {} - ] - ], - "XMLHttpRequest/send-send.htm": [ - [ - "/XMLHttpRequest/send-send.htm", - {} - ] - ], - "XMLHttpRequest/send-send.worker.js": [ - [ - "/XMLHttpRequest/send-send.worker.html", - {} - ] - ], - "XMLHttpRequest/send-sync-blocks-async.htm": [ - [ - "/XMLHttpRequest/send-sync-blocks-async.htm", - {} - ] - ], - "XMLHttpRequest/send-sync-no-response-event-load.htm": [ - [ - "/XMLHttpRequest/send-sync-no-response-event-load.htm", - {} - ] - ], - "XMLHttpRequest/send-sync-no-response-event-loadend.htm": [ - [ - "/XMLHttpRequest/send-sync-no-response-event-loadend.htm", - {} - ] - ], - "XMLHttpRequest/send-sync-no-response-event-order.htm": [ - [ - "/XMLHttpRequest/send-sync-no-response-event-order.htm", - {} - ] - ], - "XMLHttpRequest/send-sync-response-event-order.htm": [ - [ - "/XMLHttpRequest/send-sync-response-event-order.htm", - {} - ] - ], - "XMLHttpRequest/send-sync-timeout.htm": [ - [ - "/XMLHttpRequest/send-sync-timeout.htm", - {} - ] - ], - "XMLHttpRequest/send-timeout-events.htm": [ - [ - "/XMLHttpRequest/send-timeout-events.htm", - {} - ] - ], - "XMLHttpRequest/send-usp.any.js": [ - [ - "/XMLHttpRequest/send-usp.any.html", - {} - ], - [ - "/XMLHttpRequest/send-usp.any.worker.html", - {} - ] - ], - "XMLHttpRequest/setrequestheader-after-send.htm": [ - [ - "/XMLHttpRequest/setrequestheader-after-send.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-allow-empty-value.htm": [ - [ - "/XMLHttpRequest/setrequestheader-allow-empty-value.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-allow-whitespace-in-value.htm": [ - [ - "/XMLHttpRequest/setrequestheader-allow-whitespace-in-value.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-before-open.htm": [ - [ - "/XMLHttpRequest/setrequestheader-before-open.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-bogus-name.htm": [ - [ - "/XMLHttpRequest/setrequestheader-bogus-name.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-bogus-value.htm": [ - [ - "/XMLHttpRequest/setrequestheader-bogus-value.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-case-insensitive.htm": [ - [ - "/XMLHttpRequest/setrequestheader-case-insensitive.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-content-type.htm": [ - [ - "/XMLHttpRequest/setrequestheader-content-type.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-header-allowed.htm": [ - [ - "/XMLHttpRequest/setrequestheader-header-allowed.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-header-forbidden.htm": [ - [ - "/XMLHttpRequest/setrequestheader-header-forbidden.htm", - {} - ] - ], - "XMLHttpRequest/setrequestheader-open-setrequestheader.htm": [ - [ - "/XMLHttpRequest/setrequestheader-open-setrequestheader.htm", - {} - ] - ], - "XMLHttpRequest/status-async.htm": [ - [ - "/XMLHttpRequest/status-async.htm", - {} - ] - ], - "XMLHttpRequest/status-basic.htm": [ - [ - "/XMLHttpRequest/status-basic.htm", - {} - ] - ], - "XMLHttpRequest/status-error.htm": [ - [ - "/XMLHttpRequest/status-error.htm", - {} - ] - ], - "XMLHttpRequest/template-element.html": [ - [ - "/XMLHttpRequest/template-element.html", - {} - ] - ], - "XMLHttpRequest/timeout-cors-async.htm": [ - [ - "/XMLHttpRequest/timeout-cors-async.htm", - {} - ] - ], - "XMLHttpRequest/timeout-multiple-fetches.html": [ - [ - "/XMLHttpRequest/timeout-multiple-fetches.html", - {} - ] - ], - "XMLHttpRequest/timeout-sync.htm": [ - [ - "/XMLHttpRequest/timeout-sync.htm", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-basic.htm": [ - [ - "/XMLHttpRequest/xmlhttprequest-basic.htm", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-eventtarget.htm": [ - [ - "/XMLHttpRequest/xmlhttprequest-eventtarget.htm", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-network-error-sync.htm": [ - [ - "/XMLHttpRequest/xmlhttprequest-network-error-sync.htm", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-network-error.htm": [ - [ - "/XMLHttpRequest/xmlhttprequest-network-error.htm", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts.html", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-sync-block-scripts.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-sync-block-scripts.html", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html", - {} - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-aborted.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-aborted.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-abortedonmain.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-abortedonmain.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-overrides.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-overrides.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-overridesexpires.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-overridesexpires.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-reused.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-reused.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-simple.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-simple.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-synconmain.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-synconmain.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-twice.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-twice.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-aborted.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-worker-aborted.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-overrides.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-worker-overrides.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-overridesexpires.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-worker-overridesexpires.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-simple.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-worker-simple.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-synconworker.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-worker-synconworker.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-twice.html": [ - [ - "/XMLHttpRequest/xmlhttprequest-timeout-worker-twice.html", - { - "timeout": "long" - } - ] - ], - "XMLHttpRequest/xmlhttprequest-unsent.htm": [ - [ - "/XMLHttpRequest/xmlhttprequest-unsent.htm", - {} - ] - ], "accelerometer/Accelerometer-disabled-by-feature-policy.https.html": [ [ "/accelerometer/Accelerometer-disabled-by-feature-policy.https.html", @@ -170526,6 +169167,42 @@ {} ] ], + "css/css-typed-om/stylevalue-objects/interface.html": [ + [ + "/css/css-typed-om/stylevalue-objects/interface.html", + {} + ] + ], + "css/css-typed-om/stylevalue-objects/parse-invalid.html": [ + [ + "/css/css-typed-om/stylevalue-objects/parse-invalid.html", + {} + ] + ], + "css/css-typed-om/stylevalue-objects/parse.html": [ + [ + "/css/css-typed-om/stylevalue-objects/parse.html", + {} + ] + ], + "css/css-typed-om/stylevalue-objects/parseAll-invalid.html": [ + [ + "/css/css-typed-om/stylevalue-objects/parseAll-invalid.html", + {} + ] + ], + "css/css-typed-om/stylevalue-objects/parseAll.html": [ + [ + "/css/css-typed-om/stylevalue-objects/parseAll.html", + {} + ] + ], + "css/css-typed-om/stylevalue-subclasses/cssKeywordValue-interface.html": [ + [ + "/css/css-typed-om/stylevalue-subclasses/cssKeywordValue-interface.html", + {} + ] + ], "css/css-ui/box-sizing-027.html": [ [ "/css/css-ui/box-sizing-027.html", @@ -170592,6 +169269,18 @@ {} ] ], + "css/css-values/calc-in-color-001.html": [ + [ + "/css/css-values/calc-in-color-001.html", + {} + ] + ], + "css/css-values/calc-serialization.html": [ + [ + "/css/css-values/calc-serialization.html", + {} + ] + ], "css/css-values/calc-unit-analysis.html": [ [ "/css/css-values/calc-unit-analysis.html", @@ -172410,12 +171099,24 @@ {} ] ], + "css/selectors/invalidation/matches.html": [ + [ + "/css/selectors/invalidation/matches.html", + {} + ] + ], "css/selectors/missing-right-token.html": [ [ "/css/selectors/missing-right-token.html", {} ] ], + "css/selectors/user-invalid.html": [ + [ + "/css/selectors/user-invalid.html", + {} + ] + ], "custom-elements/CustomElementRegistry.html": [ [ "/custom-elements/CustomElementRegistry.html", @@ -177706,6 +176407,30 @@ {} ] ], + "fetch/api/request/destination/fetch-destination-iframe.https.html": [ + [ + "/fetch/api/request/destination/fetch-destination-iframe.https.html", + {} + ] + ], + "fetch/api/request/destination/fetch-destination-no-load-event.https.html": [ + [ + "/fetch/api/request/destination/fetch-destination-no-load-event.https.html", + {} + ] + ], + "fetch/api/request/destination/fetch-destination-worker.https.html": [ + [ + "/fetch/api/request/destination/fetch-destination-worker.https.html", + {} + ] + ], + "fetch/api/request/destination/fetch-destination.https.html": [ + [ + "/fetch/api/request/destination/fetch-destination.https.html", + {} + ] + ], "fetch/api/request/multi-globals/url-parsing.html": [ [ "/fetch/api/request/multi-globals/url-parsing.html", @@ -181982,6 +180707,12 @@ {} ] ], + "html/semantics/document-metadata/the-style-element/style_load_async.html": [ + [ + "/html/semantics/document-metadata/the-style-element/style_load_async.html", + {} + ] + ], "html/semantics/document-metadata/the-style-element/style_media.html": [ [ "/html/semantics/document-metadata/the-style-element/style_media.html", @@ -182962,6 +181693,102 @@ {} ] ], + "html/semantics/embedded-content/media-elements/track/track-element/track-disabled-addcue.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-disabled-addcue.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-disabled.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-disabled.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-element-dom-change.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-element-dom-change.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change-error.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change-error.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-id.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-id.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-insert-after-load.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-insert-after-load.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-large-timestamp.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-large-timestamp.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-load-error-readyState.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-load-error-readyState.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-load-from-element-readyState.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-load-from-element-readyState.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-load-from-src-readyState.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-load-from-src-readyState.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-mode-disabled.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-mode-disabled.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-mode-not-changed-by-new-track.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-mode-not-changed-by-new-track.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-mode-triggers-loading.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-mode-triggers-loading.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-mode.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-mode.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-node-add-remove.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-node-add-remove.html", + {} + ] + ], "html/semantics/embedded-content/media-elements/track/track-element/track-remove-active-cue.html": [ [ "/html/semantics/embedded-content/media-elements/track/track-element/track-remove-active-cue.html", @@ -182992,6 +181819,24 @@ {} ] ], + "html/semantics/embedded-content/media-elements/track/track-element/track-selection-metadata.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-selection-metadata.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-text-track-cue-list.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-text-track-cue-list.html", + {} + ] + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-texttracks.html": [ + [ + "/html/semantics/embedded-content/media-elements/track/track-element/track-texttracks.html", + {} + ] + ], "html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-align-positioning.html": [ [ "/html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-align-positioning.html", @@ -186874,6 +185719,18 @@ {} ] ], + "html/semantics/scripting-1/the-script-element/module/duplicated-imports-1.html": [ + [ + "/html/semantics/scripting-1/the-script-element/module/duplicated-imports-1.html", + {} + ] + ], + "html/semantics/scripting-1/the-script-element/module/duplicated-imports-2.html": [ + [ + "/html/semantics/scripting-1/the-script-element/module/duplicated-imports-2.html", + {} + ] + ], "html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-fetch-error.sub.html": [ [ "/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-fetch-error.sub.html", @@ -201938,12 +200795,6 @@ {} ] ], - "preload/fetch-destination.https.html": [ - [ - "/preload/fetch-destination.https.html", - {} - ] - ], "preload/link-header-on-subresource.html": [ [ "/preload/link-header-on-subresource.html", @@ -202100,59 +200951,59 @@ {} ] ], - "quirks-mode/blocks-ignore-line-height.html": [ + "quirks/blocks-ignore-line-height.html": [ [ - "/quirks-mode/blocks-ignore-line-height.html", + "/quirks/blocks-ignore-line-height.html", {} ] ], - "quirks-mode/classname-query-after-sibling-adoption.html": [ + "quirks/classname-query-after-sibling-adoption.html": [ [ - "/quirks-mode/classname-query-after-sibling-adoption.html", + "/quirks/classname-query-after-sibling-adoption.html", {} ] ], - "quirks-mode/hashless-hex-color.html": [ + "quirks/hashless-hex-color.html": [ [ - "/quirks-mode/hashless-hex-color.html", + "/quirks/hashless-hex-color.html", { "timeout": "long" } ] ], - "quirks-mode/line-height-calculation.html": [ + "quirks/line-height-calculation.html": [ [ - "/quirks-mode/line-height-calculation.html", + "/quirks/line-height-calculation.html", {} ] ], - "quirks-mode/percentage-height-calculation.html": [ + "quirks/percentage-height-calculation.html": [ [ - "/quirks-mode/percentage-height-calculation.html", + "/quirks/percentage-height-calculation.html", {} ] ], - "quirks-mode/supports.html": [ + "quirks/supports.html": [ [ - "/quirks-mode/supports.html", + "/quirks/supports.html", {} ] ], - "quirks-mode/table-cell-nowrap-minimum-width-calculation.html": [ + "quirks/table-cell-nowrap-minimum-width-calculation.html": [ [ - "/quirks-mode/table-cell-nowrap-minimum-width-calculation.html", + "/quirks/table-cell-nowrap-minimum-width-calculation.html", {} ] ], - "quirks-mode/table-cell-width-calculation.html": [ + "quirks/table-cell-width-calculation.html": [ [ - "/quirks-mode/table-cell-width-calculation.html", + "/quirks/table-cell-width-calculation.html", {} ] ], - "quirks-mode/unitless-length.html": [ + "quirks/unitless-length.html": [ [ - "/quirks-mode/unitless-length.html", + "/quirks/unitless-length.html", {} ] ], @@ -211338,6 +210189,12 @@ {} ] ], + "service-workers/service-worker/fetch-event-respond-with-custom-response.https.html": [ + [ + "/service-workers/service-worker/fetch-event-respond-with-custom-response.https.html", + {} + ] + ], "service-workers/service-worker/fetch-event-respond-with-partial-stream.https.html": [ [ "/service-workers/service-worker/fetch-event-respond-with-partial-stream.https.html", @@ -218788,6 +217645,12 @@ {} ] ], + "webvtt/api/VTTCue/constructor-exceptions.html": [ + [ + "/webvtt/api/VTTCue/constructor-exceptions.html", + {} + ] + ], "webvtt/api/VTTCue/constructor.html": [ [ "/webvtt/api/VTTCue/constructor.html", @@ -219190,12 +218053,24 @@ {} ] ], + "workers/SharedWorkerPerformanceNow.html": [ + [ + "/workers/SharedWorkerPerformanceNow.html", + {} + ] + ], "workers/SharedWorker_blobUrl.html": [ [ "/workers/SharedWorker_blobUrl.html", {} ] ], + "workers/SharedWorker_dataUrl.html": [ + [ + "/workers/SharedWorker_dataUrl.html", + {} + ] + ], "workers/WorkerGlobalScope_ErrorEvent_colno.htm": [ [ "/workers/WorkerGlobalScope_ErrorEvent_colno.htm", @@ -219376,6 +218251,12 @@ {} ] ], + "workers/WorkerPerformanceNow.html": [ + [ + "/workers/WorkerPerformanceNow.html", + {} + ] + ], "workers/Worker_ErrorEvent_bubbles_cancelable.htm": [ [ "/workers/Worker_ErrorEvent_bubbles_cancelable.htm", @@ -220353,6 +219234,1708 @@ "/x-frame-options/sameorigin.sub.html", {} ] + ], + "xhr/FormData-append.html": [ + [ + "/xhr/FormData-append.html", + {} + ] + ], + "xhr/XMLHttpRequest-withCredentials.any.js": [ + [ + "/xhr/XMLHttpRequest-withCredentials.any.html", + {} + ], + [ + "/xhr/XMLHttpRequest-withCredentials.any.worker.html", + {} + ] + ], + "xhr/abort-after-receive.htm": [ + [ + "/xhr/abort-after-receive.htm", + {} + ] + ], + "xhr/abort-after-send.htm": [ + [ + "/xhr/abort-after-send.htm", + {} + ] + ], + "xhr/abort-after-stop.htm": [ + [ + "/xhr/abort-after-stop.htm", + {} + ] + ], + "xhr/abort-after-timeout.htm": [ + [ + "/xhr/abort-after-timeout.htm", + {} + ] + ], + "xhr/abort-during-done.htm": [ + [ + "/xhr/abort-during-done.htm", + {} + ] + ], + "xhr/abort-during-headers-received.htm": [ + [ + "/xhr/abort-during-headers-received.htm", + {} + ] + ], + "xhr/abort-during-loading.htm": [ + [ + "/xhr/abort-during-loading.htm", + {} + ] + ], + "xhr/abort-during-open.htm": [ + [ + "/xhr/abort-during-open.htm", + {} + ] + ], + "xhr/abort-during-open.worker.js": [ + [ + "/xhr/abort-during-open.worker.html", + {} + ] + ], + "xhr/abort-during-unsent.htm": [ + [ + "/xhr/abort-during-unsent.htm", + {} + ] + ], + "xhr/abort-during-upload.htm": [ + [ + "/xhr/abort-during-upload.htm", + {} + ] + ], + "xhr/abort-event-abort.htm": [ + [ + "/xhr/abort-event-abort.htm", + {} + ] + ], + "xhr/abort-event-listeners.htm": [ + [ + "/xhr/abort-event-listeners.htm", + {} + ] + ], + "xhr/abort-event-loadend.htm": [ + [ + "/xhr/abort-event-loadend.htm", + {} + ] + ], + "xhr/abort-event-order.htm": [ + [ + "/xhr/abort-event-order.htm", + {} + ] + ], + "xhr/abort-upload-event-abort.htm": [ + [ + "/xhr/abort-upload-event-abort.htm", + {} + ] + ], + "xhr/abort-upload-event-loadend.htm": [ + [ + "/xhr/abort-upload-event-loadend.htm", + {} + ] + ], + "xhr/access-control-and-redirects-async-same-origin.htm": [ + [ + "/xhr/access-control-and-redirects-async-same-origin.htm", + {} + ] + ], + "xhr/access-control-and-redirects-async.htm": [ + [ + "/xhr/access-control-and-redirects-async.htm", + {} + ] + ], + "xhr/access-control-and-redirects.htm": [ + [ + "/xhr/access-control-and-redirects.htm", + {} + ] + ], + "xhr/access-control-basic-allow-access-control-origin-header-data-url.htm": [ + [ + "/xhr/access-control-basic-allow-access-control-origin-header-data-url.htm", + {} + ] + ], + "xhr/access-control-basic-allow-access-control-origin-header.htm": [ + [ + "/xhr/access-control-basic-allow-access-control-origin-header.htm", + {} + ] + ], + "xhr/access-control-basic-allow-async.htm": [ + [ + "/xhr/access-control-basic-allow-async.htm", + {} + ] + ], + "xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm": [ + [ + "/xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm", + {} + ] + ], + "xhr/access-control-basic-allow-non-cors-safelisted-method.htm": [ + [ + "/xhr/access-control-basic-allow-non-cors-safelisted-method.htm", + {} + ] + ], + "xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm": [ + [ + "/xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm", + {} + ] + ], + "xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm": [ + [ + "/xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm", + {} + ] + ], + "xhr/access-control-basic-allow-preflight-cache-timeout.htm": [ + [ + "/xhr/access-control-basic-allow-preflight-cache-timeout.htm", + {} + ] + ], + "xhr/access-control-basic-allow-preflight-cache.htm": [ + [ + "/xhr/access-control-basic-allow-preflight-cache.htm", + {} + ] + ], + "xhr/access-control-basic-allow-star.htm": [ + [ + "/xhr/access-control-basic-allow-star.htm", + {} + ] + ], + "xhr/access-control-basic-allow.htm": [ + [ + "/xhr/access-control-basic-allow.htm", + {} + ] + ], + "xhr/access-control-basic-cors-safelisted-request-headers.htm": [ + [ + "/xhr/access-control-basic-cors-safelisted-request-headers.htm", + {} + ] + ], + "xhr/access-control-basic-cors-safelisted-response-headers.htm": [ + [ + "/xhr/access-control-basic-cors-safelisted-response-headers.htm", + {} + ] + ], + "xhr/access-control-basic-denied.htm": [ + [ + "/xhr/access-control-basic-denied.htm", + {} + ] + ], + "xhr/access-control-basic-get-fail-non-simple.htm": [ + [ + "/xhr/access-control-basic-get-fail-non-simple.htm", + {} + ] + ], + "xhr/access-control-basic-non-cors-safelisted-content-type.htm": [ + [ + "/xhr/access-control-basic-non-cors-safelisted-content-type.htm", + {} + ] + ], + "xhr/access-control-basic-post-success-no-content-type.htm": [ + [ + "/xhr/access-control-basic-post-success-no-content-type.htm", + {} + ] + ], + "xhr/access-control-basic-post-with-non-cors-safelisted-content-type.htm": [ + [ + "/xhr/access-control-basic-post-with-non-cors-safelisted-content-type.htm", + {} + ] + ], + "xhr/access-control-basic-preflight-denied.htm": [ + [ + "/xhr/access-control-basic-preflight-denied.htm", + {} + ] + ], + "xhr/access-control-preflight-async-header-denied.htm": [ + [ + "/xhr/access-control-preflight-async-header-denied.htm", + {} + ] + ], + "xhr/access-control-preflight-async-method-denied.htm": [ + [ + "/xhr/access-control-preflight-async-method-denied.htm", + {} + ] + ], + "xhr/access-control-preflight-async-not-supported.htm": [ + [ + "/xhr/access-control-preflight-async-not-supported.htm", + {} + ] + ], + "xhr/access-control-preflight-credential-async.htm": [ + [ + "/xhr/access-control-preflight-credential-async.htm", + {} + ] + ], + "xhr/access-control-preflight-credential-sync.htm": [ + [ + "/xhr/access-control-preflight-credential-sync.htm", + {} + ] + ], + "xhr/access-control-preflight-headers-async.htm": [ + [ + "/xhr/access-control-preflight-headers-async.htm", + {} + ] + ], + "xhr/access-control-preflight-headers-sync.htm": [ + [ + "/xhr/access-control-preflight-headers-sync.htm", + {} + ] + ], + "xhr/access-control-preflight-request-header-lowercase.htm": [ + [ + "/xhr/access-control-preflight-request-header-lowercase.htm", + {} + ] + ], + "xhr/access-control-preflight-request-header-sorted.htm": [ + [ + "/xhr/access-control-preflight-request-header-sorted.htm", + {} + ] + ], + "xhr/access-control-preflight-request-headers-origin.htm": [ + [ + "/xhr/access-control-preflight-request-headers-origin.htm", + {} + ] + ], + "xhr/access-control-preflight-request-invalid-status-301.htm": [ + [ + "/xhr/access-control-preflight-request-invalid-status-301.htm", + {} + ] + ], + "xhr/access-control-preflight-request-invalid-status-400.htm": [ + [ + "/xhr/access-control-preflight-request-invalid-status-400.htm", + {} + ] + ], + "xhr/access-control-preflight-request-invalid-status-501.htm": [ + [ + "/xhr/access-control-preflight-request-invalid-status-501.htm", + {} + ] + ], + "xhr/access-control-preflight-request-must-not-contain-cookie.htm": [ + [ + "/xhr/access-control-preflight-request-must-not-contain-cookie.htm", + {} + ] + ], + "xhr/access-control-preflight-sync-header-denied.htm": [ + [ + "/xhr/access-control-preflight-sync-header-denied.htm", + {} + ] + ], + "xhr/access-control-preflight-sync-method-denied.htm": [ + [ + "/xhr/access-control-preflight-sync-method-denied.htm", + {} + ] + ], + "xhr/access-control-preflight-sync-not-supported.htm": [ + [ + "/xhr/access-control-preflight-sync-not-supported.htm", + {} + ] + ], + "xhr/access-control-recursive-failed-request.htm": [ + [ + "/xhr/access-control-recursive-failed-request.htm", + {} + ] + ], + "xhr/access-control-response-with-body-sync.htm": [ + [ + "/xhr/access-control-response-with-body-sync.htm", + {} + ] + ], + "xhr/access-control-response-with-body.htm": [ + [ + "/xhr/access-control-response-with-body.htm", + {} + ] + ], + "xhr/access-control-response-with-exposed-headers.htm": [ + [ + "/xhr/access-control-response-with-exposed-headers.htm", + {} + ] + ], + "xhr/access-control-sandboxed-iframe-allow-origin-null.htm": [ + [ + "/xhr/access-control-sandboxed-iframe-allow-origin-null.htm", + {} + ] + ], + "xhr/access-control-sandboxed-iframe-allow.htm": [ + [ + "/xhr/access-control-sandboxed-iframe-allow.htm", + {} + ] + ], + "xhr/access-control-sandboxed-iframe-denied-without-wildcard.htm": [ + [ + "/xhr/access-control-sandboxed-iframe-denied-without-wildcard.htm", + {} + ] + ], + "xhr/access-control-sandboxed-iframe-denied.htm": [ + [ + "/xhr/access-control-sandboxed-iframe-denied.htm", + {} + ] + ], + "xhr/allow-lists-starting-with-comma.htm": [ + [ + "/xhr/allow-lists-starting-with-comma.htm", + {} + ] + ], + "xhr/anonymous-mode-unsupported.htm": [ + [ + "/xhr/anonymous-mode-unsupported.htm", + {} + ] + ], + "xhr/data-uri.htm": [ + [ + "/xhr/data-uri.htm", + {} + ] + ], + "xhr/event-abort.htm": [ + [ + "/xhr/event-abort.htm", + {} + ] + ], + "xhr/event-error-order.sub.html": [ + [ + "/xhr/event-error-order.sub.html", + {} + ] + ], + "xhr/event-error.sub.html": [ + [ + "/xhr/event-error.sub.html", + {} + ] + ], + "xhr/event-load.htm": [ + [ + "/xhr/event-load.htm", + {} + ] + ], + "xhr/event-loadend.htm": [ + [ + "/xhr/event-loadend.htm", + {} + ] + ], + "xhr/event-loadstart-upload.htm": [ + [ + "/xhr/event-loadstart-upload.htm", + {} + ] + ], + "xhr/event-loadstart.htm": [ + [ + "/xhr/event-loadstart.htm", + {} + ] + ], + "xhr/event-progress.htm": [ + [ + "/xhr/event-progress.htm", + {} + ] + ], + "xhr/event-readystate-sync-open.htm": [ + [ + "/xhr/event-readystate-sync-open.htm", + {} + ] + ], + "xhr/event-readystatechange-loaded.htm": [ + [ + "/xhr/event-readystatechange-loaded.htm", + {} + ] + ], + "xhr/event-timeout-order.htm": [ + [ + "/xhr/event-timeout-order.htm", + {} + ] + ], + "xhr/event-timeout.htm": [ + [ + "/xhr/event-timeout.htm", + {} + ] + ], + "xhr/event-upload-progress-crossorigin.htm": [ + [ + "/xhr/event-upload-progress-crossorigin.htm", + {} + ] + ], + "xhr/event-upload-progress.htm": [ + [ + "/xhr/event-upload-progress.htm", + {} + ] + ], + "xhr/firing-events-http-content-length.html": [ + [ + "/xhr/firing-events-http-content-length.html", + {} + ] + ], + "xhr/firing-events-http-no-content-length.html": [ + [ + "/xhr/firing-events-http-no-content-length.html", + {} + ] + ], + "xhr/formdata-blob.htm": [ + [ + "/xhr/formdata-blob.htm", + {} + ] + ], + "xhr/formdata-delete.htm": [ + [ + "/xhr/formdata-delete.htm", + {} + ] + ], + "xhr/formdata-foreach.html": [ + [ + "/xhr/formdata-foreach.html", + {} + ] + ], + "xhr/formdata-get.htm": [ + [ + "/xhr/formdata-get.htm", + {} + ] + ], + "xhr/formdata-has.htm": [ + [ + "/xhr/formdata-has.htm", + {} + ] + ], + "xhr/formdata-set.htm": [ + [ + "/xhr/formdata-set.htm", + {} + ] + ], + "xhr/formdata.htm": [ + [ + "/xhr/formdata.htm", + {} + ] + ], + "xhr/getallresponseheaders-cookies.htm": [ + [ + "/xhr/getallresponseheaders-cookies.htm", + {} + ] + ], + "xhr/getallresponseheaders-status.htm": [ + [ + "/xhr/getallresponseheaders-status.htm", + {} + ] + ], + "xhr/getallresponseheaders.htm": [ + [ + "/xhr/getallresponseheaders.htm", + {} + ] + ], + "xhr/getresponseheader-case-insensitive.htm": [ + [ + "/xhr/getresponseheader-case-insensitive.htm", + {} + ] + ], + "xhr/getresponseheader-chunked-trailer.htm": [ + [ + "/xhr/getresponseheader-chunked-trailer.htm", + {} + ] + ], + "xhr/getresponseheader-cookies-and-more.htm": [ + [ + "/xhr/getresponseheader-cookies-and-more.htm", + {} + ] + ], + "xhr/getresponseheader-error-state.htm": [ + [ + "/xhr/getresponseheader-error-state.htm", + {} + ] + ], + "xhr/getresponseheader-server-date.htm": [ + [ + "/xhr/getresponseheader-server-date.htm", + {} + ] + ], + "xhr/getresponseheader-special-characters.htm": [ + [ + "/xhr/getresponseheader-special-characters.htm", + {} + ] + ], + "xhr/getresponseheader-unsent-opened-state.htm": [ + [ + "/xhr/getresponseheader-unsent-opened-state.htm", + {} + ] + ], + "xhr/headers-normalize-response.htm": [ + [ + "/xhr/headers-normalize-response.htm", + {} + ] + ], + "xhr/historical.html": [ + [ + "/xhr/historical.html", + {} + ] + ], + "xhr/interfaces.html": [ + [ + "/xhr/interfaces.html", + {} + ] + ], + "xhr/loadstart-and-state.html": [ + [ + "/xhr/loadstart-and-state.html", + {} + ] + ], + "xhr/no-utf16-json.htm": [ + [ + "/xhr/no-utf16-json.htm", + {} + ] + ], + "xhr/open-after-abort.htm": [ + [ + "/xhr/open-after-abort.htm", + {} + ] + ], + "xhr/open-after-setrequestheader.htm": [ + [ + "/xhr/open-after-setrequestheader.htm", + {} + ] + ], + "xhr/open-during-abort-event.htm": [ + [ + "/xhr/open-during-abort-event.htm", + {} + ] + ], + "xhr/open-during-abort-processing.htm": [ + [ + "/xhr/open-during-abort-processing.htm", + {} + ] + ], + "xhr/open-during-abort.htm": [ + [ + "/xhr/open-during-abort.htm", + {} + ] + ], + "xhr/open-method-bogus.htm": [ + [ + "/xhr/open-method-bogus.htm", + {} + ] + ], + "xhr/open-method-case-insensitive.htm": [ + [ + "/xhr/open-method-case-insensitive.htm", + {} + ] + ], + "xhr/open-method-case-sensitive.htm": [ + [ + "/xhr/open-method-case-sensitive.htm", + {} + ] + ], + "xhr/open-method-insecure.htm": [ + [ + "/xhr/open-method-insecure.htm", + {} + ] + ], + "xhr/open-method-responsetype-set-sync.htm": [ + [ + "/xhr/open-method-responsetype-set-sync.htm", + {} + ] + ], + "xhr/open-open-send.htm": [ + [ + "/xhr/open-open-send.htm", + {} + ] + ], + "xhr/open-open-sync-send.htm": [ + [ + "/xhr/open-open-sync-send.htm", + {} + ] + ], + "xhr/open-referer.htm": [ + [ + "/xhr/open-referer.htm", + {} + ] + ], + "xhr/open-send-during-abort.htm": [ + [ + "/xhr/open-send-during-abort.htm", + {} + ] + ], + "xhr/open-send-open.htm": [ + [ + "/xhr/open-send-open.htm", + {} + ] + ], + "xhr/open-sync-open-send.htm": [ + [ + "/xhr/open-sync-open-send.htm", + {} + ] + ], + "xhr/open-url-about-blank-window.htm": [ + [ + "/xhr/open-url-about-blank-window.htm", + {} + ] + ], + "xhr/open-url-base-inserted-after-open.htm": [ + [ + "/xhr/open-url-base-inserted-after-open.htm", + {} + ] + ], + "xhr/open-url-base-inserted.htm": [ + [ + "/xhr/open-url-base-inserted.htm", + {} + ] + ], + "xhr/open-url-base.htm": [ + [ + "/xhr/open-url-base.htm", + {} + ] + ], + "xhr/open-url-encoding.htm": [ + [ + "/xhr/open-url-encoding.htm", + {} + ] + ], + "xhr/open-url-fragment.htm": [ + [ + "/xhr/open-url-fragment.htm", + {} + ] + ], + "xhr/open-url-javascript-window-2.htm": [ + [ + "/xhr/open-url-javascript-window-2.htm", + {} + ] + ], + "xhr/open-url-javascript-window.htm": [ + [ + "/xhr/open-url-javascript-window.htm", + {} + ] + ], + "xhr/open-url-multi-window-2.htm": [ + [ + "/xhr/open-url-multi-window-2.htm", + {} + ] + ], + "xhr/open-url-multi-window-3.htm": [ + [ + "/xhr/open-url-multi-window-3.htm", + {} + ] + ], + "xhr/open-url-multi-window-4.htm": [ + [ + "/xhr/open-url-multi-window-4.htm", + {} + ] + ], + "xhr/open-url-multi-window-5.htm": [ + [ + "/xhr/open-url-multi-window-5.htm", + {} + ] + ], + "xhr/open-url-multi-window-6.htm": [ + [ + "/xhr/open-url-multi-window-6.htm", + {} + ] + ], + "xhr/open-url-multi-window.htm": [ + [ + "/xhr/open-url-multi-window.htm", + {} + ] + ], + "xhr/open-url-redirected-worker-origin.htm": [ + [ + "/xhr/open-url-redirected-worker-origin.htm", + {} + ] + ], + "xhr/open-url-worker-origin.htm": [ + [ + "/xhr/open-url-worker-origin.htm", + {} + ] + ], + "xhr/open-url-worker-simple.htm": [ + [ + "/xhr/open-url-worker-simple.htm", + {} + ] + ], + "xhr/open-user-password-non-same-origin.htm": [ + [ + "/xhr/open-user-password-non-same-origin.htm", + {} + ] + ], + "xhr/overridemimetype-blob.html": [ + [ + "/xhr/overridemimetype-blob.html", + {} + ] + ], + "xhr/overridemimetype-done-state.htm": [ + [ + "/xhr/overridemimetype-done-state.htm", + {} + ] + ], + "xhr/overridemimetype-headers-received-state-force-shiftjis.htm": [ + [ + "/xhr/overridemimetype-headers-received-state-force-shiftjis.htm", + {} + ] + ], + "xhr/overridemimetype-invalid-mime-type.htm": [ + [ + "/xhr/overridemimetype-invalid-mime-type.htm", + {} + ] + ], + "xhr/overridemimetype-loading-state.htm": [ + [ + "/xhr/overridemimetype-loading-state.htm", + {} + ] + ], + "xhr/overridemimetype-open-state-force-utf-8.htm": [ + [ + "/xhr/overridemimetype-open-state-force-utf-8.htm", + {} + ] + ], + "xhr/overridemimetype-open-state-force-xml.htm": [ + [ + "/xhr/overridemimetype-open-state-force-xml.htm", + {} + ] + ], + "xhr/overridemimetype-unsent-state-force-shiftjis.htm": [ + [ + "/xhr/overridemimetype-unsent-state-force-shiftjis.htm", + {} + ] + ], + "xhr/preserve-ua-header-on-redirect.htm": [ + [ + "/xhr/preserve-ua-header-on-redirect.htm", + {} + ] + ], + "xhr/progress-events-response-data-gzip.htm": [ + [ + "/xhr/progress-events-response-data-gzip.htm", + { + "timeout": "long" + } + ] + ], + "xhr/progressevent-constructor.html": [ + [ + "/xhr/progressevent-constructor.html", + {} + ] + ], + "xhr/progressevent-interface.html": [ + [ + "/xhr/progressevent-interface.html", + {} + ] + ], + "xhr/response-data-arraybuffer.htm": [ + [ + "/xhr/response-data-arraybuffer.htm", + {} + ] + ], + "xhr/response-data-blob.htm": [ + [ + "/xhr/response-data-blob.htm", + {} + ] + ], + "xhr/response-data-deflate.htm": [ + [ + "/xhr/response-data-deflate.htm", + {} + ] + ], + "xhr/response-data-gzip.htm": [ + [ + "/xhr/response-data-gzip.htm", + {} + ] + ], + "xhr/response-data-progress.htm": [ + [ + "/xhr/response-data-progress.htm", + {} + ] + ], + "xhr/response-invalid-responsetype.htm": [ + [ + "/xhr/response-invalid-responsetype.htm", + {} + ] + ], + "xhr/response-json.htm": [ + [ + "/xhr/response-json.htm", + {} + ] + ], + "xhr/response-method.htm": [ + [ + "/xhr/response-method.htm", + {} + ] + ], + "xhr/responseText-status.html": [ + [ + "/xhr/responseText-status.html", + {} + ] + ], + "xhr/responseType-document-in-worker.html": [ + [ + "/xhr/responseType-document-in-worker.html", + {} + ] + ], + "xhr/responseXML-unavailable-in-worker.html": [ + [ + "/xhr/responseXML-unavailable-in-worker.html", + {} + ] + ], + "xhr/responsedocument-decoding.htm": [ + [ + "/xhr/responsedocument-decoding.htm", + {} + ] + ], + "xhr/responsetext-decoding.htm": [ + [ + "/xhr/responsetext-decoding.htm", + {} + ] + ], + "xhr/responsetype.html": [ + [ + "/xhr/responsetype.html", + {} + ] + ], + "xhr/responseurl.html": [ + [ + "/xhr/responseurl.html", + {} + ] + ], + "xhr/responsexml-basic.htm": [ + [ + "/xhr/responsexml-basic.htm", + {} + ] + ], + "xhr/responsexml-document-properties.htm": [ + [ + "/xhr/responsexml-document-properties.htm", + {} + ] + ], + "xhr/responsexml-get-twice.htm": [ + [ + "/xhr/responsexml-get-twice.htm", + {} + ] + ], + "xhr/responsexml-media-type.htm": [ + [ + "/xhr/responsexml-media-type.htm", + {} + ] + ], + "xhr/responsexml-non-document-types.htm": [ + [ + "/xhr/responsexml-non-document-types.htm", + {} + ] + ], + "xhr/responsexml-non-well-formed.htm": [ + [ + "/xhr/responsexml-non-well-formed.htm", + {} + ] + ], + "xhr/security-consideration.sub.html": [ + [ + "/xhr/security-consideration.sub.html", + {} + ] + ], + "xhr/send-accept-language.htm": [ + [ + "/xhr/send-accept-language.htm", + {} + ] + ], + "xhr/send-accept.htm": [ + [ + "/xhr/send-accept.htm", + {} + ] + ], + "xhr/send-after-setting-document-domain.htm": [ + [ + "/xhr/send-after-setting-document-domain.htm", + {} + ] + ], + "xhr/send-authentication-basic-cors-not-enabled.htm": [ + [ + "/xhr/send-authentication-basic-cors-not-enabled.htm", + {} + ] + ], + "xhr/send-authentication-basic-cors.htm": [ + [ + "/xhr/send-authentication-basic-cors.htm", + {} + ] + ], + "xhr/send-authentication-basic-repeat-no-args.htm": [ + [ + "/xhr/send-authentication-basic-repeat-no-args.htm", + {} + ] + ], + "xhr/send-authentication-basic-setrequestheader-and-arguments.htm": [ + [ + "/xhr/send-authentication-basic-setrequestheader-and-arguments.htm", + {} + ] + ], + "xhr/send-authentication-basic-setrequestheader-existing-session.htm": [ + [ + "/xhr/send-authentication-basic-setrequestheader-existing-session.htm", + {} + ] + ], + "xhr/send-authentication-basic-setrequestheader.htm": [ + [ + "/xhr/send-authentication-basic-setrequestheader.htm", + {} + ] + ], + "xhr/send-authentication-basic.htm": [ + [ + "/xhr/send-authentication-basic.htm", + {} + ] + ], + "xhr/send-authentication-competing-names-passwords.htm": [ + [ + "/xhr/send-authentication-competing-names-passwords.htm", + {} + ] + ], + "xhr/send-authentication-cors-basic-setrequestheader.htm": [ + [ + "/xhr/send-authentication-cors-basic-setrequestheader.htm", + {} + ] + ], + "xhr/send-authentication-cors-setrequestheader-no-cred.htm": [ + [ + "/xhr/send-authentication-cors-setrequestheader-no-cred.htm", + {} + ] + ], + "xhr/send-blob-with-no-mime-type.html": [ + [ + "/xhr/send-blob-with-no-mime-type.html", + {} + ] + ], + "xhr/send-conditional-cors.htm": [ + [ + "/xhr/send-conditional-cors.htm", + {} + ] + ], + "xhr/send-conditional.htm": [ + [ + "/xhr/send-conditional.htm", + {} + ] + ], + "xhr/send-content-type-charset.htm": [ + [ + "/xhr/send-content-type-charset.htm", + {} + ] + ], + "xhr/send-content-type-string.htm": [ + [ + "/xhr/send-content-type-string.htm", + {} + ] + ], + "xhr/send-data-arraybuffer.htm": [ + [ + "/xhr/send-data-arraybuffer.htm", + {} + ] + ], + "xhr/send-data-arraybufferview.htm": [ + [ + "/xhr/send-data-arraybufferview.htm", + {} + ] + ], + "xhr/send-data-blob.htm": [ + [ + "/xhr/send-data-blob.htm", + {} + ] + ], + "xhr/send-data-es-object.htm": [ + [ + "/xhr/send-data-es-object.htm", + {} + ] + ], + "xhr/send-data-formdata.htm": [ + [ + "/xhr/send-data-formdata.htm", + {} + ] + ], + "xhr/send-data-unexpected-tostring.htm": [ + [ + "/xhr/send-data-unexpected-tostring.htm", + {} + ] + ], + "xhr/send-entity-body-basic.htm": [ + [ + "/xhr/send-entity-body-basic.htm", + {} + ] + ], + "xhr/send-entity-body-document-bogus.htm": [ + [ + "/xhr/send-entity-body-document-bogus.htm", + {} + ] + ], + "xhr/send-entity-body-document.htm": [ + [ + "/xhr/send-entity-body-document.htm", + {} + ] + ], + "xhr/send-entity-body-empty.htm": [ + [ + "/xhr/send-entity-body-empty.htm", + {} + ] + ], + "xhr/send-entity-body-get-head-async.htm": [ + [ + "/xhr/send-entity-body-get-head-async.htm", + {} + ] + ], + "xhr/send-entity-body-get-head.htm": [ + [ + "/xhr/send-entity-body-get-head.htm", + {} + ] + ], + "xhr/send-entity-body-none.htm": [ + [ + "/xhr/send-entity-body-none.htm", + {} + ] + ], + "xhr/send-network-error-async-events.sub.htm": [ + [ + "/xhr/send-network-error-async-events.sub.htm", + {} + ] + ], + "xhr/send-network-error-sync-events.sub.htm": [ + [ + "/xhr/send-network-error-sync-events.sub.htm", + {} + ] + ], + "xhr/send-no-response-event-loadend.htm": [ + [ + "/xhr/send-no-response-event-loadend.htm", + {} + ] + ], + "xhr/send-no-response-event-loadstart.htm": [ + [ + "/xhr/send-no-response-event-loadstart.htm", + {} + ] + ], + "xhr/send-no-response-event-order.htm": [ + [ + "/xhr/send-no-response-event-order.htm", + {} + ] + ], + "xhr/send-non-same-origin.htm": [ + [ + "/xhr/send-non-same-origin.htm", + {} + ] + ], + "xhr/send-receive-utf16.htm": [ + [ + "/xhr/send-receive-utf16.htm", + {} + ] + ], + "xhr/send-redirect-bogus-sync.htm": [ + [ + "/xhr/send-redirect-bogus-sync.htm", + {} + ] + ], + "xhr/send-redirect-bogus.htm": [ + [ + "/xhr/send-redirect-bogus.htm", + { + "timeout": "long" + } + ] + ], + "xhr/send-redirect-infinite-sync.htm": [ + [ + "/xhr/send-redirect-infinite-sync.htm", + {} + ] + ], + "xhr/send-redirect-infinite.htm": [ + [ + "/xhr/send-redirect-infinite.htm", + {} + ] + ], + "xhr/send-redirect-no-location.htm": [ + [ + "/xhr/send-redirect-no-location.htm", + {} + ] + ], + "xhr/send-redirect-post-upload.htm": [ + [ + "/xhr/send-redirect-post-upload.htm", + {} + ] + ], + "xhr/send-redirect-to-cors.htm": [ + [ + "/xhr/send-redirect-to-cors.htm", + {} + ] + ], + "xhr/send-redirect-to-non-cors.htm": [ + [ + "/xhr/send-redirect-to-non-cors.htm", + {} + ] + ], + "xhr/send-redirect.htm": [ + [ + "/xhr/send-redirect.htm", + {} + ] + ], + "xhr/send-response-event-order.htm": [ + [ + "/xhr/send-response-event-order.htm", + {} + ] + ], + "xhr/send-response-upload-event-loadend.htm": [ + [ + "/xhr/send-response-upload-event-loadend.htm", + {} + ] + ], + "xhr/send-response-upload-event-loadstart.htm": [ + [ + "/xhr/send-response-upload-event-loadstart.htm", + {} + ] + ], + "xhr/send-response-upload-event-progress.htm": [ + [ + "/xhr/send-response-upload-event-progress.htm", + {} + ] + ], + "xhr/send-send.htm": [ + [ + "/xhr/send-send.htm", + {} + ] + ], + "xhr/send-send.worker.js": [ + [ + "/xhr/send-send.worker.html", + {} + ] + ], + "xhr/send-sync-blocks-async.htm": [ + [ + "/xhr/send-sync-blocks-async.htm", + {} + ] + ], + "xhr/send-sync-no-response-event-load.htm": [ + [ + "/xhr/send-sync-no-response-event-load.htm", + {} + ] + ], + "xhr/send-sync-no-response-event-loadend.htm": [ + [ + "/xhr/send-sync-no-response-event-loadend.htm", + {} + ] + ], + "xhr/send-sync-no-response-event-order.htm": [ + [ + "/xhr/send-sync-no-response-event-order.htm", + {} + ] + ], + "xhr/send-sync-response-event-order.htm": [ + [ + "/xhr/send-sync-response-event-order.htm", + {} + ] + ], + "xhr/send-sync-timeout.htm": [ + [ + "/xhr/send-sync-timeout.htm", + {} + ] + ], + "xhr/send-timeout-events.htm": [ + [ + "/xhr/send-timeout-events.htm", + {} + ] + ], + "xhr/send-usp.any.js": [ + [ + "/xhr/send-usp.any.html", + {} + ], + [ + "/xhr/send-usp.any.worker.html", + {} + ] + ], + "xhr/setrequestheader-after-send.htm": [ + [ + "/xhr/setrequestheader-after-send.htm", + {} + ] + ], + "xhr/setrequestheader-allow-empty-value.htm": [ + [ + "/xhr/setrequestheader-allow-empty-value.htm", + {} + ] + ], + "xhr/setrequestheader-allow-whitespace-in-value.htm": [ + [ + "/xhr/setrequestheader-allow-whitespace-in-value.htm", + {} + ] + ], + "xhr/setrequestheader-before-open.htm": [ + [ + "/xhr/setrequestheader-before-open.htm", + {} + ] + ], + "xhr/setrequestheader-bogus-name.htm": [ + [ + "/xhr/setrequestheader-bogus-name.htm", + {} + ] + ], + "xhr/setrequestheader-bogus-value.htm": [ + [ + "/xhr/setrequestheader-bogus-value.htm", + {} + ] + ], + "xhr/setrequestheader-case-insensitive.htm": [ + [ + "/xhr/setrequestheader-case-insensitive.htm", + {} + ] + ], + "xhr/setrequestheader-content-type.htm": [ + [ + "/xhr/setrequestheader-content-type.htm", + {} + ] + ], + "xhr/setrequestheader-header-allowed.htm": [ + [ + "/xhr/setrequestheader-header-allowed.htm", + {} + ] + ], + "xhr/setrequestheader-header-forbidden.htm": [ + [ + "/xhr/setrequestheader-header-forbidden.htm", + {} + ] + ], + "xhr/setrequestheader-open-setrequestheader.htm": [ + [ + "/xhr/setrequestheader-open-setrequestheader.htm", + {} + ] + ], + "xhr/status-async.htm": [ + [ + "/xhr/status-async.htm", + {} + ] + ], + "xhr/status-basic.htm": [ + [ + "/xhr/status-basic.htm", + {} + ] + ], + "xhr/status-error.htm": [ + [ + "/xhr/status-error.htm", + {} + ] + ], + "xhr/template-element.html": [ + [ + "/xhr/template-element.html", + {} + ] + ], + "xhr/timeout-cors-async.htm": [ + [ + "/xhr/timeout-cors-async.htm", + {} + ] + ], + "xhr/timeout-multiple-fetches.html": [ + [ + "/xhr/timeout-multiple-fetches.html", + {} + ] + ], + "xhr/timeout-sync.htm": [ + [ + "/xhr/timeout-sync.htm", + {} + ] + ], + "xhr/xmlhttprequest-basic.htm": [ + [ + "/xhr/xmlhttprequest-basic.htm", + {} + ] + ], + "xhr/xmlhttprequest-eventtarget.htm": [ + [ + "/xhr/xmlhttprequest-eventtarget.htm", + {} + ] + ], + "xhr/xmlhttprequest-network-error-sync.htm": [ + [ + "/xhr/xmlhttprequest-network-error-sync.htm", + {} + ] + ], + "xhr/xmlhttprequest-network-error.htm": [ + [ + "/xhr/xmlhttprequest-network-error.htm", + {} + ] + ], + "xhr/xmlhttprequest-sync-block-defer-scripts.html": [ + [ + "/xhr/xmlhttprequest-sync-block-defer-scripts.html", + {} + ] + ], + "xhr/xmlhttprequest-sync-block-scripts.html": [ + [ + "/xhr/xmlhttprequest-sync-block-scripts.html", + {} + ] + ], + "xhr/xmlhttprequest-sync-default-feature-policy.sub.html": [ + [ + "/xhr/xmlhttprequest-sync-default-feature-policy.sub.html", + {} + ] + ], + "xhr/xmlhttprequest-sync-not-hang-scriptloader.html": [ + [ + "/xhr/xmlhttprequest-sync-not-hang-scriptloader.html", + {} + ] + ], + "xhr/xmlhttprequest-timeout-aborted.html": [ + [ + "/xhr/xmlhttprequest-timeout-aborted.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-abortedonmain.html": [ + [ + "/xhr/xmlhttprequest-timeout-abortedonmain.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-overrides.html": [ + [ + "/xhr/xmlhttprequest-timeout-overrides.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-overridesexpires.html": [ + [ + "/xhr/xmlhttprequest-timeout-overridesexpires.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-reused.html": [ + [ + "/xhr/xmlhttprequest-timeout-reused.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-simple.html": [ + [ + "/xhr/xmlhttprequest-timeout-simple.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-synconmain.html": [ + [ + "/xhr/xmlhttprequest-timeout-synconmain.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-twice.html": [ + [ + "/xhr/xmlhttprequest-timeout-twice.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-worker-aborted.html": [ + [ + "/xhr/xmlhttprequest-timeout-worker-aborted.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-worker-overrides.html": [ + [ + "/xhr/xmlhttprequest-timeout-worker-overrides.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-worker-overridesexpires.html": [ + [ + "/xhr/xmlhttprequest-timeout-worker-overridesexpires.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-worker-simple.html": [ + [ + "/xhr/xmlhttprequest-timeout-worker-simple.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-worker-synconworker.html": [ + [ + "/xhr/xmlhttprequest-timeout-worker-synconworker.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-timeout-worker-twice.html": [ + [ + "/xhr/xmlhttprequest-timeout-worker-twice.html", + { + "timeout": "long" + } + ] + ], + "xhr/xmlhttprequest-unsent.htm": [ + [ + "/xhr/xmlhttprequest-unsent.htm", + {} + ] ] }, "visual": { @@ -225776,7 +226359,7 @@ "support" ], "./lint.whitelist": [ - "92756bd517af0d5f9268ac86711cb1e7683ec4bb", + "e2ff823a37fdb49a64d144ac380ac00ab4d35655", "support" ], "./update-built-tests.sh": [ @@ -225808,7 +226391,7 @@ "support" ], "2dcontext/OWNERS": [ - "88028065ecd152d7a46a9afcf3c4748f36797f1e", + "942d0f99fe9687279413b61f54edf6d59492dcc0", "support" ], "2dcontext/best-practices/.gitkeep": [ @@ -228288,15 +228871,15 @@ "testharness" ], "2dcontext/imagebitmap/common.js": [ - "77a2b4d43407bad6e5d9eafb71180bd84190218f", + "9c16b63a9a724f46e543a32649c21f04c6540893", "support" ], "2dcontext/imagebitmap/createImageBitmap-drawImage.html": [ - "56ebe218b07fe534ded2c5734c0ecbd1b4c30d49", + "d709088a1850b25a89a4ad5cd58a0c9387aa4840", "testharness" ], "2dcontext/imagebitmap/createImageBitmap-invalid-args.html": [ - "badef04a0354c9e41f99370b86e5f757b1926ea7", + "59b291fb7cd47850077637d7ed92ca81e95b89e3", "testharness" ], "2dcontext/imagebitmap/createImageBitmap-sizeOverflow.html": [ @@ -230007,12 +230590,20 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "FileAPI/FileReader/test_notreadableerrors-manual.html": [ + "3beee687d73a0e5c987b1e697c51230f405ff7a7", + "manual" + ], + "FileAPI/FileReader/test_securityerrors-manual.html": [ + "d352d5c6b5d1f2ada419d51bcfd9ecd9100bf892", + "manual" + ], "FileAPI/FileReaderSync.worker.js": [ "19741fbd0498bf9135408ceb6128221cbeb4e2f3", "testharness" ], "FileAPI/OWNERS": [ - "cecdc13453ca58bee32e27de973846395bb07bcc", + "f340bcedd53a21c10c03764d047e2c0c1648628d", "support" ], "FileAPI/blob/Blob-Request-revoke-fetch-expected.txt": [ @@ -230232,7 +230823,7 @@ "reftest" ], "IndexedDB/OWNERS": [ - "625de99f3cd80a20a21a12e48aab4f48608ee0cb", + "8387b384bc39038b64966e871d44fc6637c2c741", "support" ], "IndexedDB/README.md": [ @@ -232379,1670 +232970,10 @@ "699d2feb7ed9f91ae04957131fcb23cebc19b621", "testharness" ], - "XMLHttpRequest/FormData-append.html": [ - "b41637b9f13c7876b581f0fb0162baea758d50e2", - "testharness" - ], "XMLHttpRequest/OWNERS": [ "bb2738dafe22a65000695059dfb22d1b3559772d", "support" ], - "XMLHttpRequest/README.md": [ - "bedec5c5902a98182c0d9456f81a9d0859f35095", - "support" - ], - "XMLHttpRequest/XMLHttpRequest-withCredentials.any.js": [ - "258104b78168059e67c84aa49c1b236c200633aa", - "testharness" - ], - "XMLHttpRequest/abort-after-receive.htm": [ - "b3b42e616f1af845a5280e56862d81fcb1491e57", - "testharness" - ], - "XMLHttpRequest/abort-after-send-expected.txt": [ - "e5b47c4b2e4db1ba9bd647414dbec1fa2dd952e0", - "support" - ], - "XMLHttpRequest/abort-after-send.htm": [ - "1ec12c1906dd99e9c048925c560ce1b9ac1a4410", - "testharness" - ], - "XMLHttpRequest/abort-after-stop.htm": [ - "3feb39f2451afa624771437337c669865fac29b5", - "testharness" - ], - "XMLHttpRequest/abort-after-timeout.htm": [ - "26252843e67111ee53079bb67619fccde700000d", - "testharness" - ], - "XMLHttpRequest/abort-during-done.htm": [ - "e613a5d6f008f867b406105f1fabbeceb05f032f", - "testharness" - ], - "XMLHttpRequest/abort-during-headers-received.htm": [ - "7ec861de6c552c3b799f4848408aca5c381f3ce1", - "testharness" - ], - "XMLHttpRequest/abort-during-loading.htm": [ - "d536b0f1b6cd251a3ee1812501bf60e25130b543", - "testharness" - ], - "XMLHttpRequest/abort-during-open.htm": [ - "bc528083ac09ef3666eb07d294bc2b48dc142791", - "testharness" - ], - "XMLHttpRequest/abort-during-open.js": [ - "f46bf95a38cc79fe499f4990457fcf1eaa193068", - "support" - ], - "XMLHttpRequest/abort-during-open.worker.js": [ - "94180bce348fa9fd3826a8993d701936141b8b0b", - "testharness" - ], - "XMLHttpRequest/abort-during-unsent.htm": [ - "5caf136ee37109ae482e44f71dbcd8bea2842b33", - "testharness" - ], - "XMLHttpRequest/abort-during-upload-expected.txt": [ - "301387199ed0f883262b2d046185946c6e49dd42", - "support" - ], - "XMLHttpRequest/abort-during-upload.htm": [ - "76a704710cb535699ee4f9e66115fa62351f7a3e", - "testharness" - ], - "XMLHttpRequest/abort-event-abort.htm": [ - "8afc5c9fe3534f452b91255fcdff35c4ab250ec7", - "testharness" - ], - "XMLHttpRequest/abort-event-listeners.htm": [ - "e3bd9ae434822d1459127756caf1c5f490bd6a56", - "testharness" - ], - "XMLHttpRequest/abort-event-loadend.htm": [ - "72f25d815a0cb004e1929e1c36dbfc53a6853d83", - "testharness" - ], - "XMLHttpRequest/abort-event-order-expected.txt": [ - "139b2f2e87f535af116089c330ee231fc0bb75fe", - "support" - ], - "XMLHttpRequest/abort-event-order.htm": [ - "8ecc9cbd0fcfd71e8ddb95e095f3153880eeaae9", - "testharness" - ], - "XMLHttpRequest/abort-upload-event-abort.htm": [ - "f7f9858f1ee9601cb1833f032c1f8c463e3ff7c0", - "testharness" - ], - "XMLHttpRequest/abort-upload-event-loadend.htm": [ - "07fc81c4d96ced6791efde32982fe3edff515cfe", - "testharness" - ], - "XMLHttpRequest/access-control-and-redirects-async-same-origin.htm": [ - "48f2e103991c8c308054fd873be8b561b412b9c7", - "testharness" - ], - "XMLHttpRequest/access-control-and-redirects-async.htm": [ - "46b2fb128461a926e0cfaf214b6df52197b45bf8", - "testharness" - ], - "XMLHttpRequest/access-control-and-redirects-expected.txt": [ - "b0a0dfd13f41d39922eeffdfc3afecb2eb5e176a", - "support" - ], - "XMLHttpRequest/access-control-and-redirects.htm": [ - "ff051032814b1242f527970edc58675e3e14fb98", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm": [ - "6693ba20a5241c7ab0261669cf24082a0a7c4e2f", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm": [ - "88aa693115ee05b05adea5273bdfab501b167a60", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-async.htm": [ - "eb115b994e3d5de90ccf54a904266c347959f35b", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm": [ - "280a31d318826ecf1405de6faa735495f2b40f9c", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm": [ - "bab7383cd05a3cb4d4e6a8e5287bc8e5810baad9", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm": [ - "567806f8997dc26cc5a9334aaa7dfe6c222404a5", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm": [ - "782aca237c5d30a3a6ba2ee9be4824e01446e411", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm": [ - "84567f027ffcff9f5a1ed9c17b984f5835d5882b", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-preflight-cache.htm": [ - "b2412a98e2a7a9ec4872bd8f42fc111b33a5ce7d", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow-star.htm": [ - "694f8b8d67002e7b27d98ea2eb32f27fee311cad", - "testharness" - ], - "XMLHttpRequest/access-control-basic-allow.htm": [ - "8c2f2df46c8086f657806f763e68d775e1294bd0", - "testharness" - ], - "XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm": [ - "29b6638f3de85cc39b77b86353dc49865e1fdc39", - "testharness" - ], - "XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm": [ - "43748883f8bf38fe34e0c0f568dec6e1cc7c9b28", - "testharness" - ], - "XMLHttpRequest/access-control-basic-denied.htm": [ - "890170b5b2857a6e837ea3ed0dc4692e206a864a", - "testharness" - ], - "XMLHttpRequest/access-control-basic-get-fail-non-simple.htm": [ - "4641b3a58df7f1eeea460e995692418cfd63f507", - "testharness" - ], - "XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm": [ - "b6e15129e3e0917bb35f5b021ba7849b924d6945", - "testharness" - ], - "XMLHttpRequest/access-control-basic-post-success-no-content-type.htm": [ - "4e7a3f374bf054f9f49ed487c8f417374514293c", - "testharness" - ], - "XMLHttpRequest/access-control-basic-post-with-non-cors-safelisted-content-type.htm": [ - "d7877dca1a16e5c3f52881558f9951e4a5f78ba8", - "testharness" - ], - "XMLHttpRequest/access-control-basic-preflight-denied.htm": [ - "36a1951a7b814d7594e7474646ee9d03108208c6", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-async-header-denied.htm": [ - "f69a2fdd41df78f29187bfa848e88c5c39b60736", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-async-method-denied.htm": [ - "29bb39b957742d739bb0d54464b48a53533206fe", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-async-not-supported.htm": [ - "7520098b97455ca0795304751cef93197be469f6", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-credential-async.htm": [ - "ae93b44faf45f95927a1ee82052a414273333e61", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-credential-sync.htm": [ - "fa393dd9f33c2c7f151f00f034ae0f23a5bbf74a", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-headers-async.htm": [ - "bd10420c088f4e871d1377bf1b7e45d30c1458c9", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-headers-sync.htm": [ - "8dcf3427076b048f2a38890a15427d703c36728f", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-request-header-lowercase.htm": [ - "1f3beb7047a0f4828d44f67664a977469af75263", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-request-header-sorted.htm": [ - "45f904c2322ee7b14cc78075f99243bbad7ecd96", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-request-headers-origin.htm": [ - "7928f916ba92a1c7c13bb2c099ec08fc5f14429e", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-request-invalid-status-301.htm": [ - "e59e2de75149869531b056b53501b92302fdee04", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-request-invalid-status-400.htm": [ - "48fbbfd1a516469058e7559969eb1f36f02c3f14", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-request-invalid-status-501.htm": [ - "a59b9c8f77991992faade11e955061078b9d9623", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-request-must-not-contain-cookie.htm": [ - "78f95f6f962f1696a1ff37a6a3216fba4e741f56", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-sync-header-denied.htm": [ - "98e89f8ddccbba846b6f21f1d77b6a64554bcb52", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-sync-method-denied.htm": [ - "536deb1a3322c4ef45e259849e659d1fa4bea7c7", - "testharness" - ], - "XMLHttpRequest/access-control-preflight-sync-not-supported.htm": [ - "997d43197782650b479ccdef1cc43d8bde7e31e4", - "testharness" - ], - "XMLHttpRequest/access-control-recursive-failed-request.htm": [ - "03650f5362e483a6e29a05554723385ab601495f", - "testharness" - ], - "XMLHttpRequest/access-control-response-with-body-sync.htm": [ - "ae7e24c4b3b3295caa7e76555ac8a21d9062556a", - "testharness" - ], - "XMLHttpRequest/access-control-response-with-body.htm": [ - "e5b2ae207a2ae58bd20a4d6903991cff5e27b5a7", - "testharness" - ], - "XMLHttpRequest/access-control-response-with-exposed-headers.htm": [ - "9c4a5cf99e43f1315dfd73f543450e4056dcef36", - "testharness" - ], - "XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm": [ - "2b507239c3e3fa6602068d6d92897c5d042a7a0d", - "testharness" - ], - "XMLHttpRequest/access-control-sandboxed-iframe-allow.htm": [ - "b1140eacc383af590578319b25ee803ba50c3fee", - "testharness" - ], - "XMLHttpRequest/access-control-sandboxed-iframe-denied-without-wildcard.htm": [ - "a476086f22c912c13d4ac175af95c80f8e226c25", - "testharness" - ], - "XMLHttpRequest/access-control-sandboxed-iframe-denied.htm": [ - "32fcbfa28e93aad6e0040b5b1c9478ce76e7e06e", - "testharness" - ], - "XMLHttpRequest/allow-lists-starting-with-comma.htm": [ - "34a8d82f397f35902c73d9ced2f3cf900d04ae53", - "testharness" - ], - "XMLHttpRequest/anonymous-mode-unsupported.htm": [ - "54a03fefabfad02e09baa4e9d37e19b6403dad9b", - "testharness" - ], - "XMLHttpRequest/data-uri-expected.txt": [ - "6cfe7c07506555203507501af7fc117b33dbee37", - "support" - ], - "XMLHttpRequest/data-uri.htm": [ - "d42eb014a32cf82d7eba31ad9b80f51bff43eeea", - "testharness" - ], - "XMLHttpRequest/event-abort.htm": [ - "5080ba821c78807b806734812a7b501cc56e48be", - "testharness" - ], - "XMLHttpRequest/event-error-order.sub-expected.txt": [ - "e67f6e1bddb9d2b31408dbf7a502f636925089c0", - "support" - ], - "XMLHttpRequest/event-error-order.sub.html": [ - "5d0328ace02c4e7075bcc310392940bb67bd627d", - "testharness" - ], - "XMLHttpRequest/event-error.sub.html": [ - "040207a85f39b12755bfb909afc3c31b0d823698", - "testharness" - ], - "XMLHttpRequest/event-load.htm": [ - "4dd7532bd503931d0d90d95d8ac26b6de8557f44", - "testharness" - ], - "XMLHttpRequest/event-loadend.htm": [ - "155c6adf45aed33817a8378f49d864606a4e8b9e", - "testharness" - ], - "XMLHttpRequest/event-loadstart-upload-expected.txt": [ - "f3b9d8795f37f7357c819c1927eb1b6b17b944fd", - "support" - ], - "XMLHttpRequest/event-loadstart-upload.htm": [ - "8e396ccd7269e2b523c466c57c9adee1222427d5", - "testharness" - ], - "XMLHttpRequest/event-loadstart.htm": [ - "bd7e25519f5389e01b769dc0f338f1567ae3a975", - "testharness" - ], - "XMLHttpRequest/event-progress.htm": [ - "1fc7ae17692af59ec627f9005a8da25819a84e96", - "testharness" - ], - "XMLHttpRequest/event-readystate-sync-open.htm": [ - "4f8da3bd441743d0164094510fbbe1f891b8d3b0", - "testharness" - ], - "XMLHttpRequest/event-readystatechange-loaded.htm": [ - "9873bff3686e2a9b1a3daf778e89943236cc46ca", - "testharness" - ], - "XMLHttpRequest/event-timeout-order-expected.txt": [ - "9e3345180f93c4f5bda1e07a683229a0c31ff837", - "support" - ], - "XMLHttpRequest/event-timeout-order.htm": [ - "a8192dcd62d73279885fb062926e4fac3b02999d", - "testharness" - ], - "XMLHttpRequest/event-timeout.htm": [ - "5035e847bc8fcf16164cefeee293d149fe5f5fce", - "testharness" - ], - "XMLHttpRequest/event-upload-progress-crossorigin-expected.txt": [ - "3372371c3f7957d3be9fd41fa8a2d2bfbd4f2011", - "support" - ], - "XMLHttpRequest/event-upload-progress-crossorigin.htm": [ - "7a18f690ea1c7679d52ff0fd39ea931650d6b9c5", - "testharness" - ], - "XMLHttpRequest/event-upload-progress.htm": [ - "4970811cfd2c1bdd1a08af6dd16eda8ffbff8ffd", - "testharness" - ], - "XMLHttpRequest/firing-events-http-content-length.html": [ - "b02468fa9d3d36190e4490cbbcb5a010403705c1", - "testharness" - ], - "XMLHttpRequest/firing-events-http-no-content-length.html": [ - "5ec562a5be5de822248ad9a4da82db1490363a67", - "testharness" - ], - "XMLHttpRequest/folder.txt": [ - "4dca56d05a21f0d018cd311f43e134e4501cf6d9", - "support" - ], - "XMLHttpRequest/formdata-blob.htm": [ - "0ee0270eeb0c3706bb0f17f991f00858bab9d1cc", - "testharness" - ], - "XMLHttpRequest/formdata-delete.htm": [ - "392d9f0159828eb3b710905c4903077fcc4ab345", - "testharness" - ], - "XMLHttpRequest/formdata-foreach.html": [ - "ac4bcf3c043dec99e2feeaeff828ead2db1e9606", - "testharness" - ], - "XMLHttpRequest/formdata-get.htm": [ - "6ee0ec2a4c0f5abcda4f1aea154ff3e2cdd95af6", - "testharness" - ], - "XMLHttpRequest/formdata-has.htm": [ - "c2d39d1b3453c817fcacb2c358c9aa1fcc4ea68b", - "testharness" - ], - "XMLHttpRequest/formdata-set.htm": [ - "5d4bf9534f6641d4ceab2096254282b7f67ac66b", - "testharness" - ], - "XMLHttpRequest/formdata.htm": [ - "ac39c4b1e3b5bf515be99cff25c3f24b56548a77", - "testharness" - ], - "XMLHttpRequest/getallresponseheaders-cookies.htm": [ - "cb8eb74de6c416c8b7658e27b440b60096da0f6b", - "testharness" - ], - "XMLHttpRequest/getallresponseheaders-expected.txt": [ - "e81e2d306e14cfb5d26e6c8cb8d5d72876ac5953", - "support" - ], - "XMLHttpRequest/getallresponseheaders-status.htm": [ - "7c74fe531715cdccc1c1668380da2a2a7ca65c71", - "testharness" - ], - "XMLHttpRequest/getallresponseheaders.htm": [ - "b41c448a5b4201e22f61ee1c22d27b3b5b2eca83", - "testharness" - ], - "XMLHttpRequest/getresponseheader-case-insensitive.htm": [ - "96f7f70d595b46fcaea81a0c155b994f4561ce08", - "testharness" - ], - "XMLHttpRequest/getresponseheader-chunked-trailer.htm": [ - "37043cc8d180a405eb150b39e2caa5f4f5a0a9c3", - "testharness" - ], - "XMLHttpRequest/getresponseheader-cookies-and-more.htm": [ - "1da70aa71749a513718e783ff68504a6c8c2bef9", - "testharness" - ], - "XMLHttpRequest/getresponseheader-error-state.htm": [ - "6faa6a8a91be180e0cdad155cde90b3969f88977", - "testharness" - ], - "XMLHttpRequest/getresponseheader-server-date.htm": [ - "e58ec1e22f9796ff368357ee6a0f90882f61581b", - "testharness" - ], - "XMLHttpRequest/getresponseheader-special-characters.htm": [ - "c1bbb4ca38e62b9775baaf05593ebcc20e5301f8", - "testharness" - ], - "XMLHttpRequest/getresponseheader-unsent-opened-state.htm": [ - "9a27f71e6e5738d2625ed30f91f3d514fc3646e8", - "testharness" - ], - "XMLHttpRequest/headers-normalize-response-expected.txt": [ - "beeb26685c597767e2b460f6b62ea3f0a9966554", - "support" - ], - "XMLHttpRequest/headers-normalize-response.htm": [ - "eb7c4df4a878181161f356cfaed84e37ccd6f772", - "testharness" - ], - "XMLHttpRequest/historical.html": [ - "1cb82348a9d6f3be34da762267cce7389f715f7c", - "testharness" - ], - "XMLHttpRequest/interfaces.html": [ - "a4c597d2bdb85e37ffe5f5ebba961d7f8a3aeb29", - "testharness" - ], - "XMLHttpRequest/loadstart-and-state.html": [ - "6804845b3ba0e52ee407fc7e8036ce905283751c", - "testharness" - ], - "XMLHttpRequest/no-utf16-json-expected.txt": [ - "c2c4e952b7b5f87163b948618b1dc8dc7cb61813", - "support" - ], - "XMLHttpRequest/no-utf16-json.htm": [ - "4546215ad6f138676d3c473782e6e34b4c922589", - "testharness" - ], - "XMLHttpRequest/open-after-abort.htm": [ - "514263c7a0b9c3494e535dfd5fb72e4cfb43e707", - "testharness" - ], - "XMLHttpRequest/open-after-setrequestheader.htm": [ - "63991d7ee44c2c54f3303393ea8843420ab2d2b4", - "testharness" - ], - "XMLHttpRequest/open-during-abort-event.htm": [ - "5586ef1a16b3215f069a14d5ae3f97e31e45cff1", - "testharness" - ], - "XMLHttpRequest/open-during-abort-processing.htm": [ - "6a32be452eff9e6aa68f805b88947aeb4c61f66e", - "testharness" - ], - "XMLHttpRequest/open-during-abort.htm": [ - "f71725852c3fca8750dbc152d378fa2609e5c40e", - "testharness" - ], - "XMLHttpRequest/open-method-bogus.htm": [ - "cb40eb7cace2026cc8997d459bd9fbbf608eba02", - "testharness" - ], - "XMLHttpRequest/open-method-case-insensitive.htm": [ - "ceeb1f065f94f54c0adc77ee264f6702b5e5df4f", - "testharness" - ], - "XMLHttpRequest/open-method-case-sensitive.htm": [ - "015e6b9e656c6a128577288c5c4f02f02e996177", - "testharness" - ], - "XMLHttpRequest/open-method-insecure.htm": [ - "2783e94a70e284addd1b0e63fad4aa1e0d19acc2", - "testharness" - ], - "XMLHttpRequest/open-method-responsetype-set-sync.htm": [ - "8fda92abd3b4de9c525c01f698e2ec216327930c", - "testharness" - ], - "XMLHttpRequest/open-open-send.htm": [ - "bd09a5efa7bfb7358d08429e1dc00d9e02adc5e7", - "testharness" - ], - "XMLHttpRequest/open-open-sync-send.htm": [ - "8b1721532c80a0732462bc090db236256bf1bf38", - "testharness" - ], - "XMLHttpRequest/open-referer.htm": [ - "7343a7af06cda485e60af3bb5d86e1376a89fd68", - "testharness" - ], - "XMLHttpRequest/open-send-during-abort.htm": [ - "cf5f04566a96f1e86ddbaa6cdc5290fba12745ca", - "testharness" - ], - "XMLHttpRequest/open-send-open.htm": [ - "35187c7ce2a9df0c5a092f85fcecdfca1ad48f43", - "testharness" - ], - "XMLHttpRequest/open-sync-open-send.htm": [ - "0004e8faf2215e2156d8df3c975c99140e6a7555", - "testharness" - ], - "XMLHttpRequest/open-url-about-blank-window.htm": [ - "3a56c852959b6da30b0885b326bf7d8d7f326008", - "testharness" - ], - "XMLHttpRequest/open-url-base-inserted-after-open.htm": [ - "6b3baec08c4ae639af75e2321e016a57e07d680d", - "testharness" - ], - "XMLHttpRequest/open-url-base-inserted.htm": [ - "11f3665ec4c491e3c4806c2be17578ccbcaf7840", - "testharness" - ], - "XMLHttpRequest/open-url-base.htm": [ - "d2c5d8d1696112b771a332011c4f33065817ed9a", - "testharness" - ], - "XMLHttpRequest/open-url-encoding.htm": [ - "a36c7b0e5919af7842883582ef9fc415d8f7ef25", - "testharness" - ], - "XMLHttpRequest/open-url-fragment.htm": [ - "79ebcd0817679394df3c8c162fcf56cd91d98c83", - "testharness" - ], - "XMLHttpRequest/open-url-javascript-window-2.htm": [ - "de6712f1db65e2886599d653a253197254b2c0f2", - "testharness" - ], - "XMLHttpRequest/open-url-javascript-window.htm": [ - "aec548dd8817870e9a4e309e7b726b3325d4ded8", - "testharness" - ], - "XMLHttpRequest/open-url-multi-window-2-expected.txt": [ - "320baf425910398a9987500be3cd8714ecebe30d", - "support" - ], - "XMLHttpRequest/open-url-multi-window-2.htm": [ - "5c94fea7396f3a5e456171b439792170ec0aa077", - "testharness" - ], - "XMLHttpRequest/open-url-multi-window-3-expected.txt": [ - "aff31773ff7b8169636db8f0731b0d519edb1450", - "support" - ], - "XMLHttpRequest/open-url-multi-window-3.htm": [ - "a69ef73ebc52cb2b0b4d67d5e74c2ccc05649651", - "testharness" - ], - "XMLHttpRequest/open-url-multi-window-4-expected.txt": [ - "f87235baa12ea85152ac9a4a28d6f2f5e015c8c8", - "support" - ], - "XMLHttpRequest/open-url-multi-window-4.htm": [ - "524e58c70f963ee2766bcdc9ec17c7ad5f8c092b", - "testharness" - ], - "XMLHttpRequest/open-url-multi-window-5-expected.txt": [ - "437da3b34abf3fdd4b7c99085b5e7b1770612140", - "support" - ], - "XMLHttpRequest/open-url-multi-window-5.htm": [ - "128e9031c746de4fafb026ab1dabda7ac56bad7f", - "testharness" - ], - "XMLHttpRequest/open-url-multi-window-6-expected.txt": [ - "dc8d9fbe1e0dc7c015743fa851ef756f945b1794", - "support" - ], - "XMLHttpRequest/open-url-multi-window-6.htm": [ - "1b00cf39a9f06d8010555ade522c5d5791dd3dba", - "testharness" - ], - "XMLHttpRequest/open-url-multi-window.htm": [ - "28603b8d225367ba648bb9271dec5cb3da73d733", - "testharness" - ], - "XMLHttpRequest/open-url-redirected-worker-origin.htm": [ - "79b3d8035d2e7bc6fef2c69eb378ede3f55e6ff5", - "testharness" - ], - "XMLHttpRequest/open-url-worker-origin.htm": [ - "efb4caaad4450dc7be2c1db7bbfdfa771de11d9e", - "testharness" - ], - "XMLHttpRequest/open-url-worker-simple.htm": [ - "224c1502970253197c670bfb04efa15708e034d5", - "testharness" - ], - "XMLHttpRequest/open-user-password-non-same-origin.htm": [ - "9e28bf35af12bb962fdfd2213d7e20e031a29703", - "testharness" - ], - "XMLHttpRequest/overridemimetype-blob.html": [ - "462d95dec7146c2a7beba5d8b2285fd2b8460002", - "testharness" - ], - "XMLHttpRequest/overridemimetype-done-state.htm": [ - "167f34f8dfc1312a9124c12ee4f8de808fa41680", - "testharness" - ], - "XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis.htm": [ - "92a00af686310d8b44fb5e4c70cc6fbea28e0a88", - "testharness" - ], - "XMLHttpRequest/overridemimetype-invalid-mime-type.htm": [ - "1deea1bfa844816a404b90cf5650382383df5d57", - "testharness" - ], - "XMLHttpRequest/overridemimetype-loading-state.htm": [ - "af7ca47e5810805e37da08fee8062dddb37425b5", - "testharness" - ], - "XMLHttpRequest/overridemimetype-open-state-force-utf-8.htm": [ - "3f686050a6720ad2064c35cd75597d067aa5b880", - "testharness" - ], - "XMLHttpRequest/overridemimetype-open-state-force-xml.htm": [ - "102e045c8828661819b0625aedb052b8c08da7b6", - "testharness" - ], - "XMLHttpRequest/overridemimetype-unsent-state-force-shiftjis.htm": [ - "900deb9a316fd91829abe1073077f95588594889", - "testharness" - ], - "XMLHttpRequest/preserve-ua-header-on-redirect.htm": [ - "1754e07e0c0650a326e0c8be21f6cb28437d1746", - "testharness" - ], - "XMLHttpRequest/progress-events-response-data-gzip.htm": [ - "628ce3c9ee69aa9d4bb1b044f8d7a86095c7b0bc", - "testharness" - ], - "XMLHttpRequest/progressevent-constructor.html": [ - "33782c1562d7c60c50d4fa54a92c082cbeb2928c", - "testharness" - ], - "XMLHttpRequest/progressevent-interface.html": [ - "a614d8381b4fa9d04aef6c2a08889451b1b086a2", - "testharness" - ], - "XMLHttpRequest/resources/accept-language.py": [ - "c8e945b53770efb8e4312f457a5a7261bc88a36c", - "support" - ], - "XMLHttpRequest/resources/accept.py": [ - "4769a0c31c00777fb37e1af76209e68040918b64", - "support" - ], - "XMLHttpRequest/resources/access-control-allow-lists.py": [ - "941a26e0b85d608bb2617362df74263564b5981d", - "support" - ], - "XMLHttpRequest/resources/access-control-allow-with-body.py": [ - "fbd35be708e601c7c3fb625ce28b9f43de784e13", - "support" - ], - "XMLHttpRequest/resources/access-control-auth-basic.py": [ - "08d5c99e4c576557cab5ddc56fda038aab767dee", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-allow-no-credentials.py": [ - "593fc8c4d78f0213017c0fb2fa78ac46274eb6ea", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-allow-star.py": [ - "d9aa8e1eaf8e73256edabafec32960bba8499f40", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-allow.py": [ - "b7351f59af91646549075b6b732eeb6c750e3faf", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-cors-safelisted-request-headers.py": [ - "19a0b1d88765fa152c17c7f684651be8c4bae3da", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-denied.py": [ - "35e7b6c552caf55e8ea7d34ec51d354c8eb2bc6e", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-options-not-supported.py": [ - "ee16a30ec1252bd66ef899f7c7bc8d3d0fb76562", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py": [ - "5b043f99d8f9d3f1c253324447df2d0586bf735a", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py": [ - "4e205534cff698089c017cd3f959f74862f3870a", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-preflight-cache.py": [ - "32e713011ca3c4235f8ef77c4ec49c08c6a49469", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-put-allow.py": [ - "eda02da8e1d89f28ff0e07442539b7eca4ca556f", - "support" - ], - "XMLHttpRequest/resources/access-control-basic-whitelist-response-headers.py": [ - "c530b8431372e0511c91b150c5f1015d504ae374", - "support" - ], - "XMLHttpRequest/resources/access-control-cookie.py": [ - "0551a6a4284fcae2ed5314d5d02767a4da1ad981", - "support" - ], - "XMLHttpRequest/resources/access-control-origin-header.py": [ - "529883eed380c4505c1ddbc87ae5885254756626", - "support" - ], - "XMLHttpRequest/resources/access-control-preflight-denied.py": [ - "b41ba9f1e3fcad508d575331e0f3f43bc75c07b9", - "support" - ], - "XMLHttpRequest/resources/access-control-preflight-request-header-lowercase.py": [ - "3f39f2f6bdda8c167df09525b8d23d04c16b2462", - "support" - ], - "XMLHttpRequest/resources/access-control-preflight-request-header-sorted.py": [ - "357dbf2f01ab59c8689af632c1116d2053f3829d", - "support" - ], - "XMLHttpRequest/resources/access-control-preflight-request-headers-origin.py": [ - "abc6b25627e019ae67b90beebad42164143321d0", - "support" - ], - "XMLHttpRequest/resources/access-control-preflight-request-invalid-status.py": [ - "c572b1e3d79f66df0a40766e6e4c3cc785458d0e", - "support" - ], - "XMLHttpRequest/resources/access-control-preflight-request-must-not-contain-cookie.py": [ - "1343bfee18c64bfbb625591bc65117e5b692c487", - "support" - ], - "XMLHttpRequest/resources/access-control-sandboxed-iframe.html": [ - "3aa5a903afc03e167a88322db44c29b287509f47", - "support" - ], - "XMLHttpRequest/resources/auth1/auth.py": [ - "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", - "support" - ], - "XMLHttpRequest/resources/auth2/auth.py": [ - "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", - "support" - ], - "XMLHttpRequest/resources/auth2/corsenabled.py": [ - "4136b00b543096216f9f1ad1314c7062dda04179", - "support" - ], - "XMLHttpRequest/resources/auth3/auth.py": [ - "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", - "support" - ], - "XMLHttpRequest/resources/auth4/auth.py": [ - "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", - "support" - ], - "XMLHttpRequest/resources/auth5/auth.py": [ - "cb73eae36004b4e939867ae72f8db79e5a14c99c", - "support" - ], - "XMLHttpRequest/resources/auth6/auth.py": [ - "cb73eae36004b4e939867ae72f8db79e5a14c99c", - "support" - ], - "XMLHttpRequest/resources/auth7/corsenabled.py": [ - "cbc1e4a39cc2e999ef7bd4053a600e8b0d515bb5", - "support" - ], - "XMLHttpRequest/resources/auth8/corsenabled-no-authorize.py": [ - "523fbc134ecfee5b13e4ef93508712847fc4e396", - "support" - ], - "XMLHttpRequest/resources/auth9/auth.py": [ - "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", - "support" - ], - "XMLHttpRequest/resources/authentication.py": [ - "e7d0a9054c562964b23c4e4bbf1d1207a1811b55", - "support" - ], - "XMLHttpRequest/resources/base.xml": [ - "4f52cca8f5bee9b2a4ded6b898d4eb9cdbae6c75", - "support" - ], - "XMLHttpRequest/resources/chunked.py": [ - "be48633bdec117d50bce7a8e4323667881c8e367", - "support" - ], - "XMLHttpRequest/resources/conditional.py": [ - "0796447779cee59308620c218160faaedbff608e", - "support" - ], - "XMLHttpRequest/resources/content.py": [ - "4bcdf8d22cbb4119b4236f65e0177c3830f79739", - "support" - ], - "XMLHttpRequest/resources/corsenabled.py": [ - "523f23a739b506de0abcac0ac39b6908a596d62f", - "support" - ], - "XMLHttpRequest/resources/delay.py": [ - "004949bbab102f3336d4a40e33f04eb57efdbb3d", - "support" - ], - "XMLHttpRequest/resources/echo-headers.py": [ - "cba52dcfcc4c73315ca1073ecea13a6d0e30a9ec", - "support" - ], - "XMLHttpRequest/resources/echo-method.py": [ - "146226b51535bcaa270c3a56a31a83828000ba74", - "support" - ], - "XMLHttpRequest/resources/empty-div-utf8-html.py": [ - "0df281fd2f67f2ec4acb6b353b2eb9ee02077957", - "support" - ], - "XMLHttpRequest/resources/folder.txt": [ - "6e7610ce7f3e29db0506a8d0c0f8c3f90a5f98eb", - "support" - ], - "XMLHttpRequest/resources/form.py": [ - "3289c17c1c9892bfc2c44599fe3af6d711a96778", - "support" - ], - "XMLHttpRequest/resources/gzip.py": [ - "a259f50e91a706acf4d9d0be8a01bd046544ea55", - "support" - ], - "XMLHttpRequest/resources/header-content-length.asis": [ - "a191134704e09ff9bb6591dc8c6aa78307edf6c9", - "support" - ], - "XMLHttpRequest/resources/headers-basic.asis": [ - "718e90fc73ec596127d26fba5433c5355e93fa3f", - "support" - ], - "XMLHttpRequest/resources/headers.asis": [ - "4f704b9f6f89a0152443a08eb7adf84415009ad1", - "support" - ], - "XMLHttpRequest/resources/headers.py": [ - "9728a796eb49af8303249f0a806ffaada599fc66", - "support" - ], - "XMLHttpRequest/resources/image.gif": [ - "2302af42d44228cf6e991db0705bf0fdaa6fde8a", - "support" - ], - "XMLHttpRequest/resources/img-utf8-html.py": [ - "961d4612b0002c2fbe228ce2fcc36c1657e60fa9", - "support" - ], - "XMLHttpRequest/resources/img.jpg": [ - "e042472cb177eedb5f89db01ede97521cf044ec9", - "support" - ], - "XMLHttpRequest/resources/infinite-redirects.py": [ - "bd033f0de21dc68ed1d4303fee49e64dd0916722", - "support" - ], - "XMLHttpRequest/resources/init.htm": [ - "d8f63ab5249fca5579d1ee4df5b2ab4695529be3", - "support" - ], - "XMLHttpRequest/resources/inspect-headers.py": [ - "aab673bbdc7411c40ef2d7350486e779f3703e89", - "support" - ], - "XMLHttpRequest/resources/invalid-utf8-html.py": [ - "3e24e9453342e058e18f114763ad01c8c2706d91", - "support" - ], - "XMLHttpRequest/resources/last-modified.py": [ - "9af7a5f9be37e7ebbbea4c683bfb2d9415229ece", - "support" - ], - "XMLHttpRequest/resources/no-custom-header-on-preflight.py": [ - "76437951442df8d19438573add8bf2b2a0be4b18", - "support" - ], - "XMLHttpRequest/resources/nocors/folder.txt": [ - "92400e232461d345128d2d7303eb5f5bba12763f", - "support" - ], - "XMLHttpRequest/resources/parse-headers.py": [ - "cc9f324cf5b044646edfc6aa9e98cdc2a40e41b9", - "support" - ], - "XMLHttpRequest/resources/pass.txt": [ - "27d2303f215d7d1a8f12f0b80b9b56a2cdf6c9a7", - "support" - ], - "XMLHttpRequest/resources/redirect-cors.py": [ - "a04af2badb3f212a9ef48e3cde491f199a85b6bc", - "support" - ], - "XMLHttpRequest/resources/redirect.py": [ - "988961f44badedfcea4e1660339ea921178b7a42", - "support" - ], - "XMLHttpRequest/resources/requri.py": [ - "7e84cbcb29783dd435c9be6ad960731d5d92706c", - "support" - ], - "XMLHttpRequest/resources/reset-token.py": [ - "ba56e4c405f81ea5ca396417ae7cd48f2029f7cb", - "support" - ], - "XMLHttpRequest/resources/responseType-document-in-worker.js": [ - "6f1477cf04fd21df905b4d14e00a67b29c98d961", - "support" - ], - "XMLHttpRequest/resources/responseXML-unavailable-in-worker.js": [ - "8ede1fa55ed1831f90022f2efb2b6e64b1cf4aea", - "support" - ], - "XMLHttpRequest/resources/send-after-setting-document-domain-window-1.htm": [ - "a4bd8b70cc61f9d403b529c079d47691a27abb8a", - "support" - ], - "XMLHttpRequest/resources/send-after-setting-document-domain-window-2.htm": [ - "36e89e62be6ce5c28e943c9cf7eb4f4fdb5dfe3a", - "support" - ], - "XMLHttpRequest/resources/send-after-setting-document-domain-window-helper.js": [ - "200cba5a61c03a34f7e37f66390f6ffe1f51610a", - "support" - ], - "XMLHttpRequest/resources/shift-jis-html.py": [ - "6348753f63dec61aeb6c17ea0a7994f64a846ae2", - "support" - ], - "XMLHttpRequest/resources/status.py": [ - "d521bae08fa1ee19e7bbf4301157703e567ad5c6", - "support" - ], - "XMLHttpRequest/resources/trickle.py": [ - "11df0d34ce5a0ef7193456125ce5546f75946f7a", - "support" - ], - "XMLHttpRequest/resources/upload.py": [ - "e1addc2a9f014c2546b5770dd328b1562dc4fdc3", - "support" - ], - "XMLHttpRequest/resources/utf16-bom.json": [ - "3d344828308b32594a8ed51a3cf186ccfa83cfb1", - "support" - ], - "XMLHttpRequest/resources/utf16.txt": [ - "47e95b463051a904934ec51df445a39301c5f671", - "support" - ], - "XMLHttpRequest/resources/well-formed.xml": [ - "11a068dcf9fa14b05a24f15c0609143ba705e112", - "support" - ], - "XMLHttpRequest/resources/win-1252-html.py": [ - "c062b6b3440e7398a05d0c1db7a5e12d3aa7e58c", - "support" - ], - "XMLHttpRequest/resources/win-1252-xml.py": [ - "e4b0b7ebd6543479a74bdf76592b027b9383e0c9", - "support" - ], - "XMLHttpRequest/resources/workerxhr-origin-referrer.js": [ - "9faaad75ec79580fe5f0a121c1f66266e7b2969e", - "support" - ], - "XMLHttpRequest/resources/workerxhr-simple.js": [ - "29d29ff7d37408b8e2ab1cebf16f3369ef4c287f", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-event-order.js": [ - "eb4a3eeee9b1d0f3a1061253ed35ba83a3d17160", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-aborted.js": [ - "6b9535692cdb91aae7141df3b4e525f603cf2915", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-abortedonmain.js": [ - "d30cfa65549f24cce221750bebdd4dd25ca668c6", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-overrides.js": [ - "ec8eb831b3901f6fb839a515058a9b6b8d552a76", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-overridesexpires.js": [ - "d44506dbf84acedcd8eaf21ec7224a4057988a07", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-runner.js": [ - "ed704b1d85d21351f1daa7c2bf3d3fa3789a7c02", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js": [ - "b6fb033f8fc5dfbd34cf03076e0790c4f58b1bc2", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js": [ - "aca45f5fb83de5fdd22143728effe996d14c9092", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js": [ - "b5b3f69353c5e2f4d6b03b6fafa32e2df9bd5dc4", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js": [ - "0a491ff406bbf3090e770d6af316e2c47c46b13c", - "support" - ], - "XMLHttpRequest/resources/xmlhttprequest-timeout.js": [ - "b884259bf6975838a5065fae472eaf6a4e8bf959", - "support" - ], - "XMLHttpRequest/resources/zlib.py": [ - "3d2a2eeebabe17c5a1ea91334927861458e4caaf", - "support" - ], - "XMLHttpRequest/response-data-arraybuffer.htm": [ - "9849b01691856c6bc25ff086e2ea75925292f1c9", - "testharness" - ], - "XMLHttpRequest/response-data-blob.htm": [ - "d15ab358dfcabd2d0a14c0585a643153a9a98aed", - "testharness" - ], - "XMLHttpRequest/response-data-deflate.htm": [ - "f0c609e892d95889e485326d360fae9623b52b00", - "testharness" - ], - "XMLHttpRequest/response-data-gzip.htm": [ - "1008022e6d8feab21f6239980d8076cb5b78272e", - "testharness" - ], - "XMLHttpRequest/response-data-progress-expected.txt": [ - "558ae097bdeb4e0ce9620529883c5338ab48ed77", - "support" - ], - "XMLHttpRequest/response-data-progress.htm": [ - "5f8d963fa1cdec6ff6b544f19c56e4e15ef39853", - "testharness" - ], - "XMLHttpRequest/response-invalid-responsetype.htm": [ - "6c43125d4b210777bdd870935f5836470c19a88d", - "testharness" - ], - "XMLHttpRequest/response-json-expected.txt": [ - "186c6ef1831003b4ce557979e1ea167c3bda40d8", - "support" - ], - "XMLHttpRequest/response-json.htm": [ - "46b0adcbd4dfa48823c7e37e1acbe50e32efd902", - "testharness" - ], - "XMLHttpRequest/response-method.htm": [ - "dcdcf03b9390763e1bbcb99e1e0e231d00d3a6bb", - "testharness" - ], - "XMLHttpRequest/responseText-status.html": [ - "fb0018f3cc052de846232231771ea8436ec4c8c0", - "testharness" - ], - "XMLHttpRequest/responseType-document-in-worker-expected.txt": [ - "2ab50994ecfbab38817824603f4355c5b80a08f8", - "support" - ], - "XMLHttpRequest/responseType-document-in-worker.html": [ - "4eceb42987047585ac193254951f900b5960975d", - "testharness" - ], - "XMLHttpRequest/responseXML-unavailable-in-worker-expected.txt": [ - "997938c4a42c76beeb645e05564059d3e4fa2e92", - "support" - ], - "XMLHttpRequest/responseXML-unavailable-in-worker.html": [ - "6111310764e8aac694655f173aef9653325ef7e8", - "testharness" - ], - "XMLHttpRequest/responsedocument-decoding.htm": [ - "ab52417826b3953b71b5f6037ebd616d4b862ad4", - "testharness" - ], - "XMLHttpRequest/responsetext-decoding.htm": [ - "538d6d5121157e04c44fd947140f2c913dc3b65e", - "testharness" - ], - "XMLHttpRequest/responsetype.html": [ - "090ae5981aed9e0ed5e5f8a2f5615d57df0c366b", - "testharness" - ], - "XMLHttpRequest/responseurl.html": [ - "b7ac10fed9c8a07afcd13f1d4906e10996ae56c6", - "testharness" - ], - "XMLHttpRequest/responsexml-basic.htm": [ - "962765bd28850b740b0945d08f31fd94c8883191", - "testharness" - ], - "XMLHttpRequest/responsexml-document-properties.htm": [ - "9c3698d77cb49266cfcc33e89a74d7930b5b06cb", - "testharness" - ], - "XMLHttpRequest/responsexml-get-twice.htm": [ - "6291caac16b148f2265968820a8bd460a1a77092", - "testharness" - ], - "XMLHttpRequest/responsexml-media-type-expected.txt": [ - "d058367dc0bb251adfa36b63fd27c1fa2ee8f49d", - "support" - ], - "XMLHttpRequest/responsexml-media-type.htm": [ - "82f735476786b2cbe5c62de17642ab42125e08ee", - "testharness" - ], - "XMLHttpRequest/responsexml-non-document-types.htm": [ - "e0eac49a846a718382cbd6ccb7a7815f77341048", - "testharness" - ], - "XMLHttpRequest/responsexml-non-well-formed.htm": [ - "f3cdc74040718681acc7f48212b0f13b695ebaeb", - "testharness" - ], - "XMLHttpRequest/security-consideration.sub-expected.txt": [ - "d20c805eb6d30da809dd952a16aba897f574741d", - "support" - ], - "XMLHttpRequest/security-consideration.sub.html": [ - "17364601f35ec0c80c0aac65b9340afb8cd2235d", - "testharness" - ], - "XMLHttpRequest/send-accept-language.htm": [ - "19fc5a0afafff1541f2fa5fca812f1f0fc0decd8", - "testharness" - ], - "XMLHttpRequest/send-accept.htm": [ - "9550c8301956239aa5abe9dd83d5cb2ec1733bb2", - "testharness" - ], - "XMLHttpRequest/send-after-setting-document-domain.htm": [ - "5fdcb3eb73151426c3ab14b14b1236d150dc2461", - "testharness" - ], - "XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm": [ - "567d92a18bf35ca579d6c68fe63cf02d40ed48f0", - "testharness" - ], - "XMLHttpRequest/send-authentication-basic-cors.htm": [ - "add5a460a8a8dbed47f26c16bd993a1d0c78c0ea", - "testharness" - ], - "XMLHttpRequest/send-authentication-basic-repeat-no-args.htm": [ - "480ae3795979672a7a7be7d37fa6dbb5a207509d", - "testharness" - ], - "XMLHttpRequest/send-authentication-basic-setrequestheader-and-arguments.htm": [ - "6525428b3b88188306af3a18a8078b074291e962", - "testharness" - ], - "XMLHttpRequest/send-authentication-basic-setrequestheader-existing-session.htm": [ - "26d24fb2e4d8212dd23c4c0e80fcd2c8669ae55d", - "testharness" - ], - "XMLHttpRequest/send-authentication-basic-setrequestheader.htm": [ - "d3e88dda4eec2959470f84864160900d2b3bc6d3", - "testharness" - ], - "XMLHttpRequest/send-authentication-basic.htm": [ - "10e209ccb90914cb95b7818ea4b28cdf1836501a", - "testharness" - ], - "XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt": [ - "f687bbcb276f39f52885afe62966e24bdfde6fe4", - "support" - ], - "XMLHttpRequest/send-authentication-competing-names-passwords.htm": [ - "f44c72cd39779c91f525dd87dca5eed3697910c2", - "testharness" - ], - "XMLHttpRequest/send-authentication-cors-basic-setrequestheader.htm": [ - "28b02ba77a45f6d46e195b863c3c789e6e643550", - "testharness" - ], - "XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt": [ - "d3d4536ce9e284f2c425da37a368c00ded27a62d", - "support" - ], - "XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred.htm": [ - "4f707072eaac0788ac50b9d22a2ea055d0ff52f1", - "testharness" - ], - "XMLHttpRequest/send-authentication-existing-session-manual.htm": [ - "668d2cfb4e53b925b85cc4dbeb783d1cd070b30b", - "manual" - ], - "XMLHttpRequest/send-authentication-prompt-2-manual.htm": [ - "5f27e6eb5c228b742ed4780f13f4671d72305a57", - "manual" - ], - "XMLHttpRequest/send-authentication-prompt-manual-expected.txt": [ - "443eb3875afd8493cb62b6b2ab705ff0d4e2e170", - "support" - ], - "XMLHttpRequest/send-authentication-prompt-manual.htm": [ - "7d70fbaef47348b9f92a70059f3827e29caf28b5", - "manual" - ], - "XMLHttpRequest/send-blob-with-no-mime-type.html": [ - "c157b5bad423e5683a97ac43f5a1f7ea391efc79", - "testharness" - ], - "XMLHttpRequest/send-conditional-cors.htm": [ - "3296d088846322713fb0a1d2160ad1c2ccddfb45", - "testharness" - ], - "XMLHttpRequest/send-conditional.htm": [ - "f807d15cf8c787653f3362e3bfbb804c010f04e3", - "testharness" - ], - "XMLHttpRequest/send-content-type-charset-expected.txt": [ - "04326d5b654c4855fbcd30f741f2bc8be3168674", - "support" - ], - "XMLHttpRequest/send-content-type-charset.htm": [ - "e143738f086c6c96de54539e799ee194de436246", - "testharness" - ], - "XMLHttpRequest/send-content-type-string-expected.txt": [ - "830bac71c41b51acebaa9ac14260b3939d582b83", - "support" - ], - "XMLHttpRequest/send-content-type-string.htm": [ - "1f90fd9a583794013b505524c9d6d1bad3e4db9c", - "testharness" - ], - "XMLHttpRequest/send-data-arraybuffer.htm": [ - "43a7647ba4c567aaea98efa41d538d5beda682ff", - "testharness" - ], - "XMLHttpRequest/send-data-arraybufferview.htm": [ - "89c4c24408588cbd42f1b3ccfd50f91b6267ff92", - "testharness" - ], - "XMLHttpRequest/send-data-blob.htm": [ - "cf811393a5a18891e46439f5d9bb92acbf45b5e3", - "testharness" - ], - "XMLHttpRequest/send-data-es-object.htm": [ - "711a09c9107498631d6aa40ec532c9b9c0d55643", - "testharness" - ], - "XMLHttpRequest/send-data-formdata.htm": [ - "e7dd3b36ef8e4986edf49aebbd9ff439e101f3ae", - "testharness" - ], - "XMLHttpRequest/send-data-unexpected-tostring.htm": [ - "f74fdf2bfdfb97d8fc648db3d8bcbf28bf348e53", - "testharness" - ], - "XMLHttpRequest/send-entity-body-basic.htm": [ - "6d96982857fd0501152257d25497f704e222ed12", - "testharness" - ], - "XMLHttpRequest/send-entity-body-document-bogus.htm": [ - "d4a39e3bc7e309314c74e4767667feb4c9a8bc48", - "testharness" - ], - "XMLHttpRequest/send-entity-body-document.htm": [ - "c5adfd8edca14061aef38217657112a070683401", - "testharness" - ], - "XMLHttpRequest/send-entity-body-empty.htm": [ - "ae63276f3b52c340e81237573769e53cbb07e07e", - "testharness" - ], - "XMLHttpRequest/send-entity-body-get-head-async.htm": [ - "1f2ed114e408365c7fbab6642db27e8e2046430a", - "testharness" - ], - "XMLHttpRequest/send-entity-body-get-head.htm": [ - "40848a8e40691622b8ea97e451bfbb850d76eef4", - "testharness" - ], - "XMLHttpRequest/send-entity-body-none.htm": [ - "7b931695fe83a3aed260e1eed87bbe0819a66874", - "testharness" - ], - "XMLHttpRequest/send-network-error-async-events.sub.htm": [ - "85d0484051e19077c1dd0fde8845761fdca45b5a", - "testharness" - ], - "XMLHttpRequest/send-network-error-sync-events.sub.htm": [ - "8dd189e5d654c1fc46808dbd860ed0b055851227", - "testharness" - ], - "XMLHttpRequest/send-no-response-event-loadend.htm": [ - "fac776e892ef186e6ac83b5fb869183682b3209c", - "testharness" - ], - "XMLHttpRequest/send-no-response-event-loadstart.htm": [ - "df45abd800cc1ab0a58f30ff0a7483369170c429", - "testharness" - ], - "XMLHttpRequest/send-no-response-event-order-expected.txt": [ - "3dd2b74f51a96c75796383e5fabd1653aa3c4cbb", - "support" - ], - "XMLHttpRequest/send-no-response-event-order.htm": [ - "8cbae4812e0a52e492a58c2c7fec4e5db5438153", - "testharness" - ], - "XMLHttpRequest/send-non-same-origin.htm": [ - "55abab10b4acd3e95c026ac81d9b30994fa0db8e", - "testharness" - ], - "XMLHttpRequest/send-receive-utf16.htm": [ - "d532cb2b3cf98bad57e4bed6417564ed047f492c", - "testharness" - ], - "XMLHttpRequest/send-redirect-bogus-sync.htm": [ - "2dcb43fb80976a41d59a45a86d437fbaaa1eadff", - "testharness" - ], - "XMLHttpRequest/send-redirect-bogus.htm": [ - "02ba73594e49226355aea8df228f49a57ed4a93c", - "testharness" - ], - "XMLHttpRequest/send-redirect-infinite-sync.htm": [ - "63bcb776518d71f4fdc66441a411fcd989137d5e", - "testharness" - ], - "XMLHttpRequest/send-redirect-infinite.htm": [ - "ebf9820dbbdeeeda873f233848a0dadb10484038", - "testharness" - ], - "XMLHttpRequest/send-redirect-no-location.htm": [ - "65831f4839b014dcd17cc53cc0f338978580ceaf", - "testharness" - ], - "XMLHttpRequest/send-redirect-post-upload.htm": [ - "504168881ffa74378fc151f01fe53a177fc89633", - "testharness" - ], - "XMLHttpRequest/send-redirect-to-cors.htm": [ - "4cdf1cc02c93c3ac96276f5be7db89758dc3e5e0", - "testharness" - ], - "XMLHttpRequest/send-redirect-to-non-cors.htm": [ - "a6500b376465aa51b21f08a7f72a2f30e6058d30", - "testharness" - ], - "XMLHttpRequest/send-redirect.htm": [ - "b430be84a453581d997856413ce14967108c75b4", - "testharness" - ], - "XMLHttpRequest/send-response-event-order-expected.txt": [ - "7de2c65764c3227cf2e8b5d27509f0139c856769", - "support" - ], - "XMLHttpRequest/send-response-event-order.htm": [ - "179e700e1cfb2ed67b4fba193b7aca5f71f91154", - "testharness" - ], - "XMLHttpRequest/send-response-upload-event-loadend.htm": [ - "d093519b07fef4176358308de50487a2a708ad01", - "testharness" - ], - "XMLHttpRequest/send-response-upload-event-loadstart.htm": [ - "6f2f52412fba355fdf0acfdeb0f19f68edbf5120", - "testharness" - ], - "XMLHttpRequest/send-response-upload-event-progress.htm": [ - "3e1788b46878b452f4417eb72dc16b80bcbad46c", - "testharness" - ], - "XMLHttpRequest/send-send.htm": [ - "8090983cb88c47209dd3e8a22883434401811985", - "testharness" - ], - "XMLHttpRequest/send-send.js": [ - "c802b56486b0967c4ede9d15dc64a546a627ef4a", - "support" - ], - "XMLHttpRequest/send-send.worker.js": [ - "f2de076a4fd8e7987aeb57b8f7cc44706d0cfa88", - "testharness" - ], - "XMLHttpRequest/send-sync-blocks-async.htm": [ - "db759d19e34e2d64f74322f608d0cbc7427e6c23", - "testharness" - ], - "XMLHttpRequest/send-sync-no-response-event-load.htm": [ - "51b87c5b915abd47f185a5c09600b9bf1be2a449", - "testharness" - ], - "XMLHttpRequest/send-sync-no-response-event-loadend.htm": [ - "b5b5a26530afa18289e1e06a4de033607a80a9fd", - "testharness" - ], - "XMLHttpRequest/send-sync-no-response-event-order.htm": [ - "bf76cb8987608b7bb9f59627032826d21936f450", - "testharness" - ], - "XMLHttpRequest/send-sync-response-event-order-expected.txt": [ - "70c00c61fbfff76b3f6042dac646624464ccb3f0", - "support" - ], - "XMLHttpRequest/send-sync-response-event-order.htm": [ - "3e2d0154469dcdf3a04376c2c350dab681ff8fe7", - "testharness" - ], - "XMLHttpRequest/send-sync-timeout.htm": [ - "943b2ff7b11f121e95d80a94086ea124703c16ad", - "testharness" - ], - "XMLHttpRequest/send-timeout-events.htm": [ - "d7f26cf564d87f53b6a6eebf87aa5f46f1320541", - "testharness" - ], - "XMLHttpRequest/send-usp.any.js": [ - "4ce0391feee2b9787792bb4f753c42610e7a4da4", - "testharness" - ], - "XMLHttpRequest/setrequestheader-after-send.htm": [ - "e82560558c317be61c7afdf95831d017334f2710", - "testharness" - ], - "XMLHttpRequest/setrequestheader-allow-empty-value.htm": [ - "42613edfadddfd6457c293de765202d1c93b2e56", - "testharness" - ], - "XMLHttpRequest/setrequestheader-allow-whitespace-in-value.htm": [ - "3a276cd07a44139a41f8237a514a9be0ac0bbeff", - "testharness" - ], - "XMLHttpRequest/setrequestheader-before-open.htm": [ - "a48dc523bf2e53b15d2cac297a779d6af2cc94bd", - "testharness" - ], - "XMLHttpRequest/setrequestheader-bogus-name.htm": [ - "6bcba2aeef3276a57ee03d41e24fe2c29ca94050", - "testharness" - ], - "XMLHttpRequest/setrequestheader-bogus-value.htm": [ - "74ea5a08ea9a5185ee20fda78b34f6b3d4d6485b", - "testharness" - ], - "XMLHttpRequest/setrequestheader-case-insensitive.htm": [ - "a4b01fb28b9002f561900de30bddf1224eb63f7b", - "testharness" - ], - "XMLHttpRequest/setrequestheader-content-type-expected.txt": [ - "b2eaf7b578420cca02dd517685501e177767b228", - "support" - ], - "XMLHttpRequest/setrequestheader-content-type.htm": [ - "388341fe59bbc12228bad7a605a26cab014220ad", - "testharness" - ], - "XMLHttpRequest/setrequestheader-header-allowed.htm": [ - "19108e657472c4967e6a86e7c60ce0ad00ae7d6f", - "testharness" - ], - "XMLHttpRequest/setrequestheader-header-forbidden.htm": [ - "5908e84fd8772dbe91ce204c57ce0b56f006ecdb", - "testharness" - ], - "XMLHttpRequest/setrequestheader-open-setrequestheader.htm": [ - "60d898c702b1486fdd017be516786729204a0f6d", - "testharness" - ], - "XMLHttpRequest/status-async.htm": [ - "5a2330789348f56971dedef5f314c6d88c4ea3ce", - "testharness" - ], - "XMLHttpRequest/status-basic.htm": [ - "f8cfccecc4df3b25091dc74639d9615101307daf", - "testharness" - ], - "XMLHttpRequest/status-error.htm": [ - "42182437d8c1015339825c035127877f4970decb", - "testharness" - ], - "XMLHttpRequest/template-element.html": [ - "748f12beaa646e244f8312afd545f56075cac727", - "testharness" - ], - "XMLHttpRequest/timeout-cors-async.htm": [ - "d5b0fa4ab0907d58f7cf5796c2bb740e5f91a82f", - "testharness" - ], - "XMLHttpRequest/timeout-multiple-fetches.html": [ - "77fc6a7771ce251c88e81546fb3abaefd244a396", - "testharness" - ], - "XMLHttpRequest/timeout-sync.htm": [ - "aefabb6eedc02aae1a46e860c12e104de251efa1", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-basic.htm": [ - "a67d1876d6245fb94d60a937b633c87c51a04d21", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-eventtarget.htm": [ - "40c886f79399108db3ded8a23848905dcf9e0862", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-network-error-sync.htm": [ - "ae354ecee8e774f2005daca9084d3e6422f829be", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-network-error.htm": [ - "89701025efa1790f619cb568db41646feb83688a", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html": [ - "316f2748b8386490a0f76609d23e1059da3296ad", - "support" - ], - "XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts.html": [ - "f5c24af1aad9988eda0909af602b072c776be34a", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-sync-block-scripts.html": [ - "380cd66f0ffda3cd0e01df31aa2679c4869535f6", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt": [ - "90c79618132380421d63fcd08aab6fed2d5b97a2", - "support" - ], - "XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html": [ - "a702c102155a1399c4a53477fc079d61b739976f", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html": [ - "c96e8731cecbfb076b6c99ba4f751b9abaddabb8", - "support" - ], - "XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html": [ - "3972db1fa5ee4cad66ce28f603cdaaf0fff57a30", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-aborted.html": [ - "4ab45a7d5aeae8444885e61d73e8dffa96355f56", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-abortedonmain.html": [ - "c30d31d766d5e195303b39a50665c949603e0c4f", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-overrides.html": [ - "ffb40f33a3f0cb85520c1218c183c387fed89c29", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-overridesexpires.html": [ - "62d637e636a998a9da3245f6afc6b17782870929", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-reused.html": [ - "dbd2edcfc16a58a89f13c783de1ba2529786095c", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-simple.html": [ - "6d774362fc2bd235b272e163c5872fa632dbb80f", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-synconmain.html": [ - "db05db83076e62de39514f02b193d692e27642fc", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-twice.html": [ - "8352d6ff8e7e86240308e35e9bf2c8cd9ec55023", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-aborted.html": [ - "8719276489716c4a8d356710c2c190d9e8b5b06a", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-overrides.html": [ - "7c1702b9740dfd14b59de9d9c7743c7758a06b50", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-overridesexpires.html": [ - "fe7b691df755e1322262df44ef6dfb05cbf7fb8e", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-simple.html": [ - "7dd1f431b436aa9b9f7dbfe2e5aa9d42568cb6e4", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-synconworker.html": [ - "1387ef228dd7ee8fe9c02e670ec2eb8b1fa14646", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-timeout-worker-twice.html": [ - "2742bcec64e68283817457336bb1b3502440acdd", - "testharness" - ], - "XMLHttpRequest/xmlhttprequest-unsent.htm": [ - "8051e72ea6d92c55fa457eb88f00da3b7a873225", - "testharness" - ], "accelerometer/Accelerometer-disabled-by-feature-policy.https-expected.txt": [ "52f629ee03b150890f9177af60ab82f716e16ae3", "support" @@ -234276,7 +233207,7 @@ "testharness" ], "background-fetch/OWNERS": [ - "a8806dd5c4faea9ced8498f76d81db08755e2c9c", + "352bfdef11c883a99f5fb675a260424246665673", "support" ], "background-fetch/content-security-policy.https.window.js": [ @@ -236347,12 +235278,8 @@ "8e7326101e28ec65c6c834f7711b261917f93218", "testharness" ], - "content-security-policy/securitypolicyviolation/idl-expected.txt": [ - "f1b3ee148afebae4642d7fab699a73f91ce20bd0", - "support" - ], "content-security-policy/securitypolicyviolation/idl.html": [ - "5f2ff4a87aa476168cf3d13b10a8d81a387b8e42", + "fb8f2938d76a29cc68c46fb49a12feebc0031e54", "testharness" ], "content-security-policy/securitypolicyviolation/img-src-redirect-upgrade-reporting.https.html": [ @@ -236508,7 +235435,7 @@ "testharness" ], "content-security-policy/style-src/style-src-imported-style-blocked.html": [ - "e59517d75d3fbc29b701ffa296b7dd007a05c79d", + "a7d3453f54478b773e4d5702a7d83f0a38664f19", "testharness" ], "content-security-policy/style-src/style-src-injected-inline-style-allowed.html": [ @@ -236860,7 +235787,7 @@ "testharness" ], "cookie-store/OWNERS": [ - "8b9f9b13ab68b47156e6d8479ae1bfcd7ca1bf37", + "2118c49146d7ca543b37104c35c79aea5839de32", "support" ], "cookie-store/README.md": [ @@ -237200,7 +236127,7 @@ "support" ], "cors/README.md": [ - "acf95ba2292a36d28bbe9aa857428b2d1741ad33", + "d537dee8e8a21b90704293c13be8bc9d52d80528", "support" ], "cors/access-control-expose-headers-parsing.window.js": [ @@ -240791,6 +239718,14 @@ "2927ed2a8c86f6a791db5d6eb670ad1961b17e9e", "visual" ], + "css/CSS2/linebox/line-height-oof-descendants-001-ref.html": [ + "284fd0f610f5428bea7a5f9c0dee1bdde3a4670b", + "support" + ], + "css/CSS2/linebox/line-height-oof-descendants-001.html": [ + "bb8949f890f140305ac76beb3f3ae1f2d15b16a3", + "reftest" + ], "css/CSS2/linebox/support/1x1-green.png": [ "51e7b6974a09eda6cb31337717c5eaeb9c44b443", "support" @@ -251755,6 +250690,10 @@ "0a631e1bd4a8b410edd28a51675207f591e04a55", "reftest" ], + "css/css-backgrounds/background-repeat/gradient-repeat-spaced-with-borders.html": [ + "2880f6e6ab270572d9279d04ca196bfeae30a261", + "reftest" + ], "css/css-backgrounds/background-repeat/reference/background-repeat-no-repeat.xht": [ "3e5eecf9416348440b6d23dc7a817de5ed97ede7", "support" @@ -251779,6 +250718,10 @@ "0e0e06ed0f62fbcca2f5a087e807bf2ac74b1ad6", "support" ], + "css/css-backgrounds/background-repeat/reference/gradient-repeat-spaced-with-borders.html": [ + "b6e92428d5562a83424ef050f3c57dfc128a95a2", + "support" + ], "css/css-backgrounds/background-repeat/reference/support/rectangle-96x60.png": [ "36050bffda9382cfd978dc82a2f0244a535a6a46", "support" @@ -271963,6 +270906,22 @@ "5a7ac292f775b82e805dfe144028bfd954cbdef6", "testharness" ], + "css/css-tables/fixup-dynamic-anonymous-inline-table-001.html": [ + "f4d95c12388e4eea168905861dfe3ca43f178225", + "reftest" + ], + "css/css-tables/fixup-dynamic-anonymous-inline-table-002.html": [ + "34b57e26b3e496aea0317eca70ba7d3b52ed8882", + "reftest" + ], + "css/css-tables/fixup-dynamic-anonymous-inline-table-003.html": [ + "0b9ae9cd83227a8601a20b9eca7df34693ef0c56", + "reftest" + ], + "css/css-tables/fixup-dynamic-anonymous-table-001.html": [ + "cdad619b8955fbfabe7b187fcc06825f916acc58", + "reftest" + ], "css/css-tables/floats/floats-wrap-bfc-006b-ref.xht": [ "22f5ec058d34dc57c010bca8a301eaa8f7901880", "support" @@ -276860,7 +275819,7 @@ "reftest_node" ], "css/css-transforms/OWNERS": [ - "86257012c615c6580cea602a1ee2f8617dcbb336", + "284ad695bf55dd397a8ec5af124d77b4e27b9f3e", "support" ], "css/css-transforms/animation/resources/interpolation-testcommon.js": [ @@ -282143,6 +281102,30 @@ "a1dee75d914b68753af742ce8e6dbbac0397a9a6", "testharness" ], + "css/css-typed-om/stylevalue-objects/interface.html": [ + "5c9086db5b7f3a9d6e3109f1ce47385ad345f474", + "testharness" + ], + "css/css-typed-om/stylevalue-objects/parse-invalid.html": [ + "d46bda9e4f7c50d27c9f1e18c643e2b1a8570896", + "testharness" + ], + "css/css-typed-om/stylevalue-objects/parse.html": [ + "c3ee3a1c827e785e09b6ba531dc04f6324643312", + "testharness" + ], + "css/css-typed-om/stylevalue-objects/parseAll-invalid.html": [ + "1fca47c4dd76e15dfd975992512bb41c8233f31c", + "testharness" + ], + "css/css-typed-om/stylevalue-objects/parseAll.html": [ + "2b6761e72a7867218d2f9d9f780569b342c1d89c", + "testharness" + ], + "css/css-typed-om/stylevalue-subclasses/cssKeywordValue-interface.html": [ + "53394d04d67fa9526240c2c0af8b71f54a60a0c3", + "testharness" + ], "css/css-ui/OWNERS": [ "c9e05453fc137fdb2a4e99030acfbd06490384c2", "support" @@ -284491,6 +283474,10 @@ "be08a1510714e8b4fbc4d35582db5708924d06b2", "reftest" ], + "css/css-values/calc-in-color-001.html": [ + "32a0face898f08b854ac392c75368282d718be32", + "testharness" + ], "css/css-values/calc-in-media-queries-001.html": [ "f8fdd8373eaca7a03d6a089b4faf71825c8bfaf2", "reftest" @@ -284507,6 +283494,14 @@ "080551c1bee3d7bf54dda2c3d5b7e5a9fbd8aed6", "reftest" ], + "css/css-values/calc-serialization-expected.txt": [ + "d38b12521063bf2abf97c7481a84977c796296a7", + "support" + ], + "css/css-values/calc-serialization.html": [ + "d0bcbd402cb78e704dabc7f1665d40ba163e30eb", + "testharness" + ], "css/css-values/calc-unit-analysis.html": [ "c5fd567b4fa257ce53c48ebf8c444bf382459fec", "testharness" @@ -291291,6 +290286,14 @@ "0561564f185dcaf2ad3a8e14e081efb3c2c273e3", "testharness" ], + "css/cssom-view/scrollTop-display-change-ref.html": [ + "bb9079ba597cbcc27604cf8cc5556b4e6e0cda93", + "support" + ], + "css/cssom-view/scrollTop-display-change.html": [ + "68d33e9669be4db95ea9016a8893212e588189fd", + "reftest" + ], "css/cssom-view/scrollWidthHeight.xht": [ "503316b6ea12a881566cce0e2e78ddfc942297f0", "testharness" @@ -291811,6 +290814,14 @@ "8fc091c20efd7fc71c6c357278977ee6137fd8d4", "testharness" ], + "css/cssom/stylesheet-replacedata-dynamic-ref.html": [ + "e733dc40a41b899ab6c184211d75def5e52af3d4", + "support" + ], + "css/cssom/stylesheet-replacedata-dynamic.html": [ + "defc259c76eb8ab8b7e3c6ad90951bf4c6f18ab3", + "reftest" + ], "css/cssom/stylesheet-same-origin.css": [ "268fb9a72d33b3d18bbb82aaaac48bb15c89a88e", "support" @@ -292404,7 +291415,7 @@ "testharness" ], "css/geometry/OWNERS": [ - "d285ff64ce6e1d989fcdaa872058291292c4a383", + "ebf024caf83f15d412a4506032c59a785bbb842b", "support" ], "css/geometry/WebKitCSSMatrix.html": [ @@ -294403,6 +293414,10 @@ "9593a7d2dddc79525edb801748a28b1a5a1837c7", "testharness" ], + "css/selectors/invalidation/matches.html": [ + "7c0c602803f2de72e1c0ee4977a04c5054fb03c5", + "testharness" + ], "css/selectors/missing-right-token.html": [ "d961e801f7df57161cd8c7b5a4b26ae24013c3e9", "testharness" @@ -294487,6 +293502,14 @@ "601b8b8426c64717f82831e6258f8fe4188c797c", "reftest" ], + "css/selectors/selectors-attr-white-space-001-ref.html": [ + "0b790e2cb7a6ca66c7e6c8f769b61e3197f372fb", + "support" + ], + "css/selectors/selectors-attr-white-space-001.html": [ + "23c9560d06ddff28e5a1f43a10347a5e46377847", + "reftest" + ], "css/selectors/selectors-dir-selector-ltr-001.html": [ "3682f8a499ad2a1348f620b33b83944c0dc90788", "reftest" @@ -294515,6 +293538,14 @@ "4bdbbf2a6d3eeddb184f07d9c48acf10d22fe61d", "support" ], + "css/selectors/user-invalid-expected.txt": [ + "3096317da4568c9c16ea64e2621cf311f642ad6d", + "support" + ], + "css/selectors/user-invalid.html": [ + "3339b031a16d89383730244600b26917f6a3b293", + "testharness" + ], "css/selectors/utils/generators.pm": [ "58588efc7dd6ee4da504fed71d1a036c222d867c", "support" @@ -297348,7 +296379,7 @@ "testharness" ], "dom/events/Event-subclasses-constructors.html": [ - "5da96a9be09ad5dc69438ba9bd6b2ab58cf77ca1", + "52382c89b67be3c3fbb8bccccb6f75a4aaa7975b", "testharness" ], "dom/events/Event-timestamp-high-resolution.html": [ @@ -297396,7 +296427,7 @@ "support" ], "dom/events/EventListener-invoke-legacy.html": [ - "e56b332acb454ab76964b78588536777946ddff8", + "13cb3802cb2722417b876ded17fddd222c69564a", "testharness" ], "dom/events/EventListenerOptions-capture.html": [ @@ -300628,7 +299659,7 @@ "support" ], "encrypted-media/OWNERS": [ - "fefa5aaab3cb08043858d42e70bcf33e32b4ac3c", + "948172577050ec0e9340ca85f773bf47371be965", "support" ], "encrypted-media/README.md": [ @@ -301320,7 +300351,7 @@ "support" ], "entries-api/OWNERS": [ - "0e87cc2c701056689bc1d111302be9b998cb641f", + "ba7106d9fc77f16b859521a09f1af9703157c0a2", "support" ], "entries-api/errors-manual.html": [ @@ -301848,7 +300879,7 @@ "support" ], "fetch/README.md": [ - "cc3f679ff78bf2e3b39cf967102c257b84fd7680", + "fc07406a432360cd0f2f7650d9d34820568809e0", "support" ], "fetch/api/abort/cache.https-expected.txt": [ @@ -301960,7 +300991,7 @@ "testharness" ], "fetch/api/basic/request-headers-case.any.js": [ - "0d212a3cfc9d2e06d96aa367fb8b998527bd53b4", + "82450614d8c97e13e59dc3472caf09e06543ebf5", "testharness" ], "fetch/api/basic/request-headers.any.js": [ @@ -302263,14 +301294,6 @@ "fab90d344cbb78bad6445288c418b87736a830ae", "support" ], - "fetch/api/policies/referrer-origin-expected.txt": [ - "8d4f143671deab10b766fffa89726e4212a2ed36", - "support" - ], - "fetch/api/policies/referrer-origin-service-worker.https-expected.txt": [ - "911d68c3da09d88b43a172cab026855326dcb955", - "support" - ], "fetch/api/policies/referrer-origin-service-worker.https.html": [ "cf400b001e381251b0eaca8290e975dc27f6ff0f", "testharness" @@ -302299,10 +301322,6 @@ "ad4eae9b2a1368f4b251579b9a246177f1c5ebbc", "support" ], - "fetch/api/policies/referrer-origin-worker-expected.txt": [ - "177d80497c09f6e0e58fdd0353d55b066fe39e8f", - "support" - ], "fetch/api/policies/referrer-origin-worker.html": [ "66feccfd0f0f2e5f0a82d6e591e03621c593acc8", "testharness" @@ -302443,6 +301462,86 @@ "3099fb27913f11a983f955cb2a883a882911bfe4", "support" ], + "fetch/api/request/destination/fetch-destination-iframe.https.html": [ + "8b9f5f87086914fa8964702042a21bb833ff2d54", + "testharness" + ], + "fetch/api/request/destination/fetch-destination-no-load-event.https.html": [ + "df03c7ad35e9fcae0287c57d9fd18f741a35833c", + "testharness" + ], + "fetch/api/request/destination/fetch-destination-worker.https.html": [ + "65fc76503d95a359bf2fafebe603aa19bd0a2bfb", + "testharness" + ], + "fetch/api/request/destination/fetch-destination.https-expected.txt": [ + "bb4b6cb3fe7248a7e8090f05cdaf53b2d4f18f81", + "support" + ], + "fetch/api/request/destination/fetch-destination.https.html": [ + "5b7276e8a10bf91ee7d2a92917176b8e62c3255d", + "testharness" + ], + "fetch/api/request/destination/resources/dummy": [ + "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "support" + ], + "fetch/api/request/destination/resources/dummy.es": [ + "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "support" + ], + "fetch/api/request/destination/resources/dummy.es.headers": [ + "f7e15b2e1050398ae0a9f734dc84998c4abb459c", + "support" + ], + "fetch/api/request/destination/resources/dummy.html": [ + "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "support" + ], + "fetch/api/request/destination/resources/dummy.png": [ + "fa547a180b73a5422d52c1702c9d1e43b1083f9c", + "support" + ], + "fetch/api/request/destination/resources/dummy.ttf": [ + "10a7017b4caead6817aa08b25f14950e6402dd95", + "support" + ], + "fetch/api/request/destination/resources/dummy_audio.mp3": [ + "b9171c72fedef62f2b3b0ade70b6d085ba94f7e5", + "support" + ], + "fetch/api/request/destination/resources/dummy_audio.oga": [ + "167093849b93b142723513ac72a725c97da635a8", + "support" + ], + "fetch/api/request/destination/resources/dummy_video.mp4": [ + "c9828d21efc0898635b693bf3e2f34041d7e8ddb", + "support" + ], + "fetch/api/request/destination/resources/dummy_video.ogv": [ + "cb9a48e1d53911d5be214320adfbf7596632a316", + "support" + ], + "fetch/api/request/destination/resources/empty.https.html": [ + "da39a3ee5e6b4b0d3255bfef95601890afd80709", + "support" + ], + "fetch/api/request/destination/resources/fetch-destination-worker-iframe.js": [ + "e3629357f9d0e3f93659aff23ab3138cc7978823", + "support" + ], + "fetch/api/request/destination/resources/fetch-destination-worker-no-load-event.js": [ + "26aedd2a95b90728af7aaa3dc9c5d11153343a7e", + "support" + ], + "fetch/api/request/destination/resources/fetch-destination-worker.js": [ + "e10bc6423b2ee29387b1153546ae765449aa1ae4", + "support" + ], + "fetch/api/request/destination/resources/importer.js": [ + "cebbf26e5c2237b62a1b5b01eb434dbfa405d28c", + "support" + ], "fetch/api/request/multi-globals/current/current.html": [ "2d9ab238e07a88d19365f78bfd5db84d32854de1", "support" @@ -302532,17 +301631,13 @@ "testharness" ], "fetch/api/request/request-idl-expected.txt": [ - "aba10c1317628b544cb67b9d3637c767d611913b", + "1fa2e2a268a67500d3eb69ac7c706d62b0c8df6c", "support" ], "fetch/api/request/request-idl.html": [ "679ff0c44a0ece1c480f5296e738b7a15f4c79cb", "testharness" ], - "fetch/api/request/request-init-001.sub-expected.txt": [ - "ec513476243cf367338e66f0937908908d4c8cd6", - "support" - ], "fetch/api/request/request-init-001.sub.html": [ "49bc4349b4e7a85d88cacd54227355aa986535f1", "testharness" @@ -302567,10 +301662,6 @@ "e6c2afd6cef41d358016d4d021b7c3e0e1185704", "testharness" ], - "fetch/api/request/request-structure-expected.txt": [ - "10a0e500b1ab89d74b0f8ff3e8c191fd99b54b28", - "support" - ], "fetch/api/request/request-structure.html": [ "cc2471d809fcf7842c38762614c656bb45bb0fc7", "testharness" @@ -302776,7 +301867,7 @@ "support" ], "fetch/api/response/response-trailer.html": [ - "9597194813fc6ce3e63a7622eb61f791b8746ec7", + "aba9a9168c083a18a85336948c1ba72ca827562f", "testharness" ], "fetch/http-cache/304-update.html": [ @@ -302792,7 +301883,7 @@ "support" ], "fetch/http-cache/cc-request.html": [ - "d4417b8fd444362a3f217d1c95d37811a608e1a7", + "2002d341679139428e164cfe916dd39b9b664a3e", "testharness" ], "fetch/http-cache/freshness.html": [ @@ -302804,7 +301895,7 @@ "support" ], "fetch/http-cache/heuristic.html": [ - "5b0d55f891cb2e235456cd65f4e9f63e07999410", + "63837026eb6085fc7d6220c3dcab200b4bcd1eca", "testharness" ], "fetch/http-cache/http-cache.js": [ @@ -302820,11 +301911,11 @@ "testharness" ], "fetch/http-cache/partial-expected.txt": [ - "67533e199d09d884aba57040b5f43cecf4329ec6", + "c659858bc562718cfae0380cdc207b3e9155ab20", "support" ], "fetch/http-cache/partial.html": [ - "243e57c39f9e45e3e2acf845b36f3a140e3763bc", + "685057fe8876321a5d42bcf1e7582e6f0b745f85", "testharness" ], "fetch/http-cache/resources/http-cache.py": [ @@ -302836,11 +301927,11 @@ "testharness" ], "fetch/http-cache/vary-expected.txt": [ - "2d9f175edc73eb23776389b4d8a86696f1269512", + "45a0a59cb0fb445821fa27a790f3670c7be5e3f8", "support" ], "fetch/http-cache/vary.html": [ - "fa9a2e0554671bf2de5826e66ac0ea73de28d530", + "45f337270cfa90932c7469802655e313367ac92f", "testharness" ], "fetch/nosniff/image.html": [ @@ -311799,6 +310890,26 @@ "175e662819cfcc1f528fd8c0e3ed149eeba02e70", "reftest" ], + "html/form-elements/the-textarea-element/multiline-placeholder-cr.html": [ + "e8f7683568ad37b625fb32d97e80f4e15a9b6f66", + "reftest" + ], + "html/form-elements/the-textarea-element/multiline-placeholder-crlf.html": [ + "e0fbe39e2376e17611ec89f6f9a1b79b912cfe1a", + "reftest" + ], + "html/form-elements/the-textarea-element/multiline-placeholder-ref.html": [ + "69fe9939aea706500232485a2e105ae67fca6783", + "support" + ], + "html/form-elements/the-textarea-element/multiline-placeholder.html": [ + "3372eef00fd32ced307dbfa63f4b5c9cc6363f94", + "reftest" + ], + "html/form-elements/the-textarea-element/support/placeholder.css": [ + "3b200a40e2b7ba13f060772e821328db1de82cd0", + "support" + ], "html/iana/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" @@ -312359,6 +311470,22 @@ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" ], + "html/input/the-placeholder-attribute/multiline-cr.html": [ + "687054d9b221998ff4c4071ccc0733faeeb129b7", + "reftest" + ], + "html/input/the-placeholder-attribute/multiline-crlf.html": [ + "f953c175dce74670a915534fb513feb960fb5152", + "reftest" + ], + "html/input/the-placeholder-attribute/multiline-ref.html": [ + "e497f7bbe3359c11265619a439dc97756131e827", + "support" + ], + "html/input/the-placeholder-attribute/multiline.html": [ + "bc7c64db1dfdb3084a7c3606005a41fd71a20a9b", + "reftest" + ], "html/introduction/.gitkeep": [ "da39a3ee5e6b4b0d3255bfef95601890afd80709", "support" @@ -313771,6 +312898,10 @@ "77a9ee6e0d58d2aa905423f3b6f9d55492ed8eb9", "testharness" ], + "html/semantics/document-metadata/the-style-element/style_load_async.html": [ + "09e5519ec1a2d1f8b044f9d1309cf36695d4631d", + "testharness" + ], "html/semantics/document-metadata/the-style-element/style_media.html": [ "3d608438361d8bec5726feb468a3c2fbd5b7cb7d", "testharness" @@ -314739,6 +313870,10 @@ "e929f8e1755f72ecae96dd40430bc07c5a4a433c", "support" ], + "html/semantics/embedded-content/media-elements/track/track-element/resources/large-timestamp.vtt": [ + "0b8a4e4d4d5fdbf5a873e5ecc134469393bf3b7c", + "support" + ], "html/semantics/embedded-content/media-elements/track/track-element/resources/line-position-bad.vtt": [ "d75633c173c91a1f8a6a0fe1d173165ae92905f1", "support" @@ -314759,6 +313894,10 @@ "778ac955bd2e01b8c6c8fdf540c99f4513390f5e", "support" ], + "html/semantics/embedded-content/media-elements/track/track-element/resources/metadata.vtt": [ + "ea18a5275465fd2eaf68f066f085551c3035ccaa", + "support" + ], "html/semantics/embedded-content/media-elements/track/track-element/resources/missed-cues.vtt": [ "28c9acd7f24cc07d15c0685bdef1d435ffbbc89a", "support" @@ -314963,10 +314102,74 @@ "e9c8849350512b1247543939ee0e529947e47c2d", "testharness" ], + "html/semantics/embedded-content/media-elements/track/track-element/track-disabled-addcue.html": [ + "50932e2a3ce52440fa5e3af935f11120267bc4dd", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-disabled.html": [ + "7e62481158e3d571c7180b5c80376336ff77615a", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-element-dom-change.html": [ + "04ade2498b9ea6d3f576e47867a5ac6c91c3e424", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change-error.html": [ + "f8b49876351834df6f98b73d79039ec45a9940d1", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-element-src-change.html": [ + "b6d8d45a74cb90c0a4a63ca169867982ac235b15", + "testharness" + ], "html/semantics/embedded-content/media-elements/track/track-element/track-helpers.js": [ "b84cd1d9f96ee9b00cef2bd219e6da5b1ba1df8b", "support" ], + "html/semantics/embedded-content/media-elements/track/track-element/track-id.html": [ + "4e5e25d281d0d88a8b0a0dd1b098502b652bdac9", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-insert-after-load.html": [ + "856cb61cc9b6698f61de7438d027999888b6fa21", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-large-timestamp.html": [ + "fd1683cc93142f971a2b0c37321adf2e9911a4b8", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-load-error-readyState.html": [ + "6736b48cb3b591479c9589e50261290541177c51", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-load-from-element-readyState.html": [ + "82ae61caf89327293f566acc794f9c193aec122f", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-load-from-src-readyState.html": [ + "a4a3afae537fca943d343add9780ae3eb1f160bc", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-mode-disabled.html": [ + "e79126149eb97f0975a32fdaec6225d4c6c74957", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-mode-not-changed-by-new-track.html": [ + "2a494b59e2ec82dc881b913aaae4e773f47afb22", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-mode-triggers-loading.html": [ + "82b09068a101ec059a383a6b656eb85788e90fa3", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-mode.html": [ + "0fd7a0385671be222873aac3b1ebd4f21f4000ae", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-node-add-remove.html": [ + "15035dd10fc1c8eea099b09cb67b0b8309af41bf", + "testharness" + ], "html/semantics/embedded-content/media-elements/track/track-element/track-remove-active-cue.html": [ "dd3ab2e0e4f4ac3b4f83e5dfd539dd9c3aa5c961", "testharness" @@ -314987,6 +314190,18 @@ "931cfc4d06107dfccb001fbeaeef987cca528747", "testharness" ], + "html/semantics/embedded-content/media-elements/track/track-element/track-selection-metadata.html": [ + "b82d60202e4df526baedd40eafef7c63a2e2c51d", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-text-track-cue-list.html": [ + "1fc10a807231c4a4e3701c4b532138dc7b520c07", + "testharness" + ], + "html/semantics/embedded-content/media-elements/track/track-element/track-texttracks.html": [ + "b05cb3d0270a5066c3452974c5dbfd7815e49bc7", + "testharness" + ], "html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-align-positioning.html": [ "9283a8233cfc10c0c1745815b3f6bd970ffdde2a", "testharness" @@ -316988,7 +316203,7 @@ "support" ], "html/semantics/forms/textfieldselection/select-event.html": [ - "e4835db1c781cad4b259b782a57b452022a50d79", + "6232a1316c4221be0f2f28a91939adfbce5698f8", "testharness" ], "html/semantics/forms/textfieldselection/selection-after-content-change.html": [ @@ -317000,15 +316215,15 @@ "testharness" ], "html/semantics/forms/textfieldselection/selection-not-application.html": [ - "3763f117f8973ca9a994354ccbf22cb7114ece7a", + "db63d0d1eedec810d4c7e1b38789be457e06e985", "testharness" ], "html/semantics/forms/textfieldselection/selection-start-end.html": [ - "e38a79075e27780327f49e7ae9cadd2558165eac", + "3fd1c942f7ac3ed3097bbd1ec89db15fb0805476", "testharness" ], "html/semantics/forms/textfieldselection/selection-value-interactions.html": [ - "c568d7fe10cb4c2071b5d38530ad601988a789ea", + "39fe9646bbc2741e9bd3296d4e01513c99106151", "testharness" ], "html/semantics/forms/textfieldselection/selection.html": [ @@ -317388,7 +316603,7 @@ "testharness" ], "html/semantics/forms/the-input-element/month.html": [ - "1d833657f1db1e58fcc12a01af2ba06a665344aa", + "d0833c2b8ddd97c35200eb95ba0473795abf1f3b", "testharness" ], "html/semantics/forms/the-input-element/number.html": [ @@ -317468,11 +316683,11 @@ "testharness" ], "html/semantics/forms/the-input-element/type-change-state-expected.txt": [ - "3f4dc141789fbc963bdfc97228e5e033e6d713f8", + "23bab8f84ddac95f5585ea926240c0f4f2f7748d", "support" ], "html/semantics/forms/the-input-element/type-change-state.html": [ - "927c8f78d173edd6e82badf4a1584df3c50c5505", + "d731573ee091b7e658ea0b1ded46a764e8165f6c", "testharness" ], "html/semantics/forms/the-input-element/url.html": [ @@ -317484,7 +316699,7 @@ "testharness" ], "html/semantics/forms/the-input-element/week.html": [ - "851b1b794f820b1fb9b7ee57fe39f8f2977b7fe6", + "95fa0e8176311adcbb5a8d0d408d3c4c8bea100c", "testharness" ], "html/semantics/forms/the-label-element/.gitkeep": [ @@ -319227,6 +318442,14 @@ "32b68baebfa9d82753f186ff34789922b1467e81", "support" ], + "html/semantics/scripting-1/the-script-element/module/duplicated-imports-1.html": [ + "4bade87f4ec14382dcb627b3bd967829d508acc7", + "testharness" + ], + "html/semantics/scripting-1/the-script-element/module/duplicated-imports-2.html": [ + "52588aecb04a97167b54e0ff7c86f3c4f3fd2b2d", + "testharness" + ], "html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-fetch-error.sub.html": [ "1f50b5eecae10d42755dde7f2a108ae6353d6154", "testharness" @@ -319451,6 +318674,10 @@ "2180793400b87fa0793a9e30ec35608bc156a25e", "testharness" ], + "html/semantics/scripting-1/the-script-element/module/export-default.js": [ + "e42f8f1f98ad51b7350ff5e94935e655c4d1c34e", + "support" + ], "html/semantics/scripting-1/the-script-element/module/export-something-nested.js": [ "83de43bdd4d71d0e350c55df4c70ffbde2711ddd", "support" @@ -319536,7 +318763,7 @@ "testharness" ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html": [ - "65bf1fc554f0e32a486eb926763ceb948d84cbb6", + "b48335aa61dc13c34d2a77806f20663e2156bc6f", "testharness" ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-1.js": [ @@ -319544,15 +318771,23 @@ "support" ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html": [ - "c4788803d0882fdf7d5222974cc941dbedfdeddb", + "e2c860b1b348148fc6b9d77f918894b1bac42c94", "testharness" ], + "html/semantics/scripting-1/the-script-element/module/instantiation-error-3-expected.txt": [ + "5712e5186f10011fcbf8247e4bfc7bdb802737fa", + "support" + ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html": [ - "ac1ea5ad075d545595352f456e30066a61e4eeff", + "996d1aa45c5975e13ac0f1e9c9249b3d452ed2e2", "testharness" ], + "html/semantics/scripting-1/the-script-element/module/instantiation-error-4-expected.txt": [ + "2a1969c22eafb996bc0ca71e8a4d9ec6c14c65cd", + "support" + ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html": [ - "891daabc06f02663a86bcd748ae02b818fb36e14", + "224fe5510f09c3dd6d58f9dcf61b4d6fca04c96c", "testharness" ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-4a.js": [ @@ -319571,8 +318806,12 @@ "bcbde9b3648aaac72d8d2ae20846a53cef8abed3", "support" ], + "html/semantics/scripting-1/the-script-element/module/instantiation-error-5-expected.txt": [ + "05f755c9a6ba3c7243d7aeacbce088edf316f02d", + "support" + ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html": [ - "f69241733b1bb2edc0733dcce2d7db279d80805b", + "7239ae9f5705f7baf5630e67cf4bfdc6c25b108d", "testharness" ], "html/semantics/scripting-1/the-script-element/module/instantiation-error-5a.js": [ @@ -322336,7 +321575,7 @@ "testharness" ], "html/webappapis/system-state-and-capabilities/the-navigator-object/navigator.any.js": [ - "defa186d15df9349c70ca1c2b4f4877e06f63d3e", + "f0eec30cf73bb537ade740f81ca16e6980d4670b", "testharness" ], "html/webappapis/system-state-and-capabilities/the-navigator-object/navigatorlanguage.html": [ @@ -322444,11 +321683,11 @@ "testharness" ], "http/resources/securedimage.py": [ - "bc4c7a8b5eef0e082a5fa7c8c763957d92730747", + "b03f45c4dad3a9cd0f0fb67a99a79be3ba64b199", "support" ], "imagebitmap-renderingcontext/OWNERS": [ - "88028065ecd152d7a46a9afcf3c4748f36797f1e", + "942d0f99fe9687279413b61f54edf6d59492dcc0", "support" ], "imagebitmap-renderingcontext/bitmaprenderer-as-imagesource.html": [ @@ -322480,7 +321719,7 @@ "testharness" ], "images/OWNERS": [ - "bdefdf4bd84d02d2bff2eb4f48f0d54e6155d248", + "ce58ed6c4ee8ec737cb3a9d4f2c5fca99db6bfde", "support" ], "images/anim-gr.gif": [ @@ -323016,7 +322255,7 @@ "testharness" ], "keyboard-lock/OWNERS": [ - "4d077ab3d78e00f63f2592844e238702495476e9", + "6374a5c8d059bb62d557b9d1b20bd855eaab90fa", "support" ], "keyboard-lock/idlharness.https-expected.txt": [ @@ -323024,7 +322263,7 @@ "support" ], "keyboard-lock/idlharness.https.html": [ - "8b2fe1d77e8c4cc8a759a31bfb6f3d962f24992e", + "bcaf4f063cd423d5fb0e1055761e8880e4b63220", "testharness" ], "keyboard-lock/navigator-cancelKeyboardLock.https.html": [ @@ -324040,7 +323279,7 @@ "testharness" ], "mediacapture-streams/OWNERS": [ - "07fc6a5ece5e626316fe1d70f23fbe377b6618d3", + "e98bce3de2093ea1bb10405a90cfcca4c2c8d51a", "support" ], "mediacapture-streams/historical-expected.txt": [ @@ -325716,7 +324955,7 @@ "testharness" ], "notifications/OWNERS": [ - "4ed62abe9b6484ff66fbec2f517e3faec811e4c0", + "bfb6e07c89d184f712a20a9a2301c66d7d1ded93", "support" ], "notifications/body-basic-manual.html": [ @@ -325840,7 +325079,7 @@ "manual" ], "offscreen-canvas/OWNERS": [ - "88028065ecd152d7a46a9afcf3c4748f36797f1e", + "942d0f99fe9687279413b61f54edf6d59492dcc0", "support" ], "offscreen-canvas/compositing/2d.composite.canvas.copy.html": [ @@ -332907,10 +332146,6 @@ "b69da90e272530d4f42bf6d9c5b3b772d1ffce48", "testharness" ], - "preload/fetch-destination.https.html": [ - "d24a50f1f0a52371f84ec35ccc1d99df63c7da44", - "testharness" - ], "preload/link-header-on-subresource.html": [ "ea2f018b648d77b13b8010b4ebe63cdc5f846603", "testharness" @@ -333023,10 +332258,6 @@ "ac876cf9750337fcde99e547f5dc1223bb200772", "support" ], - "preload/resources/fetch-destination-worker.js": [ - "04e1fd5f1b1829ab9df389f9497681c585b42b78", - "support" - ], "preload/resources/foo.vtt": [ "fbfdfb2648866047d0fa2a4ad4fde3462a491857", "support" @@ -333315,47 +332546,51 @@ "bec450f77cd9a3a2f278cc41724ae55f23b883a3", "support" ], - "quirks-mode/blocks-ignore-line-height.html": [ + "quirks/active-and-hover-manual.html": [ + "b82c3af04387a133935d1eed50be37fdc34474b2", + "manual" + ], + "quirks/blocks-ignore-line-height.html": [ "01c5b2e89c88d4145429e8860eaa88f728d0601b", "testharness" ], - "quirks-mode/classname-query-after-sibling-adoption.html": [ + "quirks/classname-query-after-sibling-adoption.html": [ "a9fd790c46562057d00b9a042f548d28259042d0", "testharness" ], - "quirks-mode/hashless-hex-color.html": [ + "quirks/hashless-hex-color.html": [ "161c0bfaabbfb59c426e855b9dcfa746ea9e8f95", "testharness" ], - "quirks-mode/historical/list-item-bullet-size-ref.html": [ + "quirks/historical/list-item-bullet-size-ref.html": [ "2579fff5cb55faf66c71dfed695f05db8774d98d", "support" ], - "quirks-mode/historical/list-item-bullet-size.html": [ + "quirks/historical/list-item-bullet-size.html": [ "4874e6e43c91378da1ecf1d4e9534339e8bed9ec", "reftest" ], - "quirks-mode/line-height-calculation.html": [ + "quirks/line-height-calculation.html": [ "aa1ccb57bd83d8dd5f61a5571ae790993a3708c0", "testharness" ], - "quirks-mode/percentage-height-calculation.html": [ + "quirks/percentage-height-calculation.html": [ "de9964d89f79db9a85df6bf65b5bc039aa244380", "testharness" ], - "quirks-mode/supports.html": [ + "quirks/supports.html": [ "cac590a930dab33ba0ab7981c31b868861931493", "testharness" ], - "quirks-mode/table-cell-nowrap-minimum-width-calculation.html": [ + "quirks/table-cell-nowrap-minimum-width-calculation.html": [ "958b1856aa89ee5d5600163b22a75333be2c099e", "testharness" ], - "quirks-mode/table-cell-width-calculation.html": [ + "quirks/table-cell-width-calculation.html": [ "b7a8466a3842237ddf9446bd3ab49de043001526", "testharness" ], - "quirks-mode/unitless-length.html": [ + "quirks/unitless-length.html": [ "578d2aed4afa7cd6739610d353aebc591d832418", "testharness" ], @@ -341032,7 +340267,7 @@ "support" ], "resource-timing/resources/fake_responses.py": [ - "ea5b33477356da9f1053413537f36684ac5efdf2", + "09568d5f64474184cde594a47e26e374bcc8ac4d", "support" ], "resource-timing/resources/gzip_xml.py": [ @@ -341500,7 +340735,7 @@ "support" ], "service-workers/cache-storage/OWNERS": [ - "84dab860a34720bd705697303b702ab3a87cffe6", + "609ec43bda6c48d5543c96ce99a1b77d1b4b727b", "support" ], "service-workers/cache-storage/common.https.html": [ @@ -342019,12 +341254,16 @@ "ce7e7cf76aace24a92d455cdb6b54fc9048960e8", "testharness" ], + "service-workers/service-worker/fetch-event-respond-with-custom-response.https.html": [ + "fc304fa03a33021e4141d940835824883415279e", + "testharness" + ], "service-workers/service-worker/fetch-event-respond-with-partial-stream.https.html": [ "c0e976149cf49c09f52b81159d2a48c301a4aa4b", "testharness" ], "service-workers/service-worker/fetch-event-respond-with-readable-stream.https.html": [ - "cf31c2b1cba37a016dc9e9a3ddb2429a5d518052", + "37c7959e58af70f3feea0f4fb46d778734a0296b", "testharness" ], "service-workers/service-worker/fetch-event-respond-with-response-body-with-invalid-chunk.https.html": [ @@ -342360,7 +341599,7 @@ "testharness" ], "service-workers/service-worker/navigation-redirect.https.html": [ - "f8e79356467abba33e8008054c32baabc770fe65", + "109f463deeaad2d60d4dab644c782ad633e97a7d", "testharness" ], "service-workers/service-worker/onactivate-script-error.https.html": [ @@ -342520,7 +341759,7 @@ "support" ], "service-workers/service-worker/resources/about-blank-replacement-popup-frame.py": [ - "0780db5196b416d599dc172c8a5503ed8d260317", + "498a08b652ec0d867e8d2e173be954f69354a208", "support" ], "service-workers/service-worker/resources/about-blank-replacement-uncontrolled-nested-frame.html": [ @@ -342763,16 +342002,16 @@ "b58b92a145a89f71c414de5e837c1db026beb1d6", "support" ], + "service-workers/service-worker/resources/fetch-event-respond-with-custom-response-worker.js": [ + "a5d0d55ccfa7c3c4c285153aa14b81ef205329c9", + "support" + ], "service-workers/service-worker/resources/fetch-event-respond-with-partial-stream-worker.js": [ "6054d723ad0d0d310b02841b696d2357e7137398", "support" ], - "service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-iframe.html": [ - "16fe2d0f84bb7898f7a89182e24001b3bc64775e", - "support" - ], "service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-worker.js": [ - "7f120661c9b24647f33dc41c36610ad3a1afef6a", + "052da5a0a6b26098fe745fd6d9ca8de0f4dfdc5b", "support" ], "service-workers/service-worker/resources/fetch-event-respond-with-response-body-with-invalid-chunk-iframe.html": [ @@ -342864,7 +342103,11 @@ "support" ], "service-workers/service-worker/resources/fetch-request-no-freshness-headers-iframe.html": [ - "6da48549aa02c25ffed99c9bdf3549e109f62e60", + "46c88ffb3ab29307b6aedc781c04223eef149cbd", + "support" + ], + "service-workers/service-worker/resources/fetch-request-no-freshness-headers-script.py": [ + "a2e1741d8265e8aa00959de6aef17cde58b2b6e4", "support" ], "service-workers/service-worker/resources/fetch-request-no-freshness-headers-worker.js": [ @@ -343143,6 +342386,10 @@ "df15579b54fc14412435eee789c81a6523a394fc", "support" ], + "service-workers/service-worker/resources/pass.txt": [ + "27d2303f215d7d1a8f12f0b80b9b56a2cdf6c9a7", + "support" + ], "service-workers/service-worker/resources/performance-timeline-worker.js": [ "fc275abc58d82c338ff369ba62994bd3d5609a67", "support" @@ -344220,7 +343467,7 @@ "testharness" ], "storage/OWNERS": [ - "12440f4f1664a6de93ebe0662f153492cbe5e428", + "858262a742df1d152d85b55cb47df59464d68809", "support" ], "storage/README.md": [ @@ -345736,7 +344983,7 @@ "support" ], "svg/OWNERS": [ - "f1806810416353aa3a92927fcdc7fb407960b41e", + "c04887939259dfb1b37463f2df46bce9f862114a", "support" ], "svg/README.md": [ @@ -346052,7 +345299,7 @@ "testharness" ], "touch-events/historical.html": [ - "668253cfe71fe71583697c8f927791b3c2fb5bdf", + "e03c5d8efc58acd552a394f23b66eceeef448f86", "testharness" ], "touch-events/multi-touch-interactions.js": [ @@ -347164,7 +346411,7 @@ "support" ], "wasm/wasm_local_iframe_test.html": [ - "dd715a4da792b9d8d634536d938b278230c66df5", + "e7b86a731b7cf7c122a1e37118cebce7342291fc", "testharness" ], "wasm/wasm_serialization_tests.html": [ @@ -347188,27 +346435,27 @@ "support" ], "web-animations/README.md": [ - "5d6d7e4d3f727b70bd2197fb48e7a1bc04147c6a", + "6344565e53b2f9e8d6ee7658d1c5c5670e68fc98", "support" ], "web-animations/animation-model/animation-types/accumulation-per-property.html": [ - "19f8cefdfe60cf8501e7743967dc8fd4a006e4d6", + "b26f3961d1913de731906ff0eed9a8548df7bbb2", "testharness" ], "web-animations/animation-model/animation-types/addition-per-property.html": [ - "a2abe830178357b19c6e220b14b5601b15d635f5", + "c16ee3be3338bd5831ff3eab455cbf6943aa8d5b", "testharness" ], "web-animations/animation-model/animation-types/discrete.html": [ - "a5fd7c9ae255d076f23b6819636f7f663589e44c", + "f3e48d8ddd42f1eecb36af2a8e1cfade6d0a02d4", "testharness" ], "web-animations/animation-model/animation-types/interpolation-per-property.html": [ - "089b1ee060459aefe130031ddda42629edb28a7b", + "2bcb2919b3034042d8a61d7af5de099a42386451", "testharness" ], "web-animations/animation-model/animation-types/property-list.js": [ - "b91b4a5d13d7aaf7cd5e953cba3d12e950110a08", + "7f20ed34cf9c72b53db3206639367eff69f0e226", "support" ], "web-animations/animation-model/animation-types/property-types.js": [ @@ -347224,7 +346471,7 @@ "support" ], "web-animations/animation-model/combining-effects/effect-composition.html": [ - "9c043a059c26a2c1449663d4fc881e8568a53206", + "5d6c3904de02eb3b6c890163ccdc6b8cb6499e56", "testharness" ], "web-animations/animation-model/keyframe-effects/effect-value-context-expected.txt": [ @@ -347232,7 +346479,7 @@ "support" ], "web-animations/animation-model/keyframe-effects/effect-value-context.html": [ - "87689f24cd6bdae1a8296fcc9b96fc51455c17c9", + "da405e4bfc35d5d0b4c151706b09eb1a84d2f0da", "testharness" ], "web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt": [ @@ -347240,15 +346487,15 @@ "support" ], "web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation.html": [ - "3034db6e48e55ad5075f17f5812ee4c396606ff8", + "bda186b311457e58c48ca5cf4619f485a41f8e2d", "testharness" ], "web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes.html": [ - "5725dc5f7d0c2b532d22add77c0f82780dd252dd", + "2b10d6fb1cb925290caf57e4cefc3c3f8161777c", "testharness" ], "web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html": [ - "68f8181b4592b25195e202facf646d9035040db5", + "8fd7dbbaf98947f8101c760e41d9cc909c844d2d", "testharness" ], "web-animations/interfaces/Animatable/animate-expected.txt": [ @@ -347260,19 +346507,19 @@ "support" ], "web-animations/interfaces/Animatable/animate-no-browsing-context.html": [ - "1d9479b404662702c2592099bde95a472f65d403", + "5c30bc76f60eb479cba967f91c6a80af7df8e2e7", "testharness" ], "web-animations/interfaces/Animatable/animate.html": [ - "2860fe7264ba57cff3f73725cf95b7d7640a10f1", + "8d76a26de47494600da40e756a26de61329ff3aa", "testharness" ], "web-animations/interfaces/Animatable/getAnimations.html": [ - "dfeebb2790874de472ebb56c7fabe81b05db77f9", + "9c03f9a6410dc8463a3e3acb3b6e38c26d79b097", "testharness" ], "web-animations/interfaces/Animation/cancel.html": [ - "7fa9434d51ba76b0f097cf0f5701b49e8724caaa", + "38d509e24fa224fc8b937e4a63dd1c404e72b466", "testharness" ], "web-animations/interfaces/Animation/constructor-expected.txt": [ @@ -347280,27 +346527,27 @@ "support" ], "web-animations/interfaces/Animation/constructor.html": [ - "c9d4da018b279b9fb7262139f6fb12634deac858", + "f4dc4fdca61255557ed346412e134745bce1a3ed", "testharness" ], "web-animations/interfaces/Animation/effect.html": [ - "bab0a2227994194c58e23edb3080d519ea453d1e", + "4445fc8bd2120fb1e212dfc6a1fcf786a531ee6f", "testharness" ], "web-animations/interfaces/Animation/finish.html": [ - "629203bd3888631c616093315f2c3f1219486131", + "64acecec8528b4d241d5dcb9248ef82eafa02810", "testharness" ], "web-animations/interfaces/Animation/finished-expected.txt": [ - "f472d4b787af844a844d6498ebde53881c5a2662", + "bbf5319f8bf5d347fa37c9ca885133bdef7380e8", "support" ], "web-animations/interfaces/Animation/finished.html": [ - "680fe7552b0cf5a246e11cd63540b343f56608bf", + "ffcba3379db7094455a7798e4d5972d8e52caec5", "testharness" ], "web-animations/interfaces/Animation/id.html": [ - "2e40d20a3b221a4b99e776bdeb951c7cba173f57", + "4e3dd92351d76c5c7d09ddd1ca025520f4c8875d", "testharness" ], "web-animations/interfaces/Animation/idlharness-expected.txt": [ @@ -347308,15 +346555,15 @@ "support" ], "web-animations/interfaces/Animation/idlharness.html": [ - "b369d57caf6557abee257ecbae0c7b4fd49965d7", + "989e773dbf3d7d57f26b41108bc3d7f0b3ea3168", "testharness" ], "web-animations/interfaces/Animation/oncancel.html": [ - "03c14c90672fa8f3a4c909ceb698a1bc421208db", + "82abc08a0b416f5198239464fb4fc01d2edd6e1c", "testharness" ], "web-animations/interfaces/Animation/onfinish.html": [ - "597362b0108c367511c26b9561158b6f32c63f54", + "db82fabeaf2b646647f134634fef30f05e5ec7f8", "testharness" ], "web-animations/interfaces/Animation/pause-expected.txt": [ @@ -347324,7 +346571,7 @@ "support" ], "web-animations/interfaces/Animation/pause.html": [ - "5be086cfc44f3d6d464016c2fe9b17220a6a4dc6", + "f044cc7ac09c38f127e399f7d6f9a0714046aa8e", "testharness" ], "web-animations/interfaces/Animation/pending-expected.txt": [ @@ -347332,47 +346579,47 @@ "support" ], "web-animations/interfaces/Animation/pending.html": [ - "38042fa2c8c1c4d0dae660e0d33393ba404a7c4d", + "5677f7e8b076dc096d636aaaa4d4191c286f1d90", "testharness" ], "web-animations/interfaces/Animation/play.html": [ - "b375f449a4c75b02d0d746e44e2ca6ff9646819b", + "54edbdd6c0e1953f8d0e2bfbb92bfe318114ab74", "testharness" ], "web-animations/interfaces/Animation/playbackRate.html": [ - "a5463d070f7273e54099bc94d8a7b31b5366665d", + "27d289f603953b3e39322287fb2a55f84dd8dc54", "testharness" ], "web-animations/interfaces/Animation/ready.html": [ - "b8c58b9d8b77ff5c10ba0f400df37e07e5bd8087", + "bd4a18205791b2b0271a6266dba3ebc8482c835b", "testharness" ], "web-animations/interfaces/Animation/startTime.html": [ - "4bafbec148bbd4b9a797fd96f482e1ed4cceabfe", + "01f669542434f03d37e9f148a4f3135fe3122d46", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/delay.html": [ - "17150915a06587117c3b521a212b70861afe0a04", + "4de5b0a692d645961de27df67efa8257adb0a031", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/direction.html": [ - "e34557857943fb90b4f28ff52441961c8076c4d8", + "11398d5ea40bb4137b4f5d4e6e6238af64caf3c5", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/duration.html": [ - "06e68349701e4dc74c79c93ce580e8f529f11594", + "315810a1e73f9b4ef2cffea868fb766af5ee5c93", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/easing.html": [ - "749c648048db7846ece84bdfe1de8bb4eeb01ff7", + "b3ad4c78c9bce0e17db0ce780cd1260de1ce7cb0", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/endDelay.html": [ - "c274f5ce7947e82f8bfdbdc9638a018be0d1906c", + "b36d9c8a4e4082e6a75ac5d8f336cf474cd75aab", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/fill.html": [ - "8d774222c824f838f846c64379b8751eeb5a57d9", + "1cef601cde33eea3b591a0826ad52f379bb31d0d", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/getComputedTiming-expected.txt": [ @@ -347380,19 +346627,19 @@ "support" ], "web-animations/interfaces/AnimationEffectTiming/getComputedTiming.html": [ - "d88434cb8b9ec4e4e3821e85dca4f4f34ec4402d", + "020e9faaae05de5a25829a05558ea72672b04f63", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/idlharness.html": [ - "a4e72d3ebf93a0bb6934f887c3da250a2ab67b63", + "aa9823e5a06c76921b49aa5f5e61fd1dedfac3af", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/iterationStart.html": [ - "6a31d545493852f33b2e6a54a18ea87f16c5247a", + "734743adeec628da907ea2f6cc4ae3be3aab7329", "testharness" ], "web-animations/interfaces/AnimationEffectTiming/iterations.html": [ - "f04176dc8a55a7dc309b72d093b78704109258e2", + "c8705eb209d8a4912b5d3fd94a05c763b7707eca", "testharness" ], "web-animations/interfaces/AnimationPlaybackEvent/constructor-expected.txt": [ @@ -347400,11 +346647,11 @@ "support" ], "web-animations/interfaces/AnimationPlaybackEvent/constructor.html": [ - "f66a3e998c900cd169c2104b7c0e7ea51271330c", + "5aff03b7fa469e5ec0dc02a389eca963ae24b470", "testharness" ], "web-animations/interfaces/AnimationPlaybackEvent/idlharness.html": [ - "37bd201a374913d0cd580b89b07688b5b655776d", + "bfdfc896fb5fe4451419464e35fe94b5e4938c2c", "testharness" ], "web-animations/interfaces/Document/getAnimations-expected.txt": [ @@ -347412,23 +346659,23 @@ "support" ], "web-animations/interfaces/Document/getAnimations.html": [ - "c07b9871f08df1183a3a33d08cc68b2d256cd493", + "12fdbce3e75f5a7d7771d9337089255ef73f9712", "testharness" ], "web-animations/interfaces/Document/timeline.html": [ - "ab6b19fc85e278418bd58308d6ffd5863a1dc940", + "2577a2d5c89fa0eec3cae2fd07b66e576ee6a483", "testharness" ], "web-animations/interfaces/DocumentTimeline/constructor.html": [ - "9f683dd88b148222d43736c464320bb51e9533d0", + "b11caf0a1766818a168a7f91b01ccd6ae9a7e4f0", "testharness" ], "web-animations/interfaces/DocumentTimeline/idlharness.html": [ - "fde7ae3f320a94619c9bb879d77d1de392212846", + "72cb7900f86611e9c2a1b0f4acd0f634555310b9", "testharness" ], "web-animations/interfaces/KeyframeEffect/composite.html": [ - "0ee4b5505a670202f0e25d483a83a10e3c8a5094", + "7dd18327d8da81914adaf443086891ba3646d882", "testharness" ], "web-animations/interfaces/KeyframeEffect/constructor-expected.txt": [ @@ -347436,7 +346683,7 @@ "support" ], "web-animations/interfaces/KeyframeEffect/constructor.html": [ - "e3cb7dfa2239e29214b5a1f88cebc5d35b16ec18", + "4a80ea073da0a9c62dcb9587676445a2fba234e1", "testharness" ], "web-animations/interfaces/KeyframeEffect/copy-constructor-expected.txt": [ @@ -347444,7 +346691,7 @@ "support" ], "web-animations/interfaces/KeyframeEffect/copy-constructor.html": [ - "16c69e33c1022f643a961f6f2d85c59010164e9d", + "6ef462ddc696269f132d596188ffd5e8da1e1164", "testharness" ], "web-animations/interfaces/KeyframeEffect/idlharness-expected.txt": [ @@ -347452,7 +346699,7 @@ "support" ], "web-animations/interfaces/KeyframeEffect/idlharness.html": [ - "d51dfde748bfdf12a1b06452099ea74fe2951a34", + "f05c9bd1cdee77ff6be143b0eb4f982c7218908b", "testharness" ], "web-animations/interfaces/KeyframeEffect/iterationComposite-expected.txt": [ @@ -347460,7 +346707,7 @@ "support" ], "web-animations/interfaces/KeyframeEffect/iterationComposite.html": [ - "8aac788873a17d840cef91ba3441451b28f40f8b", + "65cd746596a6770d1101b030769712be433bf6f3", "testharness" ], "web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001-expected.txt": [ @@ -347468,7 +346715,7 @@ "support" ], "web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html": [ - "78e32ec633628ef4f236751aa159ac05b14dda2c", + "165b651cea12ab9e0825f4335e7f697ce1fc6247", "testharness" ], "web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002-expected.txt": [ @@ -347476,7 +346723,7 @@ "support" ], "web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html": [ - "ea466d345a41c600835d278aaccf531cf3a3cc75", + "e9237e244034845f6f902f8149a0e66e5b6164f2", "testharness" ], "web-animations/interfaces/KeyframeEffect/setKeyframes-expected.txt": [ @@ -347484,7 +346731,7 @@ "support" ], "web-animations/interfaces/KeyframeEffect/setKeyframes.html": [ - "7e4965fd6cee3406b008b093d2e2873b6eea98e9", + "a346e0e004010a6f51e06ffd30d0b6eddd45421d", "testharness" ], "web-animations/interfaces/KeyframeEffect/target-expected.txt": [ @@ -347492,7 +346739,7 @@ "support" ], "web-animations/interfaces/KeyframeEffect/target.html": [ - "2e08f003caf998de2267b77416813e58a52f06e3", + "94bad3b00de7591e9faa7bd479a457b7b76f76b5", "testharness" ], "web-animations/resources/easing-tests.js": [ @@ -347500,7 +346747,7 @@ "support" ], "web-animations/resources/effect-tests.js": [ - "b35091529e7fc13348ee95ffdf194735bfb7c151", + "2eb26f4cb0e65282b8e82014ac8ebe87a4209c6a", "support" ], "web-animations/resources/keyframe-tests.js": [ @@ -347516,11 +346763,11 @@ "support" ], "web-animations/testcommon.js": [ - "9556f3b9f2e52f0998519e0572154aca0568ff25", + "94130b39fda8e95ca495d297f9d47eefa6430a04", "support" ], "web-animations/timing-model/animation-effects/active-time.html": [ - "e1c65069bf437b2a18835fd7339e4a0758b86186", + "68ca985984ed6f868cebb539dfde6d7ddba6c824", "testharness" ], "web-animations/timing-model/animation-effects/current-iteration-expected.txt": [ @@ -347528,7 +346775,7 @@ "support" ], "web-animations/timing-model/animation-effects/current-iteration.html": [ - "02094259ab6ce032aaef9a1381422d6c25c8055f", + "617bfd8c533d159c4e56ea823917d580fe262bf6", "testharness" ], "web-animations/timing-model/animation-effects/local-time-expected.txt": [ @@ -347536,7 +346783,7 @@ "support" ], "web-animations/timing-model/animation-effects/local-time.html": [ - "482cd69507100d58a41a3b17a3de9198e99165c7", + "cd76b6be13cba0bc7d3b1a0e87b70c6a66222f40", "testharness" ], "web-animations/timing-model/animation-effects/phases-and-states-expected.txt": [ @@ -347544,7 +346791,7 @@ "support" ], "web-animations/timing-model/animation-effects/phases-and-states.html": [ - "73ef4e64d766319376fdf6bd64ef55273f97d80c", + "3edd2c4bdd8409c2c12f08bc998dd8d532e0fd7d", "testharness" ], "web-animations/timing-model/animation-effects/simple-iteration-progress-expected.txt": [ @@ -347552,23 +346799,23 @@ "support" ], "web-animations/timing-model/animation-effects/simple-iteration-progress.html": [ - "89207d5638cdf20647d3dc7300f564f6ab9eda0d", + "602fe7e6880e0b18329262699872c696f451d744", "testharness" ], "web-animations/timing-model/animations/canceling-an-animation-expected.txt": [ - "17e878b21fb3f3d66b0d02da67471dea1acdb0ba", + "e68a10693c3fc2ca8a755767f8543fbc1454bf38", "support" ], "web-animations/timing-model/animations/canceling-an-animation.html": [ - "c4cc62ac4a9e826496eb7be12d33551861f25064", + "d82cbc5caf654b9811c90d5165fb0429891cb149", "testharness" ], "web-animations/timing-model/animations/current-time.html": [ - "0c9341f917a56205e9f7e33cc809f87c5c7f831e", + "390e2ba8d6de9bfea5f26cd2e7a42ccdf73f1a35", "testharness" ], "web-animations/timing-model/animations/finishing-an-animation.html": [ - "f662027f020312c17ec9385542583ba675c38e82", + "8d430adcb97bf3dab9703bc2d31be23e1adaec85", "testharness" ], "web-animations/timing-model/animations/pausing-an-animation-expected.txt": [ @@ -347576,7 +346823,7 @@ "support" ], "web-animations/timing-model/animations/pausing-an-animation.html": [ - "689b3dbdb202210d908e61ed780a7c43f2a7f04c", + "c46fbcb8bc40fc3ee26e10802a205926ab97a84f", "testharness" ], "web-animations/timing-model/animations/play-states-expected.txt": [ @@ -347584,11 +346831,11 @@ "support" ], "web-animations/timing-model/animations/play-states.html": [ - "6d460def8ee43c4c044bc80f9c41954891b7cb06", + "3ec76eff991e306699b21fb03bc1f346ffd9cee3", "testharness" ], "web-animations/timing-model/animations/playing-an-animation.html": [ - "700443f8c4a5573f0fa01932e3a6c143ccc7620f", + "6ee1b850154ce22fffafa686fc2fdfef9dded38b", "testharness" ], "web-animations/timing-model/animations/reversing-an-animation-expected.txt": [ @@ -347596,11 +346843,11 @@ "support" ], "web-animations/timing-model/animations/reversing-an-animation.html": [ - "2f23c434ffded1caea40dd2511ed91e7d2ca1d8a", + "3afdb3cc9a9dafb28ebe46902276c19c24aeb9a8", "testharness" ], "web-animations/timing-model/animations/set-the-animation-start-time.html": [ - "ee034df474b45ec0f186dd2de44c453ffad212ef", + "10fea7d0b0dbe046d72b4048607816c9ebe37f7f", "testharness" ], "web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt": [ @@ -347608,7 +346855,7 @@ "support" ], "web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html": [ - "fa6bfd26bd1df7a12959cbbbd8eda8a92ac265d6", + "3b7f1f60cd771ff8587daf7ab76ccbecff59f781", "testharness" ], "web-animations/timing-model/animations/set-the-timeline-of-an-animation-expected.txt": [ @@ -347616,11 +346863,11 @@ "support" ], "web-animations/timing-model/animations/set-the-timeline-of-an-animation.html": [ - "c167894c1968cf15b85ebe329bd50e7e00782195", + "ef8ce243226296718453e10d89b4cfd68b2d765e", "testharness" ], "web-animations/timing-model/animations/updating-the-finished-state.html": [ - "74caa48024c826fcd2747d206fc2e9bebf9828be", + "c30161f7d5a20db616ade354133ae6a8989d149f", "testharness" ], "web-animations/timing-model/time-transformations/transformed-progress-expected.txt": [ @@ -347628,15 +346875,15 @@ "support" ], "web-animations/timing-model/time-transformations/transformed-progress.html": [ - "84bd0be22d6e250cfefd118d306b2790f67471cc", + "2e55f43def584a67eeb313f050154cd146002938", "testharness" ], "web-animations/timing-model/timelines/document-timelines.html": [ - "bbe8a5565d88c5697170eba02be6858589383fdf", + "d0fcb390c19c9ede7288278dc11ea5b3d33671cb", "testharness" ], "web-animations/timing-model/timelines/timelines.html": [ - "e0164509c7fd07ec9deec024d5d7e370c5e0d705", + "29d7fe91c355fc22f563ca17315d2ab493dc0566", "testharness" ], "web-nfc/OWNERS": [ @@ -347820,7 +347067,7 @@ "support" ], "webaudio/OWNERS": [ - "73d9bb2cb2f23589c3935bef954cd2c5e280ff13", + "340b3a2dfd65901c3ad9bc52657aa76dd590572e", "support" ], "webaudio/README.md": [ @@ -348552,7 +347799,7 @@ "testharness" ], "webrtc/OWNERS": [ - "8edd63a3a9622e18424a4e9c6dc41ae8620c6af9", + "029972b55b8ece773bd13d288f590b34b2974b20", "support" ], "webrtc/RTCCertificate-expected.txt": [ @@ -350176,7 +349423,7 @@ "support" ], "webstorage/OWNERS": [ - "b3120199ea12c33172cd01146740e1848fc8a719", + "4e5fe0528ae51c9ac475c29195e1c473a5a01e1f", "support" ], "webstorage/README.md": [ @@ -350607,6 +349854,10 @@ "e88f3e9ddc5a5d4d9597403e8f7ef01d1daa339a", "support" ], + "webvtt/api/VTTCue/constructor-exceptions.html": [ + "0d7efaa2a234a5913412890517fa4722922c08ea", + "testharness" + ], "webvtt/api/VTTCue/constructor.html": [ "c844f513868cbf4053c70f37bbb630b53a763a2a", "testharness" @@ -353463,10 +352714,18 @@ "b32446a62602baf1a316520ee8e2e5d9e60cada3", "support" ], + "workers/SharedWorkerPerformanceNow.html": [ + "c493b44bc08eef8e99e7067ad7ecaaa1fd62f1d4", + "testharness" + ], "workers/SharedWorker_blobUrl.html": [ "d74620a63e7d911ef60b995cabf6b360c2c46a4f", "testharness" ], + "workers/SharedWorker_dataUrl.html": [ + "285538767c2c79223f12b58da4e347eee8101ccc", + "testharness" + ], "workers/WorkerGlobalScope_ErrorEvent_colno.htm": [ "8ceb41543f928c918010000d638099faeb674980", "testharness" @@ -353587,6 +352846,10 @@ "f7b95f548c851b082764de88b6f81181ebb387c0", "testharness" ], + "workers/WorkerPerformanceNow.html": [ + "36e133df54ceac72de4dfe3ecd0e70957a4a76e1", + "testharness" + ], "workers/Worker_ErrorEvent_bubbles_cancelable.htm": [ "d9803ca1074c58efc9cb268e4c56aa17e8f84cd0", "testharness" @@ -354511,6 +353774,10 @@ "3ec24ed15f1be767ccdbfc7bb9d63189d807ec6c", "support" ], + "workers/support/WorkerSendingPerformanceNow.js": [ + "4275a356316ca0b405d3afc7569ab9f27046a634", + "support" + ], "workers/support/WorkerTerminate.js": [ "61ceb56b0a4ec218ad849ab2abd76f7d5f56f734", "support" @@ -354519,6 +353786,10 @@ "b0e679dd7720701364abeaca6870d94db5d7ee74", "support" ], + "workers/support/iframe_sw_dataUrl.html": [ + "2cd66112b612e7b861af00af5ccc26cc7c5a76f8", + "support" + ], "workers/support/name-as-accidental-global.js": [ "530670268fae610b60066773ee475743b8498b53", "support" @@ -354540,7 +353811,7 @@ "support" ], "workers/worker-performance.worker.js": [ - "513fd99e7c523b710386b7e3736d1cbbc6a20e7a", + "c6a02eed61fe26e59252314cbbe090eeed9de9ca", "testharness" ], "worklets/OWNERS": [ @@ -354750,6 +354021,1666 @@ "x-frame-options/support/xfo.py": [ "722b135e1633e63fbfcb06bca4759a9568a84ee8", "support" + ], + "xhr/FormData-append.html": [ + "b41637b9f13c7876b581f0fb0162baea758d50e2", + "testharness" + ], + "xhr/README.md": [ + "bedec5c5902a98182c0d9456f81a9d0859f35095", + "support" + ], + "xhr/XMLHttpRequest-withCredentials.any.js": [ + "258104b78168059e67c84aa49c1b236c200633aa", + "testharness" + ], + "xhr/abort-after-receive.htm": [ + "b3b42e616f1af845a5280e56862d81fcb1491e57", + "testharness" + ], + "xhr/abort-after-send-expected.txt": [ + "e5b47c4b2e4db1ba9bd647414dbec1fa2dd952e0", + "support" + ], + "xhr/abort-after-send.htm": [ + "1ec12c1906dd99e9c048925c560ce1b9ac1a4410", + "testharness" + ], + "xhr/abort-after-stop.htm": [ + "3feb39f2451afa624771437337c669865fac29b5", + "testharness" + ], + "xhr/abort-after-timeout.htm": [ + "26252843e67111ee53079bb67619fccde700000d", + "testharness" + ], + "xhr/abort-during-done.htm": [ + "e613a5d6f008f867b406105f1fabbeceb05f032f", + "testharness" + ], + "xhr/abort-during-headers-received.htm": [ + "7ec861de6c552c3b799f4848408aca5c381f3ce1", + "testharness" + ], + "xhr/abort-during-loading.htm": [ + "d536b0f1b6cd251a3ee1812501bf60e25130b543", + "testharness" + ], + "xhr/abort-during-open.htm": [ + "bc528083ac09ef3666eb07d294bc2b48dc142791", + "testharness" + ], + "xhr/abort-during-open.js": [ + "f46bf95a38cc79fe499f4990457fcf1eaa193068", + "support" + ], + "xhr/abort-during-open.worker.js": [ + "94180bce348fa9fd3826a8993d701936141b8b0b", + "testharness" + ], + "xhr/abort-during-unsent.htm": [ + "5caf136ee37109ae482e44f71dbcd8bea2842b33", + "testharness" + ], + "xhr/abort-during-upload-expected.txt": [ + "301387199ed0f883262b2d046185946c6e49dd42", + "support" + ], + "xhr/abort-during-upload.htm": [ + "76a704710cb535699ee4f9e66115fa62351f7a3e", + "testharness" + ], + "xhr/abort-event-abort.htm": [ + "8afc5c9fe3534f452b91255fcdff35c4ab250ec7", + "testharness" + ], + "xhr/abort-event-listeners.htm": [ + "e3bd9ae434822d1459127756caf1c5f490bd6a56", + "testharness" + ], + "xhr/abort-event-loadend.htm": [ + "72f25d815a0cb004e1929e1c36dbfc53a6853d83", + "testharness" + ], + "xhr/abort-event-order-expected.txt": [ + "139b2f2e87f535af116089c330ee231fc0bb75fe", + "support" + ], + "xhr/abort-event-order.htm": [ + "8ecc9cbd0fcfd71e8ddb95e095f3153880eeaae9", + "testharness" + ], + "xhr/abort-upload-event-abort.htm": [ + "f7f9858f1ee9601cb1833f032c1f8c463e3ff7c0", + "testharness" + ], + "xhr/abort-upload-event-loadend.htm": [ + "07fc81c4d96ced6791efde32982fe3edff515cfe", + "testharness" + ], + "xhr/access-control-and-redirects-async-same-origin.htm": [ + "b4761c30644541eaa6f1e766eb4881eda63ed11a", + "testharness" + ], + "xhr/access-control-and-redirects-async.htm": [ + "51dbf57791e367a8710145fbddb3da653604b031", + "testharness" + ], + "xhr/access-control-and-redirects-expected.txt": [ + "2de8d1d9a6a0601850577b995a6be5c9de9d77db", + "support" + ], + "xhr/access-control-and-redirects.htm": [ + "1a914f10c86a399fdb57f9f35fe0586904296d9b", + "testharness" + ], + "xhr/access-control-basic-allow-access-control-origin-header-data-url.htm": [ + "df95476e8c0694430566802ec629c834d7c9f08c", + "testharness" + ], + "xhr/access-control-basic-allow-access-control-origin-header.htm": [ + "a54478b5a9f8178fcfb7c8f42df2e6fd305ff8cf", + "testharness" + ], + "xhr/access-control-basic-allow-async.htm": [ + "700f049d5ddc2806a7a34d5e2305656f9e9a6fb2", + "testharness" + ], + "xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm": [ + "f1ffc52ca6e772c7537d0c7239d7e2121a470cc6", + "testharness" + ], + "xhr/access-control-basic-allow-non-cors-safelisted-method.htm": [ + "a38f47fd7776d90a68960612f6825f415858e71a", + "testharness" + ], + "xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm": [ + "16f1e58a4f93c801c2a1c61e4f9f265950016a79", + "testharness" + ], + "xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm": [ + "8f9165c0711fafe49cb898e53a6dbfdb68ae2b77", + "testharness" + ], + "xhr/access-control-basic-allow-preflight-cache-timeout.htm": [ + "8fc811d66d8dc51b8e4cfd488f5e2a4f8ba5370e", + "testharness" + ], + "xhr/access-control-basic-allow-preflight-cache.htm": [ + "a6a51f0959a0188b9848d274a49b047e32e4208c", + "testharness" + ], + "xhr/access-control-basic-allow-star.htm": [ + "dc6a3bc45b67c2b621e70607c16ed005b4008390", + "testharness" + ], + "xhr/access-control-basic-allow.htm": [ + "174901504d6c37d28631c5bb77a3dfa386909149", + "testharness" + ], + "xhr/access-control-basic-cors-safelisted-request-headers.htm": [ + "c895784824662f88a8d730d6f391ae5972abc8c9", + "testharness" + ], + "xhr/access-control-basic-cors-safelisted-response-headers.htm": [ + "eb66284ba68fd81eaccfc8c983445298ceae287c", + "testharness" + ], + "xhr/access-control-basic-denied.htm": [ + "b83febc0462507d5a26be9b801cd7842b97f6e90", + "testharness" + ], + "xhr/access-control-basic-get-fail-non-simple.htm": [ + "54815c2c527f83e0dd2e4d0462efce8c91cdda6e", + "testharness" + ], + "xhr/access-control-basic-non-cors-safelisted-content-type.htm": [ + "69be9a4a9241abd923539c351e60ff6f32b9790b", + "testharness" + ], + "xhr/access-control-basic-post-success-no-content-type.htm": [ + "9a220a21e429330482d6ce2a01b30084ae9b4277", + "testharness" + ], + "xhr/access-control-basic-post-with-non-cors-safelisted-content-type.htm": [ + "94c893c91a4ab574e956f4a27c62d5c294e29d7a", + "testharness" + ], + "xhr/access-control-basic-preflight-denied.htm": [ + "86a46260dc6c078304d9a99ccbfb366e4ab3f5c5", + "testharness" + ], + "xhr/access-control-preflight-async-header-denied.htm": [ + "ffd195d7f2cf9ba31cd5c1ce7c499560ea9c699c", + "testharness" + ], + "xhr/access-control-preflight-async-method-denied.htm": [ + "f3ea0d8d00c2637a542ac9abdbbc33fd18fce8fe", + "testharness" + ], + "xhr/access-control-preflight-async-not-supported.htm": [ + "b88b086a388f7fd58ede3e0db239bbb1af049630", + "testharness" + ], + "xhr/access-control-preflight-credential-async.htm": [ + "2f0083c501b7d17d002b9c90c20b288957372013", + "testharness" + ], + "xhr/access-control-preflight-credential-sync.htm": [ + "69d32488a10ab722ed67f26abd80b3edd482335a", + "testharness" + ], + "xhr/access-control-preflight-headers-async.htm": [ + "69c13df1b85677c006c66f8b52e26a0d3a567b4e", + "testharness" + ], + "xhr/access-control-preflight-headers-sync.htm": [ + "28c93367452ff9324543feffeb84ba68f253b22b", + "testharness" + ], + "xhr/access-control-preflight-request-header-lowercase.htm": [ + "05159b08aa2a7743b03cbb614a7c6941e79d2029", + "testharness" + ], + "xhr/access-control-preflight-request-header-sorted.htm": [ + "2e4d90be910f1b879109fc2879a89fc1b7a2773f", + "testharness" + ], + "xhr/access-control-preflight-request-headers-origin.htm": [ + "0e193b58b3d2707e6af0530c01cafc7948122be2", + "testharness" + ], + "xhr/access-control-preflight-request-invalid-status-301.htm": [ + "9677279867c5041e69b42e47848bdfbff586c104", + "testharness" + ], + "xhr/access-control-preflight-request-invalid-status-400.htm": [ + "129449ce5e0ef3da3131f8bb89991351b19f5e13", + "testharness" + ], + "xhr/access-control-preflight-request-invalid-status-501.htm": [ + "c672aefa512299d3250956162dc9f9478eb48afc", + "testharness" + ], + "xhr/access-control-preflight-request-must-not-contain-cookie.htm": [ + "f597502165756713792469022e3bdf4c76a90ca1", + "testharness" + ], + "xhr/access-control-preflight-sync-header-denied.htm": [ + "f10476c35d6316b90bebfc38fe5f4bf436b6d89b", + "testharness" + ], + "xhr/access-control-preflight-sync-method-denied.htm": [ + "34b48c93dc7b4875082378c73d08eb0b22706e94", + "testharness" + ], + "xhr/access-control-preflight-sync-not-supported.htm": [ + "bc71e3358aab575c9732eebe36eb4152964691cd", + "testharness" + ], + "xhr/access-control-recursive-failed-request.htm": [ + "b3eef0cec11ff0e38a473a2b131888d64bb36fdb", + "testharness" + ], + "xhr/access-control-response-with-body-sync.htm": [ + "f88e52346ad9c7ad758a307b14d9bb9e0cc09859", + "testharness" + ], + "xhr/access-control-response-with-body.htm": [ + "3a35d627665242873012f8001d50cd140fa4b17b", + "testharness" + ], + "xhr/access-control-response-with-exposed-headers.htm": [ + "61d9879aa1e7e77bf946d150b79e3920154d6035", + "testharness" + ], + "xhr/access-control-sandboxed-iframe-allow-origin-null.htm": [ + "0a1b65fce582ab0fc1db6399b9f759a818940b99", + "testharness" + ], + "xhr/access-control-sandboxed-iframe-allow.htm": [ + "9905e77f9194d2c3ed5d3afbbfbaa4bdc02f51e8", + "testharness" + ], + "xhr/access-control-sandboxed-iframe-denied-without-wildcard.htm": [ + "9081bf7ece8848275b648213261cd1522caefbae", + "testharness" + ], + "xhr/access-control-sandboxed-iframe-denied.htm": [ + "f25cb7f6eda87f69d02956408bc1b83dace8e9cb", + "testharness" + ], + "xhr/allow-lists-starting-with-comma.htm": [ + "8e638b1d5939275d2d0c5a5c71ee1e3f767cfbc1", + "testharness" + ], + "xhr/anonymous-mode-unsupported.htm": [ + "54a03fefabfad02e09baa4e9d37e19b6403dad9b", + "testharness" + ], + "xhr/data-uri-expected.txt": [ + "6cfe7c07506555203507501af7fc117b33dbee37", + "support" + ], + "xhr/data-uri.htm": [ + "d42eb014a32cf82d7eba31ad9b80f51bff43eeea", + "testharness" + ], + "xhr/event-abort.htm": [ + "5080ba821c78807b806734812a7b501cc56e48be", + "testharness" + ], + "xhr/event-error-order.sub-expected.txt": [ + "e67f6e1bddb9d2b31408dbf7a502f636925089c0", + "support" + ], + "xhr/event-error-order.sub.html": [ + "5d0328ace02c4e7075bcc310392940bb67bd627d", + "testharness" + ], + "xhr/event-error.sub.html": [ + "040207a85f39b12755bfb909afc3c31b0d823698", + "testharness" + ], + "xhr/event-load.htm": [ + "4dd7532bd503931d0d90d95d8ac26b6de8557f44", + "testharness" + ], + "xhr/event-loadend.htm": [ + "155c6adf45aed33817a8378f49d864606a4e8b9e", + "testharness" + ], + "xhr/event-loadstart-upload-expected.txt": [ + "f3b9d8795f37f7357c819c1927eb1b6b17b944fd", + "support" + ], + "xhr/event-loadstart-upload.htm": [ + "8e396ccd7269e2b523c466c57c9adee1222427d5", + "testharness" + ], + "xhr/event-loadstart.htm": [ + "bd7e25519f5389e01b769dc0f338f1567ae3a975", + "testharness" + ], + "xhr/event-progress.htm": [ + "1fc7ae17692af59ec627f9005a8da25819a84e96", + "testharness" + ], + "xhr/event-readystate-sync-open.htm": [ + "4f8da3bd441743d0164094510fbbe1f891b8d3b0", + "testharness" + ], + "xhr/event-readystatechange-loaded.htm": [ + "9873bff3686e2a9b1a3daf778e89943236cc46ca", + "testharness" + ], + "xhr/event-timeout-order-expected.txt": [ + "9e3345180f93c4f5bda1e07a683229a0c31ff837", + "support" + ], + "xhr/event-timeout-order.htm": [ + "a8192dcd62d73279885fb062926e4fac3b02999d", + "testharness" + ], + "xhr/event-timeout.htm": [ + "5035e847bc8fcf16164cefeee293d149fe5f5fce", + "testharness" + ], + "xhr/event-upload-progress-crossorigin-expected.txt": [ + "277359b0a64917518ffcf2c36d28f44fcbe857e3", + "support" + ], + "xhr/event-upload-progress-crossorigin.htm": [ + "cf6c626f689b2e2066d52f35c0ab6fb495fba98e", + "testharness" + ], + "xhr/event-upload-progress.htm": [ + "4970811cfd2c1bdd1a08af6dd16eda8ffbff8ffd", + "testharness" + ], + "xhr/firing-events-http-content-length.html": [ + "b02468fa9d3d36190e4490cbbcb5a010403705c1", + "testharness" + ], + "xhr/firing-events-http-no-content-length.html": [ + "5ec562a5be5de822248ad9a4da82db1490363a67", + "testharness" + ], + "xhr/folder.txt": [ + "4dca56d05a21f0d018cd311f43e134e4501cf6d9", + "support" + ], + "xhr/formdata-blob.htm": [ + "0ee0270eeb0c3706bb0f17f991f00858bab9d1cc", + "testharness" + ], + "xhr/formdata-delete.htm": [ + "392d9f0159828eb3b710905c4903077fcc4ab345", + "testharness" + ], + "xhr/formdata-foreach.html": [ + "ac4bcf3c043dec99e2feeaeff828ead2db1e9606", + "testharness" + ], + "xhr/formdata-get.htm": [ + "6ee0ec2a4c0f5abcda4f1aea154ff3e2cdd95af6", + "testharness" + ], + "xhr/formdata-has.htm": [ + "c2d39d1b3453c817fcacb2c358c9aa1fcc4ea68b", + "testharness" + ], + "xhr/formdata-set.htm": [ + "5d4bf9534f6641d4ceab2096254282b7f67ac66b", + "testharness" + ], + "xhr/formdata.htm": [ + "ac39c4b1e3b5bf515be99cff25c3f24b56548a77", + "testharness" + ], + "xhr/getallresponseheaders-cookies.htm": [ + "cb8eb74de6c416c8b7658e27b440b60096da0f6b", + "testharness" + ], + "xhr/getallresponseheaders-expected.txt": [ + "e81e2d306e14cfb5d26e6c8cb8d5d72876ac5953", + "support" + ], + "xhr/getallresponseheaders-status.htm": [ + "7c74fe531715cdccc1c1668380da2a2a7ca65c71", + "testharness" + ], + "xhr/getallresponseheaders.htm": [ + "b41c448a5b4201e22f61ee1c22d27b3b5b2eca83", + "testharness" + ], + "xhr/getresponseheader-case-insensitive.htm": [ + "96f7f70d595b46fcaea81a0c155b994f4561ce08", + "testharness" + ], + "xhr/getresponseheader-chunked-trailer.htm": [ + "37043cc8d180a405eb150b39e2caa5f4f5a0a9c3", + "testharness" + ], + "xhr/getresponseheader-cookies-and-more.htm": [ + "1da70aa71749a513718e783ff68504a6c8c2bef9", + "testharness" + ], + "xhr/getresponseheader-error-state.htm": [ + "6faa6a8a91be180e0cdad155cde90b3969f88977", + "testharness" + ], + "xhr/getresponseheader-server-date.htm": [ + "e58ec1e22f9796ff368357ee6a0f90882f61581b", + "testharness" + ], + "xhr/getresponseheader-special-characters.htm": [ + "c1bbb4ca38e62b9775baaf05593ebcc20e5301f8", + "testharness" + ], + "xhr/getresponseheader-unsent-opened-state.htm": [ + "9a27f71e6e5738d2625ed30f91f3d514fc3646e8", + "testharness" + ], + "xhr/headers-normalize-response-expected.txt": [ + "beeb26685c597767e2b460f6b62ea3f0a9966554", + "support" + ], + "xhr/headers-normalize-response.htm": [ + "eb7c4df4a878181161f356cfaed84e37ccd6f772", + "testharness" + ], + "xhr/historical.html": [ + "1cb82348a9d6f3be34da762267cce7389f715f7c", + "testharness" + ], + "xhr/interfaces.html": [ + "a4c597d2bdb85e37ffe5f5ebba961d7f8a3aeb29", + "testharness" + ], + "xhr/loadstart-and-state.html": [ + "6804845b3ba0e52ee407fc7e8036ce905283751c", + "testharness" + ], + "xhr/no-utf16-json-expected.txt": [ + "c2c4e952b7b5f87163b948618b1dc8dc7cb61813", + "support" + ], + "xhr/no-utf16-json.htm": [ + "4546215ad6f138676d3c473782e6e34b4c922589", + "testharness" + ], + "xhr/open-after-abort.htm": [ + "514263c7a0b9c3494e535dfd5fb72e4cfb43e707", + "testharness" + ], + "xhr/open-after-setrequestheader.htm": [ + "63991d7ee44c2c54f3303393ea8843420ab2d2b4", + "testharness" + ], + "xhr/open-during-abort-event.htm": [ + "5586ef1a16b3215f069a14d5ae3f97e31e45cff1", + "testharness" + ], + "xhr/open-during-abort-processing.htm": [ + "6a32be452eff9e6aa68f805b88947aeb4c61f66e", + "testharness" + ], + "xhr/open-during-abort.htm": [ + "f71725852c3fca8750dbc152d378fa2609e5c40e", + "testharness" + ], + "xhr/open-method-bogus.htm": [ + "cb40eb7cace2026cc8997d459bd9fbbf608eba02", + "testharness" + ], + "xhr/open-method-case-insensitive.htm": [ + "ceeb1f065f94f54c0adc77ee264f6702b5e5df4f", + "testharness" + ], + "xhr/open-method-case-sensitive.htm": [ + "015e6b9e656c6a128577288c5c4f02f02e996177", + "testharness" + ], + "xhr/open-method-insecure.htm": [ + "2783e94a70e284addd1b0e63fad4aa1e0d19acc2", + "testharness" + ], + "xhr/open-method-responsetype-set-sync.htm": [ + "8fda92abd3b4de9c525c01f698e2ec216327930c", + "testharness" + ], + "xhr/open-open-send.htm": [ + "bd09a5efa7bfb7358d08429e1dc00d9e02adc5e7", + "testharness" + ], + "xhr/open-open-sync-send.htm": [ + "8b1721532c80a0732462bc090db236256bf1bf38", + "testharness" + ], + "xhr/open-referer.htm": [ + "7343a7af06cda485e60af3bb5d86e1376a89fd68", + "testharness" + ], + "xhr/open-send-during-abort.htm": [ + "cf5f04566a96f1e86ddbaa6cdc5290fba12745ca", + "testharness" + ], + "xhr/open-send-open.htm": [ + "35187c7ce2a9df0c5a092f85fcecdfca1ad48f43", + "testharness" + ], + "xhr/open-sync-open-send.htm": [ + "0004e8faf2215e2156d8df3c975c99140e6a7555", + "testharness" + ], + "xhr/open-url-about-blank-window.htm": [ + "3a56c852959b6da30b0885b326bf7d8d7f326008", + "testharness" + ], + "xhr/open-url-base-inserted-after-open.htm": [ + "6b3baec08c4ae639af75e2321e016a57e07d680d", + "testharness" + ], + "xhr/open-url-base-inserted.htm": [ + "11f3665ec4c491e3c4806c2be17578ccbcaf7840", + "testharness" + ], + "xhr/open-url-base.htm": [ + "d2c5d8d1696112b771a332011c4f33065817ed9a", + "testharness" + ], + "xhr/open-url-encoding.htm": [ + "a36c7b0e5919af7842883582ef9fc415d8f7ef25", + "testharness" + ], + "xhr/open-url-fragment.htm": [ + "da4145fc26603b01fc0fbaa7f5ac62134af90778", + "testharness" + ], + "xhr/open-url-javascript-window-2.htm": [ + "de6712f1db65e2886599d653a253197254b2c0f2", + "testharness" + ], + "xhr/open-url-javascript-window.htm": [ + "aec548dd8817870e9a4e309e7b726b3325d4ded8", + "testharness" + ], + "xhr/open-url-multi-window-2-expected.txt": [ + "320baf425910398a9987500be3cd8714ecebe30d", + "support" + ], + "xhr/open-url-multi-window-2.htm": [ + "5c94fea7396f3a5e456171b439792170ec0aa077", + "testharness" + ], + "xhr/open-url-multi-window-3-expected.txt": [ + "0ac8d75185d4394ff869eda9580f511ec2eda031", + "support" + ], + "xhr/open-url-multi-window-3.htm": [ + "a69ef73ebc52cb2b0b4d67d5e74c2ccc05649651", + "testharness" + ], + "xhr/open-url-multi-window-4-expected.txt": [ + "f87235baa12ea85152ac9a4a28d6f2f5e015c8c8", + "support" + ], + "xhr/open-url-multi-window-4.htm": [ + "524e58c70f963ee2766bcdc9ec17c7ad5f8c092b", + "testharness" + ], + "xhr/open-url-multi-window-5-expected.txt": [ + "437da3b34abf3fdd4b7c99085b5e7b1770612140", + "support" + ], + "xhr/open-url-multi-window-5.htm": [ + "128e9031c746de4fafb026ab1dabda7ac56bad7f", + "testharness" + ], + "xhr/open-url-multi-window-6-expected.txt": [ + "dc8d9fbe1e0dc7c015743fa851ef756f945b1794", + "support" + ], + "xhr/open-url-multi-window-6.htm": [ + "1b00cf39a9f06d8010555ade522c5d5791dd3dba", + "testharness" + ], + "xhr/open-url-multi-window.htm": [ + "28603b8d225367ba648bb9271dec5cb3da73d733", + "testharness" + ], + "xhr/open-url-redirected-worker-origin.htm": [ + "79b3d8035d2e7bc6fef2c69eb378ede3f55e6ff5", + "testharness" + ], + "xhr/open-url-worker-origin.htm": [ + "efb4caaad4450dc7be2c1db7bbfdfa771de11d9e", + "testharness" + ], + "xhr/open-url-worker-simple.htm": [ + "224c1502970253197c670bfb04efa15708e034d5", + "testharness" + ], + "xhr/open-user-password-non-same-origin.htm": [ + "9e28bf35af12bb962fdfd2213d7e20e031a29703", + "testharness" + ], + "xhr/overridemimetype-blob.html": [ + "462d95dec7146c2a7beba5d8b2285fd2b8460002", + "testharness" + ], + "xhr/overridemimetype-done-state.htm": [ + "167f34f8dfc1312a9124c12ee4f8de808fa41680", + "testharness" + ], + "xhr/overridemimetype-headers-received-state-force-shiftjis.htm": [ + "92a00af686310d8b44fb5e4c70cc6fbea28e0a88", + "testharness" + ], + "xhr/overridemimetype-invalid-mime-type.htm": [ + "1deea1bfa844816a404b90cf5650382383df5d57", + "testharness" + ], + "xhr/overridemimetype-loading-state.htm": [ + "af7ca47e5810805e37da08fee8062dddb37425b5", + "testharness" + ], + "xhr/overridemimetype-open-state-force-utf-8.htm": [ + "3f686050a6720ad2064c35cd75597d067aa5b880", + "testharness" + ], + "xhr/overridemimetype-open-state-force-xml.htm": [ + "102e045c8828661819b0625aedb052b8c08da7b6", + "testharness" + ], + "xhr/overridemimetype-unsent-state-force-shiftjis.htm": [ + "900deb9a316fd91829abe1073077f95588594889", + "testharness" + ], + "xhr/preserve-ua-header-on-redirect.htm": [ + "1754e07e0c0650a326e0c8be21f6cb28437d1746", + "testharness" + ], + "xhr/progress-events-response-data-gzip.htm": [ + "628ce3c9ee69aa9d4bb1b044f8d7a86095c7b0bc", + "testharness" + ], + "xhr/progressevent-constructor.html": [ + "33782c1562d7c60c50d4fa54a92c082cbeb2928c", + "testharness" + ], + "xhr/progressevent-interface.html": [ + "a614d8381b4fa9d04aef6c2a08889451b1b086a2", + "testharness" + ], + "xhr/resources/accept-language.py": [ + "c8e945b53770efb8e4312f457a5a7261bc88a36c", + "support" + ], + "xhr/resources/accept.py": [ + "4769a0c31c00777fb37e1af76209e68040918b64", + "support" + ], + "xhr/resources/access-control-allow-lists.py": [ + "941a26e0b85d608bb2617362df74263564b5981d", + "support" + ], + "xhr/resources/access-control-allow-with-body.py": [ + "fbd35be708e601c7c3fb625ce28b9f43de784e13", + "support" + ], + "xhr/resources/access-control-auth-basic.py": [ + "08d5c99e4c576557cab5ddc56fda038aab767dee", + "support" + ], + "xhr/resources/access-control-basic-allow-no-credentials.py": [ + "593fc8c4d78f0213017c0fb2fa78ac46274eb6ea", + "support" + ], + "xhr/resources/access-control-basic-allow-star.py": [ + "d9aa8e1eaf8e73256edabafec32960bba8499f40", + "support" + ], + "xhr/resources/access-control-basic-allow.py": [ + "b7351f59af91646549075b6b732eeb6c750e3faf", + "support" + ], + "xhr/resources/access-control-basic-cors-safelisted-request-headers.py": [ + "19a0b1d88765fa152c17c7f684651be8c4bae3da", + "support" + ], + "xhr/resources/access-control-basic-denied.py": [ + "35e7b6c552caf55e8ea7d34ec51d354c8eb2bc6e", + "support" + ], + "xhr/resources/access-control-basic-options-not-supported.py": [ + "ee16a30ec1252bd66ef899f7c7bc8d3d0fb76562", + "support" + ], + "xhr/resources/access-control-basic-preflight-cache-invalidation.py": [ + "5b043f99d8f9d3f1c253324447df2d0586bf735a", + "support" + ], + "xhr/resources/access-control-basic-preflight-cache-timeout.py": [ + "4e205534cff698089c017cd3f959f74862f3870a", + "support" + ], + "xhr/resources/access-control-basic-preflight-cache.py": [ + "32e713011ca3c4235f8ef77c4ec49c08c6a49469", + "support" + ], + "xhr/resources/access-control-basic-put-allow.py": [ + "eda02da8e1d89f28ff0e07442539b7eca4ca556f", + "support" + ], + "xhr/resources/access-control-basic-whitelist-response-headers.py": [ + "c530b8431372e0511c91b150c5f1015d504ae374", + "support" + ], + "xhr/resources/access-control-cookie.py": [ + "0551a6a4284fcae2ed5314d5d02767a4da1ad981", + "support" + ], + "xhr/resources/access-control-origin-header.py": [ + "529883eed380c4505c1ddbc87ae5885254756626", + "support" + ], + "xhr/resources/access-control-preflight-denied.py": [ + "b41ba9f1e3fcad508d575331e0f3f43bc75c07b9", + "support" + ], + "xhr/resources/access-control-preflight-request-header-lowercase.py": [ + "3f39f2f6bdda8c167df09525b8d23d04c16b2462", + "support" + ], + "xhr/resources/access-control-preflight-request-header-sorted.py": [ + "357dbf2f01ab59c8689af632c1116d2053f3829d", + "support" + ], + "xhr/resources/access-control-preflight-request-headers-origin.py": [ + "abc6b25627e019ae67b90beebad42164143321d0", + "support" + ], + "xhr/resources/access-control-preflight-request-invalid-status.py": [ + "c572b1e3d79f66df0a40766e6e4c3cc785458d0e", + "support" + ], + "xhr/resources/access-control-preflight-request-must-not-contain-cookie.py": [ + "1343bfee18c64bfbb625591bc65117e5b692c487", + "support" + ], + "xhr/resources/access-control-sandboxed-iframe.html": [ + "3aa5a903afc03e167a88322db44c29b287509f47", + "support" + ], + "xhr/resources/auth1/auth.py": [ + "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", + "support" + ], + "xhr/resources/auth2/auth.py": [ + "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", + "support" + ], + "xhr/resources/auth2/corsenabled.py": [ + "4136b00b543096216f9f1ad1314c7062dda04179", + "support" + ], + "xhr/resources/auth3/auth.py": [ + "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", + "support" + ], + "xhr/resources/auth4/auth.py": [ + "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", + "support" + ], + "xhr/resources/auth5/auth.py": [ + "cb73eae36004b4e939867ae72f8db79e5a14c99c", + "support" + ], + "xhr/resources/auth6/auth.py": [ + "cb73eae36004b4e939867ae72f8db79e5a14c99c", + "support" + ], + "xhr/resources/auth7/corsenabled.py": [ + "cbc1e4a39cc2e999ef7bd4053a600e8b0d515bb5", + "support" + ], + "xhr/resources/auth8/corsenabled-no-authorize.py": [ + "523fbc134ecfee5b13e4ef93508712847fc4e396", + "support" + ], + "xhr/resources/auth9/auth.py": [ + "cbe9305740f7e0a9e8c7be9dbfcb606f8abb2758", + "support" + ], + "xhr/resources/authentication.py": [ + "e7d0a9054c562964b23c4e4bbf1d1207a1811b55", + "support" + ], + "xhr/resources/base.xml": [ + "4f52cca8f5bee9b2a4ded6b898d4eb9cdbae6c75", + "support" + ], + "xhr/resources/chunked.py": [ + "be48633bdec117d50bce7a8e4323667881c8e367", + "support" + ], + "xhr/resources/conditional.py": [ + "0796447779cee59308620c218160faaedbff608e", + "support" + ], + "xhr/resources/content.py": [ + "4bcdf8d22cbb4119b4236f65e0177c3830f79739", + "support" + ], + "xhr/resources/corsenabled.py": [ + "523f23a739b506de0abcac0ac39b6908a596d62f", + "support" + ], + "xhr/resources/delay.py": [ + "004949bbab102f3336d4a40e33f04eb57efdbb3d", + "support" + ], + "xhr/resources/echo-headers.py": [ + "cba52dcfcc4c73315ca1073ecea13a6d0e30a9ec", + "support" + ], + "xhr/resources/echo-method.py": [ + "146226b51535bcaa270c3a56a31a83828000ba74", + "support" + ], + "xhr/resources/empty-div-utf8-html.py": [ + "0df281fd2f67f2ec4acb6b353b2eb9ee02077957", + "support" + ], + "xhr/resources/folder.txt": [ + "6e7610ce7f3e29db0506a8d0c0f8c3f90a5f98eb", + "support" + ], + "xhr/resources/form.py": [ + "3289c17c1c9892bfc2c44599fe3af6d711a96778", + "support" + ], + "xhr/resources/gzip.py": [ + "a259f50e91a706acf4d9d0be8a01bd046544ea55", + "support" + ], + "xhr/resources/header-content-length.asis": [ + "a191134704e09ff9bb6591dc8c6aa78307edf6c9", + "support" + ], + "xhr/resources/headers-basic.asis": [ + "718e90fc73ec596127d26fba5433c5355e93fa3f", + "support" + ], + "xhr/resources/headers.asis": [ + "4f704b9f6f89a0152443a08eb7adf84415009ad1", + "support" + ], + "xhr/resources/headers.py": [ + "9728a796eb49af8303249f0a806ffaada599fc66", + "support" + ], + "xhr/resources/image.gif": [ + "2302af42d44228cf6e991db0705bf0fdaa6fde8a", + "support" + ], + "xhr/resources/img-utf8-html.py": [ + "961d4612b0002c2fbe228ce2fcc36c1657e60fa9", + "support" + ], + "xhr/resources/img.jpg": [ + "e042472cb177eedb5f89db01ede97521cf044ec9", + "support" + ], + "xhr/resources/infinite-redirects.py": [ + "bd033f0de21dc68ed1d4303fee49e64dd0916722", + "support" + ], + "xhr/resources/init.htm": [ + "d8f63ab5249fca5579d1ee4df5b2ab4695529be3", + "support" + ], + "xhr/resources/inspect-headers.py": [ + "aab673bbdc7411c40ef2d7350486e779f3703e89", + "support" + ], + "xhr/resources/invalid-utf8-html.py": [ + "3e24e9453342e058e18f114763ad01c8c2706d91", + "support" + ], + "xhr/resources/last-modified.py": [ + "9af7a5f9be37e7ebbbea4c683bfb2d9415229ece", + "support" + ], + "xhr/resources/no-custom-header-on-preflight.py": [ + "76437951442df8d19438573add8bf2b2a0be4b18", + "support" + ], + "xhr/resources/nocors/folder.txt": [ + "92400e232461d345128d2d7303eb5f5bba12763f", + "support" + ], + "xhr/resources/parse-headers.py": [ + "cc9f324cf5b044646edfc6aa9e98cdc2a40e41b9", + "support" + ], + "xhr/resources/pass.txt": [ + "27d2303f215d7d1a8f12f0b80b9b56a2cdf6c9a7", + "support" + ], + "xhr/resources/redirect-cors.py": [ + "a04af2badb3f212a9ef48e3cde491f199a85b6bc", + "support" + ], + "xhr/resources/redirect.py": [ + "988961f44badedfcea4e1660339ea921178b7a42", + "support" + ], + "xhr/resources/requri.py": [ + "7e84cbcb29783dd435c9be6ad960731d5d92706c", + "support" + ], + "xhr/resources/reset-token.py": [ + "ba56e4c405f81ea5ca396417ae7cd48f2029f7cb", + "support" + ], + "xhr/resources/responseType-document-in-worker.js": [ + "6f1477cf04fd21df905b4d14e00a67b29c98d961", + "support" + ], + "xhr/resources/responseXML-unavailable-in-worker.js": [ + "8ede1fa55ed1831f90022f2efb2b6e64b1cf4aea", + "support" + ], + "xhr/resources/send-after-setting-document-domain-window-1.htm": [ + "a4bd8b70cc61f9d403b529c079d47691a27abb8a", + "support" + ], + "xhr/resources/send-after-setting-document-domain-window-2.htm": [ + "36e89e62be6ce5c28e943c9cf7eb4f4fdb5dfe3a", + "support" + ], + "xhr/resources/send-after-setting-document-domain-window-helper.js": [ + "200cba5a61c03a34f7e37f66390f6ffe1f51610a", + "support" + ], + "xhr/resources/shift-jis-html.py": [ + "6348753f63dec61aeb6c17ea0a7994f64a846ae2", + "support" + ], + "xhr/resources/status.py": [ + "d521bae08fa1ee19e7bbf4301157703e567ad5c6", + "support" + ], + "xhr/resources/trickle.py": [ + "11df0d34ce5a0ef7193456125ce5546f75946f7a", + "support" + ], + "xhr/resources/upload.py": [ + "e1addc2a9f014c2546b5770dd328b1562dc4fdc3", + "support" + ], + "xhr/resources/utf16-bom.json": [ + "3d344828308b32594a8ed51a3cf186ccfa83cfb1", + "support" + ], + "xhr/resources/utf16.txt": [ + "47e95b463051a904934ec51df445a39301c5f671", + "support" + ], + "xhr/resources/well-formed.xml": [ + "11a068dcf9fa14b05a24f15c0609143ba705e112", + "support" + ], + "xhr/resources/win-1252-html.py": [ + "c062b6b3440e7398a05d0c1db7a5e12d3aa7e58c", + "support" + ], + "xhr/resources/win-1252-xml.py": [ + "e4b0b7ebd6543479a74bdf76592b027b9383e0c9", + "support" + ], + "xhr/resources/workerxhr-origin-referrer.js": [ + "9faaad75ec79580fe5f0a121c1f66266e7b2969e", + "support" + ], + "xhr/resources/workerxhr-simple.js": [ + "29d29ff7d37408b8e2ab1cebf16f3369ef4c287f", + "support" + ], + "xhr/resources/xmlhttprequest-event-order.js": [ + "eb4a3eeee9b1d0f3a1061253ed35ba83a3d17160", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-aborted.js": [ + "6b9535692cdb91aae7141df3b4e525f603cf2915", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-abortedonmain.js": [ + "d30cfa65549f24cce221750bebdd4dd25ca668c6", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-overrides.js": [ + "ec8eb831b3901f6fb839a515058a9b6b8d552a76", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-overridesexpires.js": [ + "d44506dbf84acedcd8eaf21ec7224a4057988a07", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-runner.js": [ + "ed704b1d85d21351f1daa7c2bf3d3fa3789a7c02", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-simple.js": [ + "b6fb033f8fc5dfbd34cf03076e0790c4f58b1bc2", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-synconmain.js": [ + "aca45f5fb83de5fdd22143728effe996d14c9092", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-synconworker.js": [ + "b5b3f69353c5e2f4d6b03b6fafa32e2df9bd5dc4", + "support" + ], + "xhr/resources/xmlhttprequest-timeout-twice.js": [ + "0a491ff406bbf3090e770d6af316e2c47c46b13c", + "support" + ], + "xhr/resources/xmlhttprequest-timeout.js": [ + "b884259bf6975838a5065fae472eaf6a4e8bf959", + "support" + ], + "xhr/resources/zlib.py": [ + "3d2a2eeebabe17c5a1ea91334927861458e4caaf", + "support" + ], + "xhr/response-data-arraybuffer.htm": [ + "9849b01691856c6bc25ff086e2ea75925292f1c9", + "testharness" + ], + "xhr/response-data-blob.htm": [ + "d15ab358dfcabd2d0a14c0585a643153a9a98aed", + "testharness" + ], + "xhr/response-data-deflate.htm": [ + "f0c609e892d95889e485326d360fae9623b52b00", + "testharness" + ], + "xhr/response-data-gzip.htm": [ + "1008022e6d8feab21f6239980d8076cb5b78272e", + "testharness" + ], + "xhr/response-data-progress-expected.txt": [ + "558ae097bdeb4e0ce9620529883c5338ab48ed77", + "support" + ], + "xhr/response-data-progress.htm": [ + "5f8d963fa1cdec6ff6b544f19c56e4e15ef39853", + "testharness" + ], + "xhr/response-invalid-responsetype.htm": [ + "6c43125d4b210777bdd870935f5836470c19a88d", + "testharness" + ], + "xhr/response-json-expected.txt": [ + "186c6ef1831003b4ce557979e1ea167c3bda40d8", + "support" + ], + "xhr/response-json.htm": [ + "46b0adcbd4dfa48823c7e37e1acbe50e32efd902", + "testharness" + ], + "xhr/response-method.htm": [ + "dcdcf03b9390763e1bbcb99e1e0e231d00d3a6bb", + "testharness" + ], + "xhr/responseText-status.html": [ + "fb0018f3cc052de846232231771ea8436ec4c8c0", + "testharness" + ], + "xhr/responseType-document-in-worker-expected.txt": [ + "2ab50994ecfbab38817824603f4355c5b80a08f8", + "support" + ], + "xhr/responseType-document-in-worker.html": [ + "4eceb42987047585ac193254951f900b5960975d", + "testharness" + ], + "xhr/responseXML-unavailable-in-worker-expected.txt": [ + "997938c4a42c76beeb645e05564059d3e4fa2e92", + "support" + ], + "xhr/responseXML-unavailable-in-worker.html": [ + "6111310764e8aac694655f173aef9653325ef7e8", + "testharness" + ], + "xhr/responsedocument-decoding.htm": [ + "ab52417826b3953b71b5f6037ebd616d4b862ad4", + "testharness" + ], + "xhr/responsetext-decoding.htm": [ + "538d6d5121157e04c44fd947140f2c913dc3b65e", + "testharness" + ], + "xhr/responsetype.html": [ + "090ae5981aed9e0ed5e5f8a2f5615d57df0c366b", + "testharness" + ], + "xhr/responseurl.html": [ + "b7ac10fed9c8a07afcd13f1d4906e10996ae56c6", + "testharness" + ], + "xhr/responsexml-basic.htm": [ + "962765bd28850b740b0945d08f31fd94c8883191", + "testharness" + ], + "xhr/responsexml-document-properties.htm": [ + "9c3698d77cb49266cfcc33e89a74d7930b5b06cb", + "testharness" + ], + "xhr/responsexml-get-twice.htm": [ + "6291caac16b148f2265968820a8bd460a1a77092", + "testharness" + ], + "xhr/responsexml-media-type-expected.txt": [ + "d058367dc0bb251adfa36b63fd27c1fa2ee8f49d", + "support" + ], + "xhr/responsexml-media-type.htm": [ + "82f735476786b2cbe5c62de17642ab42125e08ee", + "testharness" + ], + "xhr/responsexml-non-document-types.htm": [ + "e0eac49a846a718382cbd6ccb7a7815f77341048", + "testharness" + ], + "xhr/responsexml-non-well-formed.htm": [ + "f3cdc74040718681acc7f48212b0f13b695ebaeb", + "testharness" + ], + "xhr/security-consideration.sub-expected.txt": [ + "d20c805eb6d30da809dd952a16aba897f574741d", + "support" + ], + "xhr/security-consideration.sub.html": [ + "f94b8d87fe47732729caa2104e4051f8403ad265", + "testharness" + ], + "xhr/send-accept-language.htm": [ + "19fc5a0afafff1541f2fa5fca812f1f0fc0decd8", + "testharness" + ], + "xhr/send-accept.htm": [ + "9550c8301956239aa5abe9dd83d5cb2ec1733bb2", + "testharness" + ], + "xhr/send-after-setting-document-domain.htm": [ + "89672524546c073b45d70d6826f6b66bbccb43a2", + "testharness" + ], + "xhr/send-authentication-basic-cors-not-enabled.htm": [ + "567d92a18bf35ca579d6c68fe63cf02d40ed48f0", + "testharness" + ], + "xhr/send-authentication-basic-cors.htm": [ + "add5a460a8a8dbed47f26c16bd993a1d0c78c0ea", + "testharness" + ], + "xhr/send-authentication-basic-repeat-no-args.htm": [ + "480ae3795979672a7a7be7d37fa6dbb5a207509d", + "testharness" + ], + "xhr/send-authentication-basic-setrequestheader-and-arguments.htm": [ + "6525428b3b88188306af3a18a8078b074291e962", + "testharness" + ], + "xhr/send-authentication-basic-setrequestheader-existing-session.htm": [ + "26d24fb2e4d8212dd23c4c0e80fcd2c8669ae55d", + "testharness" + ], + "xhr/send-authentication-basic-setrequestheader.htm": [ + "d3e88dda4eec2959470f84864160900d2b3bc6d3", + "testharness" + ], + "xhr/send-authentication-basic.htm": [ + "10e209ccb90914cb95b7818ea4b28cdf1836501a", + "testharness" + ], + "xhr/send-authentication-competing-names-passwords-expected.txt": [ + "f687bbcb276f39f52885afe62966e24bdfde6fe4", + "support" + ], + "xhr/send-authentication-competing-names-passwords.htm": [ + "f44c72cd39779c91f525dd87dca5eed3697910c2", + "testharness" + ], + "xhr/send-authentication-cors-basic-setrequestheader.htm": [ + "28b02ba77a45f6d46e195b863c3c789e6e643550", + "testharness" + ], + "xhr/send-authentication-cors-setrequestheader-no-cred-expected.txt": [ + "b21c757e8d1b05e165503b66236eb8a88ba29268", + "support" + ], + "xhr/send-authentication-cors-setrequestheader-no-cred.htm": [ + "4f707072eaac0788ac50b9d22a2ea055d0ff52f1", + "testharness" + ], + "xhr/send-authentication-existing-session-manual.htm": [ + "668d2cfb4e53b925b85cc4dbeb783d1cd070b30b", + "manual" + ], + "xhr/send-authentication-prompt-2-manual.htm": [ + "5f27e6eb5c228b742ed4780f13f4671d72305a57", + "manual" + ], + "xhr/send-authentication-prompt-manual-expected.txt": [ + "443eb3875afd8493cb62b6b2ab705ff0d4e2e170", + "support" + ], + "xhr/send-authentication-prompt-manual.htm": [ + "7d70fbaef47348b9f92a70059f3827e29caf28b5", + "manual" + ], + "xhr/send-blob-with-no-mime-type.html": [ + "c157b5bad423e5683a97ac43f5a1f7ea391efc79", + "testharness" + ], + "xhr/send-conditional-cors.htm": [ + "3296d088846322713fb0a1d2160ad1c2ccddfb45", + "testharness" + ], + "xhr/send-conditional.htm": [ + "f807d15cf8c787653f3362e3bfbb804c010f04e3", + "testharness" + ], + "xhr/send-content-type-charset-expected.txt": [ + "04326d5b654c4855fbcd30f741f2bc8be3168674", + "support" + ], + "xhr/send-content-type-charset.htm": [ + "e143738f086c6c96de54539e799ee194de436246", + "testharness" + ], + "xhr/send-content-type-string-expected.txt": [ + "830bac71c41b51acebaa9ac14260b3939d582b83", + "support" + ], + "xhr/send-content-type-string.htm": [ + "1f90fd9a583794013b505524c9d6d1bad3e4db9c", + "testharness" + ], + "xhr/send-data-arraybuffer.htm": [ + "43a7647ba4c567aaea98efa41d538d5beda682ff", + "testharness" + ], + "xhr/send-data-arraybufferview.htm": [ + "89c4c24408588cbd42f1b3ccfd50f91b6267ff92", + "testharness" + ], + "xhr/send-data-blob.htm": [ + "cf811393a5a18891e46439f5d9bb92acbf45b5e3", + "testharness" + ], + "xhr/send-data-es-object.htm": [ + "711a09c9107498631d6aa40ec532c9b9c0d55643", + "testharness" + ], + "xhr/send-data-formdata.htm": [ + "e7dd3b36ef8e4986edf49aebbd9ff439e101f3ae", + "testharness" + ], + "xhr/send-data-unexpected-tostring.htm": [ + "f74fdf2bfdfb97d8fc648db3d8bcbf28bf348e53", + "testharness" + ], + "xhr/send-entity-body-basic.htm": [ + "6d96982857fd0501152257d25497f704e222ed12", + "testharness" + ], + "xhr/send-entity-body-document-bogus.htm": [ + "d4a39e3bc7e309314c74e4767667feb4c9a8bc48", + "testharness" + ], + "xhr/send-entity-body-document.htm": [ + "c5adfd8edca14061aef38217657112a070683401", + "testharness" + ], + "xhr/send-entity-body-empty.htm": [ + "ae63276f3b52c340e81237573769e53cbb07e07e", + "testharness" + ], + "xhr/send-entity-body-get-head-async.htm": [ + "1f2ed114e408365c7fbab6642db27e8e2046430a", + "testharness" + ], + "xhr/send-entity-body-get-head.htm": [ + "40848a8e40691622b8ea97e451bfbb850d76eef4", + "testharness" + ], + "xhr/send-entity-body-none.htm": [ + "7b931695fe83a3aed260e1eed87bbe0819a66874", + "testharness" + ], + "xhr/send-network-error-async-events.sub.htm": [ + "85d0484051e19077c1dd0fde8845761fdca45b5a", + "testharness" + ], + "xhr/send-network-error-sync-events.sub.htm": [ + "8dd189e5d654c1fc46808dbd860ed0b055851227", + "testharness" + ], + "xhr/send-no-response-event-loadend.htm": [ + "fac776e892ef186e6ac83b5fb869183682b3209c", + "testharness" + ], + "xhr/send-no-response-event-loadstart.htm": [ + "df45abd800cc1ab0a58f30ff0a7483369170c429", + "testharness" + ], + "xhr/send-no-response-event-order-expected.txt": [ + "3dd2b74f51a96c75796383e5fabd1653aa3c4cbb", + "support" + ], + "xhr/send-no-response-event-order.htm": [ + "8cbae4812e0a52e492a58c2c7fec4e5db5438153", + "testharness" + ], + "xhr/send-non-same-origin.htm": [ + "55abab10b4acd3e95c026ac81d9b30994fa0db8e", + "testharness" + ], + "xhr/send-receive-utf16.htm": [ + "d532cb2b3cf98bad57e4bed6417564ed047f492c", + "testharness" + ], + "xhr/send-redirect-bogus-sync.htm": [ + "2dcb43fb80976a41d59a45a86d437fbaaa1eadff", + "testharness" + ], + "xhr/send-redirect-bogus.htm": [ + "02ba73594e49226355aea8df228f49a57ed4a93c", + "testharness" + ], + "xhr/send-redirect-infinite-sync.htm": [ + "63bcb776518d71f4fdc66441a411fcd989137d5e", + "testharness" + ], + "xhr/send-redirect-infinite.htm": [ + "ebf9820dbbdeeeda873f233848a0dadb10484038", + "testharness" + ], + "xhr/send-redirect-no-location.htm": [ + "65831f4839b014dcd17cc53cc0f338978580ceaf", + "testharness" + ], + "xhr/send-redirect-post-upload.htm": [ + "504168881ffa74378fc151f01fe53a177fc89633", + "testharness" + ], + "xhr/send-redirect-to-cors.htm": [ + "4cdf1cc02c93c3ac96276f5be7db89758dc3e5e0", + "testharness" + ], + "xhr/send-redirect-to-non-cors.htm": [ + "a6500b376465aa51b21f08a7f72a2f30e6058d30", + "testharness" + ], + "xhr/send-redirect.htm": [ + "b430be84a453581d997856413ce14967108c75b4", + "testharness" + ], + "xhr/send-response-event-order-expected.txt": [ + "7de2c65764c3227cf2e8b5d27509f0139c856769", + "support" + ], + "xhr/send-response-event-order.htm": [ + "179e700e1cfb2ed67b4fba193b7aca5f71f91154", + "testharness" + ], + "xhr/send-response-upload-event-loadend.htm": [ + "d093519b07fef4176358308de50487a2a708ad01", + "testharness" + ], + "xhr/send-response-upload-event-loadstart.htm": [ + "6f2f52412fba355fdf0acfdeb0f19f68edbf5120", + "testharness" + ], + "xhr/send-response-upload-event-progress.htm": [ + "3e1788b46878b452f4417eb72dc16b80bcbad46c", + "testharness" + ], + "xhr/send-send.htm": [ + "8090983cb88c47209dd3e8a22883434401811985", + "testharness" + ], + "xhr/send-send.js": [ + "c802b56486b0967c4ede9d15dc64a546a627ef4a", + "support" + ], + "xhr/send-send.worker.js": [ + "f2de076a4fd8e7987aeb57b8f7cc44706d0cfa88", + "testharness" + ], + "xhr/send-sync-blocks-async.htm": [ + "db759d19e34e2d64f74322f608d0cbc7427e6c23", + "testharness" + ], + "xhr/send-sync-no-response-event-load.htm": [ + "51b87c5b915abd47f185a5c09600b9bf1be2a449", + "testharness" + ], + "xhr/send-sync-no-response-event-loadend.htm": [ + "b5b5a26530afa18289e1e06a4de033607a80a9fd", + "testharness" + ], + "xhr/send-sync-no-response-event-order.htm": [ + "bf76cb8987608b7bb9f59627032826d21936f450", + "testharness" + ], + "xhr/send-sync-response-event-order-expected.txt": [ + "70c00c61fbfff76b3f6042dac646624464ccb3f0", + "support" + ], + "xhr/send-sync-response-event-order.htm": [ + "3e2d0154469dcdf3a04376c2c350dab681ff8fe7", + "testharness" + ], + "xhr/send-sync-timeout.htm": [ + "943b2ff7b11f121e95d80a94086ea124703c16ad", + "testharness" + ], + "xhr/send-timeout-events.htm": [ + "d7f26cf564d87f53b6a6eebf87aa5f46f1320541", + "testharness" + ], + "xhr/send-usp.any.js": [ + "4ce0391feee2b9787792bb4f753c42610e7a4da4", + "testharness" + ], + "xhr/setrequestheader-after-send.htm": [ + "e82560558c317be61c7afdf95831d017334f2710", + "testharness" + ], + "xhr/setrequestheader-allow-empty-value.htm": [ + "42613edfadddfd6457c293de765202d1c93b2e56", + "testharness" + ], + "xhr/setrequestheader-allow-whitespace-in-value.htm": [ + "3a276cd07a44139a41f8237a514a9be0ac0bbeff", + "testharness" + ], + "xhr/setrequestheader-before-open.htm": [ + "a48dc523bf2e53b15d2cac297a779d6af2cc94bd", + "testharness" + ], + "xhr/setrequestheader-bogus-name.htm": [ + "6bcba2aeef3276a57ee03d41e24fe2c29ca94050", + "testharness" + ], + "xhr/setrequestheader-bogus-value.htm": [ + "74ea5a08ea9a5185ee20fda78b34f6b3d4d6485b", + "testharness" + ], + "xhr/setrequestheader-case-insensitive.htm": [ + "a4b01fb28b9002f561900de30bddf1224eb63f7b", + "testharness" + ], + "xhr/setrequestheader-content-type-expected.txt": [ + "b2eaf7b578420cca02dd517685501e177767b228", + "support" + ], + "xhr/setrequestheader-content-type.htm": [ + "388341fe59bbc12228bad7a605a26cab014220ad", + "testharness" + ], + "xhr/setrequestheader-header-allowed.htm": [ + "19108e657472c4967e6a86e7c60ce0ad00ae7d6f", + "testharness" + ], + "xhr/setrequestheader-header-forbidden.htm": [ + "5908e84fd8772dbe91ce204c57ce0b56f006ecdb", + "testharness" + ], + "xhr/setrequestheader-open-setrequestheader.htm": [ + "60d898c702b1486fdd017be516786729204a0f6d", + "testharness" + ], + "xhr/status-async.htm": [ + "5a2330789348f56971dedef5f314c6d88c4ea3ce", + "testharness" + ], + "xhr/status-basic.htm": [ + "f8cfccecc4df3b25091dc74639d9615101307daf", + "testharness" + ], + "xhr/status-error.htm": [ + "42182437d8c1015339825c035127877f4970decb", + "testharness" + ], + "xhr/template-element.html": [ + "748f12beaa646e244f8312afd545f56075cac727", + "testharness" + ], + "xhr/timeout-cors-async.htm": [ + "d5b0fa4ab0907d58f7cf5796c2bb740e5f91a82f", + "testharness" + ], + "xhr/timeout-multiple-fetches.html": [ + "6a2443d1c4baeadec58a339b8ea87fec3a753080", + "testharness" + ], + "xhr/timeout-sync.htm": [ + "aefabb6eedc02aae1a46e860c12e104de251efa1", + "testharness" + ], + "xhr/xmlhttprequest-basic.htm": [ + "a67d1876d6245fb94d60a937b633c87c51a04d21", + "testharness" + ], + "xhr/xmlhttprequest-eventtarget.htm": [ + "40c886f79399108db3ded8a23848905dcf9e0862", + "testharness" + ], + "xhr/xmlhttprequest-network-error-sync.htm": [ + "ae354ecee8e774f2005daca9084d3e6422f829be", + "testharness" + ], + "xhr/xmlhttprequest-network-error.htm": [ + "89701025efa1790f619cb568db41646feb83688a", + "testharness" + ], + "xhr/xmlhttprequest-sync-block-defer-scripts-subframe.html": [ + "316f2748b8386490a0f76609d23e1059da3296ad", + "support" + ], + "xhr/xmlhttprequest-sync-block-defer-scripts.html": [ + "f5c24af1aad9988eda0909af602b072c776be34a", + "testharness" + ], + "xhr/xmlhttprequest-sync-block-scripts.html": [ + "380cd66f0ffda3cd0e01df31aa2679c4869535f6", + "testharness" + ], + "xhr/xmlhttprequest-sync-default-feature-policy.sub-expected.txt": [ + "90c79618132380421d63fcd08aab6fed2d5b97a2", + "support" + ], + "xhr/xmlhttprequest-sync-default-feature-policy.sub.html": [ + "a702c102155a1399c4a53477fc079d61b739976f", + "testharness" + ], + "xhr/xmlhttprequest-sync-not-hang-scriptloader-subframe.html": [ + "c96e8731cecbfb076b6c99ba4f751b9abaddabb8", + "support" + ], + "xhr/xmlhttprequest-sync-not-hang-scriptloader.html": [ + "3972db1fa5ee4cad66ce28f603cdaaf0fff57a30", + "testharness" + ], + "xhr/xmlhttprequest-timeout-aborted.html": [ + "4ab45a7d5aeae8444885e61d73e8dffa96355f56", + "testharness" + ], + "xhr/xmlhttprequest-timeout-abortedonmain.html": [ + "c30d31d766d5e195303b39a50665c949603e0c4f", + "testharness" + ], + "xhr/xmlhttprequest-timeout-overrides.html": [ + "ffb40f33a3f0cb85520c1218c183c387fed89c29", + "testharness" + ], + "xhr/xmlhttprequest-timeout-overridesexpires.html": [ + "62d637e636a998a9da3245f6afc6b17782870929", + "testharness" + ], + "xhr/xmlhttprequest-timeout-reused.html": [ + "dbd2edcfc16a58a89f13c783de1ba2529786095c", + "testharness" + ], + "xhr/xmlhttprequest-timeout-simple.html": [ + "6d774362fc2bd235b272e163c5872fa632dbb80f", + "testharness" + ], + "xhr/xmlhttprequest-timeout-synconmain.html": [ + "db05db83076e62de39514f02b193d692e27642fc", + "testharness" + ], + "xhr/xmlhttprequest-timeout-twice.html": [ + "8352d6ff8e7e86240308e35e9bf2c8cd9ec55023", + "testharness" + ], + "xhr/xmlhttprequest-timeout-worker-aborted.html": [ + "8719276489716c4a8d356710c2c190d9e8b5b06a", + "testharness" + ], + "xhr/xmlhttprequest-timeout-worker-overrides.html": [ + "7c1702b9740dfd14b59de9d9c7743c7758a06b50", + "testharness" + ], + "xhr/xmlhttprequest-timeout-worker-overridesexpires.html": [ + "fe7b691df755e1322262df44ef6dfb05cbf7fb8e", + "testharness" + ], + "xhr/xmlhttprequest-timeout-worker-simple.html": [ + "7dd1f431b436aa9b9f7dbfe2e5aa9d42568cb6e4", + "testharness" + ], + "xhr/xmlhttprequest-timeout-worker-synconworker.html": [ + "1387ef228dd7ee8fe9c02e670ec2eb8b1fa14646", + "testharness" + ], + "xhr/xmlhttprequest-timeout-worker-twice.html": [ + "2742bcec64e68283817457336bb1b3502440acdd", + "testharness" + ], + "xhr/xmlhttprequest-unsent.htm": [ + "8051e72ea6d92c55fa457eb88f00da3b7a873225", + "testharness" ] }, "url_base": "/",
diff --git a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/common.js b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/common.js index 54cdf6b7..cd2a801 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/common.js +++ b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/common.js
@@ -1,58 +1,107 @@ -function testCanvasDisplayingPattern(canvas) -{ - var tolerance = 5; // for creating ImageBitmap from a video, the tolerance needs to be high - _assertPixelApprox(canvas, 5,5, 255,0,0,255, "5,5", "255,0,0,255", tolerance); - _assertPixelApprox(canvas, 15,5, 0,255,0,255, "15,5", "0,255,0,255", tolerance); - _assertPixelApprox(canvas, 5,15, 0,0,255,255, "5,15", "0,0,255,255", tolerance); - _assertPixelApprox(canvas, 15,15, 0,0,0,255, "15,15", "0,0,0,255", tolerance); -} - -function testDrawImageBitmap(source) -{ - var canvas = document.createElement("canvas"); - canvas.width = 20; - canvas.height = 20; - var ctx = canvas.getContext("2d"); - ctx.clearRect(0, 0, canvas.width, canvas.height); - return createImageBitmap(source).then(imageBitmap => { - ctx.drawImage(imageBitmap, 0, 0); - testCanvasDisplayingPattern(canvas); +function makeCanvas() { + return new Promise(resolve => { + var testCanvas = document.createElement("canvas"); + testCanvas.width = 20; + testCanvas.height = 20; + var testCtx = testCanvas.getContext("2d"); + testCtx.fillStyle = "rgb(255, 0, 0)"; + testCtx.fillRect(0, 0, 10, 10); + testCtx.fillStyle = "rgb(0, 255, 0)"; + testCtx.fillRect(10, 0, 10, 10); + testCtx.fillStyle = "rgb(0, 0, 255)"; + testCtx.fillRect(0, 10, 10, 10); + testCtx.fillStyle = "rgb(0, 0, 0)"; + testCtx.fillRect(10, 10, 10, 10); + resolve(testCanvas); }); } -function initializeTestCanvas(testCanvas) -{ - testCanvas.width = 20; - testCanvas.height = 20; - var testCtx = testCanvas.getContext("2d"); - testCtx.fillStyle = "rgb(255, 0, 0)"; - testCtx.fillRect(0, 0, 10, 10); - testCtx.fillStyle = "rgb(0, 255, 0)"; - testCtx.fillRect(10, 0, 10, 10); - testCtx.fillStyle = "rgb(0, 0, 255)"; - testCtx.fillRect(0, 10, 10, 10); - testCtx.fillStyle = "rgb(0, 0, 0)"; - testCtx.fillRect(10, 10, 10, 10); +function makeOffscreenCanvas() { + return new Promise(resolve => { + let canvas = new OffscreenCanvas(20, 20); + var testCtx = canvas.getContext("2d"); + testCtx.fillStyle = "rgb(255, 0, 0)"; + testCtx.fillRect(0, 0, 10, 10); + testCtx.fillStyle = "rgb(0, 255, 0)"; + testCtx.fillRect(10, 0, 10, 10); + testCtx.fillStyle = "rgb(0, 0, 255)"; + testCtx.fillRect(0, 10, 10, 10); + testCtx.fillStyle = "rgb(0, 0, 0)"; + testCtx.fillRect(10, 10, 10, 10); + resolve(canvas); + }); } -function initializeImageData(imgData, width, height) -{ - for (var i = 0; i < width * height * 4; i+=4) { - imgData.data[i] = 0; - imgData.data[i + 1] = 0; - imgData.data[i + 2] = 0; - imgData.data[i + 3] = 255; //alpha channel: 255 - } - var halfWidth = width/2; - var halfHeight = height/2; - // initialize to R, G, B, Black, with each one 10*10 pixels - for (var i = 0; i < halfHeight; i++) - for (var j = 0; j < halfWidth; j++) - imgData.data[i * width * 4 + j * 4] = 255; - for (var i = 0; i < halfHeight; i++) - for (var j = halfWidth; j < width; j++) - imgData.data[i * width * 4 + j * 4 + 1] = 255; - for (var i = halfHeight; i < height; i++) - for (var j = 0; j < halfWidth; j++) - imgData.data[i * width * 4 + j * 4 + 2] = 255; +function makeVideo() { + return new Promise(function(resolve, reject) { + var video = document.createElement("video"); + video.oncanplaythrough = function() { + resolve(video); + }; + video.src = "/images/pattern.ogv"; + }); } + +function makeImage() { + return new Promise(resolve => { + var img = new Image(); + img.onload = function() { + resolve(img); + }; + img.src = "/images/pattern.png"; + }); +} + +function makeImageData() { + return new Promise(function(resolve, reject) { + var width = 20, height = 20; + var imgData = new ImageData(width, height); + for (var i = 0; i < width * height * 4; i += 4) { + imgData.data[i] = 0; + imgData.data[i + 1] = 0; + imgData.data[i + 2] = 0; + imgData.data[i + 3] = 255; //alpha channel: 255 + } + var halfWidth = width / 2; + var halfHeight = height / 2; + // initialize to R, G, B, Black, with each one 10*10 pixels + for (var i = 0; i < halfHeight; i++) + for (var j = 0; j < halfWidth; j++) + imgData.data[i * width * 4 + j * 4] = 255; + for (var i = 0; i < halfHeight; i++) + for (var j = halfWidth; j < width; j++) + imgData.data[i * width * 4 + j * 4 + 1] = 255; + for (var i = halfHeight; i < height; i++) + for (var j = 0; j < halfWidth; j++) + imgData.data[i * width * 4 + j * 4 + 2] = 255; + resolve(imgData); + }); +} + +function makeImageBitmap() { + return makeCanvas().then(canvas => { + return createImageBitmap(canvas); + }); +} + +function makeBlob() { + return new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/pattern.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); +} + +var imageSourceTypes = [ + { name: 'an HTMLCanvasElement', factory: makeCanvas }, + { name: 'an HTMLVideoElement', factory: makeVideo }, + { name: 'an HTMLImageElement', factory: makeImage }, + { name: 'an OffscreenCanvas', factory: makeOffscreenCanvas }, + { name: 'an ImageData', factory: makeImageData }, + { name: 'an ImageBitmap', factory: makeImageBitmap }, + { name: 'a Blob', factory: makeBlob }, +];
diff --git a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-drawImage.html b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-drawImage.html index 39c5ac1c..98b656e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-drawImage.html +++ b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-drawImage.html
@@ -8,68 +8,41 @@ <link rel="stylesheet" href="/common/canvas-tests.css"> <body> <script> -(function() { +function testCanvasDisplayingPattern(canvas) +{ + var tolerance = 5; // for creating ImageBitmap from a video, the tolerance needs to be high + _assertPixelApprox(canvas, 5,5, 255,0,0,255, "5,5", "255,0,0,255", tolerance); + _assertPixelApprox(canvas, 15,5, 0,255,0,255, "15,5", "0,255,0,255", tolerance); + _assertPixelApprox(canvas, 5,15, 0,0,255,255, "5,15", "0,0,255,255", tolerance); + _assertPixelApprox(canvas, 15,15, 0,0,0,255, "15,15", "0,0,0,255", tolerance); +} + +function testDrawImageBitmap(source, args = []) +{ + var canvas = document.createElement("canvas"); + canvas.width = 20; + canvas.height = 20; + var ctx = canvas.getContext("2d"); + ctx.clearRect(0, 0, canvas.width, canvas.height); + return createImageBitmap(source, ...args).then(imageBitmap => { + ctx.drawImage(imageBitmap, 0, 0); + testCanvasDisplayingPattern(canvas); + }); +} + +for (let { name, factory } of imageSourceTypes) { promise_test(function() { - return new Promise(function(resolve, reject) { - var img = new Image(); - img.onload = function() { resolve(img); }; - img.src = "/images/pattern.png"; - }).then(function(img) { + return factory().then(function(img) { return testDrawImageBitmap(img); }); - }, "createImageBitmap from a HTMLImageElement, and drawImage on the created ImageBitmap"); + }, `createImageBitmap from ${name}, and drawImage on the created ImageBitmap`); promise_test(function() { - return new Promise(function(resolve, reject) { - var xhr = new XMLHttpRequest(); - xhr.open("GET", '/images/pattern.png'); - xhr.responseType = 'blob'; - xhr.send(); - xhr.onload = function() { - blob = xhr.response; - resolve(blob); - }; - }).then(function(blob) { - return testDrawImageBitmap(blob); + return factory().then(function(img) { + return testDrawImageBitmap(img, [20, 20, -20, -20]); }); - }, "createImageBitmap from a Blob, and drawImage on the created ImageBitmap"); - - promise_test(function() { - var testCanvas = document.createElement("canvas"); - initializeTestCanvas(testCanvas); - return testDrawImageBitmap(testCanvas); - }, "createImageBitmap from a HTMLCanvasElement, and drawImage on the created ImageBitmap"); - - promise_test(function() { - var testCanvas = document.createElement("canvas"); - initializeTestCanvas(testCanvas); - return new Promise(function(resolve, reject) { - createImageBitmap(testCanvas).then(function(bitmap) { - resolve(bitmap); - }); - }).then(function(bitmap) { - return testDrawImageBitmap(bitmap); - }); - }, "createImageBitmap from an ImageBitmap, and drawImage on the created ImageBitmap"); - - promise_test(function() { - var imgData = new ImageData(20, 20); - initializeImageData(imgData, 20, 20); - return testDrawImageBitmap(imgData); - }, "createImageBitmap from an ImageData, and drawImage on the created ImageBitmap"); - - promise_test(function() { - return new Promise(function(resolve, reject) { - var video = document.createElement("video"); - video.oncanplaythrough = function() { - resolve(video); - }; - video.src = "/images/pattern.ogv"; - }).then(function(video) { - return testDrawImageBitmap(video); - }); - }, "createImageBitmap from a HTMLVideoElement, and drawImage on the created ImageBitmap"); -})(); + }, `createImageBitmap from ${name} with negative sw/sh, and drawImage on the created ImageBitmap`); +} </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-invalid-args.html b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-invalid-args.html index ad8618a..922597d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-invalid-args.html +++ b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
@@ -1,24 +1,9 @@ <!doctype html> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="common.js"></script> <script> -function makeCanvas() { - return new Promise(resolve => { - let canvas = document.createElement('canvas'); - canvas.setAttribute('width', '10'); - canvas.setAttribute('height', '10'); - resolve(canvas); - }); -} - -function makeOffscreenCanvas() { - return new Promise(resolve => { - let canvas = new OffscreenCanvas(10, 10); - resolve(canvas); - }); -} - function makeOversizedCanvas() { return new Promise(resolve => { @@ -36,46 +21,6 @@ }); } -function makeVideo() { - return new Promise(resolve => { - let video = document.createElement('video'); - video.addEventListener('canplaythrough', resolve.bind(undefined, video), false); - video.src = '/media/A4.ogv'; - }); -} - -function makeImage() { - return makeCanvas().then(canvas => { - let image = new Image(); - image.src = canvas.toDataURL(); - return new Promise(resolve => { - image.onload = resolve.bind(undefined, image); - }); - }); -} - -function makeImageData() { - return makeCanvas().then(canvas => { - return new Promise(function(resolve, reject) { - resolve(canvas.getContext('2d').getImageData(0, 0, 10, 10)); - }); - }); -} - -function makeImageBitmap() { - return makeCanvas().then(canvas => { - return createImageBitmap(canvas); - }); -} - -function makeBlob() { - return makeCanvas().then(canvas => { - return new Promise(resolve => { - canvas.toBlob(resolve); - }); - }); -} - function makeInvalidBlob() { return new Promise(resolve => { resolve(new Blob()); // Blob with no data cannot be decoded. @@ -85,29 +30,20 @@ function makeBrokenImage() { return new Promise(resolve => { const image = new Image(); - image.src = "data,x"; + image.src = "data:,x"; image.onerror = () => resolve(image); }); } function makeAvailableButBrokenImage() { - return new Promise(resolve => { + return new Promise((resolve, reject) => { const image = new Image(); image.src = "/images/broken.png"; image.onload = () => resolve(image); + image.onerror = reject; }); } -imageSourceTypes = [ - { name: 'HTMLImageElement', factory: makeImage }, - { name: 'HTMLVideoElement', factory: makeVideo }, - { name: 'HTMLCanvasElement', factory: makeCanvas }, - { name: 'OffscreenCanvas', factory: makeOffscreenCanvas }, - { name: 'ImageData', factory: makeImageData }, - { name: 'ImageBitmap', factory: makeImageBitmap }, - { name: 'Blob', factory: makeBlob }, -]; - testCases = [ { description: 'createImageBitmap with a <sourceType> source and sw set to ' + @@ -208,4 +144,10 @@ }); }, "createImageBitmap with an available but undecodable image source rejects with an InvalidStateError."); +promise_test( t => { + return makeImageBitmap().then(bitmap => { + bitmap.close() + return promise_rejects(t, "InvalidStateError", createImageBitmap(bitmap)); + }); +}, "createImageBitmap with a closed ImageBitmap rejects with an InvalidStateError."); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/FileReader/test_notreadableerrors-manual.html b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/FileReader/test_notreadableerrors-manual.html new file mode 100644 index 0000000..46d73598a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/FileReader/test_notreadableerrors-manual.html
@@ -0,0 +1,42 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>FileReader NotReadableError Test</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://w3c.github.io/FileAPI/#dfn-error-codes"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<form name="upload"> + <input type="file" id="fileChooser"><br><input type="button" id="start" value="start"> +</form> + +<div> + <p>Test steps:</p> + <ol> + <li>Download the <a href="support/file_test1.txt">file</a>.</li> + <li>Select the file in the file inputbox.</li> + <li>Delete the file's readable permission.</li> + <li>Click the 'start' button.</li> + </ol> +</div> + +<script> + + const fileChooser = document.querySelector('#fileChooser'); + + setup({explicit_done: true}); + setup({explicit_timeout: true}); + + on_event(document.querySelector('#start'), 'click', () => { + async_test(t => { + const reader = new FileReader(); + reader.readAsArrayBuffer(fileChooser.files[0]); + reader.onloadend = t.step_func_done(event => { + assert_equals(event.target.readyState, FileReader.DONE); + assert_equals(reader.error.name, "NotReadableError"); + }); + }, 'FileReader.error should be NotReadableError if the file is unreadable'); + done(); + }); + +</script> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/FileReader/test_securityerrors-manual.html b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/FileReader/test_securityerrors-manual.html new file mode 100644 index 0000000..add93ed --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/FileReader/test_securityerrors-manual.html
@@ -0,0 +1,40 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>FileReader SecurityError Test</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<link rel="help" href="https://w3c.github.io/FileAPI/#dfn-error-codes"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<form name="upload"> + <input type="file" id="fileChooser"><br><input type="button" id="start" value="start"> +</form> + +<div> + <p>Test steps:</p> + <ol> + <li>Select a system sensitive file (e.g. files in /usr/bin, password files, + and other native operating system executables) in the file inputbox.</li> + <li>Click the 'start' button.</li> + </ol> +</div> + +<script> + + const fileChooser = document.querySelector('#fileChooser'); + + setup({explicit_done: true}); + setup({explicit_timeout: true}); + + on_event(document.querySelector('#start'), 'click', () => { + async_test(t => { + const reader = new FileReader(); + reader.readAsArrayBuffer(fileChooser.files[0]); + reader.onloadend = t.step_func_done(event => { + assert_equals(event.target.readyState, FileReader.DONE); + assert_equals(reader.error.name, "SecurityError"); + }); + }, 'FileReader.error should be SECURITY_ERROR if the file is a system sensitive file'); + done(); + }); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/OWNERS index d3b730a9..c1aa799 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/FileAPI/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/FileAPI/OWNERS
@@ -1,3 +1,5 @@ # TEAM: storage-dev@chromium.org # COMPONENT: Blink>FileAPI +# WPT-NOTIFY: true jsbell@chromium.org +mek@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/OWNERS index 3f0214d..cd315c4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/OWNERS
@@ -1,3 +1,4 @@ # TEAM: storage-dev@chromium.org # COMPONENT: Blink>Storage>IndexedDB +# WPT-NOTIFY: true jsbell@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-expected.txt deleted file mode 100644 index 3e1d298..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -This is a testharness.js-based test. -FAIL Local sync redirect to remote origin Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://web-platform.test:8001/XMLHttpRequest/resources/redirect-cors.py?location=http://www1.web-platform.test:8001/XMLHttpRequest/resources/access-control-basic-allow.py'. -PASS Local async redirect to remote origin -FAIL Remote sync redirect to local origin Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://www1.web-platform.test:8001/XMLHttpRequest/resources/redirect-cors.py?location=http://web-platform.test:8001/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true'. -PASS Remote async redirect to local origin -FAIL Remote sync redirect to same remote origin Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://www1.web-platform.test:8001/XMLHttpRequest/resources/redirect-cors.py?location=http://www1.web-platform.test:8001/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true'. -PASS Remote async redirect to same remote origin -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-upload-progress-crossorigin-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-upload-progress-crossorigin-expected.txt deleted file mode 100644 index c29d392..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-upload-progress-crossorigin-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -This is a testharness.js-based test. -PASS Upload events registered on time (http://www1.web-platform.test:8001/XMLHttpRequest/resources/corsenabled.py) -FAIL Upload events registered on time (resources/redirect.py?code=307&location=http://www1.web-platform.test:8001/XMLHttpRequest/resources/corsenabled.py) assert_unreached: Reached unreachable code -PASS Upload events registered too late (http://www1.web-platform.test:8001/XMLHttpRequest/resources/corsenabled.py) -PASS Upload events registered too late (resources/redirect.py?code=307&location=http://www1.web-platform.test:8001/XMLHttpRequest/resources/corsenabled.py) -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/idl-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/idl-expected.txt deleted file mode 100644 index 5578522..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/idl-expected.txt +++ /dev/null
@@ -1,32 +0,0 @@ -This is a testharness.js-based test. -FAIL SecurityPolicyViolationEvent interface: existence and properties of interface object Cannot read property 'has_extended_attribute' of undefined -PASS SecurityPolicyViolationEvent interface object length -PASS SecurityPolicyViolationEvent interface object name -FAIL SecurityPolicyViolationEvent interface: existence and properties of interface prototype object Cannot read property 'has_extended_attribute' of undefined -PASS SecurityPolicyViolationEvent interface: existence and properties of interface prototype object's "constructor" property -PASS SecurityPolicyViolationEvent interface: attribute documentURI -PASS SecurityPolicyViolationEvent interface: attribute referrer -PASS SecurityPolicyViolationEvent interface: attribute blockedURI -PASS SecurityPolicyViolationEvent interface: attribute violatedDirective -PASS SecurityPolicyViolationEvent interface: attribute effectiveDirective -PASS SecurityPolicyViolationEvent interface: attribute originalPolicy -PASS SecurityPolicyViolationEvent interface: attribute sourceFile -PASS SecurityPolicyViolationEvent interface: attribute disposition -PASS SecurityPolicyViolationEvent interface: attribute statusCode -PASS SecurityPolicyViolationEvent interface: attribute lineNumber -PASS SecurityPolicyViolationEvent interface: attribute columnNumber -PASS SecurityPolicyViolationEvent must be primary interface of new SecurityPolicyViolationEvent({}) -FAIL Stringification of new SecurityPolicyViolationEvent({}) Cannot read property 'has_stringifier' of undefined -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "documentURI" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "referrer" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "blockedURI" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "violatedDirective" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "effectiveDirective" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "originalPolicy" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "sourceFile" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "disposition" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "statusCode" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "lineNumber" with the proper type -PASS SecurityPolicyViolationEvent interface: new SecurityPolicyViolationEvent({}) must inherit property "columnNumber" with the proper type -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/idl.html b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/idl.html index 17f492e..a4f9e68 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/idl.html +++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/securitypolicyviolation/idl.html
@@ -21,6 +21,9 @@ long lineNumber; long columnNumber; }; + + interface Event { + }; </script> <script type="text/plain" id="tested"> [Constructor(DOMString type, optional SecurityPolicyViolationEventInit eventInitDict)]
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/style-src/style-src-imported-style-blocked.html b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/style-src/style-src-imported-style-blocked.html index 1906611..a0088809 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/style-src/style-src-imported-style-blocked.html +++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/style-src/style-src-imported-style-blocked.html
@@ -12,8 +12,13 @@ document.addEventListener("securitypolicyviolation", t_spv.step_func_done(function(e) { assert_equals("style-src", e.violatedDirective); })); + + var l = document.createElement("link"); + l.setAttribute("href", "/content-security-policy/style-src/resources/style-src-import.sub.css"); + l.setAttribute("rel", "stylesheet"); + l.setAttribute("type", "text/css"); + document.head.appendChild(l); </script> - <link href="/content-security-policy/style-src/resources/style-src-import.sub.css" rel=stylesheet type=text/css> </head> <body> <div id='log'></div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookie-store/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/cookie-store/OWNERS index 5ca6cf5f..30980240 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/cookie-store/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/cookie-store/OWNERS
@@ -1,2 +1,5 @@ # TEAM: storage-dev@chromium.org # COMPONENT: Blink>Storage +# WPT-NOTIFY: true +bsittler@chromium.org +pwnall@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cors/README.md b/third_party/WebKit/LayoutTests/external/wpt/cors/README.md index b239462..aa5ff90 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/cors/README.md +++ b/third_party/WebKit/LayoutTests/external/wpt/cors/README.md
@@ -5,4 +5,4 @@ More CORS tests can be found in * /fetch -* /XMLHttpRequest +* /xhr
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/line-height-oof-descendants-001-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/line-height-oof-descendants-001-ref.html new file mode 100644 index 0000000..c338a1b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/line-height-oof-descendants-001-ref.html
@@ -0,0 +1,14 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Test Reference</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<style> +p { + font-size: 20px; + line-height: 0; +} +</style> +<p>Some paragraph</p> +<p>Some paragraph</p> +<p>Some paragraph</p> +<p>Some other paragraph</p>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/line-height-oof-descendants-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/line-height-oof-descendants-001.html new file mode 100644 index 0000000..6663b194 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/CSS2/linebox/line-height-oof-descendants-001.html
@@ -0,0 +1,17 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Test: line-height is not affected by out-of-flow descendants</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="help" href="https://www.w3.org/TR/CSS21/visudet.html#line-height"> +<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1426760"> +<link rel="match" href="line-height-oof-descendants-001-ref.html"> +<style> +p { + font-size: 20px; + line-height: 0; +} +</style> +<p><span style="position: absolute;"></span>Some paragraph</p> +<p><span style="float: left;"></span>Some paragraph</p> +<p><span style="position: fixed;"></span>Some paragraph</p> +<p>Some other paragraph</p>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/background-repeat/gradient-repeat-spaced-with-borders.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/background-repeat/gradient-repeat-spaced-with-borders.html new file mode 100644 index 0000000..289e856 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/background-repeat/gradient-repeat-spaced-with-borders.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Tiled gradient with spaces is repeated behind the border.</title> +<link rel="match" href="reference/gradient-repeat-spaced-with-borders.html"> +<link rel="help" href="https://drafts.csswg.org/css-backgrounds-3/#valdef-background-repeat-space"> +<style> + #foo { + width: 65px; + height: 65px; + border: solid 35px transparent; + background: radial-gradient(transparent 50%, #36c 50%); + background-size: 30px 30px; + background-repeat: space; + } +</style> +<body> + <div id="foo"></div> +</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/background-repeat/reference/gradient-repeat-spaced-with-borders.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/background-repeat/reference/gradient-repeat-spaced-with-borders.html new file mode 100644 index 0000000..0c226c8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-backgrounds/background-repeat/reference/gradient-repeat-spaced-with-borders.html
@@ -0,0 +1,15 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Spaced Gradient</title> +<style> + #foo { + width: calc(4 * 30px + 3 * 5px); + height: calc(4 * 30px + 3 * 5px); + background: radial-gradient(transparent 50%, #36c 50%); + background-size: 30px 30px; + background-repeat: space; + } +</style> +<body> + <div id="foo"></div> +</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parse-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parse-invalid.html new file mode 100644 index 0000000..30fbd71a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parse-invalid.html
@@ -0,0 +1,29 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSStyleValue.parse Error Handling</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-parse"> +<meta name="assert" content="Test CSSStyleValue.parse error handling" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<div id="log"> +<script> +'use strict'; + +test(() => { + assert_throws(new TypeError(), () => CSSStyleValue.parse('', 'auto')); +}, 'CSSStyleValue.parse() with empty property name throws TypeError'); + +test(() => { + assert_throws(new TypeError(), () => CSSStyleValue.parse('lemon', 'auto')); +}, 'CSSStyleValue.parse() with unsupported property name throws TypeError'); + +test(() => { + assert_throws(new TypeError(), () => CSSStyleValue.parse('background', 'red')); +}, 'CSSStyleValue.parse() with shorthand property throws TypeError'); + +test(() => { + assert_throws(new TypeError(), () => CSSStyleValue.parse('width', '10deg')); +}, 'CSSStyleValue.parse() with invalid value for valid property throws TypeError'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parse.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parse.html new file mode 100644 index 0000000..bc785d8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parse.html
@@ -0,0 +1,31 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSStyleValue.parse</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-parse"> +<meta name="assert" content="Test CSSStyleValue.parse returns CSSStyleValues" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<div id="log"> +<script> +'use strict'; + +test(() => { + const result = CSSStyleValue.parse('width', '10px'); + assert_true(result instanceof CSSStyleValue, + 'Result must be a subclass of CSSStyleValue'); +}, 'CSSStyleValue.parse() with a valid property returns a CSSStyleValue'); + +test(() => { + const result = CSSStyleValue.parse('transition-duration', '1s, 2s, 3s'); + assert_true(result instanceof CSSStyleValue, + 'Result must be a subclass of CSSStyleValue'); +}, 'CSSStyleValue.parse() with a valid list-valued property returns a CSSStyleValue'); + +test(() => { + const result = CSSStyleValue.parse('--foo', 'auto'); + assert_true(result instanceof CSSStyleValue, + 'Result must be a subclass of CSSStyleValue'); +}, 'CSSStyleValue.parse() with a valid custom property returns a CSSStyleValue'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parseAll-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parseAll-invalid.html new file mode 100644 index 0000000..1d138b512 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parseAll-invalid.html
@@ -0,0 +1,29 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSStyleValue.parseAll Error Handling</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-parseall"> +<meta name="assert" content="Test CSSStyleValue.parseAll error handling" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<div id="log"> +<script> +'use strict'; + +test(() => { + assert_throws(new TypeError(), () => CSSStyleValue.parseAll('', 'auto')); +}, 'CSSStyleValue.parseAll() with empty property name throws TypeError'); + +test(() => { + assert_throws(new TypeError(), () => CSSStyleValue.parseAll('lemon', 'auto')); +}, 'CSSStyleValue.parseAll() with unsupported property name throws TypeError'); + +test(() => { + assert_throws(new TypeError(), () => CSSStyleValue.parseAll('background', 'red')); +}, 'CSSStyleValue.parseAll() with shorthand property throws TypeError'); + +test(() => { + assert_throws(new TypeError(), () => CSSStyleValue.parseAll('width', '10deg')); +}, 'CSSStyleValue.parseAll() with invalid value for valid property throws TypeError'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parseAll.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parseAll.html new file mode 100644 index 0000000..585fc2b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/stylevalue-objects/parseAll.html
@@ -0,0 +1,36 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSSStyleValue.parseAll</title> +<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-parseall"> +<meta name="assert" content="Test CSSStyleValue.parseAll returns CSSStyleValues" /> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +<div id="log"> +<script> +'use strict'; + +test(() => { + const result = CSSStyleValue.parseAll('width', '10px'); + assert_equals(result.length, 1, 'Result must be a list with one element'); + assert_true(result[0] instanceof CSSStyleValue, + 'Only element in result must be a subclass of CSSStyleValue'); +}, 'CSSStyleValue.parseAll() with a valid property returns a list with a single CSSStyleValue'); + +test(() => { + const result = CSSStyleValue.parseAll('transition-duration', '1s, 2s, 3s'); + assert_equals(result.length, 3, 'Result must be a list with three elements'); + for (const item of result) { + assert_true(item instanceof CSSStyleValue, + 'All elements in result must be a subclass of CSSStyleValue'); + } +}, 'CSSStyleValue.parseAll() with a valid list-valued property returns a list with a single CSSStyleValue'); + +test(() => { + const result = CSSStyleValue.parseAll('--foo', 'auto'); + assert_equals(result.length, 1, 'Result must be a list with one element'); + assert_true(result[0] instanceof CSSStyleValue, + 'Only element in result must be a subclass of CSSStyleValue'); +}, 'CSSStyleValue.parseAll() with a valid custom property returns a list with a single CSSStyleValue'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-in-color-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-in-color-001.html new file mode 100644 index 0000000..e87719b4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-in-color-001.html
@@ -0,0 +1,25 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Test: calc() function in <color></title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> +<link rel="help" href="https://drafts.csswg.org/css-values/#funcdef-calc"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="testNode"></div> +<script> +const div = document.querySelector("#testNode"); +const TESTS = { + // specified -> expected + "rgb(calc(0), calc(255 + 0), calc(140 - 139 - 1))": "rgb(0, 255, 0)", + "rgba(calc(0%) calc(100%) calc(0%) / calc(10% * 10))": "rgb(0, 255, 0)", + "hsl(calc(5deg * (360 / 5)), calc(10% * 10), calc(10% * 10))": "rgb(255, 255, 255)" +} + +test(function() { + for (let test in TESTS) { + div.style.backgroundColor = ""; + div.style.backgroundColor = test; + assert_equals(getComputedStyle(div).backgroundColor, TESTS[test], test); + } +}, "calc() in color functions"); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-serialization-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-serialization-expected.txt new file mode 100644 index 0000000..c4d4577 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-serialization-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL calc() serialization assert_equals: Serialization of calc(10px + 1vmin + 10%) expected "calc(10% + 10px + 1vmin)" but got "calc((10px + 1vmin) + 10%)" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-serialization.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-serialization.html new file mode 100644 index 0000000..f92de73 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-serialization.html
@@ -0,0 +1,29 @@ +<!doctype html> +<meta charset="utf-8"> +<title>CSS Values and Units: calc() serialization.</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@mozilla.com"> +<link rel="help" href="https://drafts.csswg.org/css-values/#calc-serialize"> +<link rel="help" href="https://github.com/w3c/csswg-drafts/issues/1731"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<div id="content"></div> +<script> +test(function() { + // specified -> expected + var values = { + "calc(10px + 1vmin + 10%)": "calc(10% + 10px + 1vmin)", + "calc(10px + 1vmin)": "calc(10px + 1vmin)", + "calc(10px + 1em)": "calc(1em + 10px)", + "calc(1vmin - 10px)": "calc(-10px + 1vmin)", + "calc(-10px + 1em)": "calc(1em - 10px)", + "calc(-10px)": "calc(-10px)", + }; + + var content = document.getElementById("content"); + + for (var prop in values) { + content.style.width = prop; + assert_equals(content.style.width, values[prop], "Serialization of " + prop); + } +}, "calc() serialization") +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollTop-display-change-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollTop-display-change-ref.html new file mode 100644 index 0000000..9f12597 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollTop-display-change-ref.html
@@ -0,0 +1,8 @@ +<!doctype html> +<meta charset=utf-8> +<div id="scroller" style="height: 100px; overflow: scroll"> + <div style="height: 1000px"> + I should be visible. + </div> + I should not be visible. +</div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollTop-display-change.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollTop-display-change.html new file mode 100644 index 0000000..916bfec --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollTop-display-change.html
@@ -0,0 +1,17 @@ +<!doctype html> +<meta charset=utf-8> +<title>Setting scrollTop to 0 immediately after toggling display from "none" on an element that had nonzero scrollTop before should work.</title> +<link rel=match href="scrollTop-display-change-ref.html"> +<div id="scroller" style="height: 100px; overflow: scroll"> + <div style="height: 1000px"> + I should be visible. + </div> + I should not be visible. +</div> +<script> + scroller.scrollTop = 1000; + scroller.style.display = "none"; + var win = scroller.scrollTop; // Force layout flush + scroller.style.display = ""; + scroller.scrollTop = 0; +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/stylesheet-replacedata-dynamic-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/stylesheet-replacedata-dynamic-ref.html new file mode 100644 index 0000000..bc9cade --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/stylesheet-replacedata-dynamic-ref.html
@@ -0,0 +1,7 @@ +<!doctype html> +<title>(Ref #1) CSS Test Reference</title> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@mozilla.com"> +<link rel="author" title="Cheng You Bai" href="mailto:cyb.ai.815@gmail.com"> +<link rel="help" href="https://dom.spec.whatwg.org/#dom-characterdata-replacedata"> +<style>.pass { color: green }</style> +<div class="pass">Should be green</div> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/stylesheet-replacedata-dynamic.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/stylesheet-replacedata-dynamic.html new file mode 100644 index 0000000..3ee5937 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/stylesheet-replacedata-dynamic.html
@@ -0,0 +1,12 @@ +<!doctype html> +<title>(Test #1) CSS Test: Dynamic changes to the stylesheet contents using replaceData are reflected</title> +<link rel="match" href="stylesheet-replacedata-dynamic-ref.html"> +<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@mozilla.com"> +<link rel="author" title="Cheng You Bai" href="mailto:cyb.ai.815@gmail.com"> +<link rel="help" href="https://dom.spec.whatwg.org/#dom-characterdata-replacedata"> +<style>.fail { color: green }</style> +<div class="pass">Should be green</div> +<script> + document.body.offsetTop; + document.querySelector('style').firstChild.replaceData(1, 4, "pass"); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/selectors/invalidation/matches.html b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/invalidation/matches.html new file mode 100644 index 0000000..6fd5b1f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/invalidation/matches.html
@@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html> + <head> + <title>CSS Selectors Invalidation: :any-link</title> + <link rel="author" title="Victoria Su" href="mailto:victoriaytsu@google.com"> + <link rel="help" href="https://drafts.csswg.org/selectors-4/#matches"> + <meta name="assert" content="This tests that the :matches() selector is effective"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <style> + .b { + color: rgb(255, 255, 0); /* yellow */ + } + /*Simple selector arguments */ + .a :matches(.b, .c) { + color: rgb(255, 0, 0); /* red */ + } + /*Compound selector arguments */ + .a :matches(.c#d, .e) { + color: rgb(0, 255, 0); /* green */ + } + </style> + </head> + <body> + <div id="a1"> + <div class="b" id="b1"> + Red + </div> + <div class="c" id="c1"> + Red + </div> + <div class="c" id="d"> + Green + </div> + <div class="e" id="e1"> + Green + </div> + <div class="f" id="f1"> + Blue + </div> + </div> + <script> + document.body.offsetTop; + + test(() => { + assert_equals(getComputedStyle(b1).color, "rgb(255, 255, 0)"); + assert_equals(getComputedStyle(c1).color, "rgb(0, 0, 0)"); + assert_equals(getComputedStyle(d).color, "rgb(0, 0, 0)"); + assert_equals(getComputedStyle(e1).color, "rgb(0, 0, 0)"); + assert_equals(getComputedStyle(f1).color, "rgb(0, 0, 0)"); + }, "Preconditions."); + + test(() => { + a1.className = "a"; + assert_equals(getComputedStyle(b1).color, "rgb(255, 0, 0)"); + assert_equals(getComputedStyle(c1).color, "rgb(255, 0, 0)"); + }, "Invalidate :matches() for simple selector arguments."); + + test(() => { + a1.className = "a"; + assert_equals(getComputedStyle(d).color, "rgb(0, 255, 0)"); + }, "Invalidate :matches() for compound selector arguments."); + + </script> + </body> +</html> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/selectors/selectors-attr-white-space-001-ref.html b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/selectors-attr-white-space-001-ref.html new file mode 100644 index 0000000..3b768b3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/selectors-attr-white-space-001-ref.html
@@ -0,0 +1,11 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Selectors: White space in attribute selectors (reference)</title> +<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au"/> +<style> +body { color: green; } +</style> +<p>This text should be green.</p> +<p>This text should be green.</p> +<p>This text should be green.</p> +<p>This text should be green.</p>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/selectors/selectors-attr-white-space-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/selectors-attr-white-space-001.html new file mode 100644 index 0000000..62df884 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/selectors-attr-white-space-001.html
@@ -0,0 +1,19 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>Selectors: White space in attribute selectors</title> +<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au"/> +<link rel="help" href="https://drafts.csswg.org/selectors-3/#w3cselgrammar"/> +<link rel="help" href="https://drafts.csswg.org/selectors-4/#grammar"/> +<link rel="match" href="selectors-attr-white-space-001-ref.html"/> +<style> +body { color: red; } +[ data-test-1] { color: green; } +[data-test-2 ] { color: green; } +[data-test-3 = x] { color: green; } +[ |data-test-4] { color: green; } +[ | data-test-4] { color: red; } +</style> +<p data-test-1="">This text should be green.</p> +<p data-test-2="">This text should be green.</p> +<p data-test-3="x">This text should be green.</p> +<p data-test-4="">This text should be green.</p>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/selectors/user-invalid-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/user-invalid-expected.txt new file mode 100644 index 0000000..9fac2eed --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/user-invalid-expected.txt
@@ -0,0 +1,5 @@ +This is a testharness.js-based test. +FAIL :user-invalid selector should be supported Failed to execute 'matches' on 'Element': ':user-invalid' is not a valid selector. +PASS :user-error selector should not be supported +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/selectors/user-invalid.html b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/user-invalid.html new file mode 100644 index 0000000..f0c3d93c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/selectors/user-invalid.html
@@ -0,0 +1,20 @@ +<!doctype html> +<title>Support for the :user-invalid pseudo-class</title> +<link rel="help" href="https://drafts.csswg.org/selectors/#user-pseudos"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<input> +<script> +test(() => { + const input = document.querySelector('input'); + // The selector can't match because no interaction has happened. + assert_false(input.matches(':user-invalid')); +}, ':user-invalid selector should be supported'); + +// historical: https://github.com/w3c/csswg-drafts/issues/1329 +test(() => { + const input = document.querySelector('input'); + // matches() will throw if the selector isn't suppported + assert_throws("SyntaxError", () => input.matches(':user-error')); +}, ':user-error selector should not be supported'); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/events/Event-subclasses-constructors.html b/third_party/WebKit/LayoutTests/external/wpt/dom/events/Event-subclasses-constructors.html index 1741b960..1fd70d4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/events/Event-subclasses-constructors.html +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/events/Event-subclasses-constructors.html
@@ -21,6 +21,23 @@ } } +// Class declarations don't go on the global by default, so put it there ourselves: + +self.SubclassedEvent = class SubclassedEvent extends Event { + constructor(name, props) { + super(name, props); + if (props && typeof(props) == "object" && "customProp" in props) { + this.customProp = props.customProp; + } else { + this.customProp = 5; + } + } + + get fixedProp() { + return 17; + } +} + var EventModifierInit = [ ["ctrlKey", false, true], ["shiftKey", false, true], @@ -32,6 +49,7 @@ "properties": [ ["bubbles", false, true], ["cancelable", false, true], + ["isTrusted", false, false], ], }, @@ -93,6 +111,14 @@ ["data", "", "string"], ], }, + + "SubclassedEvent": { + "parent": "Event", + "properties": [ + ["customProp", 5, 8], + ["fixedProp", 17, 17], + ], + }, }; Object.keys(expected).forEach(function(iface) {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventListener-invoke-legacy.html b/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventListener-invoke-legacy.html index 85a4b0a..a01afcd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventListener-invoke-legacy.html +++ b/third_party/WebKit/LayoutTests/external/wpt/dom/events/EventListener-invoke-legacy.html
@@ -51,22 +51,16 @@ } function setupTransition(elem) { - elem.style.transition = ''; - requestAnimationFrame(function() { - elem.style.color = 'red'; - elem.style.transition = 'color 30ms'; - requestAnimationFrame(function() { - elem.style.color = 'green'; - }); - }); + getComputedStyle(elem).color; + elem.style.color = 'green'; + elem.style.transition = 'color 30ms'; } function setupAnimation(elem) { - elem.style.animation = 'test 30ms 2'; + elem.style.animation = 'test 30ms'; } runLegacyEventTest('transitionend', 'webkitTransitionEnd', "TransitionEvent", setupTransition); runLegacyEventTest('animationend', 'webkitAnimationEnd', "AnimationEvent", setupAnimation); -runLegacyEventTest('animationiteration', 'webkitAnimationIteration', "AnimationEvent", setupAnimation); runLegacyEventTest('animationstart', 'webkitAnimationStart', "AnimationEvent", setupAnimation); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/entries-api/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/entries-api/OWNERS index e4f6a1d..777e1278 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/entries-api/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/entries-api/OWNERS
@@ -1 +1,4 @@ +# TEAM: storage-dev@chromium.org +# COMPONENT: Blink>Storage>FileSystem +# WPT-NOTIFY: true file://third_party/WebKit/Source/modules/filesystem/OWNERS
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/README.md b/third_party/WebKit/LayoutTests/external/wpt/fetch/README.md index 3c59056..dcaad02 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/README.md +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/README.md
@@ -3,4 +3,4 @@ More Fetch tests can be found in * /cors -* /XMLHttpRequest +* /xhr
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/request-headers-case.any.js b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/request-headers-case.any.js index 549744fb..067eabb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/request-headers-case.any.js +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/basic/request-headers-case.any.js
@@ -1,11 +1,11 @@ promise_test(() => { - return fetch("/XMLHttpRequest/resources/echo-headers.py", {headers: [["THIS-is-A-test", 1], ["THIS-IS-A-TEST", 2]] }).then(res => res.text()).then(body => { + return fetch("/xhr/resources/echo-headers.py", {headers: [["THIS-is-A-test", 1], ["THIS-IS-A-TEST", 2]] }).then(res => res.text()).then(body => { assert_regexp_match(body, /THIS-is-A-test: 1, 2/) }) }, "Multiple headers with the same name, different case (THIS-is-A-test first)") promise_test(() => { - return fetch("/XMLHttpRequest/resources/echo-headers.py", {headers: [["THIS-IS-A-TEST", 1], ["THIS-is-A-test", 2]] }).then(res => res.text()).then(body => { + return fetch("/xhr/resources/echo-headers.py", {headers: [["THIS-IS-A-TEST", 1], ["THIS-is-A-test", 2]] }).then(res => res.text()).then(body => { assert_regexp_match(body, /THIS-IS-A-TEST: 1, 2/) }) }, "Multiple headers with the same name, different case (THIS-IS-A-TEST first)")
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-iframe.https.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-iframe.https.html new file mode 100644 index 0000000..cb1e9d87 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-iframe.https.html
@@ -0,0 +1,51 @@ +<!DOCTYPE html> +<title>Fetch destination tests for resources with no load event</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> +<script> +let frame; +const kScope = 'resources/dummy.html?dest=document'; + +// Set up the service worker and the frame. +promise_test(t => { + const kScript = 'resources/fetch-destination-worker-iframe.js'; + return service_worker_unregister_and_register(t, kScript, kScope) + .then(registration => { + add_completion_callback(() => { + registration.unregister(); + }); + + return wait_for_state(t, registration.installing, 'activated'); + }); + }, 'Initialize global state'); + +var waitOnMessageFromSW = async t => { + await new Promise((resolve, reject) => { + navigator.serviceWorker.onmessage = t.step_func(event => { + if (event.data == "PASS") { + resolve(); + } else { + reject(); + } + }); + }).catch(() => {; + assert_unreached("Wrong destination."); + }); + t.add_cleanup(() => { frame.contentWindow.navigator.serviceWorker.onmessage = null; }); +} + +// Document destination +/////////////////////// +promise_test(async t => { + var f = document.createElement('iframe'); + frame = f; + f.className = 'test-iframe'; + f.src = kScope; + document.body.appendChild(f); + await waitOnMessageFromSW(t); + add_completion_callback(() => { f.remove(); }); +}, 'iframe fetches with a "document" Request.destination'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-no-load-event.https.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-no-load-event.https.html new file mode 100644 index 0000000..5be882ff --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-no-load-event.https.html
@@ -0,0 +1,124 @@ +<!DOCTYPE html> +<title>Fetch destination tests for resources with no load event</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> +<script> +let frame; + +// Set up the service worker and the frame. +promise_test(t => { + const kScope = 'resources/empty.https.html'; + const kScript = 'resources/fetch-destination-worker-no-load-event.js'; + return service_worker_unregister_and_register(t, kScript, kScope) + .then(registration => { + add_completion_callback(() => { + registration.unregister(); + }); + + return wait_for_state(t, registration.installing, 'activated'); + }) + .then(() => { + return with_iframe(kScope); + }) + .then(f => { + frame = f; + add_completion_callback(() => { f.remove(); }); + }); + }, 'Initialize global state'); + +var waitOnMessageFromSW = async t => { + await new Promise((resolve, reject) => { + frame.contentWindow.navigator.serviceWorker.onmessage = t.step_func(event => { + if (event.data == "PASS") { + resolve(); + } else { + reject(); + } + }); + }).catch(() => {; + assert_unreached("Wrong destination."); + }); + t.add_cleanup(() => { frame.contentWindow.navigator.serviceWorker.onmessage = null; }); +} +// Actual tests + +// Image destination +//////////////////// + +// CSS background image - image destination +promise_test(async t => { + let node = frame.contentWindow.document.createElement("div"); + node.style = "background-image: url(dummy.png?t=bg2&dest=image)"; + frame.contentWindow.document.body.appendChild(node); + + await waitOnMessageFromSW(t); +}, 'Background image fetches with an "image" Request.destination'); + +// Font destination +/////////////////// + +// Font loading API - font destination +promise_test(async t => { + let font = new frame.contentWindow.FontFace("foo", "url(dummy.ttf?t=api&dest=font)"); + font.load(); + + await waitOnMessageFromSW(t); +}, 'Font loading API fetches with an "font" Request.destination'); + +// CSS font - font destination +promise_test(async t => { + let style = frame.contentWindow.document.createElement("style"); + style.innerHTML = "@font-face { font-family: foo; src: url(dummy.ttf?t=css&dest=font); }"; + style.innerHTML += "div {font-family: foo; }"; + let div = frame.contentWindow.document.createElement("div"); + div.innerHTML = "bar"; + frame.contentWindow.document.body.appendChild(style); + frame.contentWindow.document.body.appendChild(div); + + await waitOnMessageFromSW(t); +}, 'CSS font fetches with an "font" Request.destination'); + +// Empty string destination +/////////////////////////// + +// sendBeacon() - empty string destination +promise_test(async t => { + frame.contentWindow.navigator.sendBeacon("dummy?t=beacon&dest=", "foobar"); + + await waitOnMessageFromSW(t); +}, 'sendBeacon() fetches with an empty string Request.destination'); + +// Cache.add() - empty string destination +promise_test(async t => { + frame.contentWindow.caches.open("foo").then(cache => { + cache.add("dummy?t=cache&dest="); + }); + + await waitOnMessageFromSW(t); +}, 'Cache.add() fetches with an empty string Request.destination'); + +// script destination +///////////////////// + +// importScripts() - script destination +promise_test(async t => { + let worker = new frame.contentWindow.Worker("importer.js"); + + await waitOnMessageFromSW(t); +}, 'importScripts() fetches with a "script" Request.destination'); + +// style destination +///////////////////// + +// @import - style destination +promise_test(async t => { + let node = frame.contentWindow.document.createElement("style"); + node.innerHTML = '@import url("dummy?t=import&dest=style")'; + frame.contentWindow.document.body.appendChild(node); + + await waitOnMessageFromSW(t); +}, '@import fetches with a "style" Request.destination'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-worker.https.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-worker.https.html new file mode 100644 index 0000000..8421d4a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination-worker.https.html
@@ -0,0 +1,54 @@ +<!DOCTYPE html> +<title>Fetch destination tests for resources with no load event</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> +<script> +let frame; + +// Set up the service worker and the frame. +promise_test(t => { + const kScope = 'resources/dummy.html'; + const kScript = 'resources/fetch-destination-worker-no-load-event.js'; + return service_worker_unregister_and_register(t, kScript, kScope) + .then(registration => { + add_completion_callback(() => { + registration.unregister(); + }); + + return wait_for_state(t, registration.installing, 'activated'); + }) + .then(() => { + return with_iframe(kScope); + }) + .then(f => { + frame = f; + add_completion_callback(() => { f.remove(); }); + }); + }, 'Initialize global state'); + +var waitOnMessageFromSW = async t => { + await new Promise((resolve, reject) => { + frame.contentWindow.navigator.serviceWorker.onmessage = t.step_func(event => { + if (event.data == "PASS") { + resolve(); + } else { + reject(); + } + }); + }).catch(() => {; + assert_unreached("Wrong destination."); + }); + t.add_cleanup(() => { frame.contentWindow.navigator.serviceWorker.onmessage = null; }); +} + +// worker destination +///////////////////// +promise_test(async t => { + // We can use an html file as we don't really care about the worker successfully loading. + let worker = new frame.contentWindow.Worker("dummy.html?t=worker&dest=worker"); + await waitOnMessageFromSW(t); +}, 'Worker fetches with a "worker" Request.destination'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination.https-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination.https-expected.txt new file mode 100644 index 0000000..b787d8df --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination.https-expected.txt
@@ -0,0 +1,28 @@ +This is a testharness.js-based test. +PASS Initialize global state +PASS HTMLImageElement fetches with an "image" Request.destination +PASS HTMLImageElement with srcset attribute fetches with an "image" Request.destination +PASS HTMLImageElement with a HTMLPictureElement parent attribute fetches with an "image" Request.destination +PASS SVGImageElement fetches with an "image" Request.destination +PASS fetch() fetches with an empty string Request.destination +PASS XMLHttpRequest() fetches with an empty string Request.destination +PASS EventSource() fetches with an empty string Request.destination +FAIL HTMLAudioElement fetches with an "audio" Request.destination assert_unreached: Fetch errored. Reached unreachable code +PASS HTMLVideoElement fetches with a "video" Request.destination +PASS HTMLScriptElement fetches with a "script" Request.destination +PASS HTMLLinkElement with rel=stylesheet fetches with a "style" Request.destination +PASS HTMLLinkElement with rel=preload and as=fetch fetches with an empty string Request.destination +PASS HTMLLinkElement with rel=preload and as=style fetches with a "style" Request.destination +PASS HTMLLinkElement with rel=preload and as=script fetches with a "script" Request.destination +PASS HTMLLinkElement with rel=preload and as=font fetches with a "font" Request.destination +PASS HTMLLinkElement with rel=preload and as=image fetches with a "image" Request.destination +FAIL HTMLLinkElement with rel=preload and as=audio fetches with a "audio" Request.destination assert_unreached: Fetch errored. Reached unreachable code +PASS HTMLLinkElement with rel=preload and as=video fetches with a "video" Request.destination +PASS HTMLLinkElement with rel=preload and as=track fetches with a "track" Request.destination +PASS HTMLLinkElement with rel=preload and as=document fetches with a "document" Request.destination +PASS HTMLLinkElement with rel=preload and as=worker fetches with a "worker" Request.destination +PASS HTMLLinkElement with rel=preload and as=sharedworker fetches with a "sharedworker" Request.destination +PASS HTMLLinkElement with rel=preload and as=xslt fetches with a "xslt" Request.destination +PASS HTMLLinkElement with rel=preload and as=manifest fetches with a "manifest" Request.destination +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination.https.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination.https.html new file mode 100644 index 0000000..27b5102 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/fetch-destination.https.html
@@ -0,0 +1,428 @@ +<!DOCTYPE html> +<title>Fetch destination tests</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/get-host-info.sub.js"></script> +<script src="/common/media.js"></script> +<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script> +<script> +let frame; + +// Set up the service worker and the frame. +promise_test(t => { + const kScope = 'resources/empty.https.html'; + const kScript = 'resources/fetch-destination-worker.js'; + return service_worker_unregister_and_register(t, kScript, kScope) + .then(registration => { + add_completion_callback(() => { + registration.unregister(); + }); + + return wait_for_state(t, registration.installing, 'activated'); + }) + .then(() => { + return with_iframe(kScope); + }) + .then(f => { + frame = f; + add_completion_callback(() => { f.remove(); }); + }); + }, 'Initialize global state'); + +// Actual tests + +// Image destination +//////////////////// + +// HTMLImageElement - image destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("img"); + node.onload = resolve; + node.onerror = reject; + node.src = "dummy.png?dest=image"; + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLImageElement fetches with an "image" Request.destination'); + +// HTMLImageElement with srcset attribute - image destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("img"); + node.onload = resolve; + node.onerror = reject; + node.srcset = "dummy.png?t=srcset&dest=image"; + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLImageElement with srcset attribute fetches with an "image" Request.destination'); + +// HTMLImageElement with srcset attribute - image destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let img = frame.contentWindow.document.createElement("img"); + let picture = frame.contentWindow.document.createElement("picture"); + let source = frame.contentWindow.document.createElement("source"); + picture.appendChild(source); + picture.appendChild(img); + img.onload = resolve; + img.onerror = reject; + source.srcset = "dummy.png?t=picture&dest=image"; + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLImageElement with a HTMLPictureElement parent attribute fetches with an "image" Request.destination'); + +// SVGImageElement - image destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let svg = frame.contentWindow.document.createElementNS('http://www.w3.org/2000/svg','svg'); + svg.setAttributeNS('http://www.w3.org/2000/svg','xlink','http://www.w3.org/1999/xlink'); + let svgimg = frame.contentWindow.document.createElementNS('http://www.w3.org/2000/svg','image'); + svgimg.onload = resolve; + svgimg.onerror = reject; + svgimg.setAttributeNS('http://www.w3.org/1999/xlink','href','dummy.png?t=svg&dest=image'); + svg.appendChild(svgimg); + frame.contentWindow.document.documentElement.appendChild(svg); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'SVGImageElement fetches with an "image" Request.destination'); + +// Empty string destination +/////////////////////////// + +// fetch() - empty string destination +promise_test(async t => { + let response = await frame.contentWindow.fetch("dummy?dest="); + assert_true(response.ok); +}, 'fetch() fetches with an empty string Request.destination'); + +// XMLHttpRequest - empty string destination +promise_test(async t => { + let xhr; + await new Promise((resolve, reject) => { + xhr = new frame.contentWindow.XMLHttpRequest(); + xhr.onload = resolve; + xhr.onerror = reject; + xhr.open("GET", "dummy?t=xhr&dest="); + xhr.send(); + }).catch(() => { + assert_unreached("Fetch errored."); + }); + assert_equals(xhr.status, 200); +}, 'XMLHttpRequest() fetches with an empty string Request.destination'); + +// EventSource - empty string destination +promise_test(async t => { + let xhr; + await new Promise((resolve, reject) => { + eventSource = new frame.contentWindow.EventSource("dummy.es?t=eventsource&dest="); + eventSource.onopen = resolve; + eventSource.onerror = reject; + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'EventSource() fetches with an empty string Request.destination'); + +// HTMLAudioElement - audio destination +/////////////////////////////////////// +promise_test(async t => { + await new Promise((resolve, reject) => { + let audioURL = getAudioURI("dummy_audio"); + let node = frame.contentWindow.document.createElement("audio"); + node.onloadeddata = resolve; + node.onerror = reject; + node.src = audioURL + "?dest=audio"; + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLAudioElement fetches with an "audio" Request.destination'); + +// HTMLVideoElement - video destination +/////////////////////////////////////// +promise_test(async t => { + await new Promise((resolve, reject) => { + let videoURL = getVideoURI("dummy_video"); + let node = frame.contentWindow.document.createElement("video"); + node.onloadeddata = resolve; + node.onerror = reject; + node.src = videoURL + "?dest=video"; + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLVideoElement fetches with a "video" Request.destination'); + +// script destinations +////////////////////// + +// HTMLScriptElement - script destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("script"); + node.onload = resolve; + node.onerror = reject; + node.src = "dummy?dest=script"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLScriptElement fetches with a "script" Request.destination'); + +// Style destination +//////////////////// + +// HTMLLinkElement with rel=stylesheet - style destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "stylesheet"; + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?dest=style"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=stylesheet fetches with a "style" Request.destination'); + +// Preload tests +//////////////// +// HTMLLinkElement with rel=preload and as=fetch - empty string destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "fetch"; + if (node.as != "fetch") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?t=2&dest="; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=fetch fetches with an empty string Request.destination'); + +// HTMLLinkElement with rel=preload and as=style - style destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "style"; + if (node.as != "style") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?t=2&dest=style"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=style fetches with a "style" Request.destination'); + +// HTMLLinkElement with rel=preload and as=script - script destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "script"; + if (node.as != "script") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?t=2&dest=script"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=script fetches with a "script" Request.destination'); + +// HTMLLinkElement with rel=preload and as=font - font destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "font"; + if (node.as != "font") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?t=2&dest=font"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=font fetches with a "font" Request.destination'); + +// HTMLLinkElement with rel=preload and as=image - image destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "image"; + if (node.as != "image") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy.png?t=2&dest=image"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=image fetches with a "image" Request.destination'); + +// HTMLLinkElement with rel=preload and as=audio - audio destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let audioURL = getAudioURI("dummy_audio"); + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "audio"; + if (node.as != "audio") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = audioURL + "?dest=audio"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=audio fetches with a "audio" Request.destination'); + +// HTMLLinkElement with rel=preload and as=video - video destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let videoURL = getVideoURI("dummy_video"); + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "video"; + if (node.as != "video") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = videoURL + "?dest=video"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=video fetches with a "video" Request.destination'); + +// HTMLLinkElement with rel=preload and as=track - track destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "track"; + if (node.as != "track") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?dest=track"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=track fetches with a "track" Request.destination'); + +// HTMLLinkElement with rel=preload and as=document - document destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "document"; + if (node.as != "document") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?dest=document"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=document fetches with a "document" Request.destination'); + +// HTMLLinkElement with rel=preload and as=worker - worker destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "worker"; + if (node.as != "worker") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?dest=worker"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=worker fetches with a "worker" Request.destination'); + +// HTMLLinkElement with rel=preload and as=sharedworker - sharedworker destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "sharedworker"; + if (node.as != "sharedworker") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?dest=sharedworker"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=sharedworker fetches with a "sharedworker" Request.destination'); + +// HTMLLinkElement with rel=preload and as=xslt - xslt destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "xslt"; + if (node.as != "xslt") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?dest=xslt"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=xslt fetches with a "xslt" Request.destination'); + +// HTMLLinkElement with rel=preload and as=manifest - manifest destination +promise_test(async t => { + await new Promise((resolve, reject) => { + let node = frame.contentWindow.document.createElement("link"); + node.rel = "preload"; + node.as = "manifest"; + if (node.as != "manifest") { + resolve(); + } + node.onload = resolve; + node.onerror = reject; + node.href = "dummy?dest=manifest"; + frame.contentWindow.document.body.appendChild(node); + }).catch(() => { + assert_unreached("Fetch errored."); + }); +}, 'HTMLLinkElement with rel=preload and as=manifest fetches with a "manifest" Request.destination'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.es b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.es new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.es
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.es.headers b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.es.headers new file mode 100644 index 0000000..9bb8badc --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.es.headers
@@ -0,0 +1 @@ +Content-Type: text/event-stream
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.png b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.png new file mode 100644 index 0000000..01c9666a --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.ttf b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.ttf new file mode 100644 index 0000000..9023592 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy.ttf Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_audio.mp3 b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_audio.mp3 new file mode 100644 index 0000000..0091330 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_audio.mp3 Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_audio.oga b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_audio.oga new file mode 100644 index 0000000..239ad2b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_audio.oga Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_video.mp4 b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_video.mp4 new file mode 100644 index 0000000..7022e75 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_video.mp4 Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_video.ogv b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_video.ogv new file mode 100644 index 0000000..de99616 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/dummy_video.ogv Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/empty.https.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/empty.https.html new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/empty.https.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker-iframe.js b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker-iframe.js new file mode 100644 index 0000000..7634583 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker-iframe.js
@@ -0,0 +1,20 @@ +self.addEventListener('fetch', function(event) { + if (event.request.url.includes('dummy')) { + event.waitUntil(async function() { + let destination = new URL(event.request.url).searchParams.get("dest"); + let clients = await self.clients.matchAll({"includeUncontrolled": true}); + clients.forEach(function(client) { + if (client.url.includes("fetch-destination-iframe")) { + if (event.request.destination == destination) { + client.postMessage("PASS"); + } else { + client.postMessage("FAIL"); + } + } + }) + }()); + } + event.respondWith(fetch(event.request)); +}); + +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker-no-load-event.js b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker-no-load-event.js new file mode 100644 index 0000000..fd71ffb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker-no-load-event.js
@@ -0,0 +1,16 @@ +self.addEventListener('fetch', function(event) { + if (event.request.url.includes('dummy')) { + event.waitUntil(async function() { + let destination = new URL(event.request.url).searchParams.get("dest"); + let client = await self.clients.get(event.clientId); + if (event.request.destination == destination) { + client.postMessage("PASS"); + } else { + client.postMessage("FAIL"); + } + }()) + } + event.respondWith(fetch(event.request)); +}); + +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker.js b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker.js new file mode 100644 index 0000000..f8e8e26 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/fetch-destination-worker.js
@@ -0,0 +1,11 @@ +self.addEventListener('fetch', function(event) { + if (event.request.url.includes('dummy')) { + let destination = new URL(event.request.url).searchParams.get("dest"); + if (event.request.destination == destination) { + event.respondWith(fetch(event.request)); + } else { + event.respondWith(Response.error()); + } + } +}); +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/importer.js b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/importer.js new file mode 100644 index 0000000..9568474 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/destination/resources/importer.js
@@ -0,0 +1 @@ +importScripts("dummy?t=importScripts&dest=script");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-idl-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-idl-expected.txt index 8615326..2c55c1b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-idl-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-idl-expected.txt
@@ -7,7 +7,7 @@ PASS Request interface: attribute method PASS Request interface: attribute url PASS Request interface: attribute headers -FAIL Request interface: attribute destination assert_true: The prototype object must have a property "destination" expected true got false +PASS Request interface: attribute destination PASS Request interface: attribute referrer PASS Request interface: attribute referrerPolicy PASS Request interface: attribute mode @@ -28,7 +28,7 @@ PASS Request interface: new Request("") must inherit property "method" with the proper type PASS Request interface: new Request("") must inherit property "url" with the proper type PASS Request interface: new Request("") must inherit property "headers" with the proper type -FAIL Request interface: new Request("") must inherit property "destination" with the proper type assert_inherits: property "destination" not found in prototype chain +PASS Request interface: new Request("") must inherit property "destination" with the proper type PASS Request interface: new Request("") must inherit property "referrer" with the proper type PASS Request interface: new Request("") must inherit property "referrerPolicy" with the proper type PASS Request interface: new Request("") must inherit property "mode" with the proper type
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-structure-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-structure-expected.txt deleted file mode 100644 index 7c3c8df..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/request/request-structure-expected.txt +++ /dev/null
@@ -1,21 +0,0 @@ -This is a testharness.js-based test. -PASS Request has clone method -PASS Request has arrayBuffer method -PASS Request has blob method -PASS Request has formData method -PASS Request has json method -PASS Request has text method -PASS Check method attribute -PASS Check url attribute -PASS Check headers attribute -FAIL Check destination attribute assert_true: request has destination attribute expected true got false -PASS Check referrer attribute -PASS Check referrerPolicy attribute -PASS Check mode attribute -PASS Check credentials attribute -PASS Check cache attribute -PASS Check redirect attribute -PASS Check integrity attribute -PASS Check bodyUsed attribute -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-trailer.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-trailer.html index 5454040..cbea155 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-trailer.html +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/response/response-trailer.html
@@ -3,10 +3,10 @@ <script src=/resources/testharness.js></script> <script src=/resources/testharnessreport.js></script> <div id=log></div> -<!-- based on /XMLHttpRequest/getresponseheader-chunked-trailer.htm --> +<!-- based on /xhr/getresponseheader-chunked-trailer.htm --> <script> promise_test(() => { - return fetch("/XMLHttpRequest/resources/chunked.py").then(res => { + return fetch("/xhr/resources/chunked.py").then(res => { assert_equals(res.headers.get("Trailer"), "X-Test-Me") assert_equals(res.headers.get("X-Test-Me"), null) assert_equals(res.headers.get("Content-Type"), "text/plain")
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/cc-request.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/cc-request.html index 05d6f6b..6ea8fbc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/cc-request.html +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/cc-request.html
@@ -201,7 +201,8 @@ request_headers: [ ["Cache-Control", "only-if-cached"] ], - expected_status: 504 + expected_status: 504, + expected_response_text: "" } ] }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/heuristic.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/heuristic.html index 429ddda..81deb1d0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/heuristic.html +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/heuristic.html
@@ -26,6 +26,7 @@ }, { expected_type: "cached", + response_status: [299, "Whatever"], } ] }, @@ -35,8 +36,7 @@ { response_status: [299, "Whatever"], response_headers: [ - ['Last-Modified', http_date(-3 * 100)], - ['Cache-Control', 'public'] + ['Last-Modified', http_date(-3 * 100)] ], }, {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial-expected.txt index 37a3664..13dd0e0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial-expected.txt
@@ -1,7 +1,11 @@ This is a testharness.js-based test. FAIL HTTP cache stores partial content and reuses it. assert_less_than: Response used expected a number less than 2 but got 2 -FAIL HTTP cache stores complete response and serves smaller ranges from it. assert_equals: Response status expected 200 but got 206 -FAIL HTTP cache stores partial response and serves smaller ranges from it. assert_less_than: Response used expected a number less than 2 but got 2 +PASS HTTP cache stores complete response and serves smaller ranges from it(byte-range-spec). +PASS HTTP cache stores complete response and serves smaller ranges from it(absent last-byte-pos). +PASS HTTP cache stores complete response and serves smaller ranges from it(suffix-byte-range-spec). +FAIL HTTP cache stores partial response and serves smaller ranges from it(byte-range-spec). assert_less_than: Response used expected a number less than 2 but got 2 +FAIL HTTP cache stores partial response and serves smaller ranges from it(absent last-byte-pos). assert_less_than: Response used expected a number less than 2 but got 2 +FAIL HTTP cache stores partial response and serves smaller ranges from it(suffix-byte-range-spec). assert_less_than: Response used expected a number less than 2 but got 2 FAIL HTTP cache stores partial content and completes it. assert_equals: expected (string) "bytes=5-" but got (undefined) undefined Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html index 3ad5933..8d5d61d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/partial.html
@@ -24,7 +24,7 @@ response_status: [206, "Partial Content"], response_headers: [ ['Cache-Control', 'max-age=3600'], - ['Content-Range', 'bytes 0-4/10'] + ['Content-Range', 'bytes 4-9/10'] ], response_body: "01234", expected_request_headers: [ @@ -36,12 +36,13 @@ ['Range', "bytes=-5"] ], expected_type: "cached", - expected_status: 206 + expected_status: 206, + expected_response_text: "01234" } ] }, { - name: 'HTTP cache stores complete response and serves smaller ranges from it.', + name: 'HTTP cache stores complete response and serves smaller ranges from it(byte-range-spec).', requests: [ { response_headers: [ @@ -51,15 +52,54 @@ }, { request_headers: [ - ['Range', "bytes=-1"] + ['Range', "bytes=0-1"] ], expected_type: "cached", + expected_status: 206, expected_response_text: "01" + }, + ] + }, + { + name: 'HTTP cache stores complete response and serves smaller ranges from it(absent last-byte-pos).', + requests: [ + { + response_headers: [ + ['Cache-Control', 'max-age=3600'], + ], + response_body: "01234567890", + }, + { + request_headers: [ + ['Range', "bytes=1-"] + ], + expected_type: "cached", + expected_status: 206, + expected_response_text: "1234567890" } ] }, { - name: 'HTTP cache stores partial response and serves smaller ranges from it.', + name: 'HTTP cache stores complete response and serves smaller ranges from it(suffix-byte-range-spec).', + requests: [ + { + response_headers: [ + ['Cache-Control', 'max-age=3600'], + ], + response_body: "0123456789A", + }, + { + request_headers: [ + ['Range', "bytes=-1"] + ], + expected_type: "cached", + expected_status: 206, + expected_response_text: "A" + } + ] + }, + { + name: 'HTTP cache stores partial response and serves smaller ranges from it(byte-range-spec).', requests: [ { request_headers: [ @@ -68,7 +108,55 @@ response_status: [206, "Partial Content"], response_headers: [ ['Cache-Control', 'max-age=3600'], - ['Content-Range', 'bytes 0-4/10'] + ['Content-Range', 'bytes 4-9/10'] + ], + response_body: "01234", + }, + { + request_headers: [ + ['Range', "bytes=6-8"] + ], + expected_type: "cached", + expected_status: 206, + expected_response_text: "234" + } + ] + }, + { + name: 'HTTP cache stores partial response and serves smaller ranges from it(absent last-byte-pos).', + requests: [ + { + request_headers: [ + ['Range', "bytes=-5"] + ], + response_status: [206, "Partial Content"], + response_headers: [ + ['Cache-Control', 'max-age=3600'], + ['Content-Range', 'bytes 4-9/10'] + ], + response_body: "01234", + }, + { + request_headers: [ + ['Range', "bytes=6-"] + ], + expected_type: "cached", + expected_status: 206, + expected_response_text: "234" + } + ] + }, + { + name: 'HTTP cache stores partial response and serves smaller ranges from it(suffix-byte-range-spec).', + requests: [ + { + request_headers: [ + ['Range', "bytes=-5"] + ], + response_status: [206, "Partial Content"], + response_headers: [ + ['Cache-Control', 'max-age=3600'], + ['Content-Range', 'bytes 4-9/10'] ], response_body: "01234", }, @@ -77,7 +165,8 @@ ['Range', "bytes=-1"] ], expected_type: "cached", - expected_response_text: "01" + expected_status: 206, + expected_response_text: "4" } ] },
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/vary-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/vary-expected.txt index ddc0d09..ffbd9349 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/vary-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/vary-expected.txt
@@ -9,6 +9,8 @@ PASS HTTP cache doesn't use two-way Vary response when request omits variant header. PASS HTTP cache reuses three-way Vary response when request matches. PASS HTTP cache doesn't use three-way Vary response when request doesn't match. -PASS HTTP cache doesn't use three-way Vary response when request omits variant header. +PASS HTTP cache doesn't use three-way Vary response when request doesn't match, regardless of header order. +PASS HTTP cache uses three-way Vary response when both request and the original request omited a variant header. +PASS HTTP cache doesn't use Vary response with a field value of '*'. Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/vary.html b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/vary.html index 2f4b945..dd42b14 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/vary.html +++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/http-cache/vary.html
@@ -103,6 +103,7 @@ request_headers: [ ["Foo", "1"] ], + response_body: http_content('foo_1'), expected_type: "cached" } ] @@ -245,7 +246,32 @@ ] }, { - name: "HTTP cache doesn't use three-way Vary response when request omits variant header.", + name: "HTTP cache doesn't use three-way Vary response when request doesn't match, regardless of header order.", + requests: [ + { + request_headers: [ + ["Foo", "1"], + ["Bar", "abc4"], + ["Baz", "789"] + ], + response_headers: [ + ["Expires", http_date(5000)], + ["Last-Modified", http_date(-3000)], + ["Vary", "Foo, Bar, Baz"] + ] + }, + { + request_headers: [ + ["Foo", "1"], + ["Bar", "abc"], + ["Baz", "789"] + ], + expected_type: "not_cached" + } + ] + }, + { + name: "HTTP cache uses three-way Vary response when both request and the original request omited a variant header.", requests: [ { request_headers: [ @@ -259,6 +285,33 @@ ] }, { + request_headers: [ + ["Foo", "1"], + ["Baz", "789"] + ], + expected_type: "cached" + } + ] + }, + { + name: "HTTP cache doesn't use Vary response with a field value of '*'.", + requests: [ + { + request_headers: [ + ["Foo", "1"], + ["Baz", "789"] + ], + response_headers: [ + ["Expires", http_date(5000)], + ["Last-Modified", http_date(-3000)], + ["Vary", "*"] + ] + }, + { + request_headers: [ + ["*", "1"], + ["Baz", "789"] + ], expected_type: "not_cached" } ]
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-cr.html b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-cr.html new file mode 100644 index 0000000..8879ca4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-cr.html Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html new file mode 100644 index 0000000..9632ef1b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html
@@ -0,0 +1,21 @@ +<!doctype html> +<html class="reftest-wait"> +<meta charset="utf-8"> +<title>textarea multiline placeholder (CRLF)</title> +<link rel="help" href="https://html.spec.whatwg.org/multipage/form-elements.html#attr-textarea-placeholder"> +<meta name="assert" content="textarea element's placeholder preserves newlines (CRLF)"> +<link rel="match" href="/html/form-elements/the-textarea-element/multiline-placeholder-ref.html"> +<link rel="stylesheet" href="support/placeholder.css"> +<textarea rows="5" placeholder="this is +a multiline + +placeholder"></textarea> +<textarea rows="5" placeholder="this is
a multiline

placeholder"></textarea> +<textarea rows="5" id="dynamic"></textarea> +<script> + document.querySelector("#dynamic") + .setAttribute("placeholder", "this is\r\na multiline\r\n\r\nplaceholder"); + document.documentElement.classList.remove("reftest-wait"); +</script> +</html> +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-ref.html b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-ref.html new file mode 100644 index 0000000..0234ed6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder-ref.html
@@ -0,0 +1,15 @@ +<!doctype html> +<meta charset="utf-8"> +<link rel="stylesheet" href="support/placeholder.css"> +<textarea rows="5" class="placeholder">this is +a multiline + +placeholder</textarea> +<textarea rows="5" class="placeholder">this is +a multiline + +placeholder</textarea> +<textarea rows="5" class="placeholder">this is +a multiline + +placeholder</textarea>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder.html b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder.html new file mode 100644 index 0000000..00bb969 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/multiline-placeholder.html
@@ -0,0 +1,22 @@ +<!doctype html> +<html class="reftest-wait"> +<meta charset="utf-8"> +<title>textarea multiline placeholder</title> +<link rel="help" href="https://html.spec.whatwg.org/multipage/form-elements.html#attr-textarea-placeholder"> +<meta name="assert" content="textarea element's placeholder preserves newlines"> +<link rel="match" href="/html/form-elements/the-textarea-element/multiline-placeholder-ref.html"> +<link rel="stylesheet" href="support/placeholder.css"> +<textarea rows="5" placeholder="this is +a multiline + +placeholder"></textarea> +<textarea rows="5" placeholder="this is
a multiline

placeholder"></textarea> +<textarea rows="5" id="dynamic"></textarea> +<script> + document.querySelector("#dynamic") + .setAttribute("placeholder", "this is\na multiline\n\nplaceholder"); + document.documentElement.classList.remove("reftest-wait"); +</script> +</html> + +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/support/placeholder.css b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/support/placeholder.css new file mode 100644 index 0000000..9aaed05 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/form-elements/the-textarea-element/support/placeholder.css
@@ -0,0 +1,6 @@ +textarea.placeholder, +textarea::placeholder { + /* revert browser styling of the placeholder */ + color: GrayText; /* blink/webkit use colour */ + opacity: 1.0; /* gecko uses opacity */ +}
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-cr.html b/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-cr.html new file mode 100644 index 0000000..4184ab2c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-cr.html Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-crlf.html b/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-crlf.html new file mode 100644 index 0000000..50c91fb --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-crlf.html
@@ -0,0 +1,19 @@ +<!doctype html> +<html class="reftest-wait"> +<meta charset="utf-8"> +<title>input multiline placeholder (CRLF)</title> +<link rel="help" href="https://html.spec.whatwg.org/multipage/input.html#the-placeholder-attribute"> +<meta name="assert" content="input element's placeholder strips newlines (CRLF)"> +<link rel="match" href="/html/input/the-placeholder-attribute/multiline-ref.html"> +<input placeholder="this is +a multiline + +placeholder"> +<input placeholder="this is
a multiline

placeholder"> +<input id="dynamic"> +<script> + document.querySelector("#dynamic") + .setAttribute("placeholder", "this is\r\na multiline\r\n\r\nplaceholder"); + document.documentElement.classList.remove("reftest-wait"); +</script> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-ref.html b/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-ref.html new file mode 100644 index 0000000..2812f86e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline-ref.html
@@ -0,0 +1,5 @@ +<!doctype html> +<meta charset=utf-8> +<input placeholder="this isa multilineplaceholder"> +<input placeholder="this isa multilineplaceholder"> +<input placeholder="this isa multilineplaceholder">
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline.html b/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline.html new file mode 100644 index 0000000..2d7102bd --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/input/the-placeholder-attribute/multiline.html
@@ -0,0 +1,19 @@ +<!doctype html> +<html class="reftest-wait"> +<meta charset="utf-8"> +<title>input multiline placeholder</title> +<link rel="help" href="https://html.spec.whatwg.org/multipage/input.html#the-placeholder-attribute"> +<meta name="assert" content="input element's placeholder strips newlines"> +<link rel="match" href="/html/input/the-placeholder-attribute/multiline-ref.html"> +<input placeholder="this is +a multiline + +placeholder"> +<input placeholder="this is
a multiline

placeholder"> +<input id="dynamic"> +<script> + document.querySelector("#dynamic") + .setAttribute("placeholder", "this is\na multiline\n\nplaceholder"); + document.documentElement.classList.remove("reftest-wait"); +</script> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-style-element/style_load_async.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-style-element/style_load_async.html new file mode 100644 index 0000000..ef8ac89 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/document-metadata/the-style-element/style_load_async.html
@@ -0,0 +1,25 @@ +<!doctype html> +<html> +<meta charset="utf-8"> +<title>Style load event should be async</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> + var t = async_test("style load should be async"); + var sync = true; + function check() { + assert_false(sync); + t.done(); + } +</script> +<style onload="t.step(check)"> +</style> +<script> + sync = false +</script> + +<body> + <div id="log"></div> + <div id="test"></div> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-id.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-id.html new file mode 100644 index 0000000..f0223fda --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-id.html
@@ -0,0 +1,25 @@ +<!DOCTYPE html> +<title>TextTrack "id" attribute</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<video> + <track id="LoremIpsum" src="resources/captions-fast.vtt" default> + <script> + test(function() { + var video = document.querySelector("video"); + var track = document.querySelector("track"); + var textTrack = track.track; + + // Test default attribute value. + assert_equals(textTrack.id, "LoremIpsum"); + assert_equals(video.textTracks[0].id, "LoremIpsum"); + + // Make sure we can look up tracks by id. + assert_equals(video.textTracks.getTrackById("LoremIpsum"), textTrack); + + // Test that it's readonly. + textTrack.id = "newvalue"; + assert_equals(textTrack.id, "LoremIpsum"); + }); + </script> +</video> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-insert-after-load.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-insert-after-load.html new file mode 100644 index 0000000..28b4f826 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-insert-after-load.html
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<title>Inserting a track element immediately after video load</title> +<script src="/common/media.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +async_test(function(t) { + var video = document.createElement('video'); + video.src = getVideoURI('/media/test'); + video.load(); + video.appendChild(document.createElement('track')); + video.onloadedmetadata = t.step_func_done(); +}); +</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-node-add-remove.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-node-add-remove.html similarity index 87% rename from third_party/WebKit/LayoutTests/media/track/track-node-add-remove.html rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-node-add-remove.html index 177d083..2708879 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-node-add-remove.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-node-add-remove.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> -<title>Adding and removing track node</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<title>Add and remove track node</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <body> <script> test(function() {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-selection-metadata.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-selection-metadata.html new file mode 100644 index 0000000..1f7df3b6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-selection-metadata.html
@@ -0,0 +1,33 @@ +<!DOCTYPE html> +<title>Multiple 'metadata' tracks with 'default'</title> +<script src="/common/media.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<video> + <track kind="metadata" src="resources/default-styles.vtt" id="t1"> + <track kind="metadata" src="resources/class.vtt" default id="t2hidden"> + <track kind="metadata" src="resources/metadata-area.vtt" id="t3"> + <track kind="metadata" src="resources/webvtt-file.vtt" default id="t4hidden"> + <script> + async_test(function() { + var video = document.querySelector('video'); + video.onloadstart = this.step_func_done(function() { + assert_equals(video.textTracks.length, 4); + for (var track of video.textTracks) { + assert_equals(track.kind, 'metadata'); + + var trackElement = document.getElementById(track.id); + if (track.id.indexOf('hidden') != -1) { + assert_true(trackElement.default); + assert_equals(track.mode, 'hidden'); + } else { + assert_false(trackElement.default); + assert_equals(track.mode, 'disabled'); + } + } + }); + + video.src = getVideoURI("/media/test"); + }); + </script> +</video> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-text-track-cue-list.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-text-track-cue-list.html new file mode 100644 index 0000000..5b11bfde --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-text-track-cue-list.html
@@ -0,0 +1,29 @@ +<!DOCTYPE html> +<title>TextTrackCueList functionality: length, operator[], and getCueById()</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<video> + <track src="resources/settings.vtt" kind="captions" default> + <script> + async_test(function(t) { + var testTrack = document.querySelector("track"); + + testTrack.onload = t.step_func_done(function() { + var cues = testTrack.track.cues; + + // Testing TextTrackCueList length. + assert_equals(cues.length, 4); + + // Testing TextTrackCueList [] operator. + assert_equals(cues[0].id, "1"); + assert_equals(cues[3].id, "4"); + assert_object_equals(cues[4], undefined); + + // Testing TextTrackCueList getCueById(). + assert_equals(cues.getCueById("1").startTime, 0); + assert_equals(cues.getCueById("4").startTime, 121); + assert_object_equals(cues.getCueById("junk"), undefined); + }); + }); + </script> +</video> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-texttracks.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-texttracks.html similarity index 73% rename from third_party/WebKit/LayoutTests/media/track/track-texttracks.html rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-texttracks.html index 45d3e6c..4d006fc 100644 --- a/third_party/WebKit/LayoutTests/media/track/track-texttracks.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-texttracks.html
@@ -1,9 +1,9 @@ <!DOCTYPE html> -<title>Tests that TextTracks in a TextTrackList are kept in the correct order.</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> +<title>TextTracks in a TextTrackList are kept in the correct order</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> <video> - <track kind="captions" src="captions-webvtt/tc004-webvtt-file.vtt" > + <track kind="captions" src="resources/webvtt-file.vtt"> </video> <script> test(function() { @@ -23,12 +23,14 @@ assert_equals(video.textTracks[1].kind, "chapters"); assert_equals(video.textTracks[2].kind, "descriptions"); - // Verify the default parameters of the text track object returned by addTextTrack(). + // Verify the default parameters of the text track object + // returned by addTextTrack(). assert_equals(video.textTracks[2].mode, "hidden"); assert_not_equals(video.textTracks[2].cues, null); assert_equals(video.textTracks[2].cues.length, 0); - // Add another track element, it should insert before the addTextTrack() track. + // Add another track element, it should insert + // before the addTextTrack() track. trackElement = document.createElement("track"); trackElement.setAttribute("kind", "metadata"); video.appendChild(trackElement);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/select-event.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/select-event.html index 6cfe52e8..2fb018f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/select-event.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/select-event.html
@@ -47,10 +47,10 @@ } ]; -for (const el of els) { +els.forEach((el) => { const elLabel = el.localName === "textarea" ? "textarea" : "input type " + el.type; - for (const action of actions) { + actions.forEach((action) => { // promise_test instead of async_test is important because these need to happen in sequence (to test that events // fire if and only if the selection changes). promise_test(t => { @@ -79,6 +79,6 @@ }, 200); }); }, `${elLabel}: ${action.label} a second time (must not fire select)`); - } -} + }); +}); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html index b0db8a9..04b4fdd4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-not-application.html
@@ -7,45 +7,90 @@ <script src="/resources/testharnessreport.js"></script> <div id="log"></div> <script> - var types = ["hidden", "email", "datetime-local", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; //types for which the API doesn't apply - var types2 = ["text", "search", "tel", "url", "password"]; //types for which the API applies + var nonApplicableTypes = ["hidden", "email", "datetime-local", "date", "month", "week", "time", "number", "range", "color", "checkbox", "radio", "file", "submit", "image", "reset", "button"]; + var applicableTypes = ["text", "search", "tel", "url", "password", "aninvalidtype", null]; - types.forEach(function(type){ - test(function(){ - var el = document.createElement("input"); - el.type = type; + nonApplicableTypes.forEach(function(type){ + var el = document.createElement("input"); + el.type = type; + + test(() => { assert_equals(el.selectionStart, null); + }, `selectionStart on an input[type=${type}] returns null`); + + test(() => { assert_equals(el.selectionEnd, null); + }, `selectionEnd on an input[type=${type}] returns null`); + + test(() => { assert_equals(el.selectionDirection, null); + }, `selectionDirection on an input[type=${type}] returns null`); + + test(() => { assert_throws("InvalidStateError", function(){ el.selectionStart = 0; }); + }, `assigning selectionStart on an input[type=${type}] throws InvalidStateError`); + + test(() => { assert_throws("InvalidStateError", function(){ el.selectionEnd = 0; }); + }, `assigning selectionEnd on an input[type=${type}] throws InvalidStateError`); + + test(() => { assert_throws("InvalidStateError", function(){ el.selectionDirection = 'none'; }); + }, `assigning selectionDirection on an input[type=${type}] throws InvalidStateError`); + + test(() => { assert_throws("InvalidStateError", function(){ el.setRangeText("foobar"); }); + }, `setRangeText on an input[type=${type}] throws InvalidStateError`); + + test(() => { assert_throws("InvalidStateError", function(){ el.setSelectionRange(0, 1); }); - }, "text field selection for the input " + type); + }, `setSelectionRange on an input[type=${type}] throws InvalidStateError`); }); - types2.forEach(function(type) { - test(function() { - var el = document.createElement("input"); - el.type = type; + applicableTypes.forEach(function(type) { + var el = document.createElement("input"); + if (type) el.type = type; + + test(() => { assert_equals(el.selectionStart, 0); + }, `selectionStart on an input[type=${type}] returns a value`); + + test(() => { assert_equals(el.selectionEnd, 0); + }, `selectionEnd on an input[type=${type}] returns a value`); + + test(() => { + assert_equals(el.selectionDirection, "none"); + }, `selectionDirection on an input[type=${type}] returns a value`); + + test(() => { el.selectionStart = 1; + }, `assigning selectionStart on an input[type=${type}] doesn't throw an exception`); + + test(() => { el.selectionEnd = 1; + }, `assigning selectionEnd on an input[type=${type}] doesn't throw an exception`); + + test(() => { el.selectionDirection = "forward"; + }, `assigning selectionDirection on an input[type=${type}] doesn't throw an exception`); + + test(() => { el.setRangeText("foobar"); + }, `setRangeText on an input[type=${type}] doesn't throw an exception`); + + test(() => { el.setSelectionRange(0, 1); - }, "text field selection for the input " + type); + }, `setSelectionRange on an input[type=${type}] doesn't throw an exception`); }); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-start-end.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-start-end.html index 0638380..17fd28c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-start-end.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-start-end.html
@@ -59,10 +59,16 @@ assert_equals(testValue.length, 10); }, "Sanity check for testValue length; if this fails, variou absolute offsets in the test below need to be adjusted to be less than testValue.length"); + for (let prop of ["selectionStart", "selectionEnd"]) { + for (let el of createTestElements(testValue)) { + test(function() { + assert_equals(el.selectionStart, testValue.length); + }, `Initial .value set on ${el.id} should set ${prop} to end of value`); + } + } + test(function() { for (let el of createTestElements(testValue)) { - assert_equals(el.selectionStart, testValue.length, - `Initial .value set on ${el.id} should set selectionStart to end of value`); var t = async_test(`onselect should fire when selectionStart is changed on ${el.id}`); el.onselect = t.step_func_done(function(e) { assert_equals(e.type, "select"); @@ -74,8 +80,6 @@ test(function() { for (let el of createTestElements(testValue)) { - assert_equals(el.selectionEnd, testValue.length, - `Initial .value set on ${el.id} should set selectionEnd to end of value`); var t = async_test(`onselect should fire when selectionEnd is changed on ${el.id}`); el.onselect = t.step_func_done(function(e) { assert_equals(e.type, "select"); @@ -87,8 +91,6 @@ test(function() { for (let el of createTestElements(testValue)) { - assert_equals(el.selectionStart, testValue.length, - `Initial .value set on ${el.id} should set selectionStart to end of value`); el.selectionStart = 0; el.selectionEnd = 5; el.selectionStart = 8; @@ -100,10 +102,6 @@ test(function() { for (let el of createTestElements(testValue)) { - assert_equals(el.selectionStart, testValue.length, - `Initial .value set on ${el.id} should set selectionStart to end of value`); - assert_equals(el.selectionEnd, testValue.length, - `Initial .value set on ${el.id} should set selectionEnd to end of value`); el.selectionStart = 8; el.selectionEnd = 5; assert_equals(el.selectionStart, 5, `selectionStart on ${el.id}`);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-value-interactions.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-value-interactions.html index c453efd8e..0fd8a5b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-value-interactions.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/textfieldselection/selection-value-interactions.html
@@ -97,22 +97,31 @@ var el = document.createElement(tag); document.body.appendChild(el); this.add_cleanup(() => el.remove()); - el.value = ""; - assert_equals(el.selectionStart, el.value.length, - "element.selectionStart should be value.length"); - assert_equals(el.selectionEnd, el.value.length, - "element.selectionEnd should be value.length"); - el.value = "foo"; - assert_equals(el.selectionStart, el.value.length, - "element.selectionStart should be value.length"); - assert_equals(el.selectionEnd, el.value.length, - "element.selectionEnd should be value.length"); - el.value = "foobar"; - assert_equals(el.selectionStart, el.value.length, - "element.selectionStart should be value.length"); - assert_equals(el.selectionEnd, el.value.length, - "element.selectionEnd should be value.length"); - }, `selection is always collapsed to the end after setting values on ${tag}`); + + for (let val of ["", "foo", "foobar"]) { + el.value = val; + assert_equals(el.selectionStart, val.length, + "element.selectionStart should be value.length"); + assert_equals(el.selectionEnd, val.length, + "element.selectionEnd should be value.length"); + } + }, `selection is collapsed to the end after changing values on ${tag}`); + + test(function() { + var el = document.createElement(tag); + document.body.appendChild(el); + this.add_cleanup(() => el.remove()); + + el.value = "foobar" + el.selectionStart = 2 + el.selectionEnd = 4 + el.value = "foobar" + + assert_equals(el.selectionStart, 2, + "element.selectionStart should be unchanged"); + assert_equals(el.selectionEnd, 4, + "element.selectionEnd should be unchanged"); + }, `selection is not collapsed to the end when value is set to its existing value on ${tag}`); } </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/month.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/month.html index 15fa76d..99be9bc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/month.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/month.html
@@ -13,6 +13,9 @@ <body> <h1>Inputs Month</h1> <div style="display: none"> + <input id="valid_value_1" type="month" value="20133-12" /> + <input id="valid_value_2" type="month" value="2013-12" /> + <input id="valid_value_3" type="month" value="0003-01" /> <input id="valid" type="month" value="2011-11" min="2011-01" max="2011-12" /> <input id="invalid_value" type="month" value="invalid-month" min="2011-01" max="2011-12"/> <input id="value_can_be_empty_string" type="month" value="2013-06" /> @@ -21,12 +24,28 @@ <input id="step_attribute_is_invalid_value" type="month" value="2013-06" step="invalid_step_value" /> <input id="invalid_month_too_high" type="month" value="2013-13" /> <input id="invalid_month_too_low" type="month" value="2013-00" /> + <input id="invalid_year_all_zero" type="month" value="0000-10" /> + <input id="invalid_month_with_one_number" type="month" value="2013-1" /> + <input id="invalid_month_non_numerical" type="month" value="2013-abc" /> + <input id="invalid_date_additional_tuples" type="month" value="2013-11-1-1" /> </div> <div id="log"></div> <script> test(function() { + assert_equals(document.getElementById("valid_value_1").value, "20133-12") + }, "year can be more than four digits"); + + test(function() { + assert_equals(document.getElementById("valid_value_2").value, "2013-12") + }, "valid value test"); + + test(function() { + assert_equals(document.getElementById("valid_value_3").value, "0003-01") + }, "year can contain prefixes of zero, as long as there are at least four digits"); + + test(function() { assert_equals(document.getElementById("valid").type, "month") }, "month type support on input element"); @@ -60,6 +79,22 @@ test(function() { assert_equals(document.getElementById("invalid_month_too_low").value, ""); }, "Month should be > 0: If the value of the element is not a valid month string, then set it to the empty string instead.>"); + + test(function() { + assert_equals(document.getElementById("invalid_year_all_zero").value, ""); + }, "Year should be > 0: If the value of the element is not a valid year string, then set it to the empty string instead.>"); + + test(function() { + assert_equals(document.getElementById("invalid_month_with_one_number").value, ""); + }, "Month should be two digits: If the value of the element is not a valid month string, then set it to the empty string instead.>"); + + test(function() { + assert_equals(document.getElementById("invalid_month_non_numerical").value, ""); + }, "Month should be two digits not characters: If the value of the element is not a valid month string, then set it to the empty string instead.>"); + + test(function() { + assert_equals(document.getElementById("invalid_date_additional_tuples").value, ""); + }, "Value should be two parts: If the value of the element is not a valid month string, then set it to the empty string instead.>"); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/type-change-state-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/type-change-state-expected.txt index f17e7426..bc13760 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/type-change-state-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/type-change-state-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. -Found 462 tests; 405 PASS, 57 FAIL, 0 TIMEOUT, 0 NOTRUN. +Found 462 tests; 441 PASS, 21 FAIL, 0 TIMEOUT, 0 NOTRUN. PASS change state from hidden to text PASS change state from hidden to search PASS change state from hidden to tel @@ -85,11 +85,11 @@ PASS change state from tel to reset PASS change state from tel to button PASS change state from url to hidden -FAIL change state from url to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "foobar" -FAIL change state from url to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "foobar" -FAIL change state from url to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "foobar" +FAIL change state from url to text assert_equals: input.value should be ' foobar ' after change of state expected " foobar " but got "foobar" +FAIL change state from url to search assert_equals: input.value should be ' foobar ' after change of state expected " foobar " but got "foobar" +FAIL change state from url to tel assert_equals: input.value should be ' foobar ' after change of state expected " foobar " but got "foobar" PASS change state from url to email -FAIL change state from url to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "foobar" +FAIL change state from url to password assert_equals: input.value should be ' foobar ' after change of state expected " foobar " but got "foobar" PASS change state from url to datetime-local PASS change state from url to date PASS change state from url to month @@ -106,11 +106,11 @@ PASS change state from url to reset PASS change state from url to button PASS change state from email to hidden -FAIL change state from email to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "foobar" -FAIL change state from email to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "foobar" -FAIL change state from email to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "foobar" +FAIL change state from email to text assert_equals: input.value should be ' foobar ' after change of state expected " foobar " but got "foobar" +FAIL change state from email to search assert_equals: input.value should be ' foobar ' after change of state expected " foobar " but got "foobar" +FAIL change state from email to tel assert_equals: input.value should be ' foobar ' after change of state expected " foobar " but got "foobar" PASS change state from email to url -FAIL change state from email to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "foobar" +FAIL change state from email to password assert_equals: input.value should be ' foobar ' after change of state expected " foobar " but got "foobar" PASS change state from email to datetime-local PASS change state from email to date PASS change state from email to month @@ -148,12 +148,12 @@ PASS change state from password to reset PASS change state from password to button PASS change state from datetime-local to hidden -FAIL change state from datetime-local to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from datetime-local to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from datetime-local to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from datetime-local to url assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from datetime-local to email assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from datetime-local to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "" +PASS change state from datetime-local to text +PASS change state from datetime-local to search +PASS change state from datetime-local to tel +PASS change state from datetime-local to url +PASS change state from datetime-local to email +PASS change state from datetime-local to password PASS change state from datetime-local to date PASS change state from datetime-local to month PASS change state from datetime-local to week @@ -161,20 +161,20 @@ PASS change state from datetime-local to number PASS change state from datetime-local to range PASS change state from datetime-local to color -PASS change state from datetime-local to checkbox -PASS change state from datetime-local to radio +FAIL change state from datetime-local to checkbox assert_equals: input.value should be 'on' after change of state expected "on" but got "" +FAIL change state from datetime-local to radio assert_equals: input.value should be 'on' after change of state expected "on" but got "" PASS change state from datetime-local to file PASS change state from datetime-local to submit PASS change state from datetime-local to image PASS change state from datetime-local to reset PASS change state from datetime-local to button PASS change state from date to hidden -FAIL change state from date to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from date to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from date to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from date to url assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from date to email assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from date to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "" +PASS change state from date to text +PASS change state from date to search +PASS change state from date to tel +PASS change state from date to url +PASS change state from date to email +PASS change state from date to password PASS change state from date to datetime-local PASS change state from date to month PASS change state from date to week @@ -182,20 +182,20 @@ PASS change state from date to number PASS change state from date to range PASS change state from date to color -PASS change state from date to checkbox -PASS change state from date to radio +FAIL change state from date to checkbox assert_equals: input.value should be 'on' after change of state expected "on" but got "" +FAIL change state from date to radio assert_equals: input.value should be 'on' after change of state expected "on" but got "" PASS change state from date to file PASS change state from date to submit PASS change state from date to image PASS change state from date to reset PASS change state from date to button PASS change state from month to hidden -FAIL change state from month to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from month to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from month to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from month to url assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from month to email assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from month to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "" +PASS change state from month to text +PASS change state from month to search +PASS change state from month to tel +PASS change state from month to url +PASS change state from month to email +PASS change state from month to password PASS change state from month to datetime-local PASS change state from month to date PASS change state from month to week @@ -203,20 +203,20 @@ PASS change state from month to number PASS change state from month to range PASS change state from month to color -PASS change state from month to checkbox -PASS change state from month to radio +FAIL change state from month to checkbox assert_equals: input.value should be 'on' after change of state expected "on" but got "" +FAIL change state from month to radio assert_equals: input.value should be 'on' after change of state expected "on" but got "" PASS change state from month to file PASS change state from month to submit PASS change state from month to image PASS change state from month to reset PASS change state from month to button PASS change state from week to hidden -FAIL change state from week to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from week to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from week to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from week to url assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from week to email assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from week to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "" +PASS change state from week to text +PASS change state from week to search +PASS change state from week to tel +PASS change state from week to url +PASS change state from week to email +PASS change state from week to password PASS change state from week to datetime-local PASS change state from week to date PASS change state from week to month @@ -224,20 +224,20 @@ PASS change state from week to number PASS change state from week to range PASS change state from week to color -PASS change state from week to checkbox -PASS change state from week to radio +FAIL change state from week to checkbox assert_equals: input.value should be 'on' after change of state expected "on" but got "" +FAIL change state from week to radio assert_equals: input.value should be 'on' after change of state expected "on" but got "" PASS change state from week to file PASS change state from week to submit PASS change state from week to image PASS change state from week to reset PASS change state from week to button PASS change state from time to hidden -FAIL change state from time to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from time to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from time to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from time to url assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from time to email assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from time to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "" +PASS change state from time to text +PASS change state from time to search +PASS change state from time to tel +PASS change state from time to url +PASS change state from time to email +PASS change state from time to password PASS change state from time to datetime-local PASS change state from time to date PASS change state from time to month @@ -245,20 +245,20 @@ PASS change state from time to number PASS change state from time to range PASS change state from time to color -PASS change state from time to checkbox -PASS change state from time to radio +FAIL change state from time to checkbox assert_equals: input.value should be 'on' after change of state expected "on" but got "" +FAIL change state from time to radio assert_equals: input.value should be 'on' after change of state expected "on" but got "" PASS change state from time to file PASS change state from time to submit PASS change state from time to image PASS change state from time to reset PASS change state from time to button PASS change state from number to hidden -FAIL change state from number to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from number to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from number to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "" -FAIL change state from number to url assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from number to email assert_equals: input.value should be foobar after change of state expected "foobar" but got "" -FAIL change state from number to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "" +PASS change state from number to text +PASS change state from number to search +PASS change state from number to tel +PASS change state from number to url +PASS change state from number to email +PASS change state from number to password PASS change state from number to datetime-local PASS change state from number to date PASS change state from number to month @@ -266,26 +266,26 @@ PASS change state from number to time PASS change state from number to range PASS change state from number to color -PASS change state from number to checkbox -PASS change state from number to radio +FAIL change state from number to checkbox assert_equals: input.value should be 'on' after change of state expected "on" but got "" +FAIL change state from number to radio assert_equals: input.value should be 'on' after change of state expected "on" but got "" PASS change state from number to file PASS change state from number to submit PASS change state from number to image PASS change state from number to reset PASS change state from number to button PASS change state from range to hidden -FAIL change state from range to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "50" -FAIL change state from range to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "50" -FAIL change state from range to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "50" -FAIL change state from range to url assert_equals: input.value should be foobar after change of state expected "foobar" but got "50" -FAIL change state from range to email assert_equals: input.value should be foobar after change of state expected "foobar" but got "50" -FAIL change state from range to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "50" +PASS change state from range to text +PASS change state from range to search +PASS change state from range to tel +PASS change state from range to url +PASS change state from range to email +PASS change state from range to password PASS change state from range to datetime-local PASS change state from range to date PASS change state from range to month PASS change state from range to week PASS change state from range to time -FAIL change state from range to number assert_equals: input.value should be after change of state expected "" but got "50" +FAIL change state from range to number assert_equals: input.value should be '' after change of state expected "" but got "50" PASS change state from range to color PASS change state from range to checkbox PASS change state from range to radio @@ -295,12 +295,12 @@ PASS change state from range to reset PASS change state from range to button PASS change state from color to hidden -FAIL change state from color to text assert_equals: input.value should be foobar after change of state expected " foobar " but got "#000000" -FAIL change state from color to search assert_equals: input.value should be foobar after change of state expected " foobar " but got "#000000" -FAIL change state from color to tel assert_equals: input.value should be foobar after change of state expected " foobar " but got "#000000" -FAIL change state from color to url assert_equals: input.value should be foobar after change of state expected "foobar" but got "#000000" -FAIL change state from color to email assert_equals: input.value should be foobar after change of state expected "foobar" but got "#000000" -FAIL change state from color to password assert_equals: input.value should be foobar after change of state expected " foobar " but got "#000000" +PASS change state from color to text +PASS change state from color to search +PASS change state from color to tel +PASS change state from color to url +PASS change state from color to email +PASS change state from color to password PASS change state from color to datetime-local PASS change state from color to date PASS change state from color to month
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/type-change-state.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/type-change-state.html index d98b623..82d36cd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/type-change-state.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/type-change-state.html
@@ -15,16 +15,16 @@ { type: "url", sanitizedValue: "foobar" }, { type: "email", sanitizedValue: "foobar" }, { type: "password", sanitizedValue: " foobar " }, - { type: "datetime-local", sanitizedValue: "" }, - { type: "date", sanitizedValue: "" }, - { type: "month", sanitizedValue: "" }, - { type: "week", sanitizedValue: "" }, - { type: "time", sanitizedValue: "" }, - { type: "number", sanitizedValue: "" }, - { type: "range", sanitizedValue: "50" }, - { type: "color", sanitizedValue: "#000000" }, - { type: "checkbox" }, - { type: "radio" }, + { type: "datetime-local", sanitizedValue: "", overridesSanitization: true }, + { type: "date", sanitizedValue: "", overridesSanitization: true }, + { type: "month", sanitizedValue: "", overridesSanitization: true }, + { type: "week", sanitizedValue: "", overridesSanitization: true }, + { type: "time", sanitizedValue: "", overridesSanitization: true }, + { type: "number", sanitizedValue: "", overridesSanitization: true }, + { type: "range", sanitizedValue: "50", overridesSanitization: true }, + { type: "color", sanitizedValue: "#000000", overridesSanitization: true }, + { type: "checkbox", defaultValue: "on" }, + { type: "radio", defaultValue: "on" }, { type: "file" }, { type: "submit" }, { type: "image" }, @@ -36,26 +36,39 @@ if (types[i] != types[j]) { test(function() { var input = document.createElement("input"); + var expected = " foo\rbar "; input.type = types[i].type; if (types[i].type === "file") { assert_throws("INVALID_STATE_ERR", function() { - input.value = " foo\rbar "; + input.value = expected; }); assert_equals(input.value, ""); } else if (types[j].type === "file") { - input.value = " foo\rbar "; + input.value = expected; input.type = types[j].type; // change state assert_equals(input.value, ""); } else { - input.value = " foo\rbar "; + input.value = expected; input.type = types[j].type; // change state - if (types[j].sanitizedValue || types[j].sanitizedValue === "") { - assert_equals(input.value, types[j].sanitizedValue, "input.value should be " + types[j].sanitizedValue + " after change of state"); - } else if (types[i].sanitizedValue || types[i].sanitizedValue === "") { - assert_equals(input.value, types[i].sanitizedValue, "input.value should be " + types[i].sanitizedValue + " after change of state"); - } else { - assert_equals(input.value, " foo\rbar ", "input.value should be ' foo\\rbar ' after change of state"); + + // type[i] sanitization + if (types[i].sanitizedValue || types[i].sanitizedValue === "") { + expected = types[i].sanitizedValue; } + + // type[j] sanitization + if (types[j].sanitizedValue || types[j].sanitizedValue === "") { + if ((expected !== "" && !types[i].overridesSanitization) || types[j].overridesSanitization) { + expected = types[j].sanitizedValue; + } + } + + // type[j] defaultValue + if (expected === "" && types[j].defaultValue) { + expected = types[j].defaultValue; + } + + assert_equals(input.value, expected, "input.value should be '" + expected + "' after change of state"); } }, "change state from " + types[i].type + " to " + types[j].type); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/week.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/week.html index 77978a2..925acfd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/week.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/the-input-element/week.html
@@ -17,6 +17,9 @@ {value: "2014W", expected: "", testname: "Invalid value: no week number"}, {value: "2014W52", expected: "", testname: "Invalid value: no '-' (U+002D)"}, {value: "-W52", expected: "", testname: "Invalid value: yearless week"}, + {value: "2017-w52", expected: "", testname: "Invalid value: should be capital letter 'W'"}, + {value: "2017-W52-", expected: "", testname: "Invalid value: incorrect with '-' at the end"}, + {value: "2017-W52-12", expected: "", testname: "Invalid value: value should be two parts"}, {value: "W52", expected: "", testname: "Invalid value: yearless week and no '-' (U+002D)"}, {value: "2014-W03", attributes: { min: "2014-W02" }, expected: "2014-W03", testname: "Value >= min attribute"}, {value: "2014-W01", attributes: { min: "2014-W02" }, expected: "2014-W01", testname: "Value < min attribute"},
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/duplicated-imports-1.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/duplicated-imports-1.html new file mode 100644 index 0000000..57002a3e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/duplicated-imports-1.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<title>Importing a module multiple times with the same specifier</title> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +window.log = []; +</script> +<script type="module"> +import { foo } from './export-something.js'; +import { set_foo } from './export-something.js'; +import default1 from './export-default.js'; +import default2 from './export-default.js'; + +test(() => { + assert_array_equals(log, ['export-something', 'export-default']); + assert_equals(foo, 42); + set_foo(43); + assert_equals(foo, 43); + assert_equals(default1, "fox"); + assert_equals(default2, "fox"); +}, 'Duplicated imports with the same specifier'); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/duplicated-imports-2.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/duplicated-imports-2.html new file mode 100644 index 0000000..6a01495 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/duplicated-imports-2.html
@@ -0,0 +1,23 @@ +<!DOCTYPE html> +<title>Importing a module multiple times with the different specifier</title> + +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script> +window.log = []; +</script> +<script type="module"> +import { foo } from './export-something.js'; +import { set_foo } from '../module/export-something.js'; +import default1 from './export-default.js'; +import default2 from '../module/export-default.js'; + +test(() => { + assert_array_equals(log, ['export-something', 'export-default']); + assert_equals(foo, 42); + set_foo(43); + assert_equals(foo, 43); + assert_equals(default1, "fox"); + assert_equals(default2, "fox"); +}, 'Duplicated imports with the different specifier'); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/export-default.js b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/export-default.js new file mode 100644 index 0000000..283830ab --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/export-default.js
@@ -0,0 +1,2 @@ +log.push("export-default"); +export default "fox";
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html index 1cb07993..57b40f5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html
@@ -6,25 +6,19 @@ <script> setup({allow_uncaught_exception: true}); - window.log = []; - - window.addEventListener("error", ev => log.push(ev.error)); - const test_load = async_test( "Test that missing exports lead to SyntaxError events on window and " + "load events on script"); + + window.log = []; + window.addEventListener("error", ev => { + test_load.step(() => assert_equals(ev.error.constructor, SyntaxError)); + log.push(ev.message); + }); + window.addEventListener("load", test_load.step_func_done(ev => { - assert_equals(log.length, 10); - assert_equals(log[0].constructor, SyntaxError); - assert_equals(log[1], 1); - assert_equals(log[2].constructor, SyntaxError); - assert_equals(log[3], 2); - assert_equals(log[4].constructor, SyntaxError); - assert_equals(log[5], 3); - assert_equals(log[6].constructor, SyntaxError); - assert_equals(log[7], 4); - assert_equals(log[8].constructor, SyntaxError); - assert_equals(log[9], 5); + const msg = log[0]; + assert_array_equals(log, [msg, 1, msg, 2, msg, 3, msg, 4, msg, 5]); })); function unreachable() { log.push("unexpected"); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html index d7151f2b..27ba006 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html
@@ -6,25 +6,19 @@ <script> setup({allow_uncaught_exception: true}); - window.log = []; - - window.addEventListener("error", ev => log.push(ev.error)); - const test_load = async_test( "Test that missing exports lead to SyntaxError events on window and " + "load events on script"); + + window.log = []; + window.addEventListener("error", ev => { + test_load.step(() => assert_equals(ev.error.constructor, SyntaxError)); + log.push(ev.message); + }); + window.addEventListener("load", test_load.step_func_done(ev => { - assert_equals(log.length, 10); - assert_equals(log[0].constructor, SyntaxError); - assert_equals(log[1], 1); - assert_equals(log[2].constructor, SyntaxError); - assert_equals(log[3], 2); - assert_equals(log[4].constructor, SyntaxError); - assert_equals(log[5], 3); - assert_equals(log[6].constructor, SyntaxError); - assert_equals(log[7], 4); - assert_equals(log[8].constructor, SyntaxError); - assert_equals(log[9], 5); + const msg = log[0]; + assert_array_equals(log, [msg, 1, msg, 2, msg, 3, msg, 4, msg, 5]); })); function unreachable() { log.push("unexpected"); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-3-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-3-expected.txt new file mode 100644 index 0000000..4aef3b3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-3-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Test that unresolvable cycles lead to SyntaxError events on window and load events on script assert_array_equals: property 2, expected "Uncaught SyntaxError: Detected cycle while resolving name 'x' in './cycle-unresolvable-a.js'" but got "Uncaught SyntaxError: Detected cycle while resolving name 'x' in './cycle-unresolvable.js'" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html index 739bf0e..e03fcc0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html
@@ -6,21 +6,19 @@ <script> setup({allow_uncaught_exception: true}); - window.log = []; - - window.addEventListener("error", ev => log.push(ev.error)); - const test_load = async_test( "Test that unresolvable cycles lead to SyntaxError events on window " + "and load events on script"); + + window.log = []; + window.addEventListener("error", ev => { + test_load.step(() => assert_equals(ev.error.constructor, SyntaxError)); + log.push(ev.message); + }); + window.addEventListener("load", test_load.step_func_done(ev => { - assert_equals(log.length, 6); - assert_equals(log[0].constructor, SyntaxError); - assert_equals(log[1], 1); - assert_equals(log[2].constructor, SyntaxError); - assert_equals(log[3], 2); - assert_equals(log[4].constructor, SyntaxError); - assert_equals(log[5], 3); + const msg = log[0]; + assert_array_equals(log, [msg, 1, msg, 2, msg, 3]); })); function unreachable() { log.push("unexpected"); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-4-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-4-expected.txt new file mode 100644 index 0000000..7c539bf5 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-4-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Test that loading a graph in which a module is already errored results in an error. assert_array_equals: property 2, expected "Uncaught SyntaxError: The requested module './instantiation-error-4c.js' does not provide an export named 'something'" but got "Uncaught SyntaxError: The requested module './instantiation-error-4d.js' does not provide an export named 'something'" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html index b6be1db..238e8832 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html
@@ -7,18 +7,18 @@ setup({allow_uncaught_exception: true}); window.log = []; - - window.addEventListener("error", ev => log.push(ev.error)); - const test_load = async_test( "Test that loading a graph in which a module is already " + - "errored results in that module's error."); + "errored results in an error."); + + window.addEventListener("error", ev => { + test_load.step(() => assert_equals(ev.error.constructor, SyntaxError)); + log.push(ev.message); + }); + window.addEventListener("load", test_load.step_func_done(ev => { - assert_equals(log.length, 4); - assert_equals(log[0].constructor, SyntaxError); - assert_equals(log[1], 1); - assert_equals(log[2].constructor, SyntaxError); - assert_equals(log[3], 2); + const msg = log[0]; + assert_array_equals(log, [msg, 1, msg, 2]); })); function unreachable() { log.push("unexpected"); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-5-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-5-expected.txt new file mode 100644 index 0000000..56747fec --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-5-expected.txt
@@ -0,0 +1,4 @@ +This is a testharness.js-based test. +FAIL Test that loading a graph in which a module is already errored results an error. assert_array_equals: property 2, expected "Uncaught SyntaxError: The requested module './instantiation-error-5c.js' does not provide an export named 'something'" but got "Uncaught SyntaxError: The requested module './instantiation-error-5e.js' does not provide an export named 'something'" +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html index 5afd011d0..de2b6ba 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html +++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html
@@ -6,20 +6,19 @@ <script> setup({allow_uncaught_exception: true}); - window.log = []; - - window.addEventListener("error", ev => log.push(ev.error)); - const test_load = async_test( "Test that loading a graph in which a module is already " + - "errored results in that module's error."); + "errored results an error."); + + window.log = []; + window.addEventListener("error", ev => { + test_load.step(() => assert_equals(ev.error.constructor, SyntaxError)); + log.push(ev.message); + }); + window.addEventListener("load", test_load.step_func_done(ev => { - assert_equals(log.length, 4); - assert_equals(log[0].constructor, SyntaxError); - assert_equals(log[1], 1); - assert_equals(log[2].constructor, SyntaxError); - assert_equals(log[3], 2); - assert_not_equals(log[0], log[2], "errors should be different"); + const msg = log[0]; + assert_array_equals(log, [msg, 1, msg, 2]); })); function unreachable() { log.push("unexpected"); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator.any.js b/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator.any.js index 8cfaef0..07bccb7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator.any.js +++ b/third_party/WebKit/LayoutTests/external/wpt/html/webappapis/system-state-and-capabilities/the-navigator-object/navigator.any.js
@@ -54,7 +54,7 @@ "userAgent should return the value sent in the " + "User-Agent header"); }); - request.open("GET", "/XMLHttpRequest/resources/inspect-headers.py?" + + request.open("GET", "/xhr/resources/inspect-headers.py?" + "filter_name=User-Agent"); request.send(); }, "userAgent value");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/http/resources/securedimage.py b/third_party/WebKit/LayoutTests/external/wpt/http/resources/securedimage.py index 311b0c5..89cbd72 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/http/resources/securedimage.py +++ b/third_party/WebKit/LayoutTests/external/wpt/http/resources/securedimage.py
@@ -6,12 +6,10 @@ if "authorization" not in request.headers: response.status = 401 response.headers.set("WWW-Authenticate", "Basic") - return response else: auth = request.headers.get("Authorization") if auth != "Basic dGVzdHVzZXI6dGVzdHBhc3M=": response.set_error(403, "Invalid username or password - " + auth) - return response response.status = 301 response.headers.set("Location", image_url)
diff --git a/third_party/WebKit/LayoutTests/external/wpt/keyboard-lock/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/keyboard-lock/OWNERS index f3349c0..af150a334 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/keyboard-lock/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/keyboard-lock/OWNERS
@@ -1 +1,2 @@ -zijiehe@chromium.org +garykac@chromium.org +joedow@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/keyboard-lock/idlharness.https.html b/third_party/WebKit/LayoutTests/external/wpt/keyboard-lock/idlharness.https.html index 6fabb411..4e06d57 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/keyboard-lock/idlharness.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/keyboard-lock/idlharness.https.html
@@ -18,7 +18,7 @@ idlharness.js. media-capabilities/idlharness.html is also impacted by this issue. See https://codereview.chromium.org/2805763004/#ps620001, which includes a potential fix. - TODO(zijiehe): Submit the fix. + TODO(joedow): Submit the fix. --> <pre id="idl" style="display: none"> partial interface Navigator {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/lint.whitelist b/third_party/WebKit/LayoutTests/external/wpt/lint.whitelist index 6d8971f..dcabf43 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/lint.whitelist +++ b/third_party/WebKit/LayoutTests/external/wpt/lint.whitelist
@@ -99,6 +99,10 @@ # Intentional use of CRLF CR AT EOL: WebIDL/valid/idl/documentation-dos.widl CR AT EOL: cors/resources/cors-headers.asis +CR AT EOL: html/form-elements/the-textarea-element/multiline-placeholder-cr.html +CR AT EOL: html/form-elements/the-textarea-element/multiline-placeholder-crlf.html +CR AT EOL: html/input/the-placeholder-attribute/multiline-cr.html +CR AT EOL: html/input/the-placeholder-attribute/multiline-crlf.html CR AT EOL: html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html CR AT EOL: webvtt/parsing/file-parsing/tests/support/newlines.vtt @@ -226,8 +230,8 @@ SET TIMEOUT: webstorage/eventTestHarness.js SET TIMEOUT: webvtt/* SET TIMEOUT: workers/* -SET TIMEOUT: XMLHttpRequest/resources/init.htm -SET TIMEOUT: XMLHttpRequest/resources/xmlhttprequest-timeout.js +SET TIMEOUT: xhr/resources/init.htm +SET TIMEOUT: xhr/resources/xmlhttprequest-timeout.js # generate_tests implementation and sample usage GENERATE_TESTS: resources/test/tests/generate-callback.html @@ -939,6 +943,7 @@ MISSING-LINK: css/cssom-view/scrollingElement.html MISSING-LINK: css/cssom-view/scrollIntoView-shadow.html MISSING-LINK: css/cssom-view/scrollIntoView-smooth.html +MISSING-LINK: css/cssom-view/scrollTop-display-change.html CSS-COLLIDING-TEST-NAME: css/cssom-view/interfaces.html CSS-COLLIDING-TEST-NAME: css/cssom/interfaces.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/mediacapture-streams/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/mediacapture-streams/OWNERS index e3f972f..bffa2b19 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/mediacapture-streams/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/mediacapture-streams/OWNERS
@@ -1,2 +1,3 @@ # COMPONENT: Blink>MediaStream -phoglund@chromium.org +# WPT-NOTIFY: true +guidou@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/preload/fetch-destination.https.html b/third_party/WebKit/LayoutTests/external/wpt/preload/fetch-destination.https.html deleted file mode 100644 index c7d5142..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/preload/fetch-destination.https.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="/preload/resources/preload_helper.js"></script> -<script src="../service-workers/service-worker/resources/test-helpers.sub.js"></script> -<script> -async_test(function(t) { - var worker_url = 'resources/fetch-destination-worker.js'; - var scope = 'resources/empty.html'; - var registration; - verifyPreloadAndRTSupport(); - - service_worker_unregister_and_register(t, worker_url, scope) - .then(t.step_func(function(r) { - registration = r; - return wait_for_state(t, r.installing, 'activated'); - })) - .then(t.step_func(function() { - return with_iframe(scope); - })) - .then(t.step_func(function(frame) { - var link = frame.contentWindow.document.createElement("link"); - link.as = "fetch"; - link.href = "resources/dummy.xml"; - link.rel = "preload"; - link.addEventListener("load", t.step_func_done(function() { registration.unregister(); })); - link.addEventListener("error", t.step_func_done(function() { - registration.unregister(); - assert_unreached("Fetch destination preload errored"); - })); - frame.contentWindow.document.body.appendChild(link); - })) - .catch(unreached_rejection(t)); -}, 'Fetch destination preload'); -</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/preload/resources/fetch-destination-worker.js b/third_party/WebKit/LayoutTests/external/wpt/preload/resources/fetch-destination-worker.js deleted file mode 100644 index 57b259e0..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/preload/resources/fetch-destination-worker.js +++ /dev/null
@@ -1,9 +0,0 @@ -self.addEventListener('fetch', function(event) { - if (event.request.url.indexOf('dummy.xml') != -1) { - if (!event.request.destination || event.request.destination == "") - event.respondWith(new Response()); - else - event.respondWith(Response.error()); - } -}); -
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks/active-and-hover-manual.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/active-and-hover-manual.html new file mode 100644 index 0000000..10d787d --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/quirks/active-and-hover-manual.html
@@ -0,0 +1,181 @@ +<!doctype html> +<html> + <head> + <title>The :active and :hover quirk</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <style> iframe { width:100%; height:200px; } </style> + </head> + <body> + <p>Click on the boxes below (using a pointing device). <button onclick="timeout()">Abort and show results</button></p> + <div id=log></div> + <p>quirks: + <iframe id=quirks></iframe> + <p>almost: + <iframe id=almost></iframe> + <p>standards: + <iframe id=standards></iframe> + <script type="text/plain" id=html_tmpl> +<html id=html class=x lang=en> +<style> +.t:not(area), img { display:inline-block; vertical-align:middle; width:50px; height:50px; background-color:#eee; margin:0 0.5em } +.done.done { background-color:lime } +link::before { content:'' } +table, tbody, tr, td { display:inline } +</style> +<style>{style}</style> +<body id=body class=x> +a<a href=# id=a class=t></a> +b<a id=b class=t></a> +c<map id=map1 name=map1 class=x><area href=# coords=0,0,50,50 id=c class=t></map><img id=img1 class=x usemap=#map1 src=/images/transparent.png> +d<map id=map2 name=map2 class=x><area coords=0,0,50,50 id=d class=t></map><img id=img2 class=x usemap=#map2 src=/images/transparent.png> +e<link href=# id=e class=t> +f<link rel=stylesheet href=# id=f class=t> +g<link id=g class=t> +h<button id=h class=t></button> +i<input type=submit id=i class=t value> +j<input type=image id=j class=t alt> +k<input type=reset id=k class=t value> +l<input type=button id=l class=t value> +m<img tabindex=0 id=n class=t src=/images/transparent.png> +n<a href=# id=a_ancestor class=x><table id=table class=x><tbody id=tbody class=x><tr id=tr class=x><td id=td class=x><a href=# id=o class=t></a></table></a> +</script> + <script> + setup({explicit_done:true, explicit_timeout:true}); + onload = function() { + + var links_only = [ + {input:':active', prop:'background-attachment', value:'fixed'}, + {input:':hover', prop:'background-position', value:'1px 2px'}, + {input:':hover:active', prop:'background-repeat', value:'repeat-x'}, + {input:':active:active', prop:'border-collapse', value:'collapse'}, + {input:':hover:hover', prop:'border-spacing', value:'1px 2px'}, + {input:'*:active', prop:'border-top-style', value:'dotted'}, + {input:'*:hover', prop:'border-right-style', value:'dotted'}, + ]; + + var any_elm = [ + // type selector + {input:'a:active, map:active, area:active, link:active, button:active, input:active, img:active, table:active, tbody:active, tr:active, td:active, body:active, html:active', prop:'top', value:'1px'}, + {input:'a:hover, map:hover, area:hover, link:hover, button:hover, input:hover, img:hover, table:hover, tbody:hover, tr:hover, td:hover, body:hover, html:hover', prop:'right', value:'1px'}, + // attribute selector + {input:'[id]:active', prop:'bottom', value:'1px'}, + {input:'[id]:hover', prop:'left', value:'1px'}, + // id selector + {input:'#a:active, #b:active, #map1:active, #c:active, #img1:active, #map2:active, #d:active, #img2:active, #e:active, #f:active, #g:active, #h:active, #i:active, #j:active, #k:active, #l:active, #m:active, #n:active, #o:active, #a_ancestor:active, #table:active, #tbody:active, #tr:active, #td:active, #body:active, #html:active', prop:'caption-side', value:'bottom'}, + {input:'#a:hover, #b:hover, #map1:hover, #c:hover, #img1:hover, #map2:hover, #d:hover, #img2:hover, #e:hover, #f:hover, #g:hover, #h:hover, #i:hover, #j:hover, #k:hover, #l:hover, #m:hover, #n:hover, #o:hover, #a_ancestor:hover, #table:hover, #tbody:hover, #tr:hover, #td:hover, #body:hover, #html:hover', prop:'clear', value:'left'}, + {input:':active#a, :active#b, :active#map1, :active#c, :active#img1, :active#map2, :active#d, :active#img2, :active#e, :active#f, :active#g, :active#h, :active#i, :active#j, :active#k, :active#l, :active#m, :active#n, :active#o, :active#a_ancestor, :active#table, :active#tbody, :active#tr, :active#td, :active#body, :active#html', prop:'list-style-type', value:'circle'}, + {input:':hover#a, :hover#b, :hover#map1, :hover#c, :hover#img1, :hover#map2, :hover#d, :hover#img2, :hover#e, :hover#f, :hover#g, :hover#h, :hover#i, :hover#j, :hover#k, :hover#l, :hover#m, :hover#n, :hover#o, :hover#a_ancestor, :hover#table, :hover#tbody, :hover#tr, :hover#td, :hover#body, :hover#html', prop:'max-height', value:'10000px'}, + // class selector + {input:'.t:active, .x:active', prop:'cursor', value:'move'}, + {input:'.t:hover, .x:hover', prop:'empty-cells', value:'hide'}, + {input:':active.t, :active.x', prop:'max-width', value:'10000px'}, + {input:':hover.t, :hover.x', prop:'min-height', value:'1px'}, + // pseudo-class selector + {input:':lang(en):active', prop:'font-style', value:'italic'}, + {input:':lang(en):hover', prop:'font-variant', value:'small-caps'}, + {input:':active:lang(en)', prop:'min-width', value:'1px'}, + {input:':hover:lang(en)', prop:'overflow', value:'hidden'}, + // pseudo-element selector + {input:':active::before', prop:'top', value:'1px', pseudoElt:'::before'}, + {input:':hover::before', prop:'right', value:'1px', pseudoElt:'::before'}, + {input:':active::after', prop:'bottom', value:'1px', pseudoElt:'::after'}, + {input:':hover::after', prop:'left', value:'1px', pseudoElt:'::after'}, + // as argument + //{input:':matches(:active)', prop:'font-weight', value:'bold'}, + //{input:':matches(:hover)', prop:'list-style-position', value:'inside'}, + ]; + + var stylesheet = ''; + function serialize(t) { + return t.input + '{' + t.prop + ':' + t.value + '}'; + } + + links_only.concat(any_elm).forEach(function(t) { + stylesheet += serialize(t); + }); + var html = document.getElementById('html_tmpl').textContent.replace('{style}', stylesheet); + var a_doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; + var s_doctype = '<!DOCTYPE HTML>'; + var q = document.getElementById('quirks').contentWindow; + var a = document.getElementById('almost').contentWindow; + var s = document.getElementById('standards').contentWindow; + q.document.open(); + q.document.write(html); + q.document.close(); + a.document.open(); + a.document.write(a_doctype + html); + a.document.close(); + s.document.open(); + s.document.write(s_doctype + html); + s.document.close(); + q.mode = 'quirks'; + a.mode = 'almost'; + s.mode = 'standards'; + [q, a, s].forEach(function(win) { + win.onmousedown = win.onmouseup = run_tests; + win.onclick = function(e) { + e.preventDefault(); + }; + }); + var test_count = 0; + var total_test_count = q.document.querySelectorAll('.t').length * 3; + + function check_matches(id, win, elm, t, expectMatch) { + var prefix = id + ', ' + win.mode + ': '; + + // .getComputedStyle can be checked both for pseudo-elements and normal elements + test(function() { + assert_equals(win.getComputedStyle(elm, t.pseudoElt).getPropertyValue(t.prop) === t.value, expectMatch); + }, prefix + 'getComputedStyle(' + elm.id + ') with selector ' + t.input); + + // .matches doesn't work with pseudo-elements + if (!t.pseudoElt) { + test(function() { + assert_equals(elm.matches(t.input), expectMatch); + }, prefix + elm.id + '.matches("' + t.input + '")'); + } + } + + function run_tests(e) { + var elm = e.target; + if (elm.classList.contains('t') && !elm.classList.contains('done')) { + if (!elm.matches('.t:active')) { + return; + } + if (elm.tagName != 'AREA') { + elm.classList.add('done'); + } else { + // For <area> we want to style the <img> instead. + if (elm.parentNode.nextElementSibling.tagName != 'IMG') { + throw new Error("<area>'s parent's next element sibling wasn't an <img>"); + } + elm.parentNode.nextElementSibling.classList.add('done'); + } + var id = elm.id; + var win = elm.ownerDocument.defaultView; + do { + if (win.mode === 'quirks') { + links_only.forEach(function(t) { + var elmIsLink = elm.matches('a[href], area[href], link[href]'); + check_matches(id, win, elm, t, elmIsLink); + }); + } else { + links_only.forEach(function(t) { + check_matches(id, win, elm, t, true); + }); + } + any_elm.forEach(function(t) { + check_matches(id, win, elm, t, true); + }); + } while (elm = elm.parentElement); + test_count++; + if (test_count === total_test_count) { + done(); + } + } + } + } + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/blocks-ignore-line-height.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/blocks-ignore-line-height.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/blocks-ignore-line-height.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/blocks-ignore-line-height.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/classname-query-after-sibling-adoption.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/classname-query-after-sibling-adoption.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/classname-query-after-sibling-adoption.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/classname-query-after-sibling-adoption.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/hashless-hex-color.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/hashless-hex-color.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/hashless-hex-color.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/hashless-hex-color.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/historical/list-item-bullet-size-ref.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/historical/list-item-bullet-size-ref.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/historical/list-item-bullet-size-ref.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/historical/list-item-bullet-size-ref.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/historical/list-item-bullet-size.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/historical/list-item-bullet-size.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/historical/list-item-bullet-size.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/historical/list-item-bullet-size.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/line-height-calculation.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/line-height-calculation.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/line-height-calculation.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/line-height-calculation.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/percentage-height-calculation.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/percentage-height-calculation.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/percentage-height-calculation.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/percentage-height-calculation.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/supports.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/supports.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/supports.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/supports.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/table-cell-nowrap-minimum-width-calculation.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/table-cell-nowrap-minimum-width-calculation.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/table-cell-nowrap-minimum-width-calculation.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/table-cell-nowrap-minimum-width-calculation.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/table-cell-width-calculation.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/table-cell-width-calculation.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/table-cell-width-calculation.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/table-cell-width-calculation.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/quirks-mode/unitless-length.html b/third_party/WebKit/LayoutTests/external/wpt/quirks/unitless-length.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/quirks-mode/unitless-length.html rename to third_party/WebKit/LayoutTests/external/wpt/quirks/unitless-length.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/resource-timing/resources/fake_responses.py b/third_party/WebKit/LayoutTests/external/wpt/resource-timing/resources/fake_responses.py index 9f2e43d..f7169381 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/resource-timing/resources/fake_responses.py +++ b/third_party/WebKit/LayoutTests/external/wpt/resource-timing/resources/fake_responses.py
@@ -1,4 +1,4 @@ -# XMLHttpRequest/resources/conditional.py -- to fake a 304 response +# /xhr/resources/conditional.py -- to fake a 304 response def main(request, response): tag = request.GET.first("tag", None)
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/OWNERS index 82c8165..afb2620d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/cache-storage/OWNERS
@@ -1 +1,4 @@ +# TEAM: storage-dev@chromium.org +# COMPONENT: Blink>Storage>CacheStorage +# WPT-NOTIFY: true jsbell@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event-respond-with-custom-response.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event-respond-with-custom-response.https.html new file mode 100644 index 0000000..645a29c9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event-respond-with-custom-response.https.html
@@ -0,0 +1,82 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>respondWith with a new Response</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/test-helpers.sub.js"></script> +<script> +'use strict'; + +const WORKER = + 'resources/fetch-event-respond-with-custom-response-worker.js'; +const SCOPE = + 'resources/blank.html'; + +// Register a service worker, then create an iframe at url. +function iframeTest(url, callback, name) { + return promise_test(async t => { + const reg = await service_worker_unregister_and_register(t, WORKER, SCOPE); + add_completion_callback(() => reg.unregister()); + await wait_for_state(t, reg.installing, 'activated'); + const iframe = await with_iframe(url); + const iwin = iframe.contentWindow; + t.add_cleanup(() => iframe.remove()); + await callback(t, iwin); + }, name); +} + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?type=string'); + assert_equals(await response.text(), 'PASS'); +}, 'Subresource built from a string'); + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?type=blob'); + assert_equals(await response.text(), 'PASS'); +}, 'Subresource built from a blob'); + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?type=buffer'); + assert_equals(await response.text(), 'PASS'); +}, 'Subresource built from a buffer'); + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?type=buffer-view'); + assert_equals(await response.text(), 'PASS'); +}, 'Subresource built from a buffer-view'); + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?type=form-data'); + const data = await response.formData(); + assert_equals(data.get('result'), 'PASS'); +}, 'Subresource built from form-data'); + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?type=search-params'); + assert_equals(await response.text(), 'result=PASS'); +}, 'Subresource built from search-params'); + +// As above, but navigations + +iframeTest(SCOPE + '?type=string', (t, iwin) => { + assert_equals(iwin.document.body.textContent, 'PASS'); +}, 'Navigation resource built from a string'); + +iframeTest(SCOPE + '?type=blob', (t, iwin) => { + assert_equals(iwin.document.body.textContent, 'PASS'); +}, 'Navigation resource built from a blob'); + +iframeTest(SCOPE + '?type=buffer', (t, iwin) => { + assert_equals(iwin.document.body.textContent, 'PASS'); +}, 'Navigation resource built from a buffer'); + +iframeTest(SCOPE + '?type=buffer-view', (t, iwin) => { + assert_equals(iwin.document.body.textContent, 'PASS'); +}, 'Navigation resource built from a buffer-view'); + +// Note: not testing form data for a navigation as the boundary header is lost. + +iframeTest(SCOPE + '?type=search-params', (t, iwin) => { + assert_equals(iwin.document.body.textContent, 'result=PASS'); +}, 'Navigation resource built from search-params'); +</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event-respond-with-readable-stream.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event-respond-with-readable-stream.https.html index 05afb6b..75545ad 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event-respond-with-readable-stream.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/fetch-event-respond-with-readable-stream.https.html
@@ -10,22 +10,45 @@ const WORKER = 'resources/fetch-event-respond-with-readable-stream-worker.js'; const SCOPE = - 'resources/fetch-event-respond-with-readable-stream-iframe.html'; -// Called by the iframe when done. -var done; -var done_was_called = new Promise(resolve => done = resolve); + 'resources/blank.html'; -promise_test(t => { - return service_worker_unregister_and_register(t, WORKER, SCOPE) - .then(reg => { - add_completion_callback(() => reg.unregister()); - return wait_for_state(t, reg.installing, 'activated'); - }) - .then(() => with_iframe(SCOPE)) - .then(iframe => { - t.add_cleanup(() => iframe.remove()) - }) - .then(() => done_was_called) - .then(result => assert_equals(result, 'PASS')); - }, 'Respond with a Response built from a ReadableStream'); +// Register a service worker, then create an iframe at url. +function iframeTest(url, callback, name) { + return promise_test(async t => { + const reg = await service_worker_unregister_and_register(t, WORKER, SCOPE); + add_completion_callback(() => reg.unregister()); + await wait_for_state(t, reg.installing, 'activated'); + const iframe = await with_iframe(url); + const iwin = iframe.contentWindow; + t.add_cleanup(() => iframe.remove()); + await callback(t, iwin); + }, name); +} + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?stream'); + assert_equals(await response.text(), 'PASS'); +}, 'Subresource built from a ReadableStream'); + +iframeTest(SCOPE + '?stream', (t, iwin) => { + assert_equals(iwin.document.body.textContent, 'PASS'); +}, 'Main resource built from a ReadableStream'); + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?stream&delay'); + assert_equals(await response.text(), 'PASS'); +}, 'Subresource built from a ReadableStream - delayed'); + +iframeTest(SCOPE + '?stream&delay', (t, iwin) => { + assert_equals(iwin.document.body.textContent, 'PASS'); +}, 'Main resource built from a ReadableStream - delayed'); + +iframeTest(SCOPE, async (t, iwin) => { + const response = await iwin.fetch('?stream&use-fetch-stream'); + assert_equals(await response.text(), 'PASS\n'); +}, 'Subresource built from a ReadableStream - fetch stream'); + +iframeTest(SCOPE + '?stream&use-fetch-stream', (t, iwin) => { + assert_equals(iwin.document.body.textContent, 'PASS\n'); +}, 'Main resource built from a ReadableStream - fetch stream'); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https.html index d840666b8..3f12c2f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/navigation-redirect.https.html
@@ -156,6 +156,22 @@ promise_test(function(t) { return setup_environment(t).then(function() { return test_redirect( + OUT_SCOPE + 'url=' + encodeURIComponent(SCOPE1) + '#ref', + SCOPE1 + '#ref', + [[SCOPE1 + '#ref'], [], []]); + }); + }, 'Normal redirect to same-origin scope with a hash fragment.'); +promise_test(function(t) { + return setup_environment(t).then(function() { + return test_redirect( + OUT_SCOPE + 'url=' + encodeURIComponent(SCOPE1 + '#ref2') + '#ref', + SCOPE1 + '#ref2', + [[SCOPE1 + '#ref2'], [], []]); + }); + }, 'Normal redirect to same-origin scope with different hash fragments.'); +promise_test(function(t) { + return setup_environment(t).then(function() { + return test_redirect( OUT_SCOPE + 'url=' + encodeURIComponent(OTHER_ORIGIN_SCOPE), OTHER_ORIGIN_SCOPE, [[], [], [OTHER_ORIGIN_SCOPE]]); @@ -182,6 +198,27 @@ promise_test(function(t) { return setup_environment(t).then(function() { return test_redirect( + SCOPE1 + 'url=' + encodeURIComponent(SCOPE1) + '#ref', + SCOPE1 + '#ref', + [[SCOPE1 + 'url=' + encodeURIComponent(SCOPE1) + '#ref', + SCOPE1 + '#ref'], + [], []]); + }); + }, 'SW-fallbacked redirect to same-origin same-scope with a hash fragment.'); +promise_test(function(t) { + return setup_environment(t).then(function() { + return test_redirect( + SCOPE1 + 'url=' + encodeURIComponent(SCOPE1 + '#ref2') + '#ref', + SCOPE1 + '#ref2', + [[SCOPE1 + 'url=' + encodeURIComponent(SCOPE1 + '#ref2') + '#ref', + SCOPE1 + '#ref2'], + [], []]); + }); + }, 'SW-fallbacked redirect to same-origin same-scope with different hash ' + + 'fragments.'); +promise_test(function(t) { + return setup_environment(t).then(function() { + return test_redirect( SCOPE1 + 'url=' + encodeURIComponent(SCOPE2), SCOPE2, [[SCOPE1 + 'url=' + encodeURIComponent(SCOPE2)], [SCOPE2], []]); @@ -221,6 +258,27 @@ promise_test(function(t) { return setup_environment(t).then(function() { return test_redirect( + SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OUT_SCOPE) + '#ref', + OUT_SCOPE + '#ref', + [[SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OUT_SCOPE) + '#ref'], + [], []]); + }); + }, 'SW-generated redirect to same-origin out-scope with a hash fragment.'); +promise_test(function(t) { + return setup_environment(t).then(function() { + return test_redirect( + SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OUT_SCOPE + '#ref2') + + '#ref', + OUT_SCOPE + '#ref2', + [[SCOPE1 + 'sw=gen&url=' + encodeURIComponent(OUT_SCOPE + '#ref2') + + '#ref'], + [], []]); + }); + }, 'SW-generated redirect to same-origin out-scope with different hash' + + 'fragments.'); +promise_test(function(t) { + return setup_environment(t).then(function() { + return test_redirect( SCOPE1 + 'sw=gen&url=' + encodeURIComponent(SCOPE1), SCOPE1, [[SCOPE1 + 'sw=gen&url=' + encodeURIComponent(SCOPE1), SCOPE1],
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/about-blank-replacement-popup-frame.py b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/about-blank-replacement-popup-frame.py index be529453..f0b8cd5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/about-blank-replacement-popup-frame.py +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/about-blank-replacement-popup-frame.py
@@ -12,12 +12,15 @@ <script> function nestedLoaded() { parent.postMessage({ type: 'NESTED_LOADED' }, '*'); - popup.close(); } let popup = window.open('?nested=true'); popup.onload = nestedLoaded; +addEventListener('unload', evt => { + popup.close(); +}, { once: true }); + // Helper routine to make it slightly easier for our parent to find // the nested popup window. function nested() {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-custom-response-worker.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-custom-response-worker.js new file mode 100644 index 0000000..ff24aed --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-custom-response-worker.js
@@ -0,0 +1,45 @@ +'use strict'; + +addEventListener('fetch', event => { + const url = new URL(event.request.url); + const type = url.searchParams.get('type'); + + if (!type) return; + + if (type === 'string') { + event.respondWith(new Response('PASS')); + } + else if (type === 'blob') { + event.respondWith( + new Response(new Blob(['PASS'])) + ); + } + else if (type === 'buffer-view') { + const encoder = new TextEncoder(); + event.respondWith( + new Response(encoder.encode('PASS')) + ); + } + else if (type === 'buffer') { + const encoder = new TextEncoder(); + event.respondWith( + new Response(encoder.encode('PASS').buffer) + ); + } + else if (type === 'form-data') { + const body = new FormData(); + body.set('result', 'PASS'); + event.respondWith( + new Response(body) + ); + } + else if (type === 'search-params') { + const body = new URLSearchParams(); + body.set('result', 'PASS'); + event.respondWith( + new Response(body, { + headers: { 'Content-Type': 'text/plain' } + }) + ); + } +});
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-iframe.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-iframe.html deleted file mode 100644 index 1904d75..0000000 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-iframe.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script> -'use strict'; - -fetch('body-stream').then(resp => { - return resp.text(); - }).then(text => parent.done(text)) - .catch(e => parent.done('FAIL: ' + e)); -</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-worker.js b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-worker.js index ddaba55..aaabdc3 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-worker.js +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-worker.js
@@ -1,13 +1,37 @@ 'use strict'; +importScripts("/resources/testharness.js"); self.addEventListener('fetch', event => { - if (!event.request.url.match(/body-stream$/)) - return; + const url = new URL(event.request.url); + if (!url.searchParams.has('stream')) return; - const stream = new ReadableStream({start: controller => { - const encoder = new TextEncoder(); + if (url.searchParams.has('use-fetch-stream')) { + event.respondWith(async function() { + const response = await fetch('pass.txt'); + return new Response(response.body); + }()); + return; + } + + const delayEnqueue = url.searchParams.has('delay'); + + const stream = new ReadableStream({ + start(controller) { + const encoder = new TextEncoder(); + + const populate = () => { controller.enqueue(encoder.encode('PASS')); controller.close(); - }}); - event.respondWith(new Response(stream)); + } + + if (delayEnqueue) { + step_timeout(populate, 16); + } + else { + populate(); + } + } }); + + event.respondWith(new Response(stream)); +});
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-no-freshness-headers-iframe.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-no-freshness-headers-iframe.html index 68a1a868..e6e9380 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-no-freshness-headers-iframe.html +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-no-freshness-headers-iframe.html
@@ -1 +1 @@ -<script src="empty.js"></script> +<script src="./fetch-request-no-freshness-headers-script.py"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-no-freshness-headers-script.py b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-no-freshness-headers-script.py new file mode 100644 index 0000000..e6a392c --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/fetch-request-no-freshness-headers-script.py
@@ -0,0 +1,6 @@ +def main(request, response): + headers = [] + # Sets an ETag header to check the cache revalidation behavior. + headers.append(("ETag", "abc123")) + headers.append(("Content-Type", "text/javascript")) + return headers, "/* empty script */"
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/pass.txt b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/pass.txt similarity index 100% copy from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/pass.txt copy to third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/resources/pass.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/storage/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/storage/OWNERS index dae5a38..ce2ae1f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/storage/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/storage/OWNERS
@@ -1,3 +1,4 @@ # TEAM: storage-dev@chromium.org # COMPONENT: Blink>Storage>Quota +# WPT-NOTIFY: true jsbell@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/touch-events/historical.html b/third_party/WebKit/LayoutTests/external/wpt/touch-events/historical.html index e6fd5981..7d1e323 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/touch-events/historical.html +++ b/third_party/WebKit/LayoutTests/external/wpt/touch-events/historical.html
@@ -6,6 +6,22 @@ <script src="touch-support.js"></script> <body> <script> +[ + "webkitRadiusX", + "webkitRadiusY", + "webkitRotationAngle", + "webkitForce", +].forEach(function(name) { + test(function() { + assert_false(name in Touch.prototype, + "Should not be supported on the prototype"); + + var touch = document.createTouch(window, window, 0, 0, 0, 0, 0); + assert_false(name in touch, + "Should not be supported on the instance"); + }, "Touch::" + name); +}); + test(function() { assert_false("identifiedTouch" in TouchList.prototype, "Should not be supported on the prototype"); @@ -14,4 +30,13 @@ assert_false("identifiedTouch" in touchList, "Should not be supported on the instance"); }, "TouchList::identifiedTouch"); + +test(function() { + assert_false("initTouchEvent" in TouchEvent.prototype, + "Should not be supported on the prototype"); + + var touchEvent = document.createEvent("touchevent"); + assert_false("initTouchEvent" in touchEvent, + "Should not be supported on the instance"); +}, "TouchEvent::initTouchEvent"); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/wasm/wasm_local_iframe_test.html b/third_party/WebKit/LayoutTests/external/wpt/wasm/wasm_local_iframe_test.html index 9ccebdc7..0f4fbd0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/wasm/wasm_local_iframe_test.html +++ b/third_party/WebKit/LayoutTests/external/wpt/wasm/wasm_local_iframe_test.html
@@ -2,16 +2,18 @@ <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="resources/load_wasm.js"></script> -<iframe src="resources/frame.html" id="iframe"></iframe> <script> - promise_test(async function() { - var mod = await createWasmModule(); - assert_true(mod instanceof WebAssembly.Module); - var ans = await new Promise((resolve, reject) => { - var iframe = document.getElementById("iframe").contentWindow; - iframe.postMessage(mod, '*'); - window.addEventListener("message", (reply) => resolve(reply.data), false); - }); - assert_equals(ans, 43); - }, "send wasm module to iframe"); + function runTests(iframe) { + iframe = iframe.contentWindow; + promise_test(async function() { + var mod = await createWasmModule(); + assert_true(mod instanceof WebAssembly.Module); + var ans = await new Promise((resolve, reject) => { + iframe.postMessage(mod, '*'); + window.addEventListener("message", (reply) => resolve(reply.data), false); + }); + assert_equals(ans, 43); + }, "send wasm module to iframe"); + } </script> +<iframe src="resources/frame.html" onload="runTests(this)"></iframe>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/README.md b/third_party/WebKit/LayoutTests/external/wpt/web-animations/README.md index 1bc3512..475f58a5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/README.md +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/README.md
@@ -1,7 +1,7 @@ Web Animations Test Suite ========================= -Specification: https://w3c.github.io/web-animations/ +Specification: https://drafts.csswg.org/web-animations/ Guidelines for writing tests
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/accumulation-per-property.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/accumulation-per-property.html index 3a7201e..870e489 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/accumulation-per-property.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/accumulation-per-property.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>Accumulation for each property</title> -<link rel="help" href="https://w3c.github.io/web-animations/#animation-types"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#animation-types"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/addition-per-property.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/addition-per-property.html index c66efd3..6125631 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/addition-per-property.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/addition-per-property.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>Addition for each property</title> -<link rel="help" href="https://w3c.github.io/web-animations/#animation-types"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#animation-types"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/discrete.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/discrete.html index add3429..76f42bc7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/discrete.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/discrete.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Discrete animation type</title> -<link rel="help" href="https://w3c.github.io/web-animations/#discrete-animation-type"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#discrete-animation-type"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/interpolation-per-property.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/interpolation-per-property.html index 94ce9dd..2c335da 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/interpolation-per-property.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/interpolation-per-property.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Interpolation for each property</title> -<link rel="help" href="https://w3c.github.io/web-animations/#animation-types"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#animation-types"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/property-list.js b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/property-list.js index 46829c314..1220b455 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/property-list.js +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/animation-types/property-list.js
@@ -1054,12 +1054,6 @@ types: [ ] }, - 'overflow-clip-box': { - // https://developer.mozilla.org/en/docs/Web/CSS/overflow-clip-box - types: [ - { type: 'discrete', options: [ [ 'padding-box', 'content-box' ] ] } - ] - }, 'overflow-wrap': { // https://drafts.csswg.org/css-text-3/#propdef-overflow-wrap types: [ @@ -1554,7 +1548,7 @@ } function propertyToIDL(property) { - // https://w3c.github.io/web-animations/#animation-property-name-to-idl-attribute-name + // https://drafts.csswg.org/web-animations/#animation-property-name-to-idl-attribute-name if (property === 'float') { return 'cssFloat'; }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/combining-effects/effect-composition.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/combining-effects/effect-composition.html index d70d9d2..78f46c9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/combining-effects/effect-composition.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/combining-effects/effect-composition.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>Effect composition</title> -<link rel="help" href="https://w3c.github.io/web-animations/#effect-composition"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#effect-composition"> <script src=/resources/testharness.js></script> <script src=/resources/testharnessreport.js></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-context.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-context.html index 4115ed64..3730a0209 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-context.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-context.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>The effect value of a keyframe effect: Property values that depend on their context (target element)</title> -<link rel="help" href="https://w3c.github.io/web-animations/#calculating-computed-keyframes"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#calculating-computed-keyframes"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation.html index 29da85e..c2e9702 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation.html
@@ -2,8 +2,8 @@ <meta charset=utf-8> <title>The effect value of a keyframe effect: Applying the iteration composite operation</title> -<link rel="help" href="https://w3c.github.io/web-animations/#the-effect-value-of-a-keyframe-animation-effect"> -<link rel="help" href="https://w3c.github.io/web-animations/#effect-accumulation-section"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#the-effect-value-of-a-keyframe-animation-effect"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#effect-accumulation-section"> <script src=/resources/testharness.js></script> <script src=/resources/testharnessreport.js></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes.html index 011b76f..2a41f04 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-overlapping-keyframes.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>The effect value of a keyframe effect: Overlapping keyframes</title> -<link rel="help" href="https://w3c.github.io/web-animations/#the-effect-value-of-a-keyframe-animation-effect"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#the-effect-value-of-a-keyframe-animation-effect"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html index 1f7065c..6ad9cd2a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/animation-model/keyframe-effects/effect-value-transformed-distance.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>The effect value of a keyframe effect: Calculating the transformed distance between keyframes</title> -<link rel="help" href="https://w3c.github.io/web-animations/#the-effect-value-of-a-keyframe-animation-effect"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#the-effect-value-of-a-keyframe-animation-effect"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context.html index c72b5dee..61a7502 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate-no-browsing-context.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>Animatable.animate in combination with elements in documents without a browsing context</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animatable-animate"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animatable-animate"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate.html index 49842ff..36c4ee1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/animate.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animatable.animate</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animatable-animate"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animatable-animate"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/getAnimations.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/getAnimations.html index ec50df3f..d05e2aa 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/getAnimations.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animatable/getAnimations.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animatable.getAnimations</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animatable-getanimations"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animatable-getanimations"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/cancel.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/cancel.html index a342b2e..be1bb5d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/cancel.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/cancel.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.cancel</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-cancel"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-cancel"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/constructor.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/constructor.html index 6b7978cd..c00c66ea 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/constructor.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/constructor.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation constructor</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-animation"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-animation"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/effect.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/effect.html index 339028e..175fc31 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/effect.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/effect.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.effect</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-effect"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-effect"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finish.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finish.html index c413d04..1f81867 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finish.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finish.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.finish</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-finish"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-finish"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished-expected.txt index 177f2096..32a633f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished-expected.txt
@@ -6,9 +6,8 @@ PASS Finished promise does not resolve when paused PASS Finished promise does not resolve when pause-pending PASS The finished promise is fulfilled with its Animation -PASS finished promise is rejected when an animation is cancelled by calling cancel() -PASS cancelling an already-finished animation replaces the finished promise -FAIL cancelling an idle animation still replaces the finished promise assert_not_equals: A redundant call to cancel() should still generate a new finished promise got disallowed value object "[object Promise]" +PASS finished promise is rejected when an animation is canceled by calling cancel() +PASS canceling an already-finished animation replaces the finished promise FAIL Test finished promise changes for animation duration changes assert_false: shortening of the animation duration should resolve the finished promise expected false got true PASS Test finished promise changes when playbackRate == 0 PASS Test finished promise resolves when reaching to the natural boundary.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html index 7d0aa387..79700f31 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/finished.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.finished</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-finished"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-finished"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script> @@ -163,7 +163,7 @@ animation.cancel(); return retPromise; -}, 'finished promise is rejected when an animation is cancelled by calling ' + +}, 'finished promise is rejected when an animation is canceled by calling ' + 'cancel()'); promise_test(t => { @@ -175,30 +175,9 @@ animation.cancel(); assert_not_equals(animation.finished, previousFinishedPromise, 'A new finished promise should be created when' - + ' cancelling a finished animation'); + + ' canceling a finished animation'); }); -}, 'cancelling an already-finished animation replaces the finished promise'); - -promise_test(t => { - const div = createDiv(t); - const animation = div.animate({}, 100 * MS_PER_SEC); - animation.cancel(); - // The spec says we still create a new finished promise and reject the old - // one even if we're already idle. That behavior might change, but for now - // test that we do that. - const retPromise = animation.finished.catch(err => { - assert_equals(err.name, 'AbortError', - 'finished promise is rejected with AbortError'); - }); - - // Redundant call to cancel(); - const previousFinishedPromise = animation.finished; - animation.cancel(); - assert_not_equals(animation.finished, previousFinishedPromise, - 'A redundant call to cancel() should still generate a new' - + ' finished promise'); - return retPromise; -}, 'cancelling an idle animation still replaces the finished promise'); +}, 'canceling an already-finished animation replaces the finished promise'); promise_test(t => { const div = createDiv(t);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/id.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/id.html index b41076a..5b9586b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/id.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/id.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.id</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-id"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-id"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/idlharness.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/idlharness.html index ef630591..3075146 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/idlharness.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/idlharness.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>Animation IDL</title> -<link rel="help" href="https://w3c.github.io/web-animations/#animation"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#animation"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/oncancel.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/oncancel.html index 5f29dab..3e918a4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/oncancel.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/oncancel.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.oncancel</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-oncancel"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-oncancel"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/onfinish.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/onfinish.html index 0313385..79d1d70 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/onfinish.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/onfinish.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.onfinish</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-onfinish"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-onfinish"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/pause.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/pause.html index 71e30b0..0649c2f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/pause.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/pause.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.pause</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-pause"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-pause"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/pending.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/pending.html index aa53eef..fe7efe0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/pending.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/pending.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.pending</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-pending"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-pending"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/play.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/play.html index d3e0122..3e8f923d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/play.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/play.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.play</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-play"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-play"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/playbackRate.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/playbackRate.html index 4f9bed1..9a3b762 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/playbackRate.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/playbackRate.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.playbackRate</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-playbackrate"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-playbackrate"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/ready.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/ready.html index eb8713d..461c4e95 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/ready.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/ready.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Animation.ready</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animation-ready"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animation-ready"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/startTime.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/startTime.html index fab8534f..61f7695 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/startTime.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Animation/startTime.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>Animation.startTime</title> <link rel="help" -href="https://w3c.github.io/web-animations/#dom-animation-starttime"> +href="https://drafts.csswg.org/web-animations/#dom-animation-starttime"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/delay.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/delay.html index 80149458..41f099b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/delay.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/delay.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.delay</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-delay"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-delay"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/direction.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/direction.html index 2fb300292..7bc315d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/direction.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/direction.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.direction</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-direction"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-direction"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/duration.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/duration.html index 98ddd68..9caa0e36 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/duration.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/duration.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.duration</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-duration"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-duration"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/easing.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/easing.html index 28f8a537..ec2b239 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/easing.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/easing.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.easing</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-easing"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-easing"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay.html index 7b4ceca0..b6793ed 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.endDelay</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-enddelay"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-enddelay"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/fill.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/fill.html index 5686b58..01739478 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/fill.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/fill.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.fill</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-fill"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-fill"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/getComputedTiming.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/getComputedTiming.html index ee0a5e2..9a92880a6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/getComputedTiming.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/getComputedTiming.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.getComputedTiming</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffectreadonly-getcomputedtiming"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffectreadonly-getcomputedtiming"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/idlharness.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/idlharness.html index 866d5bf8ee..7e537d1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/idlharness.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/idlharness.html
@@ -2,9 +2,9 @@ <meta charset=utf-8> <title>AnimationEffectTiming and AnimationEffectTimingReadOnly IDL</title> <link rel="help" - href="https://w3c.github.io/web-animations/#animationeffecttiming"> + href="https://drafts.csswg.org/web-animations/#animationeffecttiming"> <link rel="help" - href="https://w3c.github.io/web-animations/#animationeffecttimingreadonly"> + href="https://drafts.csswg.org/web-animations/#animationeffecttimingreadonly"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart.html index 8ba01a92..5521f1e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.iterationStart</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-iterationstart"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-iterationstart"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/iterations.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/iterations.html index b8192e07..3239062 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/iterations.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationEffectTiming/iterations.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>AnimationEffectTiming.iterations</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-animationeffecttiming-iterations"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-animationeffecttiming-iterations"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationPlaybackEvent/constructor.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationPlaybackEvent/constructor.html index 41cf603..1c40a3f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationPlaybackEvent/constructor.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationPlaybackEvent/constructor.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>AnimationPlaybackEvent constructor</title> <link rel="help" - href="https://w3c.github.io/web-animations/#dom-animationplaybackevent-animationplaybackevent"> + href="https://drafts.csswg.org/web-animations/#dom-animationplaybackevent-animationplaybackevent"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <div id="log"></div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationPlaybackEvent/idlharness.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationPlaybackEvent/idlharness.html index f4e3e8c..0c351738 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationPlaybackEvent/idlharness.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/AnimationPlaybackEvent/idlharness.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>AnimationPlaybackEvent IDL</title> <link rel="help" - href="https://w3c.github.io/web-animations/#animationplaybackevent"> + href="https://drafts.csswg.org/web-animations/#animationplaybackevent"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/getAnimations.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/getAnimations.html index 9533bee..165626de 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/getAnimations.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/getAnimations.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Document.getAnimations</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-document-getanimations"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-document-getanimations"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/timeline.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/timeline.html index a0d7c9f..b8b4d74d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/timeline.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/Document/timeline.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>Document.timeline</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-document-timeline"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-document-timeline"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/DocumentTimeline/constructor.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/DocumentTimeline/constructor.html index 47d353c..e4714be 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/DocumentTimeline/constructor.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/DocumentTimeline/constructor.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>DocumentTimeline constructor tests</title> -<link rel="help" href="https://w3c.github.io/web-animations/#the-documenttimeline-interface"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#the-documenttimeline-interface"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/DocumentTimeline/idlharness.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/DocumentTimeline/idlharness.html index 639aa2e..696f4f7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/DocumentTimeline/idlharness.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/DocumentTimeline/idlharness.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>DocumentTimeline IDL</title> -<link rel="help" href="https://w3c.github.io/web-animations/#documenttimeline"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#documenttimeline"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/composite.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/composite.html index 6447dd2..745f66b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/composite.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/composite.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>KeyframeEffect.composite</title> <link rel="help" - href="https://w3c.github.io/web-animations/#dom-keyframeeffect-composite"> + href="https://drafts.csswg.org/web-animations/#dom-keyframeeffect-composite"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/constructor.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/constructor.html index 41cc396..b257257b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/constructor.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/constructor.html
@@ -2,9 +2,9 @@ <meta charset=utf-8> <title>KeyframeEffect and KeyframeEffectReadOnly constructor</title> <link rel="help" - href="https://w3c.github.io/web-animations/#dom-keyframeeffect-keyframeeffect"> + href="https://drafts.csswg.org/web-animations/#dom-keyframeeffect-keyframeeffect"> <link rel="help" - href="https://w3c.github.io/web-animations/#dom-keyframeeffectreadonly-keyframeeffectreadonly"> + href="https://drafts.csswg.org/web-animations/#dom-keyframeeffectreadonly-keyframeeffectreadonly"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/copy-constructor.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/copy-constructor.html index f6bb45a..c4e8a8e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/copy-constructor.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/copy-constructor.html
@@ -2,9 +2,9 @@ <meta charset=utf-8> <title>KeyframeEffect and KeyframeEffectReadOnly copy constructor</title> <link rel="help" - href="https://w3c.github.io/web-animations/#dom-keyframeeffect-keyframeeffect-source"> + href="https://drafts.csswg.org/web-animations/#dom-keyframeeffect-keyframeeffect-source"> <link rel="help" - href="https://w3c.github.io/web-animations/#dom-keyframeeffectreadonly-keyframeeffectreadonly-source"> + href="https://drafts.csswg.org/web-animations/#dom-keyframeeffectreadonly-keyframeeffectreadonly-source"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/idlharness.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/idlharness.html index c397234..5056a875 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/idlharness.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/idlharness.html
@@ -1,9 +1,9 @@ <!doctype html> <meta charset=utf-8> <title>KeyframeEffect IDL</title> -<link rel="help" href="https://w3c.github.io/web-animations/#keyframeeffect"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#keyframeeffect"> <link rel="help" - href="https://w3c.github.io/web-animations/#keyframeeffectreadonly"> + href="https://drafts.csswg.org/web-animations/#keyframeeffectreadonly"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="/resources/WebIDLParser.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/iterationComposite.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/iterationComposite.html index cab51d0..de2afa7 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/iterationComposite.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/iterationComposite.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>KeyframeEffect.iterationComposite</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-keyframeeffect-iterationcomposite"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-keyframeeffect-iterationcomposite"> <script src=/resources/testharness.js></script> <script src=/resources/testharnessreport.js></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html index b1de5bda..e6c5c2a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Processing a keyframes argument (property access)</title> -<link rel="help" href="https://w3c.github.io/web-animations/#processing-a-keyframes-argument"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#processing-a-keyframes-argument"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html index 13715bc6..8233dc07 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Processing a keyframes argument (easing)</title> -<link rel="help" href="https://w3c.github.io/web-animations/#processing-a-keyframes-argument"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#processing-a-keyframes-argument"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html index 1ea4090b..90ab89d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/setKeyframes.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>KeyframeEffect.setKeyframes</title> -<link rel="help" href="https://w3c.github.io/web-animations/#dom-keyframeeffect-setkeyframes"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#dom-keyframeeffect-setkeyframes"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/target.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/target.html index a00c96c..b8fc05b8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/target.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/interfaces/KeyframeEffect/target.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>KeyframeEffect.target</title> <link rel="help" - href="https://w3c.github.io/web-animations/#dom-keyframeeffect-target"> + href="https://drafts.csswg.org/web-animations/#dom-keyframeeffect-target"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/resources/effect-tests.js b/third_party/WebKit/LayoutTests/external/wpt/web-animations/resources/effect-tests.js index f3f7fc2..8a18ab1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/resources/effect-tests.js +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/resources/effect-tests.js
@@ -28,7 +28,7 @@ const timing = effect.getComputedTiming(); // The following calculations are based on the definitions here: - // https://w3c.github.io/web-animations/#animation-effect-phases-and-states + // https://drafts.csswg.org/web-animations/#animation-effect-phases-and-states const beforeActive = Math.max(Math.min(timing.delay, timing.endTime), 0); const activeAfter = Math.max(Math.min(timing.delay + timing.activeDuration, timing.endTime), 0);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/testcommon.js b/third_party/WebKit/LayoutTests/external/wpt/web-animations/testcommon.js index e2062b4..51b84dd 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/testcommon.js +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/testcommon.js
@@ -14,7 +14,7 @@ // The recommended minimum precision to use for time values[1]. // -// [1] https://w3c.github.io/web-animations/#precision-of-time-values +// [1] https://drafts.csswg.org/web-animations/#precision-of-time-values const TIME_PRECISION = 0.0005; // ms // Allow implementations to substitute an alternative method for comparing @@ -176,6 +176,21 @@ }); } + +// Waits for a requestAnimationFrame callback in the next refresh driver tick. +function waitForNextFrame() { + const timeAtStart = document.timeline.currentTime; + return new Promise(resolve => { + window.requestAnimationFrame(() => { + if (timeAtStart === document.timeline.currentTime) { + window.requestAnimationFrame(resolve); + } else { + resolve(); + } + }); + }); +} + // Returns 'matrix()' or 'matrix3d()' function string generated from an array. function createMatrixFromArray(array) { return (array.length == 16 ? 'matrix3d' : 'matrix') + `(${array.join()})`;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/active-time.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/active-time.html index c5d91fc..3e3b528 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/active-time.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/active-time.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Active time</title> -<link rel="help" href="https://w3c.github.io/web-animations/#calculating-the-active-time"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#calculating-the-active-time"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/current-iteration.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/current-iteration.html index 0ac920d..24464ce 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/current-iteration.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/current-iteration.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Current iteration</title> -<link rel="help" href="https://w3c.github.io/web-animations/#current-iteration"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#current-iteration"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/local-time.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/local-time.html index 54455a1..79437d9f5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/local-time.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/local-time.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Local time</title> -<link rel="help" href="https://w3c.github.io/web-animations/#local-time"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#local-time"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/phases-and-states.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/phases-and-states.html index b3e8f7852..ac3732fe6 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/phases-and-states.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/phases-and-states.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>Phases and states</title> -<link rel="help" href="https://w3c.github.io/web-animations/#animation-effect-phases-and-states"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#animation-effect-phases-and-states"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress.html index 22331f43..3c42f79 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>Simple iteration progress</title> <link rel="help" - href="https://w3c.github.io/web-animations/#simple-iteration-progress"> + href="https://drafts.csswg.org/web-animations/#simple-iteration-progress"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/canceling-an-animation-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/canceling-an-animation-expected.txt index 65372d7..6cf3672 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/canceling-an-animation-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/canceling-an-animation-expected.txt
@@ -4,5 +4,7 @@ PASS A pause-pending ready promise should be rejected when the animation is canceled PASS When an animation is canceled, it should create a resolved Promise PASS The ready promise should be replaced when the animation is canceled +PASS The finished promise should NOT be rejected if the animation is already idle +PASS The cancel event should NOT be fired if the animation is already idle Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/canceling-an-animation.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/canceling-an-animation.html index e4cafc0..6964431 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/canceling-an-animation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/canceling-an-animation.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>Canceling an animation</title> <link rel="help" - href="https://w3c.github.io/web-animations/#canceling-an-animation-section"> + href="https://drafts.csswg.org/web-animations/#canceling-an-animation-section"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script> @@ -58,5 +58,43 @@ assert_not_equals(animation.ready, promise); }, 'The ready promise should be replaced when the animation is canceled'); +promise_test(t => { + const animation = new Animation( + new KeyframeEffect(null, null, { duration: 1000 }), + null + ); + assert_equals(animation.playState, 'idle', + 'The animation should be initially idle'); + + animation.finished.then(t.step_func(() => { + assert_unreached('Finished promise should not resolve'); + }), t.step_func(() => { + assert_unreached('Finished promise should not reject'); + })); + + animation.cancel(); + + return waitForAnimationFrames(3); +}, 'The finished promise should NOT be rejected if the animation is already' + + ' idle'); + +promise_test(t => { + const animation = new Animation( + new KeyframeEffect(null, null, { duration: 1000 }), + null + ); + assert_equals(animation.playState, 'idle', + 'The animation should be initially idle'); + + animation.oncancel = t.step_func(() => { + assert_unreached('Cancel event should not be fired'); + }); + + animation.cancel(); + + return waitForAnimationFrames(3); +}, 'The cancel event should NOT be fired if the animation is already' + + ' idle'); + </script> </body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/current-time.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/current-time.html index 680d8ad9..d2f5075 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/current-time.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/current-time.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Current time</title> -<link rel="help" href="https://w3c.github.io/web-animations/#current-time"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#current-time"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/finishing-an-animation.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/finishing-an-animation.html index 566fb3c1..7fde3c4d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/finishing-an-animation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/finishing-an-animation.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>Finishing an animation</title> <link rel="help" - href="https://w3c.github.io/web-animations/#finishing-an-animation-section"> + href="https://drafts.csswg.org/web-animations/#finishing-an-animation-section"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/pausing-an-animation.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/pausing-an-animation.html index b1614c1..f04ec1a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/pausing-an-animation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/pausing-an-animation.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>Pausing an animation</title> <link rel="help" - href="https://w3c.github.io/web-animations/#pausing-an-animation-section"> + href="https://drafts.csswg.org/web-animations/#pausing-an-animation-section"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/play-states.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/play-states.html index 22d8ff3..49b2638 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/play-states.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/play-states.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Play states</title> -<link rel="help" href="https://w3c.github.io/web-animations/#play-state"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#play-state"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/playing-an-animation.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/playing-an-animation.html index 43e9a6b..2beed47 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/playing-an-animation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/playing-an-animation.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>Playing an animation</title> <link rel="help" - href="https://w3c.github.io/web-animations/#playing-an-animation-section"> + href="https://drafts.csswg.org/web-animations/#playing-an-animation-section"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/reversing-an-animation.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/reversing-an-animation.html index bdae2ad..2d5d4e5d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/reversing-an-animation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/reversing-an-animation.html
@@ -2,7 +2,7 @@ <meta charset=utf-8> <title>Reverse an animation</title> <link rel="help" - href="https://w3c.github.io/web-animations/#reverse-an-animation"> + href="https://drafts.csswg.org/web-animations/#reverse-an-animation"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-animation-start-time.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-animation-start-time.html index 070d5bc..1526be0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-animation-start-time.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-animation-start-time.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Set the animation start time</title> -<link rel="help" href="https://w3c.github.io/web-animations/#set-the-animation-start-time"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#set-the-animation-start-time"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html index c90dc82..b416bda 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Setting the target effect</title> -<link rel='help' href='https://w3c.github.io/web-animations/#setting-the-target-effect'> +<link rel='help' href='https://drafts.csswg.org/web-animations/#setting-the-target-effect'> <script src='/resources/testharness.js'></script> <script src='/resources/testharnessreport.js'></script> <script src='../../testcommon.js'></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation.html index f6a77411..8a44213 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/set-the-timeline-of-an-animation.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Setting the timeline</title> -<link rel="help" href="https://w3c.github.io/web-animations/#setting-the-timeline"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#setting-the-timeline"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/updating-the-finished-state.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/updating-the-finished-state.html index c77c4d7..034cd6ee 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/updating-the-finished-state.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/animations/updating-the-finished-state.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Updating the finished state</title> -<link rel="help" href="https://w3c.github.io/web-animations/#updating-the-finished-state"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#updating-the-finished-state"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script> @@ -41,7 +41,7 @@ const anim = createDiv(t).animate(null, 100 * MS_PER_SEC); return anim.ready.then(() => { anim.currentTime = 200 * MS_PER_SEC; - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_equals(anim.currentTime, 200 * MS_PER_SEC, 'Hold time is set so current time should NOT change'); @@ -63,7 +63,7 @@ const anim = createDiv(t).animate(null, 100 * MS_PER_SEC); return anim.ready.then(() => { anim.currentTime = 100 * MS_PER_SEC; - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_equals(anim.currentTime, 100 * MS_PER_SEC, 'Hold time is set so current time should NOT change'); @@ -96,7 +96,7 @@ anim.play(); return anim.ready.then(() => { anim.currentTime = -100 * MS_PER_SEC; - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_equals(anim.currentTime, -100 * MS_PER_SEC, 'Hold time is set so current time should NOT change'); @@ -113,7 +113,7 @@ anim.play(); return anim.ready.then(() => { anim.currentTime = 0; - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_equals(anim.currentTime, 0 * MS_PER_SEC, 'Hold time is set so current time should NOT change'); @@ -138,7 +138,7 @@ // Then extend the duration so that the hold time is cleared and on // the next tick the current time will increase. anim.effect.timing.duration *= 2; - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_greater_than(anim.currentTime, 100 * MS_PER_SEC, 'Hold time is not set so current time should increase'); @@ -156,7 +156,7 @@ // We can test both by checking that the currentTime is initially // updated and then increases. assert_equals(anim.currentTime, 50 * MS_PER_SEC, 'Start time is updated'); - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_greater_than(anim.currentTime, 50 * MS_PER_SEC, 'Hold time is not set so current time should increase'); @@ -183,7 +183,7 @@ return anim.ready.then(() => { anim.currentTime = 50 * MS_PER_SEC; assert_equals(anim.currentTime, 50 * MS_PER_SEC, 'Start time is updated'); - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_less_than(anim.currentTime, 50 * MS_PER_SEC, 'Hold time is not set so current time should decrease'); @@ -198,7 +198,7 @@ anim.playbackRate = 0; return anim.ready.then(() => { anim.currentTime = -100 * MS_PER_SEC; - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_equals(anim.currentTime, -100 * MS_PER_SEC, 'Hold time should not be cleared so current time should' @@ -213,7 +213,7 @@ anim.playbackRate = 0; return anim.ready.then(() => { anim.currentTime = 50 * MS_PER_SEC; - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_equals(anim.currentTime, 50 * MS_PER_SEC, 'Hold time should not be cleared so current time should' @@ -228,7 +228,7 @@ anim.playbackRate = 0; return anim.ready.then(() => { anim.currentTime = 200 * MS_PER_SEC; - return waitForAnimationFrames(1); + return waitForNextFrame(); }).then(() => { assert_equals(anim.currentTime, 200 * MS_PER_SEC, 'Hold time should not be cleared so current time should'
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/time-transformations/transformed-progress.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/time-transformations/transformed-progress.html index 946babf2..839ebe1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/time-transformations/transformed-progress.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/time-transformations/transformed-progress.html
@@ -1,7 +1,7 @@ <!DOCTYPE html> <meta charset=utf-8> <title>Transformed progress</title> -<link rel="help" href="https://w3c.github.io/web-animations/#calculating-the-transformed-progress"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#calculating-the-transformed-progress"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/timelines/document-timelines.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/timelines/document-timelines.html index 545ec2c..bc3edff1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/timelines/document-timelines.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/timelines/document-timelines.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>Document timelines</title> -<link rel="help" href="https://w3c.github.io/web-animations/#document-timelines"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#document-timelines"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/timelines/timelines.html b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/timelines/timelines.html index 0f7db3f..50bb3ac 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/timelines/timelines.html +++ b/third_party/WebKit/LayoutTests/external/wpt/web-animations/timing-model/timelines/timelines.html
@@ -1,7 +1,7 @@ <!doctype html> <meta charset=utf-8> <title>Timelines</title> -<link rel="help" href="https://w3c.github.io/web-animations/#timelines"> +<link rel="help" href="https://drafts.csswg.org/web-animations/#timelines"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> <script src="../../testcommon.js"></script> @@ -71,4 +71,17 @@ }, 'Timeline time should be the same for all RAF callbacks in an animation' + ' frame'); +async_test(t => { + const div = createDiv(t); + const animation = div.animate(null, 100 * MS_PER_SEC); + + animation.ready.then(t.step_func(() => { + const readyTimelineTime = document.timeline.currentTime; + requestAnimationFrame(t.step_func_done(() => { + assert_equals(readyTimelineTime, document.timeline.currentTime, + 'There should be a microtask checkpoint'); + })); + })); +}, 'Performs a microtask checkpoint after updating timelins'); + </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webaudio/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/webaudio/OWNERS index 53b19d0..a4cc14b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/webaudio/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/webaudio/OWNERS
@@ -1,3 +1,4 @@ # COMPONENT: Blink>WebAudio +# WPT-NOTIFY: true hongchan@chromium.org rtoy@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webrtc/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/webrtc/OWNERS index bb3cc83..ba485b1 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/webrtc/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/webrtc/OWNERS
@@ -1,2 +1,3 @@ # COMPONENT: Blink>WebRTC +# WPT-NOTIFY: true hta@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webstorage/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/webstorage/OWNERS index ceb5270..87788a2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/webstorage/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/webstorage/OWNERS
@@ -1,4 +1,6 @@ # TEAM: storage-dev@chromium.org # COMPONENT: Blink>Storage>DOMStorage +# WPT-NOTIFY: true michaeln@chromium.org jsbell@chromium.org +mek@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/workers/SharedWorkerPerformanceNow.html b/third_party/WebKit/LayoutTests/external/wpt/workers/SharedWorkerPerformanceNow.html new file mode 100644 index 0000000..a784293b3 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/workers/SharedWorkerPerformanceNow.html
@@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html> +<head> +<title>window.performance.now in shared workers</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script> +async_test(function(t) { + const worker = new SharedWorker('support/WorkerSendingPerformanceNow.js'); + worker.port.onmessage = t.step_func(event => { + const results = event.data; + assert_true(results.length == 4); + assert_equals(results[0], 'undefined', + 'workerStart not defined on the Worker object'); + assert_equals(results[1], 'object', 'self.performance is defined'); + assert_equals(results[2], 'function', 'self.performance.now is defined'); + assert_greater_than(results[3], 0, 'Time in the worker should be positive'); + assert_greater_than(window.performance.now(), results[3], 'Time in the worker should be before the current time in the main document'); + setupIframe(); + }); + window.iframeStartTime = 0; + window.test_iframe = function(event) { + const workerTime = event.data[3]; + assert_greater_than(workerTime, window.iframeStartTime, + 'Time since origin time should be greater in the shared worker than the iframe'); + t.done(); + } + function setupIframe() { + const iframe = document.createElement('iframe'); + document.body.appendChild(iframe); + const script = iframe.contentWindow.document.createElement('script'); + script.innerHTML = + 'window.top.iframeStartTime = window.performance.now();' + + 'const worker = new SharedWorker("support/WorkerSendingPerformanceNow.js");' + + 'worker.port.onmessage = function(event) {' + + ' window.top.test_iframe(event);' + + '};' + + 'worker.port.postMessage("");'; + iframe.contentWindow.document.body.appendChild(script); + } + worker.port.postMessage(''); +}, 'performance.now() exists in shared workers and reports reasonable times'); +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/workers/SharedWorker_dataUrl.html b/third_party/WebKit/LayoutTests/external/wpt/workers/SharedWorker_dataUrl.html new file mode 100644 index 0000000..c1dec27 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/workers/SharedWorker_dataUrl.html
@@ -0,0 +1,63 @@ +<!DOCTYPE html> +<title>Shared Worker: Data URL cross-origin checks</title> +<script src="/common/get-host-info.sub.js"></script> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<body> +</body> +<script> + +function dirname(path) { + return path.replace(/\/[^\/]*$/, '/'); +} + +promise_test(t => { + return new Promise(function(resolve) { + let count = 0; + onmessage = e => { + assert_equals(e.data, 1); + if (++count == 2) { + resolve(true); + } + }; + + let iframeA = document.createElement('iframe'); + document.body.appendChild(iframeA); + iframeA.src = get_host_info().HTTP_REMOTE_ORIGIN + + dirname(location.pathname) + + "support/iframe_sw_dataUrl.html"; + + let iframeB = document.createElement('iframe'); + document.body.appendChild(iframeB); + iframeB.src = get_host_info().HTTPS_REMOTE_ORIGIN + + dirname(location.pathname) + + "support/iframe_sw_dataUrl.html"; + }); +}, 'Data URL not shared by cross-origin SharedWorkers'); + +promise_test(t => { + return new Promise(function(resolve) { + let count = 0; + onmessage = e => { + assert_equals(e.data, ++count); + if (count == 2) { + resolve(true); + } + }; + + let iframeA = document.createElement('iframe'); + document.body.appendChild(iframeA); + iframeA.src = get_host_info().HTTP_ORIGIN + + dirname(location.pathname) + + "support/iframe_sw_dataUrl.html"; + + let iframeB = document.createElement('iframe'); + document.body.appendChild(iframeB); + iframeB.src = get_host_info().HTTP_ORIGIN + + dirname(location.pathname) + + "support/iframe_sw_dataUrl.html"; + }); +}, 'Data URLs shared by same-origin SharedWorkers'); + +</script> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/workers/WorkerPerformanceNow.html b/third_party/WebKit/LayoutTests/external/wpt/workers/WorkerPerformanceNow.html new file mode 100644 index 0000000..467dad4 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/workers/WorkerPerformanceNow.html
@@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html> +<head> +<title>performance.now in dedicated workers</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +<script> +async_test(function(t) { + const worker = new Worker('support/WorkerSendingPerformanceNow.js'); + worker.onmessage = t.step_func_done(event => { + const results = event.data; + assert_true(results.length == 4); + assert_equals(results[0], 'undefined', + 'workerStart not defined on the Worker object'); + assert_equals(results[1], 'object', "self.performance is defined"); + assert_equals(results[2], 'function', "self.performance.now is defined"); + assert_greater_than(results[3], 0, "Time in the worker should be positive"); + assert_greater_than(window.performance.now(), results[3], "Time in the worker should be before the current time in the main document"); + }); + worker.postMessage(''); +}, 'performance.now() exists in dedicated workers and reports reasonable times'); +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/workers/support/WorkerSendingPerformanceNow.js b/third_party/WebKit/LayoutTests/external/wpt/workers/support/WorkerSendingPerformanceNow.js new file mode 100644 index 0000000..ac12190e --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/workers/support/WorkerSendingPerformanceNow.js
@@ -0,0 +1,22 @@ +function calcResponse() { + const response = [ + typeof(workerStart), + typeof(performance), + typeof(performance.now), + performance.now() + ]; + return response; +} + +self.onmessage = function(event) { + postMessage(calcResponse()); + self.close(); +} + +self.addEventListener("connect", function(event) { + const port = event.ports[0]; + port.onmessage = function(event) { + port.postMessage(calcResponse()); + port.close(); + }; +});
diff --git a/third_party/WebKit/LayoutTests/external/wpt/workers/support/iframe_sw_dataUrl.html b/third_party/WebKit/LayoutTests/external/wpt/workers/support/iframe_sw_dataUrl.html new file mode 100644 index 0000000..0fb0ec2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/workers/support/iframe_sw_dataUrl.html
@@ -0,0 +1,13 @@ +<!DOCTYPE html> +<title>Iframe for Shared Worker: Data URL cross-origin checks</title> +<body> +<script> + +let worker = new SharedWorker('data:text/javascript,let conns=0; onconnect = e => { e.ports[0].postMessage(++conns); }'); +worker.port.onmessage = e => { + parent.postMessage(e.data, '*'); +} + +</script> +</body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/workers/worker-performance.worker.js b/third_party/WebKit/LayoutTests/external/wpt/workers/worker-performance.worker.js index 88db976..c913b2e 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/workers/worker-performance.worker.js +++ b/third_party/WebKit/LayoutTests/external/wpt/workers/worker-performance.worker.js
@@ -16,6 +16,7 @@ }, "Can use performance.now in workers"); test(function testPerformanceMark () { + while (performance.now() == start) { } performance.mark("mark1"); // Stall the minimum amount of time to ensure the marks are separate var now = performance.now();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/FormData-append.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/FormData-append.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/FormData-append.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/FormData-append.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/README.md b/third_party/WebKit/LayoutTests/external/wpt/xhr/README.md similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/README.md rename to third_party/WebKit/LayoutTests/external/wpt/xhr/README.md
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/XMLHttpRequest-withCredentials.any.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/XMLHttpRequest-withCredentials.any.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/XMLHttpRequest-withCredentials.any.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/XMLHttpRequest-withCredentials.any.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-receive.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-receive.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-receive.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-receive.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-send-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-send-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-send-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-send-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-send.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-send.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-send.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-send.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-stop.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-stop.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-stop.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-stop.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-timeout.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-timeout.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-after-timeout.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-after-timeout.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-done.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-done.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-done.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-done.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-headers-received.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-headers-received.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-headers-received.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-headers-received.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-loading.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-loading.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-loading.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-loading.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-open.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-open.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-open.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-open.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-open.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-open.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-open.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-open.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-open.worker.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-open.worker.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-open.worker.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-open.worker.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-unsent.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-unsent.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-unsent.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-unsent.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-upload-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-upload-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-upload-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-upload-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-upload.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-upload.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-during-upload.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-during-upload.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-abort.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-abort.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-abort.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-abort.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-listeners.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-listeners.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-listeners.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-listeners.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-loadend.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-loadend.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-loadend.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-loadend.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-order-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-order-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-order-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-order-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-order.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-order.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-event-order.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-event-order.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-upload-event-abort.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-upload-event-abort.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-upload-event-abort.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-upload-event-abort.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-upload-event-loadend.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/abort-upload-event-loadend.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/abort-upload-event-loadend.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/abort-upload-event-loadend.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-async-same-origin.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-async-same-origin.htm similarity index 84% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-async-same-origin.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-async-same-origin.htm index 24cc80c..14e999c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-async-same-origin.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-async-same-origin.htm
@@ -33,37 +33,37 @@ // The redirect response passes the access check. async_test(t => { - runTest(t, "/XMLHttpRequest/resources/access-control-basic-allow-star.py", + runTest(t, "/xhr/resources/access-control-basic-allow-star.py", withoutCredentials, succeeds) }, "Request without credentials is redirected to a cross-origin response with Access-Control-Allow-Origin=* (with star)"); // The redirect response fails the access check because credentials were sent. async_test(t => { - runTest(t, "/XMLHttpRequest/resources/access-control-basic-allow-star.py", + runTest(t, "/xhr/resources/access-control-basic-allow-star.py", withCredentials, fails) }, "Request with credentials is redirected to a cross-origin response with Access-Control-Allow-Origin=* (with star)"); // The redirect response passes the access check. async_test(t => { - runTest(t, "/XMLHttpRequest/resources/access-control-basic-allow.py", + runTest(t, "/xhr/resources/access-control-basic-allow.py", withoutCredentials, succeeds) }, "Request without credentials is redirected to a cross-origin response with a specific Access-Control-Allow-Origin"); // The redirect response passes the access check. async_test(t => { - runTest(t, "/XMLHttpRequest/resources/access-control-basic-allow.py", + runTest(t, "/xhr/resources/access-control-basic-allow.py", withCredentials, succeeds) }, "Request with credentials is redirected to a cross-origin response with a specific Access-Control-Allow-Origin"); // forbidding credentials. The redirect response passes the access check. async_test(t => { - runTest(t, "/XMLHttpRequest/resources/access-control-basic-allow-no-credentials.py", + runTest(t, "/xhr/resources/access-control-basic-allow-no-credentials.py", withoutCredentials, succeeds) }, "Request without credentials is redirected to a cross-origin response with a specific Access-Control-Allow-Origin (no credentials)"); // forbidding credentials. The redirect response fails the access check. async_test(t => { - runTest(t, "/XMLHttpRequest/resources/access-control-basic-allow-no-credentials.py", + runTest(t, "/xhr/resources/access-control-basic-allow-no-credentials.py", withCredentials, fails) }, "Request with credentials is redirected to a cross-origin response with a specific Access-Control-Allow-Origin (no credentials)"); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-async.htm similarity index 84% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-async.htm index bf16c3c8..a77846f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects-async.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-async.htm
@@ -11,7 +11,7 @@ function runTest(test, destination, parameters, customHeader, local, expectSuccess) { const xhr = new XMLHttpRequest(); const url = (local ? get_host_info().HTTP_ORIGIN : get_host_info().HTTP_REMOTE_ORIGIN) + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + destination + "&" + parameters; + "/xhr/resources/redirect-cors.py?location=" + destination + "&" + parameters; xhr.open("GET", url, true); @@ -41,21 +41,21 @@ // The redirect response fails the access check because the redirect lacks a CORS header. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", "", + "/xhr/resources/access-control-basic-allow-star.py", "", withoutCustomHeader, remote, fails) }, "Request is redirected without CORS headers to a response with Access-Control-Allow-Origin=*"); // The redirect response passes the access check. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", "allow_origin=true", + "/xhr/resources/access-control-basic-allow-star.py", "allow_origin=true", withoutCustomHeader, remote, succeeds) }, "Request is redirected to a response with Access-Control-Allow-Origin=*"); // The redirect response fails the access check because user info was sent. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN.replace("http://", "http://username:password@") + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", "allow_origin=true", + "/xhr/resources/access-control-basic-allow-star.py", "allow_origin=true", withoutCustomHeader, remote, fails) }, "Request with user info is redirected to a response with Access-Control-Allow-Origin=*"); @@ -67,21 +67,21 @@ // The preflighted redirect response fails the access check because of preflighting. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", + "/xhr/resources/access-control-basic-allow-star.py", "allow_origin=true&redirect_preflight=true", withCustomHeader, remote, fails) }, "Preflighted request is redirected to a response with Access-Control-Allow-Origin=*"); // The preflighted redirect response fails the access check after successful preflighting. async_test(t => { runTest(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow-star.py", + "/xhr/resources/access-control-basic-allow-star.py", "allow_origin=true&allow_header=x-test&redirect_preflight=true", withCustomHeader, remote, fails) }, "Preflighted request is redirected to a response with Access-Control-Allow-Origin=* and header allowed"); // The same-origin redirect response passes the access check. async_test(t => { - runTest(t, get_host_info().HTTP_ORIGIN + "/XMLHttpRequest/resources/pass.txt", + runTest(t, get_host_info().HTTP_ORIGIN + "/xhr/resources/pass.txt", "", withCustomHeader, local, succeeds) }, "Request is redirected to a same-origin resource file"); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-expected.txt new file mode 100644 index 0000000..8e655909 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects-expected.txt
@@ -0,0 +1,9 @@ +This is a testharness.js-based test. +FAIL Local sync redirect to remote origin Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://web-platform.test:8001/xhr/resources/redirect-cors.py?location=http://www1.web-platform.test:8001/xhr/resources/access-control-basic-allow.py'. +PASS Local async redirect to remote origin +FAIL Remote sync redirect to local origin Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://www1.web-platform.test:8001/xhr/resources/redirect-cors.py?location=http://web-platform.test:8001/xhr/resources/access-control-basic-allow.py&allow_origin=true'. +PASS Remote async redirect to local origin +FAIL Remote sync redirect to same remote origin Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://www1.web-platform.test:8001/xhr/resources/redirect-cors.py?location=http://www1.web-platform.test:8001/xhr/resources/access-control-basic-allow.py&allow_origin=true'. +PASS Remote async redirect to same remote origin +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects.htm similarity index 66% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects.htm index dcdf4004..a10bc1f5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-and-redirects.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-and-redirects.htm
@@ -29,31 +29,31 @@ } test(t => { runSync(t, "resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py") + "/xhr/resources/access-control-basic-allow.py") }, "Local sync redirect to remote origin"); async_test(t => { runAsync(t, "resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py") + "/xhr/resources/access-control-basic-allow.py") }, "Local async redirect to remote origin"); test(t => { runSync(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + get_host_info().HTTP_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true") + "/xhr/resources/redirect-cors.py?location=" + get_host_info().HTTP_ORIGIN + + "/xhr/resources/access-control-basic-allow.py&allow_origin=true") }, "Remote sync redirect to local origin"); async_test(t => { runAsync(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + get_host_info().HTTP_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true") + "/xhr/resources/redirect-cors.py?location=" + get_host_info().HTTP_ORIGIN + + "/xhr/resources/access-control-basic-allow.py&allow_origin=true") }, "Remote async redirect to local origin"); test(t => { runSync(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true") + "/xhr/resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + + "/xhr/resources/access-control-basic-allow.py&allow_origin=true") }, "Remote sync redirect to same remote origin"); async_test(t => { runAsync(t, get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py&allow_origin=true") + "/xhr/resources/redirect-cors.py?location=" + get_host_info().HTTP_REMOTE_ORIGIN + + "/xhr/resources/access-control-basic-allow.py&allow_origin=true") }, "Remote async redirect to same remote origin"); </script> </body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-access-control-origin-header-data-url.htm similarity index 91% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-access-control-origin-header-data-url.htm index d73f56b0..0d66ad78 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-access-control-origin-header-data-url.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-access-control-origin-header-data-url.htm
@@ -8,7 +8,7 @@ </head> <body> <script type="text/javascript"> -const url = get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-origin-header.py"; +const url = get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-origin-header.py"; async_test(function(test) { window.addEventListener("message", test.step_func(function(evt) { if (evt.data == "ready") {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-access-control-origin-header.htm similarity index 81% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-access-control-origin-header.htm index 87b7e475..aedd2074 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-access-control-origin-header.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-access-control-origin-header.htm
@@ -10,7 +10,7 @@ async_test(function(test) { const xhr = new XMLHttpRequest; - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-origin-header.py", false); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-origin-header.py", false); xhr.send(); assert_equals(xhr.responseText, "PASS: Cross-domain access allowed.\n" +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-async.htm similarity index 91% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-async.htm index d9e0321..142181e9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-async.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-async.htm
@@ -21,7 +21,7 @@ xhr.onerror = test.unreached_func("FAIL: Network error."); xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-allow.py", true); + "/xhr/resources/access-control-basic-allow.py", true); xhr.send(); }, "Basic async cross-origin XHR request"); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm similarity index 91% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm index 57721aa..e468c82 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method-async.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-non-cors-safelisted-method-async.htm
@@ -18,7 +18,7 @@ xhr.onerror = test.unreached_func("Unexpected error."); xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-put-allow.py"); + "/xhr/resources/access-control-basic-put-allow.py"); xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8"); xhr.send("PASS: PUT data received"); }, "Allow async PUT request");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-non-cors-safelisted-method.htm similarity index 83% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-non-cors-safelisted-method.htm index 08f4111..2612265 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-non-cors-safelisted-method.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-non-cors-safelisted-method.htm
@@ -11,7 +11,7 @@ test(function() { const xhr = new XMLHttpRequest; - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-put-allow.py", false); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-put-allow.py", false); xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm similarity index 75% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm index 5a1e396..306eb02b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-header.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-invalidation-by-header.htm
@@ -20,7 +20,7 @@ firstRequest(); }); - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, true); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/reset-token.py?token=" + uuid, true); xhr.send(); function firstRequest() { @@ -28,7 +28,7 @@ assert_equals(xhr.responseText, "PASS: First PUT request."); secondRequest(); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); xhr.send(); } @@ -38,7 +38,7 @@ test.done(); }); // Send a header not included in the inital cache. - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); xhr.setRequestHeader("x-test", "headerValue"); xhr.send(); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm similarity index 78% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm index 058943e..f8a99a25 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-invalidation-by-method.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-invalidation-by-method.htm
@@ -20,7 +20,7 @@ firstRequest(); }); - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, true); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/reset-token.py?token=" + uuid, true); xhr.send(); function firstRequest() { @@ -28,7 +28,7 @@ assert_equals(xhr.responseText, "PASS: First PUT request."); secondRequest(); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); xhr.send(); } @@ -38,7 +38,7 @@ test.done(); }); // Send a header not included in the inital cache. - xhr.open("XMETHOD", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); + xhr.open("XMETHOD", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-invalidation.py?token=" + uuid, true); xhr.send(); } }, "Preflight cache should be invalidated by changed method");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-timeout.htm similarity index 74% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-timeout.htm index 56702c0..ccd961f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache-timeout.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache-timeout.htm
@@ -20,7 +20,7 @@ firstRequest(); }); - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, true); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/reset-token.py?token=" + uuid, true); xhr.send(); function firstRequest() { @@ -28,7 +28,7 @@ assert_equals(xhr.responseText, "PASS: First PUT request."); step_timeout(secondRequest, 3000); // 3 seconds }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-timeout.py?token=" + uuid, true); xhr.send(); } @@ -37,7 +37,7 @@ assert_equals(xhr.responseText, "PASS: Second OPTIONS request was sent."); test.done(); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache-timeout.py?token=" + uuid, true); xhr.send(); } }, "Preflight cache should be invalidated on timeout");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache.htm similarity index 75% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache.htm index ad38a6b..b8deda4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-preflight-cache.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-preflight-cache.htm
@@ -20,7 +20,7 @@ firstRequest(); }); - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, true); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/reset-token.py?token=" + uuid, true); xhr.send(); function firstRequest() { @@ -28,7 +28,7 @@ assert_equals(xhr.responseText, "PASS: First PUT request."); secondRequest(); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache.py?token=" + uuid, true); xhr.send(); } @@ -36,7 +36,7 @@ xhr.onload = test.step_func_done(function() { assert_equals(xhr.responseText, "PASS: Second PUT request. Preflight worked."); }); - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-preflight-cache.py?token=" + uuid, true); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-preflight-cache.py?token=" + uuid, true); xhr.send(); } }, "Preflight cache should allow second request");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-star.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-star.htm similarity index 80% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-star.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-star.htm index fac25e2..d05222f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow-star.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow-star.htm
@@ -11,7 +11,7 @@ const xhr = new XMLHttpRequest; test(function(test) { - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-allow-star.py", false); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-allow-star.py", false); xhr.send();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow.htm similarity index 80% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow.htm index f7e67bab..61c02ed5 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-allow.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-allow.htm
@@ -11,7 +11,7 @@ test(function() { const xhr = new XMLHttpRequest; - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-allow.py", false); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-allow.py", false); xhr.send();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-cors-safelisted-request-headers.htm similarity index 85% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-cors-safelisted-request-headers.htm index 1d570a3c..20b875b9 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-cors-safelisted-request-headers.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-cors-safelisted-request-headers.htm
@@ -11,7 +11,7 @@ test(function() { const xhr = new XMLHttpRequest; - xhr.open("POST", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-cors-safelisted-request-headers.py", false); + xhr.open("POST", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-cors-safelisted-request-headers.py", false); xhr.setRequestHeader("Accept", "*"); xhr.setRequestHeader("Accept-Language", "ru");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-cors-safelisted-response-headers.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-cors-safelisted-response-headers.htm index c795083..a5c470b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-cors-safelisted-response-headers.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-cors-safelisted-response-headers.htm
@@ -12,7 +12,7 @@ const xhr = new XMLHttpRequest; xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-whitelist-response-headers.py", false); + "/xhr/resources/access-control-basic-whitelist-response-headers.py", false); xhr.send(); assert_not_equals(xhr.getResponseHeader("cache-control"), null);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-denied.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-denied.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-denied.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-denied.htm index 924bdd5..3bcd251 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-denied.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-denied.htm
@@ -8,7 +8,7 @@ </head> <body> <script type="text/javascript"> - const path = "/XMLHttpRequest/resources/access-control-basic-denied.py"; + const path = "/xhr/resources/access-control-basic-denied.py"; test(function() { const xhr = new XMLHttpRequest;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-get-fail-non-simple.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-get-fail-non-simple.htm similarity index 90% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-get-fail-non-simple.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-get-fail-non-simple.htm index ccd9f7c..38f7a34 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-get-fail-non-simple.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-get-fail-non-simple.htm
@@ -12,7 +12,7 @@ const xhr = new XMLHttpRequest; xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-options-not-supported.py", false); + "/xhr/resources/access-control-basic-options-not-supported.py", false); // Non-CORS-safelisted header xhr.setRequestHeader("x-test", "foobar");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-non-cors-safelisted-content-type.htm similarity index 87% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-non-cors-safelisted-content-type.htm index bff0cf56..b1cf9c8a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-non-cors-safelisted-content-type.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-non-cors-safelisted-content-type.htm
@@ -12,14 +12,14 @@ const xhr = new XMLHttpRequest; xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-put-allow.py", false); + "/xhr/resources/access-control-basic-put-allow.py", false); xhr.setRequestHeader("Content-Type", "text/plain"); xhr.send("PASS: PUT data received"); assert_equals(xhr.responseText, "PASS: Cross-domain access allowed.\nPASS: PUT data received"); xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-put-allow.py", false); + "/xhr/resources/access-control-basic-put-allow.py", false); xhr.setRequestHeader("Content-Type", "application/xml"); try {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-post-success-no-content-type.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-post-success-no-content-type.htm similarity index 84% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-post-success-no-content-type.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-post-success-no-content-type.htm index 8785a44..7e7a7d3a 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-post-success-no-content-type.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-post-success-no-content-type.htm
@@ -11,7 +11,7 @@ async_test(function(test) { const xhr = new XMLHttpRequest; - xhr.open("POST", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-basic-options-not-supported.py"); + xhr.open("POST", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-options-not-supported.py"); xhr.onerror = test.unreached_func("Network error.");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-post-with-non-cors-safelisted-content-type.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-post-with-non-cors-safelisted-content-type.htm similarity index 86% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-post-with-non-cors-safelisted-content-type.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-post-with-non-cors-safelisted-content-type.htm index 9867c79..9b3bc54 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-post-with-non-cors-safelisted-content-type.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-post-with-non-cors-safelisted-content-type.htm
@@ -12,7 +12,7 @@ const xhr = new XMLHttpRequest; xhr.open("POST", get_host_info().HTTP_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-options-not-supported.py", false); + "/xhr/resources/access-control-basic-options-not-supported.py", false); xhr.setRequestHeader("Content-Type", "application/xml"); @@ -25,7 +25,7 @@ const xhr = new XMLHttpRequest; xhr.open("POST", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-options-not-supported.py", false); + "/xhr/resources/access-control-basic-options-not-supported.py", false); xhr.setRequestHeader("Content-Type", "application/xml");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-preflight-denied.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-preflight-denied.htm similarity index 93% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-preflight-denied.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-preflight-denied.htm index d02bdf0d..6475186 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-basic-preflight-denied.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-basic-preflight-denied.htm
@@ -23,7 +23,7 @@ xhr.onload = test.unreached_func("Request succeeded unexpectedly"); xhr.open("FOO", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-denied.py"); + "/xhr/resources/access-control-basic-denied.py"); xhr.send(); }); </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-header-denied.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-header-denied.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-header-denied.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-header-denied.htm index 84a60eb..a00cc58 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-header-denied.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-header-denied.htm
@@ -11,7 +11,7 @@ <script type="text/javascript"> const uuid = token(); const url = get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-preflight-denied.py?token=" + uuid; + "/xhr/resources/access-control-preflight-denied.py?token=" + uuid; async_test((test) => { let xhr = new XMLHttpRequest;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-method-denied.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-method-denied.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-method-denied.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-method-denied.htm index eb36110f..a0425a4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-method-denied.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-method-denied.htm
@@ -11,7 +11,7 @@ <script type="text/javascript"> const uuid = token(); const url = get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-preflight-denied.py?token=" + uuid; + "/xhr/resources/access-control-preflight-denied.py?token=" + uuid; async_test((test) => { let xhr = new XMLHttpRequest;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-not-supported.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-not-supported.htm similarity index 91% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-not-supported.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-not-supported.htm index e1607d4..a4dc06d 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-async-not-supported.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-async-not-supported.htm
@@ -11,7 +11,7 @@ <script type="text/javascript"> const uuid = token(); const url = get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-preflight-denied.py?token=" + uuid; + "/xhr/resources/access-control-preflight-denied.py?token=" + uuid; async_test((test) => { let xhr = new XMLHttpRequest;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-credential-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-credential-async.htm similarity index 91% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-credential-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-credential-async.htm index d9ccc1028..ad7117f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-credential-async.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-credential-async.htm
@@ -12,7 +12,7 @@ const xhr = new XMLHttpRequest; xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-auth-basic.py?uid=fooUser", + "/xhr/resources/access-control-auth-basic.py?uid=fooUser", true, "fooUser", "barPass"); xhr.withCredentials = true;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-credential-sync.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-credential-sync.htm similarity index 79% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-credential-sync.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-credential-sync.htm index d0b9901..3844d02 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-credential-sync.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-credential-sync.htm
@@ -11,7 +11,7 @@ test(() => { const xhr = new XMLHttpRequest; - xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-auth-basic.py?uid=fooUser", false, "fooUser", "barPass"); + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-auth-basic.py?uid=fooUser", false, "fooUser", "barPass"); xhr.withCredentials = true;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-headers-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-headers-async.htm similarity index 85% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-headers-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-headers-async.htm index 6e05cfe..ffea72ac 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-headers-async.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-headers-async.htm
@@ -14,12 +14,12 @@ const uuid = token(); xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, false); + "/xhr/resources/reset-token.py?token=" + uuid, false); xhr.send(); xhr = new XMLHttpRequest; xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/no-custom-header-on-preflight.py?token=" + uuid); + "/xhr/resources/no-custom-header-on-preflight.py?token=" + uuid); xhr.setRequestHeader("x-test", "foobar"); xhr.onerror = test.unreached_func("Unexpected error");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-headers-sync.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-headers-sync.htm similarity index 83% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-headers-sync.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-headers-sync.htm index 85fe446c..2ae9fe8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-headers-sync.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-headers-sync.htm
@@ -14,12 +14,12 @@ const uuid = token(); xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/reset-token.py?token=" + uuid, false); + "/xhr/resources/reset-token.py?token=" + uuid, false); xhr.send(); xhr = new XMLHttpRequest; xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/no-custom-header-on-preflight.py?token=" + uuid, false); + "/xhr/resources/no-custom-header-on-preflight.py?token=" + uuid, false); xhr.setRequestHeader("x-test", "foobar"); xhr.send(); assert_equals(xhr.responseText, "PASS");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-header-lowercase.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-header-lowercase.htm similarity index 84% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-header-lowercase.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-header-lowercase.htm index d88cac8..7dc4608f 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-header-lowercase.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-header-lowercase.htm
@@ -11,7 +11,7 @@ async_test(function(test) { const xhr = new XMLHttpRequest; - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-preflight-request-header-lowercase.py"); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-preflight-request-header-lowercase.py"); xhr.setRequestHeader("X-Test", "foobar");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-header-sorted.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-header-sorted.htm similarity index 85% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-header-sorted.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-header-sorted.htm index 2423b80..830e0fb 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-header-sorted.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-header-sorted.htm
@@ -10,7 +10,7 @@ <script> async_test((test) => { const xhr = new XMLHttpRequest(); - const url = get_host_info().HTTP_REMOTE_ORIGIN + '/XMLHttpRequest/resources/access-control-preflight-request-header-sorted.py'; + const url = get_host_info().HTTP_REMOTE_ORIGIN + '/xhr/resources/access-control-preflight-request-header-sorted.py'; xhr.open('GET', url); xhr.setRequestHeader("X-Custom-Test", "foobar"); xhr.setRequestHeader("X-Custom-ua", "foobar");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-headers-origin.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-headers-origin.htm similarity index 90% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-headers-origin.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-headers-origin.htm index 67aeda9e..fc11abc0 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-headers-origin.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-headers-origin.htm
@@ -11,7 +11,7 @@ async_test((test) => { const xhr = new XMLHttpRequest; const url = get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-preflight-request-headers-origin.py"; + "/xhr/resources/access-control-preflight-request-headers-origin.py"; xhr.open("GET", url); xhr.setRequestHeader("x-pass", "PASS");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-301.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-301.htm similarity index 83% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-301.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-301.htm index 669f7db8..62fc480 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-301.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-301.htm
@@ -11,7 +11,7 @@ async_test((test) => { const xhr = new XMLHttpRequest; - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-preflight-request-invalid-status.py?code=301"); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-preflight-request-invalid-status.py?code=301"); xhr.setRequestHeader("x-pass", "pass");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-400.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-400.htm similarity index 83% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-400.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-400.htm index 3852099..9e76d9e13 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-400.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-400.htm
@@ -11,7 +11,7 @@ async_test((test) => { const xhr = new XMLHttpRequest; - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-preflight-request-invalid-status.py?code=400"); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-preflight-request-invalid-status.py?code=400"); xhr.setRequestHeader("x-pass", "pass");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-501.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-501.htm similarity index 83% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-501.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-501.htm index 5f3c5e6..f2ed85b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-invalid-status-501.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-invalid-status-501.htm
@@ -11,7 +11,7 @@ async_test((test) => { const xhr = new XMLHttpRequest; - xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/access-control-preflight-request-invalid-status.py?code=501"); + xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-preflight-request-invalid-status.py?code=501"); xhr.setRequestHeader("x-pass", "pass");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-must-not-contain-cookie.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-must-not-contain-cookie.htm similarity index 87% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-must-not-contain-cookie.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-must-not-contain-cookie.htm index c7cb5cd..6dd8e6db 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-request-must-not-contain-cookie.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-request-must-not-contain-cookie.htm
@@ -13,7 +13,7 @@ const xhr = new XMLHttpRequest; // Delete all preexisting cookies and set a cookie named "foo" xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-cookie.py?cookie_name=foo"); + "/xhr/resources/access-control-cookie.py?cookie_name=foo"); xhr.withCredentials = true; xhr.send(); xhr.onerror = test.unreached_func("Unexpected error."); @@ -27,7 +27,7 @@ const xhr = new XMLHttpRequest; // Request to server-side file fails if cookie is included in preflight xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-preflight-request-must-not-contain-cookie.py"); + "/xhr/resources/access-control-preflight-request-must-not-contain-cookie.py"); xhr.withCredentials = true; xhr.setRequestHeader("X-Proprietary-Header", "foo"); xhr.onerror = test.unreached_func("Unexpected error."); @@ -43,7 +43,7 @@ const xhr = new XMLHttpRequest; // Delete all cookies xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-cookie.py"); + "/xhr/resources/access-control-cookie.py"); xhr.withCredentials = true; xhr.send(); xhr.onerror = test.unreached_func("Unexpected error.");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-header-denied.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-header-denied.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-header-denied.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-header-denied.htm index 422c625e..f400985b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-header-denied.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-header-denied.htm
@@ -11,7 +11,7 @@ <script type="text/javascript"> const uuid = token(); const url = get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-preflight-denied.py?token=" + uuid; + "/xhr/resources/access-control-preflight-denied.py?token=" + uuid; test(() => { let xhr = new XMLHttpRequest;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-method-denied.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-method-denied.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-method-denied.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-method-denied.htm index cd2999a..021f9e37 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-method-denied.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-method-denied.htm
@@ -11,7 +11,7 @@ <script type="text/javascript"> const uuid = token(); const url = get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-preflight-denied.py?token=" + uuid; + "/xhr/resources/access-control-preflight-denied.py?token=" + uuid; test(() => { let xhr = new XMLHttpRequest;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-not-supported.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-not-supported.htm similarity index 91% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-not-supported.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-not-supported.htm index a0b079e0..c5ff94bc 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-preflight-sync-not-supported.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-preflight-sync-not-supported.htm
@@ -11,7 +11,7 @@ <script type="text/javascript"> const uuid = token(); const url = get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-preflight-denied.py?token=" + uuid; + "/xhr/resources/access-control-preflight-denied.py?token=" + uuid; test(() => { let xhr = new XMLHttpRequest;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-recursive-failed-request.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-recursive-failed-request.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-recursive-failed-request.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-recursive-failed-request.htm index e29a34a6..2c2bcef4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-recursive-failed-request.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-recursive-failed-request.htm
@@ -27,7 +27,7 @@ }); xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-basic-denied.py"); + "/xhr/resources/access-control-basic-denied.py"); xhr.send(); }
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-body-sync.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-body-sync.htm similarity index 90% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-body-sync.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-body-sync.htm index 559b7d21..d4c90ae 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-body-sync.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-body-sync.htm
@@ -12,7 +12,7 @@ const xhr = new XMLHttpRequest; xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN+ - "/XMLHttpRequest/resources/access-control-allow-with-body.py", false); + "/xhr/resources/access-control-allow-with-body.py", false); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhr.send();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-body.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-body.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-body.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-body.htm index ab89cef..3ab0521 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-body.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-body.htm
@@ -19,7 +19,7 @@ }); xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/access-control-allow-with-body.py"); + "/xhr/resources/access-control-allow-with-body.py"); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhr.send();
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-exposed-headers.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-exposed-headers.htm similarity index 95% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-exposed-headers.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-exposed-headers.htm index 23cd0fb..c6f7bf5c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-response-with-exposed-headers.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-response-with-exposed-headers.htm
@@ -12,7 +12,7 @@ const xhr = new XMLHttpRequest; xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + - "/XMLHttpRequest/resources/pass.txt?pipe=" + + "/xhr/resources/pass.txt?pipe=" + "header(Cache-Control,no-cache)|" + "header(Access-Control-Max-Age,0)|" + "header(Access-Control-Allow-Origin,*)|" +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-allow-origin-null.htm similarity index 85% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-allow-origin-null.htm index 5c647df..ae966683 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-allow-origin-null.htm
@@ -13,7 +13,7 @@ if (evt.data === "ready") { document.getElementById("frame").contentWindow.postMessage( get_host_info().HTTP_ORIGIN + - "/XMLHttpRequest/resources/pass.txt?pipe=" + + "/xhr/resources/pass.txt?pipe=" + "header(Cache-Control,no-store)|" + "header(Content-Type,text/plain)|" + "header(Access-Control-Allow-Credentials,true)|" + @@ -26,7 +26,7 @@ }), false); }); </script> - <iframe id="frame" sandbox="allow-scripts" src="/XMLHttpRequest/resources/access-control-sandboxed-iframe.html"> + <iframe id="frame" sandbox="allow-scripts" src="/xhr/resources/access-control-sandboxed-iframe.html"> </iframe> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-allow.htm similarity index 85% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-allow.htm index 21413f3..a3dbed4 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-allow.htm
@@ -13,7 +13,7 @@ if (evt.data === "ready") { document.getElementById("frame").contentWindow.postMessage( get_host_info().HTTP_ORIGIN + - "/XMLHttpRequest/resources/pass.txt?pipe=" + + "/xhr/resources/pass.txt?pipe=" + "header(Cache-Control,no-store)|" + "header(Content-Type,text/plain)|" + "header(Access-Control-Allow-Credentials,true)|" + @@ -26,7 +26,7 @@ }), false); }); </script> - <iframe id="frame" sandbox="allow-scripts" src="/XMLHttpRequest/resources/access-control-sandboxed-iframe.html"> + <iframe id="frame" sandbox="allow-scripts" src="/xhr/resources/access-control-sandboxed-iframe.html"> </iframe> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied-without-wildcard.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-denied-without-wildcard.htm similarity index 89% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied-without-wildcard.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-denied-without-wildcard.htm index 7c375f60..a703a922 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied-without-wildcard.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-denied-without-wildcard.htm
@@ -8,7 +8,7 @@ </head> <body> <script type="text/javascript"> -const path = "/XMLHttpRequest/resources/pass.txt?pipe=" + +const path = "/xhr/resources/pass.txt?pipe=" + "header(Cache-Control,no-store)|" + "header(Content-Type,text/plain)" + "header(Access-Control-Allow-Credentials,true)|" + @@ -37,7 +37,7 @@ }), false); }, "Sandboxed iframe is denied CORS access to server that allows parent origin"); </script> - <iframe id="frame" sandbox="allow-scripts" src="/XMLHttpRequest/resources/access-control-sandboxed-iframe.html"> + <iframe id="frame" sandbox="allow-scripts" src="/xhr/resources/access-control-sandboxed-iframe.html"> </iframe> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-denied.htm similarity index 87% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-denied.htm index a87dd7d1..5b62991 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/access-control-sandboxed-iframe-denied.htm
@@ -8,7 +8,7 @@ </head> <body> <script type="text/javascript"> -const path = "/XMLHttpRequest/resources/pass.txt?pipe=" + +const path = "/xhr/resources/pass.txt?pipe=" + "header(Cache-Control,no-store)|" + "header(Content-Type,text/plain)"; @@ -35,7 +35,7 @@ }), false); }, "Sandboxed iframe is denied access to path"); </script> - <iframe id="frame" sandbox="allow-scripts" src="/XMLHttpRequest/resources/access-control-sandboxed-iframe.html"> + <iframe id="frame" sandbox="allow-scripts" src="/xhr/resources/access-control-sandboxed-iframe.html"> </iframe> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/allow-lists-starting-with-comma.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/allow-lists-starting-with-comma.htm similarity index 84% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/allow-lists-starting-with-comma.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/allow-lists-starting-with-comma.htm index 4a4e5e2..ece699b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/allow-lists-starting-with-comma.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/allow-lists-starting-with-comma.htm
@@ -10,7 +10,7 @@ <script type="text/javascript"> async_test(function(test) { const client = new XMLHttpRequest(); - let url = "XMLHttpRequest/resources/access-control-allow-lists.py?headers=,y-lol,x-print,%20,,,y-print&origin=" + + let url = "xhr/resources/access-control-allow-lists.py?headers=,y-lol,x-print,%20,,,y-print&origin=" + get_host_info().HTTP_ORIGIN; client.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + '/' + url, false); client.setRequestHeader('x-print', 'unicorn') @@ -21,7 +21,7 @@ assert_equals(response['x-print'], "unicorn"); assert_equals(response['y-print'], "narwhal"); - url = "XMLHttpRequest/resources/access-control-allow-lists.py?methods=,,PUT,GET&origin=" + + url = "xhr/resources/access-control-allow-lists.py?methods=,,PUT,GET&origin=" + get_host_info().HTTP_ORIGIN; client.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + '/' + url, false); // Sending PUT request
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/anonymous-mode-unsupported.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/anonymous-mode-unsupported.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/anonymous-mode-unsupported.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/anonymous-mode-unsupported.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/data-uri-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/data-uri-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/data-uri-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/data-uri-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/data-uri.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/data-uri.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/data-uri.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/data-uri.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-abort.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-abort.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-abort.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-abort.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-error-order.sub-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-error-order.sub-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-error-order.sub-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-error-order.sub-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-error-order.sub.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-error-order.sub.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-error-order.sub.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-error-order.sub.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-error.sub.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-error.sub.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-error.sub.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-error.sub.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-load.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-load.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-load.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-load.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-loadend.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-loadend.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-loadend.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-loadend.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-loadstart-upload-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-loadstart-upload-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-loadstart-upload-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-loadstart-upload-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-loadstart-upload.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-loadstart-upload.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-loadstart-upload.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-loadstart-upload.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-loadstart.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-loadstart.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-loadstart.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-loadstart.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-progress.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-progress.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-progress.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-progress.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-readystate-sync-open.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-readystate-sync-open.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-readystate-sync-open.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-readystate-sync-open.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-readystatechange-loaded.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-readystatechange-loaded.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-readystatechange-loaded.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-readystatechange-loaded.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-timeout-order-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-timeout-order-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-timeout-order-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-timeout-order-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-timeout-order.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-timeout-order.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-timeout-order.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-timeout-order.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-timeout.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-timeout.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-timeout.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-timeout.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/xhr/event-upload-progress-crossorigin-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-upload-progress-crossorigin-expected.txt new file mode 100644 index 0000000..3fba2d6aa --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-upload-progress-crossorigin-expected.txt
@@ -0,0 +1,7 @@ +This is a testharness.js-based test. +PASS Upload events registered on time (http://www1.web-platform.test:8001/xhr/resources/corsenabled.py) +FAIL Upload events registered on time (resources/redirect.py?code=307&location=http://www1.web-platform.test:8001/xhr/resources/corsenabled.py) assert_unreached: Reached unreachable code +PASS Upload events registered too late (http://www1.web-platform.test:8001/xhr/resources/corsenabled.py) +PASS Upload events registered too late (resources/redirect.py?code=307&location=http://www1.web-platform.test:8001/xhr/resources/corsenabled.py) +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-upload-progress-crossorigin.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-upload-progress-crossorigin.htm similarity index 92% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-upload-progress-crossorigin.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-upload-progress-crossorigin.htm index 293f7bf..5e558a2 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-upload-progress-crossorigin.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-upload-progress-crossorigin.htm
@@ -7,7 +7,7 @@ <script src="/common/get-host-info.sub.js"></script> <div id="log"></div> <script> -const remote = get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/corsenabled.py", +const remote = get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/corsenabled.py", redirect = "resources/redirect.py?code=307&location=" + remote; [remote, redirect].forEach(url => {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-upload-progress.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/event-upload-progress.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/event-upload-progress.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/event-upload-progress.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/firing-events-http-content-length.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/firing-events-http-content-length.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/firing-events-http-content-length.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/firing-events-http-content-length.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/firing-events-http-no-content-length.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/firing-events-http-no-content-length.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/firing-events-http-no-content-length.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/firing-events-http-no-content-length.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/folder.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/folder.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/folder.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/folder.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-blob.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-blob.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-blob.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-blob.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-delete.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-delete.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-delete.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-delete.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-foreach.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-foreach.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-foreach.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-foreach.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-get.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-get.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-get.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-get.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-has.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-has.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-has.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-has.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-set.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-set.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata-set.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/formdata-set.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/formdata.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/formdata.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/formdata.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getallresponseheaders-cookies.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getallresponseheaders-cookies.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getallresponseheaders-cookies.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getallresponseheaders-cookies.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getallresponseheaders-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/getallresponseheaders-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getallresponseheaders-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getallresponseheaders-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getallresponseheaders-status.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getallresponseheaders-status.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getallresponseheaders-status.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getallresponseheaders-status.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getallresponseheaders.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getallresponseheaders.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getallresponseheaders.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getallresponseheaders.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-case-insensitive.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-case-insensitive.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-case-insensitive.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-case-insensitive.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-chunked-trailer.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-chunked-trailer.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-chunked-trailer.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-chunked-trailer.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-cookies-and-more.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-cookies-and-more.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-cookies-and-more.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-cookies-and-more.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-error-state.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-error-state.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-error-state.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-error-state.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-server-date.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-server-date.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-server-date.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-server-date.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-special-characters.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-special-characters.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-special-characters.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-special-characters.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-unsent-opened-state.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-unsent-opened-state.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/getresponseheader-unsent-opened-state.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/getresponseheader-unsent-opened-state.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/headers-normalize-response-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/headers-normalize-response-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/headers-normalize-response-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/headers-normalize-response-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/headers-normalize-response.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/headers-normalize-response.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/headers-normalize-response.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/headers-normalize-response.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/historical.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/historical.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/historical.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/historical.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/interfaces.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/interfaces.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/interfaces.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/interfaces.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/loadstart-and-state.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/loadstart-and-state.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/loadstart-and-state.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/loadstart-and-state.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/no-utf16-json-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/no-utf16-json-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/no-utf16-json-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/no-utf16-json-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/no-utf16-json.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/no-utf16-json.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/no-utf16-json.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/no-utf16-json.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-after-abort.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-after-abort.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-after-abort.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-after-abort.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-after-setrequestheader.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-after-setrequestheader.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-after-setrequestheader.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-after-setrequestheader.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-during-abort-event.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-during-abort-event.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-during-abort-event.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-during-abort-event.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-during-abort-processing.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-during-abort-processing.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-during-abort-processing.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-during-abort-processing.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-during-abort.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-during-abort.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-during-abort.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-during-abort.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-bogus.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-bogus.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-bogus.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-bogus.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-case-insensitive.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-case-insensitive.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-case-insensitive.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-case-insensitive.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-case-sensitive.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-case-sensitive.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-case-sensitive.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-case-sensitive.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-insecure.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-insecure.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-insecure.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-insecure.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-responsetype-set-sync.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-responsetype-set-sync.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-method-responsetype-set-sync.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-method-responsetype-set-sync.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-open-send.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-open-send.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-open-send.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-open-send.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-open-sync-send.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-open-sync-send.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-open-sync-send.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-open-sync-send.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-referer.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-referer.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-referer.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-referer.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-send-during-abort.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-send-during-abort.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-send-during-abort.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-send-during-abort.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-send-open.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-send-open.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-send-open.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-send-open.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-sync-open-send.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-sync-open-send.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-sync-open-send.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-sync-open-send.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-about-blank-window.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-about-blank-window.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-about-blank-window.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-about-blank-window.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-base-inserted-after-open.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-base-inserted-after-open.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-base-inserted-after-open.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-base-inserted-after-open.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-base-inserted.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-base-inserted.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-base-inserted.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-base-inserted.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-base.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-base.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-base.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-base.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-encoding.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-encoding.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-encoding.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-encoding.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-fragment.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-fragment.htm similarity index 82% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-fragment.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-fragment.htm index 6b3fdeb..03f4016 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-fragment.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-fragment.htm
@@ -19,19 +19,19 @@ var client = new XMLHttpRequest() client.open("GET", "resources/requri.py#foobar", false) client.send(null) - assert_regexp_match(client.responseText, /XMLHttpRequest\/resources\/requri\.py$/) + assert_regexp_match(client.responseText, /xhr\/resources\/requri\.py$/) }, 'make sure fragment is removed from URL before request') test(function() { var client = new XMLHttpRequest() client.open("GET", "resources/requri.py?help=#foobar", false) client.send(null) - assert_regexp_match(client.responseText, /XMLHttpRequest\/resources\/requri\.py\?help=$/) + assert_regexp_match(client.responseText, /xhr\/resources\/requri\.py\?help=$/) }, 'make sure fragment is removed from URL before request (with query string)') test(function() { var client = new XMLHttpRequest() client.open("GET", "resources/requri.py?" +encodeURIComponent("#foobar"), false) client.send(null) - assert_regexp_match(client.responseText, /XMLHttpRequest\/resources\/requri\.py\?%23foobar$/) + assert_regexp_match(client.responseText, /xhr\/resources\/requri\.py\?%23foobar$/) }, 'make sure escaped # is not removed') </script> </body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-javascript-window-2.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-javascript-window-2.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-javascript-window-2.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-javascript-window-2.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-javascript-window.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-javascript-window.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-javascript-window.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-javascript-window.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-2-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-2-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-2-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-2-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-2.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-2.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-2.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-2.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-3-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-3-expected.txt similarity index 70% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-3-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-3-expected.txt index 8d1ee5d..0bd5647 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-3-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-3-expected.txt
@@ -1,6 +1,6 @@ This is a testharness.js-based test. FAIL XMLHttpRequest: open() resolving URLs (multi-Window; 3; evil) assert_throws: send() when associated document's IFRAME is removed function "function () { client.send(null) - }" threw object "NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://web-platform.test:8001/XMLHttpRequest/resources/folder.txt': Document is already detached." that is not a DOMException InvalidStateError: property "code" is equal to 19, expected 11 + }" threw object "NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://web-platform.test:8001/xhr/resources/folder.txt': Document is already detached." that is not a DOMException InvalidStateError: property "code" is equal to 19, expected 11 Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-3.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-3.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-3.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-3.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-4-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-4-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-4-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-4-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-4.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-4.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-4.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-4.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-5-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-5-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-5-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-5-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-5.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-5.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-5.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-5.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-6-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-6-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-6-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-6-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-6.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-6.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window-6.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window-6.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-multi-window.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-multi-window.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-redirected-worker-origin.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-redirected-worker-origin.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-redirected-worker-origin.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-redirected-worker-origin.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-worker-origin.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-worker-origin.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-worker-origin.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-worker-origin.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-worker-simple.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-worker-simple.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-url-worker-simple.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-url-worker-simple.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-user-password-non-same-origin.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/open-user-password-non-same-origin.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/open-user-password-non-same-origin.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/open-user-password-non-same-origin.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-blob.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-blob.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-blob.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-blob.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-done-state.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-done-state.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-done-state.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-done-state.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-headers-received-state-force-shiftjis.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-headers-received-state-force-shiftjis.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-headers-received-state-force-shiftjis.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-invalid-mime-type.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-invalid-mime-type.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-invalid-mime-type.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-invalid-mime-type.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-loading-state.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-loading-state.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-loading-state.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-loading-state.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-open-state-force-utf-8.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-open-state-force-utf-8.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-open-state-force-utf-8.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-open-state-force-utf-8.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-open-state-force-xml.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-open-state-force-xml.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-open-state-force-xml.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-open-state-force-xml.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-unsent-state-force-shiftjis.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-unsent-state-force-shiftjis.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/overridemimetype-unsent-state-force-shiftjis.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/overridemimetype-unsent-state-force-shiftjis.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/preserve-ua-header-on-redirect.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/preserve-ua-header-on-redirect.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/preserve-ua-header-on-redirect.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/preserve-ua-header-on-redirect.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/progress-events-response-data-gzip.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/progress-events-response-data-gzip.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/progress-events-response-data-gzip.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/progress-events-response-data-gzip.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/progressevent-constructor.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/progressevent-constructor.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/progressevent-constructor.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/progressevent-constructor.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/progressevent-interface.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/progressevent-interface.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/progressevent-interface.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/progressevent-interface.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/accept-language.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/accept-language.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/accept-language.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/accept-language.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/accept.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/accept.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/accept.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/accept.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-allow-lists.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-allow-lists.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-allow-lists.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-allow-lists.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-allow-with-body.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-allow-with-body.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-allow-with-body.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-allow-with-body.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-auth-basic.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-auth-basic.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-auth-basic.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-auth-basic.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-allow-no-credentials.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-allow-no-credentials.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-allow-no-credentials.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-allow-no-credentials.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-allow-star.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-allow-star.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-allow-star.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-allow-star.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-allow.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-allow.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-allow.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-allow.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-cors-safelisted-request-headers.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-cors-safelisted-request-headers.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-cors-safelisted-request-headers.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-cors-safelisted-request-headers.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-denied.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-denied.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-denied.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-denied.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-options-not-supported.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-options-not-supported.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-options-not-supported.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-options-not-supported.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-preflight-cache-invalidation.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-preflight-cache-invalidation.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-preflight-cache-invalidation.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-preflight-cache-timeout.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-preflight-cache-timeout.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-preflight-cache-timeout.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-preflight-cache.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-preflight-cache.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-preflight-cache.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-preflight-cache.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-put-allow.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-put-allow.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-put-allow.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-put-allow.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-whitelist-response-headers.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-whitelist-response-headers.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-basic-whitelist-response-headers.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-basic-whitelist-response-headers.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-cookie.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-cookie.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-cookie.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-cookie.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-origin-header.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-origin-header.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-origin-header.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-origin-header.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-denied.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-denied.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-denied.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-denied.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-header-lowercase.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-header-lowercase.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-header-lowercase.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-header-lowercase.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-header-sorted.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-header-sorted.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-header-sorted.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-header-sorted.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-headers-origin.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-headers-origin.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-headers-origin.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-headers-origin.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-invalid-status.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-invalid-status.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-invalid-status.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-invalid-status.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-must-not-contain-cookie.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-must-not-contain-cookie.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-preflight-request-must-not-contain-cookie.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-preflight-request-must-not-contain-cookie.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-sandboxed-iframe.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-sandboxed-iframe.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/access-control-sandboxed-iframe.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/access-control-sandboxed-iframe.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth1/auth.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth1/auth.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth1/auth.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth1/auth.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth2/auth.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth2/auth.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth2/auth.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth2/auth.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth2/corsenabled.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth2/corsenabled.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth2/corsenabled.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth2/corsenabled.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth3/auth.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth3/auth.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth3/auth.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth3/auth.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth4/auth.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth4/auth.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth4/auth.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth4/auth.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth5/auth.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth5/auth.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth5/auth.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth5/auth.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth6/auth.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth6/auth.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth6/auth.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth6/auth.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth7/corsenabled.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth7/corsenabled.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth7/corsenabled.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth7/corsenabled.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth8/corsenabled-no-authorize.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth8/corsenabled-no-authorize.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth8/corsenabled-no-authorize.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth8/corsenabled-no-authorize.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth9/auth.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth9/auth.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/auth9/auth.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/auth9/auth.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/authentication.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/authentication.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/authentication.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/authentication.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/base.xml b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/base.xml similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/base.xml rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/base.xml
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/chunked.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/chunked.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/chunked.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/chunked.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/conditional.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/conditional.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/conditional.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/conditional.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/content.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/content.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/content.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/content.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/corsenabled.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/corsenabled.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/corsenabled.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/corsenabled.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/delay.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/delay.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/delay.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/delay.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/echo-headers.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/echo-headers.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/echo-headers.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/echo-headers.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/echo-method.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/echo-method.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/echo-method.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/echo-method.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/empty-div-utf8-html.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/empty-div-utf8-html.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/empty-div-utf8-html.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/empty-div-utf8-html.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/folder.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/folder.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/folder.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/folder.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/form.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/form.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/form.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/form.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/gzip.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/gzip.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/gzip.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/gzip.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/header-content-length.asis b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/header-content-length.asis similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/header-content-length.asis rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/header-content-length.asis
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/headers-basic.asis b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/headers-basic.asis similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/headers-basic.asis rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/headers-basic.asis
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/headers.asis b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/headers.asis similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/headers.asis rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/headers.asis
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/headers.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/headers.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/headers.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/headers.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/image.gif b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/image.gif similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/image.gif rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/image.gif Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/img-utf8-html.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/img-utf8-html.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/img-utf8-html.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/img-utf8-html.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/img.jpg b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/img.jpg similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/img.jpg rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/img.jpg Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/infinite-redirects.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/infinite-redirects.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/infinite-redirects.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/infinite-redirects.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/init.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/init.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/init.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/init.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/inspect-headers.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/inspect-headers.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/inspect-headers.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/inspect-headers.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/invalid-utf8-html.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/invalid-utf8-html.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/invalid-utf8-html.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/invalid-utf8-html.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/last-modified.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/last-modified.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/last-modified.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/last-modified.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/no-custom-header-on-preflight.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/no-custom-header-on-preflight.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/no-custom-header-on-preflight.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/no-custom-header-on-preflight.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/nocors/folder.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/nocors/folder.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/nocors/folder.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/nocors/folder.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/parse-headers.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/parse-headers.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/parse-headers.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/parse-headers.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/pass.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/pass.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/pass.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/pass.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/redirect-cors.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/redirect-cors.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/redirect-cors.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/redirect-cors.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/redirect.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/redirect.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/redirect.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/redirect.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/requri.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/requri.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/requri.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/requri.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/reset-token.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/reset-token.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/reset-token.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/reset-token.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/responseType-document-in-worker.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/responseType-document-in-worker.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/responseType-document-in-worker.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/responseType-document-in-worker.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/responseXML-unavailable-in-worker.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/responseXML-unavailable-in-worker.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/responseXML-unavailable-in-worker.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/responseXML-unavailable-in-worker.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/send-after-setting-document-domain-window-1.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/send-after-setting-document-domain-window-1.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/send-after-setting-document-domain-window-1.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/send-after-setting-document-domain-window-1.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/send-after-setting-document-domain-window-2.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/send-after-setting-document-domain-window-2.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/send-after-setting-document-domain-window-2.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/send-after-setting-document-domain-window-2.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/send-after-setting-document-domain-window-helper.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/send-after-setting-document-domain-window-helper.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/send-after-setting-document-domain-window-helper.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/send-after-setting-document-domain-window-helper.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/shift-jis-html.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/shift-jis-html.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/shift-jis-html.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/shift-jis-html.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/status.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/status.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/status.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/status.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/trickle.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/trickle.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/trickle.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/trickle.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/upload.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/upload.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/upload.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/upload.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/utf16-bom.json b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/utf16-bom.json similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/utf16-bom.json rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/utf16-bom.json Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/utf16.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/utf16.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/utf16.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/utf16.txt Binary files differ
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/well-formed.xml b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/well-formed.xml similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/well-formed.xml rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/well-formed.xml
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/win-1252-html.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/win-1252-html.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/win-1252-html.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/win-1252-html.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/win-1252-xml.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/win-1252-xml.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/win-1252-xml.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/win-1252-xml.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/workerxhr-origin-referrer.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/workerxhr-origin-referrer.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/workerxhr-origin-referrer.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/workerxhr-origin-referrer.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/workerxhr-simple.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/workerxhr-simple.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/workerxhr-simple.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/workerxhr-simple.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-event-order.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-event-order.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-event-order.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-event-order.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-aborted.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-aborted.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-aborted.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-aborted.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-abortedonmain.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-abortedonmain.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-abortedonmain.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-abortedonmain.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-overrides.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-overrides.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-overrides.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-overrides.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-overridesexpires.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-overridesexpires.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-overridesexpires.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-overridesexpires.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-runner.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-runner.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-runner.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-runner.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-simple.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-simple.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-simple.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-synconmain.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-synconmain.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-synconmain.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-synconworker.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-synconworker.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-synconworker.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-twice.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout-twice.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout-twice.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/xmlhttprequest-timeout.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/xmlhttprequest-timeout.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/zlib.py b/third_party/WebKit/LayoutTests/external/wpt/xhr/resources/zlib.py similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/resources/zlib.py rename to third_party/WebKit/LayoutTests/external/wpt/xhr/resources/zlib.py
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-arraybuffer.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-arraybuffer.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-arraybuffer.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-arraybuffer.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-blob.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-blob.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-blob.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-blob.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-deflate.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-deflate.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-deflate.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-deflate.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-gzip.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-gzip.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-gzip.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-gzip.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-progress-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-progress-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-progress-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-progress-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-progress.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-progress.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-data-progress.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-data-progress.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-invalid-responsetype.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-invalid-responsetype.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-invalid-responsetype.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-invalid-responsetype.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-json-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-json-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-json-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-json-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-json.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-json.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-json.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-json.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-method.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/response-method.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/response-method.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/response-method.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseText-status.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/responseText-status.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseText-status.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responseText-status.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseType-document-in-worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/responseType-document-in-worker-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseType-document-in-worker-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responseType-document-in-worker-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseType-document-in-worker.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/responseType-document-in-worker.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseType-document-in-worker.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responseType-document-in-worker.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseXML-unavailable-in-worker-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/responseXML-unavailable-in-worker-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseXML-unavailable-in-worker-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responseXML-unavailable-in-worker-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseXML-unavailable-in-worker.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/responseXML-unavailable-in-worker.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseXML-unavailable-in-worker.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responseXML-unavailable-in-worker.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsedocument-decoding.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsedocument-decoding.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsedocument-decoding.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsedocument-decoding.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsetext-decoding.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsetext-decoding.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsetext-decoding.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsetext-decoding.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsetype.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsetype.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsetype.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsetype.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseurl.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/responseurl.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responseurl.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responseurl.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-basic.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-basic.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-basic.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-basic.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-document-properties.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-document-properties.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-document-properties.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-document-properties.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-get-twice.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-get-twice.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-get-twice.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-get-twice.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-media-type-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-media-type-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-media-type-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-media-type-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-media-type.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-media-type.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-media-type.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-media-type.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-non-document-types.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-non-document-types.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-non-document-types.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-non-document-types.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-non-well-formed.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-non-well-formed.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/responsexml-non-well-formed.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/responsexml-non-well-formed.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/security-consideration.sub-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/security-consideration.sub-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/security-consideration.sub-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/security-consideration.sub-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/security-consideration.sub.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/security-consideration.sub.html similarity index 93% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/security-consideration.sub.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/security-consideration.sub.html index 5eb7110..a364e2c 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/security-consideration.sub.html +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/security-consideration.sub.html
@@ -28,7 +28,7 @@ assert_equals(pe.total, 0, "total is zero."); this.done(); }); - xhr.open("GET", "http://{{host}}:{{ports[http][1]}}/XMLHttpRequest/resources/img.jpg", true); + xhr.open("GET", "http://{{host}}:{{ports[http][1]}}/xhr/resources/img.jpg", true); xhr.send(null); }) </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-accept-language.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-accept-language.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-accept-language.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-accept-language.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-accept.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-accept.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-accept.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-accept.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-after-setting-document-domain.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-after-setting-document-domain.htm similarity index 97% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-after-setting-document-domain.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-after-setting-document-domain.htm index 30b6c71..49eeb95 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-after-setting-document-domain.htm +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-after-setting-document-domain.htm
@@ -9,7 +9,7 @@ <body> <div id="log"></div> <script> - var test_base_url = location.protocol+'//www2.'+location.host+"/XMLHttpRequest/resources/", + var test_base_url = location.protocol+'//www2.'+location.host+"/xhr/resources/", test_windows = [ window.open(test_base_url + "send-after-setting-document-domain-window-1.htm"), window.open(test_base_url + "send-after-setting-document-domain-window-2.htm"),
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-cors-not-enabled.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-cors-not-enabled.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-cors-not-enabled.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-cors.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-cors.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-cors.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-cors.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-repeat-no-args.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-repeat-no-args.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-repeat-no-args.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-setrequestheader-and-arguments.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-setrequestheader-and-arguments.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-setrequestheader-and-arguments.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-setrequestheader-and-arguments.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-setrequestheader-existing-session.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-setrequestheader-existing-session.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-setrequestheader-existing-session.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-setrequestheader-existing-session.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-setrequestheader.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-setrequestheader.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic-setrequestheader.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic-setrequestheader.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-basic.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-basic.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-competing-names-passwords-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-competing-names-passwords-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-competing-names-passwords-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-competing-names-passwords.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-competing-names-passwords.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-competing-names-passwords.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-competing-names-passwords.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-cors-basic-setrequestheader.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-cors-basic-setrequestheader.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-cors-basic-setrequestheader.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-cors-basic-setrequestheader.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-cors-setrequestheader-no-cred-expected.txt similarity index 70% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-cors-setrequestheader-no-cred-expected.txt index 2f59b250..66a41e8 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred-expected.txt +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-cors-setrequestheader-no-cred-expected.txt
@@ -1,5 +1,5 @@ This is a testharness.js-based test. PASS CORS request with setRequestHeader auth to URL accepting Authorization header -FAIL CORS request with setRequestHeader auth to URL NOT accepting Authorization header Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://www1.web-platform.test:8001/XMLHttpRequest/resources/auth8/corsenabled-no-authorize.py'. +FAIL CORS request with setRequestHeader auth to URL NOT accepting Authorization header Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://www1.web-platform.test:8001/xhr/resources/auth8/corsenabled-no-authorize.py'. Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-cors-setrequestheader-no-cred.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-cors-setrequestheader-no-cred.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-cors-setrequestheader-no-cred.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-existing-session-manual.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-existing-session-manual.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-existing-session-manual.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-existing-session-manual.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-prompt-2-manual.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-prompt-2-manual.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-prompt-2-manual.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-prompt-2-manual.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-prompt-manual-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-prompt-manual-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-prompt-manual-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-prompt-manual-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-prompt-manual.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-prompt-manual.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-authentication-prompt-manual.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-authentication-prompt-manual.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-blob-with-no-mime-type.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-blob-with-no-mime-type.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-blob-with-no-mime-type.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-blob-with-no-mime-type.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-conditional-cors.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-conditional-cors.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-conditional-cors.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-conditional-cors.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-conditional.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-conditional.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-conditional.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-conditional.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-content-type-charset-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-content-type-charset-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-content-type-charset-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-content-type-charset-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-content-type-charset.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-content-type-charset.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-content-type-charset.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-content-type-charset.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-content-type-string-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-content-type-string-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-content-type-string-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-content-type-string-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-content-type-string.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-content-type-string.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-content-type-string.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-content-type-string.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-arraybuffer.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-arraybuffer.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-arraybuffer.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-arraybuffer.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-arraybufferview.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-arraybufferview.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-arraybufferview.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-arraybufferview.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-blob.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-blob.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-blob.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-blob.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-es-object.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-es-object.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-es-object.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-es-object.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-formdata.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-formdata.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-formdata.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-formdata.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-unexpected-tostring.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-unexpected-tostring.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-data-unexpected-tostring.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-data-unexpected-tostring.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-basic.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-basic.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-basic.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-basic.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-document-bogus.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-document-bogus.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-document-bogus.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-document-bogus.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-document.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-document.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-document.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-document.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-empty.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-empty.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-empty.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-empty.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-get-head-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-get-head-async.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-get-head-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-get-head-async.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-get-head.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-get-head.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-get-head.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-get-head.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-none.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-none.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-entity-body-none.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-entity-body-none.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-network-error-async-events.sub.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-network-error-async-events.sub.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-network-error-async-events.sub.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-network-error-async-events.sub.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-network-error-sync-events.sub.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-network-error-sync-events.sub.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-network-error-sync-events.sub.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-network-error-sync-events.sub.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-no-response-event-loadend.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-no-response-event-loadend.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-no-response-event-loadend.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-no-response-event-loadend.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-no-response-event-loadstart.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-no-response-event-loadstart.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-no-response-event-loadstart.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-no-response-event-loadstart.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-no-response-event-order-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-no-response-event-order-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-no-response-event-order-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-no-response-event-order-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-no-response-event-order.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-no-response-event-order.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-no-response-event-order.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-no-response-event-order.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-non-same-origin.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-non-same-origin.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-non-same-origin.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-non-same-origin.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-receive-utf16.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-receive-utf16.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-receive-utf16.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-receive-utf16.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-bogus-sync.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-bogus-sync.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-bogus-sync.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-bogus-sync.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-bogus.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-bogus.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-bogus.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-bogus.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-infinite-sync.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-infinite-sync.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-infinite-sync.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-infinite-sync.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-infinite.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-infinite.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-infinite.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-infinite.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-no-location.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-no-location.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-no-location.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-no-location.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-post-upload.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-post-upload.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-post-upload.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-post-upload.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-to-cors.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-to-cors.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-to-cors.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-to-cors.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-to-non-cors.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-to-non-cors.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect-to-non-cors.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect-to-non-cors.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-redirect.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-redirect.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-event-order-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-event-order-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-event-order-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-event-order-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-event-order.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-event-order.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-event-order.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-event-order.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-upload-event-loadend.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-upload-event-loadend.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-upload-event-loadend.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-upload-event-loadend.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-upload-event-loadstart.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-upload-event-loadstart.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-upload-event-loadstart.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-upload-event-loadstart.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-upload-event-progress.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-upload-event-progress.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-response-upload-event-progress.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-response-upload-event-progress.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-send.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-send.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-send.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-send.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-send.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-send.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-send.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-send.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-send.worker.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-send.worker.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-send.worker.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-send.worker.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-blocks-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-blocks-async.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-blocks-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-blocks-async.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-no-response-event-load.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-no-response-event-load.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-no-response-event-load.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-no-response-event-load.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-no-response-event-loadend.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-no-response-event-loadend.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-no-response-event-loadend.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-no-response-event-loadend.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-no-response-event-order.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-no-response-event-order.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-no-response-event-order.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-no-response-event-order.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-response-event-order-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-response-event-order-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-response-event-order-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-response-event-order-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-response-event-order.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-response-event-order.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-response-event-order.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-response-event-order.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-timeout.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-timeout.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-sync-timeout.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-sync-timeout.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-timeout-events.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-timeout-events.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-timeout-events.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-timeout-events.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-usp.any.js b/third_party/WebKit/LayoutTests/external/wpt/xhr/send-usp.any.js similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/send-usp.any.js rename to third_party/WebKit/LayoutTests/external/wpt/xhr/send-usp.any.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-after-send.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-after-send.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-after-send.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-after-send.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-allow-empty-value.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-allow-empty-value.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-allow-empty-value.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-allow-empty-value.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-allow-whitespace-in-value.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-allow-whitespace-in-value.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-allow-whitespace-in-value.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-allow-whitespace-in-value.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-before-open.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-before-open.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-before-open.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-before-open.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-bogus-name.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-bogus-name.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-bogus-name.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-bogus-name.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-bogus-value.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-bogus-value.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-bogus-value.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-bogus-value.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-case-insensitive.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-case-insensitive.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-case-insensitive.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-case-insensitive.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-content-type-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-content-type-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-content-type-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-content-type-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-content-type.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-content-type.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-content-type.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-content-type.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-header-allowed.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-header-allowed.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-header-allowed.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-header-allowed.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-header-forbidden.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-header-forbidden.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-header-forbidden.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-header-forbidden.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-open-setrequestheader.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-open-setrequestheader.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/setrequestheader-open-setrequestheader.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/setrequestheader-open-setrequestheader.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/status-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/status-async.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/status-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/status-async.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/status-basic.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/status-basic.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/status-basic.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/status-basic.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/status-error.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/status-error.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/status-error.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/status-error.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/template-element.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/template-element.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/template-element.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/template-element.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/timeout-cors-async.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/timeout-cors-async.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/timeout-cors-async.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/timeout-cors-async.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/timeout-multiple-fetches.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/timeout-multiple-fetches.html similarity index 90% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/timeout-multiple-fetches.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/timeout-multiple-fetches.html index d2ab4d2..30d6b73 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/timeout-multiple-fetches.html +++ b/third_party/WebKit/LayoutTests/external/wpt/xhr/timeout-multiple-fetches.html
@@ -18,7 +18,7 @@ async_test(t => { const client = new XMLHttpRequest - client.open("YO", get_host_info().HTTP_REMOTE_ORIGIN + "/XMLHttpRequest/resources/delay.py") + client.open("YO", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/delay.py") client.timeout = 1000 client.send() client.ontimeout = t.step_func_done(() => {
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/timeout-sync.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/timeout-sync.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/timeout-sync.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/timeout-sync.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-basic.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-basic.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-basic.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-basic.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-eventtarget.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-eventtarget.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-eventtarget.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-eventtarget.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-network-error-sync.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-network-error-sync.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-network-error-sync.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-network-error-sync.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-network-error.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-network-error.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-network-error.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-network-error.htm
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-block-defer-scripts-subframe.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts-subframe.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-block-defer-scripts-subframe.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-block-defer-scripts.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-block-defer-scripts.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-block-defer-scripts.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-block-scripts.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-block-scripts.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-block-scripts.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-block-scripts.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-default-feature-policy.sub-expected.txt similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub-expected.txt rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-default-feature-policy.sub-expected.txt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-default-feature-policy.sub.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-default-feature-policy.sub.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-default-feature-policy.sub.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-not-hang-scriptloader-subframe.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader-subframe.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-not-hang-scriptloader-subframe.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-not-hang-scriptloader.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-sync-not-hang-scriptloader.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-sync-not-hang-scriptloader.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-aborted.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-aborted.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-aborted.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-aborted.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-abortedonmain.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-abortedonmain.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-abortedonmain.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-abortedonmain.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-overrides.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-overrides.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-overrides.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-overrides.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-overridesexpires.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-overridesexpires.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-overridesexpires.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-overridesexpires.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-reused.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-reused.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-reused.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-reused.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-simple.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-simple.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-simple.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-simple.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-synconmain.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-synconmain.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-synconmain.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-synconmain.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-twice.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-twice.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-twice.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-twice.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-aborted.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-aborted.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-aborted.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-aborted.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-overrides.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-overrides.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-overrides.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-overrides.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-overridesexpires.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-overridesexpires.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-overridesexpires.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-overridesexpires.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-simple.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-simple.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-simple.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-simple.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-synconworker.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-synconworker.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-synconworker.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-synconworker.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-twice.html b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-twice.html similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-timeout-worker-twice.html rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-timeout-worker-twice.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-unsent.htm b/third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-unsent.htm similarity index 100% rename from third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/xmlhttprequest-unsent.htm rename to third_party/WebKit/LayoutTests/external/wpt/xhr/xmlhttprequest-unsent.htm
diff --git a/third_party/WebKit/LayoutTests/fast/beacon/beacon-basic-expected.txt b/third_party/WebKit/LayoutTests/fast/beacon/beacon-basic-expected.txt index 33d164ec..17c5cb1 100644 --- a/third_party/WebKit/LayoutTests/fast/beacon/beacon-basic-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/beacon/beacon-basic-expected.txt
@@ -8,7 +8,6 @@ PASS navigator.sendBeacon() threw exception TypeError: Failed to execute 'sendBeacon' on 'Navigator': 1 argument required, but only 0 present.. PASS navigator.sendBeacon('http:') threw exception TypeError: Failed to execute 'sendBeacon' on 'Navigator': The URL argument is ill-formed or unsupported.. PASS navigator.sendBeacon('javascript:alert(1);') threw exception TypeError: Failed to execute 'sendBeacon' on 'Navigator': Beacons are only supported over HTTP(S).. -PASS navigator.sendBeacon('https:', new Uint8Array(new SharedArrayBuffer(10))) threw exception TypeError: Failed to execute 'sendBeacon' on 'Navigator': The provided ArrayBufferView value must not be shared.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/css/fontface-arraybuffer-expected.txt b/third_party/WebKit/LayoutTests/fast/css/fontface-arraybuffer-expected.txt index 26e246e5..549324c 100644 --- a/third_party/WebKit/LayoutTests/fast/css/fontface-arraybuffer-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/css/fontface-arraybuffer-expected.txt
@@ -5,7 +5,6 @@ PASS face1.status is "loaded" PASS face2.status is "loaded" -PASS rejectionValue.name is "TypeError" PASS face3.status is "error" PASS rejectionValue.name is "SyntaxError" PASS document.getElementById('FontFromArrayBuffer').offsetWidth is document.getElementById('ref').offsetWidth
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/shadow-root-sibling-invalidation-crash.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/shadow-root-sibling-invalidation-crash.html new file mode 100644 index 0000000..fd11ed8 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/shadow-root-sibling-invalidation-crash.html
@@ -0,0 +1,18 @@ +<!DOCTYPE html> +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<style> + .a + .b { color: pink } +</style> +<div id="host"></div> +<script> + test(() => { + var root = host.attachShadow({mode:"open"}); + root.innerHTML = "<span></span><span></span>"; + var span = root.firstChild; + document.documentElement.offsetTop; + span.setAttribute("class", "a"); + span.remove(); + }, `Scheduling a sibling invalidation set on shadow root before remove() + should not cause a DCHECK failure`); +</script>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-expected.txt index de7b170..bdf0090 100644 --- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-matrix-expected.txt
@@ -14,7 +14,6 @@ PASS DOMMatrix fromFloat*Array - invalid array size of nearby 6 PASS DOMMatrix fromFloat*Array - invalid array size of nearby 16 PASS DOMMatrix fromFloat*Array - invalid array size -PASS DOMMatrix fromFloat*Array - can't use SharedArrayBuffer view PASS DOMMatrix.fromMatrix() with no parameter PASS DOMMatrix.fromMatrix() with null PASS DOMMatrix.fromMatrix() with undefined
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/api/sharedarraybuffer-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/api/sharedarraybuffer-expected.txt deleted file mode 100644 index 9999c96..0000000 --- a/third_party/WebKit/LayoutTests/fast/encoding/api/sharedarraybuffer-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL decoding SharedArrayBuffer Test bug: need to pass exception to assert_throws() -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor-expected.txt index 14b8b2b..5e399a2 100644 --- a/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor-expected.txt
@@ -14,7 +14,6 @@ PASS new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data: data }).bubbles is true PASS new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data: data }).cancelable is true PASS new MIDIMessageEvent('eventType', { bubbles: true, cancelable: true, data: data }).data == '0,0,0' is true -PASS new MIDIMessageEvent('eventType', { data: data }) threw exception TypeError: Failed to construct 'MIDIMessageEvent': The provided ArrayBufferView value must not be shared.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/input-events.html b/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/input-events.html index b0c4cae..ecfcd25 100644 --- a/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/input-events.html +++ b/third_party/WebKit/LayoutTests/fast/events/hr-timestamp/input-events.html
@@ -24,10 +24,10 @@ async_test(function(t) { document.addEventListener(eventName, t.step_func(function(e) { const platformTimestamp = eventSender.lastEventTimestamp(); // in seconds - const expectedTimestamp = Math.floor((internals.monotonicTimeToZeroBasedDocumentTime(platformTimestamp) * 1000) / 0.005) * 0.005; - // Use 0.005001 instead of 0.005 to deal with floating point + const expectedTimestamp = Math.floor((internals.monotonicTimeToZeroBasedDocumentTime(platformTimestamp) * 1000) / 0.1) * 0.1; + // Use 0.100001 instead of 0.1 to deal with floating point // comparison issues. - assert_approx_equals(e.timeStamp, expectedTimestamp, 0.005001); + assert_approx_equals(e.timeStamp, expectedTimestamp, 0.100001); t.done(); })); dispatchEventFn();
diff --git a/third_party/WebKit/LayoutTests/fast/files/blob-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/files/blob-constructor-expected.txt index f3fe4d0..0aae9c8 100644 --- a/third_party/WebKit/LayoutTests/fast/files/blob-constructor-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/files/blob-constructor-expected.txt
@@ -30,7 +30,6 @@ PASS new Blob([(new Float64Array(100)).buffer]).size is 800 PASS new Blob([(new Float64Array(100)).buffer, (new Int32Array(100)).buffer, (new Uint8Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size is 1400 PASS new Blob([new Blob([(new Int32Array(100)).buffer]), (new Uint8Array(100)).buffer, (new Float32Array(100)).buffer, (new DataView(new ArrayBuffer(100))).buffer]).size is 1000 -PASS new Blob([new Uint8Array(new SharedArrayBuffer(4))]) threw exception TypeError: Failed to construct 'Blob': The provided ArrayBufferView value must not be shared.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-createOffer-promise.html b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-createOffer-promise.html index 2598f130..af9f5633 100644 --- a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-createOffer-promise.html +++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-createOffer-promise.html
@@ -30,6 +30,40 @@ var invalidStateError = new DOMException('', 'InvalidStateError'); return promise_rejects(this, invalidStateError, closedPC.createOffer({iceRestart:true})); }, 'createOffer() with closed peer connection' ); + + + // These tests are testing the non-standard "sdpFormat" extension. + promise_test(function() { + pc = new RTCPeerConnection({sdpSemantics: "plan-b"}); + return navigator.mediaDevices.getUserMedia({audio:true}) + .then((stream) => { + console.log('got stream'); + stream2 = stream.clone(); + pc.addTrack(stream.getAudioTracks()[0]); + pc.addTrack(stream2.getAudioTracks()[0]); + return pc.createOffer(); + }) + .then((offer) => { + let section_count = offer.sdp.match(/\nm=audio /g || []).length; + assert_equals(section_count, 1); + }); + }, 'plan B create offer creates only one media section'); + + promise_test(function() { + pc = new RTCPeerConnection({sdpSemantics: "unified-plan"}); + return navigator.mediaDevices.getUserMedia({audio:true}) + .then((stream) => { + console.log('got stream'); + stream2 = stream.clone(); + pc.addTrack(stream.getAudioTracks()[0]); + pc.addTrack(stream2.getAudioTracks()[0]); + return pc.createOffer(); + }) + .then((offer) => { + let section_count = offer.sdp.match(/\nm=audio /g || []).length; + assert_equals(section_count, 2); + }); + }, 'Unified plan create offer creates two media sections'); </script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-datachannel-expected.txt b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-datachannel-expected.txt index 9b4d7b8..2857a86 100644 --- a/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-datachannel-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/peerconnection/RTCPeerConnection-datachannel-expected.txt
@@ -38,7 +38,6 @@ PASS data.byteLength is 10 PASS array[0] is 1 PASS array[9] is 10 -PASS dc.send(new Uint8Array(new SharedArrayBuffer(16))); threw exception TypeError: Failed to execute 'send' on 'RTCDataChannel': The provided ArrayBufferView value must not be shared.. PASS dc_onclose was called PASS dc.readyState is 'closed' PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/text/pre-br-expected.html b/third_party/WebKit/LayoutTests/fast/text/pre-br-expected.html new file mode 100644 index 0000000..cf2b35b --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/pre-br-expected.html
@@ -0,0 +1,4 @@ +<!DOCTYPE html> +<div> + <br>This line should not wrap +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/text/pre-br.html b/third_party/WebKit/LayoutTests/fast/text/pre-br.html new file mode 100644 index 0000000..ea853c6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/pre-br.html
@@ -0,0 +1,4 @@ +<!DOCTYPE html> +<div style="width:5ch"> + <span style="white-space:pre"><br>This line should not wrap</span> +</div>
diff --git a/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt b/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt index 43d4b94b..f10bb142 100644 --- a/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/workers/worker-atomics-wait-expected.txt
@@ -1,6 +1,4 @@ Test that Atomics.wait is not allowed on the main thread. -PASS: Calling Atomics.wait on the main thread throws. -PASS: Atomics.wait is allowed in a worker. -DONE +SharedArrayBuffers are not enabled -- skipping test.
diff --git a/third_party/WebKit/LayoutTests/fast/workers/worker-sharedarraybuffer-transfer-expected.txt b/third_party/WebKit/LayoutTests/fast/workers/worker-sharedarraybuffer-transfer-expected.txt index e25db6bf..64bf5d6 100644 --- a/third_party/WebKit/LayoutTests/fast/workers/worker-sharedarraybuffer-transfer-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/workers/worker-sharedarraybuffer-transfer-expected.txt
@@ -1,73 +1,4 @@ Test sharing SharedArrayBuffers between dedicated workers. -Running SharedArrayBuffer test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred data is OK. -Running Int8Array test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running Uint8Array test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running Uint8ClampedArray test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running Int16Array test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running Uint16Array test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running Int32Array test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running Uint32Array test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running Float32Array test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running Float64Array test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: SharedArrayBuffer not neutered during transfer. -PASS: Original data not changed during transfer. -PASS: Transferred array type is OK. -PASS: Transferred data is OK. -Running SendSharedArrayBufferTwice test case -PASS: Transferred data is OK. -Running TransferArrayBufferAndSharedArrayBuffer test case -PASS: ArrayBuffer was neutered during transfer. -PASS: Transferred data is OK. -PASS: Transferred data is OK. -Running SharedArrayBufferInTransferListViaMessagePort test case -PASS: Passing SharedArrayBuffer in the transfer list threw. -PASS: ArrayBuffer 'ab1' was not neutered. -PASS: ArrayBuffer 'ab2' was not neutered. -DONE +SharedArrayBuffers are not enabled -- skipping test.
diff --git a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-send-sharedarraybuffer-expected.txt b/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-send-sharedarraybuffer-expected.txt deleted file mode 100644 index 1603c51..0000000 --- a/third_party/WebKit/LayoutTests/fast/xmlhttprequest/xmlhttprequest-send-sharedarraybuffer-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -This is a testharness.js-based test. -FAIL sending SharedArrayBuffer Test bug: need to pass exception to assert_throws() -Harness: the test ran to completion. -
diff --git a/third_party/WebKit/LayoutTests/fragmentation/repeating-thead-tfoot-different-fragment-height-expected.html b/third_party/WebKit/LayoutTests/fragmentation/repeating-thead-tfoot-different-fragment-height-expected.html new file mode 100644 index 0000000..e1d5161 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fragmentation/repeating-thead-tfoot-different-fragment-height-expected.html
@@ -0,0 +1,42 @@ +<!DOCTYPE html> +<style> +table { border-spacing: 0; } +tr { break-inside: avoid; } +td, td { height: 18px; padding: 0; font-size: 14px; } +</style> +<div style="columns: 2; width: 300px; height: 200px; column-fill: auto"> + <div style="height: 100px; background: grey"></div> + <div style="columns: 2; column-fill: auto; height: 300px"> + <table> + <tr><td>HEAD</td></tr> + <tr><td>1</td></tr> + <tr><td>2</td></tr> + <tr><td>3</td></tr> + <tr><td style="height: 10px"></td></tr> + <tr><td>FOOT</td></tr> + <tr><td>HEAD</td></tr> + <tr><td>4</td></tr> + <tr><td>5</td></tr> + <tr><td>6</td></tr> + <tr><td style="height: 10px"></td></tr> + <tr><td>FOOT</td></tr> + <tr><td>HEAD</td></tr> + <tr><td>7</td></tr> + <tr><td>8</td></tr> + <tr><td>9</td></tr> + <tr><td>10</td></tr> + <tr><td>11</td></tr> + <tr><td>12</td></tr> + <tr><td>13</td></tr> + <tr><td>14</td></tr> + <tr><td>15</td></tr> + <tr><td style="height: 2px"></td></tr> + <tr><td>FOOT</td></tr> + <tr><td>HEAD</td><tr> + <tr><td>16</td></tr> + <tr><td>17</td></tr> + <tr><td>18</td></tr> + <tr><td>FOOT</td></tr> + </table> + </div> +</div>
diff --git a/third_party/WebKit/LayoutTests/fragmentation/repeating-thead-tfoot-different-fragment-height.html b/third_party/WebKit/LayoutTests/fragmentation/repeating-thead-tfoot-different-fragment-height.html new file mode 100644 index 0000000..81ea35b --- /dev/null +++ b/third_party/WebKit/LayoutTests/fragmentation/repeating-thead-tfoot-different-fragment-height.html
@@ -0,0 +1,33 @@ +<!DOCTYPE html> +<style> +table { border-spacing: 0; } +thead, tfoot { break-inside: avoid; } +td { height: 18px; padding: 0; font-size: 14px; } +</style> +<div style="columns: 2; width: 300px; height: 200px; column-fill: auto"> + <div style="height: 100px; background: grey"></div> + <div style="columns: 2; column-fill: auto; height: 300px"> + <table> + <thead><td>HEAD</td></thead> + <tr><td>1</td></tr> + <tr><td>2</td></tr> + <tr><td>3</td></tr> + <tr><td>4</td></tr> + <tr><td>5</td></tr> + <tr><td>6</td></tr> + <tr><td>7</td></tr> + <tr><td>8</td></tr> + <tr><td>9</td></tr> + <tr><td>10</td></tr> + <tr><td>11</td></tr> + <tr><td>12</td></tr> + <tr><td>13</td></tr> + <tr><td>14</td></tr> + <tr><td>15</td></tr> + <tr><td>16</td></tr> + <tr><td>17</td></tr> + <tr><td>18</td></tr> + <tfoot><td>FOOT</td></tfoot> + </table> + </div> +</div>
diff --git a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-detached.html b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-detached.html new file mode 100644 index 0000000..3b95f87 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/credentialscontainer-detached.html
@@ -0,0 +1,31 @@ +<!DOCTYPE html> +<title>Credential Manager: invoke methods after the relevant document has been detached.</title> +<script src="../resources/testharness.js"></script> +<script src="../resources/testharnessreport.js"></script> +<script> + +async_test(t => { + let openedWindow = window.open("./resources/notify-opener-on-load.html"); + let eventWatcher = new EventWatcher(t, window, ["message"]); + let navigatorCredentials = null; + eventWatcher.wait_for("message") + .then(_ => { + navigatorCredentials = openedWindow.navigator.credentials; + window.setTimeout(_ => openedWindow.location.reload()); + return eventWatcher.wait_for("message"); + }) + .then(t.step_func_done(_ => { + assert_equals(navigatorCredentials.get(), undefined, + "navigator.credentials.get() should not crash nor return a Promise."); + assert_equals(navigatorCredentials.create(), undefined, + "navigator.credentials.create() should not crash nor return a Promise."); + assert_equals( + navigatorCredentials.store(new PasswordCredential({id: 'a', password: 'b'})), + undefined, + "navigator.credentials.store() should not crash nor return a Promise."); + assert_equals(navigatorCredentials.preventSilentAccess(), undefined, + "navigator.credentials.preventSilentAccess() should not crash nor return a Promise."); + })); +}); + +</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/notify-opener-on-load.html b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/notify-opener-on-load.html new file mode 100644 index 0000000..9c6daba --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/credentialmanager/resources/notify-opener-on-load.html
@@ -0,0 +1,4 @@ +<!DOCTYPE html> +<script> +window.addEventListener("load", _ => window.opener.postMessage("loaded", "*")); +</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/components/throttler-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/components/throttler-expected.txt index a85ec05..c9a43427 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/components/throttler-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/components/throttler-expected.txt
@@ -85,3 +85,9 @@ error: Error: Exception during process execution. Throttler is in IDLE state (doesn't have any timers set up) +Running: testPromise +SCHEDULED: 'operation #1' asSoonAsPossible: undefined +Process 'operation #1' STARTED. +Process 'operation #1' FINISHED. +The promise resolved. +
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/components/throttler.js b/third_party/WebKit/LayoutTests/http/tests/devtools/components/throttler.js index 90a8f518..e47cb3b 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/components/throttler.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/components/throttler.js
@@ -222,6 +222,19 @@ function processBody() { throw new Error('Exception during process execution.'); } + }, + + async function testPromise(next) { + var process = ProcessMock.create('operation #1', () => 1); + var schedulePromse = throttler.schedule(process.run).then(() => TestRunner.addResult('The promise resolved.')); + await Promise.resolve(); + timeoutMock.fireAllTimers(); + await Promise.resolve(); + process.finish(); + + await schedulePromse; + next(); + } ]); @@ -272,7 +285,11 @@ 'Throttler is in TIMEOUT state. Scheduled timers timeouts: [' + timeouts.sort().join(', ') + ']'); } - function logSchedule(operation, asSoonAsPossible) { + function logSchedule(operation, asSoonAsPossible, returnValue) { + if (returnValue === undefined) { + returnValue = asSoonAsPossible; + asSoonAsPossible = undefined; + } TestRunner.addResult('SCHEDULED: \'' + operation.processName + '\' asSoonAsPossible: ' + asSoonAsPossible); } })();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-context-selector.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-context-selector.js index 424eacc..6017a8ea7 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-context-selector.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-context-selector.js
@@ -40,7 +40,7 @@ await new Promise(f => SourcesTestRunner.startDebuggerTest(f, true)); await TestRunner.evaluateInPageAsync('setup()'); var workerTarget = await TestRunner.waitForTarget(target => target.parentTarget() === TestRunner.mainTarget); - var workerExecutionContext = await TestRunner.waitForExecutionContext(workerTarget.model(SDK.RuntimeModel)); + await TestRunner.waitForExecutionContext(workerTarget.model(SDK.RuntimeModel)); dump(); TestRunner.addResult(''); @@ -48,9 +48,6 @@ UI.context.setFlavor(SDK.Target, workerTarget); dump(); - var mainFrame = TestRunner.resourceTreeModel.mainFrame; - var mainExecutionContext = - TestRunner.runtimeModel.executionContexts().find(context => context.frameId === mainFrame.id); var childFrame = TestRunner.resourceTreeModel.frames().find(frame => frame !== TestRunner.resourceTreeModel.mainFrame); var childExecutionContext = @@ -60,35 +57,54 @@ UI.context.setFlavor(SDK.ExecutionContext, childExecutionContext); dump(); + var handleExecutionContextFlavorChanged; + UI.context.addFlavorChangeListener(SDK.DebuggerModel.CallFrame, () => { + if (handleExecutionContextFlavorChanged) + handleExecutionContextFlavorChanged(); + handleExecutionContextFlavorChanged = undefined; + }); + + function waitForExecutionContextFlavorChanged() { + return new Promise(fulfill => { + handleExecutionContextFlavorChanged = fulfill; + }); + } + TestRunner.evaluateInPage('pauseInMain()'); await SourcesTestRunner.waitUntilPausedPromise(); + await waitForExecutionContextFlavorChanged(); TestRunner.addResult(''); TestRunner.addResult('Paused in main'); dump(); await new Promise(f => SourcesTestRunner.resumeExecution(f)); + await waitForExecutionContextFlavorChanged(); TestRunner.addResult(''); TestRunner.addResult('Resumed'); dump(); TestRunner.evaluateInPage('pauseInWorker()'); await SourcesTestRunner.waitUntilPausedPromise(); + await waitForExecutionContextFlavorChanged(); TestRunner.addResult(''); TestRunner.addResult('Paused in worker'); dump(); await new Promise(f => SourcesTestRunner.resumeExecution(f)); + await waitForExecutionContextFlavorChanged(); TestRunner.addResult(''); TestRunner.addResult('Resumed'); dump(); TestRunner.evaluateInPage('pauseInIframe()'); await SourcesTestRunner.waitUntilPausedPromise(); + await waitForExecutionContextFlavorChanged(); TestRunner.addResult(''); TestRunner.addResult('Paused in iframe'); dump(); await new Promise(f => SourcesTestRunner.resumeExecution(f)); + await waitForExecutionContextFlavorChanged(); TestRunner.addResult(''); TestRunner.addResult('Resumed'); dump();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style-expected.txt index 7a8ae5b..d8a9395e 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style-expected.txt
@@ -7,5 +7,15 @@ Styled text #1: color: red; console-format-style.js:16 www.google.com Styled text #0: color: blue; -Styled text #1: color: blue; +Styled text #1: -webkit-text-stroke: 0px !important; text-decoration: underline !important; color: rgb(84, 84, 84) !important; background-color: rgb(255, 255, 255) !important; +console-format-style.js:17 www.google.com +onload @ console-format-style.js:17 +(anonymous) @ console-format-style.js:19 +Styled text #0: color: blue; background: blue; +Styled text #1: -webkit-text-stroke: 0px !important; text-decoration: underline !important; color: rgb(84, 84, 84) !important; background-color: rgb(255, 251, 229) !important; +console-format-style.js:18 www.google.com +onload @ console-format-style.js:18 +(anonymous) @ console-format-style.js:19 +Styled text #0: color: blue; background: blue; +Styled text #1: -webkit-text-stroke: 0px !important; text-decoration: underline !important; color: rgb(84, 84, 84) !important; background-color: rgb(255, 240, 240) !important;
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style.js index b2e6be7..2d8a336 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-format-style.js
@@ -14,6 +14,8 @@ console.log("%cBlue!.", "color: blue;"); console.log("%cBlue! %cRed!", "color: blue;", "color: red;"); console.log("%cwww.google.com", "color: blue"); + console.warn("%cwww.google.com", "color: blue; background: blue"); + console.error("%cwww.google.com", "color: blue; background: blue"); })(); `);
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-links-in-errors-with-trace-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-links-in-errors-with-trace-expected.txt index 0e5fc2c6..9d61ded 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-links-in-errors-with-trace-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-links-in-errors-with-trace-expected.txt
@@ -1,5 +1,12 @@ -Test that relative links in traces open in the sources panel. +Test that relative links and links with hash open in the sources panel. + +Running: testClickRelativeLink Clicking link source3.js:3 Panel sources was opened. +Running: testClickURLWithHash +Panel console was opened. +Clicking link http://127.0.0.1:8000/devtools/resources/source3.js#foo +Panel sources was opened. +
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-links-in-errors-with-trace.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-links-in-errors-with-trace.js index e95ec2f7..4819ed55 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-links-in-errors-with-trace.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-links-in-errors-with-trace.js
@@ -3,32 +3,39 @@ // found in the LICENSE file. (async function() { - TestRunner.addResult('Test that relative links in traces open in the sources panel.\n'); + TestRunner.addResult('Test that relative links and links with hash open in the sources panel.\n'); await TestRunner.loadModule('console_test_runner'); await TestRunner.showPanel('console'); await TestRunner.addScriptTag('../resources/source3.js'); + await TestRunner.evaluateInPagePromise('foo()'); + var messages = Console.ConsoleView.instance()._visibleViewMessages; - TestRunner.evaluateInPage('foo()', step1); - UI.inspectorView._tabbedPane.addEventListener(UI.TabbedPane.Events.TabSelected, panelChanged); + TestRunner.runTestSuite([ + function testClickRelativeLink(next) { + var clickTarget = messages[0].element().querySelectorAll('.console-message-text .devtools-link')[1]; + TestRunner.addResult('Clicking link ' + clickTarget.textContent); + UI.inspectorView._tabbedPane.once(UI.TabbedPane.Events.TabSelected).then(() => { + TestRunner.addResult('Panel ' + UI.inspectorView._tabbedPane._currentTab.id + ' was opened.'); + next(); + }); + clickTarget.click(); + }, - function panelChanged() { - TestRunner.addResult('Panel ' + UI.inspectorView._tabbedPane._currentTab.id + ' was opened.'); - TestRunner.completeTest(); - } - - var clickTarget; - - function step1() { - var firstMessageEl = Console.ConsoleView.instance()._visibleViewMessages[0].element(); - clickTarget = firstMessageEl.querySelectorAll('.console-message-text .devtools-link')[1]; - UI.inspectorView.showPanel('console').then(testClickTarget); - } - - function testClickTarget() { - TestRunner.addResult('Clicking link ' + clickTarget.textContent); - clickTarget.click(); - } + function testClickURLWithHash(next) { + UI.inspectorView._tabbedPane.once(UI.TabbedPane.Events.TabSelected).then(() => { + TestRunner.addResult('Panel ' + UI.inspectorView._tabbedPane._currentTab.id + ' was opened.'); + var clickTarget = messages[1].element().querySelectorAll('.console-message-text .devtools-link')[0]; + TestRunner.addResult('Clicking link ' + clickTarget.textContent); + UI.inspectorView._tabbedPane.once(UI.TabbedPane.Events.TabSelected).then(() => { + TestRunner.addResult('Panel ' + UI.inspectorView._tabbedPane._currentTab.id + ' was opened.'); + next(); + }); + clickTarget.click(); + }); + TestRunner.showPanel('console'); + } + ]); InspectorFrontendHost.openInNewTab = function() { TestRunner.addResult('Failure: Open link in new tab!!');
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-links-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-links-expected.txt index 1920feb..ab9f2fc 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-links-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-links-expected.txt
@@ -1,21 +1,84 @@ Test that console.log() would linkify the links. Bug 231074. -console-log-linkify-links.js:11 http://www.chromium.org/ console-message > source-code > console-message-anchor > devtools-link > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link -console-log-linkify-links.js:12 follow http://www.chromium.org/ console-message > source-code > console-message-anchor > devtools-link > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link -console-log-linkify-links.js:13 string http://www.chromium.org/ console-message > source-code > console-message-anchor > devtools-link > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link -console-log-linkify-links.js:14 123 "http://www.chromium.org/" console-message > source-code > console-message-anchor > devtools-link > hidden console-message-badge > hide-badge-title > console-message-text > object-value-number source-code > object-value-string source-code > object-value-string-quote > devtools-link > object-value-string-quote -console-log-linkify-links.js:15 http://www.chromium.org/some?v=114:56:57 console-message > source-code > console-message-anchor > devtools-link > hidden console-message-badge > hide-badge-title > console-message-text > devtools-link Dump urls in messages -linked url:null -linked url:http://www.chromium.org/ -linked url:null -linked url:http://www.chromium.org/ -linked url:null -linked url:http://www.chromium.org/ -linked url:null -linked url:http://www.chromium.org/ -linked url:null -linked url:http://www.chromium.org/some?v=114 + +Text: www.chromium.org +Linked url: http://www.chromium.org + +Text: http://www.chromium.org/ +Linked url: http://www.chromium.org/ + +Text: follow http://www.chromium.org/ +Linked url: http://www.chromium.org/ + +Text: string http://www.chromium.org/ +Linked url: http://www.chromium.org/ + +Text: 123 "http://www.chromium.org/" +Linked url: http://www.chromium.org/ + +Text: http://www.chromium.org/some?v=114:56:57 +Linked url: http://www.chromium.org/some?v=114 + +Text: http://www.example.com/düsseldorf?neighbourhood=Lörick +Linked url: http://www.example.com/düsseldorf?neighbourhood=Lörick + +Text: http://👓.ws +Linked url: http://👓.ws + +Text: http:/www.example.com/молодец +Linked url: http://www.example.com/молодец + +Text: http://ar.wikipedia.org/wiki/نجيب_محفوظ/ +Linked url: http://ar.wikipedia.org/wiki/نجيب_محفوظ/ + +Text: http://example.com/スター・ウォーズ/ +Linked url: http://example.com/スター・ウォーズ/ + +Text: data:text/plain;a +Linked url: data:text/plain;a + +Text: 'www.chromium.org' +Linked url: http://www.chromium.org + +Text: (www.chromium.org) +Linked url: http://www.chromium.org + +Text: "www.chromium.org" +Linked url: http://www.chromium.org + +Text: {www.chromium.org} +Linked url: http://www.chromium.org + +Text: [www.chromium.org] +Linked url: http://www.chromium.org + +Text: www.chromium.org +Linked url: http://www.chromium.org + +Text: www.chromium.org~ +Linked url: http://www.chromium.org~ + +Text: www.chromium.org, +Linked url: http://www.chromium.org + +Text: www.chromium.org: +Linked url: http://www.chromium.org + +Text: www.chromium.org; +Linked url: http://www.chromium.org + +Text: www.chromium.org. +Linked url: http://www.chromium.org + +Text: www.chromium.org... +Linked url: http://www.chromium.org + +Text: www.chromium.org! +Linked url: http://www.chromium.org + +Text: www.chromium.org? +Linked url: http://www.chromium.org The string "at triggerError (http://localhost/show/:22:11) " linkifies to url: http://localhost/show/ The lineNumber is 21 The columnNumber is 10
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-links.js b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-links.js index 78edefa..82b25dddd 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-links.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-log-linkify-links.js
@@ -8,25 +8,46 @@ await TestRunner.loadModule('console_test_runner'); await TestRunner.showPanel('console'); await TestRunner.evaluateInPagePromise(` + console.log("www.chromium.org"); console.log("http://www.chromium.org/"); console.log("follow http://www.chromium.org/"); console.log("string", "http://www.chromium.org/"); console.log(123, "http://www.chromium.org/"); console.log("http://www.chromium.org/some?v=114:56:57"); + console.log("http://www.example.com/düsseldorf?neighbourhood=Lörick"); + console.log("http://👓.ws"); + console.log("http:/www.example.com/молодец"); + console.log("http://ar.wikipedia.org/wiki/نجيب_محفوظ/"); + console.log("http://example.com/スター・ウォーズ/"); + console.log("data:text/plain;a"); + console.log("'www.chromium.org'"); + console.log("(www.chromium.org)"); + console.log("\\"www.chromium.org\\""); + console.log("{www.chromium.org}"); + console.log("[www.chromium.org]"); + console.log("www.chromium.org\\u00a0"); + console.log("www.chromium.org~"); + console.log("www.chromium.org,"); + console.log("www.chromium.org:"); + console.log("www.chromium.org;"); + console.log("www.chromium.org."); + console.log("www.chromium.org..."); + console.log("www.chromium.org!"); + console.log("www.chromium.org?"); `); - ConsoleTestRunner.dumpConsoleMessages(false, true); - TestRunner.addResult('Dump urls in messages'); var consoleView = Console.ConsoleView.instance(); var viewMessages = consoleView._visibleViewMessages; for (var i = 0; i < viewMessages.length; ++i) { var uiMessage = viewMessages[i]; - var element = uiMessage.contentElement(); + var element = uiMessage.element().querySelector('.console-message-text'); + TestRunner.addResult('\nText: ' + element.deepTextContent()); var links = element.querySelectorAll('.devtools-link'); for (var link of links) { var info = Components.Linkifier._linkInfo(link); - TestRunner.addResult('linked url:' + (info && info.url)); + if (info && info.url) + TestRunner.addResult('Linked url: ' + info.url); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-exception-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-exception-expected.txt index 3437274..77ce2ef0 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-exception-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/console/console-uncaught-exception-expected.txt
@@ -12,6 +12,8 @@ at uncaught-in-iframe.html:13 f @ uncaught-in-iframe.html:11 (anonymous) @ uncaught-in-iframe.html:13 +load (async) +(anonymous) @ uncaught-in-iframe.html:2 uncaught-in-iframe.html:6 Uncaught Error: Exception in setTimeout callback. at bar (uncaught-in-iframe.html:6) at uncaught-in-iframe.html:8 @@ -20,4 +22,6 @@ setTimeout (async) f @ uncaught-in-iframe.html:4 (anonymous) @ uncaught-in-iframe.html:13 +load (async) +(anonymous) @ uncaught-in-iframe.html:2
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/network/server-timing-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/network/server-timing-expected.txt new file mode 100644 index 0000000..27c5eb7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/network/server-timing-expected.txt
@@ -0,0 +1,5 @@ +Tests that server-timing headers are parsed correctly. + +Tests ran to completion. + +
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/network/server-timing.js b/third_party/WebKit/LayoutTests/http/tests/devtools/network/server-timing.js new file mode 100644 index 0000000..9046853 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/network/server-timing.js
@@ -0,0 +1,146 @@ +// Copyright 2017 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. + +(async function() { + TestRunner.addResult('Tests that server-timing headers are parsed correctly.\n'); + + function testServerTimingHeader(headerValue, expectedResults) { + var actualResults = SDK.ServerTiming.createFromHeaderValue(headerValue) + if (JSON.stringify(actualResults) !== JSON.stringify(expectedResults)) { + TestRunner.addResult('Test failure header=' + headerValue) + TestRunner.addResult(' expected=' + JSON.stringify(expectedResults)) + TestRunner.addResult(' actual=' + JSON.stringify(actualResults)) + } + } + + testServerTimingHeader("", []); + + // name only + testServerTimingHeader("metric", [{"name":"metric"}]); + + // name and duration + testServerTimingHeader("metric;dur=123.4", [{"name":"metric","dur":123.4}]); + testServerTimingHeader("metric;dur=\"123.4\"", [{"name":"metric","dur":123.4}]); + + // name and description + testServerTimingHeader("metric;desc=description", [{"name":"metric","desc":"description"}]); + testServerTimingHeader("metric;desc=\"description\"", [{"name":"metric","desc":"description"}]); + + // name, duration, and description + testServerTimingHeader("metric;dur=123.4;desc=description", [{"name":"metric","dur":123.4,"desc":"description"}]); + testServerTimingHeader("metric;desc=description;dur=123.4", [{"name":"metric","desc":"description","dur":123.4}]); + + // special chars in name + testServerTimingHeader("aB3!#$%&'*+-.^_`|~", [{"name":"aB3!#$%&'*+-.^_`|~"}]) + + // spaces + testServerTimingHeader("metric ; ", [{"name":"metric"}]); + testServerTimingHeader("metric , ", [{"name":"metric"}]); + testServerTimingHeader("metric ; dur = 123.4 ; desc = description", [{"name":"metric","dur":123.4,"desc":"description"}]); + testServerTimingHeader("metric ; desc = description ; dur = 123.4", [{"name":"metric","desc":"description","dur":123.4}]); + testServerTimingHeader("metric;desc = \"description\"", [{"name":"metric","desc":"description"}]); + + // tabs + testServerTimingHeader("metric\t;\t", [{"name":"metric"}]); + testServerTimingHeader("metric\t,\t", [{"name":"metric"}]); + testServerTimingHeader("metric\t;\tdur\t=\t123.4\t;\tdesc\t=\tdescription", [{"name":"metric","dur":123.4,"desc":"description"}]); + testServerTimingHeader("metric\t;\tdesc\t=\tdescription\t;\tdur\t=\t123.4", [{"name":"metric","desc":"description","dur":123.4}]); + testServerTimingHeader("metric;desc\t=\t\"description\"", [{"name":"metric","desc":"description"}]); + + // multiple entries + testServerTimingHeader("metric1;dur=12.3;desc=description1,metric2;dur=45.6;desc=description2,metric3;dur=78.9;desc=description3", [{"name":"metric1","dur":12.3,"desc":"description1"}, {"name":"metric2","dur":45.6,"desc":"description2"}, {"name":"metric3","dur":78.9,"desc":"description3"}]); + testServerTimingHeader("metric1,metric2 ,metric3, metric4 , metric5", [{"name":"metric1"}, {"name":"metric2"}, {"name":"metric3"}, {"name":"metric4"}, {"name":"metric5"}]); + + // quoted-strings - happy path + testServerTimingHeader("metric;desc=\"description\"", [{"name":"metric","desc":"description"}]); + testServerTimingHeader("metric;desc=\"\t description \t\"", [{"name":"metric","desc":"\t description \t"}]); + testServerTimingHeader("metric;desc=\"descr\\\"iption\"", [{"name":"metric","desc":"descr\"iption"}]); + + // quoted-strings - others + testServerTimingHeader("metric;desc=\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\\\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\\\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\"\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\"\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\\\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\\\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\"\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\"\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\\\\\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\\\\\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\\\"\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\\\"\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\"\\\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\"\\\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\"\"\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\\\"\"\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\\\\\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\\\\\"", [{"name":"metric","desc":"\\"}]); + testServerTimingHeader("metric;desc=\"\\\"\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\\\"\"", [{"name":"metric","desc":"\""}]); + testServerTimingHeader("metric;desc=\"\"\\\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\"\\\"", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\"\"\\", [{"name":"metric","desc":""}]); + testServerTimingHeader("metric;desc=\"\"\"\"", [{"name":"metric","desc":""}]); + + // duplicate entry names + testServerTimingHeader("metric;dur=12.3;desc=description1,metric;dur=45.6;desc=description2", [{"name":"metric","dur":12.3,"desc":"description1"}, {"name":"metric","dur":45.6,"desc":"description2"}]); + + // param name case sensitivity + testServerTimingHeader("metric;DuR=123.4;DeSc=description", [{"name":"metric","dur":123.4,"desc":"description"}]); + + // non-numeric durations + testServerTimingHeader("metric;dur=foo", [{"name":"metric","dur":0}]); + testServerTimingHeader("metric;dur=\"foo\"", [{"name":"metric","dur":0}]); + + // unrecognized param names + testServerTimingHeader("metric1;foo=bar;desc=description;foo=bar;dur=123.4;foo=bar,metric2", [{"name":"metric1","desc":"description","dur":123.4}, {"name":"metric2"}]); + + // duplicate param names + testServerTimingHeader("metric;dur=123.4;dur=567.8", [{"name":"metric","dur":123.4}]); + testServerTimingHeader("metric;dur=foo;dur=567.8", [{"name":"metric","dur":0}]); + testServerTimingHeader("metric;desc=description1;desc=description2", [{"name":"metric","desc":"description1"}]); + + // incomplete params + testServerTimingHeader("metric;dur;dur=123.4;desc=description", [{"name":"metric","dur":0,"desc":"description"}]); + testServerTimingHeader("metric;dur=;dur=123.4;desc=description", [{"name":"metric","dur":0,"desc":"description"}]); + testServerTimingHeader("metric;desc;desc=description;dur=123.4", [{"name":"metric","desc":"","dur":123.4}]); + testServerTimingHeader("metric;desc=;desc=description;dur=123.4", [{"name":"metric","desc":"","dur":123.4}]); + + // extraneous characters after param value as token + testServerTimingHeader("metric;desc=d1 d2;dur=123.4", [{"name":"metric","desc":"d1","dur":123.4}]); + testServerTimingHeader("metric1;desc=d1 d2,metric2", [{"name":"metric1","desc":"d1"},{"name":"metric2"}]); + + // extraneous characters after param value as quoted-string + testServerTimingHeader("metric;desc=\"d1\" d2;dur=123.4", [{"name":"metric","desc":"d1","dur":123.4}]); + testServerTimingHeader("metric1;desc=\"d1\" d2,metric2", [{"name":"metric1","desc":"d1"},{"name":"metric2"}]); + + // nonsense - extraneous characters after entry name token + testServerTimingHeader("metric== \"\"foo;dur=123.4", [{"name":"metric"}]); + testServerTimingHeader("metric1== \"\"foo,metric2", [{"name":"metric1"}]); + + // nonsense - extraneous characters after param name token + testServerTimingHeader("metric;dur foo=12", [{"name":"metric","dur":0}]); + testServerTimingHeader("metric;foo dur=12", [{"name":"metric"}]); + + // nonsense - return zero entries + testServerTimingHeader(" ", []); + testServerTimingHeader("=", []); + testServerTimingHeader(";", []); + testServerTimingHeader(",", []); + testServerTimingHeader("=;", []); + testServerTimingHeader(";=", []); + testServerTimingHeader("=,", []); + testServerTimingHeader(",=", []); + testServerTimingHeader(";,", []); + testServerTimingHeader(",;", []); + + TestRunner.addResult('Tests ran to completion.\n'); + TestRunner.completeTest(); +})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/resources/source3.js b/third_party/WebKit/LayoutTests/http/tests/devtools/resources/source3.js index 91ecf0d..54aa5b5 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/resources/source3.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/resources/source3.js
@@ -1,4 +1,5 @@ function foo() { console.error(new Error("http://127.0.0.1:8000/devtools/resources/source3.js")); + console.error("http://127.0.0.1:8000/devtools/resources/source3.js#foo"); } \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/tracing/timeline-time/timeline-usertiming.js b/third_party/WebKit/LayoutTests/http/tests/devtools/tracing/timeline-time/timeline-usertiming.js index 6d77da8b..4663b81 100644 --- a/third_party/WebKit/LayoutTests/http/tests/devtools/tracing/timeline-time/timeline-usertiming.js +++ b/third_party/WebKit/LayoutTests/http/tests/devtools/tracing/timeline-time/timeline-usertiming.js
@@ -14,16 +14,23 @@ performance.measure("a", "a-start", "a-end"); } + function doWork() + { + for(var i = 0; i < 10000; i++) {} + } + function nestedPerformanceMeasure() { performance.mark("a-start"); { performance.mark("b-start"); + doWork(); performance.mark("b-end"); { performance.mark("c-start"); { performance.mark("d-start"); + doWork(); performance.mark("d-end"); } performance.mark("c-end"); @@ -51,9 +58,11 @@ function parentMeasureIsOnTop() { performance.mark("startTime1"); + doWork(); performance.mark("endTime1"); performance.mark("startTime2"); + doWork(); performance.mark("endTime2"); performance.measure("durationTime1", "startTime1", "endTime1");
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network-data-length-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network-data-length-expected.txt index 2a9d867..de4ab1a9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network-data-length-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network-data-length-expected.txt
@@ -24,7 +24,6 @@ redirected: true headersSize: 0 receivedDataSize: 0 - reportedTotalSize: 182 url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?cached=1 isChunked: false
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network-data-length.js b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network-data-length.js index 0a367fd..7a74640 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network-data-length.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network-data-length.js
@@ -25,7 +25,8 @@ testRunner.log(' redirected: ' + request.redirected); testRunner.log(' headersSize: ' + request.headersSize); testRunner.log(' receivedDataSize: ' + request.receivedDataSize); - testRunner.log(' reportedTotalSize: ' + request.reportedTotalSize); + if (!request.redirected) // reportedTotalSize is not stable across platforms. + testRunner.log(' reportedTotalSize: ' + request.reportedTotalSize); testRunner.log(''); } }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-both-redirect-rewrite-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-both-redirect-rewrite-expected.txt index 43a36edc..5668d922 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-both-redirect-rewrite-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-both-redirect-rewrite-expected.txt
@@ -23,7 +23,6 @@ Location: redirect2.php Pragma: no-cache Server: <Masked> - X-Powered-By: <Masked> redirectUrl: redirect2.php responseBody: Error<Can only get response body on requests captured after headers received.> @@ -43,7 +42,6 @@ Location: final.html Pragma: no-cache Server: <Masked> - X-Powered-By: <Masked> redirectUrl: final.html responseBody: Error<Can only get response body on requests captured after headers received.>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-both-redirect-rewrite.js b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-both-redirect-rewrite.js index 747f3406..1e31efa1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-both-redirect-rewrite.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-both-redirect-rewrite.js
@@ -2,7 +2,9 @@ var {page, session, dp} = await testRunner.startBlank( `Tests interception for redirects in a chain but rewrite last response.`); - var headersMaskList = new Set(['date', 'server', 'last-modified', 'etag', 'keep-alive', 'x-powered-by', 'expires']); + var headersMaskList = new Set(['date', 'server', 'last-modified', 'etag', 'keep-alive', 'expires']); + // Hide these headers which are not shown in newer versions of PHP. + var headersHideList = new Set(['x-powered-by']); var fileNameForRequestId = new Map(); var responseReceivedEventProimseForFile = new Map(); var responseReceivedResolverForFile = new Map(); @@ -119,6 +121,8 @@ testRunner.log(' responseHeaders:'); for (var headerName of Object.keys(event.params.responseHeaders).sort()) { var headerValue = event.params.responseHeaders[headerName].split(';')[0]; // Sometimes "; charset=UTF-8" gets in here. + if (headersHideList.has(headerName.toLowerCase())) + continue; if (headersMaskList.has(headerName.toLowerCase())) headerValue = '<Masked>'; testRunner.log(` ${headerName}: ${headerValue}`);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-response-redirect-expected.txt b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-response-redirect-expected.txt index 7a5ec105..3df3cef2 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-response-redirect-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-response-redirect-expected.txt
@@ -26,7 +26,6 @@ Location: ping-redirected-page.html Pragma: no-cache Server: <Masked> - X-Powered-By: <Masked> redirectUrl: ping-redirected-page.html responseBody: error: Can only get response body on requests captured after headers received.
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-response-redirect.js b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-response-redirect.js index bf3c1d0..8cab1976 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-response-redirect.js +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/request-interception-on-response-redirect.js
@@ -6,6 +6,7 @@ var helper = new InterceptionHelper(testRunner, session); var headersMaskList = new Set(['date', 'server', 'last-modified', 'etag', 'keep-alive', 'x-powered-by', 'expires']); + var headersHideList = new Set(['x-powered-by']); var requestInterceptedDict = { 'ping-redirect.php': async event => { @@ -17,6 +18,8 @@ testRunner.log(' responseHeaders:'); for (var headerName of Object.keys(event.params.responseHeaders).sort()) { var headerValue = event.params.responseHeaders[headerName].split(';')[0]; // Sometimes "; charset=UTF-8" gets in here. + if (headersHideList.has(headerName.toLowerCase())) + continue; if (headersMaskList.has(headerName.toLowerCase())) headerValue = '<Masked>'; testRunner.log(` ${headerName}: ${headerValue}`);
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/echo-headers.php b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/echo-headers.php index b1dd4af..14d6432 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/echo-headers.php +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/echo-headers.php
@@ -1,5 +1,5 @@ <?php -$headers = split(":", $_GET['headers']); +$headers = explode(":", $_GET['headers']); foreach ($headers as $header) { echo $header . ": " . (isset($_SERVER[$header]) ? $_SERVER[$header] : "<not set>") . "\n"; }
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/iframe-auth-js.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/iframe-auth-js.html index 19cc3dd..c5c1b809 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/iframe-auth-js.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/iframe-auth-js.html
@@ -1,6 +1,12 @@ <!DOCTYPE html> <html> <head> -<script src="unauthorised.pl"></script> +<script> +// Suppress usage of cached credentials from other tests by randomizing the domain. +var token = (Math.random() * (1 << 30) | 0); +var script = document.createElement('script'); +script.src = `http://wut${token}.test:8000/inspector-protocol/network/resources/unauthorised.pl`; +document.head.appendChild(script); +</script> </head> </html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/xhr-iframe-auth-fail.html b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/xhr-iframe-auth-fail.html index d34f53e1..66444d1 100644 --- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/xhr-iframe-auth-fail.html +++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/network/resources/xhr-iframe-auth-fail.html
@@ -6,7 +6,8 @@ xhr.onload = function() { console.log('xhr.status = ' + xhr.status); }; -xhr.open("GET", "unauthorised.pl"); +// Suppress usage of credentials cached from other tests in pre-emptive auth by adding a bogus user to the URL. +xhr.open("GET", "http://user@127.0.0.1:8000/inspector-protocol/network/resources/unauthorised.pl"); xhr.send(); </script> </head>
diff --git a/third_party/WebKit/LayoutTests/http/tests/locks/acquire.html b/third_party/WebKit/LayoutTests/http/tests/locks/acquire.html index c857fe6..80b6580 100644 --- a/third_party/WebKit/LayoutTests/http/tests/locks/acquire.html +++ b/third_party/WebKit/LayoutTests/http/tests/locks/acquire.html
@@ -4,7 +4,6 @@ <link rel=help href="https://github.com/inexorabletash/web-locks"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> -<script src="/resources/get-host-info.js"></script> <script> 'use strict';
diff --git a/third_party/WebKit/LayoutTests/http/tests/locks/chromium-waiting-promise-gc.html b/third_party/WebKit/LayoutTests/http/tests/locks/chromium-waiting-promise-gc.html new file mode 100644 index 0000000..c6b2335 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/locks/chromium-waiting-promise-gc.html
@@ -0,0 +1,53 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Web Locks API: Lock held with Promise that is GC'd (Chromium-specific, relies on gc/internals)</title> +<link rel=help href="https://github.com/inexorabletash/web-locks"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/helpers.js"></script> +<script> +'use strict'; + +// For uncaught rejections. +setup({allow_uncaught_exception: true}); + +// Wait for a promise in a subsequent task (not just microtask in same task). +function task(t) { + return new Promise(resolve => { + t.step_timeout(resolve, 0); + }); +} + +promise_test(async t => { + let res = uniqueName(t); + let observe_lock, observe_promise; + + // Acquire the lock, and keep it alive via a promise that never resolves. + let resolve, acquired = new Promise(r => { resolve = r; }); + navigator.locks.acquire(res, lock => { + resolve(); + + // Neither |lock| nor |promise| are retained. + const promise = new Promise(() => {}); + observe_lock = internals.observeGC(lock); + observe_promise = internals.observeGC(promise); + return promise; + }); + await acquired; + + // Drain the microtask queue and trigger a GC. + await task(t); + gc(); + assert_true(observe_lock.wasCollected, 'Lock should be collected'); + assert_true(observe_promise.wasCollected, 'Promise should be collected'); + + // Now try and acquire the lock. + let lock = 'should be overwritten'; + await navigator.locks.acquire(res, {ifAvailable: true}, l => { + lock = l; + }); + assert_equals(lock, null, 'Lock acquisition should have failed'); + +}, 'GC of waiting promise does not cause lock to be released'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/locks/frames.html b/third_party/WebKit/LayoutTests/http/tests/locks/frames.html index 5b00448f..57067f957d 100644 --- a/third_party/WebKit/LayoutTests/http/tests/locks/frames.html +++ b/third_party/WebKit/LayoutTests/http/tests/locks/frames.html
@@ -4,15 +4,11 @@ <link rel=help href="https://github.com/inexorabletash/web-locks"> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> +<script src="resources/helpers.js"></script> <style>iframe { display: none; }</style> <script> 'use strict'; -let res_num = 0; -function uniqueName(testCase) { - return `${self.location.pathname}-${testCase.name}-${++res_num}`; -} - function iframe(url) { return new Promise(resolve => { const element = document.createElement('iframe');
diff --git a/third_party/WebKit/LayoutTests/http/tests/locks/interfaces.idl b/third_party/WebKit/LayoutTests/http/tests/locks/interfaces.idl index 29fbfcf..b1897ef 100644 --- a/third_party/WebKit/LayoutTests/http/tests/locks/interfaces.idl +++ b/third_party/WebKit/LayoutTests/http/tests/locks/interfaces.idl
@@ -21,10 +21,12 @@ [Exposed=(Window,Worker), SecureContext] interface LockManager { Promise<any> acquire(DOMString name, - LockRequestCallback callback); + LockGrantedCallback callback); Promise<any> acquire(DOMString name, LockOptions options, - LockRequestCallback callback); + LockGrantedCallback callback); + + Promise<LockManagerSnapshot> query(); }; [Exposed=(Window,Worker), SecureContext] @@ -32,3 +34,13 @@ readonly attribute DOMString name; readonly attribute LockMode mode; }; + +dictionary LockManagerSnapshot { + sequence<LockInfo> pending; + sequence<LockInfo> held; +}; + +dictionary LockInfo { + DOMString name; + LockMode mode; +};
diff --git a/third_party/WebKit/LayoutTests/http/tests/locks/query.html b/third_party/WebKit/LayoutTests/http/tests/locks/query.html new file mode 100644 index 0000000..25f4934 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/locks/query.html
@@ -0,0 +1,106 @@ +<!DOCTYPE html> +<meta charset=utf-8> +<title>Web Locks API: navigator.locks.query method</title> +<link rel=help href="https://github.com/inexorabletash/web-locks"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="resources/helpers.js"></script> +<script> +'use strict'; + +// Returns an array of the modes for the locks with matching name. +function modes(list, name) { + return list.filter(item => item.name === name).map(item => item.mode); +} + +promise_test(async t => { + const res = uniqueName(t); + + await navigator.locks.acquire(res, async lock1 => { + const state = await navigator.locks.query(); + assert_array_equals(modes(state.held, res), ['exclusive'], + 'Held lock should appear once'); + }); + + await navigator.locks.acquire(res, {mode: 'shared'}, async lock1 => { + const state = await navigator.locks.query(); + assert_array_equals(modes(state.held, res), ['shared'], + 'Held lock should appear once'); + }); +}, 'query() reports individual held locks'); + +promise_test(async t => { + const res1 = uniqueName(t); + const res2 = uniqueName(t); + + await navigator.locks.acquire(res1, async lock1 => { + await navigator.locks.acquire(res2, {mode: 'shared'}, async lock2 => { + const state = await navigator.locks.query(); + assert_array_equals(modes(state.held, res1), ['exclusive'], + 'Held lock should appear once'); + assert_array_equals(modes(state.held, res2), ['shared'], + 'Held lock should appear once'); + }); + }); +}, 'query() reports multiple held locks'); + +promise_test(async t => { + const res = uniqueName(t); + + await navigator.locks.acquire(res, async lock1 => { + // Attempt to acquire this again - should be blocked. + let lock2_acquired = false; + navigator.locks.acquire(res, lock2 => { lock2_acquired = true; }); + + // Verify that it was blocked. + await navigator.locks.acquire(res, {ifAvailable: true}, async lock3 => { + assert_false(lock2_acquired, 'second request should be blocked'); + assert_equals(lock3, null, 'third request should have failed'); + + const state = await navigator.locks.query(); + assert_array_equals(modes(state.pending, res), ['exclusive'], + 'Pending lock should appear once'); + assert_array_equals(modes(state.held, res), ['exclusive'], + 'Held lock should appear once'); + }); + }); +}, 'query() reports pending and held locks'); + +promise_test(async t => { + const res = uniqueName(t); + + await navigator.locks.acquire(res, {mode: 'shared'}, async lock1 => { + await navigator.locks.acquire(res, {mode: 'shared'}, async lock2 => { + const state = await navigator.locks.query(); + assert_array_equals(modes(state.held, res), ['shared', 'shared'], + 'Held lock should appear twice'); + }); + }); +}, 'query() reports held shared locks with appropriate count'); + +promise_test(async t => { + const res = uniqueName(t); + + await navigator.locks.acquire(res, async lock1 => { + let lock2_acquired = false, lock3_acquired = false; + navigator.locks.acquire(res, {mode: 'shared'}, + lock2 => { lock2_acquired = true; }); + navigator.locks.acquire(res, {mode: 'shared'}, + lock3 => { lock3_acquired = true; }); + + await navigator.locks.acquire(res, {ifAvailable: true}, async lock4 => { + assert_equals(lock4, null, 'lock should not be available'); + assert_false(lock2_acquired, 'second attempt should be blocked'); + assert_false(lock3_acquired, 'third attempt should be blocked'); + + const state = await navigator.locks.query(); + assert_array_equals(modes(state.held, res), ['exclusive'], + 'Held lock should appear once'); + + assert_array_equals(modes(state.pending, res), ['shared', 'shared'], + 'Pending lock should appear twice'); + }); + }); +}, 'query() reports pending shared locks with appropriate count'); + +</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/locks/resources/helpers.js b/third_party/WebKit/LayoutTests/http/tests/locks/resources/helpers.js new file mode 100644 index 0000000..ac437550 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/locks/resources/helpers.js
@@ -0,0 +1,9 @@ +// Test helpers used by multiple Web Locks API tests. +(() => { + + let res_num = 0; + self.uniqueName = testCase => { + return `${self.location.pathname}-${testCase.name}-${++res_num}`; + }; + +})();
diff --git a/third_party/WebKit/LayoutTests/http/tests/locks/workers.html b/third_party/WebKit/LayoutTests/http/tests/locks/workers.html index 2c4f9de..ece134a 100644 --- a/third_party/WebKit/LayoutTests/http/tests/locks/workers.html +++ b/third_party/WebKit/LayoutTests/http/tests/locks/workers.html
@@ -21,8 +21,8 @@ }); } -async function postAndConfirm(frame, data) { - const response = await postAndWait(frame, data); +async function postAndConfirm(worker, data) { + const response = await postAndWait(worker, data); assert_equals(response.ack, data.op); assert_equals(response.id, data.lock_id); return response;
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/webtiming-resolution-expected.txt b/third_party/WebKit/LayoutTests/http/tests/misc/webtiming-resolution-expected.txt index 9192a1e..05ce7bd 100644 --- a/third_party/WebKit/LayoutTests/http/tests/misc/webtiming-resolution-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/misc/webtiming-resolution-expected.txt
@@ -1,10 +1,10 @@ -Verifies the minimum resolution is 5 microseconds. +Verifies the minimum resolution is 100 microseconds. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS shouldBeNearZeroOrOne < 1e-10 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-10 is true -PASS shouldBeNearZeroOrOne < 1e-10 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-10 is true +PASS shouldBeNearZeroOrOne < 1e-5 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-5 is true +PASS shouldBeNearZeroOrOne < 1e-5 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-5 is true PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/http/tests/misc/webtiming-resolution.html b/third_party/WebKit/LayoutTests/http/tests/misc/webtiming-resolution.html index 812af6ac..b4d707ce 100644 --- a/third_party/WebKit/LayoutTests/http/tests/misc/webtiming-resolution.html +++ b/third_party/WebKit/LayoutTests/http/tests/misc/webtiming-resolution.html
@@ -6,7 +6,7 @@ <p id="description"></p> <div id="console"></div> <script> -description("Verifies the minimum resolution is 5 microseconds."); +description("Verifies the minimum resolution is 100 microseconds."); function testTimeResolution(highResTimeFunc) { var t0 = highResTimeFunc(); @@ -15,10 +15,10 @@ t1 = highResTimeFunc(); } - var expectedResolutionMilliseconds = 0.005; + var expectedResolutionMilliseconds = 0.100; var integerMultipleOfResolution = (t1 - t0) / expectedResolutionMilliseconds; shouldBeNearZeroOrOne = integerMultipleOfResolution % 1; - shouldBe("shouldBeNearZeroOrOne < 1e-10 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-10", "true"); + shouldBe("shouldBeNearZeroOrOne < 1e-5 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-5", "true"); } function timeByPerformanceNow() {
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/reentrant-xhr-onabort-crash-during-commit-expected.txt b/third_party/WebKit/LayoutTests/http/tests/navigation/reentrant-xhr-onabort-crash-during-commit-expected.txt new file mode 100644 index 0000000..bec52ef --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/navigation/reentrant-xhr-onabort-crash-during-commit-expected.txt
@@ -0,0 +1 @@ +This test creates a child iframe, which in turn creates a slow XHR then reloads. During commit for the reload, the slow XHR is cancelled, and the XHR's onabort handler in turn creates a new XHR, which is then aborted slightly later during the commit process. This second XHR's onabort handler detaches the iframe. This will cause the iframe to detach in the middle of commit, and shouldn't crash.
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/reentrant-xhr-onabort-crash-during-commit.html b/third_party/WebKit/LayoutTests/http/tests/navigation/reentrant-xhr-onabort-crash-during-commit.html new file mode 100644 index 0000000..4dbe4a2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/navigation/reentrant-xhr-onabort-crash-during-commit.html
@@ -0,0 +1,21 @@ +<body> +This test creates a child iframe, which in turn creates a slow XHR then reloads. +During commit for the reload, the slow XHR is cancelled, and the XHR's onabort +handler in turn creates a new XHR, which is then aborted slightly later during +the commit process. This second XHR's onabort handler detaches the iframe. This +will cause the iframe to detach in the middle of commit, and shouldn't crash. +<script> +if (window.testRunner) { + testRunner.dumpAsText(); + testRunner.waitUntilDone(); +} + +function finish() { + setTimeout(function() { + if (window.testRunner) + testRunner.notifyDone(); + }, 0); +} +</script> +<iframe src="resources/reentrant-xhr-onabort-crash-during-commit-iframe.html"></iframe> +</body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/resources/reentrant-xhr-onabort-crash-during-commit-iframe.html b/third_party/WebKit/LayoutTests/http/tests/navigation/resources/reentrant-xhr-onabort-crash-during-commit-iframe.html new file mode 100644 index 0000000..49197fb0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/navigation/resources/reentrant-xhr-onabort-crash-during-commit-iframe.html
@@ -0,0 +1,17 @@ +<body> +<script> +var x = new XMLHttpRequest(); +x.onabort = function() { + var x2 = new XMLHttpRequest(); + x2.onabort = function() { + top.finish(); + frameElement.remove(); + } + x2.open("GET", "slow-resource.pl"); + x2.send(); +} +x.open("GET", "slow-resource.pl"); +x.send(); +location.reload(); +</script> +</body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/audioworklet-origin-trial-interfaces.html b/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/audioworklet-origin-trial-interfaces.html new file mode 100644 index 0000000..d029520a --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/origin_trials/webexposed/audioworklet-origin-trial-interfaces.html
@@ -0,0 +1,54 @@ +<!DOCTYPE html> +<!-- + Generate token with the command: + tools/origin_trials/generate_token.py http://127.0.0.1:8000 AudioWorklet \ + --expire-timestamp=2000000000 +--> +<html> + <head> + <title> + AudioWorklet Interface Exposed by Origin Trial + </title> + <meta charset="utf-8"> + <meta http-equiv="origin-trial" content="Ao6nN+X7Mfg/2fBkWhI2DVdWHwslhOAfSeqD4pPKKzkZ37MLbrnWqO8Tn3apWwRfd/U0GyZHBhghuekDLa4PkwgAAABUeyJvcmlnaW4iOiAiaHR0cDovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQXVkaW9Xb3JrbGV0IiwgImV4cGlyeSI6IDIwMDAwMDAwMDB9"> + <script src="../../resources/testharness.js"></script> + <script src="../../resources/testharnessreport.js"></script> + <script src="../../../webaudio-resources/audit.js"></script> + </head> + <body> + <script id="layout-test-code"> + let audit = Audit.createTaskRunner(); + let realtimeContext = new AudioContext(); + + // Test if AudioWorklet is visible via BaseAudioContext. + audit.define( + 'AudioWorklet in BaseAudioContext', + (task, should) => { + should(realtimeContext.audioWorklet instanceof AudioWorklet, + 'Context.audioWorklet being an instance of AudioWorklet') + .beTrue(); + task.done(); + }); + + // Test if AudioWorkletGlobalScope parses JS code correctly. + // AudioWorkletProcessor must be available to pass the assertion. + audit.define( + 'Create AudioWorkletNode after .addModule() call', + (task, should) => { + realtimeContext.audioWorklet + .addModule('../../webaudio/audio-worklet/dummy-processor.js') + .then(() => { + let dummyWorkletNode = + new AudioWorkletNode(realtimeContext, 'dummy'); + should(dummyWorkletNode instanceof AudioWorkletNode, + 'dummyWorkeletNode being an instance of ' + + 'AudioWorkletNode') + .beTrue(); + task.done(); + }); + }); + + audit.run(); + </script> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/push_messaging/pushmessagedata-expected.txt b/third_party/WebKit/LayoutTests/http/tests/push_messaging/pushmessagedata-expected.txt index 526a8c4..30fda97 100644 --- a/third_party/WebKit/LayoutTests/http/tests/push_messaging/pushmessagedata-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/push_messaging/pushmessagedata-expected.txt
@@ -8,6 +8,5 @@ FAIL PushMessageData handling of invalid JSON content. Test bug: need to pass exception to assert_throws() FAIL PushMessageData should not be constructable. Test bug: need to pass exception to assert_throws() PASS PushEventInit data is not normalized -FAIL PushMessageData throws when passed SharedArrayBuffer view. Test bug: need to pass exception to assert_throws() Harness: the test ran to completion.
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/base-url-data-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/base-url-data-expected.txt new file mode 100644 index 0000000..fbb7066 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/base-url-data-expected.txt
@@ -0,0 +1,5 @@ +CONSOLE ERROR: line 7: 'data' URLs may not be used as base URLs for a document. +This is a testharness.js-based test. +PASS 'data:' is an invalid base URL. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/base-url-data.html b/third_party/WebKit/LayoutTests/http/tests/security/base-url-data.html new file mode 100644 index 0000000..9bab9fa --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/base-url-data.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<head> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/get-host-info.sub.js"></script> + + <base href="data:/,This is a data URL."> +</head> +<body> + <script> + async_test(t => { + var base = document.querySelector('base'); + var img = new Image(); + img.onload = t.step_func_done(_ => { + assert_equals(img.naturalWidth, 76, "Image loaded correctly."); + assert_equals(img.src, "http://127.0.0.1:8000/security/resources/abe.png"); + assert_equals(base.href, 'data:/,This is a data URL.'); + }); + img.onerror = t.unreached_func("Image should have loaded."); + + img.src = "/security/resources/abe.png"; + }, "'data:' is an invalid base URL."); + </script> +</body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/base-url-javascript-expected.txt b/third_party/WebKit/LayoutTests/http/tests/security/base-url-javascript-expected.txt new file mode 100644 index 0000000..29f78161 --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/base-url-javascript-expected.txt
@@ -0,0 +1,5 @@ +CONSOLE ERROR: line 7: 'javascript' URLs may not be used as base URLs for a document. +This is a testharness.js-based test. +PASS 'javascript:' is an invalid base URL. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/base-url-javascript.html b/third_party/WebKit/LayoutTests/http/tests/security/base-url-javascript.html new file mode 100644 index 0000000..b0024ba --- /dev/null +++ b/third_party/WebKit/LayoutTests/http/tests/security/base-url-javascript.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<head> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/get-host-info.sub.js"></script> + + <base href="javascript:// This is JavaScript"> +</head> +<body> + <script> + async_test(t => { + var base = document.querySelector('base'); + var img = new Image(); + img.onload = t.step_func_done(_ => { + assert_equals(img.naturalWidth, 76, "Image loaded correctly."); + assert_equals(img.src, "http://127.0.0.1:8000/security/resources/abe.png"); + assert_equals(base.href, 'javascript:// This is JavaScript'); + }); + img.onerror = t.unreached_func("Image should have loaded."); + + img.src = "/security/resources/abe.png"; + }, "'javascript:' is an invalid base URL."); + </script> +</body>
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index fac2702..36fe8d6f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -712,6 +712,7 @@ attribute @@toStringTag method acquire method constructor + method query interface MessageChannel attribute @@toStringTag getter port1 @@ -1082,6 +1083,7 @@ getter bodyUsed getter cache getter credentials + getter destination getter headers getter integrity getter keepalive @@ -1140,11 +1142,6 @@ method unregister method update setter onupdatefound -interface SharedArrayBuffer - attribute @@toStringTag - getter byteLength - method constructor - method slice interface StorageManager attribute @@toStringTag method constructor @@ -2578,7 +2575,6 @@ method constructor method getWriter [GLOBAL OBJECT] - attribute Atomics attribute console attribute internals getter clients
diff --git a/third_party/WebKit/LayoutTests/http/tests/w3c/webperf/submission/Google/HighResolutionTime/worker-dedicated-basic.html b/third_party/WebKit/LayoutTests/http/tests/w3c/webperf/submission/Google/HighResolutionTime/worker-dedicated-basic.html deleted file mode 100644 index 9c1f1692..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/w3c/webperf/submission/Google/HighResolutionTime/worker-dedicated-basic.html +++ /dev/null
@@ -1,49 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<title>window.performance.now in dedicated workers</title> -<link rel="author" title="Google" href="http://www.google.com/" /> -<link rel="help" href="https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime2/Overview.html"/> -<script src="/w3c/resources/testharness.js"></script> -<script src="/w3c/resources/testharnessreport.js"></script> -<script src="/w3c/webperf/resources/webperftestharness.js"></script> -<link rel="stylesheet" href="/w3c/resources/testharness.css" /> -<script> -setup({explicit_done: true}); - -var tests = [ - '"performance" in self;', - '"now" in self.performance;', - 'self.performance.now();', -]; - -var startTime = window.performance.now(); -var worker = new Worker("/w3c/webperf/resources/worker.js"); - -worker.onmessage = function(event) { - var results = event.data; - assert_true(results.length == 3); - test_true(results[0], "self.performance is defined"); - test_true(results[1], "self.performance.now is defined"); - test_greater_than(results[2], 0, "Time in the worker should be positive"); - test_greater_than(window.performance.now(), results[2], "Time in the worker should be before the current time in the main document"); - done(); -} - -function start() { - test_true(!("workerStart" in worker), "workerStart not defined on the Worker object"); - worker.postMessage(tests); -} - -window.addEventListener("load", start); -</script> -</head> -<body> -<h1>Description</h1> -<p>This test validates that performance.now() exists in dedicated workers and reports reasonable times.</p> - -<div id="log"></div> - -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/w3c/webperf/submission/Google/HighResolutionTime/worker-shared-basic.html b/third_party/WebKit/LayoutTests/http/tests/w3c/webperf/submission/Google/HighResolutionTime/worker-shared-basic.html deleted file mode 100644 index fbd35452..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/w3c/webperf/submission/Google/HighResolutionTime/worker-shared-basic.html +++ /dev/null
@@ -1,70 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<title>window.performance.now in shared workers</title> -<link rel="author" title="Google" href="http://www.google.com/" /> -<link rel="help" href="https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime2/Overview.html"/> -<script src="/w3c/resources/testharness.js"></script> -<script src="/w3c/resources/testharnessreport.js"></script> -<script src="/w3c/webperf/resources/webperftestharness.js"></script> -<link rel="stylesheet" href="/w3c/resources/testharness.css" /> -<script> -setup({explicit_done: true, timeout:10000}); - -var tests = [ - '"performance" in self;', - '"now" in self.performance;', - 'self.performance.now();', -]; - -var worker = new SharedWorker("/w3c/webperf/resources/worker.js"); - -worker.port.onmessage = function(event) { - var results = event.data; - assert_true(results.length == 3); - test_true(results[0], "self.performance is defined"); - test_true(results[1], "self.performance.now is defined"); - test_greater_than(window.performance.now(), results[2], "Time since origin time should be greater in the main document than the worker"); - setupIframe(); -} - -window.iframeStartTime = 0; -window.test_iframe = function(event, iframeNow) { - var workerTime = event.data; - test_greater_than(workerTime, window.iframeStartTime, "Time since origin time should be greater in the worker than the iframe", {}); - worker.port.postMessage(["close();"]); - done(); -} - -function start() { - test_true(!("workerStart" in worker), "workerStart is not defined on the SharedWorker object"); - worker.port.postMessage(tests); -} - -function setupIframe() { - var iframe = document.createElement("iframe"); - var body = document.getElementsByTagName("body")[0]; - body.appendChild(iframe); - var script = iframe.contentWindow.document.createElement("script"); - script.innerHTML = - "window.top.iframeStartTime = window.performance.now();" + - "var worker = new SharedWorker('/w3c/webperf/resources/worker.js');" + - "worker.port.onmessage = function(event) {" + - " window.top.test_iframe(event);" + - "};" + - "worker.port.postMessage(['self.performance.now();']);"; - iframe.contentWindow.document.body.appendChild(script); -} - -window.addEventListener("load", start); -</script> -</head> -<body> -<h1>Description</h1> -<p>This test validates that performance.now() exists in shared workers and reports reasonable times.</p> - -<div id="log"></div> - -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/send-arraybufferview-expected.txt b/third_party/WebKit/LayoutTests/http/tests/websocket/send-arraybufferview-expected.txt index f4970fe..e939eae9 100644 --- a/third_party/WebKit/LayoutTests/http/tests/websocket/send-arraybufferview-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/websocket/send-arraybufferview-expected.txt
@@ -2,7 +2,6 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -PASS ws.send(createSharedArrayBufferView()) threw exception TypeError: Failed to execute 'send' on 'WebSocket': The provided ArrayBufferView value must not be shared.. PASS PASS: Message #0. PASS PASS: Message #1. PASS PASS: Message #2.
diff --git a/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt b/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt index d8e0d140..f5b800f 100644 --- a/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt +++ b/third_party/WebKit/LayoutTests/http/tests/worklet/webexposed/global-interface-listing-paint-worklet-expected.txt
@@ -258,10 +258,6 @@ CONSOLE MESSAGE: line 147: method pipeThrough CONSOLE MESSAGE: line 147: method pipeTo CONSOLE MESSAGE: line 147: method tee -CONSOLE MESSAGE: line 147: interface SharedArrayBuffer -CONSOLE MESSAGE: line 147: getter byteLength -CONSOLE MESSAGE: line 147: method constructor -CONSOLE MESSAGE: line 147: method slice CONSOLE MESSAGE: line 147: interface StylePropertyMap : StylePropertyMapReadOnly CONSOLE MESSAGE: line 147: method append CONSOLE MESSAGE: line 147: method constructor @@ -290,7 +286,6 @@ CONSOLE MESSAGE: line 147: method constructor CONSOLE MESSAGE: line 147: method getWriter CONSOLE MESSAGE: line 147: global object -CONSOLE MESSAGE: line 147: attribute Atomics CONSOLE MESSAGE: line 147: attribute console CONSOLE MESSAGE: line 147: getter devicePixelRatio CONSOLE MESSAGE: line 147: method gc @@ -554,10 +549,6 @@ CONSOLE MESSAGE: line 147: method pipeThrough CONSOLE MESSAGE: line 147: method pipeTo CONSOLE MESSAGE: line 147: method tee -CONSOLE MESSAGE: line 147: interface SharedArrayBuffer -CONSOLE MESSAGE: line 147: getter byteLength -CONSOLE MESSAGE: line 147: method constructor -CONSOLE MESSAGE: line 147: method slice CONSOLE MESSAGE: line 147: interface StylePropertyMap : StylePropertyMapReadOnly CONSOLE MESSAGE: line 147: method append CONSOLE MESSAGE: line 147: method constructor @@ -586,7 +577,6 @@ CONSOLE MESSAGE: line 147: method constructor CONSOLE MESSAGE: line 147: method getWriter CONSOLE MESSAGE: line 147: global object -CONSOLE MESSAGE: line 147: attribute Atomics CONSOLE MESSAGE: line 147: attribute console CONSOLE MESSAGE: line 147: getter devicePixelRatio CONSOLE MESSAGE: line 147: method gc
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/async-stacks-for-load-and-error-events-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/async-stacks-for-load-and-error-events-expected.txt new file mode 100644 index 0000000..23adcae --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/async-stacks-for-load-and-error-events-expected.txt
@@ -0,0 +1,10 @@ +Tests async stacks for load and error events +Test load event.. +onScriptLoad at test.js:7:6 +--load-- +(anonymous) at test.js:3:11 +Test error event.. +onScriptError at test.js:7:6 +--error-- +(anonymous) at test.js:3:11 +
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/async-stacks-for-load-and-error-events.js b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/async-stacks-for-load-and-error-events.js new file mode 100644 index 0000000..b8c63d6 --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/async-stacks-for-load-and-error-events.js
@@ -0,0 +1,55 @@ +(async function(testRunner) { + var {page, session, dp} = await testRunner.startBlank( + 'Tests async stacks for load and error events'); + let debuggerId = (await dp.Debugger.enable()).result.debuggerId; + let debuggers = new Map([[debuggerId, dp.Debugger]]); + dp.Debugger.setAsyncCallStackDepth({maxDepth: 32}); + + testRunner.log('Test load event..'); + await dp.Runtime.evaluate({ + expression: ` + let script = document.createElement('script'); + script.src = '${testRunner.url('resources/simple.js')}'; + script.addEventListener('load', onScriptLoad); + document.body.appendChild(script); + + function onScriptLoad() { + debugger; + } + //# sourceURL=test.js + ` + }); + + let {params: {callFrames, asyncStackTrace, asyncStackTraceId}} = + await dp.Debugger.oncePaused(); + await testRunner.logStackTrace( + debuggers, + {callFrames, parent: asyncStackTrace, parentId: asyncStackTraceId}, + debuggerId); + dp.Debugger.resume(); + + testRunner.log('Test error event..'); + await dp.Runtime.evaluate({ + expression: ` + script = document.createElement('script'); + script.src = '${testRunner.url('resources/should-be-no-script.js')}'; + script.addEventListener('error', onScriptError); + document.body.appendChild(script); + + function onScriptError() { + debugger; + } + //# sourceURL=test.js + ` + }); + + ({params: {callFrames, asyncStackTrace, asyncStackTraceId}} = + await dp.Debugger.oncePaused()); + await testRunner.logStackTrace( + debuggers, + {callFrames, parent: asyncStackTrace, parentId: asyncStackTraceId}, + debuggerId); + dp.Debugger.resume(); + + testRunner.completeTest(); +}) \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/resources/simple.js b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/resources/simple.js new file mode 100644 index 0000000..b0400ee9 --- /dev/null +++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/resources/simple.js
@@ -0,0 +1 @@ +function foo() {}
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt index eeb68b0..4ba42ad2 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-expected.txt
@@ -14,7 +14,18 @@ "baseURL": "<string>", "contentLanguage": "de", "documentEncoding": "windows-1252", - "frameId": "<string>" + "frameId": "<string>", + "eventListeners": [ + { + "type": "documentListener", + "useCapture": false, + "passive": false, + "once": false, + "scriptId": "19", + "lineNumber": 42, + "columnNumber": 46 + } + ] }, { "nodeType": 1, @@ -90,7 +101,9 @@ 11, 61, 62, - 63 + 63, + 64, + 66 ], "attributes": [ { @@ -186,9 +199,24 @@ { "name": "style", "value": "display:inline-block; width: 200px" + }, + { + "name": "id", + "value": "A" } ], - "layoutNodeIndex": 7 + "layoutNodeIndex": 7, + "eventListeners": [ + { + "type": "listenerA", + "useCapture": false, + "passive": false, + "once": false, + "scriptId": "19", + "lineNumber": 39, + "columnNumber": 59 + } + ] }, { "nodeType": 3, @@ -272,7 +300,24 @@ "childNodeIndexes": [ 26 ], - "layoutNodeIndex": 12 + "attributes": [ + { + "name": "id", + "value": "B" + } + ], + "layoutNodeIndex": 12, + "eventListeners": [ + { + "type": "listenerB", + "useCapture": false, + "passive": false, + "once": false, + "scriptId": "19", + "lineNumber": 40, + "columnNumber": 59 + } + ] }, { "nodeType": 3, @@ -313,9 +358,24 @@ { "name": "style", "value": "transform: rotateZ(90deg); width: 200px" + }, + { + "name": "id", + "value": "C" } ], - "layoutNodeIndex": 16 + "layoutNodeIndex": 16, + "eventListeners": [ + { + "type": "listenerC", + "useCapture": false, + "passive": false, + "once": false, + "scriptId": "19", + "lineNumber": 41, + "columnNumber": 59 + } + ] }, { "nodeType": 3, @@ -626,6 +686,27 @@ { "nodeType": 3, "nodeName": "#text", + "nodeValue": "\n", + "backendNodeId": "<number>" + }, + { + "nodeType": 1, + "nodeName": "SCRIPT", + "nodeValue": "", + "backendNodeId": "<number>", + "childNodeIndexes": [ + 65 + ] + }, + { + "nodeType": 3, + "nodeName": "#text", + "nodeValue": "\ndocument.getElementById('A').addEventListener('listenerA', () => {});\ndocument.getElementById('B').addEventListener('listenerB', () => {});\ndocument.getElementById('C').addEventListener('listenerC', () => {});\ndocument.addEventListener('documentListener', () => {});\n", + "backendNodeId": "<number>" + }, + { + "nodeType": 3, + "nodeName": "#text", "nodeValue": "\n\n\n", "backendNodeId": "<number>" }
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.js b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.js index e78070ee0..348f3764 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.js +++ b/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot.js
@@ -19,7 +19,7 @@ } var whitelist = ['transform', 'transform-origin', 'height', 'width', 'display', 'outline-color', 'color']; - var response = await dp.DOMSnapshot.getSnapshot({'computedStyleWhitelist': whitelist}); + var response = await dp.DOMSnapshot.getSnapshot({'computedStyleWhitelist': whitelist, 'includeEventListeners': true}); if (response.error) testRunner.log(response); else
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/resources/dom-snapshot.html b/third_party/WebKit/LayoutTests/inspector-protocol/resources/dom-snapshot.html index e74560c..c1bc20a8 100644 --- a/third_party/WebKit/LayoutTests/inspector-protocol/resources/dom-snapshot.html +++ b/third_party/WebKit/LayoutTests/inspector-protocol/resources/dom-snapshot.html
@@ -18,7 +18,7 @@ <body class="body-class"> <div style="font-family: ahem;"> <div class="class1">Some Text</div> And More Text - <div style="display:inline-block; width: 200px"> + <div style="display:inline-block; width: 200px" id="A"> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque sit amet est sem. Aenean ut neque volutpat, posuere odio at, mollis nibh. Aenean sodales nulla et @@ -27,14 +27,20 @@ </p> <ul class="class3"> <li class="class4"></li> - <span>Lets have a span</span> + <span id="B">Lets have a span</span> </ul> </div> - <div style="transform: rotateZ(90deg); width: 200px">Rotated text!</div> + <div style="transform: rotateZ(90deg); width: 200px" id="C">Rotated text!</div> <iframe src='./simple-iframe.html' width="400" height="200"></iframe> <div id="shadow-host"></div> <a href="https://www.google.com/">Click ME!</a> </div> <meta http-equiv="content-language" content="de"> +<script> +document.getElementById('A').addEventListener('listenerA', () => {}); +document.getElementById('B').addEventListener('listenerB', () => {}); +document.getElementById('C').addEventListener('listenerC', () => {}); +document.addEventListener('documentListener', () => {}); +</script> </body> </html>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-id.html b/third_party/WebKit/LayoutTests/media/track/track-id.html deleted file mode 100644 index 6edeebc..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-id.html +++ /dev/null
@@ -1,27 +0,0 @@ -<!DOCTYPE html> -<title>Tests that the TextTrack "id" attribute is set appropriately.</title> -<video> - <track id="LoremIpsum" src="captions-webvtt/captions-fast.vtt" default> -</video> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> -test(function() { - var video = document.querySelector("video"); - - var track = document.querySelector("track"); - - var textTrack = track.track; - - // Test default attribute value. - assert_equals(textTrack.id, "LoremIpsum"); - assert_equals(video.textTracks[0].id, "LoremIpsum"); - - // Make sure we can look up tracks by id. - assert_equals(video.textTracks.getTrackById("LoremIpsum"), textTrack); - - // Test that it's readonly. - textTrack.id = "newvalue"; - assert_equals(textTrack.id, "LoremIpsum"); -}); -</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html b/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html deleted file mode 100644 index 7e2e95ff..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-insert-after-load-crash.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<title>Tests that inserting a track element immediately after a load() doesn't crash.</title> -<script src="../media-file.js"></script> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> -async_test(function(t) { - var video = document.createElement('video'); - video.src = findMediaFile('video', '../content/test'); - video.load(); - video.appendChild(document.createElement('track')); - video.onloadedmetadata = t.step_func_done(); -}); -</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-selection-metadata.html b/third_party/WebKit/LayoutTests/media/track/track-selection-metadata.html deleted file mode 100644 index 352cabb..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-selection-metadata.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<title>Multiple 'metadata' tracks with 'default'</title> -<script src=../../resources/testharness.js></script> -<script src=../../resources/testharnessreport.js></script> -<video src="../content/test.ogv"> - <track kind="metadata" src="captions-webvtt/tc005-default-styles.vtt" id="t1"> - <track kind="metadata" src="captions-webvtt/tc025-class.vtt" default id="t2hidden"> - <track kind="metadata" src="captions-webvtt/tc005-metadata-area.vtt" id="t3"> - <track kind="metadata" src="captions-webvtt/tc004-webvtt-file.vtt" default id="t4hidden"> -</video> -<script> -async_test(function() { - var video = document.querySelector('video'); - video.onloadstart = this.step_func(function() { - var tracks = video.textTracks; - assert_equals(tracks.length, 4); - for (var i = 0; i < tracks.length; ++i) { - assert_equals(tracks[i].kind, 'metadata'); - - var trackElement = document.getElementById(tracks[i].id); - if (tracks[i].id.indexOf('hidden') != -1) { - assert_true(trackElement.default); - assert_equals(tracks[i].mode, 'hidden'); - } else { - assert_false(trackElement.default); - assert_equals(tracks[i].mode, 'disabled'); - } - } - this.done(); - }); -}); -</script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list.html b/third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list.html deleted file mode 100644 index d903d89a..0000000 --- a/third_party/WebKit/LayoutTests/media/track/track-text-track-cue-list.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<title>Tests TextTrackCueList functionality: length, operator[], and getCueById().</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<video> - <track src="captions-webvtt/tc013-settings.vtt" kind="captions" default> -</video> -<script> -async_test(function(t) { - var testTrack = document.querySelector("track"); - - testTrack.onload = t.step_func_done(function() { - var cues = testTrack.track.cues; - - // Testing TextTrackCueList length. - assert_equals(cues.length, 4); - - // Testing TextTrackCueList [] operator. - assert_equals(cues[0].id, "1"); - assert_equals(cues[3].id, "4"); - assert_object_equals(cues[4], undefined); - - // Testing TextTrackCueList getCueById(). - assert_equals(cues.getCueById("1").startTime, 0); - assert_equals(cues.getCueById("4").startTime, 121); - assert_object_equals(cues.getCueById("junk"), undefined); - }); -}); -</script> \ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/paint/clipath/clip-path-with-background-and-box-behind-expected.png b/third_party/WebKit/LayoutTests/paint/clipath/clip-path-with-background-and-box-behind-expected.png deleted file mode 100644 index dbc6b93..0000000 --- a/third_party/WebKit/LayoutTests/paint/clipath/clip-path-with-background-and-box-behind-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/clip/clip-path-constant-repaint-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/clip/clip-path-constant-repaint-expected.txt index efd92f1d..4100ecd6 100644 --- a/third_party/WebKit/LayoutTests/paint/invalidation/clip/clip-path-constant-repaint-expected.txt +++ b/third_party/WebKit/LayoutTests/paint/invalidation/clip/clip-path-constant-repaint-expected.txt
@@ -11,6 +11,13 @@ "bounds": [800, 300], "backfaceVisibility": "hidden", "backgroundColor": "#FF0000E6", + "maskLayer": [ + { + "name": "Child Clipping Mask Layer", + "position": [8, 8], + "bounds": [800, 300] + } + ], "transform": 2 } ],
diff --git a/third_party/WebKit/LayoutTests/paint/overflow/composited-scroll-vertical-rl-expected.html b/third_party/WebKit/LayoutTests/paint/overflow/composited-scroll-vertical-rl-expected.html new file mode 100644 index 0000000..d80d1e2 --- /dev/null +++ b/third_party/WebKit/LayoutTests/paint/overflow/composited-scroll-vertical-rl-expected.html
@@ -0,0 +1,14 @@ +<!DOCTYPE html> +<script> +if (window.internals) + internals.settings.setMockScrollbarsEnabled(true); +onload = function() { + container.scrollLeft = 2000; +}; +</script> +There should be a green square. +<div id="container" style="width: 200px; height: 200px; overflow: scroll"> + <div style="width: 2000px"> + <div style="width: 100px; height: 100px; background: green; float: right"></div> + </div> +</div>
diff --git a/third_party/WebKit/LayoutTests/paint/overflow/composited-scroll-vertical-rl.html b/third_party/WebKit/LayoutTests/paint/overflow/composited-scroll-vertical-rl.html new file mode 100644 index 0000000..6271146 --- /dev/null +++ b/third_party/WebKit/LayoutTests/paint/overflow/composited-scroll-vertical-rl.html
@@ -0,0 +1,11 @@ +<!DOCTYPE html> +<script> +if (window.internals) + internals.settings.setMockScrollbarsEnabled(true); +</script> +There should be a green square. +<div style="width: 200px; height: 200px; overflow: scroll; will-change: transform; writing-mode: vertical-rl"> + <div style="width: 2000px"> + <div style="width: 100px; height: 100px; background: green"></div> + </div> +</div>
diff --git a/third_party/WebKit/LayoutTests/platform/linux/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt new file mode 100644 index 0000000..f757823 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt
@@ -0,0 +1,38 @@ +This is a testharness.js-based test. +PASS Normal redirect to same-origin scope. +FAIL Normal redirect to same-origin scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL Normal redirect to same-origin scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS Normal redirect to other-origin scope. +PASS SW-fallbacked redirect to same-origin out-scope. +PASS SW-fallbacked redirect to same-origin same-scope. +FAIL SW-fallbacked redirect to same-origin same-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL SW-fallbacked redirect to same-origin same-scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS SW-fallbacked redirect to same-origin other-scope. +PASS SW-fallbacked redirect to other-origin out-scope. +PASS SW-fallbacked redirect to other-origin in-scope. +PASS SW-generated redirect to same-origin out-scope. +FAIL SW-generated redirect to same-origin out-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F"] +FAIL SW-generated redirect to same-origin out-scope with different hashfragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2"] +PASS SW-generated redirect to same-origin same-scope. +PASS SW-generated redirect to same-origin other-scope. +PASS SW-generated redirect to other-origin out-scope. +PASS SW-generated redirect to other-origin in-scope. +PASS SW-fetched redirect to same-origin out-scope. +PASS SW-fetched redirect to same-origin same-scope. +PASS SW-fetched redirect to same-origin other-scope. +PASS SW-fetched redirect to other-origin out-scope. +PASS SW-fetched redirect to other-origin in-scope. +PASS Redirect to same-origin out-scope with opaque redirect response. +PASS Redirect to same-origin same-scope with opaque redirect response. +PASS Redirect to same-origin other-scope with opaque redirect response. +PASS Redirect to other-origin out-scope with opaque redirect response. +PASS Redirect to other-origin in-scope with opaque redirect response. +PASS No location redirect response. +PASS Redirect to same-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin same-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin other-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin in-scope with opaque redirect response which is passed through Cache. +PASS No location redirect response via Cache. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/linux/external/wpt/xhr/send-content-type-string-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/external/wpt/xhr/send-content-type-string-expected.txt new file mode 100644 index 0000000..b9f5ae0 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/external/wpt/xhr/send-content-type-string-expected.txt
@@ -0,0 +1,6 @@ +This is a testharness.js-based test. +PASS XMLHttpRequest: send() - Content-Type +FAIL XMLHttpRequest: send() - Content-Type 1 assert_equals: expected "text/html;charset=UTF-8" but got "application/xml;charset=UTF-8" +PASS XMLHttpRequest: send() - Content-Type 2 +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.png index d704c66f..d437802 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.png index e6fe887..7e0d5aa 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.txt deleted file mode 100644 index feb6d8a..0000000 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.txt +++ /dev/null
@@ -1,28 +0,0 @@ -layer at (0,0) size 800x600 - LayoutView at (0,0) size 800x600 -layer at (0,0) size 800x600 - LayoutBlockFlow {HTML} at (0,0) size 800x600 - LayoutBlockFlow {BODY} at (8,8) size 784x584 - LayoutBlockFlow {P} at (0,0) size 784x20 - LayoutText {#text} at (0,0) size 440x19 - text run at (0,0) width 440: "This pixel test verifies that we position combining characters properly." - LayoutBlockFlow {P} at (0,36) size 784x20 - LayoutText {#text} at (0,0) size 708x19 - text run at (0,0) width 708: "The backslash-looking mark should connect into the the character on the center, not be positioned off to the side." - LayoutBlockFlow {DIV} at (0,72) size 784x123 - LayoutText {#text} at (0,16) size 259x80 - text run at (0,16) width 259: "\x{915}+ \x{947} = \x{915}\x{947}" - LayoutBlockFlow {DIV} at (0,195) size 784x53 - LayoutText {#text} at (0,7) size 112x34 - text run at (0,7) width 112: "\x{915}+ \x{947} = \x{915}\x{947}" - LayoutBlockFlow {P} at (0,264) size 784x20 - LayoutText {#text} at (0,0) size 603x19 - text run at (0,0) width 603: "The three words should be separated by spaces, and there should be no marks above the spaces." - LayoutBlockFlow {DIV} at (0,300) size 784x131 - LayoutText {#text} at (0,27) size 766x80 - text run at (0,27) width 426: "\x{E40}\x{E01}\x{E21}\x{E2A}\x{E4C} \x{E1F}\x{E31}\x{E07}\x{E40}\x{E1E}\x{E25}\x{E07} " - text run at (426,27) width 340: "\x{E42}\x{E1B}\x{E23}\x{E42}\x{E21}\x{E17}\x{E40}\x{E27}\x{E47}\x{E1A}" - LayoutBlockFlow {DIV} at (0,431) size 784x57 - LayoutText {#text} at (0,12) size 326x34 - text run at (0,12) width 182: "\x{E40}\x{E01}\x{E21}\x{E2A}\x{E4C} \x{E1F}\x{E31}\x{E07}\x{E40}\x{E1E}\x{E25}\x{E07} " - text run at (182,12) width 144: "\x{E42}\x{E1B}\x{E23}\x{E42}\x{E21}\x{E17}\x{E40}\x{E27}\x{E47}\x{E1A}"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/danda-space-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/danda-space-expected.png index 29cd3326e..f14c97e 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/danda-space-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/danda-space-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.png index 7c5226f5..299f4810 100644 --- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.png +++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-blobs/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-blobs/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt new file mode 100644 index 0000000..f757823 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-blobs/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt
@@ -0,0 +1,38 @@ +This is a testharness.js-based test. +PASS Normal redirect to same-origin scope. +FAIL Normal redirect to same-origin scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL Normal redirect to same-origin scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS Normal redirect to other-origin scope. +PASS SW-fallbacked redirect to same-origin out-scope. +PASS SW-fallbacked redirect to same-origin same-scope. +FAIL SW-fallbacked redirect to same-origin same-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL SW-fallbacked redirect to same-origin same-scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS SW-fallbacked redirect to same-origin other-scope. +PASS SW-fallbacked redirect to other-origin out-scope. +PASS SW-fallbacked redirect to other-origin in-scope. +PASS SW-generated redirect to same-origin out-scope. +FAIL SW-generated redirect to same-origin out-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F"] +FAIL SW-generated redirect to same-origin out-scope with different hashfragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2"] +PASS SW-generated redirect to same-origin same-scope. +PASS SW-generated redirect to same-origin other-scope. +PASS SW-generated redirect to other-origin out-scope. +PASS SW-generated redirect to other-origin in-scope. +PASS SW-fetched redirect to same-origin out-scope. +PASS SW-fetched redirect to same-origin same-scope. +PASS SW-fetched redirect to same-origin other-scope. +PASS SW-fetched redirect to other-origin out-scope. +PASS SW-fetched redirect to other-origin in-scope. +PASS Redirect to same-origin out-scope with opaque redirect response. +PASS Redirect to same-origin same-scope with opaque redirect response. +PASS Redirect to same-origin other-scope with opaque redirect response. +PASS Redirect to other-origin out-scope with opaque redirect response. +PASS Redirect to other-origin in-scope with opaque redirect response. +PASS No location redirect response. +PASS Redirect to same-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin same-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin other-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin in-scope with opaque redirect response which is passed through Cache. +PASS No location redirect response via Cache. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/outofblink-cors/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/outofblink-cors/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt new file mode 100644 index 0000000..f757823 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/outofblink-cors/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt
@@ -0,0 +1,38 @@ +This is a testharness.js-based test. +PASS Normal redirect to same-origin scope. +FAIL Normal redirect to same-origin scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL Normal redirect to same-origin scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS Normal redirect to other-origin scope. +PASS SW-fallbacked redirect to same-origin out-scope. +PASS SW-fallbacked redirect to same-origin same-scope. +FAIL SW-fallbacked redirect to same-origin same-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL SW-fallbacked redirect to same-origin same-scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS SW-fallbacked redirect to same-origin other-scope. +PASS SW-fallbacked redirect to other-origin out-scope. +PASS SW-fallbacked redirect to other-origin in-scope. +PASS SW-generated redirect to same-origin out-scope. +FAIL SW-generated redirect to same-origin out-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F"] +FAIL SW-generated redirect to same-origin out-scope with different hashfragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2"] +PASS SW-generated redirect to same-origin same-scope. +PASS SW-generated redirect to same-origin other-scope. +PASS SW-generated redirect to other-origin out-scope. +PASS SW-generated redirect to other-origin in-scope. +PASS SW-fetched redirect to same-origin out-scope. +PASS SW-fetched redirect to same-origin same-scope. +PASS SW-fetched redirect to same-origin other-scope. +PASS SW-fetched redirect to other-origin out-scope. +PASS SW-fetched redirect to other-origin in-scope. +PASS Redirect to same-origin out-scope with opaque redirect response. +PASS Redirect to same-origin same-scope with opaque redirect response. +PASS Redirect to same-origin other-scope with opaque redirect response. +PASS Redirect to other-origin out-scope with opaque redirect response. +PASS Redirect to other-origin in-scope with opaque redirect response. +PASS No location redirect response. +PASS Redirect to same-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin same-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin other-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin in-scope with opaque redirect response which is passed through Cache. +PASS No location redirect response via Cache. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/service-worker-script-streaming/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/service-worker-script-streaming/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt new file mode 100644 index 0000000..f757823 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/service-worker-script-streaming/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt
@@ -0,0 +1,38 @@ +This is a testharness.js-based test. +PASS Normal redirect to same-origin scope. +FAIL Normal redirect to same-origin scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL Normal redirect to same-origin scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS Normal redirect to other-origin scope. +PASS SW-fallbacked redirect to same-origin out-scope. +PASS SW-fallbacked redirect to same-origin same-scope. +FAIL SW-fallbacked redirect to same-origin same-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL SW-fallbacked redirect to same-origin same-scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS SW-fallbacked redirect to same-origin other-scope. +PASS SW-fallbacked redirect to other-origin out-scope. +PASS SW-fallbacked redirect to other-origin in-scope. +PASS SW-generated redirect to same-origin out-scope. +FAIL SW-generated redirect to same-origin out-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F"] +FAIL SW-generated redirect to same-origin out-scope with different hashfragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2"] +PASS SW-generated redirect to same-origin same-scope. +PASS SW-generated redirect to same-origin other-scope. +PASS SW-generated redirect to other-origin out-scope. +PASS SW-generated redirect to other-origin in-scope. +PASS SW-fetched redirect to same-origin out-scope. +PASS SW-fetched redirect to same-origin same-scope. +PASS SW-fetched redirect to same-origin other-scope. +PASS SW-fetched redirect to other-origin out-scope. +PASS SW-fetched redirect to other-origin in-scope. +PASS Redirect to same-origin out-scope with opaque redirect response. +PASS Redirect to same-origin same-scope with opaque redirect response. +PASS Redirect to same-origin other-scope with opaque redirect response. +PASS Redirect to other-origin out-scope with opaque redirect response. +PASS Redirect to other-origin in-scope with opaque redirect response. +PASS No location redirect response. +PASS Redirect to same-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin same-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin other-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin in-scope with opaque redirect response which is passed through Cache. +PASS No location redirect response via Cache. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/http/tests/inspector-protocol/network-data-length-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/http/tests/inspector-protocol/network-data-length-expected.txt deleted file mode 100644 index 2a9d867..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/http/tests/inspector-protocol/network-data-length-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Ensures that data and header length sent from protocol is proper sizes -Test started -Network agent enabled - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?redirect=1 - isChunked: null - isH2: null - redirected: true - headersSize: 0 - receivedDataSize: 0 - reportedTotalSize: 182 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?cached=1 - isChunked: false - isH2: false - redirected: false - headersSize: 101 - receivedDataSize: 0 - reportedTotalSize: 101 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php? - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 0 - reportedTotalSize: 173 - -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt deleted file mode 100644 index 2a9d867..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Ensures that data and header length sent from protocol is proper sizes -Test started -Network agent enabled - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?redirect=1 - isChunked: null - isH2: null - redirected: true - headersSize: 0 - receivedDataSize: 0 - reportedTotalSize: 182 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?cached=1 - isChunked: false - isH2: false - redirected: false - headersSize: 101 - receivedDataSize: 0 - reportedTotalSize: 101 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php? - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 0 - reportedTotalSize: 173 - -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/inspector-protocol/network-data-length-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/inspector-protocol/network-data-length-expected.txt deleted file mode 100644 index 2a9d867..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/http/tests/inspector-protocol/network-data-length-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Ensures that data and header length sent from protocol is proper sizes -Test started -Network agent enabled - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?redirect=1 - isChunked: null - isH2: null - redirected: true - headersSize: 0 - receivedDataSize: 0 - reportedTotalSize: 182 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?cached=1 - isChunked: false - isH2: false - redirected: false - headersSize: 101 - receivedDataSize: 0 - reportedTotalSize: 101 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php? - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 0 - reportedTotalSize: 173 - -
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt deleted file mode 100644 index 2a9d867..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Ensures that data and header length sent from protocol is proper sizes -Test started -Network agent enabled - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?redirect=1 - isChunked: null - isH2: null - redirected: true - headersSize: 0 - receivedDataSize: 0 - reportedTotalSize: 182 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?cached=1 - isChunked: false - isH2: false - redirected: false - headersSize: 101 - receivedDataSize: 0 - reportedTotalSize: 101 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php? - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 0 - reportedTotalSize: 173 - -
diff --git a/third_party/WebKit/LayoutTests/platform/mac/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt new file mode 100644 index 0000000..f757823 --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/external/wpt/service-workers/service-worker/navigation-redirect.https-expected.txt
@@ -0,0 +1,38 @@ +This is a testharness.js-based test. +PASS Normal redirect to same-origin scope. +FAIL Normal redirect to same-origin scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL Normal redirect to same-origin scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS Normal redirect to other-origin scope. +PASS SW-fallbacked redirect to same-origin out-scope. +PASS SW-fallbacked redirect to same-origin same-scope. +FAIL SW-fallbacked redirect to same-origin same-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +FAIL SW-fallbacked redirect to same-origin same-scope with different hash fragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2#ref", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?#ref2"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-scope1.py%3F%23ref2", "https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?"] +PASS SW-fallbacked redirect to same-origin other-scope. +PASS SW-fallbacked redirect to other-origin out-scope. +PASS SW-fallbacked redirect to other-origin in-scope. +PASS SW-generated redirect to same-origin out-scope. +FAIL SW-generated redirect to same-origin out-scope with a hash fragment. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F"] +FAIL SW-generated redirect to same-origin out-scope with different hashfragments. assert_object_equals: Intercepted URLs should match. property "0" expected ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2#ref"] got ["https://web-platform.test:8444/service-workers/service-worker/resources/navigation-redirect-scope1.py?sw=gen&url=https%3A%2F%2Fweb-platform.test%3A8444%2Fservice-workers%2Fservice-worker%2Fresources%2Fnavigation-redirect-out-scope.py%3F%23ref2"] +PASS SW-generated redirect to same-origin same-scope. +PASS SW-generated redirect to same-origin other-scope. +PASS SW-generated redirect to other-origin out-scope. +PASS SW-generated redirect to other-origin in-scope. +PASS SW-fetched redirect to same-origin out-scope. +PASS SW-fetched redirect to same-origin same-scope. +PASS SW-fetched redirect to same-origin other-scope. +PASS SW-fetched redirect to other-origin out-scope. +PASS SW-fetched redirect to other-origin in-scope. +PASS Redirect to same-origin out-scope with opaque redirect response. +PASS Redirect to same-origin same-scope with opaque redirect response. +PASS Redirect to same-origin other-scope with opaque redirect response. +PASS Redirect to other-origin out-scope with opaque redirect response. +PASS Redirect to other-origin in-scope with opaque redirect response. +PASS No location redirect response. +PASS Redirect to same-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin same-scope with opaque redirect response which is passed through Cache. +PASS Redirect to same-origin other-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin out-scope with opaque redirect response which is passed through Cache. +PASS Redirect to other-origin in-scope with opaque redirect response which is passed through Cache. +PASS No location redirect response via Cache. +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/mac/http/tests/inspector-protocol/network-data-length-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/http/tests/inspector-protocol/network-data-length-expected.txt deleted file mode 100644 index cf83be2a..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/http/tests/inspector-protocol/network-data-length-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Ensures that data and header length sent from protocol is proper sizes -Test started -Network agent enabled - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?redirect=1 - isChunked: null - isH2: null - redirected: true - headersSize: 0 - receivedDataSize: 0 - reportedTotalSize: 197 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?cached=1 - isChunked: false - isH2: false - redirected: false - headersSize: 101 - receivedDataSize: 0 - reportedTotalSize: 101 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php? - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 0 - reportedTotalSize: 173 - -
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/clipath/clip-path-with-background-and-box-behind-expected.png b/third_party/WebKit/LayoutTests/platform/mac/paint/clipath/clip-path-with-background-and-box-behind-expected.png new file mode 100644 index 0000000..7733620c --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/mac/paint/clipath/clip-path-with-background-and-box-behind-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt deleted file mode 100644 index cf83be2a..0000000 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/inspector-protocol/network-data-length-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -Ensures that data and header length sent from protocol is proper sizes -Test started -Network agent enabled - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?size=4&flush_header_with_x_bytes=1&wait_after_headers_packet=25&flush_every=1&wait_every_x_bytes=1&wait_duration_every_x_bytes=25 - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 4 - reportedTotalSize: 177 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?redirect=1 - isChunked: null - isH2: null - redirected: true - headersSize: 0 - receivedDataSize: 0 - reportedTotalSize: 197 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php?cached=1 - isChunked: false - isH2: false - redirected: false - headersSize: 101 - receivedDataSize: 0 - reportedTotalSize: 101 - -url: http://127.0.0.1:8000/inspector-protocol/resources/data-xfer-resource.php? - isChunked: false - isH2: false - redirected: false - headersSize: 173 - receivedDataSize: 0 - reportedTotalSize: 173 - -
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index f0ce0bc..0a7a8e3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -756,6 +756,7 @@ getter bodyUsed getter cache getter credentials + getter destination getter headers getter integrity getter method @@ -810,11 +811,6 @@ method unregister method update setter onupdatefound -interface SharedArrayBuffer - attribute @@toStringTag - getter byteLength - method constructor - method slice interface StorageManager attribute @@toStringTag method constructor @@ -992,7 +988,6 @@ method constructor method getWriter [GLOBAL OBJECT] - attribute Atomics attribute console attribute internals getter clients
diff --git a/third_party/WebKit/LayoutTests/platform/win/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-expected.txt b/third_party/WebKit/LayoutTests/platform/win/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-expected.txt new file mode 100644 index 0000000..3a4b37af --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/external/wpt/html/semantics/forms/textfieldselection/selection-not-application-expected.txt
@@ -0,0 +1,196 @@ +This is a testharness.js-based test. +Found 192 tests; 185 PASS, 7 FAIL, 0 TIMEOUT, 0 NOTRUN. +PASS selectionStart on an input[type=hidden] returns null +PASS selectionEnd on an input[type=hidden] returns null +PASS selectionDirection on an input[type=hidden] returns null +PASS assigning selectionStart on an input[type=hidden] throws InvalidStateError +PASS assigning selectionEnd on an input[type=hidden] throws InvalidStateError +PASS assigning selectionDirection on an input[type=hidden] throws InvalidStateError +PASS setRangeText on an input[type=hidden] throws InvalidStateError +PASS setSelectionRange on an input[type=hidden] throws InvalidStateError +PASS selectionStart on an input[type=email] returns null +PASS selectionEnd on an input[type=email] returns null +PASS selectionDirection on an input[type=email] returns null +PASS assigning selectionStart on an input[type=email] throws InvalidStateError +PASS assigning selectionEnd on an input[type=email] throws InvalidStateError +PASS assigning selectionDirection on an input[type=email] throws InvalidStateError +PASS setRangeText on an input[type=email] throws InvalidStateError +PASS setSelectionRange on an input[type=email] throws InvalidStateError +PASS selectionStart on an input[type=datetime-local] returns null +PASS selectionEnd on an input[type=datetime-local] returns null +PASS selectionDirection on an input[type=datetime-local] returns null +PASS assigning selectionStart on an input[type=datetime-local] throws InvalidStateError +PASS assigning selectionEnd on an input[type=datetime-local] throws InvalidStateError +PASS assigning selectionDirection on an input[type=datetime-local] throws InvalidStateError +PASS setRangeText on an input[type=datetime-local] throws InvalidStateError +PASS setSelectionRange on an input[type=datetime-local] throws InvalidStateError +PASS selectionStart on an input[type=date] returns null +PASS selectionEnd on an input[type=date] returns null +PASS selectionDirection on an input[type=date] returns null +PASS assigning selectionStart on an input[type=date] throws InvalidStateError +PASS assigning selectionEnd on an input[type=date] throws InvalidStateError +PASS assigning selectionDirection on an input[type=date] throws InvalidStateError +PASS setRangeText on an input[type=date] throws InvalidStateError +PASS setSelectionRange on an input[type=date] throws InvalidStateError +PASS selectionStart on an input[type=month] returns null +PASS selectionEnd on an input[type=month] returns null +PASS selectionDirection on an input[type=month] returns null +PASS assigning selectionStart on an input[type=month] throws InvalidStateError +PASS assigning selectionEnd on an input[type=month] throws InvalidStateError +PASS assigning selectionDirection on an input[type=month] throws InvalidStateError +PASS setRangeText on an input[type=month] throws InvalidStateError +PASS setSelectionRange on an input[type=month] throws InvalidStateError +PASS selectionStart on an input[type=week] returns null +PASS selectionEnd on an input[type=week] returns null +PASS selectionDirection on an input[type=week] returns null +PASS assigning selectionStart on an input[type=week] throws InvalidStateError +PASS assigning selectionEnd on an input[type=week] throws InvalidStateError +PASS assigning selectionDirection on an input[type=week] throws InvalidStateError +PASS setRangeText on an input[type=week] throws InvalidStateError +PASS setSelectionRange on an input[type=week] throws InvalidStateError +PASS selectionStart on an input[type=time] returns null +PASS selectionEnd on an input[type=time] returns null +PASS selectionDirection on an input[type=time] returns null +PASS assigning selectionStart on an input[type=time] throws InvalidStateError +PASS assigning selectionEnd on an input[type=time] throws InvalidStateError +PASS assigning selectionDirection on an input[type=time] throws InvalidStateError +PASS setRangeText on an input[type=time] throws InvalidStateError +PASS setSelectionRange on an input[type=time] throws InvalidStateError +PASS selectionStart on an input[type=number] returns null +PASS selectionEnd on an input[type=number] returns null +PASS selectionDirection on an input[type=number] returns null +PASS assigning selectionStart on an input[type=number] throws InvalidStateError +PASS assigning selectionEnd on an input[type=number] throws InvalidStateError +PASS assigning selectionDirection on an input[type=number] throws InvalidStateError +PASS setRangeText on an input[type=number] throws InvalidStateError +PASS setSelectionRange on an input[type=number] throws InvalidStateError +PASS selectionStart on an input[type=range] returns null +PASS selectionEnd on an input[type=range] returns null +PASS selectionDirection on an input[type=range] returns null +PASS assigning selectionStart on an input[type=range] throws InvalidStateError +PASS assigning selectionEnd on an input[type=range] throws InvalidStateError +PASS assigning selectionDirection on an input[type=range] throws InvalidStateError +PASS setRangeText on an input[type=range] throws InvalidStateError +PASS setSelectionRange on an input[type=range] throws InvalidStateError +PASS selectionStart on an input[type=color] returns null +PASS selectionEnd on an input[type=color] returns null +PASS selectionDirection on an input[type=color] returns null +PASS assigning selectionStart on an input[type=color] throws InvalidStateError +PASS assigning selectionEnd on an input[type=color] throws InvalidStateError +PASS assigning selectionDirection on an input[type=color] throws InvalidStateError +PASS setRangeText on an input[type=color] throws InvalidStateError +PASS setSelectionRange on an input[type=color] throws InvalidStateError +PASS selectionStart on an input[type=checkbox] returns null +PASS selectionEnd on an input[type=checkbox] returns null +PASS selectionDirection on an input[type=checkbox] returns null +PASS assigning selectionStart on an input[type=checkbox] throws InvalidStateError +PASS assigning selectionEnd on an input[type=checkbox] throws InvalidStateError +PASS assigning selectionDirection on an input[type=checkbox] throws InvalidStateError +PASS setRangeText on an input[type=checkbox] throws InvalidStateError +PASS setSelectionRange on an input[type=checkbox] throws InvalidStateError +PASS selectionStart on an input[type=radio] returns null +PASS selectionEnd on an input[type=radio] returns null +PASS selectionDirection on an input[type=radio] returns null +PASS assigning selectionStart on an input[type=radio] throws InvalidStateError +PASS assigning selectionEnd on an input[type=radio] throws InvalidStateError +PASS assigning selectionDirection on an input[type=radio] throws InvalidStateError +PASS setRangeText on an input[type=radio] throws InvalidStateError +PASS setSelectionRange on an input[type=radio] throws InvalidStateError +PASS selectionStart on an input[type=file] returns null +PASS selectionEnd on an input[type=file] returns null +PASS selectionDirection on an input[type=file] returns null +PASS assigning selectionStart on an input[type=file] throws InvalidStateError +PASS assigning selectionEnd on an input[type=file] throws InvalidStateError +PASS assigning selectionDirection on an input[type=file] throws InvalidStateError +PASS setRangeText on an input[type=file] throws InvalidStateError +PASS setSelectionRange on an input[type=file] throws InvalidStateError +PASS selectionStart on an input[type=submit] returns null +PASS selectionEnd on an input[type=submit] returns null +PASS selectionDirection on an input[type=submit] returns null +PASS assigning selectionStart on an input[type=submit] throws InvalidStateError +PASS assigning selectionEnd on an input[type=submit] throws InvalidStateError +PASS assigning selectionDirection on an input[type=submit] throws InvalidStateError +PASS setRangeText on an input[type=submit] throws InvalidStateError +PASS setSelectionRange on an input[type=submit] throws InvalidStateError +PASS selectionStart on an input[type=image] returns null +PASS selectionEnd on an input[type=image] returns null +PASS selectionDirection on an input[type=image] returns null +PASS assigning selectionStart on an input[type=image] throws InvalidStateError +PASS assigning selectionEnd on an input[type=image] throws InvalidStateError +PASS assigning selectionDirection on an input[type=image] throws InvalidStateError +PASS setRangeText on an input[type=image] throws InvalidStateError +PASS setSelectionRange on an input[type=image] throws InvalidStateError +PASS selectionStart on an input[type=reset] returns null +PASS selectionEnd on an input[type=reset] returns null +PASS selectionDirection on an input[type=reset] returns null +PASS assigning selectionStart on an input[type=reset] throws InvalidStateError +PASS assigning selectionEnd on an input[type=reset] throws InvalidStateError +PASS assigning selectionDirection on an input[type=reset] throws InvalidStateError +PASS setRangeText on an input[type=reset] throws InvalidStateError +PASS setSelectionRange on an input[type=reset] throws InvalidStateError +PASS selectionStart on an input[type=button] returns null +PASS selectionEnd on an input[type=button] returns null +PASS selectionDirection on an input[type=button] returns null +PASS assigning selectionStart on an input[type=button] throws InvalidStateError +PASS assigning selectionEnd on an input[type=button] throws InvalidStateError +PASS assigning selectionDirection on an input[type=button] throws InvalidStateError +PASS setRangeText on an input[type=button] throws InvalidStateError +PASS setSelectionRange on an input[type=button] throws InvalidStateError +PASS selectionStart on an input[type=text] returns a value +PASS selectionEnd on an input[type=text] returns a value +FAIL selectionDirection on an input[type=text] returns a value assert_equals: expected "none" but got "forward" +PASS assigning selectionStart on an input[type=text] doesn't throw an exception +PASS assigning selectionEnd on an input[type=text] doesn't throw an exception +PASS assigning selectionDirection on an input[type=text] doesn't throw an exception +PASS setRangeText on an input[type=text] doesn't throw an exception +PASS setSelectionRange on an input[type=text] doesn't throw an exception +PASS selectionStart on an input[type=search] returns a value +PASS selectionEnd on an input[type=search] returns a value +FAIL selectionDirection on an input[type=search] returns a value assert_equals: expected "none" but got "forward" +PASS assigning selectionStart on an input[type=search] doesn't throw an exception +PASS assigning selectionEnd on an input[type=search] doesn't throw an exception +PASS assigning selectionDirection on an input[type=search] doesn't throw an exception +PASS setRangeText on an input[type=search] doesn't throw an exception +PASS setSelectionRange on an input[type=search] doesn't throw an exception +PASS selectionStart on an input[type=tel] returns a value +PASS selectionEnd on an input[type=tel] returns a value +FAIL selectionDirection on an input[type=tel] returns a value assert_equals: expected "none" but got "forward" +PASS assigning selectionStart on an input[type=tel] doesn't throw an exception +PASS assigning selectionEnd on an input[type=tel] doesn't throw an exception +PASS assigning selectionDirection on an input[type=tel] doesn't throw an exception +PASS setRangeText on an input[type=tel] doesn't throw an exception +PASS setSelectionRange on an input[type=tel] doesn't throw an exception +PASS selectionStart on an input[type=url] returns a value +PASS selectionEnd on an input[type=url] returns a value +FAIL selectionDirection on an input[type=url] returns a value assert_equals: expected "none" but got "forward" +PASS assigning selectionStart on an input[type=url] doesn't throw an exception +PASS assigning selectionEnd on an input[type=url] doesn't throw an exception +PASS assigning selectionDirection on an input[type=url] doesn't throw an exception +PASS setRangeText on an input[type=url] doesn't throw an exception +PASS setSelectionRange on an input[type=url] doesn't throw an exception +PASS selectionStart on an input[type=password] returns a value +PASS selectionEnd on an input[type=password] returns a value +FAIL selectionDirection on an input[type=password] returns a value assert_equals: expected "none" but got "forward" +PASS assigning selectionStart on an input[type=password] doesn't throw an exception +PASS assigning selectionEnd on an input[type=password] doesn't throw an exception +PASS assigning selectionDirection on an input[type=password] doesn't throw an exception +PASS setRangeText on an input[type=password] doesn't throw an exception +PASS setSelectionRange on an input[type=password] doesn't throw an exception +PASS selectionStart on an input[type=aninvalidtype] returns a value +PASS selectionEnd on an input[type=aninvalidtype] returns a value +FAIL selectionDirection on an input[type=aninvalidtype] returns a value assert_equals: expected "none" but got "forward" +PASS assigning selectionStart on an input[type=aninvalidtype] doesn't throw an exception +PASS assigning selectionEnd on an input[type=aninvalidtype] doesn't throw an exception +PASS assigning selectionDirection on an input[type=aninvalidtype] doesn't throw an exception +PASS setRangeText on an input[type=aninvalidtype] doesn't throw an exception +PASS setSelectionRange on an input[type=aninvalidtype] doesn't throw an exception +PASS selectionStart on an input[type=null] returns a value +PASS selectionEnd on an input[type=null] returns a value +FAIL selectionDirection on an input[type=null] returns a value assert_equals: expected "none" but got "forward" +PASS assigning selectionStart on an input[type=null] doesn't throw an exception +PASS assigning selectionEnd on an input[type=null] doesn't throw an exception +PASS assigning selectionDirection on an input[type=null] doesn't throw an exception +PASS setRangeText on an input[type=null] doesn't throw an exception +PASS setSelectionRange on an input[type=null] doesn't throw an exception +Harness: the test ran to completion. +
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/clipath/clip-path-with-background-and-box-behind-expected.png b/third_party/WebKit/LayoutTests/platform/win/paint/clipath/clip-path-with-background-and-box-behind-expected.png new file mode 100644 index 0000000..d9611fd --- /dev/null +++ b/third_party/WebKit/LayoutTests/platform/win/paint/clipath/clip-path-with-background-and-box-behind-expected.png Binary files differ
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html b/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html index d9d1bf0..0ee3380 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssMatrixComponent.html
@@ -75,17 +75,4 @@ assert_throws(new TypeError(), () => { new CSSMatrixComponent(undefined); }); }, "invalid number of arguments to the constructor throws"); -test(() => { - let matrix3d = new DOMMatrixReadOnly( - [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); - let matrix2d = new DOMMatrixReadOnly([1, 2, 5, 6, 13, 14]); - let matrixComponent = new CSSMatrixComponent(matrix3d); - matrixComponent.is2D = true; - assert_matrix_approx_equals(matrixComponent.matrix, matrix3d, EPSILON); - - let transformValue = new CSSTransformValue([matrixComponent]); - assert_true(transformValue.is2D); - assert_matrix_approx_equals(transformValue.toMatrix(), matrix2d, EPSILON); -}, "Matrix is converted to 2D inside CSSTransformValue when is2D is true."); - </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html b/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html deleted file mode 100644 index 8ed43658..0000000 --- a/third_party/WebKit/LayoutTests/typedcssom/cssPerspective.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script src="resources/comparisons.js"></script> - -<script> -let EPSILON = 1e-6; - -test(() => { - let transformValue = new CSSTransformValue([new CSSPerspective(CSS.em(10))]); - assert_throws(new TypeError(), () => { - transformValue.toMatrix(); - }); -}, "toMatrix throws TypeError if relative units are used"); - -test(() => { - let expectedMatrix = new DOMMatrixReadOnly(); - let transformValue = new CSSTransformValue([new CSSPerspective(CSS.px(-10))]); - assert_matrix_approx_equals(transformValue.toMatrix(), expectedMatrix, EPSILON); -}, "toMatrix is the identity when perspective is negative (which is invalid)"); - -</script> -
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html b/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html index bac1c6b50..4775e708 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssRotation.html
@@ -111,28 +111,4 @@ }); }, "Invalid arguments to constructor should throw"); -test(() => { - // Obtained by doing the following in a console: - // $0.style.transform = 'rotate3d(1, 2, 3, 10rad)'; - // getComputedStyle($0).transform - let expected3DMatrix = new DOMMatrixReadOnly( - [-0.707709, -0.173463, 0.684878, 0, - 0.698912, -0.313623, 0.642778, 0, - 0.103295, 0.933569, 0.343189, 0, - 0, 0, 0, 1]); - let expected2DMatrix = new DOMMatrixReadOnly( - [Math.cos(10), Math.sin(10), -Math.sin(10), Math.cos(10), 0, 0]); - - let rotation = new CSSRotation(1, 2, 3, CSS.rad(10)); - let transformValue = new CSSTransformValue([rotation]); - - assert_matrix_approx_equals( - transformValue.toMatrix(), expected3DMatrix, EPSILON); - - rotation.is2D = true; - - assert_matrix_approx_equals( - transformValue.toMatrix(), expected2DMatrix, EPSILON); -}, "x, y, and z attributes have no effect on toMatrix if is2D is set to true"); - </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html b/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html index 1260d3c7..aeed05a 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html +++ b/third_party/WebKit/LayoutTests/typedcssom/cssTranslation.html
@@ -61,12 +61,4 @@ assert_throws(new TypeError(), () => { new CSSTranslation(CSS.px(0)); }); }, "Invalid number of arguments to constructor throws an exception."); -test(() => { - let transformValue = new CSSTransformValue( - [new CSSTranslation(CSS.em(1), CSS.px(2), CSS.px(3))]); - assert_throws(new TypeError(), () => { - transformValue.toMatrix(); - }); -}, "toMatrix throws TypeError when relative lengths are used"); - </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/config-templates.js b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/config-templates.js index 38b424e..43a5914 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/config-templates.js +++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/config-templates.js
@@ -105,6 +105,17 @@ invalidObjects: [new CSSUnitValue(4, 'px')] }; +// TODO(crbug.com/774887): Flesh this out once we have a table of +// what properties normalize to what. +config_templates.positionConfig_ = { + validKeywords: [ + ], + validObjects: [ + ], + supportsMultiple: false, + invalidObjects: [] +}; + config_templates.lengthConfig = function() { return Object.assign({}, config_templates.lengthConfig_); }; @@ -114,3 +125,6 @@ config_templates.borderConfig = function() { return Object.assign({}, config_templates.borderConfig_); }; +config_templates.positionConfig = function() { + return Object.assign({}, config_templates.positionConfig_); +};
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/object-position.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/object-position.html new file mode 100644 index 0000000..214bb555 --- /dev/null +++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/object-position.html
@@ -0,0 +1,10 @@ +<!DOCTYPE html> +<script src='../../../resources/testharness.js'></script> +<script src='../../../resources/testharnessreport.js'></script> +<script src='property-suite.js'></script> +<script src='config-templates.js'></script> +<script> +let config = config_templates.positionConfig(); +config['property'] = 'object-position'; +runInlineStylePropertyMapTests(config); +</script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-objects/parse-parseAll.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-objects/parse-parseAll.html deleted file mode 100644 index 1137c7c..0000000 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-objects/parse-parseAll.html +++ /dev/null
@@ -1,63 +0,0 @@ -<!doctype html> -<meta charset="utf-8"> -<title>CSSStyleValue.parse and CSSStyleValue.parseAll tests</title> -<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-parse"> -<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-cssstylevalue-parseall"> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../resources/testhelper.js"></script> -<script> -'use strict'; - -for (const parseMethod of ['parse', 'parseAll']) { - test(() => { - assert_throws(new TypeError(), () => CSSStyleValue[parseMethod]('', 'foo')); - }, 'Calling CSSStyleValue.' + parseMethod + ' with an empty string throws a TypeError'); - - test(() => { - assert_throws(new TypeError(), () => CSSStyleValue[parseMethod]('lemon', 'ade')); - }, 'Calling CSSStyleValue.' + parseMethod + ' with an unsupported CSS property throws a TypeError'); - - test(() => { - assert_throws(new TypeError(), () => CSSStyleValue[parseMethod]('background', 'red')); - }, 'Calling CSSStyleValue.' + parseMethod + ' with a CSS shorthand throws a TypeError'); - - test(() => { - assert_throws(new SyntaxError(), () => CSSStyleValue[parseMethod]('width', '10deg')); - }, 'Calling CSSStyleValue.' + parseMethod + ' with an invalid cssText for the given property throws a SyntaxError'); -} - -const gValidNonListTests = [ - { property: 'width', value: '10px', expected: CSS.px(10), desc: 'a valid cssText for the given property' }, - { property: 'wIdTh', value: '10px', expected: CSS.px(10), desc: 'a mixed case cssText' }, - { property: '--foo', value: '10%', expected: new CSSUnparsedValue('10%'), desc: 'a custom property' }, -]; - -for (const {property, value, expected, desc} of gValidNonListTests) { - test(() => { - const result = CSSStyleValue.parse(property, value); - assert_style_value_equals(result, expected); - }, 'Calling CSSStyleValue.parse with ' + desc + ' returns a valid CSSStyleValue'); -} - -for (const {property, value, expected, desc} of gValidNonListTests) { - test(() => { - const result = CSSStyleValue.parseAll(property, value); - assert_style_value_array_equals(result, [expected]); - }, 'Calling CSSStyleValue.parseAll with ' + desc + ' returns a single-element list containing a valid CSSStyleValue'); -} - -test(() => { - const result = CSSStyleValue.parse('transition-duration', '1s, 2s, 3s'); - assert_style_value_equals(result, CSS.s(1)); -}, 'Calling CSSStyleValue.parse with a list-value property returns first list value'); - -test(() => { - const result = CSSStyleValue.parseAll('transition-duration', '1s, 2s, 3s'); - assert_equals(result.length, 3); - for (let i = 0; i < result.length; i++) { - assert_style_value_equals(result[i], CSS.s(i + 1)); - } -}, 'Calling CSSStyleValue.parseAll with a list-value property returns a sequence of values'); - -</script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTransformValue.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTransformValue.html index 5f360ab..f84b5ee 100644 --- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTransformValue.html +++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssTransformValue.html
@@ -52,6 +52,11 @@ }, 'CSSTransformValue.is2D is readonly'); test(() => { + assert_throws(new TypeError(), () => new CSSTransformValue([new CSSTranslation(CSS.px(1), CSS.em(1))]).toMatrix()); + assert_throws(new TypeError(), () => new CSSTransformValue([new CSSPerspective(CSS.em(1))]).toMatrix()); +}, 'Calling CSSTransformValue.toMatrix containing relative units throws TypeError'); + +test(() => { const transform = new CSSTransformValue([ new CSSTranslation(CSS.px(1), CSS.px(2), CSS.px(3)) ]); @@ -126,6 +131,27 @@ }, 'CSSTransformValue.toMatrix multiplies its component matrices'); test(() => { + const transformMatrix = new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + let transformArray = [ + new CSSTranslation(CSS.px(1), CSS.px(1), CSS.px(1)), + new CSSRotation(1, 2, 3, CSS.deg(90)), + new CSSScale(2, 3, 2), + new CSSMatrixComponent(transformMatrix), + ]; + + transformArray.forEach(transform => transform.is2D = true); + + let expectedMatrix = new DOMMatrix(); + expectedMatrix.translateSelf(1, 1); + expectedMatrix.rotateSelf(90); + expectedMatrix.scaleSelf(2, 3); + expectedMatrix.multiplySelf(new DOMMatrixReadOnly([1, 2, 5, 6, 13, 14])); + + const transform = new CSSTransformValue(transformArray); + assert_matrix_approx_equals(transform.toMatrix(), expectedMatrix, EPSILON); +}, 'CSSTransformValue.toMatrix respects is2D changes in its components'); + +test(() => { const transformArray = [ new CSSScale(2, 2), new CSSMatrixComponent(new DOMMatrixReadOnly([1, 1, 1, 1, 1, 1])),
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/declared/delete-rule-crash.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/declared/delete-rule-crash.html new file mode 100644 index 0000000..87c86d7 --- /dev/null +++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/declared/delete-rule-crash.html
@@ -0,0 +1,29 @@ +<!DOCTYPE html> +<html> +<head> +<title>Crash test for using declared style map with no associated style rule</title> +<style> +#target { color: red; } +</style> +</head> +<body> +<script src="../../../resources/testharness.js"></script> +<script src="../../../resources/testharnessreport.js"></script> +<script> +test(() => { + var sheet = document.styleSheets[0]; + var styleMap = sheet.cssRules[0].attributeStyleMap; + sheet.deleteRule(0); + gc(); + + // Make sure none of the styleMap methods crash. + styleMap.get('color'); + styleMap.getAll('color'); + [...styleMap]; + styleMap.getProperties(); + styleMap.append('transition-duration', '1s'); + styleMap.delete('color'); + styleMap.set('width', '10px'); + styleMap.update('width', () => CSS.px(1)); +}, "Deleting a style rule does not crash the corresponding declared style map"); +</script>
diff --git a/third_party/WebKit/LayoutTests/virtual/spv175/fast/pagination/README.txt b/third_party/WebKit/LayoutTests/virtual/spv175/fast/pagination/README.txt new file mode 100644 index 0000000..c68ac05 --- /dev/null +++ b/third_party/WebKit/LayoutTests/virtual/spv175/fast/pagination/README.txt
@@ -0,0 +1 @@ +# This suite runs tests with --enable-slimming-paint-v175
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt index f0ce0bc..0a7a8e3 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -756,6 +756,7 @@ getter bodyUsed getter cache getter credentials + getter destination getter headers getter integrity getter method @@ -810,11 +811,6 @@ method unregister method update setter onupdatefound -interface SharedArrayBuffer - attribute @@toStringTag - getter byteLength - method constructor - method slice interface StorageManager attribute @@toStringTag method constructor @@ -992,7 +988,6 @@ method constructor method getWriter [GLOBAL OBJECT] - attribute Atomics attribute console attribute internals getter clients
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt index bbf6842..f81c0491 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -726,6 +726,7 @@ [Worker] getter bodyUsed [Worker] getter cache [Worker] getter credentials +[Worker] getter destination [Worker] getter headers [Worker] getter integrity [Worker] getter method @@ -777,11 +778,6 @@ [Worker] method unregister [Worker] method update [Worker] setter onupdatefound -[Worker] interface SharedArrayBuffer -[Worker] attribute @@toStringTag -[Worker] getter byteLength -[Worker] method constructor -[Worker] method slice [Worker] interface StorageManager [Worker] attribute @@toStringTag [Worker] method constructor @@ -1000,7 +996,6 @@ [Worker] attribute @@toStringTag [Worker] method constructor [Worker] [GLOBAL OBJECT] -[Worker] attribute Atomics [Worker] attribute console [Worker] attribute internals [Worker] getter onmessage
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt index 1835841e..e7211df 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -4485,6 +4485,7 @@ getter bodyUsed getter cache getter credentials + getter destination getter headers getter integrity getter method @@ -5737,11 +5738,6 @@ method elementsFromPoint method getSelection setter innerHTML -interface SharedArrayBuffer - attribute @@toStringTag - getter byteLength - method constructor - method slice interface SharedWorker : EventTarget attribute @@toStringTag getter onerror @@ -7924,7 +7920,6 @@ setter search setter username [GLOBAL OBJECT] - attribute Atomics attribute GCController attribute accessibilityController attribute chrome
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt index 49b14b46..8e5d8a78 100644 --- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -721,6 +721,7 @@ [Worker] getter bodyUsed [Worker] getter cache [Worker] getter credentials +[Worker] getter destination [Worker] getter headers [Worker] getter integrity [Worker] getter method @@ -772,11 +773,6 @@ [Worker] method unregister [Worker] method update [Worker] setter onupdatefound -[Worker] interface SharedArrayBuffer -[Worker] attribute @@toStringTag -[Worker] getter byteLength -[Worker] method constructor -[Worker] method slice [Worker] interface SharedWorkerGlobalScope : WorkerGlobalScope [Worker] attribute @@toStringTag [Worker] attribute PERSISTENT @@ -1000,7 +996,6 @@ [Worker] attribute @@toStringTag [Worker] method constructor [Worker] [GLOBAL OBJECT] -[Worker] attribute Atomics [Worker] attribute console [Worker] attribute internals [Worker] getter name
diff --git a/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js b/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js index 3f395cb..1cdefebd 100644 --- a/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js +++ b/third_party/WebKit/LayoutTests/vr/resources/mock-vr-service.js
@@ -12,9 +12,16 @@ } } - requestPresent(submitFrameClient, request) { - this.presentation_provider_.bind(submitFrameClient, request); - return Promise.resolve({success: true}); + requestPresent(submitFrameClient, request, presentOptions) { + this.presentation_provider_.bind(submitFrameClient, request, + presentOptions); + // The JavaScript bindings convert c_style_names to camelCase names. + var options = new device.mojom.VRDisplayFrameTransportOptions(); + options.transportMethod = + device.mojom.VRDisplayFrameTransportMethod.SUBMIT_AS_MAILBOX_HOLDER; + options.waitForTransferNotification = true; + options.waitForRenderNotification = true; + return Promise.resolve({success: true, transportOptions: options}); } setPose(pose) { @@ -67,16 +74,11 @@ submitFrame(frameId, mailboxHolder, timeWaited) { // Trigger the submit completion callbacks here. WARNING: The - // Javascript-based mojo mocks are *not* re-entrant. In the current - // default implementation, Javascript calls display.submitFrame, and the - // corresponding C++ code uses a reentrant mojo call that waits for - // onSubmitFrameTransferred to indicate completion. This never finishes - // when using the mocks since the incoming calls are queued until the - // current execution context finishes. As a workaround, use the alternate - // "WebVRExperimentalRendering" mode which works without reentrant calls, - // the code only checks for completion on the *next* frame, see the - // corresponding option setting in runtime_enabled_features.json5. - this.submitFrameClient_.onSubmitFrameTransferred(); + // Javascript-based mojo mocks are *not* re-entrant. It's OK to + // wait for these notifications on the next frame, but waiting + // within the current frame would never finish since the incoming + // calls would be queued until the current execution context finishes. + this.submitFrameClient_.onSubmitFrameTransferred(true); this.submitFrameClient_.onSubmitFrameRendered(); }
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/audionodeoptions.js b/third_party/WebKit/LayoutTests/webaudio/constructor/audionodeoptions.js index 083a286..293e8e0 100644 --- a/third_party/WebKit/LayoutTests/webaudio/constructor/audionodeoptions.js +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/audionodeoptions.js
@@ -46,19 +46,14 @@ // values and make sure an error is thrown. let errorType = 'NotSupportedError'; - should(() => { - node = new window[nodeName]( - context, - Object.assign( - {}, expectedNodeOptions.additionalOptions, {channelCount: 0})); - }, 'new ' + nodeName + '(c, {channelCount: 0}}', ).throw(errorType); - - should(() => { - node = new window[nodeName]( - context, - Object.assign( - {}, expectedNodeOptions.additionalOptions, {channelCount: 99})); - }, 'new ' + nodeName + '(c, {channelCount: 99}}').throw(errorType); + [0, 99].forEach(testValue => { + should(() => { + node = new window[nodeName]( + context, Object.assign({}, expectedNodeOptions.additionalOptions, { + channelCount: testValue + })); + }, `new ${nodeName}(c, {channelCount: ${testValue}})`).throw(errorType); + }); } // Test channelCountMode @@ -82,45 +77,38 @@ if (expectedNodeOptions.channelCountMode && expectedNodeOptions.channelCountMode.isFixed) { // Channel count mode is fixed. Test setting to something else throws. - let testChannelCountModeMap = { - 'max': 'clamped-max', - 'clamped-max': 'explicit', - 'explicit': 'max' - }; - testChannelCountMode = - testChannelCountModeMap[expectedNodeOptions.channelCountMode.value]; - should( - () => { - node = new window[nodeName]( - context, - Object.assign( - {}, expectedNodeOptions.additionalOptions, - {channelCountMode: testChannelCountMode})); - }, - 'new ' + nodeName + '(c, {channelCountMode: "' + testChannelCountMode + - '"}') - .throw(expectedNodeOptions.channelCountMode.errorType); + ['max', 'clamped-max', 'explicit'].forEach(testValue => { + if (testValue !== expectedNodeOptions.channelCountMode.value) { + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelCountMode: testValue})); + }, + `new ${nodeName}(c, {channelCountMode: "${testValue}"})`) + .throw(expectedNodeOptions.channelCountMode.errorType); + } + }); } else { // Mode is not fixed. Verify that we can set the mode to all valid // values, and that we throw for invalid values. - should(() => { - node = new window[nodeName]( - context, Object.assign({}, expectedNodeOptions.additionalOptions, { - channelCountMode: 'clamped-max' - })); - }, 'new ' + nodeName + '(c, {channelCountMode: "clamped-max"}').notThrow(); - should(node.channelCountMode, 'node.channelCountMode after invalid setter') - .beEqualTo('clamped-max'); + let testValues = ['max', 'clamped-max', 'explicit']; - should(() => { - node = new window[nodeName]( - context, Object.assign({}, expectedNodeOptions.additionalOptions, { - channelCountMode: 'explicit' - })); - }, 'new ' + nodeName + '(c, {channelCountMode: "explicit"}').notThrow(); - should(node.channelCountMode, 'node.channelCountMode') - .beEqualTo('explicit'); + testValues.forEach(testValue => { + should(() => { + node = new window[nodeName]( + context, Object.assign({}, expectedNodeOptions.additionalOptions, { + channelCountMode: testValue + })); + }, `new ${nodeName}(c, {channelCountMode: "${testValue}"})`).notThrow(); + should( + node.channelCountMode, 'node.channelCountMode after valid setter') + .beEqualTo(testValue); + + }); should( () => { @@ -133,41 +121,72 @@ 'new ' + nodeName + '(c, {channelCountMode: "foobar"}') .throw('TypeError'); should(node.channelCountMode, 'node.channelCountMode after invalid setter') - .beEqualTo('explicit'); + .beEqualTo(testValues[testValues.length - 1]); } // Test channelInterpretation - should(() => { - node = new window[nodeName]( - context, Object.assign({}, expectedNodeOptions.additionalOptions, { - channelInterpretation: 'speakers' - })); - }, 'new ' + nodeName + '(c, {channelInterpretation: "speakers"})').notThrow(); - should(node.channelInterpretation, 'node.channelInterpretation') - .beEqualTo('speakers'); + if (expectedNodeOptions.channelInterpretation && + expectedNodeOptions.channelInterpretation.isFixed) { + // The channel interpretation is fixed. Verify that we throw an + // error if we try to change it. + ['speakers', 'discrete'].forEach(testValue => { + if (testValue !== expectedNodeOptions.channelInterpretation.value) { + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionOptions, + {channelInterpretation: testValue})); + }, + `new ${nodeName}(c, {channelInterpretation: "${testValue}"})`) + .throw(expectedNodeOptions.channelInterpretation.errorType); + } + }); + } else { + // Channel interpretation is not fixed. Verify that we can set it + // to all possible values. + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelInterpretation: 'speakers'})); + }, + 'new ' + nodeName + '(c, {channelInterpretation: "speakers"})') + .notThrow(); + should(node.channelInterpretation, 'node.channelInterpretation') + .beEqualTo('speakers'); - should(() => { - node = new window[nodeName]( - context, Object.assign({}, expectedNodeOptions.additionalOptions, { - channelInterpretation: 'discrete' - })); - }, 'new ' + nodeName + '(c, {channelInterpretation: "discrete"})').notThrow(); - should(node.channelInterpretation, 'node.channelInterpretation') - .beEqualTo('discrete'); + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelInterpretation: 'discrete'})); + }, + 'new ' + nodeName + '(c, {channelInterpretation: "discrete"})') + .notThrow(); + should(node.channelInterpretation, 'node.channelInterpretation') + .beEqualTo('discrete'); - should( - () => { - node = new window[nodeName]( - context, Object.assign({}, expectedNodeOptions.additionalOptions, { - channelInterpretation: 'foobar' - })); - }, - 'new ' + nodeName + '(c, {channelInterpretation: "foobar"})') - .throw('TypeError'); - should( - node.channelInterpretation, - 'node.channelInterpretation after invalid setter') - .beEqualTo('discrete'); + should( + () => { + node = new window[nodeName]( + context, + Object.assign( + {}, expectedNodeOptions.additionalOptions, + {channelInterpretation: 'foobar'})); + }, + 'new ' + nodeName + '(c, {channelInterpretation: "foobar"})') + .throw('TypeError'); + should( + node.channelInterpretation, + 'node.channelInterpretation after invalid setter') + .beEqualTo('discrete'); + } } function initializeContext(should) {
diff --git a/third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html b/third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html index a760305..5447b5c 100644 --- a/third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html +++ b/third_party/WebKit/LayoutTests/webaudio/constructor/channelsplitter.html
@@ -33,7 +33,7 @@ numberOfOutputs: 6, channelCount: 6, channelCountMode: 'explicit', - channelInterpretation: 'speakers' + channelInterpretation: 'discrete' }); task.done(); @@ -46,7 +46,12 @@ channelCountMode: { value: 'explicit', isFixed: true, - } + }, + channelInterpretation: { + value: 'discrete', + isFixed: true, + errorType: 'InvalidStateError' + }, }); task.done(); });
diff --git a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt index 64b79d2c4..ef83f68 100644 --- a/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt +++ b/third_party/WebKit/LayoutTests/webaudio/dom-exceptions-expected.txt
@@ -75,12 +75,8 @@ PASS AnalyserNode.getByteFrequencyData(null) threw TypeError: "Failed to execute 'getByteFrequencyData' on 'AnalyserNode': parameter 1 is not of type 'Uint8Array'.". PASS AnalyserNode.getFloatTimeDomainData(null) threw TypeError: "Failed to execute 'getFloatTimeDomainData' on 'AnalyserNode': parameter 1 is not of type 'Float32Array'.". PASS AnalyserNode.getByteTimeDomainData(null) threw TypeError: "Failed to execute 'getByteTimeDomainData' on 'AnalyserNode': parameter 1 is not of type 'Uint8Array'.". -PASS AnalyserNode.getFloatFrequencyData(SharedArrayBuffer view) threw TypeError: "Failed to execute 'getFloatFrequencyData' on 'AnalyserNode': The provided ArrayBufferView value must not be shared.". -PASS AnalyserNode.getByteFrequencyData(SharedArrayBuffer view) threw TypeError: "Failed to execute 'getByteFrequencyData' on 'AnalyserNode': The provided ArrayBufferView value must not be shared.". -PASS AnalyserNode.getFloatTimeDomainData(SharedArrayBuffer view) threw TypeError: "Failed to execute 'getFloatTimeDomainData' on 'AnalyserNode': The provided ArrayBufferView value must not be shared.". -PASS AnalyserNode.getByteTimeDomainData(SharedArrayBuffer view) threw TypeError: "Failed to execute 'getByteTimeDomainData' on 'AnalyserNode': The provided ArrayBufferView value must not be shared.". PASS AudioBuffer.getChannelData(2) threw IndexSizeError: "Failed to execute 'getChannelData' on 'AudioBuffer': channel index (2) exceeds number of channels (1)". -PASS < [createAnalyser] All assertions passed. (total 28 assertions) +PASS < [createAnalyser] All assertions passed. (total 24 assertions) PASS > [Init test nodes] Create test nodes for the following tests PASS node = context.createGain() did not throw an exception. PASS node2 = context.createGain() did not throw an exception. @@ -115,10 +111,7 @@ PASS node.getFrequencyResponse(null, new Float32Array(1), new Float32Array(1)) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': parameter 1 is not of type 'Float32Array'.". PASS node.getFrequencyResponse(new Float32Array(1), null, new Float32Array(1)) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': parameter 2 is not of type 'Float32Array'.". PASS node.getFrequencyResponse(new Float32Array(1), new Float32Array(1), null) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': parameter 3 is not of type 'Float32Array'.". -PASS node.getFrequencyResponse(shared_view, nonshared_view, nonshared_view) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': The provided ArrayBufferView value must not be shared.". -PASS node.getFrequencyResponse(nonshared_view, shared_view, nonshared_view) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': The provided ArrayBufferView value must not be shared.". -PASS node.getFrequencyResponse(nonshared_view, nonshared_view, shared_view) threw TypeError: "Failed to execute 'getFrequencyResponse' on 'BiquadFilterNode': The provided ArrayBufferView value must not be shared.". -PASS < [biquad] All assertions passed. (total 7 assertions) +PASS < [biquad] All assertions passed. (total 4 assertions) PASS > [offline-audio-context] PASS new OfflineAudioContext(32, 100, context.sampleRate) did not throw an exception. PASS new OfflineAudioContext(0, 100, context.sampleRate) threw NotSupportedError: "Failed to construct 'OfflineAudioContext': The number of channels provided (0) is outside the range [1, 32].".
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt index fe87c02..0d14ec5b 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -651,6 +651,7 @@ [Worker] attribute @@toStringTag [Worker] method acquire [Worker] method constructor +[Worker] method query [Worker] interface MessageChannel [Worker] attribute @@toStringTag [Worker] getter port1 @@ -998,6 +999,7 @@ [Worker] getter bodyUsed [Worker] getter cache [Worker] getter credentials +[Worker] getter destination [Worker] getter headers [Worker] getter integrity [Worker] getter keepalive @@ -1053,11 +1055,6 @@ [Worker] method unregister [Worker] method update [Worker] setter onupdatefound -[Worker] interface SharedArrayBuffer -[Worker] attribute @@toStringTag -[Worker] getter byteLength -[Worker] method constructor -[Worker] method slice [Worker] interface StorageManager [Worker] attribute @@toStringTag [Worker] method constructor @@ -2532,7 +2529,6 @@ [Worker] attribute @@toStringTag [Worker] method constructor [Worker] [GLOBAL OBJECT] -[Worker] attribute Atomics [Worker] attribute console [Worker] attribute internals [Worker] getter onmessage
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt index 1145ec6..5e13b0e 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -3980,6 +3980,7 @@ attribute @@toStringTag method acquire method constructor + method query interface MIDIAccess : EventTarget attribute @@toStringTag getter inputs @@ -5394,6 +5395,7 @@ getter bodyUsed getter cache getter credentials + getter destination getter headers getter integrity getter keepalive @@ -6677,11 +6679,6 @@ method elementsFromPoint method getSelection setter innerHTML -interface SharedArrayBuffer - attribute @@toStringTag - getter byteLength - method constructor - method slice interface SharedWorker : EventTarget attribute @@toStringTag getter onerror @@ -9163,7 +9160,6 @@ setter search setter username [GLOBAL OBJECT] - attribute Atomics attribute GCController attribute accessibilityController attribute chrome
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt index db17871..77e9bc39 100644 --- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt +++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -646,6 +646,7 @@ [Worker] attribute @@toStringTag [Worker] method acquire [Worker] method constructor +[Worker] method query [Worker] interface MessageChannel [Worker] attribute @@toStringTag [Worker] getter port1 @@ -993,6 +994,7 @@ [Worker] getter bodyUsed [Worker] getter cache [Worker] getter credentials +[Worker] getter destination [Worker] getter headers [Worker] getter integrity [Worker] getter keepalive @@ -1048,11 +1050,6 @@ [Worker] method unregister [Worker] method update [Worker] setter onupdatefound -[Worker] interface SharedArrayBuffer -[Worker] attribute @@toStringTag -[Worker] getter byteLength -[Worker] method constructor -[Worker] method slice [Worker] interface SharedWorkerGlobalScope : WorkerGlobalScope [Worker] attribute @@toStringTag [Worker] attribute PERSISTENT @@ -2532,7 +2529,6 @@ [Worker] attribute @@toStringTag [Worker] method constructor [Worker] [GLOBAL OBJECT] -[Worker] attribute Atomics [Worker] attribute console [Worker] attribute internals [Worker] getter name
diff --git a/third_party/WebKit/LayoutTests/webmidi/send-messages-expected.txt b/third_party/WebKit/LayoutTests/webmidi/send-messages-expected.txt index 27b298d..45be94a 100644 --- a/third_party/WebKit/LayoutTests/webmidi/send-messages-expected.txt +++ b/third_party/WebKit/LayoutTests/webmidi/send-messages-expected.txt
@@ -40,8 +40,6 @@ PASS output.send([], Infinity) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided double value is non-finite.. PASS output.send(new Uint8Array(), NaN) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided double value is non-finite.. PASS output.send(new Uint8Array(), Infinity) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided double value is non-finite.. -PASS output.send(new Uint8Array(new SharedArrayBuffer(4))) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided ArrayBufferView value must not be shared.. -PASS output.send(new Uint8Array(new SharedArrayBuffer(4), 0)) threw exception TypeError: Failed to execute 'send' on 'MIDIOutput': The provided ArrayBufferView value must not be shared.. PASS successfullyParsed is true TEST COMPLETE
diff --git a/third_party/WebKit/Source/bindings/bindings.gni b/third_party/WebKit/Source/bindings/bindings.gni index 1e41cd0..37bfff46 100644 --- a/third_party/WebKit/Source/bindings/bindings.gni +++ b/third_party/WebKit/Source/bindings/bindings.gni
@@ -204,7 +204,6 @@ "core/v8/V8BindingForTesting.cpp", "core/v8/V8BindingForTesting.h", "core/v8/WindowProxyTest.cpp", - "core/v8/V8BindingTest.cpp", "core/v8/V8ObjectBuilderTest.cpp", "core/v8/V8ScriptRunnerTest.cpp", "core/v8/serialization/SerializedScriptValueTest.cpp",
diff --git a/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfo.cpp b/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfo.cpp index 6b1d93c..ff2be23 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfo.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ReferrerScriptInfo.cpp
@@ -31,8 +31,8 @@ v8::Local<v8::Primitive> base_url_value = host_defined_options->Get(kBaseURL); String base_url_string = ToCoreStringWithNullCheck(v8::Local<v8::String>::Cast(base_url_value)); - KURL base_url(base_url_string); - DCHECK(base_url_string.IsEmpty() || base_url.IsValid()); + KURL base_url = base_url_string.IsEmpty() ? KURL() : KURL(base_url_string); + DCHECK(base_url.IsNull() || base_url.IsValid()); v8::Local<v8::Primitive> credentials_mode_value = host_defined_options->Get(kCredentialsMode);
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp index f388346..f363c0b 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
@@ -40,6 +40,7 @@ #include "core/dom/ExecutionContext.h" #include "core/dom/events/Event.h" #include "core/events/BeforeUnloadEvent.h" +#include "core/probe/CoreProbes.h" #include "core/workers/WorkerOrWorkletGlobalScope.h" #include "platform/InstanceCounters.h" #include "platform/bindings/V8PrivateProperty.h" @@ -241,6 +242,7 @@ void V8AbstractEventListener::ClearListenerObject() { if (!HasExistingListenerObject()) return; + probe::AsyncTaskCanceled(GetIsolate(), this); listener_.Clear(); if (worker_or_worklet_global_scope_) { worker_or_worklet_global_scope_->DeregisterEventListener(this);
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h b/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h index af78fce9..3f3de5e 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h +++ b/third_party/WebKit/Source/bindings/core/v8/V8BindingForCore.h
@@ -395,29 +395,6 @@ XPathNSResolver* ToXPathNSResolver(ScriptState*, v8::Local<v8::Value>); template <typename VectorType> -VectorType ToImplArray(const Vector<ScriptValue>& value, - v8::Isolate* isolate, - ExceptionState& exception_state) { - using ValueType = typename VectorType::ValueType; - using TraitsType = NativeValueTraits<ValueType>; - - if (value.size() > VectorType::MaxCapacity()) { - exception_state.ThrowRangeError("Array length exceeds supported limit."); - return VectorType(); - } - - VectorType result; - result.ReserveInitialCapacity(value.size()); - for (unsigned i = 0; i < value.size(); ++i) { - result.UncheckedAppend( - TraitsType::NativeValue(isolate, value[i].V8Value(), exception_state)); - if (exception_state.HadException()) - return VectorType(); - } - return result; -} - -template <typename VectorType> VectorType ToImplArguments(const v8::FunctionCallbackInfo<v8::Value>& info, int start_index, ExceptionState& exception_state) {
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp b/third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp deleted file mode 100644 index d9e6d44..0000000 --- a/third_party/WebKit/Source/bindings/core/v8/V8BindingTest.cpp +++ /dev/null
@@ -1,46 +0,0 @@ -// Copyright 2014 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 "bindings/core/v8/V8BindingForCore.h" - -#include "bindings/core/v8/ExceptionState.h" -#include "bindings/core/v8/IDLTypes.h" -#include "bindings/core/v8/NativeValueTraitsImpl.h" -#include "bindings/core/v8/ScriptValue.h" -#include "bindings/core/v8/ToV8ForCore.h" -#include "bindings/core/v8/V8BindingForTesting.h" -#include "platform/wtf/Vector.h" -#include "testing/gtest/include/gtest/gtest.h" - -namespace blink { - -namespace { - -TEST(V8BindingTest, ToImplArray) { - V8TestingScope scope; - { - v8::Local<v8::Array> v8_array = v8::Array::New(scope.GetIsolate(), 3); - EXPECT_TRUE( - V8CallBoolean(v8_array->Set(scope.GetContext(), ToV8(&scope, 0), - ToV8(&scope, "Vini, vidi, vici.")))); - EXPECT_TRUE(V8CallBoolean(v8_array->Set(scope.GetContext(), ToV8(&scope, 1), - ToV8(&scope, 65535)))); - EXPECT_TRUE(V8CallBoolean(v8_array->Set(scope.GetContext(), ToV8(&scope, 2), - ToV8(&scope, 0.125)))); - - NonThrowableExceptionState exception_state; - Vector<ScriptValue> script_value_vector = - NativeValueTraits<IDLSequence<ScriptValue>>::NativeValue( - scope.GetIsolate(), v8_array, exception_state); - Vector<String> string_vector = ToImplArray<Vector<String>>( - script_value_vector, scope.GetIsolate(), exception_state); - EXPECT_EQ(3U, string_vector.size()); - EXPECT_EQ("Vini, vidi, vici.", string_vector[0]); - EXPECT_EQ("65535", string_vector[1]); - } -} - -} // namespace - -} // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp index c0b2b8b3..254f549 100644 --- a/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/V8Initializer.cpp
@@ -473,17 +473,19 @@ } String specifier = ToCoreStringWithNullCheck(v8_specifier); - v8::Local<v8::Value> v8_referrer_url = v8_referrer->GetResourceName(); - KURL referrer_url; - if (v8_referrer_url->IsString()) { - String referrer_url_str = - ToCoreString(v8::Local<v8::String>::Cast(v8_referrer_url)); - referrer_url = KURL(NullURL(), referrer_url_str); + v8::Local<v8::Value> v8_referrer_resource_url = + v8_referrer->GetResourceName(); + KURL referrer_resource_url; + if (v8_referrer_resource_url->IsString()) { + String referrer_resource_url_str = + ToCoreString(v8::Local<v8::String>::Cast(v8_referrer_resource_url)); + if (!referrer_resource_url_str.IsEmpty()) + referrer_resource_url = KURL(NullURL(), referrer_resource_url_str); } ReferrerScriptInfo referrer_info = ReferrerScriptInfo::FromV8HostDefinedOptions( context, v8_referrer->GetHostDefinedOptions()); - modulator->ResolveDynamically(specifier, referrer_url, referrer_info, + modulator->ResolveDynamically(specifier, referrer_resource_url, referrer_info, resolver); return v8::Local<v8::Promise>::Cast(promise.V8Value()); }
diff --git a/third_party/WebKit/Source/bindings/core/v8/serialization/SerializedScriptValueFuzzer.cpp b/third_party/WebKit/Source/bindings/core/v8/serialization/SerializedScriptValueFuzzer.cpp index 37a4575..cbb2e29 100644 --- a/third_party/WebKit/Source/bindings/core/v8/serialization/SerializedScriptValueFuzzer.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/serialization/SerializedScriptValueFuzzer.cpp
@@ -9,6 +9,7 @@ #include <cstdint> #include "bindings/core/v8/V8BindingForCore.h" +#include "build/build_config.h" #include "core/frame/Settings.h" #include "core/messaging/MessagePort.h" #include "core/testing/DummyPageHolder.h" @@ -103,7 +104,14 @@ } // namespace blink -extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) { +// Explicitly specify some attributes to avoid issues with the linker dead- +// stripping the following function on macOS, as it is not called directly +// by fuzz target. LibFuzzer runtime uses dlsym() to resolve that function. +#if defined(OS_MACOSX) +__attribute__((used)) __attribute__((visibility("default"))) +#endif // defined(OS_MACOSX) +extern "C" int +LLVMFuzzerInitialize(int* argc, char*** argv) { return blink::LLVMFuzzerInitialize(argc, argv); }
diff --git a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl index eea0a350..9e7a6d5 100644 --- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
@@ -1041,7 +1041,7 @@ v8Contents.ByteLength(), kind, WTF::ArrayBufferContents::FreeMemory); - WTF::ArrayBufferContents contents(std::move(data), v8Contents.ByteLength(), WTF::ArrayBufferContents::k{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Shared); + WTF::ArrayBufferContents contents(std::move(data), WTF::ArrayBufferContents::k{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Shared); {{cpp_class}}* buffer = {{cpp_class}}::Create(contents); v8::Local<v8::Object> associatedWrapper = buffer->AssociateWithWrapper(v8::Isolate::GetCurrent(), buffer->GetWrapperTypeInfo(), object); DCHECK(associatedWrapper == object);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp index cfdab5a..6df7ae78 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8ArrayBuffer.cpp
@@ -94,7 +94,7 @@ v8Contents.ByteLength(), kind, WTF::ArrayBufferContents::FreeMemory); - WTF::ArrayBufferContents contents(std::move(data), v8Contents.ByteLength(), WTF::ArrayBufferContents::kNotShared); + WTF::ArrayBufferContents contents(std::move(data), WTF::ArrayBufferContents::kNotShared); TestArrayBuffer* buffer = TestArrayBuffer::Create(contents); v8::Local<v8::Object> associatedWrapper = buffer->AssociateWithWrapper(v8::Isolate::GetCurrent(), buffer->GetWrapperTypeInfo(), object); DCHECK(associatedWrapper == object);
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index e97ccf70..583136c 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -1813,6 +1813,7 @@ "frame/FrameTestHelpers.cpp", "frame/FrameTestHelpers.h", "frame/HistoryTest.cpp", + "frame/LocalFrameTest.cpp", "frame/LocalFrameViewTest.cpp", "frame/MHTMLTest.cpp", "frame/OriginsUsingFeaturesTest.cpp",
diff --git a/third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp index 1a5c55e..698f2670 100644 --- a/third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSBasicShapeInterpolationType.cpp
@@ -18,9 +18,9 @@ namespace { -const BasicShape* GetBasicShape(CSSPropertyID property, +const BasicShape* GetBasicShape(const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyShapeOutside: if (!style.ShapeOutside()) return nullptr; @@ -70,14 +70,14 @@ : public CSSInterpolationType::CSSConversionChecker { public: static std::unique_ptr<InheritedShapeChecker> Create( - CSSPropertyID property, + const CSSProperty& property, scoped_refptr<BasicShape> inherited_shape) { return WTF::WrapUnique( new InheritedShapeChecker(property, std::move(inherited_shape))); } private: - InheritedShapeChecker(CSSPropertyID property, + InheritedShapeChecker(const CSSProperty& property, scoped_refptr<BasicShape> inherited_shape) : property_(property), inherited_shape_(std::move(inherited_shape)) {} @@ -87,7 +87,7 @@ GetBasicShape(property_, *state.ParentStyle())); } - const CSSPropertyID property_; + const CSSProperty& property_; scoped_refptr<BasicShape> inherited_shape_; }; @@ -181,7 +181,7 @@ BasicShapeInterpolationFunctions::CreateBasicShape( interpolable_value, *non_interpolable_value, state.CssToLengthConversionData()); - switch (CssProperty()) { + switch (CssProperty().PropertyID()) { case CSSPropertyShapeOutside: state.Style()->SetShapeOutside( ShapeValue::CreateShapeValue(std::move(shape), kBoxMissing));
diff --git a/third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp index 9750b700..65123447 100644 --- a/third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSBorderImageLengthBoxInterpolationType.cpp
@@ -73,9 +73,9 @@ }; const BorderImageLengthBox& GetBorderImageLengthBox( - CSSPropertyID property, + const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBorderImageOutset: return style.BorderImageOutset(); case CSSPropertyBorderImageWidth: @@ -86,15 +86,16 @@ return style.MaskBoxImageWidth(); default: NOTREACHED(); - return GetBorderImageLengthBox(CSSPropertyBorderImageOutset, - ComputedStyle::InitialStyle()); + return GetBorderImageLengthBox( + CSSProperty::Get(CSSPropertyBorderImageOutset), + ComputedStyle::InitialStyle()); } } -void SetBorderImageLengthBox(CSSPropertyID property, +void SetBorderImageLengthBox(const CSSProperty& property, ComputedStyle& style, const BorderImageLengthBox& box) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBorderImageOutset: style.SetBorderImageOutset(box); break; @@ -195,14 +196,14 @@ : public CSSInterpolationType::CSSConversionChecker { public: static std::unique_ptr<InheritedSideTypesChecker> Create( - CSSPropertyID property, + const CSSProperty& property, const SideTypes& inherited_side_types) { return WTF::WrapUnique( new InheritedSideTypesChecker(property, inherited_side_types)); } private: - InheritedSideTypesChecker(CSSPropertyID property, + InheritedSideTypesChecker(const CSSProperty& property, const SideTypes& inherited_side_types) : property_(property), inherited_side_types_(inherited_side_types) {} @@ -212,7 +213,7 @@ SideTypes(GetBorderImageLengthBox(property_, *state.ParentStyle())); } - const CSSPropertyID property_; + const CSSProperty& property_; const SideTypes inherited_side_types_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSClipInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSClipInterpolationType.h index 81bec7b9..fef28670 100644 --- a/third_party/WebKit/Source/core/animation/CSSClipInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSClipInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSClipInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyClip); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyClip); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp index be689355..0bc5d24 100644 --- a/third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp
@@ -125,12 +125,15 @@ StyleColor current_style_color = StyleColor::CurrentColor(); if (is_text_decoration) { current_style_color = - current_color_getter(CSSPropertyWebkitTextFillColor, *state.Style()) + current_color_getter(CSSProperty::Get(CSSPropertyWebkitTextFillColor), + *state.Style()) .Access(); } if (current_style_color.IsCurrentColor()) { current_style_color = - current_color_getter(CSSPropertyColor, *state.Style()).Access(); + current_color_getter(CSSProperty::Get(CSSPropertyColor), + *state.Style()) + .Access(); } AddPremultipliedColor(red, green, blue, alpha, currentcolor_fraction, current_style_color.GetColor()); @@ -162,13 +165,14 @@ : public CSSInterpolationType::CSSConversionChecker { public: static std::unique_ptr<InheritedColorChecker> Create( - CSSPropertyID property, + const CSSProperty& property, const OptionalStyleColor& color) { return WTF::WrapUnique(new InheritedColorChecker(property, color)); } private: - InheritedColorChecker(CSSPropertyID property, const OptionalStyleColor& color) + InheritedColorChecker(const CSSProperty& property, + const OptionalStyleColor& color) : property_(property), color_(color) {} bool IsValid(const StyleResolverState& state, @@ -177,7 +181,7 @@ property_, *state.ParentStyle()); } - const CSSPropertyID property_; + const CSSProperty& property_; const OptionalStyleColor color_; }; @@ -223,7 +227,8 @@ const CSSValue& value, const StyleResolverState* state, ConversionCheckers& conversion_checkers) const { - if (CssProperty() == CSSPropertyColor && value.IsIdentifierValue() && + if (CssProperty().PropertyID() == CSSPropertyColor && + value.IsIdentifierValue() && ToCSSIdentifierValue(value).GetValueID() == CSSValueCurrentcolor) { DCHECK(state); return MaybeConvertInherit(*state, conversion_checkers); @@ -272,12 +277,12 @@ CssProperty(), *state.Style(), ResolveInterpolableColor( *color_pair.Get(kUnvisited), state, false, - CssProperty() == CSSPropertyTextDecorationColor)); + CssProperty().PropertyID() == CSSPropertyTextDecorationColor)); ColorPropertyFunctions::SetVisitedColor( CssProperty(), *state.Style(), ResolveInterpolableColor( *color_pair.Get(kVisited), state, true, - CssProperty() == CSSPropertyTextDecorationColor)); + CssProperty().PropertyID() == CSSPropertyTextDecorationColor)); } const CSSValue* CSSColorInterpolationType::CreateCSSValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp index cb3e331..59e6774 100644 --- a/third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSFilterListInterpolationType.cpp
@@ -18,9 +18,9 @@ namespace { -const FilterOperations& GetFilterList(CSSPropertyID property, +const FilterOperations& GetFilterList(const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { default: NOTREACHED(); // Fall through. @@ -31,10 +31,10 @@ } } -void SetFilterList(CSSPropertyID property, +void SetFilterList(const CSSProperty& property, ComputedStyle& style, const FilterOperations& filter_operations) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackdropFilter: style.SetBackdropFilter(filter_operations); break; @@ -84,7 +84,7 @@ : public CSSInterpolationType::CSSConversionChecker { public: static std::unique_ptr<InheritedFilterListChecker> Create( - CSSPropertyID property, + const CSSProperty& property, const FilterOperations& filter_operations) { return WTF::WrapUnique( new InheritedFilterListChecker(property, filter_operations)); @@ -98,13 +98,13 @@ } private: - InheritedFilterListChecker(CSSPropertyID property, + InheritedFilterListChecker(const CSSProperty& property, const FilterOperations& filter_operations) : property_(property), filter_operations_wrapper_( FilterOperationsWrapper::Create(filter_operations)) {} - const CSSPropertyID property_; + const CSSProperty& property_; Persistent<FilterOperationsWrapper> filter_operations_wrapper_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSFontSizeInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSFontSizeInterpolationType.h index bce9d0f..18551e1 100644 --- a/third_party/WebKit/Source/core/animation/CSSFontSizeInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSFontSizeInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSFontSizeInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyFontSize); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyFontSize); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSFontVariationSettingsInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSFontVariationSettingsInterpolationType.h index f74760f..dfc8ba04 100644 --- a/third_party/WebKit/Source/core/animation/CSSFontVariationSettingsInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSFontVariationSettingsInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSFontVariationSettingsInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyFontVariationSettings); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyFontVariationSettings); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSFontWeightInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSFontWeightInterpolationType.h index e849378d..d1f7e2a 100644 --- a/third_party/WebKit/Source/core/animation/CSSFontWeightInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSFontWeightInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSFontWeightInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyFontWeight); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyFontWeight); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.cpp index cff4964..586417c 100644 --- a/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.cpp
@@ -16,9 +16,9 @@ namespace blink { namespace { -const StyleImage* GetStyleImage(CSSPropertyID property, +const StyleImage* GetStyleImage(const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBorderImageSource: return style.BorderImageSource(); case CSSPropertyListStyleImage: @@ -139,13 +139,13 @@ } StyleImage* CSSImageInterpolationType::ResolveStyleImage( - CSSPropertyID property, + const CSSProperty& property, const InterpolableValue& interpolable_value, const NonInterpolableValue* non_interpolable_value, StyleResolverState& state) { const CSSValue* image = StaticCreateCSSValue(interpolable_value, non_interpolable_value); - return state.GetStyleImage(property, *image); + return state.GetStyleImage(property.PropertyID(), *image); } bool CSSImageInterpolationType::EqualNonInterpolableValues( @@ -204,14 +204,15 @@ ~InheritedImageChecker() final {} static std::unique_ptr<InheritedImageChecker> Create( - CSSPropertyID property, + const CSSProperty& property, StyleImage* inherited_image) { return WTF::WrapUnique( new InheritedImageChecker(property, inherited_image)); } private: - InheritedImageChecker(CSSPropertyID property, StyleImage* inherited_image) + InheritedImageChecker(const CSSProperty& property, + StyleImage* inherited_image) : property_(property), inherited_image_(inherited_image) {} bool IsValid(const StyleResolverState& state, @@ -225,7 +226,7 @@ return *inherited_image_ == *inherited_image; } - CSSPropertyID property_; + const CSSProperty& property_; Persistent<StyleImage> inherited_image_; }; @@ -270,7 +271,7 @@ StyleResolverState& state) const { StyleImage* image = ResolveStyleImage(CssProperty(), interpolable_value, non_interpolable_value, state); - switch (CssProperty()) { + switch (CssProperty().PropertyID()) { case CSSPropertyBorderImageSource: state.Style()->SetBorderImageSource(image); break;
diff --git a/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.h index 701548f..bf2d8612 100644 --- a/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSImageInterpolationType.h
@@ -38,7 +38,7 @@ static PairwiseInterpolationValue StaticMergeSingleConversions( InterpolationValue&& start, InterpolationValue&& end); - static StyleImage* ResolveStyleImage(CSSPropertyID, + static StyleImage* ResolveStyleImage(const CSSProperty&, const InterpolableValue&, const NonInterpolableValue*, StyleResolverState&);
diff --git a/third_party/WebKit/Source/core/animation/CSSImageListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSImageListInterpolationType.cpp index e65585e..b75d952 100644 --- a/third_party/WebKit/Source/core/animation/CSSImageListInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSImageListInterpolationType.cpp
@@ -73,14 +73,14 @@ ~InheritedImageListChecker() final {} static std::unique_ptr<InheritedImageListChecker> Create( - CSSPropertyID property, + const CSSProperty& property, const StyleImageList& inherited_image_list) { return WTF::WrapUnique( new InheritedImageListChecker(property, inherited_image_list)); } private: - InheritedImageListChecker(CSSPropertyID property, + InheritedImageListChecker(const CSSProperty& property, const StyleImageList& inherited_image_list) : property_(property), inherited_image_list_(inherited_image_list) {} @@ -92,7 +92,7 @@ return inherited_image_list_ == inherited_image_list; } - CSSPropertyID property_; + const CSSProperty& property_; StyleImageList inherited_image_list_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSImageSliceInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSImageSliceInterpolationType.cpp index a8b59320..e1a5ecef 100644 --- a/third_party/WebKit/Source/core/animation/CSSImageSliceInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSImageSliceInterpolationType.cpp
@@ -108,14 +108,14 @@ : public CSSInterpolationType::CSSConversionChecker { public: static std::unique_ptr<InheritedSliceTypesChecker> Create( - CSSPropertyID property, + const CSSProperty& property, const SliceTypes& inherited_types) { return WTF::WrapUnique( new InheritedSliceTypesChecker(property, inherited_types)); } private: - InheritedSliceTypesChecker(CSSPropertyID property, + InheritedSliceTypesChecker(const CSSProperty& property, const SliceTypes& inherited_types) : property_(property), inherited_types_(inherited_types) {} @@ -126,7 +126,7 @@ property_, *state.ParentStyle())); } - const CSSPropertyID property_; + const CSSProperty& property_; const SliceTypes inherited_types_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp index 11c6d03..eab4df8 100644 --- a/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSInterpolationType.cpp
@@ -137,7 +137,7 @@ const PropertyRegistration* registration) : InterpolationType(property), registration_(registration) { DCHECK(!GetProperty().IsCSSCustomProperty() || registration); - DCHECK(!CSSProperty::Get(CssProperty()).IsShorthand()); + DCHECK(!CssProperty().IsShorthand()); } InterpolationValue CSSInterpolationType::MaybeConvertSingle( @@ -179,13 +179,13 @@ bool omit_animation_tainted = false; const CSSValue* resolved_value = CSSVariableResolver(state).ResolveVariableReferences( - CssProperty(), *value, omit_animation_tainted); - conversion_checkers.push_back( - ResolvedVariableChecker::Create(CssProperty(), value, resolved_value)); + CssProperty().PropertyID(), *value, omit_animation_tainted); + conversion_checkers.push_back(ResolvedVariableChecker::Create( + CssProperty().PropertyID(), value, resolved_value)); value = resolved_value; } - bool is_inherited = CSSProperty::Get(CssProperty()).IsInherited(); + bool is_inherited = CssProperty().IsInherited(); if (value->IsInitialValue() || (value->IsUnsetValue() && !is_inherited)) { return MaybeConvertInitial(state, conversion_checkers); }
diff --git a/third_party/WebKit/Source/core/animation/CSSInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSInterpolationType.h index 6136fb6..3b22077 100644 --- a/third_party/WebKit/Source/core/animation/CSSInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSInterpolationType.h
@@ -35,8 +35,8 @@ protected: CSSInterpolationType(PropertyHandle, const PropertyRegistration* = nullptr); - CSSPropertyID CssProperty() const { - return GetProperty().GetCSSProperty().PropertyID(); + const CSSProperty& CssProperty() const { + return GetProperty().GetCSSProperty(); } InterpolationValue MaybeConvertSingle(const PropertySpecificKeyframe&,
diff --git a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp index 73745c2..f09d699 100644 --- a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
@@ -34,13 +34,14 @@ class InheritedLengthChecker : public CSSInterpolationType::CSSConversionChecker { public: - static std::unique_ptr<InheritedLengthChecker> Create(CSSPropertyID property, - const Length& length) { + static std::unique_ptr<InheritedLengthChecker> Create( + const CSSProperty& property, + const Length& length) { return WTF::WrapUnique(new InheritedLengthChecker(property, length)); } private: - InheritedLengthChecker(CSSPropertyID property, const Length& length) + InheritedLengthChecker(const CSSProperty& property, const Length& length) : property_(property), length_(length) {} bool IsValid(const StyleResolverState& state, @@ -52,7 +53,7 @@ return parent_length == length_; } - const CSSPropertyID property_; + const CSSProperty& property_; const Length length_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp index ec3f794..a8b628b 100644 --- a/third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSLengthListInterpolationType.cpp
@@ -68,14 +68,14 @@ ~InheritedLengthListChecker() final {} static std::unique_ptr<InheritedLengthListChecker> Create( - CSSPropertyID property, + const CSSProperty& property, const Vector<Length>& inherited_length_list) { return WTF::WrapUnique( new InheritedLengthListChecker(property, inherited_length_list)); } private: - InheritedLengthListChecker(CSSPropertyID property, + InheritedLengthListChecker(const CSSProperty& property, const Vector<Length>& inherited_length_list) : property_(property), inherited_length_list_(inherited_length_list) {} @@ -87,7 +87,7 @@ return inherited_length_list_ == inherited_length_list; } - CSSPropertyID property_; + const CSSProperty& property_; Vector<Length> inherited_length_list_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSNumberInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSNumberInterpolationType.cpp index af02bb92..f20844dc 100644 --- a/third_party/WebKit/Source/core/animation/CSSNumberInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSNumberInterpolationType.cpp
@@ -15,13 +15,14 @@ class InheritedNumberChecker : public CSSInterpolationType::CSSConversionChecker { public: - static std::unique_ptr<InheritedNumberChecker> Create(CSSPropertyID property, - double number) { + static std::unique_ptr<InheritedNumberChecker> Create( + const CSSProperty& property, + double number) { return WTF::WrapUnique(new InheritedNumberChecker(property, number)); } private: - InheritedNumberChecker(CSSPropertyID property, double number) + InheritedNumberChecker(const CSSProperty& property, double number) : property_(property), number_(number) {} bool IsValid(const StyleResolverState& state, @@ -33,7 +34,7 @@ return parent_number == number_; } - const CSSPropertyID property_; + const CSSProperty& property_; const double number_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSOffsetRotateInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSOffsetRotateInterpolationType.h index a5128f4..6c6c22c 100644 --- a/third_party/WebKit/Source/core/animation/CSSOffsetRotateInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSOffsetRotateInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSOffsetRotateInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK(CssProperty() == CSSPropertyOffsetRotate); + DCHECK(CssProperty().PropertyID() == CSSPropertyOffsetRotate); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.cpp index 1b1c98d..afbaa540 100644 --- a/third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSPaintInterpolationType.cpp
@@ -30,10 +30,10 @@ } } -bool GetColor(CSSPropertyID property, +bool GetColor(const CSSProperty& property, const ComputedStyle& style, StyleColor& result) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyFill: return GetColorFromPaint(style.SvgStyle().FillPaintType(), style.SvgStyle().FillPaintColor(), result); @@ -68,18 +68,19 @@ : public CSSInterpolationType::CSSConversionChecker { public: static std::unique_ptr<InheritedPaintChecker> Create( - CSSPropertyID property, + const CSSProperty& property, const StyleColor& color) { return WTF::WrapUnique(new InheritedPaintChecker(property, color)); } - static std::unique_ptr<InheritedPaintChecker> Create(CSSPropertyID property) { + static std::unique_ptr<InheritedPaintChecker> Create( + const CSSProperty& property) { return WTF::WrapUnique(new InheritedPaintChecker(property)); } private: - InheritedPaintChecker(CSSPropertyID property) + InheritedPaintChecker(const CSSProperty& property) : property_(property), valid_color_(false) {} - InheritedPaintChecker(CSSPropertyID property, const StyleColor& color) + InheritedPaintChecker(const CSSProperty& property, const StyleColor& color) : property_(property), valid_color_(true), color_(color) {} bool IsValid(const StyleResolverState& state, @@ -90,7 +91,7 @@ return valid_color_ && parent_color == color_; } - const CSSPropertyID property_; + const CSSProperty& property_; const bool valid_color_; const StyleColor color_; }; @@ -140,7 +141,7 @@ StyleResolverState& state) const { Color color = CSSColorInterpolationType::ResolveInterpolableColor( interpolable_color, state); - switch (CssProperty()) { + switch (CssProperty().PropertyID()) { case CSSPropertyFill: state.Style()->AccessSVGStyle().SetFillPaint(SVG_PAINTTYPE_RGBCOLOR, color, String(), true, true);
diff --git a/third_party/WebKit/Source/core/animation/CSSPathInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSPathInterpolationType.cpp index ffd1a29..e707ff91 100644 --- a/third_party/WebKit/Source/core/animation/CSSPathInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSPathInterpolationType.cpp
@@ -17,8 +17,8 @@ // Returns the property's path() value. // If the property's value is not a path(), returns nullptr. -StylePath* GetPath(CSSPropertyID property, const ComputedStyle& style) { - switch (property) { +StylePath* GetPath(const CSSProperty& property, const ComputedStyle& style) { + switch (property.PropertyID()) { case CSSPropertyD: return style.SvgStyle().D(); case CSSPropertyOffsetPath: { @@ -34,10 +34,10 @@ } // Set the property to the given path() value. -void SetPath(CSSPropertyID property, +void SetPath(const CSSProperty& property, ComputedStyle& style, scoped_refptr<blink::StylePath> path) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyD: style.SetD(std::move(path)); return; @@ -93,14 +93,14 @@ class InheritedPathChecker : public CSSInterpolationType::CSSConversionChecker { public: static std::unique_ptr<InheritedPathChecker> Create( - CSSPropertyID property, + const CSSProperty& property, scoped_refptr<StylePath> style_path) { return WTF::WrapUnique( new InheritedPathChecker(property, std::move(style_path))); } private: - InheritedPathChecker(CSSPropertyID property, + InheritedPathChecker(const CSSProperty& property, scoped_refptr<StylePath> style_path) : property_(property), style_path_(std::move(style_path)) {} @@ -109,7 +109,7 @@ return GetPath(property_, *state.ParentStyle()) == style_path_.get(); } - const CSSPropertyID property_; + const CSSProperty& property_; const scoped_refptr<StylePath> style_path_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSRayInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSRayInterpolationType.h index d105ec0..49577b8 100644 --- a/third_party/WebKit/Source/core/animation/CSSRayInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSRayInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSRayInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK(CssProperty() == CSSPropertyOffsetPath); + DCHECK(CssProperty().PropertyID() == CSSPropertyOffsetPath); } void ApplyStandardPropertyValue(const InterpolableValue&,
diff --git a/third_party/WebKit/Source/core/animation/CSSRotateInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSRotateInterpolationType.h index 761905b..f7a5c700 100644 --- a/third_party/WebKit/Source/core/animation/CSSRotateInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSRotateInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSRotateInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyRotate); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyRotate); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSScaleInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSScaleInterpolationType.h index c7e86a3..3f94789 100644 --- a/third_party/WebKit/Source/core/animation/CSSScaleInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSScaleInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSScaleInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyScale); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyScale); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSShadowListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSShadowListInterpolationType.cpp index 18cf32f..9136c314 100644 --- a/third_party/WebKit/Source/core/animation/CSSShadowListInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSShadowListInterpolationType.cpp
@@ -19,9 +19,9 @@ namespace blink { namespace { -const ShadowList* GetShadowList(CSSPropertyID property, +const ShadowList* GetShadowList(const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBoxShadow: return style.BoxShadow(); case CSSPropertyTextShadow: @@ -66,14 +66,14 @@ : public CSSInterpolationType::CSSConversionChecker { public: static std::unique_ptr<InheritedShadowListChecker> Create( - CSSPropertyID property, + const CSSProperty& property, scoped_refptr<ShadowList> shadow_list) { return WTF::WrapUnique( new InheritedShadowListChecker(property, std::move(shadow_list))); } private: - InheritedShadowListChecker(CSSPropertyID property, + InheritedShadowListChecker(const CSSProperty& property, scoped_refptr<ShadowList> shadow_list) : property_(property), shadow_list_(std::move(shadow_list)) {} @@ -88,7 +88,7 @@ return *inherited_shadow_list == *shadow_list_; } - const CSSPropertyID property_; + const CSSProperty& property_; scoped_refptr<ShadowList> shadow_list_; }; @@ -177,7 +177,7 @@ StyleResolverState& state) const { scoped_refptr<ShadowList> shadow_list = CreateShadowList(interpolable_value, non_interpolable_value, state); - switch (CssProperty()) { + switch (CssProperty().PropertyID()) { case CSSPropertyBoxShadow: state.Style()->SetBoxShadow(std::move(shadow_list)); return;
diff --git a/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.cpp index 2090b34..886e6400 100644 --- a/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.cpp +++ b/third_party/WebKit/Source/core/animation/CSSSizeListInterpolationType.cpp
@@ -53,14 +53,14 @@ ~InheritedSizeListChecker() final {} static std::unique_ptr<InheritedSizeListChecker> Create( - CSSPropertyID property, + const CSSProperty& property, const SizeList& inherited_size_list) { return WTF::WrapUnique( new InheritedSizeListChecker(property, inherited_size_list)); } private: - InheritedSizeListChecker(CSSPropertyID property, + InheritedSizeListChecker(const CSSProperty& property, const SizeList& inherited_size_list) : property_(property), inherited_size_list_(inherited_size_list) {} @@ -70,7 +70,7 @@ property_, *state.ParentStyle()); } - CSSPropertyID property_; + const CSSProperty& property_; SizeList inherited_size_list_; };
diff --git a/third_party/WebKit/Source/core/animation/CSSTextIndentInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSTextIndentInterpolationType.h index 032b2ad9..cd6400c9 100644 --- a/third_party/WebKit/Source/core/animation/CSSTextIndentInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSTextIndentInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSTextIndentInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyTextIndent); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyTextIndent); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSTransformInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSTransformInterpolationType.h index f238dde9..f23e0bb2 100644 --- a/third_party/WebKit/Source/core/animation/CSSTransformInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSTransformInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSTransformInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyTransform); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyTransform); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSTranslateInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSTranslateInterpolationType.h index 16823ad..ff46183 100644 --- a/third_party/WebKit/Source/core/animation/CSSTranslateInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSTranslateInterpolationType.h
@@ -13,7 +13,7 @@ public: CSSTranslateInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyTranslate); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyTranslate); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/CSSVisibilityInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSVisibilityInterpolationType.h index c8d81a8..add29f5d 100644 --- a/third_party/WebKit/Source/core/animation/CSSVisibilityInterpolationType.h +++ b/third_party/WebKit/Source/core/animation/CSSVisibilityInterpolationType.h
@@ -14,7 +14,7 @@ public: CSSVisibilityInterpolationType(PropertyHandle property) : CSSInterpolationType(property) { - DCHECK_EQ(CssProperty(), CSSPropertyVisibility); + DCHECK_EQ(CssProperty().PropertyID(), CSSPropertyVisibility); } InterpolationValue MaybeConvertStandardPropertyUnderlyingValue(
diff --git a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp index 228e327..16319fa 100644 --- a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp +++ b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.cpp
@@ -9,14 +9,14 @@ namespace blink { OptionalStyleColor ColorPropertyFunctions::GetInitialColor( - CSSPropertyID property) { + const CSSProperty& property) { return GetUnvisitedColor(property, ComputedStyle::InitialStyle()); } OptionalStyleColor ColorPropertyFunctions::GetUnvisitedColor( - CSSPropertyID property, + const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundColor: return style.BackgroundColor(); case CSSPropertyBorderLeftColor: @@ -60,9 +60,9 @@ } OptionalStyleColor ColorPropertyFunctions::GetVisitedColor( - CSSPropertyID property, + const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundColor: return style.VisitedLinkBackgroundColor(); case CSSPropertyBorderLeftColor: @@ -107,10 +107,10 @@ } } -void ColorPropertyFunctions::SetUnvisitedColor(CSSPropertyID property, +void ColorPropertyFunctions::SetUnvisitedColor(const CSSProperty& property, ComputedStyle& style, const Color& color) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundColor: style.SetBackgroundColor(color); return; @@ -158,10 +158,10 @@ } } -void ColorPropertyFunctions::SetVisitedColor(CSSPropertyID property, +void ColorPropertyFunctions::SetVisitedColor(const CSSProperty& property, ComputedStyle& style, const Color& color) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundColor: style.SetVisitedLinkBackgroundColor(color); return;
diff --git a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h index 57ce2b3..e5a4333 100644 --- a/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/ColorPropertyFunctions.h
@@ -11,6 +11,7 @@ namespace blink { class ComputedStyle; +class CSSProperty; struct OptionalStyleColor { public: @@ -36,13 +37,15 @@ class ColorPropertyFunctions { public: - static OptionalStyleColor GetInitialColor(CSSPropertyID); - static OptionalStyleColor GetUnvisitedColor(CSSPropertyID, + static OptionalStyleColor GetInitialColor(const CSSProperty&); + static OptionalStyleColor GetUnvisitedColor(const CSSProperty&, const ComputedStyle&); - static OptionalStyleColor GetVisitedColor(CSSPropertyID, + static OptionalStyleColor GetVisitedColor(const CSSProperty&, const ComputedStyle&); - static void SetUnvisitedColor(CSSPropertyID, ComputedStyle&, const Color&); - static void SetVisitedColor(CSSPropertyID, ComputedStyle&, const Color&); + static void SetUnvisitedColor(const CSSProperty&, + ComputedStyle&, + const Color&); + static void SetVisitedColor(const CSSProperty&, ComputedStyle&, const Color&); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/animation/ImageListPropertyFunctions.h b/third_party/WebKit/Source/core/animation/ImageListPropertyFunctions.h index fb7a8f8de..ae80c213 100644 --- a/third_party/WebKit/Source/core/animation/ImageListPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/ImageListPropertyFunctions.h
@@ -15,15 +15,15 @@ class ImageListPropertyFunctions { public: - static void GetInitialImageList(CSSPropertyID, StyleImageList& result) { + static void GetInitialImageList(const CSSProperty&, StyleImageList& result) { result.clear(); } - static void GetImageList(CSSPropertyID property, + static void GetImageList(const CSSProperty& property, const ComputedStyle& style, StyleImageList& result) { const FillLayer* fill_layer = nullptr; - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundImage: fill_layer = &style.BackgroundLayers(); break; @@ -42,11 +42,11 @@ } } - static void SetImageList(CSSPropertyID property, + static void SetImageList(const CSSProperty& property, ComputedStyle& style, const StyleImageList& image_list) { FillLayer* fill_layer = nullptr; - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundImage: fill_layer = &style.AccessBackgroundLayers(); break;
diff --git a/third_party/WebKit/Source/core/animation/ImageSlicePropertyFunctions.h b/third_party/WebKit/Source/core/animation/ImageSlicePropertyFunctions.h index cbc261e..ec402716 100644 --- a/third_party/WebKit/Source/core/animation/ImageSlicePropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/ImageSlicePropertyFunctions.h
@@ -21,13 +21,13 @@ class ImageSlicePropertyFunctions { public: - static ImageSlice GetInitialImageSlice(CSSPropertyID property) { + static ImageSlice GetInitialImageSlice(const CSSProperty& property) { return GetImageSlice(property, ComputedStyle::InitialStyle()); } - static ImageSlice GetImageSlice(CSSPropertyID property, + static ImageSlice GetImageSlice(const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { default: NOTREACHED(); // Fall through. @@ -40,10 +40,10 @@ } } - static void SetImageSlice(CSSPropertyID property, + static void SetImageSlice(const CSSProperty& property, ComputedStyle& style, const ImageSlice& slice) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBorderImageSlice: style.SetBorderImageSlices(slice.slices); style.SetBorderImageSlicesFill(slice.fill);
diff --git a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp index ec10cef0..1b90cc2 100644 --- a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp +++ b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp
@@ -10,9 +10,9 @@ namespace { -const FillLayer* GetFillLayerForPosition(CSSPropertyID property, +const FillLayer* GetFillLayerForPosition(const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundPositionX: case CSSPropertyBackgroundPositionY: return &style.BackgroundLayers(); @@ -25,9 +25,9 @@ } } -FillLayer* AccessFillLayerForPosition(CSSPropertyID property, +FillLayer* AccessFillLayerForPosition(const CSSProperty& property, ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundPositionX: case CSSPropertyBackgroundPositionY: return &style.AccessBackgroundLayers(); @@ -41,8 +41,8 @@ } struct FillLayerMethods { - FillLayerMethods(CSSPropertyID property) { - switch (property) { + FillLayerMethods(const CSSProperty& property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundPositionX: case CSSPropertyWebkitMaskPositionX: is_set = &FillLayer::IsPositionXSet; @@ -74,8 +74,9 @@ } // namespace -ValueRange LengthListPropertyFunctions::GetValueRange(CSSPropertyID property) { - switch (property) { +ValueRange LengthListPropertyFunctions::GetValueRange( + const CSSProperty& property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundPositionX: case CSSPropertyBackgroundPositionY: case CSSPropertyObjectPosition: @@ -100,8 +101,9 @@ } } -bool LengthListPropertyFunctions::GetInitialLengthList(CSSPropertyID property, - Vector<Length>& result) { +bool LengthListPropertyFunctions::GetInitialLengthList( + const CSSProperty& property, + Vector<Length>& result) { return GetLengthList(property, ComputedStyle::InitialStyle(), result); } @@ -125,12 +127,12 @@ return true; } -bool LengthListPropertyFunctions::GetLengthList(CSSPropertyID property, +bool LengthListPropertyFunctions::GetLengthList(const CSSProperty& property, const ComputedStyle& style, Vector<Length>& result) { DCHECK(result.IsEmpty()); - switch (property) { + switch (property.PropertyID()) { case CSSPropertyStrokeDasharray: { if (style.StrokeDashArray()) result.AppendVector(style.StrokeDashArray()->GetVector()); @@ -198,10 +200,10 @@ return TransformOrigin(list[0], list[1], list[2].Pixels()); } -void LengthListPropertyFunctions::SetLengthList(CSSPropertyID property, +void LengthListPropertyFunctions::SetLengthList(const CSSProperty& property, ComputedStyle& style, Vector<Length>&& length_list) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyStrokeDasharray: style.SetStrokeDashArray( length_list.IsEmpty()
diff --git a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.h b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.h index df518a8e..ea918241 100644 --- a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.h
@@ -12,17 +12,18 @@ namespace blink { class ComputedStyle; +class CSSProperty; class LengthListPropertyFunctions { STATIC_ONLY(LengthListPropertyFunctions); public: - static ValueRange GetValueRange(CSSPropertyID); - static bool GetInitialLengthList(CSSPropertyID, Vector<Length>& result); - static bool GetLengthList(CSSPropertyID, + static ValueRange GetValueRange(const CSSProperty&); + static bool GetInitialLengthList(const CSSProperty&, Vector<Length>& result); + static bool GetLengthList(const CSSProperty&, const ComputedStyle&, Vector<Length>& result); - static void SetLengthList(CSSPropertyID, + static void SetLengthList(const CSSProperty&, ComputedStyle&, Vector<Length>&& length_list); };
diff --git a/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.cpp index 7f3a7e8..98ff0d0 100644 --- a/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.cpp +++ b/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.cpp
@@ -8,8 +8,8 @@ namespace blink { -ValueRange LengthPropertyFunctions::GetValueRange(CSSPropertyID property) { - switch (property) { +ValueRange LengthPropertyFunctions::GetValueRange(const CSSProperty& property) { + switch (property.PropertyID()) { case CSSPropertyBorderBottomWidth: case CSSPropertyBorderLeftWidth: case CSSPropertyBorderRightWidth: @@ -43,14 +43,14 @@ } } -bool LengthPropertyFunctions::IsZoomedLength(CSSPropertyID property) { - return property != CSSPropertyStrokeWidth; +bool LengthPropertyFunctions::IsZoomedLength(const CSSProperty& property) { + return property.PropertyID() != CSSPropertyStrokeWidth; } -bool LengthPropertyFunctions::GetPixelsForKeyword(CSSPropertyID property, +bool LengthPropertyFunctions::GetPixelsForKeyword(const CSSProperty& property, CSSValueID value_id, double& result) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBaselineShift: if (value_id == CSSValueBaseline) { result = 0; @@ -88,9 +88,9 @@ } } -bool LengthPropertyFunctions::GetInitialLength(CSSPropertyID property, +bool LengthPropertyFunctions::GetInitialLength(const CSSProperty& property, Length& result) { - switch (property) { + switch (property.PropertyID()) { // The computed value of "initial" for the following properties is 0px if // the associated *-style property resolves to "none" or "hidden". // - border-width: @@ -121,10 +121,10 @@ } } -bool LengthPropertyFunctions::GetLength(CSSPropertyID property, +bool LengthPropertyFunctions::GetLength(const CSSProperty& property, const ComputedStyle& style, Length& result) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBottom: result = style.Bottom(); return true; @@ -287,7 +287,7 @@ result = Length(style.Perspective(), kFixed); return true; case CSSPropertyStrokeWidth: - DCHECK(!IsZoomedLength(CSSPropertyStrokeWidth)); + DCHECK(!IsZoomedLength(CSSProperty::Get(CSSPropertyStrokeWidth))); result = style.StrokeWidth().length(); return true; case CSSPropertyVerticalAlign: @@ -305,10 +305,10 @@ } } -bool LengthPropertyFunctions::SetLength(CSSPropertyID property, +bool LengthPropertyFunctions::SetLength(const CSSProperty& property, ComputedStyle& style, const Length& value) { - switch (property) { + switch (property.PropertyID()) { // Setters that take a Length value. case CSSPropertyBaselineShift: style.SetBaselineShiftValue(value);
diff --git a/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.h b/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.h index 338bb7f..77405df 100644 --- a/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/LengthPropertyFunctions.h
@@ -13,19 +13,22 @@ namespace blink { class ComputedStyle; +class CSSProperty; class LengthPropertyFunctions { STATIC_ONLY(LengthPropertyFunctions); public: - static ValueRange GetValueRange(CSSPropertyID); - static bool IsZoomedLength(CSSPropertyID); - static bool GetPixelsForKeyword(CSSPropertyID, + static ValueRange GetValueRange(const CSSProperty&); + static bool IsZoomedLength(const CSSProperty&); + static bool GetPixelsForKeyword(const CSSProperty&, CSSValueID, double& result_pixels); - static bool GetInitialLength(CSSPropertyID, Length& result); - static bool GetLength(CSSPropertyID, const ComputedStyle&, Length& result); - static bool SetLength(CSSPropertyID, ComputedStyle&, const Length&); + static bool GetInitialLength(const CSSProperty&, Length& result); + static bool GetLength(const CSSProperty&, + const ComputedStyle&, + Length& result); + static bool SetLength(const CSSProperty&, ComputedStyle&, const Length&); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp index b3da345..d087f5b2 100644 --- a/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp +++ b/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp
@@ -8,15 +8,15 @@ namespace blink { -bool NumberPropertyFunctions::GetInitialNumber(CSSPropertyID property, +bool NumberPropertyFunctions::GetInitialNumber(const CSSProperty& property, double& result) { return GetNumber(property, ComputedStyle::InitialStyle(), result); } -bool NumberPropertyFunctions::GetNumber(CSSPropertyID property, +bool NumberPropertyFunctions::GetNumber(const CSSProperty& property, const ComputedStyle& style, double& result) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyFillOpacity: result = style.FillOpacity(); return true; @@ -88,9 +88,9 @@ } } -double NumberPropertyFunctions::ClampNumber(CSSPropertyID property, +double NumberPropertyFunctions::ClampNumber(const CSSProperty& property, double value) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyStrokeMiterlimit: return clampTo<float>(value, 1); @@ -130,11 +130,11 @@ } } -bool NumberPropertyFunctions::SetNumber(CSSPropertyID property, +bool NumberPropertyFunctions::SetNumber(const CSSProperty& property, ComputedStyle& style, double value) { DCHECK_EQ(value, ClampNumber(property, value)); - switch (property) { + switch (property.PropertyID()) { case CSSPropertyFillOpacity: style.SetFillOpacity(value); return true;
diff --git a/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.h b/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.h index 1f8be1c0..136af7ff 100644 --- a/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.h
@@ -10,13 +10,16 @@ namespace blink { class ComputedStyle; +class CSSProperty; class NumberPropertyFunctions { public: - static bool GetInitialNumber(CSSPropertyID, double& result); - static bool GetNumber(CSSPropertyID, const ComputedStyle&, double& result); - static double ClampNumber(CSSPropertyID, double); - static bool SetNumber(CSSPropertyID, ComputedStyle&, double); + static bool GetInitialNumber(const CSSProperty&, double& result); + static bool GetNumber(const CSSProperty&, + const ComputedStyle&, + double& result); + static double ClampNumber(const CSSProperty&, double); + static bool SetNumber(const CSSProperty&, ComputedStyle&, double); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.cpp index 37c82ed..3d89969 100644 --- a/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.cpp +++ b/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.cpp
@@ -8,9 +8,9 @@ namespace blink { -static const FillLayer* GetFillLayerForSize(CSSPropertyID property, +static const FillLayer* GetFillLayerForSize(const CSSProperty& property, const ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundSize: return &style.BackgroundLayers(); case CSSPropertyWebkitMaskSize: @@ -21,9 +21,9 @@ } } -static FillLayer* AccessFillLayerForSize(CSSPropertyID property, +static FillLayer* AccessFillLayerForSize(const CSSProperty& property, ComputedStyle& style) { - switch (property) { + switch (property.PropertyID()) { case CSSPropertyBackgroundSize: return &style.AccessBackgroundLayers(); case CSSPropertyWebkitMaskSize: @@ -34,11 +34,12 @@ } } -SizeList SizeListPropertyFunctions::GetInitialSizeList(CSSPropertyID property) { +SizeList SizeListPropertyFunctions::GetInitialSizeList( + const CSSProperty& property) { return GetSizeList(property, ComputedStyle::InitialStyle()); } -SizeList SizeListPropertyFunctions::GetSizeList(CSSPropertyID property, +SizeList SizeListPropertyFunctions::GetSizeList(const CSSProperty& property, const ComputedStyle& style) { SizeList result; for (const FillLayer* fill_layer = GetFillLayerForSize(property, style); @@ -47,7 +48,7 @@ return result; } -void SizeListPropertyFunctions::SetSizeList(CSSPropertyID property, +void SizeListPropertyFunctions::SetSizeList(const CSSProperty& property, ComputedStyle& style, const SizeList& size_list) { FillLayer* fill_layer = AccessFillLayerForSize(property, style);
diff --git a/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.h b/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.h index 76335fb24..567a409 100644 --- a/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.h +++ b/third_party/WebKit/Source/core/animation/SizeListPropertyFunctions.h
@@ -12,6 +12,7 @@ namespace blink { class ComputedStyle; +class CSSProperty; using SizeList = Vector<FillSize, 1>; @@ -19,9 +20,9 @@ STATIC_ONLY(SizeListPropertyFunctions); public: - static SizeList GetInitialSizeList(CSSPropertyID); - static SizeList GetSizeList(CSSPropertyID, const ComputedStyle&); - static void SetSizeList(CSSPropertyID, ComputedStyle&, const SizeList&); + static SizeList GetInitialSizeList(const CSSProperty&); + static SizeList GetSizeList(const CSSProperty&, const ComputedStyle&); + static void SetSizeList(const CSSProperty&, ComputedStyle&, const SizeList&); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimationData.h b/third_party/WebKit/Source/core/animation/css/CSSAnimationData.h index c49ec6c..ebd0ba6 100644 --- a/third_party/WebKit/Source/core/animation/css/CSSAnimationData.h +++ b/third_party/WebKit/Source/core/animation/css/CSSAnimationData.h
@@ -56,7 +56,7 @@ } static Timing::FillMode InitialFillMode() { return Timing::FillMode::NONE; } static double InitialIterationCount() { return 1.0; } - static EAnimPlayState InitialPlayState() { return kAnimPlayStatePlaying; } + static EAnimPlayState InitialPlayState() { return EAnimPlayState::kPlaying; } private: CSSAnimationData();
diff --git a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp index 3c18bfe..7e87036 100644 --- a/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp +++ b/third_party/WebKit/Source/core/animation/css/CSSAnimations.cpp
@@ -330,7 +330,7 @@ const bool is_paused = CSSTimingData::GetRepeated(animation_data->PlayStateList(), i) == - kAnimPlayStatePaused; + EAnimPlayState::kPaused; Timing timing = animation_data->ConvertToTiming(i); Timing specified_timing = timing;
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp b/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp index a78dbf3f..1cd391fc 100644 --- a/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp +++ b/third_party/WebKit/Source/core/clipboard/DataTransfer.cpp
@@ -103,8 +103,16 @@ layer = layer->StackingNode()->AncestorStackingContextNode()->Layer(); IntRect absolute_bounding_box = dragged_layout_object->AbsoluteBoundingBoxRectIncludingDescendants(); - absolute_bounding_box.Intersect( - layer->GetLayoutObject().GetFrameView()->VisibleContentRect()); + // TODO(chrishtr): consider using the root frame's visible rect instead + // of the local frame, to avoid over-clipping. + FloatRect visible_rect = + layer->GetLayoutObject().GetFrameView()->VisibleContentRect(); + // If the absolute bounding box is large enough to be possibly a memory + // or IPC payload issue, clip it to the visible content rect. + if (absolute_bounding_box.Size().Area() > visible_rect.Size().Area()) { + absolute_bounding_box.Intersect(IntRect(visible_rect)); + } + FloatRect bounding_box = layer->GetLayoutObject() .AbsoluteToLocalQuad(FloatQuad(absolute_bounding_box),
diff --git a/third_party/WebKit/Source/core/clipboard/DataTransferTest.cpp b/third_party/WebKit/Source/core/clipboard/DataTransferTest.cpp index 7682f68..eb43df9 100644 --- a/third_party/WebKit/Source/core/clipboard/DataTransferTest.cpp +++ b/third_party/WebKit/Source/core/clipboard/DataTransferTest.cpp
@@ -139,7 +139,7 @@ <style> * { margin: 0; } #first { width: 500px; height: 500px; } - #second { width: 300px; height: 200px; } + #second { width: 800px; height: 900px; } </style> <div id='first'></div> <div id='second'></div> @@ -154,14 +154,14 @@ Element& first = *GetDocument().getElementById("first"); const auto first_image = DataTransfer::NodeImage(GetFrame(), first); const int first_height = 500; - EXPECT_EQ(IntSize(500, first_height - scroll_amount), first_image->Size()); + EXPECT_EQ(IntSize(500, first_height), first_image->Size()); // The second div should also be offset by the scroll offset. In addition, // the second div should be clipped by the viewport. Element& second = *GetDocument().getElementById("second"); const auto second_image = DataTransfer::NodeImage(GetFrame(), second); const int viewport_height = 600; - EXPECT_EQ(IntSize(300, viewport_height - (first_height - scroll_amount)), + EXPECT_EQ(IntSize(800, viewport_height - (first_height - scroll_amount)), second_image->Size()); } @@ -191,6 +191,37 @@ frame_view->LayoutViewportScrollableArea()->SetScrollOffset( ScrollOffset(0, scroll_amount), kProgrammaticScroll); const auto image_with_offset = DataTransfer::NodeImage(GetFrame(), node); + EXPECT_EQ( + IntSize(node_width * page_scale_factor, node_height * page_scale_factor), + image_with_offset->Size()); +} + +TEST_P(DataTransferTest, NodeImageSizeWithPageScaleFactorTooLarge) { + SetBodyInnerHTML(R"HTML( + <style> + * { margin: 0; } + html, body { height: 2000px; } + #node { width: 800px; height: 601px; } + </style> + <div id='node'></div> + )HTML"); + const int page_scale_factor = 2; + GetPage().SetPageScaleFactor(page_scale_factor); + Element& node = *GetDocument().getElementById("node"); + const auto image = DataTransfer::NodeImage(GetFrame(), node); + const int node_width = 800; + const int node_height = 601; + EXPECT_EQ(IntSize(node_width * page_scale_factor, + (node_height - 1) * page_scale_factor), + image->Size()); + + // Check that a scroll offset is scaled to device coordinates which includes + // page scale factor. + const int scroll_amount = 10; + LocalFrameView* frame_view = GetDocument().View(); + frame_view->LayoutViewportScrollableArea()->SetScrollOffset( + ScrollOffset(0, scroll_amount), kProgrammaticScroll); + const auto image_with_offset = DataTransfer::NodeImage(GetFrame(), node); EXPECT_EQ(IntSize(node_width * page_scale_factor, (node_height - scroll_amount) * page_scale_factor), image_with_offset->Size()); @@ -235,10 +266,10 @@ EXPECT_EQ(expected_bitmap.getColor(x, y), bitmap.getColor(x, y)); } -TEST_P(DataTransferTest, NodeImageWithScrolling) { +TEST_P(DataTransferTest, NodeImageFullyOffscreen) { SetBodyInnerHTML(R"HTML( <style> - #inner { + #target { position: absolute; top: 800px; left: 0; @@ -248,7 +279,7 @@ isolation: isolate; } </style> - <div id="inner" draggable="true" ondragstart="drag(event)"></div> + <div id="target" draggable="true" ondragstart="drag(event)"></div> )HTML"); const int scroll_amount = 800; @@ -256,11 +287,32 @@ frame_view->LayoutViewportScrollableArea()->SetScrollOffset( ScrollOffset(0, scroll_amount), kProgrammaticScroll); - Element& inner = *GetDocument().getElementById("inner"); - const auto image = DataTransfer::NodeImage(GetFrame(), inner); - const int inner_width = 200; - const int inner_height = 100; - EXPECT_EQ(IntSize(inner_width, inner_height), image->Size()); + Element& target = *GetDocument().getElementById("target"); + const auto image = DataTransfer::NodeImage(GetFrame(), target); + + EXPECT_EQ(IntSize(200, 100), image->Size()); +} + +TEST_P(DataTransferTest, NodeImageWithScrolling) { + SetBodyInnerHTML(R"HTML( + <style> + #target { + position: absolute; + top: 800px; + left: 0; + height: 100px; + width: 200px; + background: lightblue; + isolation: isolate; + } + </style> + <div id="target" draggable="true" ondragstart="drag(event)"></div> + )HTML"); + + Element& target = *GetDocument().getElementById("target"); + const auto image = DataTransfer::NodeImage(GetFrame(), target); + + EXPECT_EQ(IntSize(200, 100), image->Size()); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp index f9e51008..68d7120 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
@@ -76,7 +76,7 @@ } bool CSSFontFaceSrcValue::HasFailedOrCanceledSubresources() const { - return fetched_ && fetched_->LoadFailedOrCanceled(); + return fetched_ && fetched_->GetResource()->LoadFailedOrCanceled(); } FontResource* CSSFontFaceSrcValue::Fetch(ExecutionContext* context, @@ -104,18 +104,23 @@ if (context->IsWorkerGlobalScope()) { ToWorkerGlobalScope(context)->EnsureFetcher(); } - fetched_ = FontResource::Fetch(params, context->Fetcher(), client); + FontResource* resource = + FontResource::Fetch(params, context->Fetcher(), client); + if (!resource) + return nullptr; + fetched_ = FontResourceHelper::Create( + resource, context->GetTaskRunner(TaskType::kUnspecedLoading).get()); } else { // FIXME: CSSFontFaceSrcValue::Fetch is invoked when @font-face rule // is processed by StyleResolver / StyleEngine. RestoreCachedResourceIfNeeded(context); if (client) { client->SetResource( - fetched_.Get(), + fetched_->GetResource(), context->GetTaskRunner(TaskType::kUnspecedLoading).get()); } } - return fetched_.Get(); + return ToFontResource(fetched_->GetResource()); } void CSSFontFaceSrcValue::RestoreCachedResourceIfNeeded( @@ -126,10 +131,10 @@ const String resource_url = context->CompleteURL(absolute_resource_); DCHECK_EQ(should_check_content_security_policy_, - fetched_->Options().content_security_policy_option); + fetched_->GetResource()->Options().content_security_policy_option); context->Fetcher()->EmulateLoadStartedForInspector( - fetched_, KURL(resource_url), WebURLRequest::kRequestContextFont, - FetchInitiatorTypeNames::css); + fetched_->GetResource(), KURL(resource_url), + WebURLRequest::kRequestContextFont, FetchInitiatorTypeNames::css); } bool CSSFontFaceSrcValue::Equals(const CSSFontFaceSrcValue& other) const {
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h index c60e4c6..a807cdc 100644 --- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h +++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h
@@ -99,7 +99,32 @@ Referrer referrer_; bool is_local_; ContentSecurityPolicyDisposition should_check_content_security_policy_; - mutable Member<FontResource> fetched_; + + class FontResourceHelper + : public GarbageCollectedFinalized<FontResourceHelper>, + public FontResourceClient { + USING_GARBAGE_COLLECTED_MIXIN(FontResourceHelper); + + public: + static FontResourceHelper* Create(FontResource* resource, + WebTaskRunner* task_runner) { + return new FontResourceHelper(resource, task_runner); + } + + virtual void Trace(blink::Visitor* visitor) { + FontResourceClient::Trace(visitor); + } + + private: + FontResourceHelper(FontResource* resource, WebTaskRunner* task_runner) { + SetResource(resource, task_runner); + } + + String DebugName() const override { + return "CSSFontFaceSrcValue::FontResourceHelper"; + } + }; + mutable Member<FontResourceHelper> fetched_; }; DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, IsFontFaceSrcValue());
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5 index 105c70f..349bc34 100644 --- a/third_party/WebKit/Source/core/css/CSSProperties.json5 +++ b/third_party/WebKit/Source/core/css/CSSProperties.json5
@@ -745,7 +745,7 @@ }, { name: "background-image", - property_methods: ["ParseSingleValue"], + property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal"], interpolable: true, keywords: ["auto", "none"], typedom_types: ["Image"], @@ -778,7 +778,7 @@ }, { name: "background-size", - property_methods: ["ParseSingleValue"], + property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal"], interpolable: true, custom_apply_functions_all: true, }, @@ -3180,7 +3180,7 @@ }, { name: "-webkit-mask-image", - property_methods: ["ParseSingleValue"], + property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal"], interpolable: true, custom_apply_functions_all: true, }, @@ -3211,7 +3211,7 @@ }, { name: "-webkit-mask-size", - property_methods: ["ParseSingleValue"], + property_methods: ["ParseSingleValue", "CSSValueFromComputedStyleInternal"], interpolable: true, custom_apply_functions_all: true, }, @@ -3801,17 +3801,17 @@ "background-attachment", "background-origin", "background-clip", "background-color" ], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "background-position", longhands: ["background-position-x", "background-position-y"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "background-repeat", longhands: ["background-repeat-x", "background-repeat-y"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "border", @@ -4197,12 +4197,12 @@ { name: "-webkit-mask-position", longhands: ["-webkit-mask-position-x", "-webkit-mask-position-y"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "-webkit-mask-repeat", longhands: ["-webkit-mask-repeat-x", "-webkit-mask-repeat-y"], - property_methods: ["ParseShorthand"], + property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"], }, { name: "-webkit-text-emphasis",
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.cpp b/third_party/WebKit/Source/core/css/CSSSelector.cpp index 1d3af474..1bcbe07 100644 --- a/third_party/WebKit/Source/core/css/CSSSelector.cpp +++ b/third_party/WebKit/Source/core/css/CSSSelector.cpp
@@ -116,6 +116,7 @@ // FIXME: PseudoAny should base the specificity on the sub-selectors. // See http://lists.w3.org/Archives/Public/www-style/2010Sep/0530.html case kPseudoAny: + case kPseudoMatches: default: break; } @@ -214,6 +215,7 @@ case kPseudoLink: case kPseudoVisited: case kPseudoAny: + case kPseudoMatches: case kPseudoAnyLink: case kPseudoWebkitAnyLink: case kPseudoAutofill: @@ -386,6 +388,7 @@ {"host", CSSSelector::kPseudoHost}, {"host-context", CSSSelector::kPseudoHostContext}, {"lang", CSSSelector::kPseudoLang}, + {"matches", CSSSelector::kPseudoMatches}, {"not", CSSSelector::kPseudoNot}, {"nth-child", CSSSelector::kPseudoNthChild}, {"nth-last-child", CSSSelector::kPseudoNthLastChild}, @@ -596,6 +599,7 @@ case kPseudoLastChild: case kPseudoLastOfType: case kPseudoLink: + case kPseudoMatches: case kPseudoNoButton: case kPseudoNot: case kPseudoNthChild: @@ -734,6 +738,7 @@ case kPseudoHost: case kPseudoHostContext: case kPseudoAny: + case kPseudoMatches: break; default: break;
diff --git a/third_party/WebKit/Source/core/css/CSSSelector.h b/third_party/WebKit/Source/core/css/CSSSelector.h index e1429b46..1f303e1 100644 --- a/third_party/WebKit/Source/core/css/CSSSelector.h +++ b/third_party/WebKit/Source/core/css/CSSSelector.h
@@ -157,6 +157,7 @@ kPseudoLink, kPseudoVisited, kPseudoAny, + kPseudoMatches, kPseudoAnyLink, kPseudoWebkitAnyLink, kPseudoAutofill,
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp index fc2a9a0..3059a6e6 100644 --- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp +++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -100,75 +100,11 @@ return CSSValue::Create(length, style.EffectiveZoom()); } -static CSSValueList* CreatePositionListForLayer(const CSSProperty& property, - const FillLayer& layer, - const ComputedStyle& style) { - CSSValueList* position_list = CSSValueList::CreateSpaceSeparated(); - if (layer.IsBackgroundXOriginSet()) { - DCHECK(property.IDEquals(CSSPropertyBackgroundPosition) || - property.IDEquals(CSSPropertyWebkitMaskPosition)); - position_list->Append( - *CSSIdentifierValue::Create(layer.BackgroundXOrigin())); - } - position_list->Append(*ComputedStyleUtils::ZoomAdjustedPixelValueForLength( - layer.PositionX(), style)); - if (layer.IsBackgroundYOriginSet()) { - DCHECK(property.IDEquals(CSSPropertyBackgroundPosition) || - property.IDEquals(CSSPropertyWebkitMaskPosition)); - position_list->Append( - *CSSIdentifierValue::Create(layer.BackgroundYOrigin())); - } - position_list->Append(*ComputedStyleUtils::ZoomAdjustedPixelValueForLength( - layer.PositionY(), style)); - return position_list; -} - -static CSSValue* ValueForFillSize(const FillSize& fill_size, - const ComputedStyle& style) { - if (fill_size.type == EFillSizeType::kContain) - return CSSIdentifierValue::Create(CSSValueContain); - - if (fill_size.type == EFillSizeType::kCover) - return CSSIdentifierValue::Create(CSSValueCover); - - if (fill_size.size.Height().IsAuto()) { - return ComputedStyleUtils::ZoomAdjustedPixelValueForLength( - fill_size.size.Width(), style); - } - - CSSValueList* list = CSSValueList::CreateSpaceSeparated(); - list->Append(*ComputedStyleUtils::ZoomAdjustedPixelValueForLength( - fill_size.size.Width(), style)); - list->Append(*ComputedStyleUtils::ZoomAdjustedPixelValueForLength( - fill_size.size.Height(), style)); - return list; -} - -static CSSValue* ValueForFillRepeat(EFillRepeat x_repeat, - EFillRepeat y_repeat) { - // For backwards compatibility, if both values are equal, just return one of - // them. And if the two values are equivalent to repeat-x or repeat-y, just - // return the shorthand. - if (x_repeat == y_repeat) - return CSSIdentifierValue::Create(x_repeat); - if (x_repeat == EFillRepeat::kRepeatFill && - y_repeat == EFillRepeat::kNoRepeatFill) - return CSSIdentifierValue::Create(CSSValueRepeatX); - if (x_repeat == EFillRepeat::kNoRepeatFill && - y_repeat == EFillRepeat::kRepeatFill) - return CSSIdentifierValue::Create(CSSValueRepeatY); - - CSSValueList* list = CSSValueList::CreateSpaceSeparated(); - list->Append(*CSSIdentifierValue::Create(x_repeat)); - list->Append(*CSSIdentifierValue::Create(y_repeat)); - return list; -} - static CSSValue* ValueForFillSourceType(EMaskSourceType type) { switch (type) { - case kMaskAlpha: + case EMaskSourceType::kAlpha: return CSSIdentifierValue::Create(CSSValueAlpha); - case kMaskLuminance: + case EMaskSourceType::kLuminance: return CSSIdentifierValue::Create(CSSValueLuminance); } @@ -620,42 +556,6 @@ } } -static CSSValueList* ValuesForBackgroundShorthand( - const ComputedStyle& style, - const LayoutObject* layout_object, - Node* styled_node, - bool allow_visited_style) { - CSSValueList* ret = CSSValueList::CreateCommaSeparated(); - const FillLayer* curr_layer = &style.BackgroundLayers(); - for (; curr_layer; curr_layer = curr_layer->Next()) { - CSSValueList* list = CSSValueList::CreateSlashSeparated(); - CSSValueList* before_slash = CSSValueList::CreateSpaceSeparated(); - if (!curr_layer->Next()) { // color only for final layer - const CSSValue* value = ComputedStyleCSSValueMapping::Get( - GetCSSPropertyBackgroundColor(), style, layout_object, styled_node, - allow_visited_style); - DCHECK(value); - before_slash->Append(*value); - } - before_slash->Append(curr_layer->GetImage() - ? *curr_layer->GetImage()->ComputedCSSValue() - : *CSSIdentifierValue::Create(CSSValueNone)); - before_slash->Append( - *ValueForFillRepeat(curr_layer->RepeatX(), curr_layer->RepeatY())); - before_slash->Append(*CSSIdentifierValue::Create(curr_layer->Attachment())); - before_slash->Append(*CreatePositionListForLayer( - GetCSSPropertyBackgroundPosition(), *curr_layer, style)); - list->Append(*before_slash); - CSSValueList* after_slash = CSSValueList::CreateSpaceSeparated(); - after_slash->Append(*ValueForFillSize(curr_layer->Size(), style)); - after_slash->Append(*CSSIdentifierValue::Create(curr_layer->Origin())); - after_slash->Append(*CSSIdentifierValue::Create(curr_layer->Clip())); - list->Append(*after_slash); - ret->Append(*list); - } - return ret; -} - static CSSValueList* ValueForContentPositionAndDistributionWithOverflowAlignment( const StyleContentAlignmentData& data) { @@ -1378,9 +1278,9 @@ } static CSSValue* ValueForAnimationPlayState(EAnimPlayState play_state) { - if (play_state == kAnimPlayStatePlaying) + if (play_state == EAnimPlayState::kPlaying) return CSSIdentifierValue::Create(CSSValueRunning); - DCHECK_EQ(play_state, kAnimPlayStatePaused); + DCHECK_EQ(play_state, EAnimPlayState::kPaused); return CSSIdentifierValue::Create(CSSValuePaused); } @@ -1604,13 +1504,13 @@ CSSValueID ValueForQuoteType(const QuoteType quote_type) { switch (quote_type) { - case NO_OPEN_QUOTE: + case QuoteType::kNoOpen: return CSSValueNoOpenQuote; - case NO_CLOSE_QUOTE: + case QuoteType::kNoClose: return CSSValueNoCloseQuote; - case CLOSE_QUOTE: + case QuoteType::kClose: return CSSValueCloseQuote; - case OPEN_QUOTE: + case QuoteType::kOpen: return CSSValueOpenQuote; } NOTREACHED(); @@ -2243,45 +2143,8 @@ const SVGComputedStyle& svg_style = style.SvgStyle(); const CSSProperty& resolved_property = property.ResolveDirectionAwareProperty( style.Direction(), style.GetWritingMode()); + switch (resolved_property.PropertyID()) { - case CSSPropertyBackgroundImage: - case CSSPropertyWebkitMaskImage: { - CSSValueList* list = CSSValueList::CreateCommaSeparated(); - const FillLayer* curr_layer = - resolved_property.IDEquals(CSSPropertyWebkitMaskImage) - ? &style.MaskLayers() - : &style.BackgroundLayers(); - for (; curr_layer; curr_layer = curr_layer->Next()) { - if (curr_layer->GetImage()) - list->Append(*curr_layer->GetImage()->ComputedCSSValue()); - else - list->Append(*CSSIdentifierValue::Create(CSSValueNone)); - } - return list; - } - case CSSPropertyBackgroundSize: - case CSSPropertyWebkitMaskSize: { - CSSValueList* list = CSSValueList::CreateCommaSeparated(); - const FillLayer* curr_layer = - resolved_property.IDEquals(CSSPropertyWebkitMaskSize) - ? &style.MaskLayers() - : &style.BackgroundLayers(); - for (; curr_layer; curr_layer = curr_layer->Next()) - list->Append(*ValueForFillSize(curr_layer->Size(), style)); - return list; - } - case CSSPropertyBackgroundRepeat: - case CSSPropertyWebkitMaskRepeat: { - CSSValueList* list = CSSValueList::CreateCommaSeparated(); - const FillLayer* curr_layer = - resolved_property.IDEquals(CSSPropertyWebkitMaskRepeat) - ? &style.MaskLayers() - : &style.BackgroundLayers(); - for (; curr_layer; curr_layer = curr_layer->Next()) - list->Append( - *ValueForFillRepeat(curr_layer->RepeatX(), curr_layer->RepeatY())); - return list; - } case CSSPropertyMaskSourceType: { CSSValueList* list = CSSValueList::CreateCommaSeparated(); for (const FillLayer* curr_layer = &style.MaskLayers(); curr_layer; @@ -2324,19 +2187,6 @@ } return list; } - case CSSPropertyBackgroundPosition: - case CSSPropertyWebkitMaskPosition: { - CSSValueList* list = CSSValueList::CreateCommaSeparated(); - const FillLayer* curr_layer = - resolved_property.IDEquals(CSSPropertyWebkitMaskPosition) - ? &style.MaskLayers() - : &style.BackgroundLayers(); - for (; curr_layer; curr_layer = curr_layer->Next()) { - list->Append( - *CreatePositionListForLayer(resolved_property, *curr_layer, style)); - } - return list; - } case CSSPropertyBackgroundPositionX: case CSSPropertyWebkitMaskPositionX: { CSSValueList* list = CSSValueList::CreateCommaSeparated(); @@ -3297,9 +3147,6 @@ list->Append(*CSSIdentifierValue::Create(curr_layer->BlendMode())); return list; } - case CSSPropertyBackground: - return ValuesForBackgroundShorthand(style, layout_object, styled_node, - allow_visited_style); case CSSPropertyBorder: { const CSSValue* value = Get(GetCSSPropertyBorderTop(), style, layout_object, styled_node,
diff --git a/third_party/WebKit/Source/core/css/RuleFeatureSet.cpp b/third_party/WebKit/Source/core/css/RuleFeatureSet.cpp index 92409374..162cbab6 100644 --- a/third_party/WebKit/Source/core/css/RuleFeatureSet.cpp +++ b/third_party/WebKit/Source/core/css/RuleFeatureSet.cpp
@@ -42,6 +42,7 @@ #include "core/dom/Element.h" #include "core/dom/Node.h" #include "core/inspector/InspectorTraceEvents.h" +#include "platform/runtime_enabled_features.h" #include "platform/wtf/BitVector.h" namespace blink { @@ -90,6 +91,7 @@ case CSSSelector::kPseudoLink: case CSSSelector::kPseudoVisited: case CSSSelector::kPseudoAny: + case CSSSelector::kPseudoMatches: case CSSSelector::kPseudoWebkitAnyLink: case CSSSelector::kPseudoAnyLink: case CSSSelector::kPseudoAutofill: @@ -181,6 +183,8 @@ pseudo == CSSSelector::kPseudoCue || pseudo == CSSSelector::kPseudoHost || pseudo == CSSSelector::kPseudoHostContext || + ((pseudo == CSSSelector::kPseudoMatches) && + RuntimeEnabledFeatures::CSSMatchesEnabled()) || pseudo == CSSSelector::kPseudoNot || pseudo == CSSSelector::kPseudoSlotted; }
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp index 68e9a5d1..f9d5166 100644 --- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp +++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -878,6 +878,21 @@ } case CSSSelector::kPseudoTarget: return element == element.GetDocument().CssTarget(); + case CSSSelector::kPseudoMatches: { + if (!RuntimeEnabledFeatures::CSSMatchesEnabled()) + return false; + UseCounter::Count(context.element->GetDocument(), + WebFeature::kCSSSelectorPseudoMatches); + SelectorCheckingContext sub_context(context); + sub_context.is_sub_selector = true; + DCHECK(selector.SelectorList()); + for (sub_context.selector = selector.SelectorList()->First(); + sub_context.selector; sub_context.selector = CSSSelectorList::Next( + *sub_context.selector)) { + if (Match(sub_context)) + return true; + } + } break; case CSSSelector::kPseudoAny: { SelectorCheckingContext sub_context(context); sub_context.is_sub_selector = true;
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp b/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp index 061bb4e..b9dccdf 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp
@@ -153,8 +153,13 @@ return nullptr; } - DOMMatrix* result = DOMMatrix::Create(); - return result->scaleSelf(x->value(), y->value(), z->value()); + DOMMatrix* matrix = DOMMatrix::Create(); + if (is2D()) + matrix->scaleSelf(x->value(), y->value()); + else + matrix->scaleSelf(x->value(), y->value(), z->value()); + + return matrix; } const CSSFunctionValue* CSSScale::ToCSSValue() const {
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp index 478ffa4f..47599bbf 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp
@@ -37,10 +37,9 @@ const auto style_values = StyleValueFactory::FromString( property_id, value, CSSParserContext::Create(*execution_context)); if (style_values.IsEmpty()) { - exception_state.ThrowDOMException( - kSyntaxError, "The value provided ('" + value + - "') could not be parsed as a '" + property_name + - "'."); + exception_state.ThrowTypeError("The value provided ('" + value + + "') could not be parsed as a '" + + property_name + "'."); return CSSStyleValueVector(); }
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp b/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp index 9bdd0d6..3a3f0f6 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp
@@ -177,7 +177,12 @@ } DOMMatrix* matrix = DOMMatrix::Create(); - return matrix->translate(x->value(), y->value(), z->value()); + if (is2D()) + matrix->translateSelf(x->value(), y->value()); + else + matrix->translateSelf(x->value(), y->value(), z->value()); + + return matrix; } const CSSFunctionValue* CSSTranslation::ToCSSValue() const {
diff --git a/third_party/WebKit/Source/core/css/cssom/DeclaredStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/DeclaredStylePropertyMap.cpp index ca8f417..a1d674c 100644 --- a/third_party/WebKit/Source/core/css/cssom/DeclaredStylePropertyMap.cpp +++ b/third_party/WebKit/Source/core/css/cssom/DeclaredStylePropertyMap.cpp
@@ -55,6 +55,8 @@ void DeclaredStylePropertyMap::ForEachProperty( const IterationCallback& callback) { + if (!GetStyleRule()) + return; const CSSPropertyValueSet& declared_style_set = GetStyleRule()->Properties(); for (unsigned i = 0; i < declared_style_set.PropertyCount(); i++) { const auto& property_reference = declared_style_set.PropertyAt(i);
diff --git a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp index 4ee361cc..3a104cf 100644 --- a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp +++ b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp
@@ -42,8 +42,7 @@ } CSSStyleValue* CreateStyleValue(const CSSValue& value) { - if (value.IsCSSWideKeyword() || value.IsIdentifierValue() || - value.IsCustomIdentValue()) + if (value.IsIdentifierValue() || value.IsCustomIdentValue()) return CSSKeywordValue::FromCSSValue(value); if (value.IsPrimitiveValue()) return CSSNumericValue::FromCSSValue(ToCSSPrimitiveValue(value)); @@ -63,6 +62,9 @@ CSSStyleValue* CreateStyleValueWithProperty(CSSPropertyID property_id, const CSSValue& value) { + if (value.IsCSSWideKeyword()) + return CSSKeywordValue::FromCSSValue(value); + CSSStyleValue* style_value = CreateStyleValueWithPropertyInternal(property_id, value); if (style_value)
diff --git a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp index c6317d19..fd29c00e 100644 --- a/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp +++ b/third_party/WebKit/Source/core/css/parser/CSSSelectorParser.cpp
@@ -528,6 +528,9 @@ return nullptr; switch (selector->GetPseudoType()) { + case CSSSelector::kPseudoMatches: + if (!RuntimeEnabledFeatures::CSSMatchesEnabled()) + break; case CSSSelector::kPseudoHost: case CSSSelector::kPseudoHostContext: case CSSSelector::kPseudoAny: @@ -907,6 +910,10 @@ case CSSSelector::kPseudoAny: feature = WebFeature::kCSSSelectorPseudoAny; break; + case CSSSelector::kPseudoMatches: + if (RuntimeEnabledFeatures::CSSMatchesEnabled()) + feature = WebFeature::kCSSSelectorPseudoMatches; + break; case CSSSelector::kPseudoUnresolved: feature = WebFeature::kCSSSelectorPseudoUnresolved; break;
diff --git a/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.cpp b/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.cpp index aa66d02..f03358ce 100644 --- a/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.cpp +++ b/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.cpp
@@ -5,6 +5,8 @@ #include "core/css/properties/ComputedStyleUtils.h" #include "core/css/CSSColorValue.h" +#include "core/css/CSSIdentifierValue.h" +#include "core/css/CSSPrimitiveValueMappings.h" #include "core/css/CSSValue.h" #include "core/css/StyleColor.h" #include "core/css/ZoomAdjustedPixelValue.h" @@ -45,4 +47,149 @@ return CSSValue::Create(length, style.EffectiveZoom()); } +const CSSValue* ComputedStyleUtils::BackgroundImageOrWebkitMaskImage( + const FillLayer& fill_layer) { + CSSValueList* list = CSSValueList::CreateCommaSeparated(); + const FillLayer* curr_layer = &fill_layer; + for (; curr_layer; curr_layer = curr_layer->Next()) { + if (curr_layer->GetImage()) + list->Append(*curr_layer->GetImage()->ComputedCSSValue()); + else + list->Append(*CSSIdentifierValue::Create(CSSValueNone)); + } + return list; +} + +const CSSValue* ComputedStyleUtils::ValueForFillSize( + const FillSize& fill_size, + const ComputedStyle& style) { + if (fill_size.type == EFillSizeType::kContain) + return CSSIdentifierValue::Create(CSSValueContain); + + if (fill_size.type == EFillSizeType::kCover) + return CSSIdentifierValue::Create(CSSValueCover); + + if (fill_size.size.Height().IsAuto()) { + return ZoomAdjustedPixelValueForLength(fill_size.size.Width(), style); + } + + CSSValueList* list = CSSValueList::CreateSpaceSeparated(); + list->Append(*ZoomAdjustedPixelValueForLength(fill_size.size.Width(), style)); + list->Append( + *ZoomAdjustedPixelValueForLength(fill_size.size.Height(), style)); + return list; +} + +const CSSValue* ComputedStyleUtils::BackgroundImageOrWebkitMaskSize( + const ComputedStyle& style, + const FillLayer& fill_layer) { + CSSValueList* list = CSSValueList::CreateCommaSeparated(); + const FillLayer* curr_layer = &fill_layer; + for (; curr_layer; curr_layer = curr_layer->Next()) + list->Append(*ValueForFillSize(curr_layer->Size(), style)); + return list; +} + +const CSSValueList* ComputedStyleUtils::CreatePositionListForLayer( + const CSSProperty& property, + const FillLayer& layer, + const ComputedStyle& style) { + CSSValueList* position_list = CSSValueList::CreateSpaceSeparated(); + if (layer.IsBackgroundXOriginSet()) { + DCHECK(property.IDEquals(CSSPropertyBackgroundPosition) || + property.IDEquals(CSSPropertyWebkitMaskPosition)); + position_list->Append( + *CSSIdentifierValue::Create(layer.BackgroundXOrigin())); + } + position_list->Append(*ComputedStyleUtils::ZoomAdjustedPixelValueForLength( + layer.PositionX(), style)); + if (layer.IsBackgroundYOriginSet()) { + DCHECK(property.IDEquals(CSSPropertyBackgroundPosition) || + property.IDEquals(CSSPropertyWebkitMaskPosition)); + position_list->Append( + *CSSIdentifierValue::Create(layer.BackgroundYOrigin())); + } + position_list->Append(*ComputedStyleUtils::ZoomAdjustedPixelValueForLength( + layer.PositionY(), style)); + return position_list; +} + +const CSSValue* ComputedStyleUtils::ValueForFillRepeat(EFillRepeat x_repeat, + EFillRepeat y_repeat) { + // For backwards compatibility, if both values are equal, just return one of + // them. And if the two values are equivalent to repeat-x or repeat-y, just + // return the shorthand. + if (x_repeat == y_repeat) + return CSSIdentifierValue::Create(x_repeat); + if (x_repeat == EFillRepeat::kRepeatFill && + y_repeat == EFillRepeat::kNoRepeatFill) + return CSSIdentifierValue::Create(CSSValueRepeatX); + if (x_repeat == EFillRepeat::kNoRepeatFill && + y_repeat == EFillRepeat::kRepeatFill) + return CSSIdentifierValue::Create(CSSValueRepeatY); + + CSSValueList* list = CSSValueList::CreateSpaceSeparated(); + list->Append(*CSSIdentifierValue::Create(x_repeat)); + list->Append(*CSSIdentifierValue::Create(y_repeat)); + return list; +} + +const CSSValueList* ComputedStyleUtils::ValuesForBackgroundShorthand( + const ComputedStyle& style, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) { + CSSValueList* result = CSSValueList::CreateCommaSeparated(); + const FillLayer* curr_layer = &style.BackgroundLayers(); + for (; curr_layer; curr_layer = curr_layer->Next()) { + CSSValueList* list = CSSValueList::CreateSlashSeparated(); + CSSValueList* before_slash = CSSValueList::CreateSpaceSeparated(); + if (!curr_layer->Next()) { // color only for final layer + const CSSValue* value = + GetCSSPropertyBackgroundColor().CSSValueFromComputedStyle( + style, layout_object, styled_node, allow_visited_style); + DCHECK(value); + before_slash->Append(*value); + } + before_slash->Append(curr_layer->GetImage() + ? *curr_layer->GetImage()->ComputedCSSValue() + : *CSSIdentifierValue::Create(CSSValueNone)); + before_slash->Append( + *ValueForFillRepeat(curr_layer->RepeatX(), curr_layer->RepeatY())); + before_slash->Append(*CSSIdentifierValue::Create(curr_layer->Attachment())); + before_slash->Append(*CreatePositionListForLayer( + GetCSSPropertyBackgroundPosition(), *curr_layer, style)); + list->Append(*before_slash); + CSSValueList* after_slash = CSSValueList::CreateSpaceSeparated(); + after_slash->Append(*ValueForFillSize(curr_layer->Size(), style)); + after_slash->Append(*CSSIdentifierValue::Create(curr_layer->Origin())); + after_slash->Append(*CSSIdentifierValue::Create(curr_layer->Clip())); + list->Append(*after_slash); + result->Append(*list); + } + return result; +} + +const CSSValue* ComputedStyleUtils::BackgroundRepeatOrWebkitMaskRepeat( + const FillLayer* curr_layer) { + CSSValueList* list = CSSValueList::CreateCommaSeparated(); + for (; curr_layer; curr_layer = curr_layer->Next()) { + list->Append( + *ValueForFillRepeat(curr_layer->RepeatX(), curr_layer->RepeatY())); + } + return list; +} + +const CSSValue* ComputedStyleUtils::BackgroundPositionOrWebkitMaskPosition( + const CSSProperty& resolved_property, + const ComputedStyle& style, + const FillLayer* curr_layer) { + CSSValueList* list = CSSValueList::CreateCommaSeparated(); + for (; curr_layer; curr_layer = curr_layer->Next()) { + list->Append( + *CreatePositionListForLayer(resolved_property, *curr_layer, style)); + } + return list; +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.h b/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.h index ff5df60..10d7c73 100644 --- a/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.h +++ b/third_party/WebKit/Source/core/css/properties/ComputedStyleUtils.h
@@ -5,7 +5,9 @@ #ifndef ComputedStyleUtils_h #define ComputedStyleUtils_h +#include "core/css/CSSValueList.h" #include "core/style/ComputedStyle.h" +#include "core/style/ComputedStyleConstants.h" #include "platform/wtf/Allocator.h" namespace blink { @@ -26,6 +28,26 @@ bool visited_link); static CSSValue* ZoomAdjustedPixelValueForLength(const Length&, const ComputedStyle&); + static const CSSValue* BackgroundImageOrWebkitMaskImage(const FillLayer&); + static const CSSValue* ValueForFillSize(const FillSize&, + const ComputedStyle&); + static const CSSValue* BackgroundImageOrWebkitMaskSize(const ComputedStyle&, + const FillLayer&); + static const CSSValueList* CreatePositionListForLayer(const CSSProperty&, + const FillLayer&, + const ComputedStyle&); + static const CSSValue* ValueForFillRepeat(EFillRepeat x_repeat, + EFillRepeat y_repeat); + static const CSSValueList* ValuesForBackgroundShorthand( + const ComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style); + static const CSSValue* BackgroundRepeatOrWebkitMaskRepeat(const FillLayer*); + static const CSSValue* BackgroundPositionOrWebkitMaskPosition( + const CSSProperty&, + const ComputedStyle&, + const FillLayer*); }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/README.md b/third_party/WebKit/Source/core/css/properties/README.md index 4df12c6c..e7b6907 100644 --- a/third_party/WebKit/Source/core/css/properties/README.md +++ b/third_party/WebKit/Source/core/css/properties/README.md
@@ -7,34 +7,53 @@ ## Overview -CSSProperty is the base class which all property implementations are derived -from. It contains all the methods that can be called on a property class, and a -default implementation for each. The .cpp implementation files for -CSSProperty are split between the generated code (CSSProperty.cpp) and the -hand written code (CSSPropertyBaseCustom.cpp). +Property class inheritance structure: -The methods that are overriden from the base class by a property class depends + + +CSSUnresolvedProperty is the base class which all property implementations are +derived from, either directly or indirectly. This class includes logic that +needs to be implemented by alias classes (a small subset of property logic), as +well as static methods to get the property class for every property. Alias +classes inherit directly from CSSUnresolvedProperty. + +CSSProperty is another base class, which inherits from CSSUnresolvedProperty. +It contains all the methods that can be called on a resolved property class, and +a default implementation for each. The implementation for CSSProperty is +partially generated (CSSProperty.h and CSSProperty.cpp) and partially hand +written (CSSPropertyBaseCustom.cpp). + +Longhand and Shorthand are base classes which inherit from CSSProperty, from +which all longhand and shorthand property classes directly derive. Variable is a +special property class that represents custom properties, which inherits from +CSSProperty. + +The methods that are overriden from the base classes by a property class depends on the functionality required by that property. Methods may have a working -default implementation in the base class, or may assert that this default +default implementation in the base classes, or may assert that this default implementation is not reached. -A derived CSS property class (<Property|GroupName\>) represents a -single CSS property or a group of CSS properties that share implementation -logic. Property groups can be determined from -[CSSProperties.json5](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/CSSProperties.json5). -Properties that are a part of a group define the group class name as -'property_class' here. +Alias classes, longhand classes, and shorthand classes each represent a single +CSS property and are named after that property. These property classes are +partially generated (<PropertyName\>.h and for some properties +<PropertyName\>.cpp), and partially hand written (<PropertyName\>Custom.cpp). -Examples: - -* A single property class: the `LineHeight` class is used only by - the `line-height` property -* A group of properties that share logic: the `ImageSource` - class is shared by the `border-image-source` and - `-webkit-mask-box-image-source` properties. ## Special property classes +### Aliases + +Aliases are properties that share most of their logic with another property, +somtimes with the exception of some minor differences in parsing logic due to +legacy reasons. Many aliases are -webit prefixed properties that have since +been implemented without the prefix. Aliases define the alias_for member in +[CSSProperties.json5](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/CSSProperties.json5)). + +Alias classes implement a small subset of functions of properties, only those +that do not share an implementation with the resolved property that they are an +alias for. Because of this, these classes inherit directly from a base class +CSSUnresolvedProperty. + ### Shorthand properties Shorthand properties only exist in the context of parsing and serialization. @@ -63,16 +82,17 @@ ## How to add a new property class 1. Add a .cpp file to this directory named - `<Property|GroupName>.cpp` + `<PropertyName>.cpp` 2. Implement the property class in the .cpp file - 1. Add `#include "core/css/properties/<longhands|shorthands>/<Property|GroupName>.h"` + 1. Add `#include "core/css/properties/<longhands|shorthands>/<PropertyName>.h"` (this will be a generated file). 2. Implement the required methods on the property class. 3. If logic is required by multiple property classes you may need to create a - new Utils file. + new Utils file. These utils methods are grouped by pipeline function (e.g. + [CSSParsingUtils](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/properties/CSSParsingUtils.h)). 4. Add the new property to `core/css/CSSProperties.json5`. Ensure that you - include the 'property_class' flag and the 'property_methods' flag so that - the property class files are generated correctly (see + include all the methods implemented on the property in the + 'property_methods' flag so that the header file is generated correctly (see [CSSProperties.json5](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/CSSProperties.json5) for more details) 5. Add new files to BUILD files @@ -81,21 +101,34 @@ in the `blink_core_sources` target's `sources` parameter 2. Add the generated .h file to [core/BUILD.gn](https://codesearch.chromium.org/chromium/src/third_party/WebKit/Source/core/BUILD.gn) - in the `css_properties` target's `outputs` parameter + in the `css_properties` target's `outputs` parameter. This step is often + forgotten and may not immediately caues an error but can cause linking + errors in certain situations. See [this example CL](https://codereview.chromium.org/2735093005), which converts the existing line-height property to use the CSSProperty design. This new line-height property class only implements the ParseSingleValue method, -using -[CSSPropertyFontUtils.cpp](https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/properties/CSSPropertyFontUtils.h) -to access shared font logic. +using shared logic through a utils file. + +## How to use a property class + +Property class instances may be accessed through the base class +CSSUnresolvedProperty, either by directly calling the get function for that +property +(CSSUnresolvedProperty::GetCSSProperty<PropertyName\>)(), or by passing the +CSSPropertyID to the general getter +(CSSUnresolvedProperty::Get(CSSPropertyID)). + +Methods that handle property specific logic may be called directly on the +property class instance. Which methods are available depends on what type of +property it is (i.e. which base classes it implements). ## Status Eventually, all logic pertaining to a single property will be found only within its CSS property class where possible. -Currently (September 1 2017) the code base is in a transitional state and +Currently (5 Jan 2018) the code base is in a transitional state and property specific logic is still scattered around the code base. See Project Ribbon [tracking bug](https://bugs.chromium.org/p/chromium/issues/detail?id=545324) and
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundImageCustom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundImageCustom.cpp index 87b406a..2dde51c 100644 --- a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundImageCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundImageCustom.cpp
@@ -5,6 +5,8 @@ #include "core/css/properties/longhands/BackgroundImage.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSLonghand { @@ -17,5 +19,15 @@ CSSPropertyParserHelpers::ConsumeImageOrNone, range, &context); } +const CSSValue* BackgroundImage::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style) const { + const FillLayer& fill_layer = style.BackgroundLayers(); + return ComputedStyleUtils::BackgroundImageOrWebkitMaskImage(fill_layer); +} + } // namespace CSSLonghand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundSizeCustom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundSizeCustom.cpp index e93f0b3b..ab04f1c 100644 --- a/third_party/WebKit/Source/core/css/properties/longhands/BackgroundSizeCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/longhands/BackgroundSizeCustom.cpp
@@ -5,6 +5,8 @@ #include "core/css/properties/longhands/BackgroundSize.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSLonghand { @@ -17,5 +19,15 @@ local_context); } +const CSSValue* BackgroundSize::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style) const { + const FillLayer& fill_layer = style.BackgroundLayers(); + return ComputedStyleUtils::BackgroundImageOrWebkitMaskSize(style, fill_layer); +} + } // namespace CSSLonghand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskImageCustom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskImageCustom.cpp index cb0cc6ce..eaa7d76 100644 --- a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskImageCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskImageCustom.cpp
@@ -5,6 +5,8 @@ #include "core/css/properties/longhands/WebkitMaskImage.h" #include "core/css/parser/CSSPropertyParserHelpers.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSLonghand { @@ -17,5 +19,15 @@ CSSPropertyParserHelpers::ConsumeImageOrNone, range, &context); } +const CSSValue* WebkitMaskImage::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style) const { + const FillLayer& fill_layer = style.MaskLayers(); + return ComputedStyleUtils::BackgroundImageOrWebkitMaskImage(fill_layer); +} + } // namespace CSSLonghand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSizeCustom.cpp b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSizeCustom.cpp index 1a646dc..fb5d311 100644 --- a/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSizeCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/longhands/WebkitMaskSizeCustom.cpp
@@ -5,6 +5,8 @@ #include "core/css/properties/longhands/WebkitMaskSize.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSLonghand { @@ -17,5 +19,15 @@ local_context); } +const CSSValue* WebkitMaskSize::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style) const { + const FillLayer& fill_layer = style.MaskLayers(); + return ComputedStyleUtils::BackgroundImageOrWebkitMaskSize(style, fill_layer); +} + } // namespace CSSLonghand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundCustom.cpp index e43747c..c24941a 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundCustom.cpp
@@ -5,6 +5,8 @@ #include "core/css/properties/shorthands/Background.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -19,5 +21,15 @@ local_context, properties); } +const CSSValue* Background::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject* layout_object, + Node* styled_node, + bool allow_visited_style) const { + return ComputedStyleUtils::ValuesForBackgroundShorthand( + style, layout_object, styled_node, allow_visited_style); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundPositionCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundPositionCustom.cpp index 38e3bf7..f0a542f 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundPositionCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundPositionCustom.cpp
@@ -7,6 +7,8 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -38,5 +40,15 @@ return true; } +const CSSValue* BackgroundPosition::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style) const { + return ComputedStyleUtils::BackgroundPositionOrWebkitMaskPosition( + *this, style, &style.BackgroundLayers()); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundRepeatCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundRepeatCustom.cpp index cebe238..b56dbc7 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundRepeatCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/BackgroundRepeatCustom.cpp
@@ -9,6 +9,8 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -43,5 +45,15 @@ return true; } +const CSSValue* BackgroundRepeat::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style) const { + return ComputedStyleUtils::BackgroundRepeatOrWebkitMaskRepeat( + &style.BackgroundLayers()); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskPositionCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskPositionCustom.cpp index cb674c9a..bf96873 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskPositionCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskPositionCustom.cpp
@@ -7,6 +7,8 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -38,5 +40,15 @@ return true; } +const CSSValue* WebkitMaskPosition::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style) const { + return ComputedStyleUtils::BackgroundPositionOrWebkitMaskPosition( + *this, style, &style.MaskLayers()); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskRepeatCustom.cpp b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskRepeatCustom.cpp index 268cdeb..1a3b86a2 100644 --- a/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskRepeatCustom.cpp +++ b/third_party/WebKit/Source/core/css/properties/shorthands/WebkitMaskRepeatCustom.cpp
@@ -9,6 +9,8 @@ #include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/properties/CSSParsingUtils.h" +#include "core/css/properties/ComputedStyleUtils.h" +#include "core/style/ComputedStyle.h" namespace blink { namespace CSSShorthand { @@ -43,5 +45,15 @@ return true; } +const CSSValue* WebkitMaskRepeat::CSSValueFromComputedStyleInternal( + const ComputedStyle& style, + const SVGComputedStyle&, + const LayoutObject*, + Node*, + bool allow_visited_style) const { + return ComputedStyleUtils::BackgroundRepeatOrWebkitMaskRepeat( + &style.MaskLayers()); +} + } // namespace CSSShorthand } // namespace blink
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp b/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp index a39a7a0..0b18cb7 100644 --- a/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp +++ b/third_party/WebKit/Source/core/css/resolver/CSSToStyleMap.cpp
@@ -299,10 +299,10 @@ switch (ToCSSIdentifierValue(value).GetValueID()) { case CSSValueAlpha: - type = kMaskAlpha; + type = EMaskSourceType::kAlpha; break; case CSSValueLuminance: - type = kMaskLuminance; + type = EMaskSourceType::kLuminance; break; case CSSValueAuto: break; @@ -386,9 +386,9 @@ if (value.IsInitialValue()) return CSSAnimationData::InitialPlayState(); if (ToCSSIdentifierValue(value).GetValueID() == CSSValuePaused) - return kAnimPlayStatePaused; + return EAnimPlayState::kPaused; DCHECK_EQ(ToCSSIdentifierValue(value).GetValueID(), CSSValueRunning); - return kAnimPlayStatePlaying; + return EAnimPlayState::kPlaying; } CSSTransitionData::TransitionProperty CSSToStyleMap::MapAnimationProperty(
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp index 05a34406..6ff01b30 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -359,7 +359,10 @@ case CSSValueBrightness: case CSSValueContrast: case CSSValueOpacity: { - double amount = (filter->FunctionType() == CSSValueBrightness) ? 0 : 1; + double amount = (filter->FunctionType() == CSSValueBrightness || + filter->FunctionType() == CSSValueInvert) + ? 0 + : 1; if (filter->length() == 1) { amount = value->GetDoubleValue(); if (value->IsPercentage())
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp index ab9f1b9..96e1663 100644 --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -742,16 +742,16 @@ default: NOTREACHED(); case CSSValueOpenQuote: - quote_type = OPEN_QUOTE; + quote_type = QuoteType::kOpen; break; case CSSValueCloseQuote: - quote_type = CLOSE_QUOTE; + quote_type = QuoteType::kClose; break; case CSSValueNoOpenQuote: - quote_type = NO_OPEN_QUOTE; + quote_type = QuoteType::kNoOpen; break; case CSSValueNoCloseQuote: - quote_type = NO_CLOSE_QUOTE; + quote_type = QuoteType::kNoClose; break; } next_content = ContentData::Create(quote_type);
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp index bddbbca..2f3d017 100644 --- a/third_party/WebKit/Source/core/dom/Document.cpp +++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -38,6 +38,7 @@ #include "bindings/core/v8/WindowProxy.h" #include "bindings/core/v8/html_script_element_or_svg_script_element.h" #include "bindings/core/v8/string_or_dictionary.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/animation/DocumentAnimations.h" #include "core/animation/DocumentTimeline.h" #include "core/animation/PendingAnimations.h" @@ -257,7 +258,6 @@ #include "public/platform/InterfaceProvider.h" #include "public/platform/Platform.h" #include "public/platform/TaskType.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebPrerenderingSupport.h" #include "public/platform/modules/insecure_input/insecure_input_service.mojom-blink.h" #include "public/platform/site_engagement.mojom-blink.h" @@ -3853,11 +3853,13 @@ } if (!base_element_url.IsEmpty()) { - if (base_element_url.ProtocolIsData()) { + if (base_element_url.ProtocolIsData() || + base_element_url.ProtocolIsJavaScript()) { UseCounter::Count(*this, WebFeature::kBaseWithDataHref); AddConsoleMessage(ConsoleMessage::Create( kSecurityMessageSource, kErrorMessageLevel, - "'data:' URLs may not be used as base URLs for a document.")); + "'" + base_element_url.Protocol() + + "' URLs may not be used as base URLs for a document.")); } if (!GetSecurityOrigin()->CanRequest(base_element_url)) UseCounter::Count(*this, WebFeature::kBaseWithCrossOriginHref); @@ -3865,6 +3867,7 @@ if (base_element_url != base_element_url_ && !base_element_url.ProtocolIsData() && + !base_element_url.ProtocolIsJavaScript() && GetContentSecurityPolicy()->AllowBaseURI(base_element_url)) { base_element_url_ = base_element_url; UpdateBaseURL(); @@ -6081,16 +6084,16 @@ // https://wicg.github.io/cors-rfc1918/#csp). if (initializer.IsHostedInReservedIPRange()) { SetAddressSpace(GetSecurityOrigin()->IsLocalhost() - ? kWebAddressSpaceLocal - : kWebAddressSpacePrivate); + ? mojom::IPAddressSpace::kLocal + : mojom::IPAddressSpace::kPrivate); } else if (GetSecurityOrigin()->IsLocal()) { // "Local" security origins (like 'file://...') are treated as having // a local address space. // // TODO(mkwst): It's not entirely clear that this is a good idea. - SetAddressSpace(kWebAddressSpaceLocal); + SetAddressSpace(mojom::IPAddressSpace::kLocal); } else { - SetAddressSpace(kWebAddressSpacePublic); + SetAddressSpace(mojom::IPAddressSpace::kPublic); } if (ImportsController()) {
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp index 69e25c2..bba93fd 100644 --- a/third_party/WebKit/Source/core/dom/Element.cpp +++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2424,6 +2424,13 @@ } return nullptr; } + if (AlwaysCreateUserAgentShadowRoot()) { + exception_state.ThrowDOMException( + kInvalidStateError, + "Shadow root cannot be created on a host which already hosts a " + "user-agent shadow tree."); + return nullptr; + } // Some elements make assumptions about what kind of layoutObjects they allow // as children so we can't allow author shadows on them for now. if (!AreAuthorShadowsAllowed()) { @@ -2491,6 +2498,8 @@ ShadowRoot& Element::CreateShadowRootInternal() { DCHECK(!ClosedShadowRoot()); DCHECK(AreAuthorShadowsAllowed()); + if (AlwaysCreateUserAgentShadowRoot()) + EnsureUserAgentShadowRoot(); GetDocument().SetShadowCascadeOrder(ShadowCascadeOrder::kShadowCascadeV0); return EnsureShadow().AddShadowRoot(*this, ShadowRootType::V0); } @@ -2506,6 +2515,7 @@ DCHECK(AreAuthorShadowsAllowed()); DCHECK(type == ShadowRootType::kOpen || type == ShadowRootType::kClosed) << type; + DCHECK(!AlwaysCreateUserAgentShadowRoot()); GetDocument().SetShadowCascadeOrder(ShadowCascadeOrder::kShadowCascadeV1); ShadowRoot& shadow_root = EnsureShadow().AddShadowRoot(*this, type);
diff --git a/third_party/WebKit/Source/core/dom/Element.h b/third_party/WebKit/Source/core/dom/Element.h index 8e00159..a6cc00ef 100644 --- a/third_party/WebKit/Source/core/dom/Element.h +++ b/third_party/WebKit/Source/core/dom/Element.h
@@ -947,6 +947,7 @@ // FIXME: Everyone should allow author shadows. virtual bool AreAuthorShadowsAllowed() const { return true; } virtual void DidAddUserAgentShadowRoot(ShadowRoot&) {} + virtual bool AlwaysCreateUserAgentShadowRoot() const { return false; } enum SynchronizationOfLazyAttribute { kNotInSynchronizationOfLazyAttribute = 0,
diff --git a/third_party/WebKit/Source/core/dom/IdleDeadline.cpp b/third_party/WebKit/Source/core/dom/IdleDeadline.cpp index a88911f..411d0a8 100644 --- a/third_party/WebKit/Source/core/dom/IdleDeadline.cpp +++ b/third_party/WebKit/Source/core/dom/IdleDeadline.cpp
@@ -17,12 +17,12 @@ double IdleDeadline::timeRemaining() const { double time_remaining = deadline_seconds_ - CurrentTimeTicksInSeconds(); if (time_remaining < 0) { - time_remaining = 0; + return 0; } else if (Platform::Current() ->CurrentThread() ->Scheduler() ->ShouldYieldForHighPriorityWork()) { - time_remaining = 0; + return 0; } return 1000.0 * PerformanceBase::ClampTimeResolution(time_remaining);
diff --git a/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp b/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp index 2a258f18..1e44d95 100644 --- a/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp +++ b/third_party/WebKit/Source/core/dom/IdleDeadlineTest.cpp
@@ -89,7 +89,7 @@ IdleDeadline* deadline = IdleDeadline::Create(1.25, IdleDeadline::CallbackType::kCalledWhenIdle); // Note: the deadline is computed with reduced resolution. - EXPECT_FLOAT_EQ(249.995, deadline->timeRemaining()); + EXPECT_FLOAT_EQ(250.0, deadline->timeRemaining()); } TEST_F(IdleDeadlineTest, deadlineInPast) {
diff --git a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp index fa19c59..b67220e8 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp
@@ -34,7 +34,6 @@ static void IdleTaskFired( scoped_refptr<IdleRequestCallbackWrapper> callback_wrapper, double deadline_seconds) { - // TODO(rmcilroy): Implement clamping of deadline in some form. if (ScriptedIdleTaskController* controller = callback_wrapper->Controller()) { // If we are going to yield immediately, reschedule the callback for
diff --git a/third_party/WebKit/Source/core/dom/SecurityContext.cpp b/third_party/WebKit/Source/core/dom/SecurityContext.cpp index f59b4c3..b89e1c80 100644 --- a/third_party/WebKit/Source/core/dom/SecurityContext.cpp +++ b/third_party/WebKit/Source/core/dom/SecurityContext.cpp
@@ -36,7 +36,7 @@ SecurityContext::SecurityContext() : sandbox_flags_(kSandboxNone), - address_space_(kWebAddressSpacePublic), + address_space_(mojom::IPAddressSpace::kPublic), insecure_request_policy_(kLeaveInsecureRequestsAlone), require_safe_types_(false) {} @@ -78,13 +78,13 @@ String SecurityContext::addressSpaceForBindings() const { switch (address_space_) { - case kWebAddressSpacePublic: + case mojom::IPAddressSpace::kPublic: return "public"; - case kWebAddressSpacePrivate: + case mojom::IPAddressSpace::kPrivate: return "private"; - case kWebAddressSpaceLocal: + case mojom::IPAddressSpace::kLocal: return "local"; } NOTREACHED();
diff --git a/third_party/WebKit/Source/core/dom/SecurityContext.h b/third_party/WebKit/Source/core/dom/SecurityContext.h index 32a45fb..19515f72 100644 --- a/third_party/WebKit/Source/core/dom/SecurityContext.h +++ b/third_party/WebKit/Source/core/dom/SecurityContext.h
@@ -29,6 +29,7 @@ #include "base/macros.h" #include "base/memory/scoped_refptr.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/CoreExport.h" #include "core/dom/SandboxFlags.h" #include "platform/heap/Handle.h" @@ -36,7 +37,6 @@ #include "platform/wtf/HashSet.h" #include "platform/wtf/text/StringHash.h" #include "platform/wtf/text/WTFString.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebInsecureRequestPolicy.h" #include "public/platform/WebURLRequest.h" #include "third_party/WebKit/common/feature_policy/feature_policy.h" @@ -73,8 +73,8 @@ bool IsSandboxed(SandboxFlags mask) const { return sandbox_flags_ & mask; } virtual void EnforceSandboxFlags(SandboxFlags mask); - void SetAddressSpace(WebAddressSpace space) { address_space_ = space; } - WebAddressSpace AddressSpace() const { return address_space_; } + void SetAddressSpace(mojom::IPAddressSpace space) { address_space_ = space; } + mojom::IPAddressSpace AddressSpace() const { return address_space_; } String addressSpaceForBindings() const; void SetRequireTrustedTypes() { require_safe_types_ = true; } @@ -120,7 +120,7 @@ Member<ContentSecurityPolicy> content_security_policy_; std::unique_ptr<FeaturePolicy> feature_policy_; - WebAddressSpace address_space_; + mojom::IPAddressSpace address_space_; WebInsecureRequestPolicy insecure_request_policy_; InsecureNavigationsSet insecure_navigations_to_upgrade_; bool require_safe_types_;
diff --git a/third_party/WebKit/Source/core/dom/ShadowRoot.cpp b/third_party/WebKit/Source/core/dom/ShadowRoot.cpp index 5dd96be..966692c 100644 --- a/third_party/WebKit/Source/core/dom/ShadowRoot.cpp +++ b/third_party/WebKit/Source/core/dom/ShadowRoot.cpp
@@ -168,7 +168,8 @@ // There's no style to update so just calling recalcStyle means we're updated. ClearNeedsStyleRecalc(); - RecalcDescendantStyles(change); + if (change >= kUpdatePseudoElements || ChildNeedsStyleRecalc()) + RecalcDescendantStyles(change); ClearChildNeedsStyleRecalc(); }
diff --git a/third_party/WebKit/Source/core/dom/events/EventTarget.cpp b/third_party/WebKit/Source/core/dom/events/EventTarget.cpp index 1779231..0d304b9 100644 --- a/third_party/WebKit/Source/core/dom/events/EventTarget.cpp +++ b/third_party/WebKit/Source/core/dom/events/EventTarget.cpp
@@ -103,6 +103,11 @@ event_type == EventTypeNames::wheel; } +bool IsInstrumentedForAsyncStack(const AtomicString& event_type) { + return event_type == EventTypeNames::load || + event_type == EventTypeNames::error; +} + double BlockedEventsWarningThreshold(ExecutionContext* context, const Event* event) { if (!event->cancelable()) @@ -367,6 +372,10 @@ event_type, listener, options, ®istered_listener); if (added) { AddedEventListener(event_type, registered_listener); + if (V8AbstractEventListener::Cast(listener) && + IsInstrumentedForAsyncStack(event_type)) { + probe::AsyncTaskScheduled(GetExecutionContext(), event_type, listener); + } } return added; } @@ -499,6 +508,10 @@ return false; } if (registered_listener) { + if (V8AbstractEventListener::Cast(listener) && + IsInstrumentedForAsyncStack(event_type)) { + probe::AsyncTaskScheduled(GetExecutionContext(), event_type, listener); + } registered_listener->SetCallback(listener); return true; } @@ -786,6 +799,9 @@ bool passive_forced = registered_listener.PassiveForcedForDocumentTarget(); probe::UserCallback probe(context, nullptr, event->type(), false, this); + probe::AsyncTask async_task( + context, V8AbstractEventListener::Cast(listener), "event", + IsInstrumentedForAsyncStack(event->type())); // To match Mozilla, the AT_TARGET phase fires both capturing and bubbling // event listeners, even though that violates some versions of the DOM spec.
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp index cb0a70a..3febbba 100644 --- a/third_party/WebKit/Source/core/editing/Editor.cpp +++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -89,7 +89,6 @@ #include "core/loader/EmptyClients.h" #include "core/loader/resource/ImageResourceContent.h" #include "core/page/DragData.h" -#include "core/page/EditorClient.h" #include "core/page/FocusController.h" #include "core/page/Page.h" #include "core/svg/SVGImageElement.h" @@ -217,17 +216,6 @@ return EditingBehavior(GetFrame().GetSettings()->GetEditingBehaviorType()); } -static EditorClient& GetEmptyEditorClient() { - DEFINE_STATIC_LOCAL(EmptyEditorClient, client, ()); - return client; -} - -EditorClient& Editor::Client() const { - if (Page* page = GetFrame().GetPage()) - return page->GetEditorClient(); - return GetEmptyEditorClient(); -} - static bool IsCaretAtStartOfWrappedLine(const FrameSelection& selection) { if (!selection.ComputeVisibleSelectionInDOMTree().IsCaret()) return false; @@ -800,7 +788,7 @@ } GetSpellChecker().RespondToChangedContents(); - Client().RespondToChangedContents(); + frame_->Client()->DidChangeContents(); } void Editor::RemoveFormattingAndStyle() { @@ -1526,12 +1514,12 @@ // WebCore inserts <div><br></div> *before* the current block, which correctly // moves the paragraph down but which doesn't change the caret's DOM position // (["hello", 0]). In these situations the above FrameSelection::setSelection - // call does not call EditorClient::respondToChangedSelection(), which, on the + // call does not call LocalFrameClient::DidChangeSelection(), which, on the // Mac, sends selection change notifications and starts a new kill ring // sequence, but we want to do these things (matches AppKit). if (selection_did_not_change_dom_position) { - Client().RespondToChangedSelection( - frame_, GetFrameSelection().GetSelectionInDOMTree().Type()); + frame_->Client()->DidChangeSelection( + GetFrameSelection().GetSelectionInDOMTree().Type() != kRangeSelection); } } @@ -1778,8 +1766,8 @@ void Editor::RespondToChangedSelection() { GetSpellChecker().RespondToChangedSelection(); - Client().RespondToChangedSelection( - frame_, GetFrameSelection().GetSelectionInDOMTree().Type()); + frame_->Client()->DidChangeSelection( + GetFrameSelection().GetSelectionInDOMTree().Type() != kRangeSelection); SetStartNewKillRingSequence(true); }
diff --git a/third_party/WebKit/Source/core/editing/Editor.h b/third_party/WebKit/Source/core/editing/Editor.h index 0d0324b2..6a46173 100644 --- a/third_party/WebKit/Source/core/editing/Editor.h +++ b/third_party/WebKit/Source/core/editing/Editor.h
@@ -46,7 +46,6 @@ class CompositeEditCommand; class DragData; -class EditorClient; class EditorInternalCommand; class FrameSelection; class LocalFrame; @@ -77,8 +76,6 @@ static Editor* Create(LocalFrame&); ~Editor(); - EditorClient& Client() const; - CompositeEditCommand* LastEditCommand() { return last_edit_command_.Get(); } void HandleKeyboardEvent(KeyboardEvent*);
diff --git a/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp b/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp index d45b71a..a265805 100644 --- a/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp +++ b/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp
@@ -30,7 +30,7 @@ #include "core/editing/FrameSelection.h" #include "core/events/KeyboardEvent.h" #include "core/frame/LocalFrame.h" -#include "core/page/EditorClient.h" +#include "core/frame/LocalFrameClient.h" #include "public/platform/WebInputEvent.h" namespace blink { @@ -82,8 +82,10 @@ void Editor::HandleKeyboardEvent(KeyboardEvent* evt) { // Give the embedder a chance to handle the keyboard event. - if (Client().HandleKeyboardEvent(frame_) || HandleEditingKeyboardEvent(evt)) + if (frame_->Client()->HandleCurrentKeyboardEvent() || + HandleEditingKeyboardEvent(evt)) { evt->SetDefaultHandled(); + } } } // namespace blink
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp index c657588e..3c3355f 100644 --- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp +++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -73,7 +73,6 @@ #include "core/layout/LayoutEmbeddedContent.h" #include "core/layout/LayoutView.h" #include "core/loader/DocumentLoader.h" -#include "core/page/EditorClient.h" #include "core/page/FocusController.h" #include "core/page/FrameTree.h" #include "core/page/Page.h"
diff --git a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp index 73a3c6f..b501a314 100644 --- a/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp +++ b/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
@@ -57,6 +57,7 @@ #include "core/editing/commands/UnlinkCommand.h" #include "core/editing/serializers/Serialization.h" #include "core/editing/spellcheck/SpellChecker.h" +#include "core/frame/ContentSettingsClient.h" #include "core/frame/LocalFrame.h" #include "core/frame/LocalFrameView.h" #include "core/frame/Settings.h" @@ -68,7 +69,6 @@ #include "core/input/EventHandler.h" #include "core/layout/LayoutBox.h" #include "core/page/ChromeClient.h" -#include "core/page/EditorClient.h" #include "core/page/Page.h" #include "platform/Histogram.h" #include "platform/KillRing.h" @@ -657,7 +657,9 @@ bool default_value = (settings && settings->GetJavaScriptCanAccessClipboard()) || Frame::HasTransientUserActivation(&frame); - return frame.GetEditor().Client().CanCopyCut(&frame, default_value); + if (!frame.GetContentSettingsClient()) + return default_value; + return frame.GetContentSettingsClient()->AllowWriteToClipboard(default_value); } static bool ExecuteCopy(LocalFrame& frame, @@ -1701,7 +1703,10 @@ bool default_value = settings && settings->GetJavaScriptCanAccessClipboard() && settings->GetDOMPasteAllowed(); - return frame.GetEditor().Client().CanPaste(&frame, default_value); + if (!frame.GetContentSettingsClient()) + return default_value; + return frame.GetContentSettingsClient()->AllowReadFromClipboard( + default_value); } static bool ExecutePaste(LocalFrame& frame, @@ -2076,7 +2081,10 @@ const bool default_value = settings && settings->GetJavaScriptCanAccessClipboard() && settings->GetDOMPasteAllowed(); - return frame->GetEditor().Client().CanPaste(frame, default_value); + if (!frame->GetContentSettingsClient()) + return default_value; + return frame->GetContentSettingsClient()->AllowReadFromClipboard( + default_value); } static bool SupportedFromMenuOrKeyBinding(LocalFrame*) {
diff --git a/third_party/WebKit/Source/core/events/ClipboardEvent.idl b/third_party/WebKit/Source/core/events/ClipboardEvent.idl index 157705b..34834d53 100644 --- a/third_party/WebKit/Source/core/events/ClipboardEvent.idl +++ b/third_party/WebKit/Source/core/events/ClipboardEvent.idl
@@ -5,7 +5,8 @@ // https://w3c.github.io/clipboard-apis/#clipboard-event-interfaces [ - Constructor(DOMString type, optional ClipboardEventInit eventInitDict) + Constructor(DOMString type, optional ClipboardEventInit eventInitDict), + Exposed=Window ] interface ClipboardEvent : Event { readonly attribute DataTransfer? clipboardData; };
diff --git a/third_party/WebKit/Source/core/events/WebInputEventConversion.cpp b/third_party/WebKit/Source/core/events/WebInputEventConversion.cpp index f32b22f..c3be6df 100644 --- a/third_party/WebKit/Source/core/events/WebInputEventConversion.cpp +++ b/third_party/WebKit/Source/core/events/WebInputEventConversion.cpp
@@ -116,6 +116,19 @@ return web_mouse_button_to_platform_modifier[static_cast<int>(button)]; } +WebPointerEvent TransformWebPointerEvent(float frame_scale, + FloatPoint frame_translate, + const WebPointerEvent& event) { + // frameScale is default initialized in debug builds to be 0. + DCHECK_EQ(0, event.FrameScale()); + DCHECK_EQ(0, event.FrameTranslate().x); + DCHECK_EQ(0, event.FrameTranslate().y); + WebPointerEvent result = event; + result.SetFrameScale(frame_scale); + result.SetFrameTranslate(frame_translate); + return result; +} + } // namespace WebMouseEvent TransformWebMouseEvent(LocalFrameView* frame_view, @@ -150,23 +163,10 @@ return result; } -WebTouchEvent TransformWebTouchEvent(float frame_scale, - FloatPoint frame_translate, - const WebTouchEvent& event) { - // frameScale is default initialized in debug builds to be 0. - DCHECK_EQ(0, event.FrameScale()); - DCHECK_EQ(0, event.FrameTranslate().x); - DCHECK_EQ(0, event.FrameTranslate().y); - WebTouchEvent result = event; - result.SetFrameScale(frame_scale); - result.SetFrameTranslate(frame_translate); - return result; -} - -WebTouchEvent TransformWebTouchEvent(LocalFrameView* frame_view, - const WebTouchEvent& event) { - return TransformWebTouchEvent(FrameScale(frame_view), - FrameTranslation(frame_view), event); +WebPointerEvent TransformWebPointerEvent(LocalFrameView* frame_view, + const WebPointerEvent& event) { + return TransformWebPointerEvent(FrameScale(frame_view), + FrameTranslation(frame_view), event); } WebMouseEventBuilder::WebMouseEventBuilder(const LocalFrameView* plugin_parent, @@ -347,18 +347,37 @@ return result; } -Vector<WebTouchEvent> TransformWebTouchEventVector( +Vector<WebPointerEvent> TransformWebPointerEventVector( LocalFrameView* frame_view, const std::vector<const WebInputEvent*>& coalesced_events) { float scale = FrameScale(frame_view); FloatPoint translation = FrameTranslation(frame_view); - Vector<WebTouchEvent> result; + Vector<WebPointerEvent> result; for (const auto& event : coalesced_events) { - DCHECK(WebInputEvent::IsTouchEventType(event->GetType())); - result.push_back(TransformWebTouchEvent( - scale, translation, static_cast<const WebTouchEvent&>(*event))); + DCHECK(WebInputEvent::IsPointerEventType(event->GetType())); + result.push_back(TransformWebPointerEvent( + scale, translation, static_cast<const WebPointerEvent&>(*event))); } return result; } +WebCoalescedInputEvent GetCoalescedWebPointerEventForTouch( + const WebPointerEvent& pointer_event, + std::vector<const WebInputEvent*> coalesced_events) { + std::vector<WebPointerEvent> related_pointer_events; + for (const auto& event : coalesced_events) { + DCHECK(WebInputEvent::IsTouchEventType(event->GetType())); + const WebTouchEvent& touch_event = + static_cast<const WebTouchEvent&>(*event); + for (unsigned i = 0; i < touch_event.touches_length; ++i) { + if (touch_event.touches[i].id == pointer_event.id && + touch_event.touches[i].state != WebTouchPoint::kStateStationary) { + related_pointer_events.push_back( + WebPointerEvent(touch_event, touch_event.touches[i])); + } + } + } + return WebCoalescedInputEvent(pointer_event, related_pointer_events); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/events/WebInputEventConversion.h b/third_party/WebKit/Source/core/events/WebInputEventConversion.h index d8d91cb3..36f799a5 100644 --- a/third_party/WebKit/Source/core/events/WebInputEventConversion.h +++ b/third_party/WebKit/Source/core/events/WebInputEventConversion.h
@@ -35,9 +35,11 @@ #include "core/CoreExport.h" #include "platform/scroll/ScrollTypes.h" #include "platform/wtf/Compiler.h" +#include "public/platform/WebCoalescedInputEvent.h" #include "public/platform/WebInputEvent.h" #include "public/platform/WebKeyboardEvent.h" #include "public/platform/WebMouseWheelEvent.h" +#include "public/platform/WebPointerEvent.h" #include "public/platform/WebTouchEvent.h" namespace blink { @@ -94,15 +96,19 @@ CORE_EXPORT WebMouseWheelEvent TransformWebMouseWheelEvent(LocalFrameView*, const WebMouseWheelEvent&); -CORE_EXPORT WebTouchEvent TransformWebTouchEvent(LocalFrameView*, - const WebTouchEvent&); +CORE_EXPORT WebPointerEvent TransformWebPointerEvent(LocalFrameView*, + const WebPointerEvent&); Vector<WebMouseEvent> CORE_EXPORT TransformWebMouseEventVector(LocalFrameView*, const std::vector<const WebInputEvent*>&); -Vector<WebTouchEvent> CORE_EXPORT -TransformWebTouchEventVector(LocalFrameView*, - const std::vector<const WebInputEvent*>&); +Vector<WebPointerEvent> CORE_EXPORT +TransformWebPointerEventVector(LocalFrameView*, + const std::vector<const WebInputEvent*>&); + +WebCoalescedInputEvent CORE_EXPORT +GetCoalescedWebPointerEventForTouch(const WebPointerEvent&, + std::vector<const WebInputEvent*>); } // namespace blink
diff --git a/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp b/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp index 7e2d725..4021892 100644 --- a/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp +++ b/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp
@@ -126,7 +126,7 @@ web_view->Resize(WebSize(page_width, page_height)); web_view->UpdateAllLifecyclePhases(); - web_view->SetPageScaleFactor(2); + web_view->SetPageScaleFactor(3); LocalFrameView* view = ToLocalFrame(web_view->GetPage()->MainFrame())->View(); @@ -134,10 +134,10 @@ WebMouseEvent web_mouse_event(WebInputEvent::kMouseMove, WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); - web_mouse_event.SetPositionInWidget(10, 10); - web_mouse_event.SetPositionInScreen(10, 10); - web_mouse_event.movement_x = 10; - web_mouse_event.movement_y = 10; + web_mouse_event.SetPositionInWidget(15, 15); + web_mouse_event.SetPositionInScreen(15, 15); + web_mouse_event.movement_x = 15; + web_mouse_event.movement_y = 15; WebMouseEvent transformed_event = TransformWebMouseEvent(view, web_mouse_event); @@ -145,8 +145,8 @@ FlooredIntPoint(transformed_event.PositionInRootFrame()); EXPECT_EQ(5, position.X()); EXPECT_EQ(5, position.Y()); - EXPECT_EQ(10, transformed_event.PositionInScreen().x); - EXPECT_EQ(10, transformed_event.PositionInScreen().y); + EXPECT_EQ(15, transformed_event.PositionInScreen().x); + EXPECT_EQ(15, transformed_event.PositionInScreen().y); IntPoint movement = FlooredIntPoint(transformed_event.MovementInRootFrame()); @@ -159,12 +159,12 @@ WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); web_gesture_event.source_device = kWebGestureDeviceTouchscreen; - web_gesture_event.x = 10; - web_gesture_event.y = 12; + web_gesture_event.x = 15; + web_gesture_event.y = 18; web_gesture_event.global_x = 20; web_gesture_event.global_y = 22; - web_gesture_event.data.scroll_update.delta_x = 30; - web_gesture_event.data.scroll_update.delta_y = 32; + web_gesture_event.data.scroll_update.delta_x = 45; + web_gesture_event.data.scroll_update.delta_y = 48; web_gesture_event.data.scroll_update.velocity_x = 40; web_gesture_event.data.scroll_update.velocity_y = 42; web_gesture_event.data.scroll_update.inertial_phase = @@ -193,8 +193,8 @@ WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); web_gesture_event.source_device = kWebGestureDeviceTouchscreen; - web_gesture_event.x = 10; - web_gesture_event.y = 12; + web_gesture_event.x = 15; + web_gesture_event.y = 18; web_gesture_event.global_x = 20; web_gesture_event.global_y = 22; @@ -215,8 +215,8 @@ WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); web_gesture_event.source_device = kWebGestureDeviceTouchscreen; - web_gesture_event.data.tap.width = 10; - web_gesture_event.data.tap.height = 10; + web_gesture_event.data.tap.width = 15; + web_gesture_event.data.tap.height = 15; WebGestureEvent scaled_gesture_event = TransformWebGestureEvent(view, web_gesture_event); @@ -230,14 +230,14 @@ WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); web_gesture_event.source_device = kWebGestureDeviceTouchscreen; - web_gesture_event.data.tap.width = 10; - web_gesture_event.data.tap.height = 10; + web_gesture_event.data.tap.width = 30; + web_gesture_event.data.tap.height = 30; WebGestureEvent scaled_gesture_event = TransformWebGestureEvent(view, web_gesture_event); IntSize area = FlooredIntSize(scaled_gesture_event.TapAreaInRootFrame()); - EXPECT_EQ(5, area.Width()); - EXPECT_EQ(5, area.Height()); + EXPECT_EQ(10, area.Width()); + EXPECT_EQ(10, area.Height()); } { @@ -245,14 +245,14 @@ WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); web_gesture_event.source_device = kWebGestureDeviceTouchscreen; - web_gesture_event.data.tap_down.width = 10; - web_gesture_event.data.tap_down.height = 10; + web_gesture_event.data.tap_down.width = 9; + web_gesture_event.data.tap_down.height = 9; WebGestureEvent scaled_gesture_event = TransformWebGestureEvent(view, web_gesture_event); IntSize area = FlooredIntSize(scaled_gesture_event.TapAreaInRootFrame()); - EXPECT_EQ(5, area.Width()); - EXPECT_EQ(5, area.Height()); + EXPECT_EQ(3, area.Width()); + EXPECT_EQ(3, area.Height()); } { @@ -260,14 +260,14 @@ WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); web_gesture_event.source_device = kWebGestureDeviceTouchscreen; - web_gesture_event.data.show_press.width = 10; - web_gesture_event.data.show_press.height = 10; + web_gesture_event.data.show_press.width = 18; + web_gesture_event.data.show_press.height = 18; WebGestureEvent scaled_gesture_event = TransformWebGestureEvent(view, web_gesture_event); IntSize area = FlooredIntSize(scaled_gesture_event.TapAreaInRootFrame()); - EXPECT_EQ(5, area.Width()); - EXPECT_EQ(5, area.Height()); + EXPECT_EQ(6, area.Width()); + EXPECT_EQ(6, area.Height()); } { @@ -275,8 +275,8 @@ WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); web_gesture_event.source_device = kWebGestureDeviceTouchscreen; - web_gesture_event.data.long_press.width = 10; - web_gesture_event.data.long_press.height = 10; + web_gesture_event.data.long_press.width = 15; + web_gesture_event.data.long_press.height = 15; WebGestureEvent scaled_gesture_event = TransformWebGestureEvent(view, web_gesture_event); @@ -290,8 +290,8 @@ WebInputEvent::kNoModifiers, WebInputEvent::kTimeStampForTesting); web_gesture_event.source_device = kWebGestureDeviceTouchscreen; - web_gesture_event.data.two_finger_tap.first_finger_width = 10; - web_gesture_event.data.two_finger_tap.first_finger_height = 10; + web_gesture_event.data.two_finger_tap.first_finger_width = 15; + web_gesture_event.data.two_finger_tap.first_finger_height = 15; WebGestureEvent scaled_gesture_event = TransformWebGestureEvent(view, web_gesture_event); @@ -301,39 +301,33 @@ } { - WebTouchEvent web_touch_event(WebInputEvent::kTouchMove, - WebInputEvent::kNoModifiers, - WebInputEvent::kTimeStampForTesting); - web_touch_event.touches_length = 1; - web_touch_event.touches[0].state = WebTouchPoint::kStateMoved; - web_touch_event.touches[0].SetPositionInScreen(10.6f, 10.4f); - web_touch_event.touches[0].SetPositionInWidget(10.6f, 10.4f); - web_touch_event.touches[0].radius_x = 10.6f; - web_touch_event.touches[0].radius_y = 10.4f; - web_touch_event.touches[0].movement_x = 20; - web_touch_event.touches[0].movement_y = 20; + WebPointerEvent web_pointer_event( + WebInputEvent::kPointerDown, + WebPointerProperties(1, WebPointerProperties::PointerType::kTouch, + WebPointerProperties::Button::kLeft, + WebFloatPoint(10.8f, 10.5f), + WebFloatPoint(10.8f, 10.5f), 30, 30), + 6.6f, 9.9f); + EXPECT_FLOAT_EQ(10.8f, web_pointer_event.PositionInScreen().x); + EXPECT_FLOAT_EQ(10.5f, web_pointer_event.PositionInScreen().y); + EXPECT_FLOAT_EQ(10.8f, web_pointer_event.PositionInWidget().x); + EXPECT_FLOAT_EQ(10.5f, web_pointer_event.PositionInWidget().y); + EXPECT_FLOAT_EQ(6.6f, web_pointer_event.width); + EXPECT_FLOAT_EQ(9.9f, web_pointer_event.height); + EXPECT_EQ(30, web_pointer_event.movement_x); + EXPECT_EQ(30, web_pointer_event.movement_y); - EXPECT_FLOAT_EQ(10.6f, web_touch_event.touches[0].PositionInScreen().x); - EXPECT_FLOAT_EQ(10.4f, web_touch_event.touches[0].PositionInScreen().y); - EXPECT_FLOAT_EQ(10.6f, web_touch_event.touches[0].PositionInWidget().x); - EXPECT_FLOAT_EQ(10.4f, web_touch_event.touches[0].PositionInWidget().y); - EXPECT_FLOAT_EQ(10.6f, web_touch_event.touches[0].radius_x); - EXPECT_FLOAT_EQ(10.4f, web_touch_event.touches[0].radius_y); - EXPECT_EQ(20, web_touch_event.touches[0].movement_x); - EXPECT_EQ(20, web_touch_event.touches[0].movement_y); - - WebTouchEvent transformed_event = - TransformWebTouchEvent(view, web_touch_event); - WebTouchPoint transformed_point = - transformed_event.TouchPointInRootFrame(0); - EXPECT_FLOAT_EQ(10.6f, transformed_point.PositionInScreen().x); - EXPECT_FLOAT_EQ(10.4f, transformed_point.PositionInScreen().y); - EXPECT_FLOAT_EQ(5.3f, transformed_point.PositionInWidget().x); - EXPECT_FLOAT_EQ(5.2f, transformed_point.PositionInWidget().y); - EXPECT_FLOAT_EQ(5.3f, transformed_point.radius_x); - EXPECT_FLOAT_EQ(5.2f, transformed_point.radius_y); - EXPECT_EQ(10, transformed_point.movement_x); - EXPECT_EQ(10, transformed_point.movement_y); + WebPointerEvent transformed_event = + TransformWebPointerEvent(view, web_pointer_event) + .WebPointerEventInRootFrame(); + EXPECT_FLOAT_EQ(10.8f, transformed_event.PositionInScreen().x); + EXPECT_FLOAT_EQ(10.5f, transformed_event.PositionInScreen().y); + EXPECT_FLOAT_EQ(3.6f, transformed_event.PositionInWidget().x); + EXPECT_FLOAT_EQ(3.5f, transformed_event.PositionInWidget().y); + EXPECT_FLOAT_EQ(2.2f, transformed_event.width); + EXPECT_FLOAT_EQ(3.3f, transformed_event.height); + EXPECT_EQ(10, transformed_event.movement_x); + EXPECT_EQ(10, transformed_event.movement_y); } } @@ -541,69 +535,64 @@ } { - WebTouchEvent web_touch_event(WebInputEvent::kTouchMove, - WebInputEvent::kNoModifiers, - WebInputEvent::kTimeStampForTesting); - web_touch_event.touches_length = 1; - web_touch_event.touches[0].state = WebTouchPoint::kStateMoved; - web_touch_event.touches[0].SetPositionInScreen(90, 90); - web_touch_event.touches[0].SetPositionInWidget(90, 90); - web_touch_event.touches[0].radius_x = 30; - web_touch_event.touches[0].radius_y = 30; + WebPointerEvent web_pointer_event( + WebInputEvent::kPointerDown, + WebPointerProperties(1, WebPointerProperties::PointerType::kTouch, + WebPointerProperties::Button::kLeft, + WebFloatPoint(90, 90), WebFloatPoint(90, 90)), + 30, 30); - WebTouchEvent transformed_event = - TransformWebTouchEvent(view, web_touch_event); + WebPointerEvent transformed_event = + TransformWebPointerEvent(view, web_pointer_event) + .WebPointerEventInRootFrame(); - WebTouchPoint transformed_point = - transformed_event.TouchPointInRootFrame(0); - EXPECT_FLOAT_EQ(90, transformed_point.PositionInScreen().x); - EXPECT_FLOAT_EQ(90, transformed_point.PositionInScreen().y); - EXPECT_FLOAT_EQ(30, transformed_point.PositionInWidget().x); - EXPECT_FLOAT_EQ(30, transformed_point.PositionInWidget().y); - EXPECT_FLOAT_EQ(10, transformed_point.radius_x); - EXPECT_FLOAT_EQ(10, transformed_point.radius_y); + EXPECT_FLOAT_EQ(90, transformed_event.PositionInScreen().x); + EXPECT_FLOAT_EQ(90, transformed_event.PositionInScreen().y); + EXPECT_FLOAT_EQ(30, transformed_event.PositionInWidget().x); + EXPECT_FLOAT_EQ(30, transformed_event.PositionInWidget().y); + EXPECT_FLOAT_EQ(10, transformed_event.width); + EXPECT_FLOAT_EQ(10, transformed_event.height); } { - WebTouchEvent web_touch_event1(WebInputEvent::kTouchMove, - WebInputEvent::kNoModifiers, - WebInputEvent::kTimeStampForTesting); - web_touch_event1.touches_length = 1; - web_touch_event1.touches[0].state = WebTouchPoint::kStateMoved; - web_touch_event1.touches[0].SetPositionInScreen(90, 90); - web_touch_event1.touches[0].SetPositionInWidget(90, 90); - web_touch_event1.touches[0].radius_x = 30; - web_touch_event1.touches[0].radius_y = 30; + WebPointerEvent web_pointer_event1( + WebInputEvent::kPointerDown, + WebPointerProperties(1, WebPointerProperties::PointerType::kTouch, + WebPointerProperties::Button::kLeft, + WebFloatPoint(90, 90), WebFloatPoint(90, 90)), + 30, 30); - WebTouchEvent web_touch_event2 = web_touch_event1; - web_touch_event2.touches[0].SetPositionInScreen(120, 90); - web_touch_event2.touches[0].SetPositionInWidget(120, 90); - web_touch_event2.touches[0].radius_x = 60; + WebPointerEvent web_pointer_event2( + WebInputEvent::kPointerDown, + WebPointerProperties(1, WebPointerProperties::PointerType::kTouch, + WebPointerProperties::Button::kLeft, + WebFloatPoint(120, 90), WebFloatPoint(120, 90)), + 60, 30); std::vector<const WebInputEvent*> events; - events.push_back(&web_touch_event1); - events.push_back(&web_touch_event2); + events.push_back(&web_pointer_event1); + events.push_back(&web_pointer_event2); - Vector<WebTouchEvent> coalescedevents = - TransformWebTouchEventVector(view, events); + Vector<WebPointerEvent> coalescedevents = + TransformWebPointerEventVector(view, events); EXPECT_EQ(events.size(), coalescedevents.size()); - WebTouchPoint transformed_point = - coalescedevents[0].TouchPointInRootFrame(0); - EXPECT_FLOAT_EQ(90, transformed_point.PositionInScreen().x); - EXPECT_FLOAT_EQ(90, transformed_point.PositionInScreen().y); - EXPECT_FLOAT_EQ(30, transformed_point.PositionInWidget().x); - EXPECT_FLOAT_EQ(30, transformed_point.PositionInWidget().y); - EXPECT_FLOAT_EQ(10, transformed_point.radius_x); - EXPECT_FLOAT_EQ(10, transformed_point.radius_y); + WebPointerEvent transformed_event = + coalescedevents[0].WebPointerEventInRootFrame(); + EXPECT_FLOAT_EQ(90, transformed_event.PositionInScreen().x); + EXPECT_FLOAT_EQ(90, transformed_event.PositionInScreen().y); + EXPECT_FLOAT_EQ(30, transformed_event.PositionInWidget().x); + EXPECT_FLOAT_EQ(30, transformed_event.PositionInWidget().y); + EXPECT_FLOAT_EQ(10, transformed_event.width); + EXPECT_FLOAT_EQ(10, transformed_event.height); - transformed_point = coalescedevents[1].TouchPointInRootFrame(0); - EXPECT_FLOAT_EQ(120, transformed_point.PositionInScreen().x); - EXPECT_FLOAT_EQ(90, transformed_point.PositionInScreen().y); - EXPECT_FLOAT_EQ(40, transformed_point.PositionInWidget().x); - EXPECT_FLOAT_EQ(30, transformed_point.PositionInWidget().y); - EXPECT_FLOAT_EQ(20, transformed_point.radius_x); - EXPECT_FLOAT_EQ(10, transformed_point.radius_y); + transformed_event = coalescedevents[1].WebPointerEventInRootFrame(); + EXPECT_FLOAT_EQ(120, transformed_event.PositionInScreen().x); + EXPECT_FLOAT_EQ(90, transformed_event.PositionInScreen().y); + EXPECT_FLOAT_EQ(40, transformed_event.PositionInWidget().x); + EXPECT_FLOAT_EQ(30, transformed_event.PositionInWidget().y); + EXPECT_FLOAT_EQ(20, transformed_event.width); + EXPECT_FLOAT_EQ(10, transformed_event.height); } } @@ -721,29 +710,28 @@ } { - WebTouchEvent web_touch_event(WebInputEvent::kTouchMove, - WebInputEvent::kNoModifiers, - WebInputEvent::kTimeStampForTesting); - web_touch_event.touches_length = 1; - web_touch_event.touches[0].state = WebTouchPoint::kStateMoved; - web_touch_event.touches[0].SetPositionInScreen(10.6f, 10.4f); - web_touch_event.touches[0].SetPositionInWidget(10.6f, 10.4f); + WebPointerEvent web_pointer_event( + WebInputEvent::kPointerDown, + WebPointerProperties(1, WebPointerProperties::PointerType::kTouch, + WebPointerProperties::Button::kLeft, + WebFloatPoint(10.6f, 10.4f), + WebFloatPoint(10.6f, 10.4f)), + 10, 10); - EXPECT_FLOAT_EQ(10.6f, web_touch_event.touches[0].PositionInScreen().x); - EXPECT_FLOAT_EQ(10.4f, web_touch_event.touches[0].PositionInScreen().y); - EXPECT_FLOAT_EQ(10.6f, web_touch_event.touches[0].PositionInWidget().x); - EXPECT_FLOAT_EQ(10.4f, web_touch_event.touches[0].PositionInWidget().y); + EXPECT_FLOAT_EQ(10.6f, web_pointer_event.PositionInScreen().x); + EXPECT_FLOAT_EQ(10.4f, web_pointer_event.PositionInScreen().y); + EXPECT_FLOAT_EQ(10.6f, web_pointer_event.PositionInWidget().x); + EXPECT_FLOAT_EQ(10.4f, web_pointer_event.PositionInWidget().y); - WebTouchEvent transformed_touch_event = - TransformWebTouchEvent(view, web_touch_event); - WebTouchPoint transformed_point = - transformed_touch_event.TouchPointInRootFrame(0); - EXPECT_FLOAT_EQ(10.6f, transformed_point.PositionInScreen().x); - EXPECT_FLOAT_EQ(10.4f, transformed_point.PositionInScreen().y); + WebPointerEvent transformed_event = + TransformWebPointerEvent(view, web_pointer_event) + .WebPointerEventInRootFrame(); + EXPECT_FLOAT_EQ(10.6f, transformed_event.PositionInScreen().x); + EXPECT_FLOAT_EQ(10.4f, transformed_event.PositionInScreen().y); EXPECT_FLOAT_EQ(5.3f + visual_offset.X(), - transformed_point.PositionInWidget().x); + transformed_event.PositionInWidget().x); EXPECT_FLOAT_EQ(5.2f + visual_offset.Y(), - transformed_point.PositionInWidget().y); + transformed_event.PositionInWidget().y); } }
diff --git a/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp b/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp index 9be275b..9115f90f7 100644 --- a/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp +++ b/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp
@@ -695,15 +695,14 @@ web_frame_->Client()->DidDispatchPingLoader(url); } -void LocalFrameClientImpl::DidDisplayContentWithCertificateErrors( - const KURL& url) { +void LocalFrameClientImpl::DidDisplayContentWithCertificateErrors() { if (web_frame_->Client()) - web_frame_->Client()->DidDisplayContentWithCertificateErrors(url); + web_frame_->Client()->DidDisplayContentWithCertificateErrors(); } -void LocalFrameClientImpl::DidRunContentWithCertificateErrors(const KURL& url) { +void LocalFrameClientImpl::DidRunContentWithCertificateErrors() { if (web_frame_->Client()) - web_frame_->Client()->DidRunContentWithCertificateErrors(url); + web_frame_->Client()->DidRunContentWithCertificateErrors(); } void LocalFrameClientImpl::ReportLegacySymantecCert(const KURL& url, @@ -1040,19 +1039,11 @@ return web_frame_->Client()->SetEffectiveConnectionTypeForTesting(type); } -bool LocalFrameClientImpl::IsClientLoFiActiveForFrame() { +WebURLRequest::PreviewsState LocalFrameClientImpl::GetPreviewsStateForFrame() + const { if (web_frame_->Client()) - return web_frame_->Client()->IsClientLoFiActiveForFrame(); - return false; -} - -bool LocalFrameClientImpl::ShouldUseClientLoFiForRequest( - const ResourceRequest& request) { - if (web_frame_->Client()) { - return web_frame_->Client()->ShouldUseClientLoFiForRequest( - WrappedResourceRequest(request)); - } - return false; + return web_frame_->Client()->GetPreviewsStateForFrame(); + return WebURLRequest::kPreviewsUnspecified; } WebDevToolsAgentImpl* LocalFrameClientImpl::DevToolsAgent() { @@ -1144,4 +1135,20 @@ return g_empty_string; } +bool LocalFrameClientImpl::HandleCurrentKeyboardEvent() { + if (web_frame_->Client()) + return web_frame_->Client()->HandleCurrentKeyboardEvent(); + return false; +} + +void LocalFrameClientImpl::DidChangeSelection(bool is_selection_empty) { + if (web_frame_->Client()) + web_frame_->Client()->DidChangeSelection(is_selection_empty); +} + +void LocalFrameClientImpl::DidChangeContents() { + if (web_frame_->Client()) + web_frame_->Client()->DidChangeContents(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.h b/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.h index 561226b..ee9c5f3 100644 --- a/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.h +++ b/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.h
@@ -138,8 +138,8 @@ const KURL& insecure_url) override; void DidDetectXSS(const KURL&, bool did_block_entire_page) override; void DidDispatchPingLoader(const KURL&) override; - void DidDisplayContentWithCertificateErrors(const KURL&) override; - void DidRunContentWithCertificateErrors(const KURL&) override; + void DidDisplayContentWithCertificateErrors() override; + void DidRunContentWithCertificateErrors() override; void ReportLegacySymantecCert(const KURL&, Time) override; void DidChangePerformanceTiming() override; void DidObserveLoadingBehavior(WebLoadingBehaviorFlag) override; @@ -227,9 +227,7 @@ void SetEffectiveConnectionTypeForTesting( WebEffectiveConnectionType) override; - bool IsClientLoFiActiveForFrame() override; - - bool ShouldUseClientLoFiForRequest(const ResourceRequest&) override; + WebURLRequest::PreviewsState GetPreviewsStateForFrame() const override; KURL OverrideFlashEmbedWithHTML(const KURL&) override; @@ -263,6 +261,12 @@ String evaluateInInspectorOverlayForTesting(const String& script) override; + bool HandleCurrentKeyboardEvent() override; + + void DidChangeSelection(bool is_selection_empty) override; + + void DidChangeContents() override; + private: explicit LocalFrameClientImpl(WebLocalFrameImpl*);
diff --git a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp index b551a13a..61525ff 100644 --- a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
@@ -281,7 +281,12 @@ resource_content_loader_.Get(), resource_container_.Get()); session->Append(css_agent); - session->Append(InspectorDOMSnapshotAgent::Create(inspected_frames_.Get())); + InspectorDOMDebuggerAgent* dom_debugger_agent = + new InspectorDOMDebuggerAgent(isolate, dom_agent, session->V8Session()); + session->Append(dom_debugger_agent); + + session->Append(InspectorDOMSnapshotAgent::Create(inspected_frames_.Get(), + dom_debugger_agent)); session->Append(new InspectorAnimationAgent(inspected_frames_.Get(), css_agent, session->V8Session())); @@ -302,8 +307,6 @@ tracing_agents_.Set(session_id, tracing_agent); session->Append(tracing_agent); - session->Append( - new InspectorDOMDebuggerAgent(isolate, dom_agent, session->V8Session())); InspectorPageAgent* page_agent = InspectorPageAgent::Create( inspected_frames_.Get(), this, resource_content_loader_.Get(), @@ -534,6 +537,11 @@ it.value->LayoutOverlay(); } +void WebDevToolsAgentImpl::DispatchBufferedTouchEvents() { + for (auto& it : overlay_agents_) + it.value->DispatchBufferedTouchEvents(); +} + bool WebDevToolsAgentImpl::HandleInputEvent(const WebInputEvent& event) { for (auto& it : overlay_agents_) { if (it.value->HandleInputEvent(event))
diff --git a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h index 4a76fde..de865c5 100644 --- a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h +++ b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h
@@ -77,6 +77,7 @@ void PaintOverlay(); void LayoutOverlay(); bool HandleInputEvent(const WebInputEvent&); + void DispatchBufferedTouchEvents(); // Instrumentation from web/ layer. void DidCommitLoadForLocalFrame(LocalFrame*);
diff --git a/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp b/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp index e20b1672..ea59669 100644 --- a/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp
@@ -502,10 +502,24 @@ .Contains(IntPoint(point_in_window.x, point_in_window.y)); } +WebInputEventResult WebPagePopupImpl::DispatchBufferedTouchEvents() { + if (closing_) + return WebInputEventResult::kNotHandled; + return page_->DeprecatedLocalMainFrame() + ->GetEventHandler() + .DispatchBufferedTouchEvents(); +} + WebInputEventResult WebPagePopupImpl::HandleInputEvent( + const WebCoalescedInputEvent& coalesced_event) { + return HandleInputEventIncludingTouch(coalesced_event); +} + +WebInputEventResult WebPagePopupImpl::HandleInputEventInternal( const WebCoalescedInputEvent& event) { if (closing_) return WebInputEventResult::kNotHandled; + DCHECK(!WebInputEvent::IsTouchEventType(event.Event().GetType())); return PageWidgetDelegate::HandleInputEvent( *this, event, page_->DeprecatedLocalMainFrame()); }
diff --git a/third_party/WebKit/Source/core/exported/WebPagePopupImpl.h b/third_party/WebKit/Source/core/exported/WebPagePopupImpl.h index 1bfc743a..f694f4f 100644 --- a/third_party/WebKit/Source/core/exported/WebPagePopupImpl.h +++ b/third_party/WebKit/Source/core/exported/WebPagePopupImpl.h
@@ -75,6 +75,8 @@ // PageWidgetEventHandler functions. WebInputEventResult HandleKeyEvent(const WebKeyboardEvent&) override; + WebInputEventResult DispatchBufferedTouchEvents() override; + private: // WebWidget functions void SetSuppressFrameRequestsWorkaroundFor704763Only(bool) final; @@ -85,6 +87,8 @@ void Resize(const WebSize&) override; void Close() override; WebInputEventResult HandleInputEvent(const WebCoalescedInputEvent&) override; + WebInputEventResult HandleInputEventInternal( + const WebCoalescedInputEvent&) override; void SetFocus(bool) override; bool IsPagePopup() const override { return true; } bool IsAcceleratedCompositingActive() const override {
diff --git a/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp index 4c468fed..6ae7e05 100644 --- a/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.cpp
@@ -77,7 +77,7 @@ WebSharedWorkerImpl::WebSharedWorkerImpl(WebSharedWorkerClient* client) : worker_inspector_proxy_(WorkerInspectorProxy::Create()), client_(client), - creation_address_space_(kWebAddressSpacePublic) { + creation_address_space_(mojom::IPAddressSpace::kPublic) { DCHECK(IsMainThread()); } @@ -218,7 +218,7 @@ const WebString& name, const WebString& content_security_policy, WebContentSecurityPolicyType policy_type, - WebAddressSpace creation_address_space, + mojom::IPAddressSpace creation_address_space, const WebString& instrumentation_token, mojo::ScopedMessagePipeHandle content_settings_handle, mojo::ScopedMessagePipeHandle interface_provider) {
diff --git a/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.h b/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.h index cebac41..948242bf 100644 --- a/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.h +++ b/third_party/WebKit/Source/core/exported/WebSharedWorkerImpl.h
@@ -35,13 +35,13 @@ #include <memory> #include "base/memory/scoped_refptr.h" +#include "common/net/ip_address_space.mojom-shared.h" #include "core/CoreExport.h" #include "core/exported/WorkerShadowPage.h" #include "core/workers/SharedWorkerReportingProxy.h" #include "core/workers/WorkerClients.h" #include "core/workers/WorkerThread.h" #include "platform/WebTaskRunner.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebContentSecurityPolicy.h" #include "public/web/WebDevToolsAgentClient.h" #include "public/web/WebSharedWorkerClient.h" @@ -87,7 +87,7 @@ const WebString& name, const WebString& content_security_policy, WebContentSecurityPolicyType, - WebAddressSpace, + mojom::IPAddressSpace, const WebString& instrumentation_token, mojo::ScopedMessagePipeHandle content_settings_handle, mojo::ScopedMessagePipeHandle interface_provider) override; @@ -146,7 +146,7 @@ WebURL url_; WebString name_; - WebAddressSpace creation_address_space_; + mojom::IPAddressSpace creation_address_space_; service_manager::mojom::blink::InterfaceProviderPtrInfo pending_interface_provider_;
diff --git a/third_party/WebKit/Source/core/exported/WebSurroundingText.cpp b/third_party/WebKit/Source/core/exported/WebSurroundingText.cpp index 62b516e1..065cc94 100644 --- a/third_party/WebKit/Source/core/exported/WebSurroundingText.cpp +++ b/third_party/WebKit/Source/core/exported/WebSurroundingText.cpp
@@ -38,27 +38,28 @@ namespace blink { -WebSurroundingText::WebSurroundingText() - : start_offset_in_text_content_(0), end_offset_in_text_content_(0) {} +namespace { -void WebSurroundingText::InitializeFromCurrentSelection(WebLocalFrame* frame, - size_t max_length) { +EphemeralRange ComputeRangeFromFrameSelection(WebLocalFrame* frame) { LocalFrame* web_frame = ToWebLocalFrameImpl(frame)->GetFrame(); // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets // needs to be audited. See http://crbug.com/590369 for more details. web_frame->GetDocument()->UpdateStyleAndLayoutIgnorePendingStylesheets(); - const EphemeralRange range = web_frame->Selection() - .ComputeVisibleSelectionInDOMTree() - .ToNormalizedEphemeralRange(); - if (range.IsNull()) - return; - InitializeFromRange(range, max_length); + return web_frame->Selection() + .ComputeVisibleSelectionInDOMTree() + .ToNormalizedEphemeralRange(); } -void WebSurroundingText::InitializeFromRange(const EphemeralRange& range, - size_t max_length) { +} // namespace + +WebSurroundingText::WebSurroundingText(WebLocalFrame* frame, size_t max_length) + : WebSurroundingText(ComputeRangeFromFrameSelection(frame), max_length) {} + +WebSurroundingText::WebSurroundingText(const EphemeralRange& range, + size_t max_length) + : start_offset_in_text_content_(0), end_offset_in_text_content_(0) { const Position start_position = range.StartPosition(); const Position end_position = range.EndPosition(); const unsigned half_max_length = max_length / 2; @@ -137,7 +138,7 @@ return end_offset_in_text_content_; } -bool WebSurroundingText::IsNull() const { +bool WebSurroundingText::IsEmpty() const { return text_content_.IsEmpty(); }
diff --git a/third_party/WebKit/Source/core/exported/WebSurroundingTextTest.cpp b/third_party/WebKit/Source/core/exported/WebSurroundingTextTest.cpp index b1270f5..54fb543 100644 --- a/third_party/WebKit/Source/core/exported/WebSurroundingTextTest.cpp +++ b/third_party/WebKit/Source/core/exported/WebSurroundingTextTest.cpp
@@ -51,8 +51,7 @@ { EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1); + WebSurroundingText surrounding_text(selection, 1); EXPECT_EQ("f", surrounding_text.TextContent()); EXPECT_EQ(0u, surrounding_text.StartOffsetInTextContent()); @@ -61,8 +60,7 @@ { EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 5); + WebSurroundingText surrounding_text(selection, 5); // maxlength/2 is used on the left and right. EXPECT_EQ("foo", @@ -73,8 +71,7 @@ { EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 42); + WebSurroundingText surrounding_text(selection, 42); EXPECT_EQ("foo bar", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -84,8 +81,7 @@ { EphemeralRange selection = Select(7); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 42); + WebSurroundingText surrounding_text(selection, 42); EXPECT_EQ("foo bar", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -95,8 +91,7 @@ { EphemeralRange selection = Select(6); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 2); + WebSurroundingText surrounding_text(selection, 2); EXPECT_EQ("ar", surrounding_text.TextContent()); EXPECT_EQ(1u, surrounding_text.StartOffsetInTextContent()); @@ -105,8 +100,7 @@ { EphemeralRange selection = Select(6); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 42); + WebSurroundingText surrounding_text(selection, 42); EXPECT_EQ("foo bar", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -120,8 +114,7 @@ { EphemeralRange selection = Select(0, 5); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1); + WebSurroundingText surrounding_text(selection, 1); EXPECT_EQ("Lorem ", surrounding_text.TextContent()); EXPECT_EQ(0u, surrounding_text.StartOffsetInTextContent()); @@ -130,8 +123,7 @@ { EphemeralRange selection = Select(0, 5); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 5); + WebSurroundingText surrounding_text(selection, 5); EXPECT_EQ("Lorem ip", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -141,8 +133,7 @@ { EphemeralRange selection = Select(0, 5); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 42); + WebSurroundingText surrounding_text(selection, 42); EXPECT_EQ("Lorem ipsum dolor sit amet", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -152,8 +143,7 @@ { EphemeralRange selection = Select(6, 11); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 2); + WebSurroundingText surrounding_text(selection, 2); EXPECT_EQ(" ipsum ", surrounding_text.TextContent()); EXPECT_EQ(1u, surrounding_text.StartOffsetInTextContent()); @@ -162,8 +152,7 @@ { EphemeralRange selection = Select(6, 11); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 42); + WebSurroundingText surrounding_text(selection, 42); EXPECT_EQ("Lorem ipsum dolor sit amet", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -174,8 +163,7 @@ { // Last word. EphemeralRange selection = Select(22, 26); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 8); + WebSurroundingText surrounding_text(selection, 8); EXPECT_EQ("sit amet", surrounding_text.TextContent()); EXPECT_EQ(4u, surrounding_text.StartOffsetInTextContent()); @@ -190,8 +178,7 @@ { EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1); + WebSurroundingText surrounding_text(selection, 1); EXPECT_EQ("f", surrounding_text.TextContent()); EXPECT_EQ(0u, surrounding_text.StartOffsetInTextContent()); @@ -200,8 +187,7 @@ { EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 5); + WebSurroundingText surrounding_text(selection, 5); EXPECT_EQ("foo", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -211,8 +197,7 @@ { EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1337); + WebSurroundingText surrounding_text(selection, 1337); EXPECT_EQ("This is outside of foo bar the selected node", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -222,8 +207,7 @@ { EphemeralRange selection = Select(6); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 2); + WebSurroundingText surrounding_text(selection, 2); EXPECT_EQ("ar", surrounding_text.TextContent()); EXPECT_EQ(1u, surrounding_text.StartOffsetInTextContent()); @@ -232,8 +216,7 @@ { EphemeralRange selection = Select(6); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1337); + WebSurroundingText surrounding_text(selection, 1337); EXPECT_EQ("This is outside of foo bar the selected node", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -249,8 +232,7 @@ { EphemeralRange selection = Select(0, 1); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1); + WebSurroundingText surrounding_text(selection, 1); EXPECT_EQ("fo", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -260,8 +242,7 @@ { EphemeralRange selection = Select(0, 3); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 12); + WebSurroundingText surrounding_text(selection, 12); EXPECT_EQ("e of foo bar", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -271,8 +252,7 @@ { EphemeralRange selection = Select(0, 3); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1337); + WebSurroundingText surrounding_text(selection, 1337); EXPECT_EQ("This is outside of foo bar the selected node", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -282,8 +262,7 @@ { EphemeralRange selection = Select(4, 7); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 12); + WebSurroundingText surrounding_text(selection, 12); EXPECT_EQ("foo bar the se", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -293,8 +272,7 @@ { EphemeralRange selection = Select(0, 7); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1337); + WebSurroundingText surrounding_text(selection, 1337); EXPECT_EQ("This is outside of foo bar the selected node", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -315,8 +293,7 @@ text_ctrl->SetSelectionRange(4, 7); EphemeralRange selection = text_ctrl->Selection().ComputeRange(); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 20); + WebSurroundingText surrounding_text(selection, 20); EXPECT_EQ("abc def ghi", String(surrounding_text.TextContent()).SimplifyWhiteSpace()); @@ -343,8 +320,7 @@ const Position end = Position(inner_editor, 0); // Surrounding text should not crash. See http://crbug.com/758438. - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(EphemeralRange(start, end), 8); + WebSurroundingText surrounding_text(EphemeralRange(start, end), 8); EXPECT_TRUE(surrounding_text.TextContent().IsEmpty()); } @@ -356,8 +332,7 @@ { EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 100); + WebSurroundingText surrounding_text(selection, 100); EXPECT_EQ("12345\n6789 12345\n\n6789", surrounding_text.TextContent()); EXPECT_EQ(6u, surrounding_text.StartOffsetInTextContent()); @@ -366,8 +341,7 @@ { EphemeralRange selection = Select(5); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 6); + WebSurroundingText surrounding_text(selection, 6); EXPECT_EQ("89 123", surrounding_text.TextContent()); EXPECT_EQ(3u, surrounding_text.StartOffsetInTextContent()); @@ -376,16 +350,14 @@ { EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 0); + WebSurroundingText surrounding_text(selection, 0); EXPECT_TRUE(surrounding_text.TextContent().IsEmpty()); } { EphemeralRange selection = Select(5); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 1); + WebSurroundingText surrounding_text(selection, 1); EXPECT_EQ("1", surrounding_text.TextContent()); EXPECT_EQ(0u, surrounding_text.StartOffsetInTextContent()); @@ -394,8 +366,7 @@ { EphemeralRange selection = Select(6); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 2); + WebSurroundingText surrounding_text(selection, 2); EXPECT_EQ("12", surrounding_text.TextContent()); EXPECT_EQ(1u, surrounding_text.StartOffsetInTextContent()); @@ -411,8 +382,7 @@ "<select>.</select>")); EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 100); + WebSurroundingText surrounding_text(selection, 100); EXPECT_STREQ( "\xEF\xBF\xBC\n57th Street and Lake Shore Drive\nChicago IL 60637", @@ -428,8 +398,7 @@ "6789<textarea>abc</textarea>0123<fieldset>.</fieldset>")); EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 100); + WebSurroundingText surrounding_text(selection, 100); EXPECT_EQ("\n6789\n12345\n\n6789", surrounding_text.TextContent()); EXPECT_EQ(6u, surrounding_text.StartOffsetInTextContent()); @@ -444,8 +413,7 @@ "example<button>.</button>")); EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 100); + WebSurroundingText surrounding_text(selection, 100); EXPECT_EQ("\nThis is a test example", surrounding_text.TextContent()); EXPECT_EQ(1u, surrounding_text.StartOffsetInTextContent()); @@ -459,8 +427,7 @@ "<button>.</button>")); EphemeralRange selection = Select(15); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 12); + WebSurroundingText surrounding_text(selection, 12); EXPECT_EQ("901234567890", surrounding_text.TextContent()); EXPECT_EQ(6u, surrounding_text.StartOffsetInTextContent()); @@ -475,16 +442,14 @@ { EphemeralRange selection = Select(1); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 100); + WebSurroundingText surrounding_text(selection, 100); EXPECT_TRUE(surrounding_text.TextContent().IsEmpty()); } { EphemeralRange selection = Select(3); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 100); + WebSurroundingText surrounding_text(selection, 100); EXPECT_TRUE(surrounding_text.TextContent().IsEmpty()); } @@ -494,8 +459,7 @@ SetHTML(String("<p id='selection'>.</p>")); EphemeralRange selection = Select(0); - WebSurroundingText surrounding_text; - surrounding_text.InitializeFromRange(selection, 2); + WebSurroundingText surrounding_text(selection, 2); EXPECT_EQ("\n.", surrounding_text.TextContent()); EXPECT_EQ(1u, surrounding_text.StartOffsetInTextContent());
diff --git a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp index 5b5bb83..c4ebf78 100644 --- a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp +++ b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
@@ -332,7 +332,6 @@ mojom::PageVisibilityState visibility_state) : client_(client), chrome_client_(ChromeClientImpl::Create(this)), - editor_client_(*this), should_auto_resize_(false), zoom_level_(0), minimum_zoom_level_(ZoomFactorToZoomLevel(kMinTextSizeMultiplier)), @@ -374,7 +373,6 @@ override_compositor_visibility_(false) { Page::PageClients page_clients; page_clients.chrome_client = chrome_client_.Get(); - page_clients.editor_client = &editor_client_; page_ = Page::CreateOrdinary(page_clients); CoreInitializer::GetInstance().ProvideModulesToPage(*page_, client_); @@ -1962,8 +1960,24 @@ ->VerticalScrollbar(); } +WebInputEventResult WebViewImpl::DispatchBufferedTouchEvents() { + if (!MainFrameImpl()) + return WebInputEventResult::kNotHandled; + if (WebDevToolsAgentImpl* devtools = MainFrameDevToolsAgentImpl()) + devtools->DispatchBufferedTouchEvents(); + return MainFrameImpl() + ->GetFrame() + ->GetEventHandler() + .DispatchBufferedTouchEvents(); +} + WebInputEventResult WebViewImpl::HandleInputEvent( const WebCoalescedInputEvent& coalesced_event) { + return HandleInputEventIncludingTouch(coalesced_event); +} + +WebInputEventResult WebViewImpl::HandleInputEventInternal( + const WebCoalescedInputEvent& coalesced_event) { const WebInputEvent& input_event = coalesced_event.Event(); // TODO(dcheng): The fact that this is getting called when there is no local // main frame is problematic and probably indicates a bug in the input event @@ -1971,6 +1985,8 @@ if (!MainFrameImpl()) return WebInputEventResult::kNotHandled; + DCHECK(!WebInputEvent::IsTouchEventType(input_event.GetType())); + GetPage()->GetVisualViewport().StartTrackingPinchStats(); TRACE_EVENT1("input,rail", "WebViewImpl::handleInputEvent", "type", @@ -2041,6 +2057,9 @@ AtomicString event_type; switch (input_event.GetType()) { + case WebInputEvent::kMouseEnter: + event_type = EventTypeNames::mouseover; + break; case WebInputEvent::kMouseMove: event_type = EventTypeNames::mousemove; break;
diff --git a/third_party/WebKit/Source/core/exported/WebViewImpl.h b/third_party/WebKit/Source/core/exported/WebViewImpl.h index ceec360..7baef3c2 100644 --- a/third_party/WebKit/Source/core/exported/WebViewImpl.h +++ b/third_party/WebKit/Source/core/exported/WebViewImpl.h
@@ -39,7 +39,6 @@ #include "core/frame/ResizeViewportAnchor.h" #include "core/page/ChromeClient.h" #include "core/page/ContextMenuProvider.h" -#include "core/page/EditorClient.h" #include "core/page/EventWithHitTestResults.h" #include "core/page/PageWidgetDelegate.h" #include "core/page/ScopedPagePauser.h" @@ -129,6 +128,7 @@ WebCompositeAndReadbackAsyncCallback*) override; void ThemeChanged() override; WebInputEventResult HandleInputEvent(const WebCoalescedInputEvent&) override; + WebInputEventResult DispatchBufferedTouchEvents() override; void SetCursorVisibilityState(bool is_visible) override; void ApplyViewportDeltas(const WebFloatSize& visual_viewport_delta, @@ -472,6 +472,8 @@ void RequestDecode(const PaintImage&, base::OnceCallback<void(bool)>); private: + WebInputEventResult HandleInputEventInternal( + const WebCoalescedInputEvent&) override; void SetPageScaleFactorAndLocation(float, const FloatPoint&); void PropagateZoomFactorToLocalFrameRoots(Frame*, float); @@ -562,7 +564,6 @@ WebViewClient* client_; // Can be 0 (e.g. unittests, shared workers, etc.) Persistent<ChromeClient> chrome_client_; - EditorClient editor_client_; WebSize size_; // If true, automatically resize the layout view around its content.
diff --git a/third_party/WebKit/Source/core/fetch/Body.idl b/third_party/WebKit/Source/core/fetch/Body.idl index 887ee69b..7afe7d0 100644 --- a/third_party/WebKit/Source/core/fetch/Body.idl +++ b/third_party/WebKit/Source/core/fetch/Body.idl
@@ -6,7 +6,6 @@ [ ActiveScriptWrappable, - Exposed=ServiceWorker, NoInterfaceObject ] interface Body { readonly attribute boolean bodyUsed;
diff --git a/third_party/WebKit/Source/core/fetch/Request.cpp b/third_party/WebKit/Source/core/fetch/Request.cpp index 1756073..4939ae9 100644 --- a/third_party/WebKit/Source/core/fetch/Request.cpp +++ b/third_party/WebKit/Source/core/fetch/Request.cpp
@@ -505,65 +505,44 @@ return request_->Url(); } -String Request::Context() const { - // "The context attribute's getter must return request's context" +String Request::destination() const { + // "The destination attribute’s getter must return request’s destination." switch (request_->Context()) { case WebURLRequest::kRequestContextUnspecified: + case WebURLRequest::kRequestContextBeacon: + case WebURLRequest::kRequestContextDownload: + case WebURLRequest::kRequestContextEventSource: + case WebURLRequest::kRequestContextFetch: + case WebURLRequest::kRequestContextPing: + case WebURLRequest::kRequestContextXMLHttpRequest: + case WebURLRequest::kRequestContextSubresource: return ""; + case WebURLRequest::kRequestContextCSPReport: + return "report"; case WebURLRequest::kRequestContextAudio: return "audio"; - case WebURLRequest::kRequestContextBeacon: - return "beacon"; - case WebURLRequest::kRequestContextCSPReport: - return "cspreport"; - case WebURLRequest::kRequestContextDownload: - return "download"; case WebURLRequest::kRequestContextEmbed: return "embed"; - case WebURLRequest::kRequestContextEventSource: - return "eventsource"; - case WebURLRequest::kRequestContextFavicon: - return "favicon"; - case WebURLRequest::kRequestContextFetch: - return "fetch"; case WebURLRequest::kRequestContextFont: return "font"; - case WebURLRequest::kRequestContextForm: - return "form"; case WebURLRequest::kRequestContextFrame: - return "frame"; case WebURLRequest::kRequestContextHyperlink: - return "hyperlink"; case WebURLRequest::kRequestContextIframe: - return "iframe"; - case WebURLRequest::kRequestContextImage: - return "image"; - case WebURLRequest::kRequestContextImageSet: - return "imageset"; - case WebURLRequest::kRequestContextImport: - return "import"; - case WebURLRequest::kRequestContextInternal: - return "internal"; case WebURLRequest::kRequestContextLocation: - return "location"; + case WebURLRequest::kRequestContextForm: + return "document"; + case WebURLRequest::kRequestContextImage: + case WebURLRequest::kRequestContextFavicon: + case WebURLRequest::kRequestContextImageSet: + return "image"; case WebURLRequest::kRequestContextManifest: return "manifest"; case WebURLRequest::kRequestContextObject: return "object"; - case WebURLRequest::kRequestContextPing: - return "ping"; - case WebURLRequest::kRequestContextPlugin: - return "plugin"; - case WebURLRequest::kRequestContextPrefetch: - return "prefetch"; case WebURLRequest::kRequestContextScript: return "script"; - case WebURLRequest::kRequestContextServiceWorker: - return "serviceworker"; case WebURLRequest::kRequestContextSharedWorker: return "sharedworker"; - case WebURLRequest::kRequestContextSubresource: - return "subresource"; case WebURLRequest::kRequestContextStyle: return "style"; case WebURLRequest::kRequestContextTrack: @@ -572,10 +551,14 @@ return "video"; case WebURLRequest::kRequestContextWorker: return "worker"; - case WebURLRequest::kRequestContextXMLHttpRequest: - return "xmlhttprequest"; case WebURLRequest::kRequestContextXSLT: return "xslt"; + case WebURLRequest::kRequestContextImport: + case WebURLRequest::kRequestContextInternal: + case WebURLRequest::kRequestContextPlugin: + case WebURLRequest::kRequestContextPrefetch: + case WebURLRequest::kRequestContextServiceWorker: + return "unknown"; } NOTREACHED(); return "";
diff --git a/third_party/WebKit/Source/core/fetch/Request.h b/third_party/WebKit/Source/core/fetch/Request.h index 04316c31..dc303a2 100644 --- a/third_party/WebKit/Source/core/fetch/Request.h +++ b/third_party/WebKit/Source/core/fetch/Request.h
@@ -61,7 +61,7 @@ String method() const; KURL url() const; Headers* getHeaders() const { return headers_; } - String Context() const; + String destination() const; String referrer() const; String getReferrerPolicy() const; String mode() const;
diff --git a/third_party/WebKit/Source/core/fetch/Request.idl b/third_party/WebKit/Source/core/fetch/Request.idl index a1c7ec86..e2427d0 100644 --- a/third_party/WebKit/Source/core/fetch/Request.idl +++ b/third_party/WebKit/Source/core/fetch/Request.idl
@@ -6,6 +6,8 @@ typedef (Request or USVString) RequestInfo; +enum RequestDestination { "", "audio", "audioworklet", "document", "embed", "font", "image", "manifest", "object", "paintworklet", "report", + "script", "sharedworker", "style", "track", "video", "worker", "xslt" }; enum RequestMode { "navigate", "same-origin", "no-cors", "cors" }; enum RequestCredentials { "omit", "same-origin", "include" }; enum RequestRedirect { "follow", "error", "manual" }; @@ -33,6 +35,7 @@ readonly attribute ByteString method; readonly attribute USVString url; [ImplementedAs=getHeaders, SameObject] readonly attribute Headers headers; + readonly attribute RequestDestination destination; readonly attribute DOMString referrer; [ImplementedAs=getReferrerPolicy] readonly attribute ReferrerPolicy referrerPolicy; readonly attribute RequestMode mode;
diff --git a/third_party/WebKit/Source/core/fetch/RequestTest.cpp b/third_party/WebKit/Source/core/fetch/RequestTest.cpp index 0f38c285..781f732 100644 --- a/third_party/WebKit/Source/core/fetch/RequestTest.cpp +++ b/third_party/WebKit/Source/core/fetch/RequestTest.cpp
@@ -85,7 +85,7 @@ DCHECK(request); EXPECT_EQ(url, request->url()); EXPECT_EQ(method, request->method()); - EXPECT_EQ("audio", request->Context()); + EXPECT_EQ("audio", request->destination()); EXPECT_EQ(referrer, request->referrer()); EXPECT_EQ("navigate", request->mode());
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp index c2be132..ad738cb8 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -125,6 +125,24 @@ return ToLocalFrame(parent)->TextZoomFactor(); } +bool ShouldUseClientLoFiForRequest( + const ResourceRequest& request, + WebURLRequest::PreviewsState frame_previews_state) { + if (request.GetPreviewsState() != WebURLRequest::kPreviewsUnspecified) + return request.GetPreviewsState() & WebURLRequest::kClientLoFiOn; + + if (!(frame_previews_state & WebURLRequest::kClientLoFiOn)) + return false; + + // Even if this frame is using Server Lo-Fi, https:// images won't be + // handled by Server Lo-Fi since their requests won't be sent to the Data + // Saver proxy, so use Client Lo-Fi instead. + if (frame_previews_state & WebURLRequest::kServerLoFiOn) + return request.Url().ProtocolIs("https"); + + return true; +} + } // namespace template class CORE_TEMPLATE_EXPORT Supplement<LocalFrame>; @@ -1127,7 +1145,8 @@ } if (Client() && - Client()->ShouldUseClientLoFiForRequest(params.GetResourceRequest())) { + ShouldUseClientLoFiForRequest(params.GetResourceRequest(), + Client()->GetPreviewsStateForFrame())) { params.MutableResourceRequest().SetPreviewsState( params.GetResourceRequest().GetPreviewsState() | WebURLRequest::kClientLoFiOn);
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameClient.h b/third_party/WebKit/Source/core/frame/LocalFrameClient.h index ceea9ab..c8e2c21 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrameClient.h +++ b/third_party/WebKit/Source/core/frame/LocalFrameClient.h
@@ -183,9 +183,9 @@ virtual void DidDispatchPingLoader(const KURL&) = 0; // The frame displayed content with certificate errors with given URL. - virtual void DidDisplayContentWithCertificateErrors(const KURL&) = 0; + virtual void DidDisplayContentWithCertificateErrors() = 0; // The frame ran content with certificate errors with the given URL. - virtual void DidRunContentWithCertificateErrors(const KURL&) = 0; + virtual void DidRunContentWithCertificateErrors() = 0; // The frame loaded a resource with an otherwise-valid legacy Symantec // certificate that is slated for distrust. Prints a console message (possibly @@ -335,14 +335,9 @@ virtual void SetEffectiveConnectionTypeForTesting( WebEffectiveConnectionType) {} - // Returns whether or not Client Lo-Fi is enabled for the frame - // (and so image requests may be replaced with a placeholder). - virtual bool IsClientLoFiActiveForFrame() { return false; } - - // Returns whether or not the requested image should be replaced with a - // placeholder as part of the Client Lo-Fi previews feature. - virtual bool ShouldUseClientLoFiForRequest(const ResourceRequest&) { - return false; + // Returns the PreviewsState active for the frame. + virtual WebURLRequest::PreviewsState GetPreviewsStateForFrame() const { + return WebURLRequest::kPreviewsUnspecified; } // Overwrites the given URL to use an HTML5 embed if possible. An empty URL is @@ -388,6 +383,12 @@ WebScopedVirtualTimePauser virtual_time_pauser) {} virtual String evaluateInInspectorOverlayForTesting(const String& script) = 0; + + virtual bool HandleCurrentKeyboardEvent() { return false; } + + virtual void DidChangeSelection(bool is_selection_empty) {} + + virtual void DidChangeContents() {} }; } // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameTest.cpp b/third_party/WebKit/Source/core/frame/LocalFrameTest.cpp new file mode 100644 index 0000000..0bc092a5 --- /dev/null +++ b/third_party/WebKit/Source/core/frame/LocalFrameTest.cpp
@@ -0,0 +1,110 @@ +// Copyright 2018 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 "core/frame/LocalFrame.h" + +#include "core/layout/LayoutTestHelper.h" +#include "core/loader/EmptyClients.h" +#include "core/testing/DummyPageHolder.h" +#include "platform/loader/fetch/FetchParameters.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace blink { + +class TestLocalFrameClient : public EmptyLocalFrameClient { + public: + explicit TestLocalFrameClient( + WebURLRequest::PreviewsState frame_previews_state) + : frame_previews_state_(frame_previews_state) {} + ~TestLocalFrameClient() override = default; + + WebURLRequest::PreviewsState GetPreviewsStateForFrame() const override { + return frame_previews_state_; + } + + private: + const WebURLRequest::PreviewsState frame_previews_state_; +}; + +TEST(LocalFrameTest, MaybeAllowPlaceholderImageUsesSpecifiedRequestValue) { + ResourceRequest request1; + request1.SetURL(KURL("http://insecure.com")); + request1.SetPreviewsState(WebURLRequest::kClientLoFiOn); + FetchParameters params1(request1); + DummyPageHolder::Create(IntSize(800, 600), nullptr, + new TestLocalFrameClient(WebURLRequest::kPreviewsOff)) + ->GetFrame() + .MaybeAllowImagePlaceholder(params1); + EXPECT_EQ(FetchParameters::kAllowPlaceholder, + params1.GetPlaceholderImageRequestType()); + + ResourceRequest request2; + request2.SetURL(KURL("https://secure.com")); + request2.SetPreviewsState(WebURLRequest::kPreviewsOff); + FetchParameters params2(request2); + DummyPageHolder::Create( + IntSize(800, 600), nullptr, + new TestLocalFrameClient(WebURLRequest::kClientLoFiOn)) + ->GetFrame() + .MaybeAllowImagePlaceholder(params2); + EXPECT_EQ(FetchParameters::kDisallowPlaceholder, + params2.GetPlaceholderImageRequestType()); +} + +TEST(LocalFrameTest, MaybeAllowPlaceholderImageUsesFramePreviewsState) { + ResourceRequest request1; + request1.SetURL(KURL("http://insecure.com")); + request1.SetPreviewsState(WebURLRequest::kPreviewsUnspecified); + FetchParameters params1(request1); + DummyPageHolder::Create( + IntSize(800, 600), nullptr, + new TestLocalFrameClient(WebURLRequest::kClientLoFiOn)) + ->GetFrame() + .MaybeAllowImagePlaceholder(params1); + EXPECT_EQ(FetchParameters::kAllowPlaceholder, + params1.GetPlaceholderImageRequestType()); + + ResourceRequest request2; + request2.SetURL(KURL("http://insecure.com")); + request2.SetPreviewsState(WebURLRequest::kPreviewsUnspecified); + FetchParameters params2(request2); + DummyPageHolder::Create( + IntSize(800, 600), nullptr, + new TestLocalFrameClient(WebURLRequest::kServerLitePageOn)) + ->GetFrame() + .MaybeAllowImagePlaceholder(params2); + EXPECT_EQ(FetchParameters::kDisallowPlaceholder, + params2.GetPlaceholderImageRequestType()); +} + +TEST(LocalFrameTest, + MaybeAllowPlaceholderImageConditionalOnSchemeForServerLoFi) { + ResourceRequest request1; + request1.SetURL(KURL("https://secure.com")); + request1.SetPreviewsState(WebURLRequest::kPreviewsUnspecified); + FetchParameters params1(request1); + DummyPageHolder::Create( + IntSize(800, 600), nullptr, + new TestLocalFrameClient(WebURLRequest::kServerLoFiOn | + WebURLRequest::kClientLoFiOn)) + ->GetFrame() + .MaybeAllowImagePlaceholder(params1); + EXPECT_EQ(FetchParameters::kAllowPlaceholder, + params1.GetPlaceholderImageRequestType()); + + ResourceRequest request2; + request2.SetURL(KURL("http://insecure.com")); + request2.SetPreviewsState(WebURLRequest::kPreviewsUnspecified); + FetchParameters params2(request2); + DummyPageHolder::Create( + IntSize(800, 600), nullptr, + new TestLocalFrameClient(WebURLRequest::kServerLoFiOn | + WebURLRequest::kClientLoFiOn)) + ->GetFrame() + .MaybeAllowImagePlaceholder(params2); + EXPECT_EQ(FetchParameters::kDisallowPlaceholder, + params2.GetPlaceholderImageRequestType()); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp index 6cfc7f34..06836a6 100644 --- a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp +++ b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
@@ -1884,7 +1884,8 @@ bool LocalFrameView::RestoreScrollAnchor( const ScrollAnchor::SerializedAnchor& serialized_anchor) { - return false; + return ShouldPerformScrollAnchoring() && + scroll_anchor_.RestoreAnchor(serialized_anchor); } void LocalFrameView::ProcessUrlFragment(const KURL& url,
diff --git a/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp index b1ab93e..f5203b67 100644 --- a/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp +++ b/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
@@ -261,7 +261,9 @@ DocumentLifecycle::AllowThrottlingScope throttling_scope( local_root_->GetFrame()->GetDocument()->Lifecycle()); PageWidgetDelegate::Animate(*GetPage(), last_frame_time_monotonic); - GetPage()->GetValidationMessageClient().LayoutOverlay(); + // Animate can cause the local frame to detach. + if (local_root_) + GetPage()->GetValidationMessageClient().LayoutOverlay(); } void WebFrameWidgetImpl::UpdateAllLifecyclePhases() { @@ -369,11 +371,36 @@ const WebInputEvent* WebFrameWidgetImpl::current_input_event_ = nullptr; +WebInputEventResult WebFrameWidgetImpl::DispatchBufferedTouchEvents() { + if (doing_drag_and_drop_) + return WebInputEventResult::kHandledSuppressed; + + if (!GetPage()) + return WebInputEventResult::kNotHandled; + + if (local_root_) { + if (WebDevToolsAgentImpl* devtools = local_root_->DevToolsAgentImpl()) + devtools->DispatchBufferedTouchEvents(); + } + if (IgnoreInputEvents()) + return WebInputEventResult::kNotHandled; + + return local_root_->GetFrame() + ->GetEventHandler() + .DispatchBufferedTouchEvents(); +} + WebInputEventResult WebFrameWidgetImpl::HandleInputEvent( const WebCoalescedInputEvent& coalesced_event) { + return HandleInputEventIncludingTouch(coalesced_event); +} + +WebInputEventResult WebFrameWidgetImpl::HandleInputEventInternal( + const WebCoalescedInputEvent& coalesced_event) { const WebInputEvent& input_event = coalesced_event.Event(); TRACE_EVENT1("input", "WebFrameWidgetImpl::handleInputEvent", "type", WebInputEvent::GetName(input_event.GetType())); + DCHECK(!WebInputEvent::IsTouchEventType(input_event.GetType())); // If a drag-and-drop operation is in progress, ignore input events. if (doing_drag_and_drop_) @@ -422,6 +449,9 @@ AtomicString event_type; switch (input_event.GetType()) { + case WebInputEvent::kMouseEnter: + event_type = EventTypeNames::mouseover; + break; case WebInputEvent::kMouseMove: event_type = EventTypeNames::mousemove; break;
diff --git a/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h b/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h index ced53f7..393d44a6 100644 --- a/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h +++ b/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
@@ -85,6 +85,7 @@ WebCompositeAndReadbackAsyncCallback*) override; void ThemeChanged() override; WebHitTestResult HitTestResultAt(const WebPoint&) override; + WebInputEventResult DispatchBufferedTouchEvents() override; WebInputEventResult HandleInputEvent(const WebCoalescedInputEvent&) override; void SetCursorVisibilityState(bool is_visible) override; @@ -155,6 +156,9 @@ explicit WebFrameWidgetImpl(WebWidgetClient*, WebLocalFrame*); + WebInputEventResult HandleInputEventInternal( + const WebCoalescedInputEvent&) override; + // Perform a hit test for a point relative to the root frame of the page. HitTestResult HitTestResultForRootFramePos( const LayoutPoint& pos_in_root_frame);
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp index a3b0e25..bb3994c 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp
@@ -27,6 +27,7 @@ #include <memory> #include "bindings/core/v8/ScriptController.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/dom/DOMStringList.h" #include "core/dom/Document.h" #include "core/dom/Element.h" @@ -70,7 +71,6 @@ #include "platform/wtf/text/StringUTF8Adaptor.h" #include "public/platform/Platform.h" #include "public/platform/TaskType.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebURLRequest.h" namespace blink { @@ -189,7 +189,7 @@ } if (treat_as_public_address_) { execution_context_->GetSecurityContext().SetAddressSpace( - kWebAddressSpacePublic); + mojom::IPAddressSpace::kPublic); } if (require_safe_types_) execution_context_->GetSecurityContext().SetRequireTrustedTypes();
diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp index 40ca259..72f40a320 100644 --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
@@ -4,6 +4,7 @@ #include "core/frame/csp/ContentSecurityPolicy.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/dom/Document.h" #include "core/frame/csp/CSPDirectiveList.h" #include "core/html/HTMLScriptElement.h" @@ -16,7 +17,6 @@ #include "platform/weborigin/KURL.h" #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityOrigin.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebInsecureRequestPolicy.h" #include "testing/gtest/include/gtest/gtest.h" @@ -99,26 +99,26 @@ TEST_F(ContentSecurityPolicyTest, ParseEnforceTreatAsPublicAddressDisabled) { ScopedCorsRFC1918ForTest cors_rfc1918(false); - execution_context->SetAddressSpace(kWebAddressSpacePrivate); - EXPECT_EQ(kWebAddressSpacePrivate, execution_context->AddressSpace()); + execution_context->SetAddressSpace(mojom::IPAddressSpace::kPrivate); + EXPECT_EQ(mojom::IPAddressSpace::kPrivate, execution_context->AddressSpace()); csp->DidReceiveHeader("treat-as-public-address", kContentSecurityPolicyHeaderTypeEnforce, kContentSecurityPolicyHeaderSourceHTTP); csp->BindToExecutionContext(execution_context.Get()); - EXPECT_EQ(kWebAddressSpacePrivate, execution_context->AddressSpace()); + EXPECT_EQ(mojom::IPAddressSpace::kPrivate, execution_context->AddressSpace()); } TEST_F(ContentSecurityPolicyTest, ParseEnforceTreatAsPublicAddressEnabled) { ScopedCorsRFC1918ForTest cors_rfc1918(true); - execution_context->SetAddressSpace(kWebAddressSpacePrivate); - EXPECT_EQ(kWebAddressSpacePrivate, execution_context->AddressSpace()); + execution_context->SetAddressSpace(mojom::IPAddressSpace::kPrivate); + EXPECT_EQ(mojom::IPAddressSpace::kPrivate, execution_context->AddressSpace()); csp->DidReceiveHeader("treat-as-public-address", kContentSecurityPolicyHeaderTypeEnforce, kContentSecurityPolicyHeaderSourceHTTP); csp->BindToExecutionContext(execution_context.Get()); - EXPECT_EQ(kWebAddressSpacePublic, execution_context->AddressSpace()); + EXPECT_EQ(mojom::IPAddressSpace::kPublic, execution_context->AddressSpace()); } TEST_F(ContentSecurityPolicyTest, CopyStateFrom) {
diff --git a/third_party/WebKit/Source/core/html/ImageData.cpp b/third_party/WebKit/Source/core/html/ImageData.cpp index d9e4c23..ffc32e2 100644 --- a/third_party/WebKit/Source/core/html/ImageData.cpp +++ b/third_party/WebKit/Source/core/html/ImageData.cpp
@@ -712,7 +712,7 @@ WTF::ArrayBufferContents& content, CanvasPixelFormat pixel_format, ImageDataStorageFormat storage_format) { - if (!content.SizeInBytes()) + if (!content.DataLength()) return nullptr; // Uint16 is not supported as the storage format for ImageData created from a @@ -738,7 +738,7 @@ bool color_converison_successful = false; switch (pixel_format) { case kRGBA8CanvasPixelFormat: - num_pixels = content.SizeInBytes() / 4; + num_pixels = content.DataLength() / 4; switch (storage_format) { case kUint8ClampedArrayStorageFormat: array_buffer = DOMArrayBuffer::Create(content); @@ -761,7 +761,7 @@ break; case kF16CanvasPixelFormat: - num_pixels = content.SizeInBytes() / 8; + num_pixels = content.DataLength() / 8; src_color_format = SkColorSpaceXform::ColorFormat::kRGBA_F16_ColorFormat; switch (storage_format) {
diff --git a/third_party/WebKit/Source/core/html/forms/HTMLButtonElement.h b/third_party/WebKit/Source/core/html/forms/HTMLButtonElement.h index bca4665..14ec75c 100644 --- a/third_party/WebKit/Source/core/html/forms/HTMLButtonElement.h +++ b/third_party/WebKit/Source/core/html/forms/HTMLButtonElement.h
@@ -49,6 +49,9 @@ LayoutObject* CreateLayoutObject(const ComputedStyle&) override; + // HTMLFormControlElement always creates one, but buttons don't need it. + bool AlwaysCreateUserAgentShadowRoot() const override { return false; } + Node::InsertionNotificationRequest InsertedInto(ContainerNode*) override; void ParseAttribute(const AttributeModificationParams&) override; bool IsPresentationAttribute(const QualifiedName&) const override;
diff --git a/third_party/WebKit/Source/core/html/forms/HTMLFieldSetElement.h b/third_party/WebKit/Source/core/html/forms/HTMLFieldSetElement.h index d49cdea..f70f9b8 100644 --- a/third_party/WebKit/Source/core/html/forms/HTMLFieldSetElement.h +++ b/third_party/WebKit/Source/core/html/forms/HTMLFieldSetElement.h
@@ -56,6 +56,7 @@ void ChildrenChanged(const ChildrenChange&) override; bool AreAuthorShadowsAllowed() const override { return false; } bool IsSubmittableElement() override; + bool AlwaysCreateUserAgentShadowRoot() const override { return false; } Element* InvalidateDescendantDisabledStateAndFindFocusedOne(Element& base); };
diff --git a/third_party/WebKit/Source/core/html/forms/HTMLFormControlElement.h b/third_party/WebKit/Source/core/html/forms/HTMLFormControlElement.h index 02971569..17967d2 100644 --- a/third_party/WebKit/Source/core/html/forms/HTMLFormControlElement.h +++ b/third_party/WebKit/Source/core/html/forms/HTMLFormControlElement.h
@@ -175,6 +175,7 @@ private: bool IsFormControlElement() const final { return true; } + bool AlwaysCreateUserAgentShadowRoot() const override { return true; } int tabIndex() const override;
diff --git a/third_party/WebKit/Source/core/html/media/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/media/HTMLMediaElement.h index 642e8e50..4bca8d12 100644 --- a/third_party/WebKit/Source/core/html/media/HTMLMediaElement.h +++ b/third_party/WebKit/Source/core/html/media/HTMLMediaElement.h
@@ -357,6 +357,7 @@ void ResetMediaPlayerAndMediaSource(); + bool AlwaysCreateUserAgentShadowRoot() const final { return true; } bool AreAuthorShadowsAllowed() const final { return false; } bool SupportsFocus() const final;
diff --git a/third_party/WebKit/Source/core/input/ContextMenuAllowedScope.cpp b/third_party/WebKit/Source/core/input/ContextMenuAllowedScope.cpp index 33be2ab..2842fee 100644 --- a/third_party/WebKit/Source/core/input/ContextMenuAllowedScope.cpp +++ b/third_party/WebKit/Source/core/input/ContextMenuAllowedScope.cpp
@@ -13,6 +13,7 @@ } ContextMenuAllowedScope::~ContextMenuAllowedScope() { + DCHECK_GT(g_context_menu_allowed_count, 0U); g_context_menu_allowed_count--; }
diff --git a/third_party/WebKit/Source/core/input/ContextMenuAllowedScope.h b/third_party/WebKit/Source/core/input/ContextMenuAllowedScope.h index 649e72e2..f48cdc5f 100644 --- a/third_party/WebKit/Source/core/input/ContextMenuAllowedScope.h +++ b/third_party/WebKit/Source/core/input/ContextMenuAllowedScope.h
@@ -5,6 +5,7 @@ #ifndef ContextMenuAllowedScope_h #define ContextMenuAllowedScope_h +#include "base/macros.h" #include "core/CoreExport.h" #include "platform/wtf/Allocator.h" @@ -12,6 +13,7 @@ class CORE_EXPORT ContextMenuAllowedScope { STACK_ALLOCATED(); + DISALLOW_COPY_AND_ASSIGN(ContextMenuAllowedScope); public: ContextMenuAllowedScope();
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp index a55de28..779c915 100644 --- a/third_party/WebKit/Source/core/input/EventHandler.cpp +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -119,22 +119,6 @@ IsHTMLInputElement(ToShadowRoot(target_node)->host()); } -Vector<WebPointerEvent> GetCoalescedWebPointerEventsWithNoTransformation( - const Vector<WebTouchEvent>& coalesced_events, - int id) { - Vector<WebPointerEvent> related_pointer_events; - for (const auto& touch_event : coalesced_events) { - for (unsigned i = 0; i < touch_event.touches_length; ++i) { - if (touch_event.touches[i].id == id && - touch_event.touches[i].state != WebTouchPoint::kStateStationary) { - related_pointer_events.push_back( - WebPointerEvent(touch_event, touch_event.touches[i])); - } - } - } - return related_pointer_events; -} - } // namespace using namespace HTMLNames; @@ -564,6 +548,10 @@ return PointerCursor(); } +WebInputEventResult EventHandler::DispatchBufferedTouchEvents() { + return pointer_event_manager_->FlushEvents(); +} + WebInputEventResult EventHandler::HandlePointerEvent( const WebPointerEvent& web_pointer_event, const Vector<WebPointerEvent>& coalesced_events) { @@ -2072,39 +2060,6 @@ } } -WebInputEventResult EventHandler::HandleTouchEvent( - const WebTouchEvent& event, - const Vector<WebTouchEvent>& coalesced_events) { - TRACE_EVENT0("blink", "EventHandler::handleTouchEvent"); - if (event.GetType() == WebInputEvent::kTouchScrollStarted) { - // As long as the type is not mouse it is fine. Any type but mouse causes - // all the active scroll capable pointers to get canceled. - return pointer_event_manager_->HandlePointerEvent( - WebPointerEvent(WebPointerProperties::PointerType::kUnknown, - event.TimeStampSeconds()), - Vector<WebPointerEvent>()); - } - - for (unsigned touch_point_index = 0; touch_point_index < event.touches_length; - ++touch_point_index) { - const WebTouchPoint& touch_point = event.touches[touch_point_index]; - if (touch_point.state != blink::WebTouchPoint::kStateStationary) { - const WebPointerEvent& web_pointer_event = - WebPointerEvent(event, event.touches[touch_point_index]); - const Vector<WebPointerEvent>& web_coalesced_pointer_events = - GetCoalescedWebPointerEventsWithNoTransformation( - coalesced_events, event.touches[touch_point_index].id); - pointer_event_manager_->HandlePointerEvent(web_pointer_event, - web_coalesced_pointer_events); - } - } - - // Calling this function |FlushEvents| will be moved to MainThreadEventQueue - // class. It will be called before rAF and also whenever we run in low latency - // mode as mentioned in crbug.com/728250. - return pointer_event_manager_->FlushEvents(); -} - WebInputEventResult EventHandler::PassMousePressEventToSubframe( MouseEventWithHitTestResults& mev, LocalFrame* subframe) {
diff --git a/third_party/WebKit/Source/core/input/EventHandler.h b/third_party/WebKit/Source/core/input/EventHandler.h index 121de3c..0e151b8 100644 --- a/third_party/WebKit/Source/core/input/EventHandler.h +++ b/third_party/WebKit/Source/core/input/EventHandler.h
@@ -75,7 +75,6 @@ class WebGestureEvent; class WebMouseEvent; class WebMouseWheelEvent; -class WebTouchEvent; class CORE_EXPORT EventHandler final : public GarbageCollectedFinalized<EventHandler> { @@ -151,6 +150,8 @@ const WebPointerEvent&, const Vector<WebPointerEvent>& coalesced_events); + WebInputEventResult DispatchBufferedTouchEvents(); + WebInputEventResult HandleMousePressEvent(const WebMouseEvent&); WebInputEventResult HandleMouseReleaseEvent(const WebMouseEvent&); WebInputEventResult HandleWheelEvent(const WebMouseWheelEvent&); @@ -232,10 +233,6 @@ void CapsLockStateMayHaveChanged(); // Only called by FrameSelection - WebInputEventResult HandleTouchEvent( - const WebTouchEvent&, - const Vector<WebTouchEvent>& coalesced_events); - bool UseHandCursor(Node*, bool is_over_link); void NotifyElementActivated();
diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp index fd59ce7..f18b09f5 100644 --- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp +++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -919,8 +919,9 @@ // corresponding pointer. if (initiator == DragInitiator::kMouse) { frame_->GetEventHandler().HandlePointerEvent( - WebPointerEvent(WebPointerProperties::PointerType::kMouse, - event.Event().TimeStampSeconds()), + WebPointerEvent::CreatePointerCausesUaActionEvent( + WebPointerProperties::PointerType::kMouse, + event.Event().TimeStampSeconds()), Vector<WebPointerEvent>()); } // TODO(crbug.com/708278): If the drag starts with touch the touch cancel
diff --git a/third_party/WebKit/Source/core/input/OverscrollBehaviorTest.cpp b/third_party/WebKit/Source/core/input/OverscrollBehaviorTest.cpp index a26b06f..23f08289c 100644 --- a/third_party/WebKit/Source/core/input/OverscrollBehaviorTest.cpp +++ b/third_party/WebKit/Source/core/input/OverscrollBehaviorTest.cpp
@@ -19,12 +19,12 @@ void SetUp() override; void SetInnerOverscrollBehavior(EOverscrollBehavior, EOverscrollBehavior); - void Scroll(double x, double y); - private: - WebGestureEvent ScrollBegin(double hint_x, double hint_y); - WebGestureEvent ScrollUpdate(double delta_x, double delta_y); - WebGestureEvent ScrollEnd(); + void ScrollBegin(double hint_x, double hint_y); + void ScrollUpdate(double x, double y); + void ScrollEnd(); + + void Scroll(double x, double y); }; void OverscrollBehaviorTest::SetUp() { @@ -66,17 +66,7 @@ inner->MutableComputedStyle()->SetOverscrollBehaviorY(y); } -void OverscrollBehaviorTest::Scroll(double x, double y) { - GetDocument().GetFrame()->GetEventHandler().HandleGestureScrollEvent( - ScrollBegin(x, y)); - GetDocument().GetFrame()->GetEventHandler().HandleGestureScrollEvent( - ScrollUpdate(x, y)); - GetDocument().GetFrame()->GetEventHandler().HandleGestureScrollEvent( - ScrollEnd()); -} - -WebGestureEvent OverscrollBehaviorTest::ScrollBegin(double hint_x, - double hint_y) { +void OverscrollBehaviorTest::ScrollBegin(double hint_x, double hint_y) { WebGestureEvent event(WebInputEvent::kGestureScrollBegin, WebInputEvent::kNoModifiers, CurrentTimeTicks().InSeconds()); @@ -87,11 +77,10 @@ event.data.scroll_begin.delta_y_hint = -hint_y; event.data.scroll_begin.pointer_count = 1; event.SetFrameScale(1); - return event; + GetDocument().GetFrame()->GetEventHandler().HandleGestureScrollEvent(event); } -WebGestureEvent OverscrollBehaviorTest::ScrollUpdate(double delta_x, - double delta_y) { +void OverscrollBehaviorTest::ScrollUpdate(double delta_x, double delta_y) { WebGestureEvent event(WebInputEvent::kGestureScrollUpdate, WebInputEvent::kNoModifiers, CurrentTimeTicks().InSeconds()); @@ -101,17 +90,23 @@ event.data.scroll_update.delta_x = -delta_x; event.data.scroll_update.delta_y = -delta_y; event.SetFrameScale(1); - return event; + GetDocument().GetFrame()->GetEventHandler().HandleGestureScrollEvent(event); } -WebGestureEvent OverscrollBehaviorTest::ScrollEnd() { +void OverscrollBehaviorTest::ScrollEnd() { WebGestureEvent event(WebInputEvent::kGestureScrollEnd, WebInputEvent::kNoModifiers, CurrentTimeTicks().InSeconds()); event.x = event.global_x = 20; event.y = event.global_y = 20; event.source_device = WebGestureDevice::kWebGestureDeviceTouchscreen; - return event; + GetDocument().GetFrame()->GetEventHandler().HandleGestureScrollEvent(event); +} + +void OverscrollBehaviorTest::Scroll(double x, double y) { + ScrollBegin(x, y); + ScrollUpdate(x, y); + ScrollEnd(); } TEST_F(OverscrollBehaviorTest, AutoAllowsPropagation) { @@ -177,4 +172,19 @@ ASSERT_EQ(outer->scrollTop(), 200); } +TEST_F(OverscrollBehaviorTest, LatchToTheElementPreventedByOverscrollBehavior) { + SetInnerOverscrollBehavior(EOverscrollBehavior::kNone, + EOverscrollBehavior::kNone); + ScrollBegin(-100, 0); + ScrollUpdate(-100, 0); + ScrollUpdate(100, 0); + ScrollUpdate(0, -100); + ScrollUpdate(0, 100); + ScrollEnd(); + + Element* inner = GetDocument().getElementById("inner"); + ASSERT_EQ(inner->scrollLeft(), 100); + ASSERT_EQ(inner->scrollTop(), 100); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/input/PointerEventManagerTest.cpp b/third_party/WebKit/Source/core/input/PointerEventManagerTest.cpp index 8bb5db0b..762142f 100644 --- a/third_party/WebKit/Source/core/input/PointerEventManagerTest.cpp +++ b/third_party/WebKit/Source/core/input/PointerEventManagerTest.cpp
@@ -52,6 +52,25 @@ EventHandler& EventHandler() { return GetDocument().GetFrame()->GetEventHandler(); } + WebPointerEvent CreateTestPointerEvent( + WebInputEvent::Type type, + WebPointerProperties::PointerType pointer_type) { + WebPointerEvent event( + type, + WebPointerProperties(1, pointer_type, + WebPointerProperties::Button::kLeft, + WebFloatPoint(100, 100), WebFloatPoint(100, 100)), + 1, 1); + event.SetFrameScale(1); + return event; + } + WebMouseEvent CreateTestMouseEvent(WebInputEvent::Type type, + const WebFloatPoint& coordinates) { + WebMouseEvent event(type, coordinates, coordinates, + WebPointerProperties::Button::kLeft, 0, 0, 0); + event.SetFrameScale(1); + return event; + } }; TEST_F(PointerEventManagerTest, PointerCancelsOfAllTypes) { @@ -67,54 +86,42 @@ GetDocument().body()->addEventListener(EventTypeNames::pointercancel, callback); - WebTouchEvent event; - event.SetFrameScale(1); - WebTouchPoint point( - WebPointerProperties(1, WebPointerProperties::PointerType::kTouch, - WebPointerProperties::Button::kLeft, - WebFloatPoint(100, 100), WebFloatPoint(100, 100))); - point.state = WebTouchPoint::State::kStatePressed; - event.touches[event.touches_length++] = point; - event.SetType(WebInputEvent::kTouchStart); - EventHandler().HandleTouchEvent(event, Vector<WebTouchEvent>()); + EventHandler().HandlePointerEvent( + CreateTestPointerEvent(WebInputEvent::kPointerDown, + WebPointerProperties::PointerType::kTouch), + Vector<WebPointerEvent>()); - point.pointer_type = WebPointerProperties::PointerType::kPen; - event.touches[0] = point; - event.SetType(WebInputEvent::kTouchStart); - EventHandler().HandleTouchEvent(event, Vector<WebTouchEvent>()); + EventHandler().HandlePointerEvent( + CreateTestPointerEvent(WebInputEvent::kPointerDown, + WebPointerProperties::PointerType::kPen), + Vector<WebPointerEvent>()); - WebMouseEvent mouse_down_event( - WebInputEvent::kMouseDown, WebFloatPoint(100, 100), - WebFloatPoint(100, 100), WebPointerProperties::Button::kLeft, 0, 0, 0); - mouse_down_event.SetFrameScale(1); - EventHandler().HandleMousePressEvent(mouse_down_event); + EventHandler().HandleMousePressEvent( + CreateTestMouseEvent(WebInputEvent::kMouseDown, WebFloatPoint(100, 100))); ASSERT_EQ(callback->mouseEventCount(), 0); ASSERT_EQ(callback->touchEventCount(), 0); ASSERT_EQ(callback->penEventCount(), 0); - point.pointer_type = WebPointerProperties::PointerType::kPen; - event.touches[0] = point; - event.SetType(WebInputEvent::kTouchScrollStarted); - EventHandler().HandleTouchEvent(event, Vector<WebTouchEvent>()); + EventHandler().HandlePointerEvent( + CreateTestPointerEvent(WebInputEvent::kPointerCausedUaAction, + WebPointerProperties::PointerType::kPen), + Vector<WebPointerEvent>()); ASSERT_EQ(callback->mouseEventCount(), 0); ASSERT_EQ(callback->touchEventCount(), 1); ASSERT_EQ(callback->penEventCount(), 1); - point.pointer_type = WebPointerProperties::PointerType::kTouch; - event.touches[0] = point; - event.SetType(WebInputEvent::kTouchScrollStarted); - EventHandler().HandleTouchEvent(event, Vector<WebTouchEvent>()); + EventHandler().HandlePointerEvent( + CreateTestPointerEvent(WebInputEvent::kPointerCausedUaAction, + WebPointerProperties::PointerType::kTouch), + Vector<WebPointerEvent>()); ASSERT_EQ(callback->mouseEventCount(), 0); ASSERT_EQ(callback->touchEventCount(), 1); ASSERT_EQ(callback->penEventCount(), 1); - WebMouseEvent mouse_move_event( - WebInputEvent::kMouseMove, WebFloatPoint(200, 200), - WebFloatPoint(200, 200), WebPointerProperties::Button::kLeft, 0, 0, 0); - mouse_move_event.SetFrameScale(1); - EventHandler().HandleMouseMoveEvent(mouse_move_event, - Vector<WebMouseEvent>()); + EventHandler().HandleMouseMoveEvent( + CreateTestMouseEvent(WebInputEvent::kMouseMove, WebFloatPoint(200, 200)), + Vector<WebMouseEvent>()); ASSERT_EQ(callback->mouseEventCount(), 1); ASSERT_EQ(callback->touchEventCount(), 1);
diff --git a/third_party/WebKit/Source/core/input/ScrollManager.cpp b/third_party/WebKit/Source/core/input/ScrollManager.cpp index 389824a..05af8f9 100644 --- a/third_party/WebKit/Source/core/input/ScrollManager.cpp +++ b/third_party/WebKit/Source/core/input/ScrollManager.cpp
@@ -131,8 +131,15 @@ cur_element == document_element) break; - if (!CanPropagate(scroll_state, *cur_element)) + if (!CanPropagate(scroll_state, *cur_element)) { + // We should add the first node with non-auto overscroll-behavior to + // the scroll chain regardlessly, as it's the only node we can latch to. + if (scroll_chain.empty() || + scroll_chain.front() != (int)DOMNodeIds::IdForNode(cur_element)) { + scroll_chain.push_front(DOMNodeIds::IdForNode(cur_element)); + } break; + } } cur_box = cur_box->ContainingBlock();
diff --git a/third_party/WebKit/Source/core/input/TouchEventManagerTest.cpp b/third_party/WebKit/Source/core/input/TouchEventManagerTest.cpp index 13dd2c1..b0d4644 100644 --- a/third_party/WebKit/Source/core/input/TouchEventManagerTest.cpp +++ b/third_party/WebKit/Source/core/input/TouchEventManagerTest.cpp
@@ -20,6 +20,17 @@ EventHandler& EventHandler() { return GetDocument().GetFrame()->GetEventHandler(); } + + WebPointerEvent CreateTouchPointerEvent(WebInputEvent::Type type) { + WebPointerEvent event( + type, + WebPointerProperties(1, WebPointerProperties::PointerType::kTouch, + WebPointerProperties::Button::kLeft, + WebFloatPoint(100, 100), WebFloatPoint(100, 100)), + 1, 1); + event.SetFrameScale(1); + return event; + } }; class CheckEventListenerCallback final : public EventListener { @@ -57,24 +68,22 @@ CheckEventListenerCallback* callback = CheckEventListenerCallback::Create(); GetDocument().body()->addEventListener(EventTypeNames::touchstart, callback); - WebTouchEvent event; - event.SetFrameScale(1); - WebTouchPoint point( - WebPointerProperties(1, WebPointerProperties::PointerType::kTouch, - WebPointerProperties::Button::kLeft, - WebFloatPoint(100, 100), WebFloatPoint(100, 100))); - - point.state = WebTouchPoint::State::kStatePressed; - event.touches[event.touches_length++] = point; - EventHandler().HandleTouchEvent(event, Vector<WebTouchEvent>()); + EventHandler().HandlePointerEvent( + CreateTouchPointerEvent(WebInputEvent::kPointerDown), + Vector<WebPointerEvent>()); + EventHandler().DispatchBufferedTouchEvents(); GetDocument().getElementById("target")->remove(); - event.touches[0].state = WebTouchPoint::State::kStateReleased; - EventHandler().HandleTouchEvent(event, Vector<WebTouchEvent>()); + EventHandler().HandlePointerEvent( + CreateTouchPointerEvent(WebInputEvent::kPointerUp), + Vector<WebPointerEvent>()); + EventHandler().DispatchBufferedTouchEvents(); - event.touches[0].state = WebTouchPoint::State::kStatePressed; - EventHandler().HandleTouchEvent(event, Vector<WebTouchEvent>()); + EventHandler().HandlePointerEvent( + CreateTouchPointerEvent(WebInputEvent::kPointerDown), + Vector<WebPointerEvent>()); + EventHandler().DispatchBufferedTouchEvents(); ASSERT_TRUE(callback->HasReceivedEvent()); }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp index fd2bb0c..17c19b8 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -80,12 +80,14 @@ static const char kEnabled[] = "enabled"; } -static void CollectEventListeners(v8::Isolate* isolate, - EventTarget* target, - v8::Local<v8::Value> target_wrapper, - Node* target_node, - bool report_for_all_contexts, - V8EventListenerInfoList* event_information) { +// static +void InspectorDOMDebuggerAgent::CollectEventListeners( + v8::Isolate* isolate, + EventTarget* target, + v8::Local<v8::Value> target_wrapper, + Node* target_node, + bool report_for_all_contexts, + V8EventListenerInfoList* event_information) { if (!target->GetExecutionContext()) return; @@ -274,11 +276,12 @@ return Response::Error("Event name is empty"); protocol::DictionaryValue* breakpoints_by_target = EnsurePropertyObject(EventListenerBreakpoints(), event_name); - if (target_name.IsEmpty()) + if (target_name.IsEmpty()) { breakpoints_by_target->setBoolean(DOMDebuggerAgentState::kEventTargetAny, true); - else + } else { breakpoints_by_target->setBoolean(target_name.DeprecatedLower(), true); + } DidAddBreakpoint(); return Response::OK(); } @@ -445,29 +448,42 @@ return Response::Error(ToCoreString(std::move(error))); } v8::Context::Scope scope(context); - *listeners_array = - protocol::Array<protocol::DOMDebugger::EventListener>::create(); V8EventListenerInfoList event_information; InspectorDOMDebuggerAgent::EventListenersInfoForTarget( context->GetIsolate(), object, depth.fromMaybe(1), pierce.fromMaybe(false), &event_information); + *listeners_array = BuildObjectsForEventListeners(event_information, context, + object_group->string()); + return Response::OK(); +} + +std::unique_ptr<protocol::Array<protocol::DOMDebugger::EventListener>> +InspectorDOMDebuggerAgent::BuildObjectsForEventListeners( + const V8EventListenerInfoList& event_information, + v8::Local<v8::Context> context, + const v8_inspector::StringView& object_group_id) { + std::unique_ptr<protocol::Array<protocol::DOMDebugger::EventListener>> + listeners_array = + protocol::Array<protocol::DOMDebugger::EventListener>::create(); + // Make sure listeners with |use_capture| true come first because they have + // precedence. for (const auto& info : event_information) { if (!info.use_capture) continue; std::unique_ptr<protocol::DOMDebugger::EventListener> listener_object = - BuildObjectForEventListener(context, info, object_group->string()); + BuildObjectForEventListener(context, info, object_group_id); if (listener_object) - (*listeners_array)->addItem(std::move(listener_object)); + listeners_array->addItem(std::move(listener_object)); } for (const auto& info : event_information) { if (info.use_capture) continue; std::unique_ptr<protocol::DOMDebugger::EventListener> listener_object = - BuildObjectForEventListener(context, info, object_group->string()); + BuildObjectForEventListener(context, info, object_group_id); if (listener_object) - (*listeners_array)->addItem(std::move(listener_object)); + listeners_array->addItem(std::move(listener_object)); } - return Response::OK(); + return listeners_array; } std::unique_ptr<protocol::DOMDebugger::EventListener>
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h index 9474adf..53e8e9c 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.h
@@ -115,6 +115,19 @@ void Restore() override; void DidCommitLoadForLocalFrame(LocalFrame*) override; + static void CollectEventListeners(v8::Isolate*, + EventTarget*, + v8::Local<v8::Value> target_wrapper, + Node* target_node, + bool report_for_all_contexts, + V8EventListenerInfoList* event_information); + + std::unique_ptr<protocol::Array<protocol::DOMDebugger::EventListener>> + BuildObjectsForEventListeners( + const V8EventListenerInfoList&, + v8::Local<v8::Context>, + const v8_inspector::StringView& object_group_id); + private: static void EventListenersInfoForTarget(v8::Isolate*, v8::Local<v8::Value>,
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp index cbbbc6d3..e4e5d0df 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp
@@ -4,6 +4,8 @@ #include "core/inspector/InspectorDOMSnapshotAgent.h" +#include "bindings/core/v8/ScriptEventListener.h" +#include "bindings/core/v8/V8BindingForCore.h" #include "core/css/CSSComputedStyleDeclaration.h" #include "core/dom/Attribute.h" #include "core/dom/AttributeCollection.h" @@ -25,6 +27,7 @@ #include "core/inspector/IdentifiersFactory.h" #include "core/inspector/InspectedFrames.h" #include "core/inspector/InspectorDOMAgent.h" +#include "core/inspector/InspectorDOMDebuggerAgent.h" #include "core/layout/LayoutObject.h" #include "core/layout/LayoutText.h" #include "core/layout/line/InlineTextBox.h" @@ -85,13 +88,16 @@ }; InspectorDOMSnapshotAgent::InspectorDOMSnapshotAgent( - InspectedFrames* inspected_frames) - : inspected_frames_(inspected_frames) {} + InspectedFrames* inspected_frames, + InspectorDOMDebuggerAgent* dom_debugger_agent) + : inspected_frames_(inspected_frames), + dom_debugger_agent_(dom_debugger_agent) {} InspectorDOMSnapshotAgent::~InspectorDOMSnapshotAgent() {} Response InspectorDOMSnapshotAgent::getSnapshot( std::unique_ptr<protocol::Array<String>> style_whitelist, + protocol::Maybe<bool> get_dom_listeners, std::unique_ptr<protocol::Array<protocol::DOMSnapshot::DOMNode>>* dom_nodes, std::unique_ptr<protocol::Array<protocol::DOMSnapshot::LayoutTreeNode>>* layout_tree_nodes, @@ -122,7 +128,7 @@ } // Actual traversal. - VisitNode(document); + VisitNode(document, get_dom_listeners.fromMaybe(false)); // Extract results from state and reset. *dom_nodes = std::move(dom_nodes_); @@ -133,7 +139,8 @@ return Response::OK(); } -int InspectorDOMSnapshotAgent::VisitNode(Node* node) { +int InspectorDOMSnapshotAgent::VisitNode(Node* node, + bool include_event_listeners) { if (node->IsDocumentNode()) { // Update layout tree before traversal of document so that we inspect a // current and consistent state of all trees. @@ -172,6 +179,24 @@ if (node->WillRespondToMouseClickEvents()) value->setIsClickable(true); + if (include_event_listeners && node->GetDocument().GetFrame()) { + ScriptState* script_state = + ToScriptStateForMainWorld(node->GetDocument().GetFrame()); + if (script_state->ContextIsValid()) { + ScriptState::Scope scope(script_state); + v8::Local<v8::Context> context = script_state->GetContext(); + V8EventListenerInfoList event_information; + InspectorDOMDebuggerAgent::CollectEventListeners( + script_state->GetIsolate(), node, v8::Local<v8::Value>(), node, true, + &event_information); + if (!event_information.IsEmpty()) { + value->setEventListeners( + dom_debugger_agent_->BuildObjectsForEventListeners( + event_information, context, v8_inspector::StringView())); + } + } + } + if (node->IsElementNode()) { Element* element = ToElement(node); value->setAttributes(BuildArrayForElementAttributes(element)); @@ -186,7 +211,7 @@ value->setFrameId(IdentifiersFactory::FrameId(frame)); } if (Document* doc = frame_owner->contentDocument()) { - value->setContentDocumentIndex(VisitNode(doc)); + value->setContentDocumentIndex(VisitNode(doc, include_event_listeners)); } } @@ -200,12 +225,15 @@ if (link_element->IsImport() && link_element->import() && InspectorDOMAgent::InnerParentNode(link_element->import()) == link_element) { - value->setImportedDocumentIndex(VisitNode(link_element->import())); + value->setImportedDocumentIndex( + VisitNode(link_element->import(), include_event_listeners)); } } - if (auto* template_element = ToHTMLTemplateElementOrNull(*element)) - value->setTemplateContentIndex(VisitNode(template_element->content())); + if (auto* template_element = ToHTMLTemplateElementOrNull(*element)) { + value->setTemplateContentIndex( + VisitNode(template_element->content(), include_event_listeners)); + } if (auto* textarea_element = ToHTMLTextAreaElementOrNull(*element)) value->setTextValue(textarea_element->value()); @@ -228,7 +256,8 @@ value->setPseudoType(pseudo_type); } } else { - value->setPseudoElementIndexes(VisitPseudoElements(element)); + value->setPseudoElementIndexes( + VisitPseudoElements(element, include_event_listeners)); } } else if (node->IsDocumentNode()) { Document* document = ToDocument(node); @@ -245,14 +274,17 @@ value->setSystemId(doc_type->systemId()); } - if (node->IsContainerNode()) - value->setChildNodeIndexes(VisitContainerChildren(node)); - + if (node->IsContainerNode()) { + value->setChildNodeIndexes( + VisitContainerChildren(node, include_event_listeners)); + } return index; } std::unique_ptr<protocol::Array<int>> -InspectorDOMSnapshotAgent::VisitContainerChildren(Node* container) { +InspectorDOMSnapshotAgent::VisitContainerChildren( + Node* container, + bool include_event_listeners) { auto children = protocol::Array<int>::create(); if (!FlatTreeTraversal::HasChildren(*container)) @@ -260,7 +292,7 @@ Node* child = FlatTreeTraversal::FirstChild(*container); while (child) { - children->addItem(VisitNode(child)); + children->addItem(VisitNode(child, include_event_listeners)); child = FlatTreeTraversal::NextSibling(*child); } @@ -268,7 +300,8 @@ } std::unique_ptr<protocol::Array<int>> -InspectorDOMSnapshotAgent::VisitPseudoElements(Element* parent) { +InspectorDOMSnapshotAgent::VisitPseudoElements(Element* parent, + bool include_event_listeners) { if (!parent->GetPseudoElement(kPseudoIdBefore) && !parent->GetPseudoElement(kPseudoIdAfter)) { return nullptr; @@ -277,12 +310,12 @@ auto pseudo_elements = protocol::Array<int>::create(); if (parent->GetPseudoElement(kPseudoIdBefore)) { - pseudo_elements->addItem( - VisitNode(parent->GetPseudoElement(kPseudoIdBefore))); + pseudo_elements->addItem(VisitNode( + parent->GetPseudoElement(kPseudoIdBefore), include_event_listeners)); } if (parent->GetPseudoElement(kPseudoIdAfter)) { - pseudo_elements->addItem( - VisitNode(parent->GetPseudoElement(kPseudoIdAfter))); + pseudo_elements->addItem(VisitNode(parent->GetPseudoElement(kPseudoIdAfter), + include_event_listeners)); } return pseudo_elements; @@ -393,6 +426,7 @@ void InspectorDOMSnapshotAgent::Trace(blink::Visitor* visitor) { visitor->Trace(inspected_frames_); + visitor->Trace(dom_debugger_agent_); InspectorBaseAgent::Trace(visitor); }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h index 2f4b116..9a4ec60 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.h
@@ -21,8 +21,10 @@ class CORE_EXPORT InspectorDOMSnapshotAgent final : public InspectorBaseAgent<protocol::DOMSnapshot::Metainfo> { public: - static InspectorDOMSnapshotAgent* Create(InspectedFrames* inspected_frames) { - return new InspectorDOMSnapshotAgent(inspected_frames); + static InspectorDOMSnapshotAgent* Create( + InspectedFrames* inspected_frames, + InspectorDOMDebuggerAgent* dom_debugger_agent) { + return new InspectorDOMSnapshotAgent(inspected_frames, dom_debugger_agent); } ~InspectorDOMSnapshotAgent() override; @@ -30,6 +32,7 @@ protocol::Response getSnapshot( std::unique_ptr<protocol::Array<String>> style_whitelist, + protocol::Maybe<bool> get_dom_listeners, std::unique_ptr<protocol::Array<protocol::DOMSnapshot::DOMNode>>* dom_nodes, std::unique_ptr<protocol::Array<protocol::DOMSnapshot::LayoutTreeNode>>* @@ -38,12 +41,16 @@ computed_styles) override; private: - explicit InspectorDOMSnapshotAgent(InspectedFrames*); + InspectorDOMSnapshotAgent(InspectedFrames*, InspectorDOMDebuggerAgent*); // Adds a DOMNode for the given Node to |dom_nodes_| and returns its index. - int VisitNode(Node*); - std::unique_ptr<protocol::Array<int>> VisitContainerChildren(Node* container); - std::unique_ptr<protocol::Array<int>> VisitPseudoElements(Element* parent); + int VisitNode(Node*, bool include_event_listeners); + std::unique_ptr<protocol::Array<int>> VisitContainerChildren( + Node* container, + bool include_event_listeners); + std::unique_ptr<protocol::Array<int>> VisitPseudoElements( + Element* parent, + bool include_event_listeners); std::unique_ptr<protocol::Array<protocol::DOMSnapshot::NameValue>> BuildArrayForElementAttributes(Element*); @@ -78,6 +85,7 @@ css_property_whitelist_; Member<InspectedFrames> inspected_frames_; + Member<InspectorDOMDebuggerAgent> dom_debugger_agent_; DISALLOW_COPY_AND_ASSIGN(InspectorDOMSnapshotAgent); };
diff --git a/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp index b481653..b7886e08 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp
@@ -122,11 +122,9 @@ } Node* HoveredNodeForEvent(LocalFrame* frame, - const WebTouchEvent& event, + const WebPointerEvent& event, bool ignore_pointer_events_none) { - if (!event.touches_length) - return nullptr; - WebTouchPoint transformed_point = event.TouchPointInRootFrame(0); + WebPointerEvent transformed_point = event.WebPointerEventInRootFrame(); return HoveredNodeForPoint( frame, RoundedIntPoint(transformed_point.PositionInWidget()), ignore_pointer_events_none); @@ -533,6 +531,12 @@ OverlayMainFrame()->View()->UpdateAllLifecyclePhases(); } +void InspectorOverlayAgent::DispatchBufferedTouchEvents() { + if (IsEmpty()) + return; + OverlayMainFrame()->GetEventHandler().DispatchBufferedTouchEvents(); +} + bool InspectorOverlayAgent::HandleInputEvent(const WebInputEvent& input_event) { bool handled = false; @@ -582,15 +586,15 @@ } } - if (WebInputEvent::IsTouchEventType(input_event.GetType())) { - WebTouchEvent transformed_event = - TransformWebTouchEvent(frame_impl_->GetFrameView(), - static_cast<const WebTouchEvent&>(input_event)); - handled = HandleTouchEvent(transformed_event); + if (WebInputEvent::IsPointerEventType(input_event.GetType())) { + WebPointerEvent transformed_event = TransformWebPointerEvent( + frame_impl_->GetFrameView(), + static_cast<const WebPointerEvent&>(input_event)); + handled = HandlePointerEvent(transformed_event); if (handled) return true; - OverlayMainFrame()->GetEventHandler().HandleTouchEvent( - transformed_event, Vector<WebTouchEvent>()); + OverlayMainFrame()->GetEventHandler().HandlePointerEvent( + transformed_event, Vector<WebPointerEvent>()); } if (WebInputEvent::IsKeyboardEventType(input_event.GetType())) { OverlayMainFrame()->GetEventHandler().KeyEvent( @@ -1129,7 +1133,7 @@ return false; } -bool InspectorOverlayAgent::HandleTouchEvent(const WebTouchEvent& event) { +bool InspectorOverlayAgent::HandlePointerEvent(const WebPointerEvent& event) { if (!ShouldSearchForNode()) return false; Node* node = HoveredNodeForEvent(frame_impl_->GetFrame(), event, false);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.h b/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.h index 44e284c..9c28a61 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.h +++ b/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.h
@@ -59,7 +59,7 @@ class WebGestureEvent; class WebMouseEvent; class WebLocalFrameImpl; -class WebTouchEvent; +class WebPointerEvent; class CORE_EXPORT InspectorOverlayAgent final : public InspectorBaseAgent<protocol::Overlay::Metainfo>, @@ -118,6 +118,7 @@ void Dispose() override; void Inspect(Node*); + void DispatchBufferedTouchEvents(); bool HandleInputEvent(const WebInputEvent&); void PageLayoutInvalidated(bool resized); void ShowReloadingBlanket(); @@ -167,7 +168,7 @@ bool HandleMouseDown(const WebMouseEvent&); bool HandleMouseUp(const WebMouseEvent&); bool HandleGestureEvent(const WebGestureEvent&); - bool HandleTouchEvent(const WebTouchEvent&); + bool HandlePointerEvent(const WebPointerEvent&); bool HandleMouseMove(const WebMouseEvent&); protocol::Response CompositingEnabled();
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp index 4206b46..e220a06d 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp +++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -241,6 +241,7 @@ DEFINE_STRING_MAPPING(PseudoLink) DEFINE_STRING_MAPPING(PseudoVisited) DEFINE_STRING_MAPPING(PseudoAny) + DEFINE_STRING_MAPPING(PseudoMatches) DEFINE_STRING_MAPPING(PseudoWebkitAnyLink) DEFINE_STRING_MAPPING(PseudoAnyLink) DEFINE_STRING_MAPPING(PseudoAutofill) @@ -1314,9 +1315,9 @@ return value; } -std::unique_ptr<TracedValue> InspectorAsyncTask::Data(const String& name) { +std::unique_ptr<TracedValue> InspectorAsyncTask::Data(const StringView& name) { std::unique_ptr<TracedValue> value = TracedValue::Create(); - value->SetString("name", name); + value->SetString("name", name.ToString()); return value; }
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h index 8efa73b6..11b31a1 100644 --- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h +++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.h
@@ -473,7 +473,7 @@ } namespace InspectorAsyncTask { -std::unique_ptr<TracedValue> Data(const String&); +std::unique_ptr<TracedValue> Data(const StringView&); } CORE_EXPORT String ToHexString(const void* p);
diff --git a/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp b/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp index 988289b..ba27dcb 100644 --- a/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp +++ b/third_party/WebKit/Source/core/inspector/ThreadDebugger.cpp
@@ -80,7 +80,7 @@ debugger->GetV8Inspector()->idleFinished(); } -void ThreadDebugger::AsyncTaskScheduled(const String& operation_name, +void ThreadDebugger::AsyncTaskScheduled(const StringView& operation_name, void* task, bool recurring) { DCHECK_EQ(reinterpret_cast<intptr_t>(task) % 2, 0);
diff --git a/third_party/WebKit/Source/core/inspector/ThreadDebugger.h b/third_party/WebKit/Source/core/inspector/ThreadDebugger.h index a9e0118..b48da431 100644 --- a/third_party/WebKit/Source/core/inspector/ThreadDebugger.h +++ b/third_party/WebKit/Source/core/inspector/ThreadDebugger.h
@@ -38,7 +38,9 @@ static void IdleStarted(v8::Isolate*); static void IdleFinished(v8::Isolate*); - void AsyncTaskScheduled(const String& task_name, void* task, bool recurring); + void AsyncTaskScheduled(const StringView& task_name, + void* task, + bool recurring); void AsyncTaskCanceled(void* task); void AllAsyncTasksCanceled(); void AsyncTaskStarted(void* task);
diff --git a/third_party/WebKit/Source/core/inspector/browser_protocol.json b/third_party/WebKit/Source/core/inspector/browser_protocol.json index 7022175..974781c 100644 --- a/third_party/WebKit/Source/core/inspector/browser_protocol.json +++ b/third_party/WebKit/Source/core/inspector/browser_protocol.json
@@ -4063,6 +4063,7 @@ "dependencies": [ "CSS", "DOM", + "DOMDebugger", "Page" ], "types": [ @@ -4219,6 +4220,15 @@ "description": "Whether this DOM node responds to mouse clicks. This includes nodes that have had click\nevent listeners attached via JavaScript as well as anchor tags that naturally navigate when\nclicked.", "optional": true, "type": "boolean" + }, + { + "name": "eventListeners", + "description": "Details of the node's event listeners, if any.", + "optional": true, + "type": "array", + "items": { + "$ref": "DOMDebugger.EventListener" + } } ] }, @@ -4327,6 +4337,12 @@ "items": { "type": "string" } + }, + { + "name": "includeEventListeners", + "description": "Whether or not to retrieve details of DOM listeners (default false).", + "optional": true, + "type": "boolean" } ], "returns": [
diff --git a/third_party/WebKit/Source/core/inspector/browser_protocol.pdl b/third_party/WebKit/Source/core/inspector/browser_protocol.pdl index 9723adb..aadbc02 100644 --- a/third_party/WebKit/Source/core/inspector/browser_protocol.pdl +++ b/third_party/WebKit/Source/core/inspector/browser_protocol.pdl
@@ -1875,6 +1875,7 @@ experimental domain DOMSnapshot depends on CSS depends on DOM + depends on DOMDebugger depends on Page # A Node in the DOM tree. @@ -1936,6 +1937,8 @@ # event listeners attached via JavaScript as well as anchor tags that naturally navigate when # clicked. optional boolean isClickable + # Details of the node's event listeners, if any. + optional array of DOMDebugger.EventListener eventListeners # Details of post layout rendered text positions. The exact layout should not be regarded as # stable and may change between versions. @@ -1984,6 +1987,8 @@ parameters # Whitelist of computed styles to return. array of string computedStyleWhitelist + # Whether or not to retrieve details of DOM listeners (default false). + optional boolean includeEventListeners returns # The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document. array of DOMNode domNodes
diff --git a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp index a18bc34f..2122628 100644 --- a/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp +++ b/third_party/WebKit/Source/core/layout/GridTrackSizingAlgorithm.cpp
@@ -661,6 +661,8 @@ if (!AvailableSpace(direction) || (direction == kForRows && !layout_grid_->CachedHasDefiniteLogicalHeight())) { + UseCounter::Count(layout_grid_->GetDocument(), + WebFeature::kGridRowTrackPercentIndefiniteHeight); if (min_track_breadth.HasPercentage()) min_track_breadth = Length(kAuto); if (max_track_breadth.HasPercentage()) @@ -740,14 +742,6 @@ flexible_sized_tracks_index_.push_back(i); if (track_size.HasAutoMaxTrackBreadth() && !track_size.IsFitContent()) auto_sized_tracks_for_stretch_index_.push_back(i); - - if (direction_ == kForRows && - !layout_grid_->CachedHasDefiniteLogicalHeight() && - (track_size.MinTrackBreadth().HasPercentage() || - track_size.MaxTrackBreadth().HasPercentage())) { - UseCounter::Count(layout_grid_->GetDocument(), - WebFeature::kGridRowTrackPercentIndefiniteHeight); - } } }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp index 940405d0..406b1f6 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -1409,7 +1409,10 @@ if (full_remove_insert && IsLayoutBlock() && child->IsBox()) ToLayoutBox(child)->RemoveFromPercentHeightContainer(); - if (full_remove_insert) { + if (full_remove_insert && (to_box_model_object->IsLayoutBlock() || + to_box_model_object->IsLayoutInline())) { + // Takes care of adding the new child correctly if toBlock and fromBlock + // have different kind of children (block vs inline). to_box_model_object->AddChild( VirtualChildren()->RemoveChildNode(this, child), before_child); } else { @@ -1470,57 +1473,4 @@ return true; } -void LayoutBoxModelObject::MoveNonAnonymousTableDescendantsTo( - LayoutBoxModelObject* to_box_model_object) { - LayoutObject* child = SlowFirstChild(); - DCHECK(IsAnonymous()); - // Append non-anonymous descendants' sub-trees of one anonymous table part to - // another. We walk down past anonymous descendants to make sure existing - // anonymous table part chains in to_box_model_object are used. - while (child) { - LayoutObject* next_child = child->NextSibling(); - if (child->IsAnonymous() && child->IsTablePart()) { - ToLayoutBoxModelObject(child)->MoveNonAnonymousTableDescendantsTo( - to_box_model_object); - child->Destroy(); - } else { - MoveChildTo(to_box_model_object, child, true); - // If we move a subtree rooted at a table section or row, we need to mark - // the section for cell recalc in case there is a cell descendant. - // Normally, boxes in a subtree will be added one by one, and AddChild in - // LayoutTableRow will make sure cells are added with AddCell or the table - // section marked for cell recalc. Since the cell is just moved along with - // its subtree here, we need to mark the section for recalc. - if (child->IsTableSection()) - ToLayoutTableSection(child)->SetNeedsCellRecalc(); - else if (child->IsTableRow()) - ToLayoutTableRow(child)->Section()->SetNeedsCellRecalc(); - } - child = next_child; - } -} - -void LayoutBoxModelObject::MergeAnonymousTablePartsIfNeeded( - LayoutBoxModelObject* prev, - LayoutBoxModelObject* next) { - if (!prev || !next || !prev->IsAnonymous() || !next->IsAnonymous()) - return; - DCHECK(prev->IsInline() == next->IsInline()); - next->MoveNonAnonymousTableDescendantsTo(prev); - next->Destroy(); -} - -void LayoutBoxModelObject::RemoveChild(LayoutObject* old_child) { - LayoutObject* prev = old_child->PreviousSibling(); - LayoutObject* next = old_child->NextSibling(); - - LayoutObject::RemoveChild(old_child); - - if (DocumentBeingDestroyed()) - return; - - if (prev && next && prev->IsTable() && next->IsTable()) - MergeAnonymousTablePartsIfNeeded(ToLayoutTable(prev), ToLayoutTable(next)); -} - } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h index a7992f80..f439e1e5 100644 --- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h +++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h
@@ -435,8 +435,6 @@ void AbsoluteQuads(Vector<FloatQuad>& quads, MapCoordinatesFlags mode = 0) const override; - void RemoveChild(LayoutObject*) override; - protected: // Compute absolute quads for |this|, but not any continuations. May only be // called for objects which can be or have continuations, i.e. LayoutInline or @@ -496,9 +494,6 @@ void InvalidateStickyConstraints(); - void MergeAnonymousTablePartsIfNeeded(LayoutBoxModelObject* prev, - LayoutBoxModelObject* next); - public: // These functions are only used internally to manipulate the layout tree // structure via remove/insert/appendChildNode. @@ -571,8 +566,6 @@ &LayoutBoxModelObject::BorderTop, &LayoutBoxModelObject::BorderRight, &LayoutBoxModelObject::BorderBottom, &LayoutBoxModelObject::BorderLeft); } - - void MoveNonAnonymousTableDescendantsTo(LayoutBoxModelObject*); }; DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutBoxModelObject, IsBoxModelObject());
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp index b62be73..eeb9575d 100644 --- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -429,6 +429,10 @@ } bool LayoutObject::HasClipRelatedProperty() const { + // TODO(trchen): CSS clip-path is really a stacking context effect instead + // of a clip. A bunch of call sites, e.g. CompositingRequirementsUpdater rely + // on returning false positives here to work properly. We should fix those + // call sites and remove HasClipPath() here. if (HasClip() || HasOverflowClip() || HasClipPath() || Style()->ContainsPaint()) return true;
diff --git a/third_party/WebKit/Source/core/layout/LayoutQuote.cpp b/third_party/WebKit/Source/core/layout/LayoutQuote.cpp index bf5bfc7d..57c0fa57 100644 --- a/third_party/WebKit/Source/core/layout/LayoutQuote.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutQuote.cpp
@@ -289,12 +289,12 @@ String LayoutQuote::ComputeText() const { switch (type_) { - case NO_OPEN_QUOTE: - case NO_CLOSE_QUOTE: + case QuoteType::kNoOpen: + case QuoteType::kNoClose: return g_empty_string; - case CLOSE_QUOTE: + case QuoteType::kClose: return GetQuotesData()->GetCloseQuote(depth_ - 1).Impl(); - case OPEN_QUOTE: + case QuoteType::kOpen: return GetQuotesData()->GetOpenQuote(depth_).Impl(); } NOTREACHED(); @@ -388,12 +388,12 @@ if (previous_) { depth_ = previous_->depth_; switch (previous_->type_) { - case OPEN_QUOTE: - case NO_OPEN_QUOTE: + case QuoteType::kOpen: + case QuoteType::kNoOpen: depth_++; break; - case CLOSE_QUOTE: - case NO_CLOSE_QUOTE: + case QuoteType::kClose: + case QuoteType::kNoClose: if (depth_) depth_--; break;
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp index 0564885..4e9364fa 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -233,18 +233,6 @@ section->AddChild(child); } -void LayoutTable::RemoveChild(LayoutObject* old_child) { - if (!DocumentBeingDestroyed()) { - LayoutObject* prev = old_child->PreviousSibling(); - LayoutObject* next = old_child->NextSibling(); - if (prev && next && prev->IsTableSection() && next->IsTableSection()) { - MergeAnonymousTablePartsIfNeeded(ToLayoutTableSection(prev), - ToLayoutTableSection(next)); - } - } - LayoutBlock::RemoveChild(old_child); -} - void LayoutTable::AddCaption(const LayoutTableCaption* caption) { DCHECK_EQ(captions_.Find(caption), kNotFound); captions_.push_back(const_cast<LayoutTableCaption*>(caption));
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.h b/third_party/WebKit/Source/core/layout/LayoutTable.h index 3825db6..e58b798 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.h +++ b/third_party/WebKit/Source/core/layout/LayoutTable.h
@@ -500,8 +500,6 @@ void SetIsAnyColumnEverCollapsed() { is_any_column_ever_collapsed_ = true; } - void RemoveChild(LayoutObject*) final; - // TODO(layout-dev): All mutables in this class are lazily updated by // recalcSections() which is called by various getter methods (e.g. // borderBefore(), borderAfter()).
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp index bba091c..a9abe265 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableRow.cpp
@@ -184,16 +184,6 @@ Section()->SetNeedsCellRecalc(); } -void LayoutTableRow::RemoveChild(LayoutObject* old_child) { - if (!DocumentBeingDestroyed()) { - LayoutTableCell* prev_cell = - ToLayoutTableCell(old_child->PreviousSibling()); - LayoutTableCell* next_cell = ToLayoutTableCell(old_child->NextSibling()); - MergeAnonymousTablePartsIfNeeded(prev_cell, next_cell); - } - LayoutTableBoxComponent::RemoveChild(old_child); -} - void LayoutTableRow::UpdateLayout() { DCHECK(NeedsLayout()); LayoutAnalyzer::Scope analyzer(*this);
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableRow.h b/third_party/WebKit/Source/core/layout/LayoutTableRow.h index 254781b..201e457a 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableRow.h +++ b/third_party/WebKit/Source/core/layout/LayoutTableRow.h
@@ -154,7 +154,6 @@ void NextSibling() const = delete; void PreviousSibling() const = delete; - void RemoveChild(LayoutObject*) final; // This field should never be read directly. It should be read through // rowIndex() above instead. This is to ensure that we never read this
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp index 0749d1e..2bab6b5 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.cpp
@@ -202,15 +202,6 @@ LayoutTableBoxComponent::AddChild(child, before_child); } -void LayoutTableSection::RemoveChild(LayoutObject* old_child) { - if (!DocumentBeingDestroyed()) { - MergeAnonymousTablePartsIfNeeded( - ToLayoutTableRow(old_child->PreviousSibling()), - ToLayoutTableRow(old_child->NextSibling())); - } - LayoutTableBoxComponent::RemoveChild(old_child); -} - static inline void CheckThatVectorIsDOMOrdered( const Vector<LayoutTableCell*, 1>& cells) { #ifndef NDEBUG
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableSection.h b/third_party/WebKit/Source/core/layout/LayoutTableSection.h index c02e90bc..02e68d1e 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableSection.h +++ b/third_party/WebKit/Source/core/layout/LayoutTableSection.h
@@ -303,8 +303,7 @@ return type == kLayoutObjectTableSection || LayoutBox::IsOfType(type); } - void WillBeRemovedFromTree() final; - void RemoveChild(LayoutObject*) final; + void WillBeRemovedFromTree() override; int BorderSpacingForRow(unsigned row) const { return grid_[row].row ? Table()->VBorderSpacing() : 0;
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp index cb4584cf..82dfc73 100644 --- a/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
@@ -4,9 +4,11 @@ #include "core/layout/ScrollAnchor.h" +#include "bindings/core/v8/V8BindingForCore.h" #include "core/css/CSSMarkup.h" #include "core/dom/ElementTraversal.h" #include "core/dom/NthIndexCache.h" +#include "core/dom/StaticNodeList.h" #include "core/frame/LocalFrameView.h" #include "core/frame/UseCounter.h" #include "core/layout/LayoutBlockFlow.h" @@ -213,22 +215,29 @@ String::Number(NthIndexCache::NthChildIndex(*element)) + ")"; } -// Computes a selector that uniquely identifies |anchor_element|. This is done +// Computes a selector that uniquely identifies |anchor_node|. This is done // by computing a selector that uniquely identifies each ancestor among its // sibling elements, terminating at a definitively unique ancestor. The // definitively unique ancestor is either the first ancestor with an id or // the root of the document. The computed selectors are chained together with // the child combinator(>) to produce a compound selector that is -// effectively a path through the DOM tree to |anchor_element|. -static const String ComputeUniqueSelector(Element* anchor_element) { - DCHECK(anchor_element); +// effectively a path through the DOM tree to |anchor_node|. +static const String ComputeUniqueSelector(Node* anchor_node) { + DCHECK(anchor_node); + // The scroll anchor can be a pseudo element, but pseudo elements aren't part + // of the DOM and can't be used as part of a selector. We fail in this case; + // success isn't possible. + if (anchor_node->IsPseudoElement()) { + return String(); + } + TRACE_EVENT0("blink", "ScrollAnchor::SerializeAnchor"); SCOPED_BLINK_UMA_HISTOGRAM_TIMER( "Layout.ScrollAnchor.TimeToComputeAnchorNodeSelector"); std::vector<String> selector_list; - for (Element* element = anchor_element; element; - element = ElementTraversal::FirstAncestor(*element->ToNode())) { + for (Element* element = ElementTraversal::FirstAncestorOrSelf(*anchor_node); + element; element = ElementTraversal::FirstAncestor(*element->ToNode())) { selector_list.push_back(UniqueSimpleSelectorAmongSiblings(element)); if (element->HasID() && !element->GetDocument().ContainsMultipleElementsWithId( @@ -459,7 +468,77 @@ } bool ScrollAnchor::RestoreAnchor(const SerializedAnchor& serialized_anchor) { - NOTIMPLEMENTED(); + if (!scroller_ || anchor_object_) { + return false; + } + + SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Layout.ScrollAnchor.TimeToRestoreAnchor"); + DEFINE_STATIC_LOCAL(EnumerationHistogram, restoration_status_histogram, + ("Layout.ScrollAnchor.RestorationStatus", kStatusCount)); + + Document* document = &(ScrollerLayoutBox(scroller_)->GetDocument()); + v8::Isolate* isolate = + ToScriptStateForMainWorld(document->GetFrame())->GetIsolate(); + ExceptionState exception_state(isolate, ExceptionState::kQueryContext, + "ScrollAnchor", "RestoreAnchor"); + StaticElementList* found_elements = document->QuerySelectorAll( + AtomicString(serialized_anchor.selector), exception_state); + + if (exception_state.HadException()) { + restoration_status_histogram.Count(kFailedBadSelector); + return false; + } + + if (found_elements->length() < 1) { + restoration_status_histogram.Count(kFailedNoMatches); + return false; + } + + for (unsigned index = 0; index < found_elements->length(); index++) { + Element* anchor_element = found_elements->item(index); + LayoutObject* anchor_object = anchor_element->ToNode()->GetLayoutObject(); + + if (!anchor_object) { + continue; + } + + // There are scenarios where the layout object we find is non-box and + // non-text; this can happen, e.g., if the original anchor object was a text + // element of a non-box element like <code>. The generated selector can't + // directly locate the text object, resulting in a loss of precision. + // Instead we scroll the object we do find into the same relative position + // and attempt to re-find the anchor. The user-visible effect should end up + // roughly the same. + ScrollOffset current_offset = scroller_->GetScrollOffset(); + FloatPoint desired_point = + anchor_object->AbsoluteBoundingBoxFloatRect().Location() + + current_offset; + ScrollOffset desired_offset = + ScrollOffset(desired_point.X(), desired_point.Y()); + ScrollOffset delta = + ScrollOffset(RoundedIntSize(serialized_anchor.relative_offset)); + desired_offset -= delta; + scroller_->SetScrollOffset(desired_offset, kAnchoringScroll); + FindAnchor(); + + // If the above FindAnchor call failed, reset the scroll position and try + // again with the next found element. + if (!anchor_object_) { + scroller_->SetScrollOffset(current_offset, kAnchoringScroll); + continue; + } + + corner_ = CornerToAnchor(scroller_); + saved_relative_offset_ = + ComputeRelativeOffset(anchor_object_, scroller_, corner_); + saved_selector_ = serialized_anchor.selector; + anchor_object_->SetIsScrollAnchorObject(); + + restoration_status_histogram.Count(kSuccess); + return true; + } + + restoration_status_histogram.Count(kFailedNoValidMatches); return false; } @@ -481,7 +560,7 @@ DCHECK(anchor_object_->GetNode()); SerializedAnchor new_anchor( - ComputeUniqueSelector(ToElement(anchor_object_->GetNode())), + ComputeUniqueSelector(anchor_object_->GetNode()), ComputeRelativeOffset(anchor_object_, scroller_, corner_)); if (new_anchor.IsValid()) { saved_selector_ = new_anchor.selector;
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchor.h b/third_party/WebKit/Source/core/layout/ScrollAnchor.h index 8899650b..fb67d91 100644 --- a/third_party/WebKit/Source/core/layout/ScrollAnchor.h +++ b/third_party/WebKit/Source/core/layout/ScrollAnchor.h
@@ -80,6 +80,16 @@ const uint64_t simhash; }; + // This enum must remain in sync with the corresponding enum in enums.xml. + enum RestorationStatus { + kSuccess = 0, + kFailedNoMatches, + kFailedNoValidMatches, + kFailedBadSelector, + kStatusCount // Special value used to count the number of enum values; not + // to be used as an actual status. Add new values above. + }; + // Attempt to restore |serialized_anchor| by scrolling to the element // identified by its selector, adjusting by its relative_offset. bool RestoreAnchor(const SerializedAnchor&);
diff --git a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp index 361ab0c..7bb0a652 100644 --- a/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp +++ b/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -4,6 +4,7 @@ #include "core/layout/ScrollAnchor.h" +#include "bindings/core/v8/V8BindingForTesting.h" #include "core/dom/StaticNodeList.h" #include "core/frame/VisualViewport.h" #include "core/geometry/DOMRect.h" @@ -98,6 +99,7 @@ <style> body { height: 1000px } div { height: 100px } </style> <div id='block1'>abc</div> <div id='block2'>def</div> + <script></script> )HTML"); ScrollableArea* viewport = LayoutViewport(); @@ -124,6 +126,35 @@ // 7 == "#block2".length() histogram_tester.ExpectUniqueSample( "Layout.ScrollAnchor.SerializedAnchorSelectorLength", 7, 1); + + // Clear the current anchor so that we can test restoration histograms. + // Restoration only proceeds if there isn't an existing anchor. + GetScrollAnchor(viewport).Clear(); + + V8TestingScope scope; + SerializedAnchor bad_anchor("##foobar", LayoutPoint(0, 0)); + EXPECT_FALSE(GetScrollAnchor(LayoutViewport()).RestoreAnchor(bad_anchor)); + histogram_tester.ExpectBucketCount("Layout.ScrollAnchor.RestorationStatus", + ScrollAnchor::kFailedBadSelector, 1); + + SerializedAnchor bad_anchor2("#bl", LayoutPoint(0, 0)); + EXPECT_FALSE(GetScrollAnchor(LayoutViewport()).RestoreAnchor(bad_anchor2)); + histogram_tester.ExpectBucketCount("Layout.ScrollAnchor.RestorationStatus", + ScrollAnchor::kFailedNoMatches, 1); + + SerializedAnchor bad_anchor3("script", LayoutPoint(0, -1000)); + EXPECT_FALSE(GetScrollAnchor(LayoutViewport()).RestoreAnchor(bad_anchor3)); + histogram_tester.ExpectBucketCount("Layout.ScrollAnchor.RestorationStatus", + ScrollAnchor::kFailedNoValidMatches, 1); + + SerializedAnchor serialized_anchor("#block1", LayoutPoint(0, 0)); + EXPECT_TRUE( + GetScrollAnchor(LayoutViewport()).RestoreAnchor(serialized_anchor)); + + histogram_tester.ExpectTotalCount("Layout.ScrollAnchor.TimeToRestoreAnchor", + 4); + histogram_tester.ExpectBucketCount("Layout.ScrollAnchor.RestorationStatus", + ScrollAnchor::kSuccess, 1); } // TODO(skobes): Convert this to web-platform-tests when visual viewport API is @@ -688,4 +719,123 @@ ValidateSerializedAnchor("html>body>:nth-child(3)>.barbaz", LayoutPoint(0, -50)); } + +TEST_P(ScrollAnchorTest, SerializeAnchorFailsForPseudoElement) { + SetBodyInnerHTML(R"HTML( + <style> + body { height: 1000px; margin: 0; } + div { height: 100px } + div:after { content: "foobar"; display: block; margin-top: 50px; } + </style> + <div>abc</div> + <div id='block1'>def</div>)HTML"); + + ScrollLayoutViewport(ScrollOffset(0, 50)); + EXPECT_FALSE(GetScrollAnchor(LayoutViewport()).AnchorObject()); +} + +TEST_P(ScrollAnchorTest, RestoreAnchorSimple) { + SetBodyInnerHTML( + "<style> body { height: 1000px; margin: 0; } div { height: 100px } " + "</style>" + "<div id='block1'>abc</div>" + "<div id='block2'>def</div>"); + + EXPECT_FALSE(GetScrollAnchor(LayoutViewport()).AnchorObject()); + + SerializedAnchor serialized_anchor("#block2", LayoutPoint(0, 0)); + + EXPECT_TRUE( + GetScrollAnchor(LayoutViewport()).RestoreAnchor(serialized_anchor)); + EXPECT_EQ(LayoutViewport()->ScrollOffsetInt().Height(), 100); + + SetHeight(GetDocument().getElementById("block1"), 200); + EXPECT_EQ(LayoutViewport()->ScrollOffsetInt().Height(), 200); + + SetHeight(GetDocument().getElementById("block1"), 50); + EXPECT_EQ(LayoutViewport()->ScrollOffsetInt().Height(), 50); +} + +TEST_P(ScrollAnchorTest, RestoreAnchorNonTrivialSelector) { + SetBodyInnerHTML(R"HTML( + <style> + body { height: 1000px; margin: 0; } + div.hundred { height: 100px; } + div.thousand { height: 1000px; } + </style> + <div id='block1' class='hundred'>abc</div> + <div id='ancestor' class='thousand'> + <div class='hundred'>abc</div> + <div class='hundred'>def</div> + <div class='hundred'> + <div class='hundred foobar'> + <div class='hundred'>ghi</div> + </div> + <div class='hundred barbaz'></div> + </div>)HTML"); + + SerializedAnchor serialized_anchor("#ancestor>:nth-child(3)>.foobar>div", + LayoutPoint(0, -50)); + + EXPECT_TRUE( + GetScrollAnchor(LayoutViewport()).RestoreAnchor(serialized_anchor)); + + EXPECT_EQ(LayoutViewport()->ScrollOffsetInt().Height(), 350); + + SetHeight(GetDocument().getElementById("block1"), 200); + EXPECT_EQ(LayoutViewport()->ScrollOffsetInt().Height(), 450); +} + +TEST_P(ScrollAnchorTest, RestoreAnchorFailsForInvalidSelectors) { + V8TestingScope scope; + SetBodyInnerHTML( + "<style> body { height: 1000px; margin: 0; } div { height: 100px } " + "</style>" + "<div id='block1'>abc</div>" + "<div id='block2'>def</div>"); + + EXPECT_FALSE(GetScrollAnchor(LayoutViewport()).AnchorObject()); + + SerializedAnchor serialized_anchor("article", LayoutPoint(0, 0)); + + EXPECT_FALSE( + GetScrollAnchor(LayoutViewport()).RestoreAnchor(serialized_anchor)); + + SerializedAnchor serialized_anchor_2("", LayoutPoint(0, 0)); + + EXPECT_FALSE( + GetScrollAnchor(LayoutViewport()).RestoreAnchor(serialized_anchor_2)); + + SerializedAnchor serialized_anchor_3("foobar", LayoutPoint(0, 0)); + + EXPECT_FALSE( + GetScrollAnchor(LayoutViewport()).RestoreAnchor(serialized_anchor_3)); +} + +// Ensure that when the serialized selector refers to a non-box, non-text +// element(meaning its corresponding LayoutObject can't be the anchor object) +// that restoration will still succeed. +TEST_P(ScrollAnchorTest, RestoreAnchorSucceedsForNonBoxNonTextElement) { + SetBodyInnerHTML( + "<style> body { height: 1000px; margin: 0; } div { height: 100px } " + "</style>" + "<div id='block1'>abc</div>" + "<code>some code</code>"); + + EXPECT_FALSE(GetScrollAnchor(LayoutViewport()).AnchorObject()); + + SerializedAnchor serialized_anchor("html>body>code", LayoutPoint(0, 0)); + + EXPECT_TRUE( + GetScrollAnchor(LayoutViewport()).RestoreAnchor(serialized_anchor)); + + EXPECT_EQ(LayoutViewport()->ScrollOffsetInt().Height(), 100); + + SetHeight(GetDocument().getElementById("block1"), 200); + EXPECT_EQ(LayoutViewport()->ScrollOffsetInt().Height(), 200); + + SerializedAnchor serialized = + GetScrollAnchor(LayoutViewport()).GetSerializedAnchor(); + ValidateSerializedAnchor("html>body>code", LayoutPoint(0, 0)); +} }
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_break_token.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_break_token.cc index 5576a52..512b43fa 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_break_token.cc +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_break_token.cc
@@ -10,11 +10,13 @@ NGInlineBreakToken::NGInlineBreakToken( NGInlineNode node, + const ComputedStyle* style, unsigned item_index, unsigned text_offset, bool is_forced_break, std::unique_ptr<const NGInlineLayoutStateStack> state_stack) : NGBreakToken(kInlineBreakToken, kUnfinished, node), + style_(style), item_index_(item_index), text_offset_(text_offset), is_forced_break_(is_forced_break),
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_break_token.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_break_token.h index 38d2535..e513a01 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_break_token.h +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_break_token.h
@@ -20,12 +20,13 @@ // Takes ownership of the state_stack. static scoped_refptr<NGInlineBreakToken> Create( NGInlineNode node, + const ComputedStyle* style, unsigned item_index, unsigned text_offset, bool is_forced_break, std::unique_ptr<const NGInlineLayoutStateStack> state_stack) { - return base::AdoptRef(new NGInlineBreakToken(node, item_index, text_offset, - is_forced_break, + return base::AdoptRef(new NGInlineBreakToken(node, style, item_index, + text_offset, is_forced_break, std::move(state_stack))); } @@ -36,6 +37,13 @@ ~NGInlineBreakToken() override; + // The style at the end of this break token. The next line should start with + // this style. + const ComputedStyle* Style() const { + DCHECK(!IsFinished()); + return style_.get(); + } + unsigned ItemIndex() const { DCHECK(!IsFinished()); return item_index_; @@ -71,6 +79,7 @@ private: NGInlineBreakToken(NGInlineNode node, + const ComputedStyle*, unsigned item_index, unsigned text_offset, bool is_forced_break, @@ -78,6 +87,7 @@ explicit NGInlineBreakToken(NGLayoutInputNode node); + scoped_refptr<const ComputedStyle> style_; unsigned item_index_; unsigned text_offset_; unsigned is_forced_break_ : 1;
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_fragment_traversal_test.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_fragment_traversal_test.cc index 6f8aa36..9f1f59d 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_fragment_traversal_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_fragment_traversal_test.cc
@@ -57,7 +57,8 @@ { \ const auto& current = *iter++; \ EXPECT_TRUE(current.fragment->IsText()) << current.fragment->ToString(); \ - EXPECT_EQ(content, ToNGPhysicalTextFragment(current.fragment)->Text()); \ + EXPECT_EQ(content, \ + ToNGPhysicalTextFragment(current.fragment.get())->Text()); \ } TEST_F(NGInlineFragmentTraversalTest, DescendantsOf) {
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h index f8c2286..c8d83a5 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_item_result.h
@@ -75,9 +75,13 @@ // Used only during line breaking. bool can_break_after = false; - // Has spaces that hangs beyond the end margin. - // Set only for text items. - bool has_hanging_spaces = false; + // True if this item contains only trailing spaces. + // Trailing spaces are measured differently that they are split from other + // text items. + // Used only when 'white-space: pre-wrap', because collapsible spaces are + // removed, and if 'pre', trailing spaces are not different from other + // characters. + bool has_only_trailing_spaces = false; // End effects for text items. // The effects are included in |shape_result|, but not in text content. @@ -144,11 +148,9 @@ LayoutUnit available_width, LayoutUnit width); - // Start/end text offset of this line. + // Start text offset of this line. unsigned StartOffset() const { return start_offset_; } - unsigned EndOffset() const { return end_offset_; } void SetStartOffset(unsigned offset) { start_offset_ = offset; } - void SetEndOffset(unsigned offset) { end_offset_ = offset; } // The base direction of this line for the bidi algorithm. TextDirection BaseDirection() const { return base_direction_; } @@ -176,7 +178,6 @@ LayoutUnit text_indent_; unsigned start_offset_; - unsigned end_offset_; TextDirection base_direction_ = TextDirection::kLtr;
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc index 2d2251d..e97751fd 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.cc
@@ -44,6 +44,35 @@ item_result.needs_box_when_empty; } +// Represents a data struct that are needed for 'text-align' and justifications. +struct NGLineAlign { + STACK_ALLOCATED(); + NGLineAlign(const NGLineInfo&); + NGLineAlign() = delete; + + LayoutUnit space; + unsigned end_offset; +}; + +NGLineAlign::NGLineAlign(const NGLineInfo& line_info) { + space = line_info.AvailableWidth() - line_info.Width(); + + // Eliminate trailing spaces from the alignment space. + const NGInlineItemResults& item_results = line_info.Results(); + for (auto it = item_results.rbegin(); it != item_results.rend(); ++it) { + const NGInlineItemResult& item_result = *it; + if (!item_result.has_only_trailing_spaces) { + end_offset = item_result.end_offset; + return; + } + space += item_result.inline_size; + } + + // An empty line, or only trailing spaces. + DCHECK_EQ(space, line_info.AvailableWidth()); + end_offset = line_info.StartOffset(); +} + } // namespace NGInlineLayoutAlgorithm::NGInlineLayoutAlgorithm( @@ -218,10 +247,11 @@ // Other 'text-align' values than 'justify' move line boxes as a whole, but // indivisual items do not change their relative position to the line box. - if (text_align != ETextAlign::kJustify) { - ApplyTextAlign(*line_info, text_align, &line_bfc_offset.line_offset, - inline_size); - } + if (text_align != ETextAlign::kJustify) + line_bfc_offset.line_offset += OffsetForTextAlign(*line_info, text_align); + + if (IsLtr(line_info->BaseDirection())) + line_bfc_offset.line_offset += line_info->TextIndent(); if (list_marker_index.has_value()) { NGListLayoutAlgorithm::SetListMarkerPosition( @@ -383,17 +413,13 @@ // Justify the line. This changes the size of items by adding spacing. // Returns false if justification failed and should fall back to start-aligned. bool NGInlineLayoutAlgorithm::ApplyJustify(NGLineInfo* line_info) { - LayoutUnit inline_size; - LayoutUnit available_width = line_info->AvailableWidth(); - if (line_info->LineEndShapeResult()) - available_width -= line_info->LineEndShapeResult()->SnappedWidth(); - LayoutUnit expansion = available_width - line_info->Width(); - if (expansion <= 0) + NGLineAlign align(*line_info); + if (align.space <= 0) return false; // no expansion is needed. // Construct the line text to compute spacing for. String line_text = - Node().Text(line_info->StartOffset(), line_info->EndOffset()).ToString(); + Node().Text(line_info->StartOffset(), align.end_offset).ToString(); // Append a hyphen if the last word is hyphenated. The hyphen is in // |ShapeResult|, but not in text. |ShapeResultSpacing| needs the text that @@ -404,12 +430,14 @@ // Compute the spacing to justify. ShapeResultSpacing<String> spacing(line_text); - spacing.SetExpansion(expansion, line_info->BaseDirection(), + spacing.SetExpansion(align.space, line_info->BaseDirection(), line_info->LineStyle().GetTextJustify()); if (!spacing.HasExpansion()) return false; // no expansion opportunities exist. for (NGInlineItemResult& item_result : line_info->Results()) { + if (item_result.has_only_trailing_spaces) + break; if (item_result.shape_result) { // Mutate the existing shape result if only used here, if not create a // copy. @@ -435,42 +463,41 @@ return true; } -void NGInlineLayoutAlgorithm::ApplyTextAlign(const NGLineInfo& line_info, - ETextAlign text_align, - LayoutUnit* line_left, - LayoutUnit inline_size) { +// Compute the offset to shift the line box for the 'text-align' property. +LayoutUnit NGInlineLayoutAlgorithm::OffsetForTextAlign( + const NGLineInfo& line_info, + ETextAlign text_align) const { bool is_base_ltr = IsLtr(line_info.BaseDirection()); - LayoutUnit available_width = line_info.AvailableWidth(); while (true) { switch (text_align) { case ETextAlign::kLeft: - case ETextAlign::kWebkitLeft: + case ETextAlign::kWebkitLeft: { // The direction of the block should determine what happens with wide // lines. In particular with RTL blocks, wide lines should still spill // out to the left. - if (!is_base_ltr && inline_size > available_width) - *line_left -= inline_size - available_width; - return; + if (is_base_ltr) + return LayoutUnit(); + NGLineAlign align(line_info); + return align.space.ClampPositiveToZero(); + } case ETextAlign::kRight: - case ETextAlign::kWebkitRight: + case ETextAlign::kWebkitRight: { // Wide lines spill out of the block based off direction. // So even if text-align is right, if direction is LTR, wide lines // should overflow out of the right side of the block. - if (inline_size < available_width || !is_base_ltr) - *line_left += available_width - inline_size; - return; + NGLineAlign align(line_info); + if (align.space > 0 || !is_base_ltr) + return align.space; + return LayoutUnit(); + } case ETextAlign::kCenter: - case ETextAlign::kWebkitCenter: - if (is_base_ltr) { - *line_left += - std::max((available_width - inline_size) / 2, LayoutUnit()); - } else if (inline_size <= available_width) { - *line_left += (available_width - inline_size) / 2; - } else { - // In RTL, wide lines should spill out to the left, same as kRight. - *line_left += available_width - inline_size; - } - return; + case ETextAlign::kWebkitCenter: { + NGLineAlign align(line_info); + if (is_base_ltr || align.space > 0) + return (align.space / 2).ClampNegativeToZero(); + // In RTL, wide lines should spill out to the left, same as kRight. + return align.space; + } case ETextAlign::kStart: text_align = is_base_ltr ? ETextAlign::kLeft : ETextAlign::kRight; continue; @@ -480,10 +507,10 @@ case ETextAlign::kJustify: // Justification is applied in earlier phase, see PlaceItems(). NOTREACHED(); - return; + return LayoutUnit(); } NOTREACHED(); - return; + return LayoutUnit(); } }
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.h index 4064780..f473ee76 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_layout_algorithm.h
@@ -74,10 +74,7 @@ NGInlineItemResult*, const NGLineInfo&); - void ApplyTextAlign(const NGLineInfo&, - ETextAlign, - LayoutUnit* line_left, - LayoutUnit inline_size); + LayoutUnit OffsetForTextAlign(const NGLineInfo&, ETextAlign) const; bool ApplyJustify(NGLineInfo*); LayoutUnit ComputeContentSize(const NGLineInfo&,
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc index bec6e88..73f4ebd 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_box_fragment_builder.cc
@@ -141,8 +141,10 @@ std::move(fragment), oof_positioned_descendants_, positioned_floats_, unpositioned_floats_, std::move(exclusion_space_), bfc_offset_, end_margin_strut_, - /* intrinsic_block_size */ LayoutUnit(), EBreakBetween::kAuto, - EBreakBetween::kAuto, NGLayoutResult::kSuccess)); + /* intrinsic_block_size */ LayoutUnit(), + /* minimal_space_shortage */ LayoutUnit::Max(), EBreakBetween::kAuto, + EBreakBetween::kAuto, + /* has_forced_break */ false, NGLayoutResult::kSuccess)); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc index 9208f66..4534d7d3 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.cc
@@ -18,6 +18,22 @@ namespace blink { +namespace { + +// CSS-defined white space characters, excluding the newline character. +// In most cases, the line breaker consider break opportunities are before +// spaces because it handles trailing spaces differently from other normal +// characters, but breaking before newline characters is not desired. +inline bool IsBreakableSpace(UChar c) { + return c == kSpaceCharacter || c == kTabulationCharacter; +} + +inline bool CanBreakAfterLast(const NGInlineItemResults& item_results) { + return !item_results.IsEmpty() && item_results.back().can_break_after; +} + +} // namespace + NGLineBreaker::NGLineBreaker( NGInlineNode node, NGLineBreakerMode mode, @@ -39,7 +55,10 @@ handled_floats_end_item_index_(handled_float_index), base_direction_(node_.BaseDirection()), in_line_height_quirks_mode_(node.InLineHeightQuirksMode()) { + break_iterator_.SetBreakSpace(BreakSpaceType::kBeforeSpaceRun); + if (break_token) { + current_style_ = break_token->Style(); item_index_ = break_token->ItemIndex(); offset_ = break_token->TextOffset(); previous_line_had_forced_break_ = break_token->IsForcedBreak(); @@ -48,10 +67,26 @@ } } -inline NGLineBreaker::LineBreakState NGLineBreaker::ToLineBreakState( - const NGInlineItemResult& item_result) { - return item_result.can_break_after ? LineBreakState::kIsBreakable - : LineBreakState::kNotBreakable; +inline NGInlineItemResult* NGLineBreaker::AddItem( + const NGInlineItem& item, + unsigned end_offset, + NGInlineItemResults* item_results) { + DCHECK_LE(end_offset, item.EndOffset()); + item_results->push_back( + NGInlineItemResult(&item, item_index_, offset_, end_offset)); + return &item_results->back(); +} + +inline NGInlineItemResult* NGLineBreaker::AddItem( + const NGInlineItem& item, + NGInlineItemResults* item_results) { + return AddItem(item, item.EndOffset(), item_results); +} + +inline void NGLineBreaker::ComputeCanBreakAfter( + NGInlineItemResult* item_result) const { + item_result->can_break_after = + auto_wrap_ && break_iterator_.IsBreakable(item_result->end_offset); } // @return if this is the "first formatted line". @@ -100,7 +135,12 @@ line_info->SetStartOffset(offset_); line_info->SetLineStyle(node_, constraint_space_, IsFirstFormattedLine(), previous_line_had_forced_break_); - SetCurrentStyle(line_info->LineStyle()); + // Set the initial style of this line from the break token. Example: + // <p>...<span>....</span></p> + // When the line wraps in <span>, the 2nd line needs to start with the style + // of the <span>. + override_break_anywhere_ = false; + SetCurrentStyle(current_style_ ? *current_style_ : line_info->LineStyle()); ComputeBaseDirection(); line_info->SetBaseDirection(base_direction_); @@ -123,13 +163,6 @@ PrepareNextLine(opportunity, line_info); BreakLine(line_info); - line_info->SetEndOffset(offset_); - - // TODO(kojii): When editing, or caret is enabled, trailing spaces at wrap - // point should not be removed. For other cases, we can a) remove, b) leave - // characters without glyphs, or c) leave both characters and glyphs without - // measuring. Need to decide which one works the best. - SkipCollapsibleWhitespaces(); if (line_info->Results().IsEmpty()) return false; @@ -152,71 +185,82 @@ NGInlineItemResults* item_results = &line_info->Results(); const Vector<NGInlineItem>& items = node_.Items(line_info->UseFirstLineStyle()); - LineBreakState state = LineBreakState::kNotBreakable; - - while (item_index_ < items.size()) { -#if DCHECK_IS_ON() - if (!item_results->IsEmpty() && (state == LineBreakState::kIsBreakable || - state == LineBreakState::kNotBreakable)) { - DCHECK_EQ(item_results->back().can_break_after, - state == LineBreakState::kIsBreakable); + LineBreakState state = LineBreakState::kContinue; + while (state != LineBreakState::kDone) { + // Check overflow even if |item_index_| is at the end of the block, because + // the last item of the block may have caused overflow. In that case, + // |HandleOverflow| will rewind |item_index_|. + if (state == LineBreakState::kContinue && auto_wrap_ && !line_.CanFit()) { + state = HandleOverflow(line_info); } -#endif - // CloseTag prohibits to break before. + // If we reach at the end of the block, this is the last line. + DCHECK_LE(item_index_, items.size()); + if (item_index_ == items.size()) { + line_info->SetIsLastLine(true); + return; + } + + // Handle trailable items first. These items may not be break before. + // They (or part of them) may also overhang the available width. const NGInlineItem& item = items[item_index_]; + if (item.Type() == NGInlineItem::kText) { + state = HandleText(item, state, line_info); +#if DCHECK_IS_ON() + if (!item_results->IsEmpty()) + item_results->back().CheckConsistency(); +#endif + continue; + } if (item.Type() == NGInlineItem::kCloseTag) { - state = HandleCloseTag(item, item_results); + HandleCloseTag(item, item_results); + continue; + } + if (item.Type() == NGInlineItem::kControl) { + state = HandleControlItem(item, state, line_info); + continue; + } + if (item.Type() == NGInlineItem::kBidiControl) { + state = HandleBidiControlItem(item, state, line_info); continue; } - if (state == LineBreakState::kBreakAfterTrailings) { + // Items after this point are not trailable. Break at the earliest break + // opportunity if we're trailing. + if (state == LineBreakState::kTrailing && + CanBreakAfterLast(*item_results)) { line_info->SetIsLastLine(false); return; } - if (state == LineBreakState::kIsBreakable && !line_.CanFit()) - return HandleOverflow(line_info); - item_results->push_back( - NGInlineItemResult(&item, item_index_, offset_, item.EndOffset())); - NGInlineItemResult* item_result = &item_results->back(); - if (item.Type() == NGInlineItem::kText) { - state = HandleText(line_info, item, item_result); -#if DCHECK_IS_ON() - item_result->CheckConsistency(); -#endif - } else if (item.Type() == NGInlineItem::kAtomicInline) { - state = HandleAtomicInline(item, item_result, *line_info); - } else if (item.Type() == NGInlineItem::kControl) { - state = HandleControlItem(item, item_result); - if (state == LineBreakState::kForcedBreak) { - line_.is_after_forced_break = true; - line_info->SetIsLastLine(true); - return; - } + if (item.Type() == NGInlineItem::kAtomicInline) { + HandleAtomicInline(item, line_info); } else if (item.Type() == NGInlineItem::kOpenTag) { - HandleOpenTag(item, item_result); - state = LineBreakState::kNotBreakable; + HandleOpenTag(item, AddItem(item, item_results)); } else if (item.Type() == NGInlineItem::kFloating) { - state = HandleFloat(item, item_result); + HandleFloat(item, AddItem(item, item_results)); + } else if (item.Type() == NGInlineItem::kOutOfFlowPositioned) { + DCHECK_EQ(item.Length(), 0u); + AddItem(item, item_results); + MoveToNextOf(item); } else if (item.Length()) { + NOTREACHED(); // For other items with text (e.g., bidi controls), use their text to // determine the break opportunity. + NGInlineItemResult* item_result = AddItem(item, item_results); item_result->can_break_after = break_iterator_.IsBreakable(item_result->end_offset); - state = ToLineBreakState(*item_result); + MoveToNextOf(item); + } else if (item.Type() == NGInlineItem::kListMarker) { + line_.should_create_line_box = true; + NGInlineItemResult* item_result = AddItem(item, item_results); + DCHECK(!item_result->can_break_after); MoveToNextOf(item); } else { - if (item.Type() == NGInlineItem::kListMarker) - line_.should_create_line_box = true; - DCHECK(!item_result->can_break_after); - state = LineBreakState::kNotBreakable; + NOTREACHED(); MoveToNextOf(item); } } - if (!line_.CanFit()) - return HandleOverflow(line_info); - line_info->SetIsLastLine(true); } // Re-compute the current position from NGInlineItemResults. @@ -233,17 +277,6 @@ LayoutUnit bfc_line_offset = line_.line_left_bfc_offset; LayoutUnit available_width = line_.AvailableWidth(); - // Indenting should move the current position to compute the size of - // tabulations. Since it is computed and stored in NGInlineItemResult, - // adjust the positoin of the line box to simplify placing items. - if (LayoutUnit text_indent = line_info->TextIndent()) { - // Move the line box by indent. Negative indents are ink overflow, let the - // line box overflow from the container box. - if (IsLtr(line_info->BaseDirection())) - bfc_line_offset += text_indent; - available_width -= text_indent; - } - // Negative margins can make the position negative, but the inline size is // always positive or 0. line_info->SetLineBfcOffset({bfc_line_offset, bfc_block_offset_}, @@ -251,30 +284,21 @@ line_.position.ClampNegativeToZero()); } -bool NGLineBreaker::IsFirstBreakOpportunity(unsigned offset, - const NGLineInfo& line_info) const { - return break_iterator_.NextBreakOpportunity(line_info.StartOffset() + 1) >= - offset; -} - -NGLineBreaker::LineBreakState NGLineBreaker::ComputeIsBreakableAfter( - NGInlineItemResult* item_result) const { - if (auto_wrap_ && break_iterator_.IsBreakable(item_result->end_offset)) { - item_result->can_break_after = true; - return LineBreakState::kIsBreakable; - } - DCHECK(!item_result->can_break_after); - return LineBreakState::kNotBreakable; -} - NGLineBreaker::LineBreakState NGLineBreaker::HandleText( - NGLineInfo* line_info, const NGInlineItem& item, - NGInlineItemResult* item_result) { + LineBreakState state, + NGLineInfo* line_info) { DCHECK_EQ(item.Type(), NGInlineItem::kText); DCHECK(item.TextShapeResult()); - line_.should_create_line_box = true; + NGInlineItemResults* item_results = &line_info->Results(); + // If we're trailing, only trailing spaces can be included in this line. + if (state == LineBreakState::kTrailing && CanBreakAfterLast(*item_results)) { + return HandleTrailingSpaces(item, line_info); + } + + line_.should_create_line_box = true; + NGInlineItemResult* item_result = AddItem(item, item_results); LayoutUnit available_width = line_.AvailableWidth(); // If the start offset is at the item boundary, try to add the entire item. @@ -285,9 +309,10 @@ if (!auto_wrap_ || next_position <= available_width) { item_result->shape_result = item.TextShapeResult(); item_result->may_break_inside = auto_wrap_; + ComputeCanBreakAfter(item_result); line_.position = next_position; MoveToNextOf(item); - return ComputeIsBreakableAfter(item_result); + return state; } } @@ -298,25 +323,22 @@ bool is_overflow = next_position > available_width; line_.position = next_position; item_result->may_break_inside = !is_overflow; - if (item_result->end_offset < item.EndOffset()) - offset_ = item_result->end_offset; - else - MoveToNextOf(item); - if (item_result->end_offset < item.EndOffset() || - item_result->has_hanging_spaces) { - // The break point found. If it fits, break this line after including - // trailing objects (end margins etc.) - if (!is_overflow) - return LineBreakState::kBreakAfterTrailings; + MoveToNextOf(*item_result); - // If overflow, proceed to the possible break point before start - // rewinding. TODO(kojii): This could be more efficient if we knew there - // was a break opportunity and that rewind will succeed. - return LineBreakState::kIsBreakable; + if (!is_overflow || state == LineBreakState::kTrailing) { + if (item_result->end_offset < item.EndOffset()) { + // The break point found, and text follows. Break here. + HandleTrailingSpaces(item, line_info); + line_info->SetIsLastLine(false); + return LineBreakState::kDone; + } + + // The break point found, but items that prohibit breaking before them may + // follow. Continue looking next items. + return state; } - DCHECK(is_overflow || item_result->start_offset != item.StartOffset()); - return ToLineBreakState(*item_result); + return HandleOverflow(line_info); } // Add the rest of the item if !auto_wrap. @@ -329,7 +351,7 @@ item_result->can_break_after = false; line_.position += item_result->inline_size; MoveToNextOf(item); - return LineBreakState::kNotBreakable; + return state; } void NGLineBreaker::BreakText(NGInlineItemResult* item_result, @@ -355,36 +377,13 @@ scoped_refptr<ShapeResult> shape_result = breaker.ShapeLine(item_result->start_offset, available_width, &result); DCHECK_GT(shape_result->NumCharacters(), 0u); - if (result.has_hanging_spaces) { - item_result->has_hanging_spaces = true; - // Hanging spaces do not expand min-content. Handle them simliar to visual - // overflow. Some details are different, but it's the closest behavior. - item_result->inline_size = available_width; - DCHECK(!result.is_hyphenated); - } else { - item_result->inline_size = - shape_result->SnappedWidth().ClampNegativeToZero(); - - // If overflow and no break opportunities exist, and if 'word-wrap: - // break-word', try to break at every grapheme cluster boundary. - if (item_result->inline_size > available_width && break_if_overflow_ && - break_iterator_.BreakType() == LineBreakType::kNormal && - IsFirstBreakOpportunity(result.break_offset, *line_info)) { - break_iterator_.SetBreakType(LineBreakType::kBreakCharacter); - BreakText(item_result, item, available_width, line_info); - break_iterator_.SetBreakType(LineBreakType::kNormal); - return; - } - - if (result.is_hyphenated) { - AppendHyphen(*item.Style(), line_info); - item_result->inline_size = - shape_result->SnappedWidth().ClampNegativeToZero(); - // TODO(kojii): Implement when adding a hyphen caused overflow. - // crbug.com/714962: Should be removed when switched to NGPaint. - item_result->text_end_effect = NGTextEndEffect::kHyphen; - } + if (result.is_hyphenated) { + AppendHyphen(*item.Style(), line_info); + // TODO(kojii): Implement when adding a hyphen caused overflow. + // crbug.com/714962: Should be removed when switched to NGPaint. + item_result->text_end_effect = NGTextEndEffect::kHyphen; } + item_result->inline_size = shape_result->SnappedWidth().ClampNegativeToZero(); item_result->end_offset = result.break_offset; item_result->shape_result = std::move(shape_result); DCHECK_GT(item_result->end_offset, item_result->start_offset); @@ -406,6 +405,55 @@ } } +NGLineBreaker::LineBreakState NGLineBreaker::HandleTrailingSpaces( + const NGInlineItem& item, + NGLineInfo* line_info) { + DCHECK_EQ(item.Type(), NGInlineItem::kText); + DCHECK_LT(offset_, item.EndOffset()); + const String& text = Text(); + NGInlineItemResults* item_results = &line_info->Results(); + DCHECK(item.Style()); + const ComputedStyle& style = *item.Style(); + if (style.CollapseWhiteSpace()) { + if (text[offset_] != kSpaceCharacter) + return LineBreakState::kDone; + + // Skipping one whitespace removes all collapsible spaces because + // collapsible spaces are collapsed to single space in NGInlineItemBuilder. + offset_++; + + // Make the last item breakable after, even if it was nowrap. + DCHECK(!item_results->IsEmpty()); + item_results->back().can_break_after = true; + } else { + // Find the end of the run of space characters in this item. + // Other white space characters (e.g., tab) are not included in this item. + DCHECK(style.BreakOnlyAfterWhiteSpace()); + unsigned end = offset_; + while (end < item.EndOffset() && text[end] == kSpaceCharacter) + end++; + if (end == offset_) + return LineBreakState::kDone; + + NGInlineItemResult* item_result = AddItem(item, end, item_results); + item_result->has_only_trailing_spaces = true; + item_result->shape_result = item.TextShapeResult()->SubRange(offset_, end); + item_result->inline_size = item_result->shape_result->SnappedWidth(); + line_.position += item_result->inline_size; + item_result->can_break_after = + end < text.length() && !IsBreakableSpace(text[end]); + offset_ = end; + } + + // If non-space characters follow, the line is done. + // Otherwise keep checking next items for the break point. + DCHECK_LE(offset_, item.EndOffset()); + if (offset_ < item.EndOffset()) + return LineBreakState::kDone; + item_index_++; + return LineBreakState::kTrailing; +} + void NGLineBreaker::AppendHyphen(const ComputedStyle& style, NGLineInfo* line_info) { TextDirection direction = style.Direction(); @@ -414,6 +462,7 @@ HarfBuzzShaper shaper(hyphen_string.Characters16(), hyphen_string.length()); scoped_refptr<ShapeResult> hyphen_result = shaper.Shape(&style.GetFont(), direction); + line_.position += hyphen_result->SnappedWidth(); line_info->SetLineEndShapeResult(std::move(hyphen_result), &style); } @@ -421,48 +470,94 @@ // layout, but do not need shaping/painting. NGLineBreaker::LineBreakState NGLineBreaker::HandleControlItem( const NGInlineItem& item, - NGInlineItemResult* item_result) { + LineBreakState state, + NGLineInfo* line_info) { DCHECK_EQ(item.Length(), 1u); line_.should_create_line_box = true; - UChar character = node_.Text()[item.StartOffset()]; + UChar character = Text()[item.StartOffset()]; switch (character) { - case kNewlineCharacter: - MoveToNextOf(item); - return LineBreakState::kForcedBreak; + case kNewlineCharacter: { + NGInlineItemResult* item_result = AddItem(item, &line_info->Results()); + item_result->has_only_trailing_spaces = true; + line_.is_after_forced_break = true; + line_info->SetIsLastLine(true); + state = LineBreakState::kDone; + break; + } case kTabulationCharacter: { + NGInlineItemResult* item_result = AddItem(item, &line_info->Results()); DCHECK(item.Style()); const ComputedStyle& style = *item.Style(); const Font& font = style.GetFont(); item_result->inline_size = font.TabWidth(style.GetTabSize(), line_.position); line_.position += item_result->inline_size; - MoveToNextOf(item); - // TODO(kojii): Implement break around the tab character. - item_result->can_break_after = true; - return LineBreakState::kIsBreakable; + item_result->has_only_trailing_spaces = + state == LineBreakState::kTrailing; + ComputeCanBreakAfter(item_result); + break; } - case kZeroWidthSpaceCharacter: + case kZeroWidthSpaceCharacter: { // <wbr> tag creates break opportunities regardless of auto_wrap. - MoveToNextOf(item); + NGInlineItemResult* item_result = AddItem(item, &line_info->Results()); item_result->can_break_after = true; - return LineBreakState::kIsBreakable; + break; + } + default: + NOTREACHED(); + break; } - NOTREACHED(); - item_result->can_break_after = true; - return LineBreakState::kIsBreakable; + MoveToNextOf(item); + return state; } -NGLineBreaker::LineBreakState NGLineBreaker::HandleAtomicInline( +NGLineBreaker::LineBreakState NGLineBreaker::HandleBidiControlItem( const NGInlineItem& item, - NGInlineItemResult* item_result, - const NGLineInfo& line_info) { + LineBreakState state, + NGLineInfo* line_info) { + DCHECK_EQ(item.Length(), 1u); + NGInlineItemResults* item_results = &line_info->Results(); + + // Bidi control characters have enter/exit semantics. Handle "enter" + // characters simialr to open-tag, while "exit" (pop) characters similar to + // close-tag. + UChar character = Text()[item.StartOffset()]; + bool is_pop = character == kPopDirectionalIsolateCharacter || + character == kPopDirectionalFormattingCharacter; + if (is_pop) { + if (!item_results->IsEmpty()) { + NGInlineItemResult* item_result = AddItem(item, item_results); + NGInlineItemResult* last = &(*item_results)[item_results->size() - 2]; + item_result->can_break_after = last->can_break_after; + last->can_break_after = false; + } else { + AddItem(item, item_results); + } + } else { + if (state == LineBreakState::kTrailing && + CanBreakAfterLast(*item_results)) { + line_info->SetIsLastLine(false); + MoveToNextOf(item); + return LineBreakState::kDone; + } + NGInlineItemResult* item_result = AddItem(item, item_results); + DCHECK(!item_result->can_break_after); + } + MoveToNextOf(item); + return state; +} + +void NGLineBreaker::HandleAtomicInline(const NGInlineItem& item, + NGLineInfo* line_info) { DCHECK_EQ(item.Type(), NGInlineItem::kAtomicInline); line_.should_create_line_box = true; + NGInlineItemResult* item_result = AddItem(item, &line_info->Results()); item_result->layout_result = NGBlockNode(ToLayoutBox(item.GetLayoutObject())) - .LayoutAtomicInline(constraint_space_, line_info.UseFirstLineStyle()); + .LayoutAtomicInline(constraint_space_, + line_info->UseFirstLineStyle()); DCHECK(item_result->layout_result->PhysicalFragment()); item_result->inline_size = @@ -476,8 +571,8 @@ item_result->inline_size += item_result->margins.InlineSum(); line_.position += item_result->inline_size; + ComputeCanBreakAfter(item_result); MoveToNextOf(item); - return ComputeIsBreakableAfter(item_result); } // Performs layout and positions a float. @@ -496,9 +591,8 @@ // in the document. // // TODO(glebl): Add the support of clearance for inline floats. -NGLineBreaker::LineBreakState NGLineBreaker::HandleFloat( - const NGInlineItem& item, - NGInlineItemResult* item_result) { +void NGLineBreaker::HandleFloat(const NGInlineItem& item, + NGInlineItemResult* item_result) { // When rewind occurs, an item may be handled multiple times. // Since floats are put into a separate list, avoid handling same floats // twice. @@ -508,10 +602,10 @@ // Additionally, we need to skip floats if we're retrying a line after a // fragmentainer break. In that case the floats associated with this line will // already have been processed. - if (item_index_ < handled_floats_end_item_index_ || ignore_floats_) { - MoveToNextOf(item); - return ComputeIsBreakableAfter(item_result); - } + ComputeCanBreakAfter(item_result); + MoveToNextOf(item); + if (item_index_ <= handled_floats_end_item_index_ || ignore_floats_) + return; NGBlockNode node(ToLayoutBox(item.GetLayoutObject())); @@ -580,9 +674,6 @@ DCHECK_GE(line_.line_right_bfc_offset, LayoutUnit()); DCHECK_GE(line_.AvailableWidth(), LayoutUnit()); } - - MoveToNextOf(item); - return ComputeIsBreakableAfter(item_result); } void NGLineBreaker::HandleOpenTag(const NGInlineItem& item, @@ -624,13 +715,9 @@ MoveToNextOf(item); } -NGLineBreaker::LineBreakState NGLineBreaker::HandleCloseTag( - const NGInlineItem& item, - NGInlineItemResults* item_results) { - item_results->push_back( - NGInlineItemResult(&item, item_index_, offset_, item.EndOffset())); - NGInlineItemResult* item_result = &item_results->back(); - +void NGLineBreaker::HandleCloseTag(const NGInlineItem& item, + NGInlineItemResults* item_results) { + NGInlineItemResult* item_result = AddItem(item, item_results); item_result->needs_box_when_empty = false; item_result->has_edge = item.HasEndEdge(); if (item_result->has_edge) { @@ -663,23 +750,37 @@ if (was_auto_wrap == auto_wrap_) { item_result->can_break_after = last->can_break_after; last->can_break_after = false; - return ToLineBreakState(*item_result); + return; } last->can_break_after = false; + if (!was_auto_wrap) { + DCHECK(auto_wrap_); + // When auto-wrap starts after no-wrap, the boundary is not allowed to + // wrap. However, when space characters follow the boundary, there should + // be a break opportunity after the space. The break_iterator cannot + // compute this because it considers break opportunities are before a run + // of spaces. + const String& text = node_.Text(); + if (offset_ < text.length() && IsBreakableSpace(text[offset_])) { + item_result->can_break_after = true; + return; + } + } } - return ComputeIsBreakableAfter(item_result); + ComputeCanBreakAfter(item_result); } // Handles when the last item overflows. // At this point, item_results does not fit into the current line, and there // are no break opportunities in item_results.back(). -void NGLineBreaker::HandleOverflow(NGLineInfo* line_info) { - HandleOverflow(line_info, line_.AvailableWidth(), false); +NGLineBreaker::LineBreakState NGLineBreaker::HandleOverflow( + NGLineInfo* line_info) { + return HandleOverflow(line_info, line_.AvailableWidth()); } -void NGLineBreaker::HandleOverflow(NGLineInfo* line_info, - LayoutUnit available_width, - bool force_break_anywhere) { +NGLineBreaker::LineBreakState NGLineBreaker::HandleOverflow( + NGLineInfo* line_info, + LayoutUnit available_width) { NGInlineItemResults* item_results = &line_info->Results(); LayoutUnit width_to_rewind = line_.position - available_width; DCHECK_GT(width_to_rewind, 0); @@ -695,7 +796,8 @@ if (i < item_results->size() - 1 && item_result->can_break_after) { if (width_to_rewind <= 0) { line_.position = available_width + width_to_rewind; - return Rewind(line_info, i + 1); + Rewind(line_info, i + 1); + return LineBreakState::kTrailing; } break_before = i + 1; } @@ -706,31 +808,40 @@ DCHECK(item_result->item); const NGInlineItem& item = *item_result->item; if (item.Type() == NGInlineItem::kText && next_width_to_rewind < 0 && - (item_result->may_break_inside || force_break_anywhere)) { + (item_result->may_break_inside || override_break_anywhere_)) { // When the text fits but its right margin does not, the break point // must not be at the end. LayoutUnit item_available_width = std::min(-next_width_to_rewind, item_result->inline_size - 1); SetCurrentStyle(*item.Style()); - if (force_break_anywhere) - break_iterator_.SetBreakType(LineBreakType::kBreakCharacter); BreakText(item_result, item, item_available_width, line_info); #if DCHECK_IS_ON() item_result->CheckConsistency(); #endif if (item_result->inline_size <= item_available_width) { - DCHECK(item_result->end_offset < item.EndOffset() || - (item_result->end_offset == item.EndOffset() && - item_result->has_hanging_spaces)); + DCHECK(item_result->end_offset < item.EndOffset()); DCHECK(item_result->can_break_after); DCHECK_LE(i + 1, item_results->size()); if (i + 1 == item_results->size()) { + // If this is the last item, adjust states to accomodate the change. line_.position = available_width + next_width_to_rewind + item_result->inline_size; + if (line_info->LineEndShapeResult()) { + line_.position -= line_info->LineEndShapeResult()->SnappedWidth(); + line_info->SetLineEndShapeResult(nullptr, nullptr); + } +#if DCHECK_IS_ON() + LayoutUnit position_fast = line_.position; + UpdatePosition(line_info->Results()); + DCHECK_EQ(line_.position, position_fast); +#endif + item_index_ = item_result->item_index; + offset_ = item_result->end_offset; + node_.AssertOffset(item_index_, offset_); } else { Rewind(line_info, i + 1); } - return; + return LineBreakState::kTrailing; } } @@ -739,12 +850,21 @@ // Reaching here means that the rewind point was not found. + if (break_anywhere_if_overflow_ && !override_break_anywhere_) { + override_break_anywhere_ = true; + break_iterator_.SetBreakType(LineBreakType::kBreakCharacter); + Rewind(line_info, 0); + return LineBreakState::kContinue; + } + // Let this line overflow. // If there was a break opporunity, the overflow should stop there. - if (break_before) - return Rewind(line_info, break_before); + if (break_before) { + Rewind(line_info, break_before); + return LineBreakState::kTrailing; + } - line_info->SetIsLastLine(item_index_ >= node_.Items().size()); + return LineBreakState::kTrailing; } void NGLineBreaker::Rewind(NGLineInfo* line_info, unsigned new_end) { @@ -768,7 +888,7 @@ // re-layout atomic inlines. item_results->Shrink(new_end); - line_info->SetIsLastLine(false); + line_info->SetLineEndShapeResult(nullptr, nullptr); UpdatePosition(line_info->Results()); } @@ -790,8 +910,10 @@ // anywhere'. unsigned saved_item_index = item_index_; unsigned saved_offset = offset_; + override_break_anywhere_ = true; + break_iterator_.SetBreakType(LineBreakType::kBreakCharacter); HandleOverflow(line_info, - line_.AvailableWidth() - shape_result->SnappedWidth(), true); + line_.AvailableWidth() - shape_result->SnappedWidth()); // Restore item_index/offset to before HandleOverflow(). item_index_ = saved_item_index; @@ -811,36 +933,41 @@ // The ellipsis should appear at the logical end of the line. // This is stored seprately from other results so that it can be appended // after bidi reorder. + line_.position += shape_result->SnappedWidth(); line_info->SetLineEndShapeResult(std::move(shape_result), style); } void NGLineBreaker::SetCurrentStyle(const ComputedStyle& style) { + current_style_ = &style; + auto_wrap_ = style.AutoWrap(); if (auto_wrap_) { break_iterator_.SetLocale(style.LocaleForLineBreakIterator()); - switch (style.WordBreak()) { - case EWordBreak::kNormal: - break_if_overflow_ = style.OverflowWrap() == EOverflowWrap::kBreakWord; - break_iterator_.SetBreakType(LineBreakType::kNormal); - break; - case EWordBreak::kBreakAll: - break_if_overflow_ = false; - break_iterator_.SetBreakType(LineBreakType::kBreakAll); - break; - case EWordBreak::kBreakWord: - break_if_overflow_ = true; - break_iterator_.SetBreakType(LineBreakType::kNormal); - break; - case EWordBreak::kKeepAll: - break_if_overflow_ = false; - break_iterator_.SetBreakType(LineBreakType::kKeepAll); - break; + if (UNLIKELY(override_break_anywhere_)) { + break_iterator_.SetBreakType(LineBreakType::kBreakCharacter); + } else { + switch (style.WordBreak()) { + case EWordBreak::kNormal: + break_anywhere_if_overflow_ = + style.OverflowWrap() == EOverflowWrap::kBreakWord; + break_iterator_.SetBreakType(LineBreakType::kNormal); + break; + case EWordBreak::kBreakAll: + break_anywhere_if_overflow_ = false; + break_iterator_.SetBreakType(LineBreakType::kBreakAll); + break; + case EWordBreak::kBreakWord: + break_anywhere_if_overflow_ = true; + break_iterator_.SetBreakType(LineBreakType::kNormal); + break; + case EWordBreak::kKeepAll: + break_anywhere_if_overflow_ = false; + break_iterator_.SetBreakType(LineBreakType::kKeepAll); + break; + } } - break_iterator_.SetBreakSpace(style.BreakOnlyAfterWhiteSpace() - ? BreakSpaceType::kAfter - : BreakSpaceType::kBeforeSpace); enable_soft_hyphen_ = style.GetHyphens() != Hyphens::kNone; hyphenation_ = style.GetHyphenation(); @@ -862,31 +989,13 @@ item_index_++; } -void NGLineBreaker::SkipCollapsibleWhitespaces() { - const Vector<NGInlineItem>& items = node_.Items(); - if (item_index_ >= items.size()) - return; - const NGInlineItem& item = items[item_index_]; - if (item.Type() != NGInlineItem::kText || !item.Style()->CollapseWhiteSpace()) - return; - - DCHECK_LT(offset_, item.EndOffset()); - if (node_.Text()[offset_] == kSpaceCharacter) { - // Skip one whitespace. Collapsible spaces are collapsed to single space in - // NGInlineItemBuilder, so this removes all collapsible spaces. - offset_++; - if (offset_ == item.EndOffset()) - item_index_++; - } -} - scoped_refptr<NGInlineBreakToken> NGLineBreaker::CreateBreakToken( std::unique_ptr<const NGInlineLayoutStateStack> state_stack) const { const Vector<NGInlineItem>& items = node_.Items(); if (item_index_ >= items.size()) return NGInlineBreakToken::Create(node_); - return NGInlineBreakToken::Create(node_, item_index_, offset_, - line_.is_after_forced_break, + return NGInlineBreakToken::Create(node_, current_style_.get(), item_index_, + offset_, line_.is_after_forced_break, std::move(state_stack)); }
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h index db5dbe76..54ee143 100644 --- a/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h +++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_line_breaker.h
@@ -87,6 +87,13 @@ } }; + const String& Text() const { return break_iterator_.GetString(); } + NGInlineItemResult* AddItem(const NGInlineItem&, + unsigned end_offset, + NGInlineItemResults*); + NGInlineItemResult* AddItem(const NGInlineItem&, NGInlineItemResults*); + void ComputeCanBreakAfter(NGInlineItemResult*) const; + void BreakLine(NGLineInfo*); void PrepareNextLine(const NGLayoutOpportunity&, NGLineInfo*); @@ -95,50 +102,48 @@ void ComputeLineLocation(NGLineInfo*) const; enum class LineBreakState { - // The current position is not breakable. - kNotBreakable, - // The current position is breakable. - kIsBreakable, - // Break by including trailing items (CloseTag). - kBreakAfterTrailings, - // Break immediately. - kForcedBreak + // The line breaking is complete. + kDone, + + // Should complete the line at the earliest possible point. + // Trailing spaces, <br>, or close tags should be included to the line even + // when it is overflowing. + kTrailing, + + // The initial state. Looking for items to break the line. + kContinue, }; - LineBreakState HandleText(NGLineInfo*, - const NGInlineItem&, - NGInlineItemResult*); + LineBreakState HandleText(const NGInlineItem&, LineBreakState, NGLineInfo*); void BreakText(NGInlineItemResult*, const NGInlineItem&, LayoutUnit available_width, NGLineInfo*); - static void AppendHyphen(const ComputedStyle&, NGLineInfo*); + LineBreakState HandleTrailingSpaces(const NGInlineItem&, NGLineInfo*); + void AppendHyphen(const ComputedStyle&, NGLineInfo*); - LineBreakState HandleControlItem(const NGInlineItem&, NGInlineItemResult*); - LineBreakState HandleAtomicInline(const NGInlineItem&, - NGInlineItemResult*, - const NGLineInfo&); - LineBreakState HandleFloat(const NGInlineItem&, NGInlineItemResult*); + LineBreakState HandleControlItem(const NGInlineItem&, + LineBreakState, + NGLineInfo*); + LineBreakState HandleBidiControlItem(const NGInlineItem&, + LineBreakState, + NGLineInfo*); + void HandleAtomicInline(const NGInlineItem&, NGLineInfo*); + void HandleFloat(const NGInlineItem&, NGInlineItemResult*); void HandleOpenTag(const NGInlineItem&, NGInlineItemResult*); - LineBreakState HandleCloseTag(const NGInlineItem&, NGInlineItemResults*); + void HandleCloseTag(const NGInlineItem&, NGInlineItemResults*); - void HandleOverflow(NGLineInfo*); - void HandleOverflow(NGLineInfo*, - LayoutUnit available_width, - bool force_break_anywhere); + LineBreakState HandleOverflow(NGLineInfo*); + LineBreakState HandleOverflow(NGLineInfo*, LayoutUnit available_width); void Rewind(NGLineInfo*, unsigned new_end); void TruncateOverflowingText(NGLineInfo*); void SetCurrentStyle(const ComputedStyle&); - bool IsFirstBreakOpportunity(unsigned, const NGLineInfo&) const; - static LineBreakState ToLineBreakState(const NGInlineItemResult&); - LineBreakState ComputeIsBreakableAfter(NGInlineItemResult*) const; void MoveToNextOf(const NGInlineItem&); void MoveToNextOf(const NGInlineItemResult&); - void SkipCollapsibleWhitespaces(); bool IsFirstFormattedLine() const; void ComputeBaseDirection(); @@ -150,6 +155,7 @@ Vector<NGPositionedFloat>* positioned_floats_; Vector<scoped_refptr<NGUnpositionedFloat>>* unpositioned_floats_; NGExclusionSpace* exclusion_space_; + scoped_refptr<const ComputedStyle> current_style_; unsigned item_index_ = 0; unsigned offset_ = 0; @@ -173,7 +179,11 @@ bool auto_wrap_ = false; // True when current box has 'word-break/word-wrap: break-word'. - bool break_if_overflow_ = false; + bool break_anywhere_if_overflow_ = false; + + // Force LineBreakType::kBreakCharacter by ignoring the current style. + // Set to find grapheme cluster boundaries for 'break-word' after overflow. + bool override_break_anywhere_ = false; // True when breaking at soft hyphens (U+00AD) is allowed. bool enable_soft_hyphen_ = true;
diff --git a/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc b/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc index 03157793..ec6e4685 100644 --- a/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc +++ b/third_party/WebKit/Source/core/layout/ng/layout_ng_block_flow.cc
@@ -173,8 +173,14 @@ NGBlockNode(this), static_position, css_container->IsBox() ? nullptr : css_container); - NGOutOfFlowLayoutPart(NGBlockNode(container), *constraint_space, - *container_style, &container_builder) + NGBoxStrut scrollbar_sizes; + if (css_container->IsBox()) + scrollbar_sizes = + NGBlockNode(ToLayoutBox(css_container)).GetScrollbarSizes(); + NGOutOfFlowLayoutPart(&container_builder, + css_container->CanContainAbsolutePositionObjects(), + css_container->CanContainFixedPositionObjects(), + scrollbar_sizes, *constraint_space, *container_style) .Run(/* update_legacy */ false); scoped_refptr<NGLayoutResult> result = container_builder.ToBoxFragment(); // These are the unpositioned OOF descendants of the current OOF block.
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc index d58082b..381f832 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -508,8 +508,9 @@ // Only layout absolute and fixed children if we aren't going to revisit this // layout. if (unpositioned_floats_.IsEmpty()) { - NGOutOfFlowLayoutPart(Node(), ConstraintSpace(), Style(), - &container_builder_) + NGOutOfFlowLayoutPart(&container_builder_, Node().IsAbsoluteContainer(), + Node().IsFixedContainer(), Node().GetScrollbarSizes(), + ConstraintSpace(), Style()) .Run(); } @@ -1255,6 +1256,7 @@ container_builder_.SetDidBreak(); container_builder_.SetBlockSize(space_left); container_builder_.SetIntrinsicBlockSize(space_left); + container_builder_.PropagateSpaceShortage(block_size - space_left); return; } @@ -1269,10 +1271,41 @@ const NGLayoutResult& layout_result, LayoutUnit block_offset) { DCHECK(ConstraintSpace().HasBlockFragmentation()); - if (!ShouldBreakBeforeChild(child, layout_result, block_offset)) + BreakType break_type = + BreakTypeBeforeChild(child, layout_result, block_offset); + if (break_type == NoBreak) return false; + LayoutUnit space_available = FragmentainerSpaceAvailable(); + LayoutUnit space_shortage; + if (layout_result.MinimalSpaceShortage() == LayoutUnit::Max()) { + // Calculate space shortage: Figure out how much more space would have been + // sufficient to make the child fit right here in the current fragment. + NGFragment fragment(ConstraintSpace().GetWritingMode(), + *layout_result.PhysicalFragment()); + LayoutUnit block_end_offset = block_offset + fragment.BlockSize(); + space_shortage = block_end_offset - space_available; + } else { + // However, if space shortage was reported inside the child, use that. If we + // broke inside the child, we didn't complete layout, so calculating space + // shortage for the child as a whole would be impossible and pointless. + space_shortage = layout_result.MinimalSpaceShortage(); + } + if (child.IsInline()) { + DCHECK_EQ(break_type, SoftBreak); + if (!first_overflowing_line_) { + // We're at the first overflowing line. This is the space shortage that + // we are going to report. We do this in spite of not yet knowing + // whether breaking here would violate orphans and widows requests. This + // approach may result in a lower space shortage than what's actually + // true, which leads to more layout passes than we'd otherwise + // need. However, getting this optimal for orphans and widows would + // require an additional piece of machinery. This case should be rare + // enough (to worry about performance), so let's focus on code + // simplicity instead. + container_builder_.PropagateSpaceShortage(space_shortage); + } // Attempt to honor orphans and widows requests. if (int line_count = container_builder_.LineCount()) { if (!first_overflowing_line_) @@ -1329,20 +1362,33 @@ // content, due to the break) should still be occupied by this container. // TODO(mstensho): Figure out if we really need to <0 here. It doesn't seem // right to have negative available space. - intrinsic_block_size_ = FragmentainerSpaceAvailable().ClampNegativeToZero(); + intrinsic_block_size_ = space_available.ClampNegativeToZero(); // Drop the fragment on the floor and retry at the start of the next // fragmentainer. container_builder_.AddBreakBeforeChild(child); container_builder_.SetDidBreak(); + if (break_type == ForcedBreak) { + container_builder_.SetHasForcedBreak(); + } else { + // Report space shortage, unless we're at a line box (in that case we've + // already dealt with it further up). + if (!child.IsInline()) { + // TODO(mstensho): Turn this into a DCHECK, when the engine is ready for + // it. Space shortage should really be positive here, or we might + // ultimately fail to stretch the columns (column balancing). + if (space_shortage > LayoutUnit()) + container_builder_.PropagateSpaceShortage(space_shortage); + } + } return true; } -bool NGBlockLayoutAlgorithm::ShouldBreakBeforeChild( +NGBlockLayoutAlgorithm::BreakType NGBlockLayoutAlgorithm::BreakTypeBeforeChild( NGLayoutInputNode child, const NGLayoutResult& layout_result, LayoutUnit block_offset) const { if (!container_builder_.BfcOffset().has_value()) - return false; + return NoBreak; const NGPhysicalFragment& physical_fragment = *layout_result.PhysicalFragment(); @@ -1352,11 +1398,11 @@ // of fragmentainers without putting any content into them. auto space_left = FragmentainerSpaceAvailable() - block_offset; if (space_left >= ConstraintSpace().FragmentainerBlockSize()) - return false; + return NoBreak; if (child.IsInline()) { NGFragment fragment(ConstraintSpace().GetWritingMode(), physical_fragment); - return fragment.BlockSize() > space_left; + return fragment.BlockSize() > space_left ? SoftBreak : NoBreak; } // If the block offset is past the fragmentainer boundary (or exactly at the @@ -1364,7 +1410,7 @@ // fragmentainer. Fragments may be pushed past the fragmentainer boundary by // margins. if (space_left <= LayoutUnit()) - return true; + return SoftBreak; EBreakBetween break_before = JoinFragmentainerBreakValues( child.Style().BreakBefore(), layout_result.InitialBreakBefore()); @@ -1374,19 +1420,19 @@ // There should be a forced break before this child, and if we're not at the // first in-flow child, just go ahead and break. if (has_processed_first_child_) - return true; + return ForcedBreak; } const auto* token = physical_fragment.BreakToken(); if (!token || token->IsFinished()) - return false; + return NoBreak; if (token && token->IsBlockType() && ToNGBlockBreakToken(token)->HasLastResortBreak()) { // If this isn't the first piece of child content, we're at a valid class A // (block) or B (line) break point [1], and we may break between this child // and the preceding one. if (has_processed_first_child_) - return true; + return SoftBreak; // TODO(crbug.com/796077): Detect class C break points [1] here. If we're // not at the block content start edge, we may break here, even if it's a // first in-flow child (this situation typically occurs if there are floats @@ -1397,12 +1443,12 @@ } // TODO(mstensho): There are other break-inside values to consider here. if (child.Style().BreakInside() != EBreakInside::kAvoid) - return false; + return NoBreak; // The child broke, and we're not at the start of a fragmentainer, and we're // supposed to avoid breaking inside the child. DCHECK(IsFirstFragment(ConstraintSpace(), physical_fragment)); - return true; + return SoftBreak; } NGBoxStrut NGBlockLayoutAlgorithm::CalculateMargins(
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h index 87a0b6f..3186620 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h
@@ -159,11 +159,13 @@ const NGLayoutResult&, LayoutUnit block_offset); - // Given a child fragment and the corresponding node's style, return true if - // we need to insert a fragmentainer break in front of it. - bool ShouldBreakBeforeChild(NGLayoutInputNode child, - const NGLayoutResult&, - LayoutUnit block_offset) const; + enum BreakType { NoBreak, SoftBreak, ForcedBreak }; + + // Given a child fragment and the corresponding node's style, determine the + // type of break we should insert in front of it, if any. + BreakType BreakTypeBeforeChild(NGLayoutInputNode child, + const NGLayoutResult&, + LayoutUnit block_offset) const; // Final adjustments before fragment creation. We need to prevent the // fragment from crossing fragmentainer boundaries, and rather create a break
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm.cc index fa306d7..47a8071 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm.cc
@@ -86,8 +86,91 @@ CalculateContentBoxSize(border_box_size, border_scrollbar_padding); NGLogicalSize column_size = CalculateColumnSize(content_box_size); - scoped_refptr<NGConstraintSpace> child_space = - CreateConstraintSpaceForColumns(column_size); + WritingMode writing_mode = ConstraintSpace().GetWritingMode(); + LayoutUnit column_block_offset(border_scrollbar_padding.block_start); + LayoutUnit column_inline_progression = + column_size.inline_size + ResolveUsedColumnGap(Style()); + int used_column_count = + ResolveUsedColumnCount(content_box_size.inline_size, Style()); + + do { + scoped_refptr<NGConstraintSpace> child_space = + CreateConstraintSpaceForColumns(column_size); + scoped_refptr<NGBlockBreakToken> break_token = BreakToken(); + LayoutUnit intrinsic_block_size; + LayoutUnit column_inline_offset(border_scrollbar_padding.inline_start); + int actual_column_count = 0; + int forced_break_count = 0; + + // Each column should calculate their own minimal space shortage. Find the + // lowest value of those. This will serve as the column stretch amount, if + // we determine that stretching them is necessary and possible (column + // balancing). + LayoutUnit minimal_space_shortage(LayoutUnit::Max()); + + do { + // Lay out one column. Each column will become a fragment. + NGBlockLayoutAlgorithm child_algorithm(Node(), *child_space.get(), + break_token.get()); + scoped_refptr<NGLayoutResult> result = child_algorithm.Layout(); + scoped_refptr<NGPhysicalBoxFragment> column( + ToNGPhysicalBoxFragment(result->PhysicalFragment().get())); + + NGLogicalOffset logical_offset(column_inline_offset, column_block_offset); + container_builder_.AddChild(result, logical_offset); + + LayoutUnit space_shortage = result->MinimalSpaceShortage(); + if (space_shortage > LayoutUnit()) { + minimal_space_shortage = + std::min(minimal_space_shortage, space_shortage); + } + actual_column_count++; + if (result->HasForcedBreak()) + forced_break_count++; + + LayoutUnit block_size = NGBoxFragment(writing_mode, *column).BlockSize(); + intrinsic_block_size = + std::max(intrinsic_block_size, column_block_offset + block_size); + + column_inline_offset += column_inline_progression; + break_token = ToNGBlockBreakToken(column->BreakToken()); + } while (break_token && !break_token->IsFinished()); + + // If we overflowed (actual column count larger than what we have room for), + // and we're supposed to calculate the column lengths automatically (column + // balancing), see if we're able to stretch them. + // + // We can only stretch the columns if we have at least one column that could + // take more content, and we also need to know the stretch amount (minimal + // space shortage). We need at least one soft break opportunity to do + // this. If forced breaks cause too many breaks, there's no stretch amount + // that could prevent the actual column count from overflowing. + if (actual_column_count > used_column_count && + actual_column_count > forced_break_count + 1 && + minimal_space_shortage != LayoutUnit::Max()) { + LayoutUnit new_column_block_size = + StretchColumnBlockSize(minimal_space_shortage, column_size.block_size, + content_box_size.block_size); + + DCHECK_GE(new_column_block_size, column_size.block_size); + if (new_column_block_size > column_size.block_size) { + // Re-attempt layout with taller columns. + column_size.block_size = new_column_block_size; + container_builder_.RemoveChildren(); + continue; + } + } + container_builder_.SetIntrinsicBlockSize(intrinsic_block_size); + break; + } while (true); + + NGOutOfFlowLayoutPart(&container_builder_, Node().IsAbsoluteContainer(), + Node().IsFixedContainer(), Node().GetScrollbarSizes(), + ConstraintSpace(), Style()) + .Run(); + + // TODO(mstensho): Propagate baselines. + if (border_box_size.block_size == NGSizeIndefinite) { // Get the block size from the columns if it's auto. border_box_size.block_size = @@ -96,40 +179,6 @@ container_builder_.SetInlineSize(border_box_size.inline_size); container_builder_.SetBlockSize(border_box_size.block_size); - WritingMode writing_mode = ConstraintSpace().GetWritingMode(); - scoped_refptr<NGBlockBreakToken> break_token = BreakToken(); - LayoutUnit intrinsic_block_size; - LayoutUnit column_inline_offset(border_scrollbar_padding.inline_start); - LayoutUnit column_block_offset(border_scrollbar_padding.block_start); - LayoutUnit column_inline_progression = - child_space->AvailableSize().inline_size + ResolveUsedColumnGap(Style()); - - do { - // Lay out one column. Each column will become a fragment. - NGBlockLayoutAlgorithm child_algorithm(Node(), *child_space.get(), - break_token.get()); - scoped_refptr<NGLayoutResult> result = child_algorithm.Layout(); - scoped_refptr<NGPhysicalBoxFragment> column( - ToNGPhysicalBoxFragment(result->PhysicalFragment().get())); - - NGLogicalOffset logical_offset(column_inline_offset, column_block_offset); - container_builder_.AddChild(result, logical_offset); - - intrinsic_block_size = std::max( - intrinsic_block_size, - column_block_offset + NGBoxFragment(writing_mode, *column).BlockSize()); - - column_inline_offset += column_inline_progression; - break_token = ToNGBlockBreakToken(column->BreakToken()); - } while (break_token && !break_token->IsFinished()); - - container_builder_.SetIntrinsicBlockSize(intrinsic_block_size); - - NGOutOfFlowLayoutPart(Node(), ConstraintSpace(), Style(), &container_builder_) - .Run(); - - // TODO(mstensho): Propagate baselines. - return container_builder_.ToBoxFragment(); } @@ -211,6 +260,17 @@ Style()); } +LayoutUnit NGColumnLayoutAlgorithm::StretchColumnBlockSize( + LayoutUnit minimal_space_shortage, + LayoutUnit current_column_size, + LayoutUnit container_content_box_block_size) const { + if (!NeedsColumnBalancing(container_content_box_block_size, Style())) + return current_column_size; + LayoutUnit length = current_column_size + minimal_space_shortage; + // Honor {,min-,max-}{height,width} properties. + return ConstrainColumnBlockSize(length, Node(), ConstraintSpace(), Style()); +} + scoped_refptr<NGConstraintSpace> NGColumnLayoutAlgorithm::CreateConstraintSpaceForColumns( const NGLogicalSize& column_size) const {
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm.h index d150f2d6..8a1975c 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm.h
@@ -33,6 +33,15 @@ NGLogicalSize CalculateColumnSize(const NGLogicalSize& content_box_size); LayoutUnit CalculateBalancedColumnBlockSize(const NGLogicalSize& column_size, int column_count); + + // Stretch the column length, if allowed. We do this during column balancing, + // when we discover that the current length isn't large enough to fit all + // content. + LayoutUnit StretchColumnBlockSize( + LayoutUnit minimal_space_shortage, + LayoutUnit current_column_size, + LayoutUnit container_content_box_block_size) const; + scoped_refptr<NGConstraintSpace> CreateConstraintSpaceForColumns( const NGLogicalSize& column_size) const; scoped_refptr<NGConstraintSpace> CreateConstaintSpaceForBalancing(
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm_test.cc index 9c08205..93fdcda 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm_test.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_column_layout_algorithm_test.cc
@@ -2294,5 +2294,201 @@ EXPECT_EQ(expectation, dump); } +TEST_F(NGColumnLayoutAlgorithmTest, ColumnBalancingLines) { + SetBodyInnerHTML(R"HTML( + <style> + #parent { + columns: 3; + column-gap: 10px; + width: 320px; + line-height: 20px; + orphans: 1; + widows: 1; + } + </style> + <div id="container"> + <div id="parent"> + <br><br><br><br><br> + </div> + </div> + )HTML"); + + String dump = DumpFragmentTree(GetElementById("container")); + String expectation = R"DUMP(.:: LayoutNG Physical Fragment Tree ::. + offset:unplaced size:1000x40 + offset:0,0 size:320x40 + offset:0,0 size:100x40 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:0,20 size:0x20 + offset:0,9 size:0x1 + offset:110,0 size:100x40 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:0,20 size:0x20 + offset:0,9 size:0x1 + offset:220,0 size:100x20 + offset:0,0 size:0x20 + offset:0,9 size:0x1 +)DUMP"; + EXPECT_EQ(expectation, dump); +} + +TEST_F(NGColumnLayoutAlgorithmTest, ColumnBalancingLinesOrphans) { + // We have 6 lines and 3 columns. If we make the columns tall enough to hold 2 + // lines each, it should all fit. But then there's an orphans request that 3 + // lines be placed together in the same column... + SetBodyInnerHTML(R"HTML( + <style> + #parent { + columns: 3; + column-gap: 10px; + width: 320px; + line-height: 20px; + orphans: 1; + widows: 1; + } + </style> + <div id="container"> + <div id="parent"> + <br> + <div style="orphans:3;"> + <br><br><br> + </div> + <br><br> + </div> + </div> + )HTML"); + + String dump = DumpFragmentTree(GetElementById("container")); + String expectation = R"DUMP(.:: LayoutNG Physical Fragment Tree ::. + offset:unplaced size:1000x60 + offset:0,0 size:320x60 + offset:0,0 size:100x60 + offset:0,0 size:100x20 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:110,0 size:100x60 + offset:0,0 size:100x60 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:0,20 size:0x20 + offset:0,9 size:0x1 + offset:0,40 size:0x20 + offset:0,9 size:0x1 + offset:220,0 size:100x40 + offset:0,0 size:100x40 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:0,20 size:0x20 + offset:0,9 size:0x1 +)DUMP"; + EXPECT_EQ(expectation, dump); +} + +TEST_F(NGColumnLayoutAlgorithmTest, ColumnBalancingLinesForcedBreak) { + // We have 6 lines and 3 columns. If we make the columns tall enough to hold 2 + // lines each, it should all fit. But then there's a forced break after the + // first line, so that the remaining 5 lines have to be distributed into the 2 + // remaining columns... + SetBodyInnerHTML(R"HTML( + <style> + #parent { + columns: 3; + column-gap: 10px; + width: 320px; + line-height: 20px; + orphans: 1; + widows: 1; + } + </style> + <div id="container"> + <div id="parent"> + <br> + <div style="break-before:column;"> + <br><br><br><br><br> + </div> + </div> + </div> + )HTML"); + + String dump = DumpFragmentTree(GetElementById("container")); + String expectation = R"DUMP(.:: LayoutNG Physical Fragment Tree ::. + offset:unplaced size:1000x60 + offset:0,0 size:320x60 + offset:0,0 size:100x60 + offset:0,0 size:100x20 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:110,0 size:100x60 + offset:0,0 size:100x60 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:0,20 size:0x20 + offset:0,9 size:0x1 + offset:0,40 size:0x20 + offset:0,9 size:0x1 + offset:220,0 size:100x40 + offset:0,0 size:100x40 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:0,20 size:0x20 + offset:0,9 size:0x1 +)DUMP"; + EXPECT_EQ(expectation, dump); +} + +TEST_F(NGColumnLayoutAlgorithmTest, ColumnBalancingLinesAvoidBreakInside) { + // We have 6 lines and 3 columns. If we make the columns tall enough to hold 2 + // lines each, it should all fit. But then there's a block with 3 lines and + // break-inside:avoid... + SetBodyInnerHTML(R"HTML( + <style> + #parent { + columns: 3; + column-gap: 10px; + width: 320px; + line-height: 20px; + orphans: 1; + widows: 1; + } + </style> + <div id="container"> + <div id="parent"> + <br> + <div style="break-inside:avoid;"> + <br><br><br> + </div> + <br><br> + </div> + </div> + )HTML"); + + String dump = DumpFragmentTree(GetElementById("container")); + String expectation = R"DUMP(.:: LayoutNG Physical Fragment Tree ::. + offset:unplaced size:1000x60 + offset:0,0 size:320x60 + offset:0,0 size:100x60 + offset:0,0 size:100x20 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:110,0 size:100x60 + offset:0,0 size:100x60 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:0,20 size:0x20 + offset:0,9 size:0x1 + offset:0,40 size:0x20 + offset:0,9 size:0x1 + offset:220,0 size:100x40 + offset:0,0 size:100x40 + offset:0,0 size:0x20 + offset:0,9 size:0x1 + offset:0,20 size:0x20 + offset:0,9 size:0x1 +)DUMP"; + EXPECT_EQ(expectation, dump); +} + } // anonymous namespace } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc index 0589c737..084c6a1 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
@@ -78,6 +78,13 @@ return NGContainerFragmentBuilder::AddChild(std::move(child), child_offset); } +void NGFragmentBuilder::RemoveChildren() { + child_break_tokens_.clear(); + inline_break_tokens_.clear(); + children_.clear(); + offsets_.clear(); +} + NGFragmentBuilder& NGFragmentBuilder::AddBreakBeforeChild( NGLayoutInputNode child) { if (children_.IsEmpty()) { @@ -99,7 +106,7 @@ // formatting context, rather than concluding that we're done with the // whole thing. inline_break_tokens_.push_back(NGInlineBreakToken::Create( - ToNGInlineNode(child), 0, 0, false, + ToNGInlineNode(child), nullptr, 0, 0, false, std::make_unique<NGInlineLayoutStateStack>())); } return *this; @@ -149,7 +156,11 @@ NGFragmentBuilder& NGFragmentBuilder::PropagateBreak( scoped_refptr<NGLayoutResult> child_layout_result) { if (!did_break_) - return PropagateBreak(child_layout_result->PhysicalFragment()); + PropagateBreak(child_layout_result->PhysicalFragment()); + if (child_layout_result->HasForcedBreak()) + SetHasForcedBreak(); + else + PropagateSpaceShortage(child_layout_result->MinimalSpaceShortage()); return *this; } @@ -281,8 +292,9 @@ return base::AdoptRef(new NGLayoutResult( std::move(fragment), oof_positioned_descendants_, positioned_floats, unpositioned_floats_, std::move(exclusion_space_), bfc_offset_, - end_margin_strut_, intrinsic_block_size_, initial_break_before_, - previous_break_after_, NGLayoutResult::kSuccess)); + end_margin_strut_, intrinsic_block_size_, minimal_space_shortage_, + initial_break_before_, previous_break_after_, has_forced_break_, + NGLayoutResult::kSuccess)); } scoped_refptr<NGLayoutResult> NGFragmentBuilder::Abort( @@ -292,7 +304,8 @@ return base::AdoptRef(new NGLayoutResult( nullptr, oof_positioned_descendants, positioned_floats, unpositioned_floats_, nullptr, bfc_offset_, end_margin_strut_, - LayoutUnit(), EBreakBetween::kAuto, EBreakBetween::kAuto, status)); + LayoutUnit(), LayoutUnit(), EBreakBetween::kAuto, EBreakBetween::kAuto, + false, status)); } // Finds FragmentPairs that define inline containing blocks. @@ -328,7 +341,7 @@ NGFragmentBuilder::FragmentPair value = inline_container_fragments->at(key); if (!value.start_fragment) { - value.start_fragment = descendant.fragment; + value.start_fragment = descendant.fragment.get(); value.start_fragment_union_rect.offset = descendant.offset_to_container_box; value.start_fragment_union_rect = @@ -338,7 +351,7 @@ value.start_linebox_offset = offsets_.at(i); } if (!value.end_fragment || value.end_linebox_fragment != linebox) { - value.end_fragment = descendant.fragment; + value.end_fragment = descendant.fragment.get(); value.end_fragment_union_rect = NGPhysicalOffsetRect( descendant.offset_to_container_box, value.end_fragment->Size()); value.end_linebox_fragment = linebox;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h index 4740cbc..d25e6247 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h
@@ -51,6 +51,9 @@ NGContainerFragmentBuilder& AddChild(scoped_refptr<NGPhysicalFragment>, const NGLogicalOffset&) final; + // Remove all children. + void RemoveChildren(); + // Add a break token for a child that doesn't yet have any fragments, because // its first fragment is to be produced in the next fragmentainer. This will // add a break token for the child, but no fragment. @@ -81,6 +84,22 @@ return *this; } + NGFragmentBuilder& SetHasForcedBreak() { + has_forced_break_ = true; + minimal_space_shortage_ = LayoutUnit(); + return *this; + } + + // Report space shortage, i.e. how much more space would have been sufficient + // to prevent some piece of content from breaking. This information may be + // used by the column balancer to stretch columns. + NGFragmentBuilder& PropagateSpaceShortage(LayoutUnit space_shortage) { + DCHECK_GT(space_shortage, LayoutUnit()); + if (minimal_space_shortage_ > space_shortage) + minimal_space_shortage_ = space_shortage; + return *this; + } + void SetInitialBreakBefore(EBreakBetween break_before) { initial_break_before_ = break_before; } @@ -170,8 +189,11 @@ NGPhysicalFragment::NGBoxType box_type_; bool is_old_layout_root_; bool did_break_; + bool has_forced_break_ = false; LayoutUnit used_block_size_; + LayoutUnit minimal_space_shortage_ = LayoutUnit::Max(); + // The break-before value on the initial child we cannot honor. There's no // valid class A break point before a first child, only *between* siblings. EBreakBetween initial_break_before_ = EBreakBetween::kAuto;
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc index b6d4adb1..21bd7875 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_result.cc
@@ -20,16 +20,20 @@ const WTF::Optional<NGBfcOffset> bfc_offset, const NGMarginStrut end_margin_strut, const LayoutUnit intrinsic_block_size, + LayoutUnit minimal_space_shortage, EBreakBetween initial_break_before, EBreakBetween final_break_after, + bool has_forced_break, NGLayoutResultStatus status) : physical_fragment_(std::move(physical_fragment)), exclusion_space_(std::move(exclusion_space)), bfc_offset_(bfc_offset), end_margin_strut_(end_margin_strut), intrinsic_block_size_(intrinsic_block_size), + minimal_space_shortage_(minimal_space_shortage), initial_break_before_(initial_break_before), final_break_after_(final_break_after), + has_forced_break_(has_forced_break), status_(status) { oof_positioned_descendants_.swap(oof_positioned_descendants); positioned_floats_.swap(positioned_floats); @@ -52,7 +56,8 @@ physical_fragment_->CloneWithoutOffset(), oof_positioned_descendants, positioned_floats, unpositioned_floats, std::move(exclusion_space), bfc_offset_, end_margin_strut_, intrinsic_block_size_, - initial_break_before_, final_break_after_, Status())); + minimal_space_shortage_, initial_break_before_, final_break_after_, + has_forced_break_, Status())); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_result.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_result.h index 198303e..390588a 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_layout_result.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_result.h
@@ -87,6 +87,8 @@ return intrinsic_block_size_; } + LayoutUnit MinimalSpaceShortage() const { return minimal_space_shortage_; } + // The break-before value on the first child needs to be propagated to the // container, in search of a valid class A break point. EBreakBetween InitialBreakBefore() const { return initial_break_before_; } @@ -95,6 +97,9 @@ // container, in search of a valid class A break point. EBreakBetween FinalBreakAfter() const { return final_break_after_; } + // Return true if the fragment broke because a forced break before a child. + bool HasForcedBreak() const { return has_forced_break_; } + scoped_refptr<NGLayoutResult> CloneWithoutOffset() const; private: @@ -111,8 +116,10 @@ const WTF::Optional<NGBfcOffset> bfc_offset, const NGMarginStrut end_margin_strut, const LayoutUnit intrinsic_block_size, + LayoutUnit minimal_space_shortage, EBreakBetween initial_break_before, EBreakBetween final_break_after, + bool has_forced_break, NGLayoutResultStatus status); scoped_refptr<NGPhysicalFragment> physical_fragment_; @@ -125,10 +132,13 @@ const WTF::Optional<NGBfcOffset> bfc_offset_; const NGMarginStrut end_margin_strut_; const LayoutUnit intrinsic_block_size_; + const LayoutUnit minimal_space_shortage_; EBreakBetween initial_break_before_; EBreakBetween final_break_after_; + unsigned has_forced_break_ : 1; + unsigned status_ : 1; };
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc index d13e7e9..6a3b9bbc 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -19,16 +19,17 @@ namespace blink { NGOutOfFlowLayoutPart::NGOutOfFlowLayoutPart( - const NGBlockNode container, + NGFragmentBuilder* container_builder, + bool contains_absolute, + bool contains_fixed, + const NGBoxStrut& scrollbar_sizes, const NGConstraintSpace& container_space, - const ComputedStyle& container_style, - NGFragmentBuilder* container_builder) + const ComputedStyle& container_style) : container_builder_(container_builder), - contains_absolute_(container.IsAbsoluteContainer()), - contains_fixed_(container.IsFixedContainer()) { + contains_absolute_(contains_absolute), + contains_fixed_(contains_fixed) { NGBoxStrut borders_and_scrollers = - ComputeBorders(container_space, container_style) + - container.GetScrollbarSizes(); + ComputeBorders(container_space, container_style) + scrollbar_sizes; NGPhysicalBoxStrut physical_borders = borders_and_scrollers.ConvertToPhysical( container_style.GetWritingMode(), container_style.Direction());
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h index e30cde11..b81e626 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.h
@@ -27,10 +27,12 @@ STACK_ALLOCATED(); public: - NGOutOfFlowLayoutPart(const NGBlockNode container, + NGOutOfFlowLayoutPart(NGFragmentBuilder* container_builder, + bool contains_absolute, + bool contains_fixed, + const NGBoxStrut& scrollbar_sizes, const NGConstraintSpace& container_space, - const ComputedStyle& container_style, - NGFragmentBuilder* container_builder); + const ComputedStyle& container_style); // update_legacy will place NG OOF descendants into their Legacy container. // It should be false if OOF descendants have already been placed into Legacy.
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_page_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_page_layout_algorithm.cc index c269b3c..476ad7f 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_page_layout_algorithm.cc +++ b/third_party/WebKit/Source/core/layout/ng/ng_page_layout_algorithm.cc
@@ -73,7 +73,9 @@ ConstraintSpace(), Style(), intrinsic_block_size); container_builder_.SetBlockSize(border_box_size.block_size); - NGOutOfFlowLayoutPart(Node(), ConstraintSpace(), Style(), &container_builder_) + NGOutOfFlowLayoutPart(&container_builder_, Node().IsAbsoluteContainer(), + Node().IsFixedContainer(), Node().GetScrollbarSizes(), + ConstraintSpace(), Style()) .Run(); // TODO(mstensho): Propagate baselines.
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h index 2e16b103..c2b4fe0 100644 --- a/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h +++ b/third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h
@@ -195,7 +195,9 @@ // Used for return value of traversing fragment tree. struct CORE_EXPORT NGPhysicalFragmentWithOffset { - const NGPhysicalFragment* fragment = nullptr; + DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); + + scoped_refptr<const NGPhysicalFragment> fragment; NGPhysicalOffset offset_to_container_box; NGPhysicalOffsetRect RectInContainerBox() const;
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContext.h b/third_party/WebKit/Source/core/loader/BaseFetchContext.h index b6749fa4..5aa802b 100644 --- a/third_party/WebKit/Source/core/loader/BaseFetchContext.h +++ b/third_party/WebKit/Source/core/loader/BaseFetchContext.h
@@ -5,6 +5,7 @@ #ifndef BaseFetchContext_h #define BaseFetchContext_h +#include "common/net/ip_address_space.mojom-blink.h" #include "core/CoreExport.h" #include "core/frame/WebFeatureForward.h" #include "core/frame/csp/ContentSecurityPolicy.h" @@ -13,7 +14,6 @@ #include "platform/loader/fetch/ResourceRequest.h" #include "platform/weborigin/ReferrerPolicy.h" #include "platform/wtf/Optional.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebURLRequest.h" namespace blink { @@ -83,7 +83,7 @@ virtual String GetOutgoingReferrer() const = 0; virtual const KURL& Url() const = 0; virtual const SecurityOrigin* GetParentSecurityOrigin() const = 0; - virtual Optional<WebAddressSpace> GetAddressSpace() const = 0; + virtual Optional<mojom::IPAddressSpace> GetAddressSpace() const = 0; virtual const ContentSecurityPolicy* GetContentSecurityPolicy() const = 0; virtual void AddConsoleMessage(ConsoleMessage*) const = 0;
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp index a020764b..8d29d5a 100644 --- a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
@@ -85,7 +85,7 @@ const SecurityOrigin* GetParentSecurityOrigin() const override { return nullptr; } - Optional<WebAddressSpace> GetAddressSpace() const override { + Optional<mojom::IPAddressSpace> GetAddressSpace() const override { return WTF::make_optional( execution_context_->GetSecurityContext().AddressSpace()); } @@ -121,7 +121,7 @@ }; TEST_F(BaseFetchContextTest, SetIsExternalRequestForPublicContext) { - EXPECT_EQ(kWebAddressSpacePublic, + EXPECT_EQ(mojom::IPAddressSpace::kPublic, execution_context_->GetSecurityContext().AddressSpace()); struct TestCase { @@ -172,8 +172,8 @@ TEST_F(BaseFetchContextTest, SetIsExternalRequestForPrivateContext) { execution_context_->GetSecurityContext().SetAddressSpace( - kWebAddressSpacePrivate); - EXPECT_EQ(kWebAddressSpacePrivate, + mojom::IPAddressSpace::kPrivate); + EXPECT_EQ(mojom::IPAddressSpace::kPrivate, execution_context_->GetSecurityContext().AddressSpace()); struct TestCase { @@ -224,8 +224,8 @@ TEST_F(BaseFetchContextTest, SetIsExternalRequestForLocalContext) { execution_context_->GetSecurityContext().SetAddressSpace( - kWebAddressSpaceLocal); - EXPECT_EQ(kWebAddressSpaceLocal, + mojom::IPAddressSpace::kLocal); + EXPECT_EQ(mojom::IPAddressSpace::kLocal, execution_context_->GetSecurityContext().AddressSpace()); struct TestCase {
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp index 6615b440..f014b84 100644 --- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp +++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -775,16 +775,15 @@ // It never makes sense to have a document loader that is detached from its // frame have any loads active, so go ahead and kill all the loads. fetcher_->StopFetching(); - if (frame_ && !SentDidFinishLoad()) LoadFailed(ResourceError::CancelledError(Url())); + fetcher_->ClearContext(); // If that load cancellation triggered another detach, leave. // (fast/frames/detach-frame-nested-no-crash.html is an example of this.) if (!frame_) return; - fetcher_->ClearContext(); application_cache_host_->DetachFromDocumentLoader(); application_cache_host_.Clear(); service_worker_network_provider_ = nullptr;
diff --git a/third_party/WebKit/Source/core/loader/EmptyClients.cpp b/third_party/WebKit/Source/core/loader/EmptyClients.cpp index 0c6bc83..bee2dc83 100644 --- a/third_party/WebKit/Source/core/loader/EmptyClients.cpp +++ b/third_party/WebKit/Source/core/loader/EmptyClients.cpp
@@ -49,9 +49,6 @@ DEFINE_STATIC_LOCAL(ChromeClient, dummy_chrome_client, (EmptyChromeClient::Create())); page_clients.chrome_client = &dummy_chrome_client; - - DEFINE_STATIC_LOCAL(EmptyEditorClient, dummy_editor_client, ()); - page_clients.editor_client = &dummy_editor_client; } class EmptyPopupMenu : public PopupMenu {
diff --git a/third_party/WebKit/Source/core/loader/EmptyClients.h b/third_party/WebKit/Source/core/loader/EmptyClients.h index 7abed33d..4248c351 100644 --- a/third_party/WebKit/Source/core/loader/EmptyClients.h +++ b/third_party/WebKit/Source/core/loader/EmptyClients.h
@@ -37,7 +37,6 @@ #include "core/frame/LocalFrameClient.h" #include "core/frame/RemoteFrameClient.h" #include "core/page/ChromeClient.h" -#include "core/page/EditorClient.h" #include "core/page/Page.h" #include "platform/DragImage.h" #include "platform/WebFrameScheduler.h" @@ -313,8 +312,8 @@ void DidRunInsecureContent(const SecurityOrigin*, const KURL&) override {} void DidDetectXSS(const KURL&, bool) override {} void DidDispatchPingLoader(const KURL&) override {} - void DidDisplayContentWithCertificateErrors(const KURL&) override {} - void DidRunContentWithCertificateErrors(const KURL&) override {} + void DidDisplayContentWithCertificateErrors() override {} + void DidRunContentWithCertificateErrors() override {} void SelectorMatchChanged(const Vector<String>&, const Vector<String>&) override {} LocalFrame* CreateFrame(const AtomicString&, HTMLFrameOwnerElement*) override; @@ -402,28 +401,6 @@ DISALLOW_COPY_AND_ASSIGN(EmptySpellCheckPanelHostClient); }; -class EmptyEditorClient final : public EditorClient { - USING_FAST_MALLOC(EmptyEditorClient); - - public: - EmptyEditorClient() : EditorClient() {} - ~EmptyEditorClient() override {} - - void RespondToChangedContents() override {} - void RespondToChangedSelection(LocalFrame*, SelectionType) override {} - - bool CanCopyCut(LocalFrame*, bool default_value) const override { - return default_value; - } - bool CanPaste(LocalFrame*, bool default_value) const override { - return default_value; - } - - bool HandleKeyboardEvent(LocalFrame*) override { return false; } - - DISALLOW_COPY_AND_ASSIGN(EmptyEditorClient); -}; - class CORE_EXPORT EmptyRemoteFrameClient : public RemoteFrameClient { public: EmptyRemoteFrameClient();
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp index 37d8d30..4186195 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -185,21 +185,20 @@ struct FrameFetchContext::FrozenState final : GarbageCollectedFinalized<FrozenState> { - FrozenState( - ReferrerPolicy referrer_policy, - const String& outgoing_referrer, - const KURL& url, - scoped_refptr<const SecurityOrigin> security_origin, - scoped_refptr<const SecurityOrigin> parent_security_origin, - const Optional<WebAddressSpace>& address_space, - const ContentSecurityPolicy* content_security_policy, - KURL site_for_cookies, - scoped_refptr<const SecurityOrigin> requestor_origin, - const ClientHintsPreferences& client_hints_preferences, - float device_pixel_ratio, - const String& user_agent, - bool is_main_frame, - bool is_svg_image_chrome_client) + FrozenState(ReferrerPolicy referrer_policy, + const String& outgoing_referrer, + const KURL& url, + scoped_refptr<const SecurityOrigin> security_origin, + scoped_refptr<const SecurityOrigin> parent_security_origin, + const Optional<mojom::IPAddressSpace>& address_space, + const ContentSecurityPolicy* content_security_policy, + KURL site_for_cookies, + scoped_refptr<const SecurityOrigin> requestor_origin, + const ClientHintsPreferences& client_hints_preferences, + float device_pixel_ratio, + const String& user_agent, + bool is_main_frame, + bool is_svg_image_chrome_client) : referrer_policy(referrer_policy), outgoing_referrer(outgoing_referrer), url(url), @@ -220,7 +219,7 @@ const KURL url; const scoped_refptr<const SecurityOrigin> security_origin; const scoped_refptr<const SecurityOrigin> parent_security_origin; - const Optional<WebAddressSpace> address_space; + const Optional<mojom::IPAddressSpace> address_space; const Member<const ContentSecurityPolicy> content_security_policy; const KURL site_for_cookies; const scoped_refptr<const SecurityOrigin> requestor_origin; @@ -353,7 +352,8 @@ if (save_data_enabled_) request.SetHTTPHeaderField(HTTPNames::Save_Data, "on"); - if (GetLocalFrameClient()->IsClientLoFiActiveForFrame()) { + if (GetLocalFrameClient()->GetPreviewsStateForFrame() & + WebURLRequest::kClientLoFiOn) { request.AddHTTPHeaderField( "Intervention", "<https://www.chromestatus.com/features/6072546726248448>; " @@ -516,11 +516,11 @@ ->Loader() .GetProvisionalDocumentLoader()) { FrameClientHintsPreferencesContext hints_context(GetFrame()); - if (IsClientHintsAllowed(response.Url())) { + document_loader_->GetClientHintsPreferences() .UpdateFromAcceptClientHintsHeader( response.HttpHeaderField(HTTPNames::Accept_CH), &hints_context); - } + // When response is received with a provisional docloader, the resource // haven't committed yet, and we cannot load resources, only preconnect. resource_loading_policy = LinkLoader::kDoNotLoadResources; @@ -832,14 +832,12 @@ const ClientHintsPreferences& hints_preferences, const FetchParameters::ResourceWidth& resource_width, ResourceRequest& request) { - if (!IsClientHintsAllowed(request.Url())) - return; - WebEnabledClientHints enabled_hints; // Check if |url| is allowed to run JavaScript. If not, client hints are not // attached to the requests that initiate on the render side. if (blink::RuntimeEnabledFeatures::ClientHintsPersistentEnabled() && - GetContentSettingsClient() && AllowScriptFromSource(request.Url())) { + IsClientHintsAllowed(request.Url()) && GetContentSettingsClient() && + AllowScriptFromSource(request.Url())) { // TODO(tbansal): crbug.com/735518 This code path is not executed for main // frame navigations when browser side navigation is enabled. For main // frame requests with browser side navigation enabled, the client hints @@ -1075,7 +1073,7 @@ return parent->GetSecurityContext()->GetSecurityOrigin(); } -Optional<WebAddressSpace> FrameFetchContext::GetAddressSpace() const { +Optional<mojom::IPAddressSpace> FrameFetchContext::GetAddressSpace() const { if (IsDetached()) return frozen_state_->address_space; if (!document_)
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.h b/third_party/WebKit/Source/core/loader/FrameFetchContext.h index bd78b02..0cd6e58 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.h +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.h
@@ -217,7 +217,7 @@ String GetOutgoingReferrer() const override; const KURL& Url() const override; const SecurityOrigin* GetParentSecurityOrigin() const override; - Optional<WebAddressSpace> GetAddressSpace() const override; + Optional<mojom::IPAddressSpace> GetAddressSpace() const override; const ContentSecurityPolicy* GetContentSecurityPolicy() const override; void AddConsoleMessage(ConsoleMessage*) const override;
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp index 53035249..288c5df 100644 --- a/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp +++ b/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp
@@ -31,6 +31,7 @@ #include "core/loader/FrameFetchContext.h" #include <memory> +#include "common/net/ip_address_space.mojom-blink.h" #include "core/dom/Document.h" #include "core/frame/FrameOwner.h" #include "core/frame/FrameTypes.h" @@ -54,7 +55,6 @@ #include "platform/testing/HistogramTester.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityViolationReportingPolicy.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebClientHintsType.h" #include "public/platform/WebDocumentSubresourceFilter.h" #include "public/platform/WebInsecureRequestPolicy.h" @@ -90,12 +90,12 @@ class FrameFetchContextMockLocalFrameClient : public EmptyLocalFrameClient { public: FrameFetchContextMockLocalFrameClient() : EmptyLocalFrameClient() {} - MOCK_METHOD1(DidDisplayContentWithCertificateErrors, void(const KURL&)); + MOCK_METHOD0(DidDisplayContentWithCertificateErrors, void()); MOCK_METHOD2(DispatchDidLoadResourceFromMemoryCache, void(const ResourceRequest&, const ResourceResponse&)); MOCK_METHOD0(UserAgent, String()); MOCK_METHOD0(MayUseClientLoFiForImageRequests, bool()); - MOCK_METHOD0(IsClientLoFiActiveForFrame, bool()); + MOCK_CONST_METHOD0(GetPreviewsStateForFrame, WebURLRequest::PreviewsState()); }; class FixedPolicySubresourceFilter : public WebDocumentSubresourceFilter { @@ -561,7 +561,7 @@ preferences.SetShouldSendForTesting(mojom::WebClientHintsType::kDeviceMemory); document->GetClientHintsPreferences().UpdateFrom(preferences); ApproximatedDeviceMemory::SetPhysicalMemoryMBForTesting(4096); - ExpectHeader("http://www.example.com/1.gif", "Device-Memory", false, ""); + ExpectHeader("http://www.example.com/1.gif", "Device-Memory", true, "4"); ExpectHeader("http://www.example.com/1.gif", "DPR", false, ""); ExpectHeader("http://www.example.com/1.gif", "Width", false, ""); ExpectHeader("http://www.example.com/1.gif", "Viewport-Width", false, ""); @@ -611,6 +611,18 @@ ExpectHeader("https://www.example.com/1.gif", "Viewport-Width", false, ""); } +TEST_F(FrameFetchContextHintsTest, MonitorDPRHintsInsecureTransport) { + ExpectHeader("http://www.example.com/1.gif", "DPR", false, ""); + ClientHintsPreferences preferences; + preferences.SetShouldSendForTesting(mojom::WebClientHintsType::kDpr); + document->GetClientHintsPreferences().UpdateFrom(preferences); + ExpectHeader("http://www.example.com/1.gif", "DPR", true, "1"); + dummy_page_holder->GetPage().SetDeviceScaleFactorDeprecated(2.5); + ExpectHeader("http://www.example.com/1.gif", "DPR", true, "2.5"); + ExpectHeader("http://www.example.com/1.gif", "Width", false, ""); + ExpectHeader("http://www.example.com/1.gif", "Viewport-Width", false, ""); +} + TEST_F(FrameFetchContextHintsTest, MonitorResourceWidthHints) { ExpectHeader("https://www.example.com/1.gif", "Width", false, ""); ClientHintsPreferences preferences; @@ -1015,7 +1027,7 @@ response.SetHasMajorCertificateErrors(true); Resource* resource = MockResource::Create(resource_request); resource->SetResponse(response); - EXPECT_CALL(*client, DidDisplayContentWithCertificateErrors(url)); + EXPECT_CALL(*client, DidDisplayContentWithCertificateErrors()); fetch_context->DispatchDidLoadResourceFromMemoryCache( CreateUniqueIdentifier(), resource_request, resource->GetResponse()); } @@ -1067,7 +1079,7 @@ document->SetSecurityOrigin(SecurityOrigin::Create(KURL(origin))); document->SetURL(document_url); document->SetReferrerPolicy(kReferrerPolicyOrigin); - document->SetAddressSpace(kWebAddressSpacePublic); + document->SetAddressSpace(mojom::IPAddressSpace::kPublic); dummy_page_holder = nullptr; @@ -1389,16 +1401,16 @@ TEST_F(FrameFetchContextMockedLocalFrameClientTest, ClientLoFiInterventionHeader) { // Verify header not added if Lo-Fi not active. - EXPECT_CALL(*client, IsClientLoFiActiveForFrame()) - .WillRepeatedly(::testing::Return(false)); + EXPECT_CALL(*client, GetPreviewsStateForFrame()) + .WillRepeatedly(::testing::Return(WebURLRequest::kPreviewsOff)); ResourceRequest resource_request("http://www.example.com/style.css"); fetch_context->AddAdditionalRequestHeaders(resource_request, kFetchMainResource); EXPECT_EQ(g_null_atom, resource_request.HttpHeaderField("Intervention")); // Verify header is added if Lo-Fi is active. - EXPECT_CALL(*client, IsClientLoFiActiveForFrame()) - .WillRepeatedly(::testing::Return(true)); + EXPECT_CALL(*client, GetPreviewsStateForFrame()) + .WillRepeatedly(::testing::Return(WebURLRequest::kClientLoFiOn)); fetch_context->AddAdditionalRequestHeaders(resource_request, kFetchSubresource); EXPECT_EQ(
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp index 61751db..0b9a5ccd 100644 --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -744,6 +744,7 @@ !request.GetResourceRequest().IsSameDocumentNavigation() && !frame_->Client()->AllowContentInitiatedDataUrlNavigations( request.OriginDocument()->Url()) && + !request.GetResourceRequest().GetSuggestedFilename().has_value() && url.ProtocolIsData() && NetworkUtils::IsDataURLMimeTypeSupported(url)) { frame_->GetDocument()->AddConsoleMessage(ConsoleMessage::Create( kSecurityMessageSource, kErrorMessageLevel,
diff --git a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp index 6a6a0df4..38639d38 100644 --- a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp +++ b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
@@ -28,6 +28,7 @@ #include "core/loader/MixedContentChecker.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/dom/Document.h" #include "core/frame/ContentSettingsClient.h" #include "core/frame/Frame.h" @@ -45,7 +46,6 @@ #include "platform/weborigin/SchemeRegistry.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/wtf/text/StringBuilder.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebInsecureRequestPolicy.h" #include "public/platform/WebMixedContent.h" #include "public/platform/WebSecurityOrigin.h" @@ -599,7 +599,7 @@ // Just count these for the moment, don't block them. if (NetworkUtils::IsReservedIPAddress(resource_ip_address) && - frame->GetDocument()->AddressSpace() == kWebAddressSpacePublic) { + frame->GetDocument()->AddressSpace() == mojom::IPAddressSpace::kPublic) { UseCounter::Count(frame->GetDocument(), WebFeature::kMixedContentPrivateHostnameInPublicHostname); // We can simplify the IP checks here, as we've already verified that @@ -648,12 +648,12 @@ WebMixedContent::ContextTypeFromRequestContext( request_context, strict_mixed_content_checking_for_plugin); if (context_type == WebMixedContentContextType::kBlockable) { - client->DidRunContentWithCertificateErrors(response.Url()); + client->DidRunContentWithCertificateErrors(); } else { // contextTypeFromRequestContext() never returns NotMixedContent (it // computes the type of mixed content, given that the content is mixed). DCHECK_NE(context_type, WebMixedContentContextType::kNotMixedContent); - client->DidDisplayContentWithCertificateErrors(response.Url()); + client->DidDisplayContentWithCertificateErrors(); } }
diff --git a/third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp b/third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp index 7ba4d269..fa2cdf1 100644 --- a/third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp +++ b/third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp
@@ -115,8 +115,8 @@ public: MixedContentCheckerMockLocalFrameClient() : EmptyLocalFrameClient() {} MOCK_METHOD0(DidContainInsecureFormAction, void()); - MOCK_METHOD1(DidDisplayContentWithCertificateErrors, void(const KURL&)); - MOCK_METHOD1(DidRunContentWithCertificateErrors, void(const KURL&)); + MOCK_METHOD0(DidDisplayContentWithCertificateErrors, void()); + MOCK_METHOD0(DidRunContentWithCertificateErrors, void()); }; } // namespace @@ -133,7 +133,7 @@ dummy_page_holder->GetFrame().GetDocument()->SetURL(main_resource_url); ResourceResponse response1(ran_url); - EXPECT_CALL(*client, DidRunContentWithCertificateErrors(ran_url)); + EXPECT_CALL(*client, DidRunContentWithCertificateErrors()); MixedContentChecker::HandleCertificateError( &dummy_page_holder->GetFrame(), response1, network::mojom::RequestContextFrameType::kNone, @@ -148,7 +148,7 @@ request_context, dummy_page_holder->GetFrame() .GetSettings() ->GetStrictMixedContentCheckingForPlugin())); - EXPECT_CALL(*client, DidDisplayContentWithCertificateErrors(displayed_url)); + EXPECT_CALL(*client, DidDisplayContentWithCertificateErrors()); MixedContentChecker::HandleCertificateError( &dummy_page_holder->GetFrame(), response2, network::mojom::RequestContextFrameType::kNone, request_context);
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp index 48d09aa..25835c5 100644 --- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.cpp
@@ -203,7 +203,7 @@ return nullptr; } -Optional<WebAddressSpace> WorkerFetchContext::GetAddressSpace() const { +Optional<mojom::IPAddressSpace> WorkerFetchContext::GetAddressSpace() const { return WTF::make_optional(global_scope_->GetSecurityContext().AddressSpace()); } @@ -283,9 +283,9 @@ WebMixedContent::ContextTypeFromRequestContext( request_context, false /* strictMixedContentCheckingForPlugin */); if (context_type == WebMixedContentContextType::kBlockable) { - web_context_->DidRunContentWithCertificateErrors(response.Url()); + web_context_->DidRunContentWithCertificateErrors(); } else { - web_context_->DidDisplayContentWithCertificateErrors(response.Url()); + web_context_->DidDisplayContentWithCertificateErrors(); } } probe::didReceiveResourceResponse(global_scope_, identifier, nullptr,
diff --git a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h index cf1f63e..5642d2a 100644 --- a/third_party/WebKit/Source/core/loader/WorkerFetchContext.h +++ b/third_party/WebKit/Source/core/loader/WorkerFetchContext.h
@@ -59,7 +59,7 @@ String GetOutgoingReferrer() const override; const KURL& Url() const override; const SecurityOrigin* GetParentSecurityOrigin() const override; - Optional<WebAddressSpace> GetAddressSpace() const override; + Optional<mojom::IPAddressSpace> GetAddressSpace() const override; const ContentSecurityPolicy* GetContentSecurityPolicy() const override; void AddConsoleMessage(ConsoleMessage*) const override;
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp index 0a119295..4320875 100644 --- a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp +++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
@@ -137,7 +137,8 @@ AdvanceState(State::kFetchingSelf); - // Step 1 is done in InitiateInternalModuleScriptGraphFetching(). + // Step 1. Let visited set be << url >>. + visited_set_.insert(request.Url()); // Step 2. Perform the internal module script graph fetching procedure given // ... with the top-level module fetch flag set. ... @@ -170,20 +171,8 @@ void ModuleTreeLinker::InitiateInternalModuleScriptGraphFetching( const ModuleScriptFetchRequest& request, ModuleGraphLevel level) { - DCHECK(!visited_set_.Contains(request.Url())); - - // This step originates from the callers of [IMSGF]: - // - // https://html.spec.whatwg.org/#fetch-a-module-script-tree - // https://html.spec.whatwg.org/#fetch-a-module-worker-script-tree - // Step 1. Let visited set be << url >>. - // - // [FD] Step 5.3.2. Append url to visited set. - visited_set_.insert(request.Url()); - // [IMSGF] Step 1. Assert: visited set contains url. - // - // This is ensured by the insert() just above. + DCHECK(visited_set_.Contains(request.Url())); ++num_incomplete_fetches_; @@ -304,9 +293,7 @@ urls.push_back(url); // [FD] Step 5.3.2. Append url to visited set. - // - // This step is deferred to InitiateInternalModuleScriptGraphFetching() - // below. + visited_set_.insert(url); positions.push_back(module_request.position); }
diff --git a/third_party/WebKit/Source/core/messaging/MessagePort.cpp b/third_party/WebKit/Source/core/messaging/MessagePort.cpp index 22b848a..558c5aa5 100644 --- a/third_party/WebKit/Source/core/messaging/MessagePort.cpp +++ b/third_party/WebKit/Source/core/messaging/MessagePort.cpp
@@ -88,32 +88,18 @@ if (exception_state.HadException()) return; - channel_.PostMojoMessage( - mojom::blink::TransferableMessage::WrapAsMessage(std::move(msg))); + mojo::Message mojo_message = + mojom::blink::TransferableMessage::WrapAsMessage(std::move(msg)); + connector_->Accept(&mojo_message); } MessagePortChannel MessagePort::Disentangle() { DCHECK(!IsNeutered()); - channel_.ClearCallback(); - auto result = std::move(channel_); - channel_ = MessagePortChannel(); + auto result = MessagePortChannel(connector_->PassMessagePipe()); + connector_ = nullptr; return result; } -// Invoked to notify us that there are messages available for this port. -// This code may be called from another thread, and so should not call any -// non-threadsafe APIs (i.e. should not call into the entangled channel or -// access mutable variables). -void MessagePort::MessageAvailable() { - // Don't post another task if there's an identical one pending. - if (AtomicTestAndSetToOne(&pending_dispatch_task_)) - return; - - PostCrossThreadTask(*task_runner_, FROM_HERE, - CrossThreadBind(&MessagePort::DispatchMessages, - WrapCrossThreadPersistent(this))); -} - void MessagePort::start() { // Do nothing if we've been cloned or closed. if (!IsEntangled()) @@ -123,98 +109,39 @@ if (started_) return; - // Note that MessagePortChannel may call this callback on any thread. - channel_.SetCallback( - ConvertToBaseCallback(CrossThreadBind( - &MessagePort::MessageAvailable, WrapCrossThreadWeakPersistent(this))), - task_runner_); started_ = true; - MessageAvailable(); + connector_->ResumeIncomingMethodCallProcessing(); } void MessagePort::close() { // A closed port should not be neutered, so rather than merely disconnecting // from the mojo message pipe, also entangle with a new dangling message pipe. - channel_.ClearCallback(); - if (IsEntangled()) - channel_ = MessagePortChannel(mojo::MessagePipe().handle0); + if (!IsNeutered()) { + connector_ = nullptr; + Entangle(mojo::MessagePipe().handle0); + } closed_ = true; } void MessagePort::Entangle(mojo::ScopedMessagePipeHandle handle) { - Entangle(MessagePortChannel(std::move(handle))); + // Only invoked to set our initial entanglement. + DCHECK(handle.is_valid()); + DCHECK(!connector_); + DCHECK(GetExecutionContext()); + connector_ = std::make_unique<mojo::Connector>( + std::move(handle), mojo::Connector::SINGLE_THREADED_SEND, task_runner_); + connector_->PauseIncomingMethodCallProcessing(); + connector_->set_incoming_receiver(this); } void MessagePort::Entangle(MessagePortChannel channel) { - // Only invoked to set our initial entanglement. - DCHECK(!channel_.GetHandle().is_valid()); - DCHECK(channel.GetHandle().is_valid()); - DCHECK(GetExecutionContext()); - - channel_ = std::move(channel); + Entangle(channel.ReleaseHandle()); } const AtomicString& MessagePort::InterfaceName() const { return EventTargetNames::MessagePort; } -bool MessagePort::TryGetMessage(BlinkTransferableMessage& message) { - if (IsNeutered()) - return false; - - mojo::Message mojo_message; - if (!channel_.GetMojoMessage(&mojo_message)) - return false; - - if (!mojom::blink::TransferableMessage::DeserializeFromMessage( - std::move(mojo_message), &message)) { - return false; - } - - return true; -} - -void MessagePort::DispatchMessages() { - // Signal to |MessageAvailable()| that there are no ongoing - // dispatches of messages. This can cause redundantly posted - // tasks, but safely avoids messages languishing. - ReleaseStore(&pending_dispatch_task_, 0); - - // Messages for contexts that are not fully active get dispatched too, but - // JSAbstractEventListener::handleEvent() doesn't call handlers for these. - // The HTML5 spec specifies that any messages sent to a document that is not - // fully active should be dropped, so this behavior is OK. - if (!Started()) - return; - - // There's an upper bound on the loop iterations in one DispatchMessages call, - // otherwise page JS could make it loop forever or starve other work. - for (int i = 0; i < kMaximumMessagesPerTask; ++i) { - // Because close() doesn't cancel any in flight calls to dispatchMessages(), - // and can be triggered by the onmessage event handler, we need to check if - // the port is still open before each dispatch. - if (closed_) - break; - - // WorkerGlobalScope::close() in Worker onmessage handler should prevent - // the next message from dispatching. - if (GetExecutionContext()->IsWorkerGlobalScope() && - ToWorkerGlobalScope(GetExecutionContext())->IsClosing()) { - break; - } - - BlinkTransferableMessage message; - if (!TryGetMessage(message)) - break; - - MessagePortArray* ports = MessagePort::EntanglePorts( - *GetExecutionContext(), std::move(message.ports)); - Event* evt = MessageEvent::Create(ports, std::move(message.message)); - - DispatchEvent(evt); - } -} - bool MessagePort::HasPendingActivity() const { // The spec says that entangled message ports should always be treated as if // they have a strong reference. @@ -285,7 +212,7 @@ } MojoHandle MessagePort::EntangledHandleForTesting() const { - return channel_.GetHandle().get().value(); + return connector_->handle().value(); } void MessagePort::Trace(blink::Visitor* visitor) { @@ -293,4 +220,47 @@ EventTargetWithInlineData::Trace(visitor); } +bool MessagePort::Accept(mojo::Message* mojo_message) { + // Connector repeatedly calls Accept as long as any messages are available. To + // avoid completely starving the event loop and give some time for other tasks + // the connector is temporarily paused after |kMaximumMessagesPerTask| have + // been received without other tasks having had a chance to run (in particular + // the ResetMessageCount task posted here). + if (messages_in_current_task_ == 0) { + task_runner_->PostTask(FROM_HERE, WTF::Bind(&MessagePort::ResetMessageCount, + WrapWeakPersistent(this))); + } + ++messages_in_current_task_; + if (messages_in_current_task_ > kMaximumMessagesPerTask) { + connector_->PauseIncomingMethodCallProcessing(); + } + + BlinkTransferableMessage message; + if (!mojom::blink::TransferableMessage::DeserializeFromMessage( + std::move(*mojo_message), &message)) { + return false; + } + + // WorkerGlobalScope::close() in Worker onmessage handler should prevent + // the next message from dispatching. + if (GetExecutionContext()->IsWorkerGlobalScope() && + ToWorkerGlobalScope(GetExecutionContext())->IsClosing()) { + return true; + } + + MessagePortArray* ports = MessagePort::EntanglePorts( + *GetExecutionContext(), std::move(message.ports)); + Event* evt = MessageEvent::Create(ports, std::move(message.message)); + DispatchEvent(evt); + return true; +} + +void MessagePort::ResetMessageCount() { + DCHECK_GT(messages_in_current_task_, 0); + messages_in_current_task_ = 0; + // No-op if not paused already. + if (connector_) + connector_->ResumeIncomingMethodCallProcessing(); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/messaging/MessagePort.h b/third_party/WebKit/Source/core/messaging/MessagePort.h index cc3a971e..3049be4 100644 --- a/third_party/WebKit/Source/core/messaging/MessagePort.h +++ b/third_party/WebKit/Source/core/messaging/MessagePort.h
@@ -42,13 +42,13 @@ namespace blink { -struct BlinkTransferableMessage; class ExceptionState; class ExecutionContext; class ScriptState; class SerializedScriptValue; class CORE_EXPORT MessagePort : public EventTargetWithInlineData, + public mojo::MessageReceiver, public ActiveScriptWrappable<MessagePort>, public ContextLifecycleObserver { DEFINE_WRAPPERTYPEINFO(); @@ -119,7 +119,7 @@ // A port gets neutered when it is transferred to a new owner via // postMessage(). - bool IsNeutered() const { return !channel_.GetHandle().is_valid(); } + bool IsNeutered() const { return !connector_ || !connector_->is_valid(); } // For testing only: allows inspection of the entangled channel. MojoHandle EntangledHandleForTesting() const; @@ -128,15 +128,15 @@ protected: explicit MessagePort(ExecutionContext&); - bool TryGetMessage(BlinkTransferableMessage&); private: - void MessageAvailable(); - void DispatchMessages(); + // mojo::MessageReceiver implementation. + bool Accept(mojo::Message*) override; + void ResetMessageCount(); - MessagePortChannel channel_; + std::unique_ptr<mojo::Connector> connector_; + int messages_in_current_task_ = 0; - int pending_dispatch_task_ = 0; bool started_ = false; bool closed_ = false;
diff --git a/third_party/WebKit/Source/core/mojo/MojoHandle.cpp b/third_party/WebKit/Source/core/mojo/MojoHandle.cpp index ad5ec65..4943b16b 100644 --- a/third_party/WebKit/Source/core/mojo/MojoHandle.cpp +++ b/third_party/WebKit/Source/core/mojo/MojoHandle.cpp
@@ -210,11 +210,12 @@ MOJO_MAP_BUFFER_FLAG_NONE); result_dict.setResult(result); if (result == MOJO_RESULT_OK) { - WTF::ArrayBufferContents::DataHandle data_handle(data, [](void* buffer) { - MojoResult result = MojoUnmapBuffer(buffer); - DCHECK_EQ(result, MOJO_RESULT_OK); - }); - WTF::ArrayBufferContents contents(std::move(data_handle), num_bytes, + WTF::ArrayBufferContents::DataHandle data_handle( + data, num_bytes, [](void* buffer) { + MojoResult result = MojoUnmapBuffer(buffer); + DCHECK_EQ(result, MOJO_RESULT_OK); + }); + WTF::ArrayBufferContents contents(std::move(data_handle), WTF::ArrayBufferContents::kNotShared); result_dict.setBuffer(DOMArrayBuffer::Create(contents)); }
diff --git a/third_party/WebKit/Source/core/page/BUILD.gn b/third_party/WebKit/Source/core/page/BUILD.gn index 51cc76c..40595c2b 100644 --- a/third_party/WebKit/Source/core/page/BUILD.gn +++ b/third_party/WebKit/Source/core/page/BUILD.gn
@@ -24,8 +24,6 @@ "DragData.h", "DragSession.h", "DragState.h", - "EditorClient.cpp", - "EditorClient.h", "EventWithHitTestResults.h", "FocusChangedObserver.cpp", "FocusChangedObserver.h",
diff --git a/third_party/WebKit/Source/core/page/EditorClient.cpp b/third_party/WebKit/Source/core/page/EditorClient.cpp deleted file mode 100644 index a13833b..0000000 --- a/third_party/WebKit/Source/core/page/EditorClient.cpp +++ /dev/null
@@ -1,73 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. - * Copyright (C) 2012 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 APPLE COMPUTER, 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 "core/page/EditorClient.h" - -#include "core/editing/SelectionType.h" -#include "core/exported/WebViewImpl.h" -#include "core/frame/ContentSettingsClient.h" -#include "core/frame/WebLocalFrameImpl.h" -#include "public/web/WebFrameClient.h" -#include "public/web/WebViewClient.h" - -namespace blink { - -EditorClient::EditorClient(WebViewImpl& webview) : web_view_(&webview) {} - -EditorClient::~EditorClient() {} - -void EditorClient::RespondToChangedSelection(LocalFrame* frame, - SelectionType selection_type) { - WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(frame); - if (web_frame->Client()) - web_frame->Client()->DidChangeSelection(selection_type != kRangeSelection); -} - -void EditorClient::RespondToChangedContents() { - if (web_view_->Client()) - web_view_->Client()->DidChangeContents(); -} - -bool EditorClient::CanCopyCut(LocalFrame* frame, bool default_value) const { - if (!frame->GetContentSettingsClient()) - return default_value; - return frame->GetContentSettingsClient()->AllowWriteToClipboard( - default_value); -} - -bool EditorClient::CanPaste(LocalFrame* frame, bool default_value) const { - if (!frame->GetContentSettingsClient()) - return default_value; - return frame->GetContentSettingsClient()->AllowReadFromClipboard( - default_value); -} - -bool EditorClient::HandleKeyboardEvent(LocalFrame* frame) { - WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(frame); - return web_frame->Client()->HandleCurrentKeyboardEvent(); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/core/page/EditorClient.h b/third_party/WebKit/Source/core/page/EditorClient.h deleted file mode 100644 index fa9f6f1a..0000000 --- a/third_party/WebKit/Source/core/page/EditorClient.h +++ /dev/null
@@ -1,61 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) - * - * 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 APPLE COMPUTER, 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. - */ - -#ifndef EditorClient_h -#define EditorClient_h - -#include "core/CoreExport.h" -#include "core/editing/SelectionType.h" -#include "platform/wtf/Forward.h" - -namespace blink { - -class LocalFrame; -class WebViewImpl; - -class CORE_EXPORT EditorClient { - public: - explicit EditorClient(WebViewImpl&); - virtual ~EditorClient(); - - virtual void RespondToChangedContents(); - virtual void RespondToChangedSelection(LocalFrame*, SelectionType); - - virtual bool CanCopyCut(LocalFrame*, bool default_value) const; - virtual bool CanPaste(LocalFrame*, bool default_value) const; - - virtual bool HandleKeyboardEvent(LocalFrame*); - - protected: - EditorClient(){}; - - private: - WebViewImpl* web_view_; -}; - -} // namespace blink - -#endif // EditorClient_h
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp index 4ffc93c..5af70f39 100644 --- a/third_party/WebKit/Source/core/page/Page.cpp +++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -128,7 +128,6 @@ OverscrollController::Create(GetVisualViewport(), GetChromeClient())), main_frame_(nullptr), plugin_data_(nullptr), - editor_client_(page_clients.editor_client), use_counter_(page_clients.chrome_client && page_clients.chrome_client->IsSVGImageChromeClient() ? UseCounter::kSVGImageContext @@ -141,8 +140,6 @@ page_lifecycle_state_(PageLifecycleState::kUnknown), is_cursor_visible_(true), subframe_count_(0) { - DCHECK(editor_client_); - DCHECK(!AllPages().Contains(this)); AllPages().insert(this); } @@ -739,9 +736,7 @@ return ScrollbarTheme::DeprecatedStaticGetTheme(); } -Page::PageClients::PageClients() - : chrome_client(nullptr), - editor_client(nullptr) {} +Page::PageClients::PageClients() : chrome_client(nullptr) {} Page::PageClients::~PageClients() {}
diff --git a/third_party/WebKit/Source/core/page/Page.h b/third_party/WebKit/Source/core/page/Page.h index bd85d9f..d18e283 100644 --- a/third_party/WebKit/Source/core/page/Page.h +++ b/third_party/WebKit/Source/core/page/Page.h
@@ -58,7 +58,6 @@ class DOMRectList; class DragCaret; class DragController; -class EditorClient; class EventHandlerRegistry; class FocusController; class Frame; @@ -101,7 +100,6 @@ ~PageClients(); Member<ChromeClient> chrome_client; - EditorClient* editor_client; DISALLOW_COPY_AND_ASSIGN(PageClients); }; @@ -143,8 +141,6 @@ // PluginsChangedObservers. static void ResetPluginData(); - EditorClient& GetEditorClient() const { return *editor_client_; } - void SetMainFrame(Frame*); Frame* MainFrame() const { return main_frame_; } // Escape hatch for existing code that assumes that the root frame is @@ -354,7 +350,6 @@ Member<PluginData> plugin_data_; - EditorClient* const editor_client_; Member<ValidationMessageClient> validation_message_client_; UseCounter use_counter_;
diff --git a/third_party/WebKit/Source/core/page/PageWidgetDelegate.cpp b/third_party/WebKit/Source/core/page/PageWidgetDelegate.cpp index 10934e7e..cf81fa4 100644 --- a/third_party/WebKit/Source/core/page/PageWidgetDelegate.cpp +++ b/third_party/WebKit/Source/core/page/PageWidgetDelegate.cpp
@@ -202,16 +202,24 @@ return handler.HandleGestureEvent( static_cast<const WebGestureEvent&>(event)); + case WebInputEvent::kPointerDown: + case WebInputEvent::kPointerUp: + case WebInputEvent::kPointerMove: + case WebInputEvent::kPointerCancel: + case WebInputEvent::kPointerCausedUaAction: + if (!root || !root->View()) + return WebInputEventResult::kNotHandled; + return handler.HandlePointerEvent( + *root, static_cast<const WebPointerEvent&>(event), + coalesced_event.GetCoalescedEventsPointers()); + case WebInputEvent::kTouchStart: case WebInputEvent::kTouchMove: case WebInputEvent::kTouchEnd: case WebInputEvent::kTouchCancel: case WebInputEvent::kTouchScrollStarted: - if (!root || !root->View()) - return WebInputEventResult::kNotHandled; - return handler.HandleTouchEvent( - *root, static_cast<const WebTouchEvent&>(event), - coalesced_event.GetCoalescedEventsPointers()); + NOTREACHED(); + case WebInputEvent::kGesturePinchBegin: case WebInputEvent::kGesturePinchEnd: case WebInputEvent::kGesturePinchUpdate: @@ -267,15 +275,44 @@ return frame.GetEventHandler().HandleWheelEvent(transformed_event); } -WebInputEventResult PageWidgetEventHandler::HandleTouchEvent( +WebInputEventResult PageWidgetEventHandler::HandlePointerEvent( LocalFrame& main_frame, - const WebTouchEvent& event, + const WebPointerEvent& event, const std::vector<const WebInputEvent*>& coalesced_events) { - WebTouchEvent transformed_event = - TransformWebTouchEvent(main_frame.View(), event); - return main_frame.GetEventHandler().HandleTouchEvent( + WebPointerEvent transformed_event = + TransformWebPointerEvent(main_frame.View(), event); + return main_frame.GetEventHandler().HandlePointerEvent( transformed_event, - TransformWebTouchEventVector(main_frame.View(), coalesced_events)); + TransformWebPointerEventVector(main_frame.View(), coalesced_events)); +} + +WebInputEventResult PageWidgetEventHandler::HandleInputEventIncludingTouch( + const WebCoalescedInputEvent& coalesced_event) { + const WebInputEvent& input_event = coalesced_event.Event(); + if (WebInputEvent::IsTouchEventType(input_event.GetType())) { + if (input_event.GetType() == WebInputEvent::kTouchScrollStarted) { + WebPointerEvent pointer_event = + WebPointerEvent::CreatePointerCausesUaActionEvent( + WebPointerProperties::PointerType::kUnknown, + input_event.TimeStampSeconds()); + return HandleInputEventInternal(WebCoalescedInputEvent(pointer_event)); + } + const WebTouchEvent touch_event = + static_cast<const WebTouchEvent&>(input_event); + for (unsigned i = 0; i < touch_event.touches_length; ++i) { + const WebTouchPoint& touch_point = touch_event.touches[i]; + if (touch_point.state != blink::WebTouchPoint::kStateStationary) { + const WebPointerEvent& pointer_event = + WebPointerEvent(touch_event, touch_point); + const WebCoalescedInputEvent& coalesced_pointer_event = + GetCoalescedWebPointerEventForTouch( + pointer_event, coalesced_event.GetCoalescedEventsPointers()); + HandleInputEventInternal(coalesced_pointer_event); + } + } + return DispatchBufferedTouchEvents(); + } + return HandleInputEventInternal(coalesced_event); } } // namespace blink
diff --git a/third_party/WebKit/Source/core/page/PageWidgetDelegate.h b/third_party/WebKit/Source/core/page/PageWidgetDelegate.h index dcb31747..4f8d1db 100644 --- a/third_party/WebKit/Source/core/page/PageWidgetDelegate.h +++ b/third_party/WebKit/Source/core/page/PageWidgetDelegate.h
@@ -45,7 +45,7 @@ class WebKeyboardEvent; class WebMouseEvent; class WebMouseWheelEvent; -class WebTouchEvent; +class WebPointerEvent; class CORE_EXPORT PageWidgetEventHandler { public: @@ -60,11 +60,18 @@ virtual WebInputEventResult HandleKeyEvent(const WebKeyboardEvent&) = 0; virtual WebInputEventResult HandleCharEvent(const WebKeyboardEvent&) = 0; virtual WebInputEventResult HandleGestureEvent(const WebGestureEvent&) = 0; - virtual WebInputEventResult HandleTouchEvent( + virtual WebInputEventResult HandlePointerEvent( LocalFrame& main_frame, - const WebTouchEvent&, + const WebPointerEvent&, const std::vector<const WebInputEvent*>&); virtual ~PageWidgetEventHandler() {} + virtual WebInputEventResult DispatchBufferedTouchEvents() = 0; + + protected: + virtual WebInputEventResult HandleInputEventInternal( + const WebCoalescedInputEvent&) = 0; + WebInputEventResult HandleInputEventIncludingTouch( + const WebCoalescedInputEvent&); }; // Common implementation of WebViewImpl and WebPagePopupImpl. @@ -83,7 +90,6 @@ WebCanvas*, const WebRect&, LocalFrame& root); - // See FIXME in the function body about nullptr |root|. static WebInputEventResult HandleInputEvent( PageWidgetEventHandler&,
diff --git a/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp b/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp index 6f0c63d..38f630a 100644 --- a/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp +++ b/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp
@@ -549,7 +549,7 @@ interpolation_quality_context.emplace( context, geometry.ImageStyle().GetInterpolationQuality()); - if (bg_layer.MaskSourceType() == kMaskLuminance) + if (bg_layer.MaskSourceType() == EMaskSourceType::kLuminance) context.SetColorFilter(kColorFilterLuminanceToAlpha); // If op != SkBlendMode::kSrcOver, a mask is being painted.
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp index 9470dcd..04d6b2e 100644 --- a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp +++ b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
@@ -412,7 +412,7 @@ // on the same backing, skip the invalidation. if (ParentFullyInvalidatedOnSameBacking() && (context_.parent_context->old_visual_rect.Contains(rect) || - object_.Parent()->FragmentsVisualRectBoundingBox().Contains(rect))) { + object_.Parent()->FirstFragment().VisualRect().Contains(rect))) { if (!object_.GetFrameView()->IsTrackingPaintInvalidations()) return; // If we are tracking paint invalidations (e.g. when running a text-based-
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp index 9a55586..31784ec 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -294,7 +294,34 @@ offset.MoveBy(enclosing_pagination_layer->VisualOffsetFromAncestor( context.root_layer)); } else { - layer_.ConvertToLayerCoords(context.root_layer, offset); + const auto* current_transform = + fragment_data.PreEffectProperties().Transform(); + const auto& root_fragment = + context.root_layer->GetLayoutObject().FirstFragment(); + const auto* root_transform = + root_fragment.LocalBorderBoxProperties()->Transform(); + if (&layer_ == context.root_layer || + current_transform == root_transform) { + offset.MoveBy(fragment_data.PaintOffset()); + offset.MoveBy(-root_fragment.PaintOffset()); + } else { + const TransformationMatrix& transform = + GeometryMapper::SourceToDestinationProjection(current_transform, + root_transform); + + if (transform.IsIdentityOr2DTranslation()) { + offset.MoveBy(fragment_data.PaintOffset()); + // The transform should be an integer translation, up to floating + // point error. + offset.Move(LayoutSize((float)transform.E(), (float)transform.F())); + offset.MoveBy(-root_fragment.PaintOffset()); + } else { + // This branch can happen due to perspective transforms. + // TODO(chrishtr): investigate whether the paint code is broken + // in this case. + layer_.ConvertToLayerCoords(context.root_layer, offset); + } + } } } layer_bounds = LayoutRect(offset, LayoutSize(layer_.PixelSnappedSize()));
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp index 94d0502..8354194 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
@@ -1227,6 +1227,8 @@ IntSize PaintLayerScrollableArea::ScrollbarOffset( const Scrollbar& scrollbar) const { + // TODO(szager): Factor out vertical offset calculation into other methods, + // for symmetry with *ScrollbarStart methods for horizontal offset. if (&scrollbar == VerticalScrollbar()) { return IntSize( VerticalScrollbarStart(0, Layer()->PixelSnappedSize().Width()), @@ -1235,7 +1237,9 @@ if (&scrollbar == HorizontalScrollbar()) { return IntSize(HorizontalScrollbarStart(0), - GetLayoutBox()->BorderTop().ToInt() + VisibleHeight()); + GetLayoutBox()->BorderTop().ToInt() + + VisibleContentRect(kIncludeScrollbars).Height() - + HorizontalScrollbar()->ScrollbarThickness()); } NOTREACHED(); @@ -1580,15 +1584,17 @@ if (resize_control_rect.Contains(local_point)) return true; } - int resize_control_size = max(resize_control_rect.Height(), 0); + + IntRect visible_rect = VisibleContentRect(kIncludeScrollbars); + if (HasVerticalScrollbar() && VerticalScrollbar()->ShouldParticipateInHitTesting()) { LayoutRect v_bar_rect( VerticalScrollbarStart(0, Layer()->PixelSnappedSize().Width()), GetLayoutBox()->BorderTop().ToInt(), VerticalScrollbar()->ScrollbarThickness(), - VisibleContentRect(kIncludeScrollbars).Height() - + visible_rect.Height() - (HasHorizontalScrollbar() ? HorizontalScrollbar()->ScrollbarThickness() : resize_control_size)); @@ -1602,13 +1608,15 @@ if (HasHorizontalScrollbar() && HorizontalScrollbar()->ShouldParticipateInHitTesting()) { // TODO(crbug.com/638981): Are the conversions to int intentional? + int h_scrollbar_thickness = HorizontalScrollbar()->ScrollbarThickness(); LayoutRect h_bar_rect( HorizontalScrollbarStart(0), - GetLayoutBox()->BorderTop().ToInt() + VisibleHeight(), - VisibleContentRect(kIncludeScrollbars).Width() - - (HasVerticalScrollbar() ? VerticalScrollbar()->ScrollbarThickness() + GetLayoutBox()->BorderTop().ToInt() + visible_rect.Height() - + h_scrollbar_thickness, + visible_rect.Width() - (HasVerticalScrollbar() + ? VerticalScrollbar()->ScrollbarThickness() : resize_control_size), - HorizontalScrollbar()->ScrollbarThickness()); + h_scrollbar_thickness); if (h_bar_rect.Contains(local_point)) { result.SetScrollbar(HorizontalScrollbar()); return true;
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp index 65239c9d..4e04316 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -821,4 +821,46 @@ const auto* properties = scroller->FirstFragment().PaintProperties(); EXPECT_NE(nullptr, properties->ScrollTranslation()); } + +TEST_F(PaintLayerScrollableAreaTest, HitTestOverlayScrollbars) { + SetBodyInnerHTML(R"HTML( + <style> + html, body { + margin: 0; + } + #scroller { + overflow: scroll; + height: 100px; + width: 100px; + } + #scrolled { + width: 1000px; + height: 1000px; + } + </style> + <div id='scroller'><div id='scrolled'></div></div> + )HTML"); + GetDocument().View()->UpdateAllLifecyclePhases(); + auto* scroller = GetLayoutObjectByElementId("scroller"); + auto* scrollable_area = ToLayoutBoxModelObject(scroller)->GetScrollableArea(); + + scrollable_area->SetScrollbarsHidden(true); + + HitTestRequest hit_request(HitTestRequest::kMove | HitTestRequest::kReadOnly); + HitTestResult hit_result(hit_request, LayoutPoint(95, 5)); + GetDocument().GetLayoutView()->HitTest(hit_result); + EXPECT_EQ(hit_result.GetScrollbar(), nullptr); + hit_result = HitTestResult(hit_request, LayoutPoint(5, 95)); + GetDocument().GetLayoutView()->HitTest(hit_result); + EXPECT_EQ(hit_result.GetScrollbar(), nullptr); + + scrollable_area->SetScrollbarsHidden(false); + + hit_result = HitTestResult(hit_request, LayoutPoint(95, 5)); + GetDocument().GetLayoutView()->HitTest(hit_result); + EXPECT_EQ(hit_result.GetScrollbar(), scrollable_area->VerticalScrollbar()); + hit_result = HitTestResult(hit_request, LayoutPoint(5, 95)); + GetDocument().GetLayoutView()->HitTest(hit_result); + EXPECT_EQ(hit_result.GetScrollbar(), scrollable_area->HorizontalScrollbar()); +} }
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp index a6ab157..2b91bbc 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -1691,7 +1691,7 @@ } // Limit the maximum number of fragments, to avoid pathological situations. -static const int kMaxNumFragments = 2000; +static const int kMaxNumFragments = 500; void ObjectPaintPropertyTreeBuilder::UpdateFragments() { bool needs_paint_properties =
diff --git a/third_party/WebKit/Source/core/paint/ViewPainter.cpp b/third_party/WebKit/Source/core/paint/ViewPainter.cpp index 5e4eecff..065a5df 100644 --- a/third_party/WebKit/Source/core/paint/ViewPainter.cpp +++ b/third_party/WebKit/Source/core/paint/ViewPainter.cpp
@@ -34,6 +34,11 @@ DCHECK(!layout_view_.GetFrameView()->ShouldThrottleRendering()); + if (RuntimeEnabledFeatures::RootLayerScrollingEnabled()) { + BlockPainter(layout_view_).Paint(paint_info, paint_offset); + return; + } + layout_view_.PaintObject(paint_info, paint_offset); BlockPainter(layout_view_) .PaintOverflowControlsIfNeeded(paint_info, paint_offset);
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp index 5a8f719..1b71bdd 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp +++ b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
@@ -784,10 +784,12 @@ // clipping mask to properly clip the scrolled contents, even if there are no // composited descendants. bool has_clip_path = style.ClipPath(); - bool needs_child_clipping_mask = - (has_clip_path || style.HasBorderRadius()) && + bool needs_child_clipping_mask_for_border_radius = + style.HasBorderRadius() && (has_child_clipping_layer || IsAcceleratedContents(layout_object) || HasScrollingLayer()); + bool needs_child_clipping_mask = + has_clip_path || needs_child_clipping_mask_for_border_radius; GraphicsLayer* layer_to_apply_child_clipping_mask = nullptr; bool should_apply_child_clipping_mask_on_contents = false;
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositingLayerPropertyUpdater.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositingLayerPropertyUpdater.cpp index 0c472e43..dba7c93 100644 --- a/third_party/WebKit/Source/core/paint/compositing/CompositingLayerPropertyUpdater.cpp +++ b/third_party/WebKit/Source/core/paint/compositing/CompositingLayerPropertyUpdater.cpp
@@ -50,14 +50,23 @@ SetContainerLayerState(mapping->ChildClippingMaskLayer()); if (mapping->ScrollingContentsLayer()) { - auto SetContentsLayerState = [&fragment_data, &snapped_paint_offset]( - GraphicsLayer* graphics_layer) { - if (graphics_layer) { - graphics_layer->SetLayerState( - fragment_data.ContentsProperties(), - snapped_paint_offset + graphics_layer->OffsetFromLayoutObject()); - } - }; + auto paint_offset = snapped_paint_offset; + + // In flipped blocks writing mode, if there is scrollbar on the right, + // we move the contents to the left with extra amount of ScrollTranslation + // (-VerticalScrollbarWidth, 0). However, ScrollTranslation doesn't apply + // on ScrollingContentsLayer so we shift paint offset instead. + if (object.IsBox() && object.HasFlippedBlocksWritingMode()) + paint_offset.Move(ToLayoutBox(object).VerticalScrollbarWidth(), 0); + + auto SetContentsLayerState = + [&fragment_data, &paint_offset](GraphicsLayer* graphics_layer) { + if (graphics_layer) { + graphics_layer->SetLayerState( + fragment_data.ContentsProperties(), + paint_offset + graphics_layer->OffsetFromLayoutObject()); + } + }; SetContentsLayerState(mapping->ScrollingContentsLayer()); SetContentsLayerState(mapping->ForegroundLayer()); } else {
diff --git a/third_party/WebKit/Source/core/probe/CoreProbes.cpp b/third_party/WebKit/Source/core/probe/CoreProbes.cpp index c97fed3..c862f1d 100644 --- a/third_party/WebKit/Source/core/probe/CoreProbes.cpp +++ b/third_party/WebKit/Source/core/probe/CoreProbes.cpp
@@ -87,7 +87,7 @@ } void AsyncTaskScheduled(ExecutionContext* context, - const String& name, + const StringView& name, void* task) { TRACE_EVENT_FLOW_BEGIN1("devtools.timeline.async", "AsyncTask", TRACE_ID_LOCAL(reinterpret_cast<uintptr_t>(task)), @@ -104,7 +104,11 @@ } void AsyncTaskCanceled(ExecutionContext* context, void* task) { - if (ThreadDebugger* debugger = ThreadDebugger::From(ToIsolate(context))) + AsyncTaskCanceled(ToIsolate(context), task); +} + +void AsyncTaskCanceled(v8::Isolate* isolate, void* task) { + if (ThreadDebugger* debugger = ThreadDebugger::From(isolate)) debugger->AsyncTaskCanceled(AsyncId(task)); TRACE_EVENT_FLOW_END0("devtools.timeline.async", "AsyncTask", TRACE_ID_LOCAL(reinterpret_cast<uintptr_t>(task)));
diff --git a/third_party/WebKit/Source/core/probe/CoreProbes.h b/third_party/WebKit/Source/core/probe/CoreProbes.h index 68be563..12536494 100644 --- a/third_party/WebKit/Source/core/probe/CoreProbes.h +++ b/third_party/WebKit/Source/core/probe/CoreProbes.h
@@ -91,12 +91,13 @@ } CORE_EXPORT void AsyncTaskScheduled(ExecutionContext*, - const String& name, + const StringView& name, void*); CORE_EXPORT void AsyncTaskScheduledBreakable(ExecutionContext*, const char* name, void*); CORE_EXPORT void AsyncTaskCanceled(ExecutionContext*, void*); +CORE_EXPORT void AsyncTaskCanceled(v8::Isolate*, void*); CORE_EXPORT void AsyncTaskCanceledBreakable(ExecutionContext*, const char* name, void*);
diff --git a/third_party/WebKit/Source/core/script/DynamicModuleResolver.cpp b/third_party/WebKit/Source/core/script/DynamicModuleResolver.cpp index f77299e6..c730494 100644 --- a/third_party/WebKit/Source/core/script/DynamicModuleResolver.cpp +++ b/third_party/WebKit/Source/core/script/DynamicModuleResolver.cpp
@@ -144,7 +144,7 @@ void DynamicModuleResolver::ResolveDynamically( const String& specifier, - const KURL& referrer_url, + const KURL& referrer_resource_url, const ReferrerScriptInfo& referrer_info, ScriptPromiseResolver* promise_resolver) { DCHECK(modulator_->GetScriptState()->GetIsolate()->InContext()) @@ -159,13 +159,22 @@ // Step 2.1. "Let url be the result of resolving a module specifier // given referencing script and specifier." [spec text] - KURL context_url = - referrer_url.IsValid() - ? referrer_url - : ExecutionContext::From(modulator_->GetScriptState())->Url(); - DCHECK(context_url.IsValid()); + KURL base_url = referrer_info.BaseURL(); + if (base_url.IsNull()) { + // ReferrerScriptInfo::BaseURL returns null if it should defer to referrer + // resource url. + base_url = referrer_resource_url; + } + if (base_url.IsNull()) { + // In some cases, "referencing script" may not exist. Use the document's + // base URL as last resort. + // TODO(kouhei): Revisit this after + // https://github.com/whatwg/html/issues/3295 resolved. + base_url = ExecutionContext::From(modulator_->GetScriptState())->BaseURL(); + } + DCHECK(!base_url.IsNull()); - KURL url = Modulator::ResolveModuleSpecifier(specifier, context_url); + KURL url = Modulator::ResolveModuleSpecifier(specifier, base_url); if (!url.IsValid()) { // Step 2.2.1. "If the result is failure, then:" [spec text] // Step 2.2.2.1. "Let completion be Completion { [[Type]]: throw, [[Value]]:
diff --git a/third_party/WebKit/Source/core/script/DynamicModuleResolver.h b/third_party/WebKit/Source/core/script/DynamicModuleResolver.h index dfa93a7..eb1919c 100644 --- a/third_party/WebKit/Source/core/script/DynamicModuleResolver.h +++ b/third_party/WebKit/Source/core/script/DynamicModuleResolver.h
@@ -32,7 +32,7 @@ // Implements "HostImportModuleDynamically" semantics. // Should be called w/ a valid V8 context. void ResolveDynamically(const String& specifier, - const KURL& referrer_url, + const KURL& referrer_resource_url, const ReferrerScriptInfo& referrer_info, ScriptPromiseResolver*);
diff --git a/third_party/WebKit/Source/core/script/DynamicModuleResolverTest.cpp b/third_party/WebKit/Source/core/script/DynamicModuleResolverTest.cpp index c559983..2e674e8 100644 --- a/third_party/WebKit/Source/core/script/DynamicModuleResolverTest.cpp +++ b/third_party/WebKit/Source/core/script/DynamicModuleResolverTest.cpp
@@ -42,6 +42,10 @@ pending_client_->NotifyModuleTreeLoadFinished(module_script); pending_client_ = nullptr; } + void SetExpectedFetchTreeURL(const KURL& url) { + expected_fetch_tree_url_ = url; + } + bool fetch_tree_was_called() const { return fetch_tree_was_called_; } void Trace(blink::Visitor*); @@ -59,9 +63,10 @@ void FetchTree(const ModuleScriptFetchRequest& request, ModuleTreeClient* client) final { - EXPECT_EQ(TestDependencyURL(), request.Url()); + EXPECT_EQ(expected_fetch_tree_url_, request.Url()); pending_client_ = client; + fetch_tree_was_called_ = true; } ScriptValue ExecuteModule(const ModuleScript* module_script, @@ -74,6 +79,8 @@ scoped_refptr<ScriptState> script_state_; Member<ModuleTreeClient> pending_client_; + KURL expected_fetch_tree_url_; + bool fetch_tree_was_called_ = false; }; void DynamicModuleResolverTestModulator::Trace(blink::Visitor* visitor) { @@ -176,8 +183,9 @@ TEST(DynamicModuleResolverTest, ResolveSuccess) { V8TestingScope scope; - DynamicModuleResolverTestModulator* modulator = + auto modulator = new DynamicModuleResolverTestModulator(scope.GetScriptState()); + modulator->SetExpectedFetchTreeURL(TestDependencyURL()); auto promise_resolver = ScriptPromiseResolver::Create(scope.GetScriptState()); ScriptPromise promise = promise_resolver->Promise(); @@ -213,6 +221,7 @@ V8TestingScope scope; auto modulator = new DynamicModuleResolverTestModulator(scope.GetScriptState()); + modulator->SetExpectedFetchTreeURL(TestDependencyURL()); auto promise_resolver = ScriptPromiseResolver::Create(scope.GetScriptState()); ScriptPromise promise = promise_resolver->Promise(); @@ -236,6 +245,7 @@ V8TestingScope scope; auto modulator = new DynamicModuleResolverTestModulator(scope.GetScriptState()); + modulator->SetExpectedFetchTreeURL(TestDependencyURL()); auto promise_resolver = ScriptPromiseResolver::Create(scope.GetScriptState()); ScriptPromise promise = promise_resolver->Promise(); @@ -263,6 +273,7 @@ V8TestingScope scope; auto modulator = new DynamicModuleResolverTestModulator(scope.GetScriptState()); + modulator->SetExpectedFetchTreeURL(TestDependencyURL()); auto promise_resolver = ScriptPromiseResolver::Create(scope.GetScriptState()); ScriptPromise promise = promise_resolver->Promise(); @@ -299,6 +310,7 @@ auto modulator = new DynamicModuleResolverTestModulator(scope.GetScriptState()); + modulator->SetExpectedFetchTreeURL(TestDependencyURL()); auto promise_resolver = ScriptPromiseResolver::Create(scope.GetScriptState()); ScriptPromise promise = promise_resolver->Promise(); @@ -330,4 +342,26 @@ EXPECT_EQ("hello", capture->CapturedValue()); } +TEST(DynamicModuleResolverTest, ResolveWithReferrerScriptInfoBaseURL) { + V8TestingScope scope; + scope.GetDocument().SetURL(KURL("https://example.com")); + + auto modulator = + new DynamicModuleResolverTestModulator(scope.GetScriptState()); + modulator->SetExpectedFetchTreeURL( + KURL("https://example.com/correct/dependency.js")); + + auto promise_resolver = ScriptPromiseResolver::Create(scope.GetScriptState()); + auto resolver = DynamicModuleResolver::Create(modulator); + KURL wrong_base_url("https://example.com/wrong/bar.js"); + KURL correct_base_url("https://example.com/correct/baz.js"); + resolver->ResolveDynamically( + "./dependency.js", wrong_base_url, + ReferrerScriptInfo(correct_base_url, ScriptFetchOptions()), + promise_resolver); + + v8::MicrotasksScope::PerformCheckpoint(scope.GetIsolate()); + EXPECT_TRUE(modulator->fetch_tree_was_called()); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h index bde18fa..6fbf2e1 100644 --- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h +++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -49,7 +49,7 @@ // from top. enum class BoxSide : unsigned { kTop, kRight, kBottom, kLeft }; -// See core/dom/stylerecalc.md for an explanation on what each state means +// See core/style/stylerecalc.md for an explanation on what each state means enum StyleRecalcChange { kNoChange, kNoInherit, @@ -143,12 +143,12 @@ enum class BackgroundEdgeOrigin : unsigned { kTop, kRight, kBottom, kLeft }; // CSS Mask Source Types -enum EMaskSourceType { kMaskAlpha, kMaskLuminance }; +enum class EMaskSourceType : unsigned { kAlpha, kLuminance }; // CSS3 Image Values -enum QuoteType { OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE }; +enum class QuoteType : unsigned { kOpen, kClose, kNoOpen, kNoClose }; -enum EAnimPlayState { kAnimPlayStatePlaying, kAnimPlayStatePaused }; +enum class EAnimPlayState : unsigned { kPlaying, kPaused }; enum OffsetRotationType { kOffsetRotationAuto, kOffsetRotationFixed };
diff --git a/third_party/WebKit/Source/core/style/FillLayer.cpp b/third_party/WebKit/Source/core/style/FillLayer.cpp index 55a02d3..e817196 100644 --- a/third_party/WebKit/Source/core/style/FillLayer.cpp +++ b/third_party/WebKit/Source/core/style/FillLayer.cpp
@@ -61,7 +61,8 @@ ? static_cast<unsigned>(FillLayer::InitialFillSizeType(type)) : static_cast<unsigned>(EFillSizeType::kSizeNone)), blend_mode_(static_cast<unsigned>(FillLayer::InitialFillBlendMode(type))), - mask_source_type_(FillLayer::InitialFillMaskSourceType(type)), + mask_source_type_( + static_cast<unsigned>(FillLayer::InitialFillMaskSourceType(type))), background_x_origin_(static_cast<unsigned>(BackgroundEdgeOrigin::kLeft)), background_y_origin_(static_cast<unsigned>(BackgroundEdgeOrigin::kTop)), image_set_(use_initial_values),
diff --git a/third_party/WebKit/Source/core/style/FillLayer.h b/third_party/WebKit/Source/core/style/FillLayer.h index 29e2cf4..b94a416 100644 --- a/third_party/WebKit/Source/core/style/FillLayer.h +++ b/third_party/WebKit/Source/core/style/FillLayer.h
@@ -179,7 +179,7 @@ size_length_ = f.size; } void SetMaskSourceType(EMaskSourceType m) { - mask_source_type_ = m; + mask_source_type_ = static_cast<unsigned>(m); mask_source_type_set_ = true; } @@ -294,7 +294,7 @@ } static StyleImage* InitialFillImage(EFillLayerType) { return nullptr; } static EMaskSourceType InitialFillMaskSourceType(EFillLayerType) { - return kMaskAlpha; + return EMaskSourceType::kAlpha; } private:
diff --git a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp index 53cff54..96cd3de 100644 --- a/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp +++ b/third_party/WebKit/Source/core/style/StyleFetchedImage.cpp
@@ -24,10 +24,12 @@ #include "core/style/StyleFetchedImage.h" #include "core/css/CSSImageValue.h" -#include "core/layout/LayoutObject.h" +#include "core/dom/Document.h" #include "core/loader/resource/ImageResourceContent.h" +#include "core/style/ComputedStyle.h" #include "core/svg/graphics/SVGImage.h" #include "core/svg/graphics/SVGImageForContainer.h" +#include "platform/geometry/LayoutSize.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp b/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp index 968e2351..fdc9333 100644 --- a/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp +++ b/third_party/WebKit/Source/core/style/StyleFetchedImageSet.cpp
@@ -26,8 +26,8 @@ #include "core/style/StyleFetchedImageSet.h" #include "core/css/CSSImageSetValue.h" -#include "core/layout/LayoutObject.h" #include "core/loader/resource/ImageResourceContent.h" +#include "core/style/ComputedStyle.h" #include "core/svg/graphics/SVGImageForContainer.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp index 016a152..649d2ec 100644 --- a/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp +++ b/third_party/WebKit/Source/core/style/StyleGeneratedImage.cpp
@@ -24,7 +24,8 @@ #include "core/style/StyleGeneratedImage.h" #include "core/css/CSSImageGeneratorValue.h" -#include "core/css/resolver/StyleResolver.h" +#include "platform/geometry/FloatSize.h" +#include "platform/geometry/LayoutSize.h" namespace blink {
diff --git a/third_party/WebKit/Source/core/testing/DummyPageHolder.cpp b/third_party/WebKit/Source/core/testing/DummyPageHolder.cpp index 8c36ac1..0169e9da 100644 --- a/third_party/WebKit/Source/core/testing/DummyPageHolder.cpp +++ b/third_party/WebKit/Source/core/testing/DummyPageHolder.cpp
@@ -57,12 +57,10 @@ LocalFrameClient* local_frame_client, FrameSettingOverrideFunction setting_overrider) { Page::PageClients page_clients; - if (!page_clients_argument) { + if (!page_clients_argument) FillWithEmptyClients(page_clients); - } else { + else page_clients.chrome_client = page_clients_argument->chrome_client; - page_clients.editor_client = page_clients_argument->editor_client; - } page_ = Page::Create(page_clients); Settings& settings = page_->GetSettings(); // FIXME: http://crbug.com/363843. This needs to find a better way to
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp index 0601e5d4..4539cc5 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceBase.cpp +++ b/third_party/WebKit/Source/core/timing/PerformanceBase.cpp
@@ -45,6 +45,7 @@ #include "core/timing/PerformanceResourceTiming.h" #include "core/timing/PerformanceUserTiming.h" #include "platform/Histogram.h" +#include "platform/TimeClamper.h" #include "platform/loader/fetch/ResourceResponse.h" #include "platform/loader/fetch/ResourceTimingInfo.h" #include "platform/runtime_enabled_features.h" @@ -581,8 +582,8 @@ // static double PerformanceBase::ClampTimeResolution(double time_seconds) { - const double kResolutionSeconds = 0.000005; - return floor(time_seconds / kResolutionSeconds) * kResolutionSeconds; + DEFINE_THREAD_SAFE_STATIC_LOCAL(TimeClamper, clamper, ()); + return clamper.ClampTimeResolution(time_seconds); } // static @@ -594,11 +595,11 @@ if (!monotonic_time || !time_origin) return 0.0; - double time_in_seconds = monotonic_time - time_origin; - if (time_in_seconds < 0 && !allow_negative_value) + double clamped_time_in_seconds = + ClampTimeResolution(monotonic_time) - ClampTimeResolution(time_origin); + if (clamped_time_in_seconds < 0 && !allow_negative_value) return 0.0; - return ConvertSecondsToDOMHighResTimeStamp( - ClampTimeResolution(time_in_seconds)); + return ConvertSecondsToDOMHighResTimeStamp(clamped_time_in_seconds); } DOMHighResTimeStamp PerformanceBase::MonotonicTimeToDOMHighResTimeStamp(
diff --git a/third_party/WebKit/Source/core/timing/PerformanceBase.h b/third_party/WebKit/Source/core/timing/PerformanceBase.h index 014081e..66b7aaa 100644 --- a/third_party/WebKit/Source/core/timing/PerformanceBase.h +++ b/third_party/WebKit/Source/core/timing/PerformanceBase.h
@@ -74,7 +74,7 @@ virtual void UpdateLongTaskInstrumentation() {} - // Reduce the resolution to 5µs to prevent timing attacks. See: + // Reduce the resolution to prevent timing attacks. See: // http://www.w3.org/TR/hr-time-2/#privacy-security static double ClampTimeResolution(double time_seconds);
diff --git a/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp b/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp index a923eac..3efcab7 100644 --- a/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp +++ b/third_party/WebKit/Source/core/workers/DedicatedWorkerTest.cpp
@@ -131,7 +131,7 @@ std::make_unique<GlobalScopeCreationParams>( script_url, "fake user agent", headers.get(), kReferrerPolicyDefault, security_origin_.get(), - nullptr /* worker_clients */, kWebAddressSpaceLocal, + nullptr /* worker_clients */, mojom::IPAddressSpace::kLocal, nullptr /* origin_trial_tokens */, std::move(worker_settings), kV8CacheOptionsDefault), WorkerBackingThreadStartupData(
diff --git a/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.cpp b/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.cpp index 5fe3e1e..4b5ab2a 100644 --- a/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.cpp +++ b/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.cpp
@@ -17,7 +17,7 @@ ReferrerPolicy referrer_policy, const SecurityOrigin* starter_origin, WorkerClients* worker_clients, - WebAddressSpace address_space, + mojom::IPAddressSpace address_space, const Vector<String>* origin_trial_tokens, std::unique_ptr<WorkerSettings> worker_settings, V8CacheOptions v8_cache_options,
diff --git a/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.h b/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.h index 60ccd2b..3a1c32e 100644 --- a/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.h +++ b/third_party/WebKit/Source/core/workers/GlobalScopeCreationParams.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/macros.h" #include "bindings/core/v8/V8CacheOptions.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/CoreExport.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/workers/WorkerClients.h" @@ -19,7 +20,6 @@ #include "platform/wtf/Forward.h" #include "platform/wtf/Optional.h" #include "platform/wtf/PtrUtil.h" -#include "public/platform/WebAddressSpace.h" #include "services/service_manager/public/interfaces/interface_provider.mojom-blink.h" namespace blink { @@ -39,7 +39,7 @@ ReferrerPolicy referrer_policy, const SecurityOrigin*, WorkerClients*, - WebAddressSpace, + mojom::IPAddressSpace, const Vector<String>* origin_trial_tokens, std::unique_ptr<WorkerSettings>, V8CacheOptions, @@ -87,7 +87,7 @@ // supplies no extra 'clients', m_workerClients can be left as empty/null. CrossThreadPersistent<WorkerClients> worker_clients; - WebAddressSpace address_space; + mojom::IPAddressSpace address_space; std::unique_ptr<WorkerSettings> worker_settings;
diff --git a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp index c59f2f8..42a9496 100644 --- a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.cpp
@@ -29,6 +29,7 @@ #include <memory> #include "base/memory/scoped_refptr.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/dom/ExecutionContext.h" #include "core/html/parser/TextResourceDecoder.h" #include "core/inspector/ConsoleMessage.h" @@ -45,12 +46,11 @@ #include "platform/network/http_names.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/wtf/PtrUtil.h" -#include "public/platform/WebAddressSpace.h" namespace blink { WorkerScriptLoader::WorkerScriptLoader() - : response_address_space_(kWebAddressSpacePublic) {} + : response_address_space_(mojom::IPAddressSpace::kPublic) {} WorkerScriptLoader::~WorkerScriptLoader() { // If |m_threadableLoader| is still working, we have to cancel it here. @@ -65,7 +65,7 @@ ExecutionContext& execution_context, const KURL& url, WebURLRequest::RequestContext request_context, - WebAddressSpace creation_address_space) { + mojom::IPAddressSpace creation_address_space) { url_ = url; execution_context_ = &execution_context; @@ -94,7 +94,7 @@ WebURLRequest::RequestContext request_context, network::mojom::FetchRequestMode fetch_request_mode, network::mojom::FetchCredentialsMode fetch_credentials_mode, - WebAddressSpace creation_address_space, + mojom::IPAddressSpace creation_address_space, base::OnceClosure response_callback, base::OnceClosure finished_callback) { DCHECK(response_callback || finished_callback); @@ -159,8 +159,8 @@ if (NetworkUtils::IsReservedIPAddress(response.RemoteIPAddress())) { response_address_space_ = SecurityOrigin::Create(response_url_)->IsLocalhost() - ? kWebAddressSpaceLocal - : kWebAddressSpacePrivate; + ? mojom::IPAddressSpace::kLocal + : mojom::IPAddressSpace::kPrivate; } if (response_callback_)
diff --git a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h index b67e6b6..d9c1cc24 100644 --- a/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h +++ b/third_party/WebKit/Source/core/workers/WorkerScriptLoader.h
@@ -30,6 +30,7 @@ #include <memory> #include "base/memory/scoped_refptr.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/CoreExport.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/loader/ThreadableLoader.h" @@ -40,7 +41,6 @@ #include "platform/wtf/Functional.h" #include "platform/wtf/RefCounted.h" #include "platform/wtf/text/StringBuilder.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebURLRequest.h" #include "services/network/public/interfaces/fetch_api.mojom-blink.h" @@ -64,7 +64,7 @@ void LoadSynchronously(ExecutionContext&, const KURL&, WebURLRequest::RequestContext, - WebAddressSpace); + mojom::IPAddressSpace); // Note that callbacks could be invoked before loadAsynchronously() returns. void LoadAsynchronously(ExecutionContext&, @@ -72,7 +72,7 @@ WebURLRequest::RequestContext, network::mojom::FetchRequestMode, network::mojom::FetchCredentialsMode, - WebAddressSpace, + mojom::IPAddressSpace, base::OnceClosure response_callback, base::OnceClosure finished_callback); @@ -102,7 +102,7 @@ const String& GetReferrerPolicy() const { return referrer_policy_; } - WebAddressSpace ResponseAddressSpace() const { + mojom::IPAddressSpace ResponseAddressSpace() const { return response_address_space_; } @@ -152,7 +152,7 @@ std::unique_ptr<Vector<char>> cached_metadata_; Persistent<ContentSecurityPolicy> content_security_policy_; Persistent<ExecutionContext> execution_context_; - WebAddressSpace response_address_space_; + mojom::IPAddressSpace response_address_space_; std::unique_ptr<Vector<String>> origin_trial_tokens_; String referrer_policy_; };
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp b/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp index 59108cd..31c0a8ed 100644 --- a/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp +++ b/third_party/WebKit/Source/core/workers/WorkerThreadTest.cpp
@@ -300,7 +300,7 @@ std::make_unique<GlobalScopeCreationParams>( KURL("http://fake.url/"), "fake user agent", headers.get(), kReferrerPolicyDefault, security_origin_.get(), - nullptr /* workerClients */, kWebAddressSpaceLocal, + nullptr /* workerClients */, mojom::IPAddressSpace::kLocal, nullptr /* originTrialToken */, std::make_unique<WorkerSettings>(Settings::Create().get()), kV8CacheOptionsDefault);
diff --git a/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h b/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h index d73fdb0..b5926a27 100644 --- a/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h +++ b/third_party/WebKit/Source/core/workers/WorkerThreadTestHelper.h
@@ -11,6 +11,7 @@ #include "bindings/core/v8/SourceLocation.h" #include "bindings/core/v8/V8CacheOptions.h" #include "bindings/core/v8/V8GCController.h" +#include "common/net/ip_address_space.mojom-blink.h" #include "core/frame/Settings.h" #include "core/frame/csp/ContentSecurityPolicy.h" #include "core/inspector/ConsoleMessage.h" @@ -34,7 +35,6 @@ #include "platform/wtf/PtrUtil.h" #include "platform/wtf/Time.h" #include "platform/wtf/Vector.h" -#include "public/platform/WebAddressSpace.h" #include "testing/gmock/include/gmock/gmock.h" #include "v8/include/v8.h" @@ -102,7 +102,7 @@ auto creation_params = std::make_unique<GlobalScopeCreationParams>( script_url, "fake user agent", headers.get(), kReferrerPolicyDefault, - security_origin, worker_clients, kWebAddressSpaceLocal, nullptr, + security_origin, worker_clients, mojom::IPAddressSpace::kLocal, nullptr, std::make_unique<WorkerSettings>(Settings::Create().get()), kV8CacheOptionsDefault);
diff --git a/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js index faf0393..886c7c1 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js +++ b/third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js
@@ -585,6 +585,11 @@ */ renderBugReport(err, inspectedURL) { console.error(err); + clearTimeout(this._scheduledFastFactTimeout); + clearTimeout(this._scheduledTextChangeTimeout); + this._resetProgressBarClasses(); + this._progressBar.classList.add('errored'); + this._commitTextChange(''); this._statusText.createTextChild(Common.UIString('Ah, sorry! We ran into an error: ')); this._statusText.createChild('em').createTextChild(err.message);
diff --git a/third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css b/third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css index a27e1ed..14f8b2c 100644 --- a/third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css +++ b/third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css
@@ -68,6 +68,11 @@ --progress-bar-auditing-percent: 95%; } +.audits2-progress-bar.errored { + width: 100%; + background: #E50303; +} + .audits2-progress-bar.loading { animation-duration: var(--progress-bar-loading-duration); animation-name: progressBarLoading;
diff --git a/third_party/WebKit/Source/devtools/front_end/common/Throttler.js b/third_party/WebKit/Source/devtools/front_end/common/Throttler.js index 6ab1882..a7fd06a4 100644 --- a/third_party/WebKit/Source/devtools/front_end/common/Throttler.js +++ b/third_party/WebKit/Source/devtools/front_end/common/Throttler.js
@@ -15,6 +15,10 @@ /** @type {?function():(!Promise.<?>)} */ this._process = null; this._lastCompleteTime = 0; + + this._schedulePromise = new Promise(fulfill => { + this._scheduleResolve = fulfill; + }); } _processCompleted() { @@ -34,13 +38,21 @@ this._asSoonAsPossible = false; this._isRunningProcess = true; - Promise.resolve().then(this._process).catch(console.error.bind(console)).then(this._processCompleted.bind(this)); + Promise.resolve() + .then(this._process) + .catch(console.error.bind(console)) + .then(this._processCompleted.bind(this)) + .then(this._scheduleResolve); + this._schedulePromise = new Promise(fulfill => { + this._scheduleResolve = fulfill; + }); this._process = null; } /** * @param {function():(!Promise.<?>)} process * @param {boolean=} asSoonAsPossible + * @return {!Promise} */ schedule(process, asSoonAsPossible) { // Deliberately skip previous process. @@ -55,6 +67,8 @@ this._asSoonAsPossible = this._asSoonAsPossible || asSoonAsPossible; this._innerSchedule(forceTimerUpdate); + + return this._schedulePromise; } /**
diff --git a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js index 9806f13..7e50ee0 100644 --- a/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js +++ b/third_party/WebKit/Source/devtools/front_end/components/Linkifier.js
@@ -542,7 +542,8 @@ url = uiLocation.uiSourceCode.contentURL(); } else if (info.url) { url = info.url; - var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(url); + var uiSourceCode = Workspace.workspace.uiSourceCodeForURL(url) || + Workspace.workspace.uiSourceCodeForURL(Common.ParsedURL.urlWithoutHash(url)); uiLocation = uiSourceCode ? uiSourceCode.uiLocation(info.lineNumber || 0, info.columnNumber || 0) : null; } var resource = url ? Bindings.resourceForURL(url) : null;
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js index 4ff8ebb..ab7f547 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -367,7 +367,7 @@ var messageElement = this._buildMessage(); var icon = UI.Icon.create('smallicon-triangle-right', 'console-message-expand-icon'); - var clickableElement = contentElement.createChild('div'); + var clickableElement = contentElement.createChild('div', 'console-message-stack-trace-message'); clickableElement.appendChild(icon); clickableElement.appendChild(messageElement); @@ -808,6 +808,7 @@ } function isWhitelistedProperty(property) { + // Make sure that allowed properties do not interfere with link visibility. var prefixes = [ 'background', 'border', 'color', 'font', 'line', 'margin', 'padding', 'text', '-webkit-background', '-webkit-border', '-webkit-font', '-webkit-margin', '-webkit-padding', '-webkit-text' @@ -835,6 +836,11 @@ formatters._ = bypassFormatter; + /** + * @param {!Element} a + * @param {*} b + * @this {!Console.ConsoleViewMessage} + */ function append(a, b) { if (b instanceof Node) { a.appendChild(b); @@ -844,8 +850,12 @@ var wrapper = createElement('span'); wrapper.appendChild(toAppend); applyCurrentStyle(wrapper); - for (var i = 0; i < wrapper.children.length; ++i) - applyCurrentStyle(wrapper.children[i]); + for (var child of wrapper.children) { + if (child.classList.contains('devtools-link')) + this._applyForcedVisibleStyle(child); + else + applyCurrentStyle(child); + } toAppend = wrapper; } a.appendChild(toAppend); @@ -862,7 +872,26 @@ } // String.format does treat formattedResult like a Builder, result is an object. - return String.format(format, parameters, formatters, formattedResult, append); + return String.format(format, parameters, formatters, formattedResult, append.bind(this)); + } + + /** + * @param {!Element} element + */ + _applyForcedVisibleStyle(element) { + element.style.setProperty('-webkit-text-stroke', '0', 'important'); + element.style.setProperty('text-decoration', 'underline', 'important'); + + var themedColor = UI.themeSupport.patchColorText('rgb(33%, 33%, 33%)', UI.ThemeSupport.ColorUsage.Foreground); + element.style.setProperty('color', themedColor, 'important'); + + var backgroundColor = 'hsl(0, 0%, 100%)'; + if (this._message.level === ConsoleModel.ConsoleMessage.MessageLevel.Error) + backgroundColor = 'hsl(0, 100%, 97%)'; + else if (this._message.level === ConsoleModel.ConsoleMessage.MessageLevel.Warning || this._shouldRenderAsWarning()) + backgroundColor = 'hsl(50, 100%, 95%)'; + var themedBackgroundColor = UI.themeSupport.patchColorText(backgroundColor, UI.ThemeSupport.ColorUsage.Background); + element.style.setProperty('background-color', themedBackgroundColor, 'important'); } /** @@ -1379,8 +1408,11 @@ */ static _tokenizeMessageText(string) { if (!Console.ConsoleViewMessage._tokenizerRegexes) { - var linkStringRegex = - /(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\/\/|data:|www\.)[\w$\-_+*'=\|\/\\(){}[\]^%@&#~,:;.!?]{2,}[\w$\-_+*=\|\/\\({^%@&#~]/; + var controlCodes = '\\u0000-\\u0020\\u007f-\\u009f'; + var linkStringRegex = new RegExp( + '(?:[a-zA-Z][a-zA-Z0-9+.-]{2,}:\\/\\/|data:|www\\.)[^\\s' + controlCodes + '"]{2,}[^\\s' + controlCodes + + '"\')}\\],:;.!?]', + 'u'); var pathLineRegex = /(?:\/[\w\.-]*)+\:[\d]+/; var timeRegex = /took [\d]+ms/; var eventRegex = /'\w+' event/;
diff --git a/third_party/WebKit/Source/devtools/front_end/console/consoleView.css b/third_party/WebKit/Source/devtools/front_end/console/consoleView.css index a8868d9..fae1cd4 100644 --- a/third_party/WebKit/Source/devtools/front_end/console/consoleView.css +++ b/third_party/WebKit/Source/devtools/front_end/console/consoleView.css
@@ -189,6 +189,7 @@ .console-message-wrapper { display: flex; border-bottom: 1px solid rgb(240, 240, 240); + overflow-y: hidden; } .console-message-wrapper.console-adjacent-user-command-result { @@ -413,6 +414,10 @@ flex: none; } +.console-message-stack-trace-message { + overflow-y: hidden; +} + .console-message-expand-icon { margin-bottom: -2px; }
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js index 42545fa..d502c631 100644 --- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js +++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -2341,6 +2341,8 @@ } _updateExpandElement() { + if (!this._expandElement) + return; if (this.expanded) this._expandElement.setIconType('smallicon-triangle-down'); else @@ -2349,7 +2351,10 @@ updateTitle() { this._updateState(); - this._expandElement = UI.Icon.create('smallicon-triangle-right', 'expand-icon'); + if (this.isExpandable()) + this._expandElement = UI.Icon.create('smallicon-triangle-right', 'expand-icon'); + else + this._expandElement = null; var propertyRenderer = new Elements.StylesSidebarPropertyRenderer(this._style.parentRule, this.node(), this.name, this.value); @@ -2370,7 +2375,8 @@ .createTextChild(indent + (this.property.disabled ? '/* ' : '')); this.listItemElement.appendChild(this.nameElement); this.listItemElement.createTextChild(': '); - this.listItemElement.appendChild(this._expandElement); + if (this._expandElement) + this.listItemElement.appendChild(this._expandElement); this.listItemElement.appendChild(this.valueElement); this.listItemElement.createTextChild(';'); if (this.property.disabled) @@ -2447,7 +2453,7 @@ if (this.parent.isShorthand) return; - if (selectElement === this._expandElement) + if (this._expandElement && selectElement === this._expandElement) return; var section = this.section();
diff --git a/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json b/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json index a78f194..f43a66b2 100644 --- a/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json +++ b/third_party/WebKit/Source/devtools/front_end/emulated_devices/module.json
@@ -41,7 +41,7 @@ "order": 30, "device": { "show-by-default": true, - "title": "iPhone 5", + "title": "iPhone 5/SE", "screen": { "horizontal": { "outline" : {
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js b/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js index 186f0fd9..78c6019 100644 --- a/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js +++ b/third_party/WebKit/Source/devtools/front_end/sdk/ServerTiming.js
@@ -25,36 +25,164 @@ if (!rawServerTimingHeaders.length) return null; - /** - * @param {?string} valueString - * @return {?Array<!SDK.ServerTiming>} - */ - function createFromHeaderValue(valueString) { - // https://www.w3.org/TR/server-timing/ - var serverTimingMetricRegExp = - /[ \t]*([\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~0-9A-Za-z]+)[ \t]*(?:=[ \t]*(\d+(?:\.\d+)?))?[ \t]*(?:;[ \t]*(?:"([^"]+)"|([\!\#\$\%\&\'\*\+\-\.\^\_\`\|\~0-9A-Za-z]+)))?[ \t]*(?:,(.*))?/; - var metricMatch; - var result = []; - while (valueString && (metricMatch = serverTimingMetricRegExp.exec(valueString))) { - var metric = metricMatch[1]; - var value = metricMatch[2]; - var description = metricMatch[3] || metricMatch[4]; - if (value !== undefined) - value = Math.abs(parseFloat(metricMatch[2])); - valueString = metricMatch[5]; // comma delimited headers - if (value === undefined || isNaN(value)) - value = null; - result.push(new SDK.ServerTiming(metric, value, description)); - } - return result; - } - var serverTimings = rawServerTimingHeaders.reduce((memo, header) => { - var timing = createFromHeaderValue(header.value); - Array.prototype.push.apply(memo, timing); + var timing = this.createFromHeaderValue(header.value); + memo.pushAll(timing.map(function(entry) { + return new SDK.ServerTiming( + entry.name, entry.hasOwnProperty('dur') ? entry.dur : null, entry.hasOwnProperty('desc') ? entry.desc : ''); + })); return memo; }, []); serverTimings.sort((a, b) => a.metric.toLowerCase().compareTo(b.metric.toLowerCase())); return serverTimings; } + + /** + * @param {string} valueString + * @return {?Array<!Object>} + */ + static createFromHeaderValue(valueString) { + function trimLeadingWhiteSpace() { + valueString = valueString.replace(/^\s*/, ''); + } + function consumeDelimiter(char) { + console.assert(char.length === 1); + trimLeadingWhiteSpace(); + if (valueString.charAt(0) !== char) + return false; + + valueString = valueString.substring(1); + return true; + } + function consumeToken() { + // https://tools.ietf.org/html/rfc7230#appendix-B + var result = /^(?:\s*)([\w!#$%&'*+\-.^`|~]+)(?:\s*)(.*)/.exec(valueString); + if (!result) + return null; + + valueString = result[2]; + return result[1]; + } + function consumeTokenOrQuotedString() { + trimLeadingWhiteSpace(); + if (valueString.charAt(0) === '"') + return consumeQuotedString(); + + return consumeToken(); + } + function consumeQuotedString() { + console.assert(valueString.charAt(0) === '"'); + valueString = valueString.substring(1); // remove leading DQUOTE + + var value = ''; + while (valueString.length) { + // split into two parts: + // -everything before the first " or \ + // -everything else + var result = /^([^"\\]*)(.*)/.exec(valueString); + value += result[1]; + if (result[2].charAt(0) === '"') { + // we have found our closing " + valueString = result[2].substring(1); // strip off everything after the closing " + return value; // we are done here + } + + console.assert(result[2].charAt(0) === '\\'); + // special rules for \ found in quoted-string (https://tools.ietf.org/html/rfc7230#section-3.2.6) + value += result[2].charAt(1); // grab the character AFTER the \ (if there was one) + valueString = result[2].substring(2); // strip off \ and next character + } + + return null; // not a valid quoted-string + } + function consumeExtraneous() { + var result = /([,;].*)/.exec(valueString); + if (result) + valueString = result[1]; + } + + var result = []; + var name; + while ((name = consumeToken()) !== null) { + var entry = {name}; + + if (valueString.charAt(0) === '=') + this.showWarning(ls`Deprecated syntax found. Please use: <name>;dur=<duration>;desc=<description>`); + + while (consumeDelimiter(';')) { + var paramName; + if ((paramName = consumeToken()) === null) + continue; + + paramName = paramName.toLowerCase(); + var parseParameter = this.getParserForParameter(paramName); + var paramValue = null; + if (consumeDelimiter('=')) { + // always parse the value, even if we don't recognize the parameter name + paramValue = consumeTokenOrQuotedString(); + consumeExtraneous(); + } + + if (parseParameter) { + // paramName is valid + if (entry.hasOwnProperty(paramName)) { + this.showWarning(ls`Duplicate parameter \"${paramName}\" ignored.`); + continue; + } + + if (paramValue === null) + this.showWarning(ls`No value found for parameter \"${paramName}\".`); + + parseParameter.call(this, entry, paramValue); + } else { + // paramName is not valid + this.showWarning(ls`Unrecognized parameter \"${paramName}\".`); + } + } + + result.push(entry); + if (!consumeDelimiter(',')) + break; + } + + if (valueString.length) + this.showWarning(ls`Extraneous trailing characters.`); + return result; + } + + /** + * @param {string} paramName + * @return {?function(!Object, string)} + */ + static getParserForParameter(paramName) { + switch (paramName) { + case 'dur': + return function(entry, paramValue) { + entry.dur = 0; + if (paramValue !== null) { + var duration = parseFloat(paramValue); + if (isNaN(duration)) { + this.showWarning(ls`Unable to parse \"${paramName}\" value \"${paramValue}\".`); + return; + } + entry.dur = duration; + } + }; + + case 'desc': + return function(entry, paramValue) { + entry.desc = paramValue || ''; + }; + + default: + return null; + } + } + + /** + * @param {string} msg + */ + static showWarning(msg) { + Common.console.warn(Common.UIString(`ServerTiming: ${msg}`)); + } };
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp index c725586..205fce3 100644 --- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp +++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -1370,7 +1370,7 @@ if (attribute_value.IsEmpty()) return; - attribute_value.SimplifyWhiteSpace(); + attribute_value = attribute_value.SimplifyWhiteSpace(); attribute_value.Split(' ', tokens); }
diff --git a/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletThreadTest.cpp b/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletThreadTest.cpp index 0b4020d..ad757a4a2 100644 --- a/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletThreadTest.cpp +++ b/third_party/WebKit/Source/modules/animationworklet/AnimationWorkletThreadTest.cpp
@@ -30,7 +30,6 @@ #include "platform/testing/UnitTestHelpers.h" #include "platform/wtf/text/TextPosition.h" #include "public/platform/Platform.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebURLRequest.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.cpp b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.cpp index ec3a8308..c8e6233 100644 --- a/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.cpp +++ b/third_party/WebKit/Source/modules/background_fetch/BackgroundFetchManager.cpp
@@ -134,17 +134,17 @@ } if (RuntimeEnabledFeatures::CorsRFC1918Enabled()) { - WebAddressSpace requestor_space = + mojom::IPAddressSpace requestor_space = execution_context->GetSecurityContext().AddressSpace(); // TODO(mkwst): This only checks explicit IP addresses. We'll have to move // all this up to //net and //content in order to have any real impact on // gateway attacks. That turns out to be a TON of work (crbug.com/378566). - WebAddressSpace target_space = kWebAddressSpacePublic; + mojom::IPAddressSpace target_space = mojom::IPAddressSpace::kPublic; if (NetworkUtils::IsReservedIPAddress(request_url.Host())) - target_space = kWebAddressSpacePrivate; + target_space = mojom::IPAddressSpace::kPrivate; if (SecurityOrigin::Create(request_url)->IsLocalhost()) - target_space = kWebAddressSpaceLocal; + target_space = mojom::IPAddressSpace::kLocal; bool is_external_request = requestor_space > target_space; if (is_external_request)
diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.idl b/third_party/WebKit/Source/modules/battery/BatteryManager.idl index 5bfa87df..412eb2d 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.idl +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.idl
@@ -4,7 +4,8 @@ // https://w3c.github.io/battery/#the-batterymanager-interface [ - ActiveScriptWrappable + ActiveScriptWrappable, + Exposed=Window ] interface BatteryManager : EventTarget { readonly attribute boolean charging; readonly attribute unrestricted double chargingTime;
diff --git a/third_party/WebKit/Source/modules/clipboard/Clipboard.idl b/third_party/WebKit/Source/modules/clipboard/Clipboard.idl index 22a02471..96467a299 100644 --- a/third_party/WebKit/Source/modules/clipboard/Clipboard.idl +++ b/third_party/WebKit/Source/modules/clipboard/Clipboard.idl
@@ -4,11 +4,13 @@ // https://w3c.github.io/clipboard-apis/#clipboard-interface -[SecureContext] -interface Clipboard : EventTarget { - [CallWith=ScriptState] Promise<DataTransfer> read(); - [CallWith=ScriptState] Promise<DOMString> readText(); +[ + SecureContext, + Exposed=Window +] interface Clipboard : EventTarget { + [CallWith=ScriptState] Promise<DataTransfer> read(); + [CallWith=ScriptState] Promise<DOMString> readText(); - [CallWith=ScriptState] Promise<void> write(DataTransfer data); - [CallWith=ScriptState] Promise<void> writeText(DOMString data); + [CallWith=ScriptState] Promise<void> write(DataTransfer data); + [CallWith=ScriptState] Promise<void> writeText(DOMString data); };
diff --git a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp index bc52ec9..1c872fb 100644 --- a/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp +++ b/third_party/WebKit/Source/modules/credentialmanager/CredentialsContainer.cpp
@@ -100,8 +100,16 @@ bool CheckSecurityRequirementsBeforeRequest( ScriptPromiseResolver* resolver, RequiredOriginType required_origin_type) { - // Credential Management is not exposed to Workers or Worklets, so the current - // realm execution context must have a responsible browsing context. + // Ignore calls if the current realm execution context is no longer valid, + // e.g., because the responsible document was detached. + DCHECK(resolver->GetExecutionContext()); + if (resolver->GetExecutionContext()->IsContextDestroyed()) { + resolver->Reject(); + return false; + } + + // The API is not exposed to Workers or Worklets, so if the current realm + // execution context is valid, it must have a responsible browsing context. SECURITY_CHECK(resolver->GetFrame()); String error_message;
diff --git a/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp index 0697862..3a26fd9 100644 --- a/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp +++ b/third_party/WebKit/Source/modules/exported/WebEmbeddedWorkerImpl.cpp
@@ -131,11 +131,11 @@ // // https://crbug.com/590714 KURL script_url = worker_start_data_.script_url; - worker_start_data_.address_space = kWebAddressSpacePublic; + worker_start_data_.address_space = mojom::IPAddressSpace::kPublic; if (NetworkUtils::IsReservedIPAddress(script_url.Host())) - worker_start_data_.address_space = kWebAddressSpacePrivate; + worker_start_data_.address_space = mojom::IPAddressSpace::kPrivate; if (SecurityOrigin::Create(script_url)->IsLocalhost()) - worker_start_data_.address_space = kWebAddressSpaceLocal; + worker_start_data_.address_space = mojom::IPAddressSpace::kLocal; if (data.pause_after_download_mode == WebEmbeddedWorkerStartData::kPauseAfterDownload)
diff --git a/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.cpp b/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.cpp index 5aeb559d..312fde1 100644 --- a/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.cpp +++ b/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.cpp
@@ -42,7 +42,7 @@ const Vector<String>& keycodes) { DCHECK(state); if (request_keylock_resolver_) { - // TODO(zijiehe): Reject with a DOMException once it has been defined in the + // TODO(joedow): Reject with a DOMException once it has been defined in the // spec. See https://github.com/w3c/keyboard-lock/issues/18. return ScriptPromise::Reject( state, V8String(state->GetIsolate(), @@ -91,12 +91,13 @@ void NavigatorKeyboardLock::LockRequestFinished( mojom::KeyboardLockRequestResult result) { DCHECK(request_keylock_resolver_); - // TODO(zijiehe): Reject with a DOMException once it has been defined in the + // TODO(joedow): Reject with a DOMException once it has been defined in the // spec. - if (result == mojom::KeyboardLockRequestResult::SUCCESS) + if (result == mojom::KeyboardLockRequestResult::SUCCESS) { request_keylock_resolver_->Resolve(); - else + } else { request_keylock_resolver_->Reject(); + } request_keylock_resolver_ = nullptr; }
diff --git a/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.idl b/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.idl index b39db8e..90e2db97 100644 --- a/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.idl +++ b/third_party/WebKit/Source/modules/keyboard_lock/NavigatorKeyboardLock.idl
@@ -3,7 +3,7 @@ // found in the LICENSE file. // https://rawgit.com/w3c/keyboard-lock/gh-pages/index.html. -// TODO(zijiehe, garykac): Update the spec to match the implementation. +// TODO(joedow, garykac): Update the spec to match the implementation. // 1. "System" should be removed from both the function names: these functions // are not for system keys or key combinations only. // See https://github.com/w3c/keyboard-lock/issues/6
diff --git a/third_party/WebKit/Source/modules/locks/Lock.cpp b/third_party/WebKit/Source/modules/locks/Lock.cpp index aafde18..c3a2e1c 100644 --- a/third_party/WebKit/Source/modules/locks/Lock.cpp +++ b/third_party/WebKit/Source/modules/locks/Lock.cpp
@@ -7,6 +7,7 @@ #include "bindings/core/v8/ScriptPromise.h" #include "bindings/core/v8/ScriptPromiseResolver.h" #include "core/dom/ExecutionContext.h" +#include "modules/locks/LockManager.h" #include "platform/bindings/ScriptState.h" namespace blink { @@ -58,19 +59,22 @@ // static Lock* Lock::Create(ScriptState* script_state, const String& name, - mojom::blink::LockManager::LockMode mode, - mojom::blink::LockHandlePtr handle) { - return new Lock(script_state, name, mode, std::move(handle)); + mojom::blink::LockMode mode, + mojom::blink::LockHandlePtr handle, + LockManager* manager) { + return new Lock(script_state, name, mode, std::move(handle), manager); } Lock::Lock(ScriptState* script_state, const String& name, - mojom::blink::LockManager::LockMode mode, - mojom::blink::LockHandlePtr handle) + mojom::blink::LockMode mode, + mojom::blink::LockHandlePtr handle, + LockManager* manager) : PausableObject(ExecutionContext::From(script_state)), name_(name), mode_(mode), - handle_(std::move(handle)) { + handle_(std::move(handle)), + manager_(manager) { PauseIfNeeded(); } @@ -92,21 +96,21 @@ } // static -mojom::blink::LockManager::LockMode Lock::StringToMode(const String& string) { +mojom::blink::LockMode Lock::StringToMode(const String& string) { if (string == kLockModeNameShared) - return mojom::blink::LockManager::LockMode::SHARED; + return mojom::blink::LockMode::SHARED; if (string == kLockModeNameExclusive) - return mojom::blink::LockManager::LockMode::EXCLUSIVE; + return mojom::blink::LockMode::EXCLUSIVE; NOTREACHED(); - return mojom::blink::LockManager::LockMode::SHARED; + return mojom::blink::LockMode::SHARED; } // static -String Lock::ModeToString(mojom::blink::LockManager::LockMode mode) { +String Lock::ModeToString(mojom::blink::LockMode mode) { switch (mode) { - case mojom::blink::LockManager::LockMode::SHARED: + case mojom::blink::LockMode::SHARED: return kLockModeNameShared; - case mojom::blink::LockManager::LockMode::EXCLUSIVE: + case mojom::blink::LockMode::EXCLUSIVE: return kLockModeNameExclusive; } NOTREACHED(); @@ -121,10 +125,17 @@ PausableObject::Trace(visitor); ScriptWrappable::Trace(visitor); visitor->Trace(resolver_); + visitor->Trace(manager_); } void Lock::ReleaseIfHeld() { - handle_.reset(); + if (handle_) { + // Drop the mojo pipe; this releases the lock on the back end. + handle_.reset(); + + // Let the lock manager know that this instance can be collected. + manager_->OnLockReleased(this); + } } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/locks/Lock.h b/third_party/WebKit/Source/modules/locks/Lock.h index 44c8b86..1cdfac3 100644 --- a/third_party/WebKit/Source/modules/locks/Lock.h +++ b/third_party/WebKit/Source/modules/locks/Lock.h
@@ -14,6 +14,7 @@ namespace blink { +class LockManager; class ScriptPromise; class ScriptPromiseResolver; class ScriptState; @@ -25,8 +26,9 @@ public: static Lock* Create(ScriptState*, const String& name, - mojom::blink::LockManager::LockMode, - mojom::blink::LockHandlePtr); + mojom::blink::LockMode, + mojom::blink::LockHandlePtr, + LockManager*); ~Lock() override; @@ -44,24 +46,33 @@ // the passed resolver is invoked with the promise's result. void HoldUntil(ScriptPromise, ScriptPromiseResolver*); - static mojom::blink::LockManager::LockMode StringToMode(const String&); - static String ModeToString(mojom::blink::LockManager::LockMode); + static mojom::blink::LockMode StringToMode(const String&); + static String ModeToString(mojom::blink::LockMode); private: class ThenFunction; Lock(ScriptState*, const String& name, - mojom::blink::LockManager::LockMode, - mojom::blink::LockHandlePtr); + mojom::blink::LockMode, + mojom::blink::LockHandlePtr, + LockManager*); void ReleaseIfHeld(); Member<ScriptPromiseResolver> resolver_; const String name_; - const mojom::blink::LockManager::LockMode mode_; + const mojom::blink::LockMode mode_; + + // An opaque handle; this one end of a mojo pipe. When this is closed, + // the lock is released by the back end. mojom::blink::LockHandlePtr handle_; + + // LockManager::OnLockReleased() is called when this lock is released, to + // stop artificially keeping this instance alive. It is necessary in the + // case where the resolver's promise could potentially be GC'd. + Member<LockManager> manager_; }; } // namespace blink
diff --git a/third_party/WebKit/Source/modules/locks/LockInfo.idl b/third_party/WebKit/Source/modules/locks/LockInfo.idl new file mode 100644 index 0000000..a0978d5 --- /dev/null +++ b/third_party/WebKit/Source/modules/locks/LockInfo.idl
@@ -0,0 +1,9 @@ +// Copyright 2017 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. + +// https://github.com/inexorabletash/web-locks +dictionary LockInfo { + DOMString name; + LockMode mode; +};
diff --git a/third_party/WebKit/Source/modules/locks/LockManager.cpp b/third_party/WebKit/Source/modules/locks/LockManager.cpp index c2fc30c9..54011df 100644 --- a/third_party/WebKit/Source/modules/locks/LockManager.cpp +++ b/third_party/WebKit/Source/modules/locks/LockManager.cpp
@@ -11,15 +11,39 @@ #include "core/dom/ExceptionCode.h" #include "core/frame/UseCounter.h" #include "modules/locks/Lock.h" -#include "modules/locks/LockOptions.h" +#include "modules/locks/LockInfo.h" +#include "modules/locks/LockManagerSnapshot.h" #include "mojo/public/cpp/bindings/binding.h" #include "platform/bindings/Microtask.h" #include "platform/bindings/ScriptState.h" #include "platform/bindings/TraceWrapperMember.h" +#include "platform/heap/Persistent.h" +#include "platform/wtf/Functional.h" +#include "platform/wtf/Vector.h" #include "services/service_manager/public/cpp/interface_provider.h" namespace blink { +namespace { + +LockInfo ToLockInfo(const mojom::blink::LockInfoPtr& record) { + LockInfo request; + request.setMode(Lock::ModeToString(record->mode)); + request.setName(record->name); + return request; +} + +HeapVector<LockInfo> ToLockInfos( + const Vector<mojom::blink::LockInfoPtr>& records) { + HeapVector<LockInfo> out; + out.ReserveInitialCapacity(records.size()); + for (const auto& record : records) + out.push_back(ToLockInfo(record)); + return out; +} + +} // namespace + class LockManager::LockRequestImpl final : public GarbageCollectedFinalized<LockRequestImpl>, public TraceWrapperBase, @@ -31,7 +55,7 @@ LockRequestImpl(V8LockGrantedCallback* callback, ScriptPromiseResolver* resolver, const String& name, - mojom::blink::LockManager::LockMode mode, + mojom::blink::LockMode mode, mojom::blink::LockRequestRequest request, LockManager* manager) : callback_(callback), @@ -103,7 +127,9 @@ return; } - Lock* lock = Lock::Create(script_state, name_, mode_, std::move(handle)); + Lock* lock = + Lock::Create(script_state, name_, mode_, std::move(handle), manager_); + manager_->held_locks_.insert(lock); ScriptState::Scope scope(script_state); v8::TryCatch try_catch(script_state->GetIsolate()); @@ -130,7 +156,7 @@ String name_; // Held to stamp the Lock object's |mode| property. - mojom::blink::LockManager::LockMode mode_; + mojom::blink::LockMode mode_; mojo::Binding<mojom::blink::LockRequest> binding_; @@ -149,6 +175,7 @@ ExceptionState& exception_state) { return acquire(script_state, name, LockOptions(), callback, exception_state); } + ScriptPromise LockManager::acquire(ScriptState* script_state, const String& name, const LockOptions& options, @@ -161,7 +188,8 @@ exception_state.ThrowSecurityError( "Access to the Locks API is denied in this context."); return ScriptPromise(); - } else if (context->GetSecurityOrigin()->IsLocal()) { + } + if (context->GetSecurityOrigin()->IsLocal()) { UseCounter::Count(context, WebFeature::kFileAccessedLocks); } @@ -174,7 +202,7 @@ } } - mojom::blink::LockManager::LockMode mode = Lock::StringToMode(options.mode()); + mojom::blink::LockMode mode = Lock::StringToMode(options.mode()); mojom::blink::LockManager::WaitMode wait = options.ifAvailable() ? mojom::blink::LockManager::WaitMode::NO_WAIT @@ -192,6 +220,46 @@ return promise; } +ScriptPromise LockManager::query(ScriptState* script_state, + ExceptionState& exception_state) { + ExecutionContext* context = ExecutionContext::From(script_state); + DCHECK(context->IsContextThread()); + + if (!context->GetSecurityOrigin()->CanAccessLocks()) { + exception_state.ThrowSecurityError( + "Access to the Locks API is denied in this context."); + return ScriptPromise(); + } + if (context->GetSecurityOrigin()->IsLocal()) { + UseCounter::Count(context, WebFeature::kFileAccessedLocks); + } + + if (!service_.get()) { + if (auto* provider = context->GetInterfaceProvider()) + provider->GetInterface(mojo::MakeRequest(&service_)); + if (!service_.get()) { + exception_state.ThrowTypeError("Service not available."); + return ScriptPromise(); + } + } + + ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state); + ScriptPromise promise = resolver->Promise(); + + service_->QueryState(WTF::Bind( + [](ScriptPromiseResolver* resolver, + Vector<mojom::blink::LockInfoPtr> pending, + Vector<mojom::blink::LockInfoPtr> held) { + LockManagerSnapshot snapshot; + snapshot.setPending(ToLockInfos(pending)); + snapshot.setHeld(ToLockInfos(held)); + resolver->Resolve(snapshot); + }, + WrapPersistent(resolver))); + + return promise; +} + void LockManager::AddPendingRequest(LockRequestImpl* request) { pending_requests_.insert(request); } @@ -204,6 +272,7 @@ ScriptWrappable::Trace(visitor); ContextLifecycleObserver::Trace(visitor); visitor->Trace(pending_requests_); + visitor->Trace(held_locks_); } void LockManager::TraceWrappers(const ScriptWrappableVisitor* visitor) const { @@ -215,6 +284,13 @@ for (auto request : pending_requests_) request->Cancel(); pending_requests_.clear(); + held_locks_.clear(); +} + +void LockManager::OnLockReleased(Lock* lock) { + // Lock may be removed by an explicit call and/or when the context is + // destroyed, so this must be idempotent. + held_locks_.erase(lock); } } // namespace blink
diff --git a/third_party/WebKit/Source/modules/locks/LockManager.h b/third_party/WebKit/Source/modules/locks/LockManager.h index bfa89428..477067a 100644 --- a/third_party/WebKit/Source/modules/locks/LockManager.h +++ b/third_party/WebKit/Source/modules/locks/LockManager.h
@@ -7,6 +7,7 @@ #include "bindings/modules/v8/string_or_string_sequence.h" #include "modules/ModulesExport.h" +#include "modules/locks/Lock.h" #include "modules/locks/LockOptions.h" #include "platform/bindings/ScriptWrappable.h" #include "platform/heap/HeapAllocator.h" @@ -37,6 +38,8 @@ V8LockGrantedCallback*, ExceptionState&); + ScriptPromise query(ScriptState*, ExceptionState&); + void Trace(blink::Visitor*); // Wrapper tracing is needed for callbacks. The reference chain is @@ -48,6 +51,14 @@ // this can unblock requests by other contexts. void ContextDestroyed(ExecutionContext*) override; + // Called by a lock when it is released. The lock is dropped from the + // |held_locks_| list. Held locks are tracked until explicitly released (or + // context is destroyed) to handle the case where both the lock and the + // promise holding it open have no script references and are potentially + // collectable. In that case, the lock should be held until the context + // is destroyed. See https://crbug.com/798500 for an example. + void OnLockReleased(Lock*); + private: class LockRequestImpl; @@ -57,6 +68,7 @@ void RemovePendingRequest(LockRequestImpl*); HeapHashSet<TraceWrapperMember<LockRequestImpl>> pending_requests_; + HeapHashSet<Member<Lock>> held_locks_; mojom::blink::LockManagerPtr service_; };
diff --git a/third_party/WebKit/Source/modules/locks/LockManager.idl b/third_party/WebKit/Source/modules/locks/LockManager.idl index 4c0501fe..74a41e5 100644 --- a/third_party/WebKit/Source/modules/locks/LockManager.idl +++ b/third_party/WebKit/Source/modules/locks/LockManager.idl
@@ -17,4 +17,6 @@ DOMString name, LockOptions options, LockGrantedCallback callback); + + [CallWith=ScriptState, RaisesException] Promise<LockState> query(); };
diff --git a/third_party/WebKit/Source/modules/locks/LockManagerSnapshot.idl b/third_party/WebKit/Source/modules/locks/LockManagerSnapshot.idl new file mode 100644 index 0000000..279b5ed --- /dev/null +++ b/third_party/WebKit/Source/modules/locks/LockManagerSnapshot.idl
@@ -0,0 +1,9 @@ +// Copyright 2017 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. + +// https://github.com/inexorabletash/web-locks +dictionary LockManagerSnapshot { + sequence<LockInfo> held; + sequence<LockInfo> pending; +};
diff --git a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp index 507e28f4..a091371 100644 --- a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp +++ b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.cpp
@@ -78,8 +78,6 @@ WebLocalizedString::Name MediaControlCastButtonElement::GetOverflowStringName() const { - if (IsPlayingRemotely()) - return WebLocalizedString::kOverflowMenuStopCast; return WebLocalizedString::kOverflowMenuCast; }
diff --git a/third_party/WebKit/Source/modules/modules_idl_files.gni b/third_party/WebKit/Source/modules/modules_idl_files.gni index a972568..7f9dee7f 100644 --- a/third_party/WebKit/Source/modules/modules_idl_files.gni +++ b/third_party/WebKit/Source/modules/modules_idl_files.gni
@@ -491,6 +491,8 @@ "indexeddb/IDBObjectStoreParameters.idl", "indexeddb/IDBObserverInit.idl", "indexeddb/IDBVersionChangeEventInit.idl", + "locks/LockInfo.idl", + "locks/LockManagerSnapshot.idl", "locks/LockOptions.idl", "media_capabilities/AudioConfiguration.idl", "media_capabilities/MediaConfiguration.idl",
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCConfiguration.idl b/third_party/WebKit/Source/modules/peerconnection/RTCConfiguration.idl index 3daa5c3..633321c 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCConfiguration.idl +++ b/third_party/WebKit/Source/modules/peerconnection/RTCConfiguration.idl
@@ -24,6 +24,13 @@ "require" }; +// Nonstandard +// For usage, see transition plan referenced from https://crbug.com/799030 +enum SdpSemantics { + "plan-b", + "unified-plan" +}; + // https://w3c.github.io/webrtc-pc/#rtcconfiguration-dictionary dictionary RTCConfiguration { @@ -39,4 +46,6 @@ // TODO(foolip): DOMString peerIdentity; sequence<RTCCertificate> certificates; [EnforceRange] octet iceCandidatePoolSize = 0; + // Nonstandard, added for Unified Plan migration + [RuntimeEnabled=RTCUnifiedPlan] SdpSemantics sdpSemantics; };
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp index 7e0f265a..7a9bc73 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -278,10 +278,23 @@ } else { DCHECK_EQ(rtcp_mux_policy_string, "require"); } + + WebRTCSdpSemantics sdp_semantics = WebRTCSdpSemantics::kDefault; + if (configuration.hasSdpSemantics()) { + String sdp_semantics_string = configuration.sdpSemantics(); + if (sdp_semantics_string == "plan-b") { + sdp_semantics = WebRTCSdpSemantics::kPlanB; + } else { + DCHECK_EQ(sdp_semantics_string, "unified-plan"); + sdp_semantics = WebRTCSdpSemantics::kUnifiedPlan; + } + } + WebRTCConfiguration web_configuration; web_configuration.ice_transport_policy = ice_transport_policy; web_configuration.bundle_policy = bundle_policy; web_configuration.rtcp_mux_policy = rtcp_mux_policy; + web_configuration.sdp_semantics = sdp_semantics; if (configuration.hasIceServers()) { Vector<WebRTCIceServer> ice_servers;
diff --git a/third_party/WebKit/Source/modules/quota/BUILD.gn b/third_party/WebKit/Source/modules/quota/BUILD.gn index be0512e..641ff3b 100644 --- a/third_party/WebKit/Source/modules/quota/BUILD.gn +++ b/third_party/WebKit/Source/modules/quota/BUILD.gn
@@ -14,8 +14,6 @@ "DeprecatedStorageInfo.h", "DeprecatedStorageQuota.cpp", "DeprecatedStorageQuota.h", - "DeprecatedStorageQuotaCallbacksImpl.cpp", - "DeprecatedStorageQuotaCallbacksImpl.h", "NavigatorStorageQuota.cpp", "NavigatorStorageQuota.h", "StorageManager.cpp",
diff --git a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp b/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp index 510b1b7..5026919 100644 --- a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp +++ b/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuota.cpp
@@ -32,19 +32,17 @@ #include "base/location.h" #include "bindings/modules/v8/v8_storage_error_callback.h" +#include "bindings/modules/v8/v8_storage_usage_callback.h" #include "core/dom/ExceptionCode.h" #include "core/dom/ExecutionContext.h" #include "modules/quota/DOMError.h" -#include "modules/quota/DeprecatedStorageQuotaCallbacksImpl.h" #include "modules/quota/StorageQuotaClient.h" -#include "platform/StorageQuotaCallbacks.h" #include "platform/WebTaskRunner.h" #include "platform/bindings/ScriptState.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" #include "public/platform/Platform.h" #include "public/platform/TaskType.h" -#include "public/platform/WebStorageQuotaCallbacks.h" #include "third_party/WebKit/common/quota/quota_types.mojom-blink.h" namespace blink { @@ -64,6 +62,26 @@ } } +void DeprecatedQueryStorageUsageAndQuotaCallback( + V8StorageUsageCallback* success_callback, + V8StorageErrorCallback* error_callback, + mojom::QuotaStatusCode status_code, + int64_t usage_in_bytes, + int64_t quota_in_bytes) { + if (status_code != mojom::QuotaStatusCode::kOk) { + if (error_callback) { + error_callback->InvokeAndReportException( + nullptr, DOMError::Create(static_cast<ExceptionCode>(status_code))); + } + return; + } + + if (success_callback) { + success_callback->InvokeAndReportException(nullptr, usage_in_bytes, + quota_in_bytes); + } +} + } // namespace void DeprecatedStorageQuota::EnqueueStorageErrorCallback( @@ -108,11 +126,11 @@ return; } - StorageQuotaCallbacks* callbacks = - DeprecatedStorageQuotaCallbacksImpl::Create(success_callback, - error_callback); Platform::Current()->QueryStorageUsageAndQuota( - WrapRefCounted(security_origin), storage_type, callbacks); + WrapRefCounted(security_origin), storage_type, + WTF::Bind(&DeprecatedQueryStorageUsageAndQuotaCallback, + WrapPersistent(success_callback), + WrapPersistent(error_callback))); } void DeprecatedStorageQuota::requestQuota(
diff --git a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuotaCallbacksImpl.cpp b/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuotaCallbacksImpl.cpp deleted file mode 100644 index 96031f9..0000000 --- a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuotaCallbacksImpl.cpp +++ /dev/null
@@ -1,81 +0,0 @@ -/* - * Copyright (C) 2011 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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 "modules/quota/DeprecatedStorageQuotaCallbacksImpl.h" - -#include "modules/quota/DOMError.h" - -namespace blink { - -DeprecatedStorageQuotaCallbacksImpl::DeprecatedStorageQuotaCallbacksImpl( - V8StorageUsageCallback* usage_callback, - V8StorageErrorCallback* error_callback) - : usage_callback_(usage_callback), - quota_callback_(nullptr), - error_callback_(error_callback) {} - -DeprecatedStorageQuotaCallbacksImpl::DeprecatedStorageQuotaCallbacksImpl( - V8StorageQuotaCallback* quota_callback, - V8StorageErrorCallback* error_callback) - : usage_callback_(nullptr), - quota_callback_(quota_callback), - error_callback_(error_callback) {} - -DeprecatedStorageQuotaCallbacksImpl::~DeprecatedStorageQuotaCallbacksImpl() {} - -void DeprecatedStorageQuotaCallbacksImpl::Trace(blink::Visitor* visitor) { - StorageQuotaCallbacks::Trace(visitor); -} - -void DeprecatedStorageQuotaCallbacksImpl::DidQueryStorageUsageAndQuota( - unsigned long long usage_in_bytes, - unsigned long long quota_in_bytes) { - if (usage_callback_) { - usage_callback_->InvokeAndReportException(nullptr, usage_in_bytes, - quota_in_bytes); - } -} - -void DeprecatedStorageQuotaCallbacksImpl::DidGrantStorageQuota( - unsigned long long usage_in_bytes, - unsigned long long granted_quota_in_bytes) { - if (quota_callback_) - quota_callback_->InvokeAndReportException(nullptr, granted_quota_in_bytes); -} - -void DeprecatedStorageQuotaCallbacksImpl::DidFail( - mojom::QuotaStatusCode error) { - if (error_callback_) { - error_callback_->InvokeAndReportException( - nullptr, DOMError::Create(static_cast<ExceptionCode>(error))); - } -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuotaCallbacksImpl.h b/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuotaCallbacksImpl.h deleted file mode 100644 index 05370b0..0000000 --- a/third_party/WebKit/Source/modules/quota/DeprecatedStorageQuotaCallbacksImpl.h +++ /dev/null
@@ -1,86 +0,0 @@ -/* - * Copyright (C) 2011 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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. - */ - -#ifndef DeprecatedStorageQuotaCallbacksImpl_h -#define DeprecatedStorageQuotaCallbacksImpl_h - -#include "base/memory/scoped_refptr.h" -#include "bindings/modules/v8/v8_storage_error_callback.h" -#include "bindings/modules/v8/v8_storage_quota_callback.h" -#include "bindings/modules/v8/v8_storage_usage_callback.h" -#include "modules/ModulesExport.h" -#include "platform/StorageQuotaCallbacks.h" - -namespace blink { - -class MODULES_EXPORT DeprecatedStorageQuotaCallbacksImpl final - : public StorageQuotaCallbacks { - public: - static DeprecatedStorageQuotaCallbacksImpl* Create( - V8StorageUsageCallback* success, - V8StorageErrorCallback* error) { - return new DeprecatedStorageQuotaCallbacksImpl(success, error); - } - - static DeprecatedStorageQuotaCallbacksImpl* Create( - V8StorageQuotaCallback* success, - V8StorageErrorCallback* error) { - return new DeprecatedStorageQuotaCallbacksImpl(success, error); - } - - ~DeprecatedStorageQuotaCallbacksImpl() override; - virtual void Trace(blink::Visitor*); - - void DidQueryStorageUsageAndQuota(unsigned long long usage_in_bytes, - unsigned long long quota_in_bytes) override; - void DidGrantStorageQuota(unsigned long long usage_in_bytes, - unsigned long long granted_quota_in_bytes) override; - void DidFail(mojom::QuotaStatusCode) override; - - private: - DeprecatedStorageQuotaCallbacksImpl(V8StorageUsageCallback*, - V8StorageErrorCallback*); - DeprecatedStorageQuotaCallbacksImpl(V8StorageQuotaCallback*, - V8StorageErrorCallback*); - - // This set of callbacks is held by WebStorageQuotaCallbacks and passed in - // Platform::QueryStorageUsageAndQuota, which doesn't support wrapper-tracing, - // and there is no other owner of this object. Thus, this object holds the - // underlying callback functions as persistent handles. This is acceptable - // because this object will be discarded in a limited time once - // Platform::QueryStorageUsageAndQuota finishes a task. - V8StorageUsageCallback::Persistent<V8StorageUsageCallback> usage_callback_; - V8StorageQuotaCallback::Persistent<V8StorageQuotaCallback> quota_callback_; - V8StorageErrorCallback::Persistent<V8StorageErrorCallback> error_callback_; -}; - -} // namespace blink - -#endif // DeprecatedStorageQuotaCallbacksImpl_h
diff --git a/third_party/WebKit/Source/modules/quota/StorageManager.cpp b/third_party/WebKit/Source/modules/quota/StorageManager.cpp index 710f357..0e263b8 100644 --- a/third_party/WebKit/Source/modules/quota/StorageManager.cpp +++ b/third_party/WebKit/Source/modules/quota/StorageManager.cpp
@@ -14,7 +14,6 @@ #include "core/frame/LocalFrame.h" #include "modules/permissions/PermissionUtils.h" #include "modules/quota/StorageEstimate.h" -#include "platform/StorageQuotaCallbacks.h" #include "platform/wtf/Assertions.h" #include "platform/wtf/Functional.h" #include "public/platform/Platform.h" @@ -31,38 +30,23 @@ const char kUniqueOriginErrorMessage[] = "The operation is not supported in this context."; -class EstimateCallbacks final : public StorageQuotaCallbacks { - WTF_MAKE_NONCOPYABLE(EstimateCallbacks); - - public: - explicit EstimateCallbacks(ScriptPromiseResolver* resolver) - : resolver_(resolver) {} - - ~EstimateCallbacks() override {} - - void DidQueryStorageUsageAndQuota( - unsigned long long usage_in_bytes, - unsigned long long quota_in_bytes) override { - StorageEstimate estimate; - estimate.setUsage(usage_in_bytes); - estimate.setQuota(quota_in_bytes); - resolver_->Resolve(estimate); - } - - void DidFail(mojom::QuotaStatusCode error) override { +void QueryStorageUsageAndQuotaCallback(ScriptPromiseResolver* resolver, + mojom::QuotaStatusCode status_code, + int64_t usage_in_bytes, + int64_t quota_in_bytes) { + if (status_code != mojom::QuotaStatusCode::kOk) { // TODO(sashab): Replace this with a switch statement, and remove the enum // values from QuotaStatusCode. - resolver_->Reject(DOMException::Create(static_cast<ExceptionCode>(error))); + resolver->Reject( + DOMException::Create(static_cast<ExceptionCode>(status_code))); + return; } - virtual void Trace(blink::Visitor* visitor) { - visitor->Trace(resolver_); - StorageQuotaCallbacks::Trace(visitor); - } - - private: - Member<ScriptPromiseResolver> resolver_; -}; + StorageEstimate estimate; + estimate.setUsage(usage_in_bytes); + estimate.setQuota(quota_in_bytes); + resolver->Resolve(estimate); +} } // namespace @@ -127,7 +111,7 @@ Platform::Current()->QueryStorageUsageAndQuota( WrapRefCounted(security_origin), mojom::StorageType::kTemporary, - new EstimateCallbacks(resolver)); + WTF::Bind(&QueryStorageUsageAndQuotaCallback, WrapPersistent(resolver))); return promise; }
diff --git a/third_party/WebKit/Source/modules/quota/StorageQuotaClient.cpp b/third_party/WebKit/Source/modules/quota/StorageQuotaClient.cpp index f23f99a..d7e3878 100644 --- a/third_party/WebKit/Source/modules/quota/StorageQuotaClient.cpp +++ b/third_party/WebKit/Source/modules/quota/StorageQuotaClient.cpp
@@ -30,17 +30,41 @@ #include "modules/quota/StorageQuotaClient.h" +#include "bindings/modules/v8/v8_storage_error_callback.h" +#include "bindings/modules/v8/v8_storage_quota_callback.h" #include "core/dom/Document.h" #include "core/dom/ExecutionContext.h" #include "core/frame/WebLocalFrameImpl.h" #include "core/page/Page.h" #include "core/workers/WorkerGlobalScope.h" -#include "modules/quota/DeprecatedStorageQuotaCallbacksImpl.h" +#include "modules/quota/DOMError.h" #include "public/platform/TaskType.h" #include "public/web/WebFrameClient.h" namespace blink { +namespace { + +void RequestStorageQuotaCallback(V8StorageQuotaCallback* success_callback, + V8StorageErrorCallback* error_callback, + mojom::QuotaStatusCode status_code, + int64_t usage_in_bytes, + int64_t granted_quota_in_bytes) { + if (status_code != mojom::QuotaStatusCode::kOk) { + if (error_callback) { + error_callback->InvokeAndReportException( + nullptr, DOMError::Create(static_cast<ExceptionCode>(status_code))); + } + return; + } + + if (success_callback) { + success_callback->InvokeAndReportException(nullptr, granted_quota_in_bytes); + } +} + +} // namespace + StorageQuotaClient::StorageQuotaClient() {} StorageQuotaClient::~StorageQuotaClient() {} @@ -58,11 +82,10 @@ Document* document = ToDocument(execution_context); WebLocalFrameImpl* web_frame = WebLocalFrameImpl::FromFrame(document->GetFrame()); - StorageQuotaCallbacks* callbacks = - DeprecatedStorageQuotaCallbacksImpl::Create(success_callback, - error_callback); - web_frame->Client()->RequestStorageQuota(storage_type, new_quota_in_bytes, - callbacks); + web_frame->Client()->RequestStorageQuota( + storage_type, new_quota_in_bytes, + WTF::Bind(&RequestStorageQuotaCallback, WrapPersistent(success_callback), + WrapPersistent(error_callback))); } const char* StorageQuotaClient::SupplementName() {
diff --git a/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.idl b/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.idl index 4d97a92..eae0f32 100644 --- a/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.idl +++ b/third_party/WebKit/Source/modules/sensor/AbsoluteOrientationSensor.idl
@@ -11,6 +11,7 @@ ConstructorCallWith=ExecutionContext, SecureContext, RaisesException=Constructor, - MeasureAs=AbsoluteOrientationSensorConstructor + MeasureAs=AbsoluteOrientationSensorConstructor, + Exposed=Window ] interface AbsoluteOrientationSensor : OrientationSensor { };
diff --git a/third_party/WebKit/Source/modules/sensor/Accelerometer.idl b/third_party/WebKit/Source/modules/sensor/Accelerometer.idl index 8f61d0d8..d288f82 100644 --- a/third_party/WebKit/Source/modules/sensor/Accelerometer.idl +++ b/third_party/WebKit/Source/modules/sensor/Accelerometer.idl
@@ -11,7 +11,8 @@ ConstructorCallWith=ExecutionContext, SecureContext, RaisesException=Constructor, - MeasureAs=AccelerometerConstructor + MeasureAs=AccelerometerConstructor, + Exposed=Window ] interface Accelerometer : Sensor { readonly attribute unrestricted double? x; readonly attribute unrestricted double? y;
diff --git a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl index 93aac9fc..4de8aff 100644 --- a/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl +++ b/third_party/WebKit/Source/modules/sensor/AmbientLightSensor.idl
@@ -11,7 +11,8 @@ ConstructorCallWith=ExecutionContext, SecureContext, RaisesException=Constructor, - MeasureAs=AmbientLightSensorConstructor + MeasureAs=AmbientLightSensorConstructor, + Exposed=Window ] interface AmbientLightSensor : Sensor { readonly attribute unrestricted double? illuminance; };
diff --git a/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.idl b/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.idl index f05c880f..d213300 100644 --- a/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.idl +++ b/third_party/WebKit/Source/modules/sensor/LinearAccelerationSensor.idl
@@ -11,6 +11,7 @@ ConstructorCallWith=ExecutionContext, SecureContext, RaisesException=Constructor, - MeasureAs=LinearAccelerationSensorConstructor + MeasureAs=LinearAccelerationSensorConstructor, + Exposed=Window ] interface LinearAccelerationSensor : Accelerometer { };
diff --git a/third_party/WebKit/Source/modules/sensor/OrientationSensor.idl b/third_party/WebKit/Source/modules/sensor/OrientationSensor.idl index 6d6f9747..d0a028a 100644 --- a/third_party/WebKit/Source/modules/sensor/OrientationSensor.idl +++ b/third_party/WebKit/Source/modules/sensor/OrientationSensor.idl
@@ -9,7 +9,8 @@ [ OriginTrialEnabled=Sensor, - SecureContext + SecureContext, + Exposed=Window ] interface OrientationSensor : Sensor { [CachedAttribute=isReadingDirty] readonly attribute FrozenArray<double>? quaternion; [RaisesException, MeasureAs=OrientationSensorPopulateMatrix] void populateMatrix(RotationMatrixType targetBuffer);
diff --git a/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.idl b/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.idl index 87d2f17..ae7813f 100644 --- a/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.idl +++ b/third_party/WebKit/Source/modules/sensor/RelativeOrientationSensor.idl
@@ -11,6 +11,7 @@ ConstructorCallWith=ExecutionContext, SecureContext, RaisesException=Constructor, - MeasureAs=RelativeOrientationSensorConstructor + MeasureAs=RelativeOrientationSensorConstructor, + Exposed=Window ] interface RelativeOrientationSensor : OrientationSensor { };
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.idl b/third_party/WebKit/Source/modules/sensor/Sensor.idl index 2cef549..6ea6e8a5 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.idl +++ b/third_party/WebKit/Source/modules/sensor/Sensor.idl
@@ -8,7 +8,8 @@ [ ActiveScriptWrappable, SecureContext, - OriginTrialEnabled=Sensor + OriginTrialEnabled=Sensor, + Exposed=Window ] interface Sensor : EventTarget { [MeasureAs=GenericSensorActivated] readonly attribute boolean activated; readonly attribute boolean hasReading;
diff --git a/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.idl b/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.idl index 6909a70..64769adc 100644 --- a/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.idl +++ b/third_party/WebKit/Source/modules/sensor/SensorErrorEvent.idl
@@ -8,7 +8,8 @@ [ OriginTrialEnabled=Sensor, SecureContext, - Constructor(DOMString type, SensorErrorEventInit eventInitDict) + Constructor(DOMString type, SensorErrorEventInit eventInitDict), + Exposed=Window ] interface SensorErrorEvent : Event { readonly attribute DOMException error; };
diff --git a/third_party/WebKit/Source/modules/vr/DEPS b/third_party/WebKit/Source/modules/vr/DEPS index a3b0b3b7..cd6d183 100644 --- a/third_party/WebKit/Source/modules/vr/DEPS +++ b/third_party/WebKit/Source/modules/vr/DEPS
@@ -5,4 +5,5 @@ "+gpu/command_buffer/client/gles2_interface.h", "+gpu/command_buffer/common/mailbox_holder.h", "+ui/gfx/geometry", + "+ui/gfx/gpu_fence.h", ]
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp index 1d65feae..4e52008 100644 --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -39,6 +39,7 @@ #include "platform/wtf/Time.h" #include "public/platform/Platform.h" #include "public/platform/TaskType.h" +#include "ui/gfx/gpu_fence.h" #include <array> #include "core/dom/ExecutionContext.h" @@ -467,9 +468,13 @@ device::mojom::blink::VRSubmitFrameClientPtr submit_frame_client; submit_frame_client_binding_.Close(); submit_frame_client_binding_.Bind(mojo::MakeRequest(&submit_frame_client)); + device::mojom::blink::VRRequestPresentOptionsPtr options = + device::mojom::blink::VRRequestPresentOptions::New(); + options->preserve_drawing_buffer = + rendering_context_->CreationAttributes().preserveDrawingBuffer(); display_->RequestPresent( std::move(submit_frame_client), - mojo::MakeRequest(&vr_presentation_provider_), + mojo::MakeRequest(&vr_presentation_provider_), std::move(options), WTF::Bind(&VRDisplay::OnPresentComplete, WrapPersistent(this))); vr_presentation_provider_.set_connection_error_handler( WTF::Bind(&VRDisplay::OnPresentationProviderConnectionError, @@ -484,7 +489,10 @@ return promise; } -void VRDisplay::OnPresentComplete(bool success) { +void VRDisplay::OnPresentComplete( + bool success, + device::mojom::blink::VRDisplayFrameTransportOptionsPtr transport_options) { + transport_options_ = std::move(transport_options); pending_present_request_ = false; if (success) { this->BeginPresent(); @@ -528,28 +536,13 @@ return promise; } -bool VRDisplay::ConfigurePresentationPathForDisplay() { - // TODO(klausw): capabilities_ should provide such information more directly. - // Currently, there's only two presentation paths which happen to align with - // having an external display (desktop devices such as OpenVR) or not (mobile - // VR on Android). - if (capabilities_->hasExternalDisplay()) { - frame_transport_method_ = FrameTransport::kTextureHandle; - wait_for_previous_render_ = WaitPrevStrategy::kNoWait; - } else { - frame_transport_method_ = FrameTransport::kMailbox; - wait_for_previous_render_ = WaitPrevStrategy::kAfterBitmap; - } - return true; -} - void VRDisplay::BeginPresent() { Document* doc = this->GetDocument(); DOMException* exception = nullptr; - if (!ConfigurePresentationPathForDisplay()) { + if (!transport_options_) { exception = DOMException::Create( - kInvalidStateError, "VRDisplay presentation path not implemented."); + kInvalidStateError, "VRDisplay presentation path not configured."); } if (layer_.source().IsOffscreenCanvas()) { @@ -702,17 +695,24 @@ UpdateLayerBounds(); } - // Ensure that required device selections were made. - DCHECK(frame_transport_method_ != FrameTransport::kUninitialized); - DCHECK(wait_for_previous_render_ != WaitPrevStrategy::kUninitialized); - WTF::TimeDelta wait_time; - // Conditionally wait for the previous render to finish, to avoid losing - // frames in the Android Surface / GLConsumer pair. An early wait here is - // appropriate when using a GpuFence to separate drawing, the new frame isn't - // complete yet at this stage. - if (wait_for_previous_render_ == WaitPrevStrategy::kBeforeBitmap) - wait_time += WaitForPreviousRenderToFinish(); + + // If we're expecting a fence for the previous frame and it hasn't arrived + // yet, wait for it to be received. + if (waiting_for_previous_frame_fence_) { + wait_time += WaitForGpuFenceReceived(); + } + // If we have a GpuFence (it may be missing if WaitForIncomingMethodCall + // failed), send it to the GPU service process and ask it to do an + // asynchronous server wait. + if (previous_frame_fence_) { + DVLOG(3) << "CreateClientGpuFenceCHROMIUM"; + GLuint id = context_gl_->CreateClientGpuFenceCHROMIUM( + previous_frame_fence_->AsClientGpuFence()); + context_gl_->WaitGpuFenceCHROMIUM(id); + context_gl_->DestroyGpuFenceCHROMIUM(id); + previous_frame_fence_.reset(); + } TRACE_EVENT_BEGIN0("gpu", "VRDisplay::GetStaticBitmapImage"); scoped_refptr<Image> image_ref = rendering_context_->GetStaticBitmapImage(); @@ -736,11 +736,19 @@ } } - if (frame_transport_method_ == FrameTransport::kTextureHandle) { + DCHECK(transport_options_); + + if (transport_options_->transport_method == + device::mojom::blink::VRDisplayFrameTransportMethod:: + SUBMIT_AS_TEXTURE_HANDLE) { #if defined(OS_WIN) // Currently, we assume that this transport needs a copy. DCHECK(present_image_needs_copy_); TRACE_EVENT0("gpu", "VRDisplay::CopyImage"); + // Update last_transfer_succeeded_ value. This should usually complete + // without waiting. + if (transport_options_->wait_for_transfer_notification) + WaitForPreviousTransfer(); if (!frame_copier_ || !last_transfer_succeeded_) { frame_copier_ = std::make_unique<GpuMemoryBufferImageCopy>(context_gl_); } @@ -767,7 +775,9 @@ #else NOTIMPLEMENTED(); #endif - } else if (frame_transport_method_ == FrameTransport::kMailbox) { + } else if (transport_options_->transport_method == + device::mojom::blink::VRDisplayFrameTransportMethod:: + SUBMIT_AS_MAILBOX_HOLDER) { // Currently, this transport assumes we don't need to make a separate copy // of the canvas content. DCHECK(!present_image_needs_copy_); @@ -787,17 +797,16 @@ // rendering. This is used if submitting fully rendered frames to GVR, but // is susceptible to bad GPU scheduling if the new frame competes with the // previous frame's incomplete rendering. - if (wait_for_previous_render_ == WaitPrevStrategy::kAfterBitmap) + if (waiting_for_previous_frame_render_) wait_time += WaitForPreviousRenderToFinish(); // Save a reference to the image to keep it alive until next frame, // but first wait for the transfer to finish before overwriting it. // Usually this check is satisfied without waiting. - WaitForPreviousTransfer(); + if (transport_options_->wait_for_transfer_notification) + WaitForPreviousTransfer(); previous_image_ = std::move(image_ref); - pending_submit_frame_ = true; - // Create mailbox and sync token for transfer. TRACE_EVENT_BEGIN0("gpu", "VRDisplay::GetMailbox"); auto mailbox = static_image->GetMailbox(); @@ -810,10 +819,16 @@ wait_time); TRACE_EVENT_END0("gpu", "VRDisplay::SubmitFrame"); } else { - NOTREACHED() << "Unimplemented frame_transport_method_"; + NOTREACHED() << "Unimplemented frame transport method"; } - pending_previous_frame_render_ = true; + // Set the expected notifications the next frame should wait for. + waiting_for_previous_frame_transfer_ = + transport_options_->wait_for_transfer_notification; + waiting_for_previous_frame_render_ = + transport_options_->wait_for_render_notification; + waiting_for_previous_frame_fence_ = transport_options_->wait_for_gpu_fence; + did_submit_this_frame_ = true; // Reset our frame id, since anything we'd want to do (resizing/etc) can // no-longer happen to this frame. @@ -829,18 +844,18 @@ void VRDisplay::OnSubmitFrameTransferred(bool success) { DVLOG(3) << __FUNCTION__; - pending_submit_frame_ = false; + waiting_for_previous_frame_transfer_ = false; last_transfer_succeeded_ = success; } void VRDisplay::OnSubmitFrameRendered() { DVLOG(3) << __FUNCTION__; - pending_previous_frame_render_ = false; + waiting_for_previous_frame_render_ = false; } void VRDisplay::WaitForPreviousTransfer() { TRACE_EVENT0("gpu", "VRDisplay::waitForPreviousTransferToFinish"); - while (pending_submit_frame_) { + while (waiting_for_previous_frame_transfer_) { if (!submit_frame_client_binding_.WaitForIncomingMethodCall()) { DLOG(ERROR) << "Failed to receive SubmitFrame response"; break; @@ -851,7 +866,25 @@ WTF::TimeDelta VRDisplay::WaitForPreviousRenderToFinish() { TRACE_EVENT0("gpu", "waitForPreviousRenderToFinish"); WTF::TimeTicks start = WTF::CurrentTimeTicks(); - while (pending_previous_frame_render_) { + while (waiting_for_previous_frame_render_) { + if (!submit_frame_client_binding_.WaitForIncomingMethodCall()) { + DLOG(ERROR) << "Failed to receive SubmitFrame response"; + break; + } + } + return WTF::CurrentTimeTicks() - start; +} + +void VRDisplay::OnSubmitFrameGpuFence(const gfx::GpuFenceHandle& handle) { + // We just received a GpuFence, unblock WaitForGpuFenceReceived. + waiting_for_previous_frame_fence_ = false; + previous_frame_fence_ = std::make_unique<gfx::GpuFence>(handle); +} + +WTF::TimeDelta VRDisplay::WaitForGpuFenceReceived() { + TRACE_EVENT0("gpu", "waitForGpuFenceReceived"); + WTF::TimeTicks start = WTF::CurrentTimeTicks(); + while (waiting_for_previous_frame_fence_) { if (!submit_frame_client_binding_.WaitForIncomingMethodCall()) { DLOG(ERROR) << "Failed to receive SubmitFrame response"; break; @@ -918,11 +951,11 @@ rendering_context_ = nullptr; context_gl_ = nullptr; - pending_submit_frame_ = false; - pending_previous_frame_render_ = false; + waiting_for_previous_frame_transfer_ = false; + waiting_for_previous_frame_render_ = false; + waiting_for_previous_frame_fence_ = false; did_submit_this_frame_ = false; - frame_transport_method_ = FrameTransport::kUninitialized; - wait_for_previous_render_ = WaitPrevStrategy::kUninitialized; + transport_options_ = nullptr; RequestVSync(); }
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.h b/third_party/WebKit/Source/modules/vr/VRDisplay.h index 9cfc03d7..820907c 100644 --- a/third_party/WebKit/Source/modules/vr/VRDisplay.h +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.h
@@ -20,6 +20,10 @@ #include "platform/wtf/text/WTFString.h" #include "public/platform/WebGraphicsContext3DProvider.h" +namespace gfx { +class GpuFence; +} + namespace gpu { namespace gles2 { class GLES2Interface; @@ -125,41 +129,13 @@ VRController* Controller(); private: - // Specifies how submitFrame should transport frame data for the presenting - // VR device, set by ConfigurePresentationPathForDisplay(). - enum class FrameTransport { - // Invalid default value. Must be changed to a valid choice before starting - // presentation. - kUninitialized, - - // Command buffer CHROMIUM_texture_mailbox. Used by the Android Surface - // rendering path. - kMailbox, - - // A TextureHandle as extracted from a GpuMemoryBufferHandle. Used with - // DXGI texture handles for OpenVR on Windows. - kTextureHandle, - }; - - // Some implementations need to synchronize submitting with the completion of - // the previous frame, i.e. the Android surface path needs to wait to avoid - // lost frames in the transfer surface and to avoid overstuffed buffers. The - // strategy choice here indicates at which point in the submission process - // it should wait. NO_WAIT means to skip this wait entirely. For example, - // the OpenVR render pipeline doesn't overlap frames, so the previous - // frame is already guaranteed complete. - enum class WaitPrevStrategy { - kUninitialized, - kNoWait, - kBeforeBitmap, - kAfterBitmap, - }; - - bool ConfigurePresentationPathForDisplay(); void WaitForPreviousTransfer(); WTF::TimeDelta WaitForPreviousRenderToFinish(); + WTF::TimeDelta WaitForGpuFenceReceived(); - void OnPresentComplete(bool); + void OnPresentComplete( + bool success, + device::mojom::blink::VRDisplayFrameTransportOptionsPtr); void OnConnected(); void OnDisconnected(); @@ -171,6 +147,7 @@ // VRSubmitFrameClient void OnSubmitFrameTransferred(bool success) override; void OnSubmitFrameRendered() override; + void OnSubmitFrameGpuFence(const gfx::GpuFenceHandle&) override; // VRDisplayClient void OnChanged(device::mojom::blink::VRDisplayInfoPtr) override; @@ -239,8 +216,11 @@ // waitForPreviousTransferToFinish. scoped_refptr<Image> previous_image_; - FrameTransport frame_transport_method_ = FrameTransport::kUninitialized; - WaitPrevStrategy wait_for_previous_render_ = WaitPrevStrategy::kUninitialized; + // If using GpuFence to separate frames, need to wait for the previous + // frame's fence, but not if this is the first frame. Separately track + // if we're expecting a fence and the received fence itself. + bool waiting_for_previous_frame_fence_ = false; + std::unique_ptr<gfx::GpuFence> previous_frame_fence_; TraceWrapperMember<ScriptedAnimationController> scripted_animation_controller_; @@ -254,13 +234,14 @@ bool in_animation_frame_ = false; bool did_submit_this_frame_ = false; bool display_blurred_ = false; - bool pending_previous_frame_render_ = false; - bool pending_submit_frame_ = false; + bool waiting_for_previous_frame_render_ = false; + bool waiting_for_previous_frame_transfer_ = false; bool pending_present_request_ = false; bool last_transfer_succeeded_ = false; device::mojom::blink::VRMagicWindowProviderPtr magic_window_provider_; device::mojom::blink::VRDisplayHostPtr display_; + device::mojom::blink::VRDisplayFrameTransportOptionsPtr transport_options_; bool present_image_needs_copy_ = false;
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioNode.h b/third_party/WebKit/Source/modules/webaudio/AudioNode.h index b2e40c0..d904bcb 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioNode.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioNode.h
@@ -220,7 +220,7 @@ virtual void SetChannelCountMode(const String&, ExceptionState&); String ChannelInterpretation(); - void SetChannelInterpretation(const String&, ExceptionState&); + virtual void SetChannelInterpretation(const String&, ExceptionState&); ChannelCountMode InternalChannelCountMode() const { return channel_count_mode_;
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParam.h b/third_party/WebKit/Source/modules/webaudio/AudioParam.h index cec738ef..9fe37cc 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParam.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioParam.h
@@ -147,7 +147,11 @@ void ResetSmoothedValue() { timeline_.SetSmoothedValue(IntrinsicValue()); } bool HasSampleAccurateValues() { - return timeline_.HasValues() || NumberOfRenderingConnections(); + bool has_values = + timeline_.HasValues(destination_handler_->CurrentSampleFrame(), + destination_handler_->SampleRate()); + + return has_values || NumberOfRenderingConnections(); } // Calculates numberOfValues parameter values starting at the context's
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp index e7daca8..3ca609e4 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
@@ -586,11 +586,29 @@ new_events_.insert(events_[i].get()); } -bool AudioParamTimeline::HasValues() const { +bool AudioParamTimeline::HasValues(size_t current_frame, + double sample_rate) const { MutexTryLocker try_locker(events_lock_); - if (try_locker.Locked()) - return events_.size(); + if (try_locker.Locked()) { + if (events_.size() == 0) + return false; + + switch (events_[0]->GetType()) { + case ParamEvent::kSetValue: + case ParamEvent::kSetValueCurve: + case ParamEvent::kSetTarget: + // Need automation if the event starts somewhere before the + // end of the current render quantum. + return events_[0]->Time() <= + (current_frame + AudioUtilities::kRenderQuantumFrames) / + sample_rate; + default: + // Otherwise, there's some kind of other event running, so we + // need to do automation. + return true; + } + } // Can't get the lock so that means the main thread is trying to insert an // event. Just return true then. If the main thread releases the lock before @@ -1105,6 +1123,14 @@ new_events_.clear(); } +// Test that for a SetTarget event, the current value is close enough +// to the target value that we can consider the event to have +// converged to the target. +static bool HasSetTargetConverged(float value, float target) { + return fabs(value - target) < kSetTargetThreshold * fabs(target) || + (target == 0 && fabs(value) < kSetTargetZeroThreshold); +} + bool AudioParamTimeline::HandleAllEventsInThePast(double current_time, double sample_rate, float default_value, @@ -1121,9 +1147,22 @@ // the curve, so we don't need to worry that SetValueCurve time is a // start time, not an end time. if (last_event_time + - 1.5 * AudioUtilities::kRenderQuantumFrames / sample_rate < - current_time && - last_event_type != ParamEvent::kSetTarget) { + 1.5 * AudioUtilities::kRenderQuantumFrames / sample_rate < + current_time) { + // If the last event is SetTarget, make sure we've converged and, that + // we're at least 5 time constants past the start of the event. If not, we + // have to continue processing it. + if (last_event_type == ParamEvent::kSetTarget) { + if (HasSetTargetConverged(default_value, last_event->Value()) && + current_time > last_event_time + 5 * last_event->TimeConstant()) { + // We've converged. Slam the default value with the target value. + default_value = last_event->Value(); + } else { + // Not converged, so give up; we can't remove this event yet. + return false; + } + } + // |events_| is being mutated. |new_events_| better be empty because there // are raw pointers there. DCHECK_EQ(new_events_.size(), 0U); @@ -1481,8 +1520,7 @@ // If the value is close enough to the target, just fill in the data // with the target value. - if (fabs(value - target) < kSetTargetThreshold * fabs(target) || - (!target && fabs(value) < kSetTargetZeroThreshold)) { + if (HasSetTargetConverged(value, target)) { for (; write_index < fill_to_frame; ++write_index) values[write_index] = target; } else {
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h index 781c216..a58966a 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h +++ b/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.h
@@ -93,8 +93,10 @@ float min_value, float max_value); - // Returns true if this AudioParam has any events on it. - bool HasValues() const; + // Returns true if the AudioParam timeline needs to run in this + // rendering quantum. This means some automation is already running + // or is scheduled to run in the current rendering quantuym. + bool HasValues(size_t current_frame, double sample_rate) const; float SmoothedValue() { return smoothed_value_; } void SetSmoothedValue(float v) { smoothed_value_ = v; }
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp index 7b8020c..0d0df31 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorklet.cpp
@@ -15,9 +15,7 @@ namespace blink { AudioWorklet* AudioWorklet::Create(BaseAudioContext* context) { - return RuntimeEnabledFeatures::AudioWorkletEnabled() - ? new AudioWorklet(context) - : nullptr; + return new AudioWorklet(context); } AudioWorklet::AudioWorklet(BaseAudioContext* context)
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.idl b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.idl index 1566021..d6702bc 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.idl +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletProcessor.idl
@@ -8,8 +8,7 @@ Constructor, ConstructorCallWith=ExecutionContext, Exposed=AudioWorklet, - Global=(Worklet,AudioWorklet), - OriginTrialEnabled=AudioWorklet + Global=(Worklet,AudioWorklet) ] interface AudioWorkletProcessor { readonly attribute MessagePort port; };
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp b/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp index b630e92..db871d2 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioWorkletThreadTest.cpp
@@ -29,7 +29,6 @@ #include "platform/testing/UnitTestHelpers.h" #include "platform/wtf/text/TextPosition.h" #include "public/platform/Platform.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebURLRequest.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp index 724e64130..818353b 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.cpp
@@ -147,8 +147,7 @@ FFTFrame::Initialize(); - if (OriginTrials::audioWorkletEnabled(GetExecutionContext()) || - RuntimeEnabledFeatures::AudioWorkletEnabled()) { + if (OriginTrials::audioWorkletEnabled(GetExecutionContext())) { audio_worklet_ = AudioWorklet::Create(this); }
diff --git a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.idl b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.idl index 82a1cce..c82d3c7 100644 --- a/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.idl +++ b/third_party/WebKit/Source/modules/webaudio/BaseAudioContext.idl
@@ -68,7 +68,7 @@ [RaisesException, MeasureAs=AudioContextCreateMediaStreamSource] MediaStreamAudioSourceNode createMediaStreamSource(MediaStream mediaStream); [RaisesException, MeasureAs=AudioContextCreateMediaStreamDestination] MediaStreamAudioDestinationNode createMediaStreamDestination(); - [RuntimeEnabled=AudioWorklet, SecureContext] readonly attribute AudioWorklet audioWorklet; + [OriginTrialEnabled=AudioWorklet, SecureContext] readonly attribute AudioWorklet audioWorklet; attribute EventHandler onstatechange; };
diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp index 93ab331..9b3a20f 100644 --- a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp +++ b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.cpp
@@ -41,6 +41,7 @@ // These properties are fixed and cannot be changed by the user. channel_count_ = number_of_outputs; SetInternalChannelCountMode(kExplicit); + SetInternalChannelInterpretation(AudioBus::kDiscrete); AddInput(); // Create a fixed number of outputs (able to handle the maximum number of @@ -110,6 +111,20 @@ } } +void ChannelSplitterHandler::SetChannelInterpretation( + const String& mode, + ExceptionState& exception_state) { + DCHECK(IsMainThread()); + BaseAudioContext::GraphAutoLocker locker(Context()); + + // channelInterpretation must be "discrete" + if (mode != "discrete") { + exception_state.ThrowDOMException(kInvalidStateError, + "ChannelSplitter: channelInterpretation " + "cannot be changed from 'discrete'"); + } +} + // ---------------------------------------------------------------- ChannelSplitterNode::ChannelSplitterNode(BaseAudioContext& context,
diff --git a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h index c3e44fe..9e91c35 100644 --- a/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h +++ b/third_party/WebKit/Source/modules/webaudio/ChannelSplitterNode.h
@@ -43,6 +43,7 @@ void Process(size_t frames_to_process) override; void SetChannelCount(unsigned long, ExceptionState&) final; void SetChannelCountMode(const String&, ExceptionState&) final; + void SetChannelInterpretation(const String&, ExceptionState&) final; // AudioNode double TailTime() const override { return 0; }
diff --git a/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp b/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp index 3222ef98..f245ae3 100644 --- a/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp +++ b/third_party/WebKit/Source/modules/webdatabase/SQLTransaction.cpp
@@ -318,9 +318,18 @@ SQLStatementErrorCallback* callback_error, ExceptionState& exception_state) { Vector<SQLValue> sql_values; - if (!arguments.IsNull()) - sql_values = ToImplArray<Vector<SQLValue>>( - arguments.Get(), script_state->GetIsolate(), exception_state); + if (!arguments.IsNull()) { + sql_values.ReserveInitialCapacity(arguments.Get().size()); + for (const ScriptValue& value : arguments.Get()) { + sql_values.UncheckedAppend(NativeValueTraits<SQLValue>::NativeValue( + script_state->GetIsolate(), value.V8Value(), exception_state)); + // Historically, no exceptions were thrown if the conversion failed. + if (exception_state.HadException()) { + sql_values.clear(); + break; + } + } + } ExecuteSQL(sql_statement, sql_values, callback, callback_error, exception_state); }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp index 5246246..e992690 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -4982,7 +4982,7 @@ scoped_refptr<StaticBitmapImage> image = canvas->Canvas2DBuffer()->NewImageSnapshot( kPreferAcceleration, FunctionIDToSnapshotReason(function_id)); - if (!!image && image->CopyImageToPlatformTexture( + if (!!image && image->CopyToTexture( ContextGL(), target, target_texture, unpack_premultiply_alpha_, unpack_flip_y_, IntPoint(xoffset, yoffset), source_sub_rectangle)) { @@ -5059,8 +5059,8 @@ copy_y_offset, source_sub_rectangle); } else { TexImageBitmapByGPU(static_cast<ImageBitmap*>(image), copy_target, - target_texture, !unpack_flip_y_, copy_x_offset, - copy_y_offset, source_sub_rectangle); + target_texture, copy_x_offset, copy_y_offset, + source_sub_rectangle); } } @@ -5351,7 +5351,7 @@ scoped_refptr<StaticBitmapImage> image = surface->NewImageSnapshot( kPreferAcceleration, FunctionIDToSnapshotReason(function_id)); if (!!image && - image->CopyImageToPlatformTexture( + image->CopyToTexture( ContextGL(), target, texture->Object(), unpack_premultiply_alpha_, unpack_flip_y_, IntPoint(0, 0), IntRect(0, 0, video->videoWidth(), video->videoHeight()))) { @@ -5378,12 +5378,12 @@ ImageBitmap* bitmap, GLenum target, GLuint target_texture, - bool flip_y, GLint xoffset, GLint yoffset, const IntRect& source_sub_rect) { bitmap->BitmapImage()->CopyToTexture( - GetDrawingBuffer()->ContextProvider(), target, target_texture, flip_y, + GetDrawingBuffer()->ContextProvider()->ContextGL(), target, + target_texture, true /* unpack_premultiply_alpha */, unpack_flip_y_, IntPoint(xoffset, yoffset), source_sub_rect); }
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h index 17593bd5..63c70fe 100644 --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -1689,7 +1689,6 @@ void TexImageBitmapByGPU(ImageBitmap*, GLenum, GLuint, - bool, GLint, GLint, const IntRect&);
diff --git a/third_party/WebKit/Source/platform/BUILD.gn b/third_party/WebKit/Source/platform/BUILD.gn index 7f8e906..88f33f3 100644 --- a/third_party/WebKit/Source/platform/BUILD.gn +++ b/third_party/WebKit/Source/platform/BUILD.gn
@@ -370,12 +370,13 @@ "SharedBuffer.h", "SharedBufferChunkReader.cpp", "SharedBufferChunkReader.h", - "StorageQuotaCallbacks.h", "Supplementable.cpp", "Supplementable.h", "Theme.cpp", "Theme.h", "ThemeTypes.h", + "TimeClamper.cpp", + "TimeClamper.h", "Timer.cpp", "Timer.h", "UUID.cpp", @@ -520,6 +521,7 @@ "audio/android/FFTFrameOpenMAXDLAndroid.cpp", "audio/cpu/arm/VectorMathNEON.h", "audio/cpu/mips/VectorMathMSA.h", + "audio/cpu/x86/VectorMathSSE.cpp", "audio/cpu/x86/VectorMathSSE.h", "audio/cpu/x86/VectorMathX86.h", "audio/ffmpeg/FFTFrameFFMPEG.cpp", @@ -680,7 +682,6 @@ "exported/WebSpeechSynthesisVoice.cpp", "exported/WebSpeechSynthesizerClientImpl.cpp", "exported/WebSpeechSynthesizerClientImpl.h", - "exported/WebStorageQuotaCallbacks.cpp", "exported/WebString.cpp", "exported/WebSurfaceLayerBridge.cpp", "exported/WebTextRun.cpp", @@ -1765,6 +1766,7 @@ "PODRedBlackTreeTest.cpp", "ScopedOrientationChangeIndicatorTest.cpp", "SharedBufferTest.cpp", + "TimeClamperTest.cpp", "TimerTest.cpp", "UUIDTest.cpp", "WebIconSizesParserTest.cpp",
diff --git a/third_party/WebKit/Source/platform/DEPS b/third_party/WebKit/Source/platform/DEPS index 2635809a..be636d62 100644 --- a/third_party/WebKit/Source/platform/DEPS +++ b/third_party/WebKit/Source/platform/DEPS
@@ -4,6 +4,7 @@ "+base/allocator/partition_allocator/oom.h", "+base/bind.h", "+base/bind_helpers.h", + "+base/bit_cast.h", "+base/feature_list.h", "+base/files", "+base/guid.h",
diff --git a/third_party/WebKit/Source/platform/StorageQuotaCallbacks.h b/third_party/WebKit/Source/platform/StorageQuotaCallbacks.h deleted file mode 100644 index ecbf1ec..0000000 --- a/third_party/WebKit/Source/platform/StorageQuotaCallbacks.h +++ /dev/null
@@ -1,64 +0,0 @@ -/* - * Copyright (C) 2013 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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. - */ - -#ifndef StorageQuotaCallbacks_h -#define StorageQuotaCallbacks_h - -#include "platform/PlatformExport.h" -#include "platform/heap/Handle.h" -#include "platform/wtf/Assertions.h" -#include "platform/wtf/Noncopyable.h" -#include "third_party/WebKit/common/quota/quota_types.mojom-blink.h" - -namespace blink { - -class PLATFORM_EXPORT StorageQuotaCallbacks - : public GarbageCollectedFinalized<StorageQuotaCallbacks> { - WTF_MAKE_NONCOPYABLE(StorageQuotaCallbacks); - - public: - StorageQuotaCallbacks() {} - virtual ~StorageQuotaCallbacks() {} - virtual void Trace(blink::Visitor* visitor) {} - - virtual void DidQueryStorageUsageAndQuota(unsigned long long usage_in_bytes, - unsigned long long quota_in_bytes) { - NOTREACHED(); - } - virtual void DidGrantStorageQuota(unsigned long long usage_in_bytes, - unsigned long long granted_quota_in_bytes) { - NOTREACHED(); - } - virtual void DidFail(mojom::QuotaStatusCode) { NOTREACHED(); } -}; - -} // namespace blink - -#endif // StorageQuotaCallbacks_h
diff --git a/third_party/WebKit/Source/platform/TimeClamper.cpp b/third_party/WebKit/Source/platform/TimeClamper.cpp new file mode 100644 index 0000000..18244e76 --- /dev/null +++ b/third_party/WebKit/Source/platform/TimeClamper.cpp
@@ -0,0 +1,54 @@ +// Copyright 2018 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 "platform/TimeClamper.h" + +#include "base/bit_cast.h" +#include "platform/wtf/Assertions.h" +#include "platform/wtf/CryptographicallyRandomNumber.h" + +#include <cmath> + +namespace blink { + +TimeClamper::TimeClamper() { + CryptographicallyRandomValues(&secret_, sizeof(secret_)); +} + +double TimeClamper::ClampTimeResolution(double time_seconds) const { + DCHECK_GE(time_seconds, 0); + double clamped_time = + floor(time_seconds / kResolutionSeconds) * kResolutionSeconds; + double tick_threshold = ThresholdFor(clamped_time); + + if (time_seconds >= tick_threshold) + return clamped_time + kResolutionSeconds; + return clamped_time; +} + +inline double TimeClamper::ThresholdFor(double clamped_time) const { + uint64_t time_hash = MurmurHash3(bit_cast<int64_t>(clamped_time) ^ secret_); + return clamped_time + kResolutionSeconds * ToDouble(time_hash); +} + +// static +inline double TimeClamper::ToDouble(uint64_t value) { + // Exponent for double values for [1.0 .. 2.0] + static const uint64_t kExponentBits = uint64_t{0x3FF0000000000000}; + static const uint64_t kMantissaMask = uint64_t{0x000FFFFFFFFFFFFF}; + uint64_t random = (value & kMantissaMask) | kExponentBits; + return bit_cast<double>(random) - 1; +} + +// static +inline uint64_t TimeClamper::MurmurHash3(uint64_t value) { + value ^= value >> 33; + value *= uint64_t{0xFF51AFD7ED558CCD}; + value ^= value >> 33; + value *= uint64_t{0xC4CEB9FE1A85EC53}; + value ^= value >> 33; + return value; +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/platform/TimeClamper.h b/third_party/WebKit/Source/platform/TimeClamper.h new file mode 100644 index 0000000..7550ef1 --- /dev/null +++ b/third_party/WebKit/Source/platform/TimeClamper.h
@@ -0,0 +1,42 @@ +// Copyright 2018 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 TimeClamper_h +#define TimeClamper_h + +#include "base/macros.h" +#include "platform/PlatformExport.h" + +#include <stdint.h> + +namespace blink { + +class PLATFORM_EXPORT TimeClamper { + public: + static constexpr double kResolutionSeconds = 0.0001; + + TimeClamper(); + + // Deterministically clamp the time value |time_seconds| to a 100us interval + // to prevent timing attacks. See + // http://www.w3.org/TR/hr-time-2/#privacy-security. + // + // For each clamped time interval, we compute a pseudorandom transition + // threshold. The returned time will either be the start of that interval or + // the next one depending on which side of the threshold |time_seconds| is. + double ClampTimeResolution(double time_seconds) const; + + private: + inline double ThresholdFor(double clamped_time) const; + static inline double ToDouble(uint64_t value); + static inline uint64_t MurmurHash3(uint64_t value); + + uint64_t secret_; + + DISALLOW_COPY_AND_ASSIGN(TimeClamper); +}; + +} // namespace blink + +#endif // TimeClamper_h
diff --git a/third_party/WebKit/Source/platform/TimeClamperTest.cpp b/third_party/WebKit/Source/platform/TimeClamperTest.cpp new file mode 100644 index 0000000..04e4622c --- /dev/null +++ b/third_party/WebKit/Source/platform/TimeClamperTest.cpp
@@ -0,0 +1,98 @@ +// Copyright 2018 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 "platform/TimeClamper.h" + +#include "testing/gtest/include/gtest/gtest.h" + +#include <cmath> + +namespace blink { +namespace { +const double kInterval = TimeClamper::kResolutionSeconds; +} + +TEST(TimeClamperTest, TimeStampsAreNonNegative) { + TimeClamper clamper; + EXPECT_GE(clamper.ClampTimeResolution(0), 0.f); + EXPECT_GE(clamper.ClampTimeResolution(TimeClamper::kResolutionSeconds), 0.f); +} + +TEST(TimeClamperTest, TimeStampsIncreaseByFixedAmount) { + const double kEpsilon = 1e-10; + TimeClamper clamper; + double prev = clamper.ClampTimeResolution(0); + for (double time_seconds = 0; time_seconds < kInterval * 100; + time_seconds += kInterval * 0.1) { + double clamped_time = clamper.ClampTimeResolution(time_seconds); + double delta = clamped_time - prev; + if (delta > kEpsilon) { + ASSERT_TRUE(std::fabs(delta - kInterval) < kEpsilon); + prev = clamped_time; + } + } +} + +TEST(TimeClamperTest, ClampingIsConsistent) { + TimeClamper clamper; + for (double time_seconds = 0; time_seconds < kInterval * 100; + time_seconds += kInterval * 0.1) { + double t1 = clamper.ClampTimeResolution(time_seconds); + double t2 = clamper.ClampTimeResolution(time_seconds); + EXPECT_EQ(t1, t2); + } +} + +TEST(TimeClamperTest, ClampingIsPerInstance) { + const double kEpsilon = 1e-10; + TimeClamper clamper1; + TimeClamper clamper2; + double time_seconds = 0; + while (true) { + if (std::fabs(clamper1.ClampTimeResolution(time_seconds) - + clamper2.ClampTimeResolution(time_seconds)) > kEpsilon) { + break; + } + time_seconds += kInterval; + } +} + +TEST(TimeClamperTest, ClampingIsUniform) { + const int kBuckets = 8; + const int kSampleCount = 10000; + const double kEpsilon = 1e-10; + const double kTimeStep = kInterval / kBuckets; + double time_seconds = 299792.458; + int histogram[kBuckets] = {0}; + TimeClamper clamper; + + // This test ensures the jitter thresholds are approximately uniformly + // distributed inside the clamping intervals. It samples individual intervals + // to detect where the threshold is and counts the number of steps taken. + for (int i = 0; i < kSampleCount; i++) { + double start = clamper.ClampTimeResolution(time_seconds); + for (int step = 0; step < kBuckets; step++) { + time_seconds += kTimeStep; + if (std::abs(clamper.ClampTimeResolution(time_seconds) - start) > + kEpsilon) { + histogram[step]++; + // Skip to the next interval to make sure each measurement is + // independent. + time_seconds = floor(time_seconds / kInterval) * kInterval + kInterval; + break; + } + } + } + + double expected_count = kSampleCount / kBuckets; + double chi_squared = 0; + for (int i = 0; i < kBuckets; ++i) { + double difference = histogram[i] - expected_count; + chi_squared += difference * difference / expected_count; + } + // P-value for a 0.001 significance level with 7 degrees of freedom. + EXPECT_LT(chi_squared, 24.322); +} + +} // namespace blink
diff --git a/third_party/WebKit/Source/platform/WebPointerEvent.cpp b/third_party/WebKit/Source/platform/WebPointerEvent.cpp index 8531f54..102959c 100644 --- a/third_party/WebKit/Source/platform/WebPointerEvent.cpp +++ b/third_party/WebKit/Source/platform/WebPointerEvent.cpp
@@ -68,12 +68,14 @@ SetModifiers(mouse_event.GetModifiers()); } -WebPointerEvent::WebPointerEvent(WebPointerProperties::PointerType type, - double time_stamp_seconds) - : WebPointerEvent() { - pointer_type = type; - SetTimeStampSeconds(time_stamp_seconds); - SetType(WebInputEvent::Type::kPointerCausedUaAction); +WebPointerEvent WebPointerEvent::CreatePointerCausesUaActionEvent( + WebPointerProperties::PointerType type, + double time_stamp_seconds) { + WebPointerEvent event; + event.pointer_type = type; + event.SetTimeStampSeconds(time_stamp_seconds); + event.SetType(WebInputEvent::Type::kPointerCausedUaAction); + return event; } WebPointerEvent WebPointerEvent::WebPointerEventInRootFrame() const {
diff --git a/third_party/WebKit/Source/platform/WebVectorTest.cpp b/third_party/WebKit/Source/platform/WebVectorTest.cpp index b66c16a..93bdf818 100644 --- a/third_party/WebKit/Source/platform/WebVectorTest.cpp +++ b/third_party/WebKit/Source/platform/WebVectorTest.cpp
@@ -151,4 +151,23 @@ EXPECT_EQ(i, vector[i]); } +namespace { + +// Used to ensure that WebVector supports types without a default constructor. +struct NoDefaultConstructor { + NoDefaultConstructor(int data) : data(data) {} + + int data; +}; + +} // anonymous namespace + +TEST(WebVectorTest, NoDefaultConstructor) { + WebVector<NoDefaultConstructor> vector; + vector.reserve(1); + vector.emplace_back(42); + ASSERT_EQ(1U, vector.size()); + EXPECT_EQ(42, vector[0].data); +} + } // namespace blink
diff --git a/third_party/WebKit/Source/platform/audio/AudioDestination.cpp b/third_party/WebKit/Source/platform/audio/AudioDestination.cpp index 8476c133..c313800 100644 --- a/third_party/WebKit/Source/platform/audio/AudioDestination.cpp +++ b/third_party/WebKit/Source/platform/audio/AudioDestination.cpp
@@ -35,7 +35,6 @@ #include "platform/audio/AudioUtilities.h" #include "platform/audio/PushPullFIFO.h" #include "platform/instrumentation/tracing/TraceEvent.h" -#include "platform/runtime_enabled_features.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/wtf/PtrUtil.h" #include "public/platform/Platform.h" @@ -197,7 +196,6 @@ void AudioDestination::StartWithWorkletThread( WebThread* worklet_backing_thread) { DCHECK(IsMainThread()); - DCHECK(RuntimeEnabledFeatures::AudioWorkletEnabled()); if (web_audio_device_ && !is_playing_) { TRACE_EVENT0("webaudio", "AudioDestination::Start");
diff --git a/third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathImpl.cpp b/third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathSSE.cpp similarity index 92% rename from third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathImpl.cpp rename to third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathSSE.cpp index c802ab4e..0cb1bb5 100644 --- a/third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathImpl.cpp +++ b/third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathSSE.cpp
@@ -6,6 +6,9 @@ #if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_MACOSX) +#include "platform/audio/cpu/x86/VectorMathSSE.h" + +#include "platform/audio/VectorMathScalar.h" #include "platform/wtf/Assertions.h" #include <algorithm> @@ -16,26 +19,15 @@ namespace blink { namespace VectorMath { namespace SSE { -namespace { #define MM_PS(name) _mm_##name##_ps -using MType = __m128; - -constexpr size_t kBitsPerRegister = 128u; -constexpr size_t kPackedFloatsPerRegister = kBitsPerRegister / 32u; -constexpr size_t kFramesToProcessMask = ~(kPackedFloatsPerRegister - 1u); -} - -namespace { - bool IsAligned(const float* p) { constexpr size_t kBytesPerRegister = kBitsPerRegister / 8u; constexpr size_t kAlignmentOffsetMask = kBytesPerRegister - 1u; return (reinterpret_cast<size_t>(p) & kAlignmentOffsetMask) == 0u; } -// dest[k] = source1[k] + source2[k] void Vadd(const float* source1p, const float* source2p, float* dest_p, @@ -73,8 +65,6 @@ #undef ADD_ALL } -// dest[k] = clip(source[k], low_threshold, high_threshold) -// = max(low_threshold, min(high_threshold, source[k])) void Vclip(const float* source_p, const float* low_threshold_p, const float* high_threshold_p, @@ -107,7 +97,6 @@ #undef CLIP_ALL } -// max = max(abs(source[k])) for all k void Vmaxmgv(const float* source_p, float* max_p, size_t frames_to_process) { constexpr uint32_t kMask = 0x7FFFFFFFu; @@ -134,7 +123,6 @@ *max_p = std::max(*max_p, maxes[i]); } -// dest[k] = source1[k] * source2[k] void Vmul(const float* source1p, const float* source2p, float* dest_p, @@ -172,7 +160,6 @@ #undef MULTIPLY_ALL } -// dest[k] += scale * source[k] void Vsma(const float* source_p, const float* scale, float* dest_p, @@ -203,7 +190,6 @@ #undef SCALAR_MULTIPLY_AND_ADD_ALL } -// dest[k] = scale * source[k] void Vsmul(const float* source_p, const float* scale, float* dest_p, @@ -233,7 +219,6 @@ #undef SCALAR_MULTIPLY_ALL } -// sum += sum(source[k]^2) for all k void Vsvesq(const float* source_p, float* sum_p, size_t frames_to_process) { const float* const source_end_p = source_p + frames_to_process; @@ -254,8 +239,6 @@ *sum_p += sums[i]; } -// real_dest_p[k] = real1[k] * real2[k] - imag1[k] * imag2[k] -// imag_dest_p[k] = real1[k] * imag2[k] + imag1[k] * real2[k] void Zvmul(const float* real1p, const float* imag1p, const float* real2p, @@ -292,7 +275,6 @@ #undef MM_PS -} // namespace } // namespace SSE } // namespace VectorMath } // namespace blink
diff --git a/third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathSSE.h b/third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathSSE.h index 3735705c..cc5346fa 100644 --- a/third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathSSE.h +++ b/third_party/WebKit/Source/platform/audio/cpu/x86/VectorMathSSE.h
@@ -5,9 +5,69 @@ #ifndef VectorMathSSE_h #define VectorMathSSE_h -#include "platform/audio/cpu/x86/VectorMathImpl.cpp" +#include <xmmintrin.h> -// Check that VectorMathImpl.cpp defined the blink::VectorMath::SSE namespace. -static_assert(sizeof(blink::VectorMath::SSE::MType), ""); +namespace blink { +namespace VectorMath { +namespace SSE { + +using MType = __m128; + +constexpr size_t kBitsPerRegister = 128u; +constexpr size_t kPackedFloatsPerRegister = kBitsPerRegister / 32u; +constexpr size_t kFramesToProcessMask = ~(kPackedFloatsPerRegister - 1u); + +bool IsAligned(const float* p); + +// dest[k] = source1[k] + source2[k] +void Vadd(const float* source1p, + const float* source2p, + float* dest_p, + size_t frames_to_process); + +// dest[k] = clip(source[k], low_threshold, high_threshold) +// = max(low_threshold, min(high_threshold, source[k])) +void Vclip(const float* source_p, + const float* low_threshold_p, + const float* high_threshold_p, + float* dest_p, + size_t frames_to_process); + +void Vmaxmgv(const float* source_p, float* max_p, size_t frames_to_process); + +// dest[k] = source1[k] * source2[k] +void Vmul(const float* source1p, + const float* source2p, + float* dest_p, + size_t frames_to_process); + +// dest[k] += scale * source[k] +void Vsma(const float* source_p, + const float* scale, + float* dest_p, + size_t frames_to_process); + +// dest[k] = scale * source[k] +void Vsmul(const float* source_p, + const float* scale, + float* dest_p, + size_t frames_to_process); + +// sum += sum(source[k]^2) for all k +void Vsvesq(const float* source_p, float* sum_p, size_t frames_to_process); + +// real_dest_p[k] = real1[k] * real2[k] - imag1[k] * imag2[k] +// imag_dest_p[k] = real1[k] * imag2[k] + imag1[k] * real2[k] +void Zvmul(const float* real1p, + const float* imag1p, + const float* real2p, + const float* imag2p, + float* real_dest_p, + float* imag_dest_p, + size_t frames_to_process); + +} // namespace SSE +} // namespace VectorMath +} // namespace blink #endif // VectorMathSSE_h
diff --git a/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.cpp b/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.cpp index e18cbd0b..3ccd3ee 100644 --- a/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.cpp +++ b/third_party/WebKit/Source/platform/bindings/V8PerIsolateData.cpp
@@ -96,7 +96,9 @@ // main thread. V8PerIsolateData::V8PerIsolateData() : v8_context_snapshot_mode_(V8ContextSnapshotMode::kTakeSnapshot), - isolate_holder_(&startup_data_), + isolate_holder_( + Platform::Current()->MainThread()->GetSingleThreadTaskRunner(), + &startup_data_), interface_template_map_for_v8_context_snapshot_(GetIsolate()), string_cache_(WTF::WrapUnique(new StringCache(GetIsolate()))), private_property_(V8PrivateProperty::Create()),
diff --git a/third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp b/third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp index 541e69e..feb16e6 100644 --- a/third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp +++ b/third_party/WebKit/Source/platform/exported/WebCoalescedInputEvent.cpp
@@ -7,6 +7,7 @@ #include "public/platform/WebGestureEvent.h" #include "public/platform/WebKeyboardEvent.h" #include "public/platform/WebMouseWheelEvent.h" +#include "public/platform/WebPointerEvent.h" #include "public/platform/WebTouchEvent.h" namespace blink { @@ -36,6 +37,8 @@ return op.template Execute<WebTouchEvent>(arg_in); if (WebInputEvent::IsGestureEventType(type)) return op.template Execute<WebGestureEvent>(arg_in); + if (WebInputEvent::IsPointerEventType(type)) + return op.template Execute<WebPointerEvent>(arg_in); NOTREACHED() << "Unknown webkit event type " << type; return false; @@ -93,6 +96,14 @@ } WebCoalescedInputEvent::WebCoalescedInputEvent( + const WebPointerEvent& event, + const std::vector<WebPointerEvent>& coalesced_events) { + event_ = MakeWebScopedInputEvent(event); + for (const auto& coalesced_event : coalesced_events) + coalesced_events_.push_back(MakeWebScopedInputEvent(coalesced_event)); +} + +WebCoalescedInputEvent::WebCoalescedInputEvent( const WebCoalescedInputEvent& event) : WebCoalescedInputEvent(event.Event(), event.GetCoalescedEventsPointers()) {} @@ -120,6 +131,10 @@ return WebScopedInputEvent(new blink::WebKeyboardEvent( static_cast<const blink::WebKeyboardEvent&>(event))); } + if (blink::WebInputEvent::IsPointerEventType(event.GetType())) { + return WebScopedInputEvent(new blink::WebPointerEvent( + static_cast<const blink::WebPointerEvent&>(event))); + } NOTREACHED(); return WebScopedInputEvent(); }
diff --git a/third_party/WebKit/Source/platform/exported/WebStorageQuotaCallbacks.cpp b/third_party/WebKit/Source/platform/exported/WebStorageQuotaCallbacks.cpp deleted file mode 100644 index 04f4f6e..0000000 --- a/third_party/WebKit/Source/platform/exported/WebStorageQuotaCallbacks.cpp +++ /dev/null
@@ -1,45 +0,0 @@ -// Copyright 2014 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 "public/platform/WebStorageQuotaCallbacks.h" - -#include "platform/StorageQuotaCallbacks.h" - -namespace blink { - -WebStorageQuotaCallbacks::WebStorageQuotaCallbacks( - StorageQuotaCallbacks* callbacks) - : private_(callbacks) {} - -void WebStorageQuotaCallbacks::Reset() { - private_.Reset(); -} - -void WebStorageQuotaCallbacks::Assign(const WebStorageQuotaCallbacks& other) { - private_ = other.private_; -} - -void WebStorageQuotaCallbacks::DidQueryStorageUsageAndQuota( - unsigned long long usage_in_bytes, - unsigned long long quota_in_bytes) { - DCHECK(!private_.IsNull()); - private_->DidQueryStorageUsageAndQuota(usage_in_bytes, quota_in_bytes); - private_.Reset(); -} - -void WebStorageQuotaCallbacks::DidGrantStorageQuota( - unsigned long long usage_in_bytes, - unsigned long long granted_quota_in_bytes) { - DCHECK(!private_.IsNull()); - private_->DidGrantStorageQuota(usage_in_bytes, granted_quota_in_bytes); - private_.Reset(); -} - -void WebStorageQuotaCallbacks::DidFail(mojom::QuotaStatusCode error) { - DCHECK(!private_.IsNull()); - private_->DidFail(error); - private_.Reset(); -} - -} // namespace blink
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp index c4dd9c27..4b29bde1 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp +++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
@@ -575,6 +575,17 @@ include_partial_glyphs)); } +TEST_F(HarfBuzzShaperTest, PositionForOffsetMissingGlyph) { + String string(u"\u0633\u0644\u0627\u0645"); + HarfBuzzShaper shaper(string.Characters16(), string.length()); + scoped_refptr<ShapeResult> result = shaper.Shape(&font, TextDirection::kRtl); + // Because the offset 1 and 2 should form a ligature, SubRange(2, 4) creates a + // ShapeResult that does not have its first glyph. + result = result->SubRange(2, 4); + result->PositionForOffset(0); + // Pass if |PositionForOffset| does not crash. +} + static struct ShapeResultCopyRangeTestData { const char16_t* string; TextDirection direction;
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp index 258b548..2151e905 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp +++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
@@ -93,11 +93,15 @@ position += glyph_data_[glyph_index].advance; ++glyph_index; } + // If |glyph_index| is at the end, the glyph for |offset| is missing, along + // with all glyphs before it. We can't adjust position to the start + // direction. + if (glyph_index == num_glyphs) + return position; // Adjust offset if it's not on the cluster boundary. In RTL, this means // that the adjusted position is the left side of the character. if (adjust_mid_cluster == kAdjustToEnd && - (glyph_index < num_glyphs ? glyph_data_[glyph_index].character_index - : num_characters_) < offset) { + glyph_data_[glyph_index].character_index < offset) { return position; } // For RTL, we need to return the right side boundary of the character.
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.cpp index 6ed7065..0f8cd57 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.cpp +++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.cpp
@@ -34,10 +34,6 @@ namespace { -inline bool IsHangableSpace(UChar ch) { - return ch == kSpaceCharacter || ch == kTabulationCharacter; -} - // ShapingLineBreaker computes using visual positions. This function flips // logical advance to visual, or vice versa. LayoutUnit FlipRtl(LayoutUnit value, TextDirection direction) { @@ -121,11 +117,11 @@ unsigned previous_break_opportunity = break_iterator_->PreviousBreakOpportunity(offset, start); unsigned word_start = previous_break_opportunity; - if (break_iterator_->BreakSpace() != BreakSpaceType::kAfter) { - while (word_start < text.length() && - LazyLineBreakIterator::IsBreakableSpace(text[word_start])) - word_start++; - } + // Skip the leading spaces of this word because the break iterator breaks + // before spaces. + while (word_start < text.length() && + LazyLineBreakIterator::IsBreakableSpace(text[word_start])) + word_start++; if (offset >= word_start && ShouldHyphenate(text, previous_break_opportunity, word_end)) { unsigned prefix_length = Hyphenate(offset, word_start, word_end, backwards); @@ -227,7 +223,6 @@ DCHECK_GE(start, range_start); DCHECK_LT(start, range_end); result_out->is_hyphenated = false; - result_out->has_hanging_spaces = false; const String& text = GetText(); // The start position in the original shape results. @@ -256,30 +251,18 @@ // comparing floats. See ShapeLineZeroAvailableWidth on Linux/Mac. candidate_break = std::max(candidate_break, start); - unsigned break_opportunity; - if (break_iterator_->BreakSpace() == BreakSpaceType::kAfter && - IsHangableSpace(text[candidate_break])) { - // If BreakAfterSpace, allow spaces to hang over the available space. - result_out->has_hanging_spaces = true; - break_opportunity = break_iterator_->NextBreakOpportunity(candidate_break); + unsigned break_opportunity = PreviousBreakOpportunity( + candidate_break, start, &result_out->is_hyphenated); + if (break_opportunity <= start) { + break_opportunity = + NextBreakOpportunity(std::max(candidate_break, start + 1), start, + &result_out->is_hyphenated); + // |range_end| may not be a break opportunity, but this function cannot + // measure beyond it. if (break_opportunity >= range_end) { result_out->break_offset = range_end; return ShapeToEnd(start, start_position, range_end); } - } else { - break_opportunity = PreviousBreakOpportunity(candidate_break, start, - &result_out->is_hyphenated); - if (break_opportunity <= start) { - break_opportunity = - NextBreakOpportunity(std::max(candidate_break, start + 1), start, - &result_out->is_hyphenated); - // |range_end| may not be a break opportunity, but this function cannot - // measure beyond it. - if (break_opportunity >= range_end) { - result_out->break_offset = range_end; - return ShapeToEnd(start, start_position, range_end); - } - } } DCHECK_GT(break_opportunity, start);
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.h b/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.h index d091274..d17ebfd 100644 --- a/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.h +++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.h
@@ -54,11 +54,6 @@ // The hyphen glyph is not included in the |ShapeResult|, and that appending // a hyphen glyph may overflow the specified available space. bool is_hyphenated; - - // True if trailing spaces hang over the given |available_space|. - // False when the result does not have trailing spaces, or trailing spaces - // do not hang. - bool has_hanging_spaces; }; // Shapes a line of text by finding a valid and appropriate break opportunity
diff --git a/third_party/WebKit/Source/platform/geometry/FloatSize.h b/third_party/WebKit/Source/platform/geometry/FloatSize.h index 5b1880b5..0a156d6 100644 --- a/third_party/WebKit/Source/platform/geometry/FloatSize.h +++ b/third_party/WebKit/Source/platform/geometry/FloatSize.h
@@ -75,6 +75,8 @@ float AspectRatio() const { return width_ / height_; } + float Area() const { return width_ * height_; } + void Expand(float width, float height) { width_ += width; height_ += height;
diff --git a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp index 6407ebe..afd2a0b 100644 --- a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp +++ b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
@@ -141,16 +141,17 @@ texture_holder_->UpdateSyncToken(sync_token); } -void AcceleratedStaticBitmapImage::CopyToTexture( - WebGraphicsContext3DProvider* dest_provider, +bool AcceleratedStaticBitmapImage::CopyToTexture( + gpu::gles2::GLES2Interface* dest_gl, GLenum dest_target, GLuint dest_texture_id, - bool flip_y, + bool unpack_premultiply_alpha, + bool unpack_flip_y, const IntPoint& dest_point, const IntRect& source_sub_rectangle) { CheckThread(); if (!IsValid()) - return; + return false; // |destProvider| may not be the same context as the one used for |m_image|, // so we use a mailbox to generate a texture id for |destProvider| to access. @@ -159,7 +160,6 @@ EnsureMailbox(kUnverifiedSyncToken, GL_NEAREST); // Get a texture id that |destProvider| knows about and copy from it. - gpu::gles2::GLES2Interface* dest_gl = dest_provider->ContextGL(); dest_gl->WaitSyncTokenCHROMIUM( texture_holder_->GetSyncToken().GetConstData()); GLuint source_texture_id = dest_gl->CreateAndConsumeTextureCHROMIUM( @@ -167,11 +167,13 @@ dest_gl->CopySubTextureCHROMIUM( source_texture_id, 0, dest_target, dest_texture_id, 0, dest_point.X(), dest_point.Y(), source_sub_rectangle.X(), source_sub_rectangle.Y(), - source_sub_rectangle.Width(), source_sub_rectangle.Height(), flip_y, - false, false); + source_sub_rectangle.Width(), source_sub_rectangle.Height(), + unpack_flip_y ? GL_FALSE : GL_TRUE, GL_FALSE, + unpack_premultiply_alpha ? GL_FALSE : GL_TRUE); // This drops the |destGL| context's reference on our |m_mailbox|, but it's // still held alive by our SkImage. dest_gl->DeleteTextures(1, &source_texture_id); + return true; } PaintImage AcceleratedStaticBitmapImage::PaintImageForCurrentFrame() {
diff --git a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h index 3f3b035..749a5483 100644 --- a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h +++ b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.h
@@ -61,10 +61,11 @@ const final; scoped_refptr<StaticBitmapImage> MakeUnaccelerated() final; - void CopyToTexture(WebGraphicsContext3DProvider*, + bool CopyToTexture(gpu::gles2::GLES2Interface* dest_gl, GLenum dest_target, GLuint dest_texture_id, - bool flip_y, + bool unpack_premultiply_alpha, + bool unpack_flip_y, const IntPoint& dest_point, const IntRect& source_sub_rectangle) override;
diff --git a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp index 96f8126..584b450d 100644 --- a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp +++ b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.cpp
@@ -118,7 +118,7 @@ alloc_size_in_bytes, WTF::ArrayBufferContents::kZeroInitialize); if (!data) return false; - WTF::ArrayBufferContents result(std::move(data), alloc_size_in_bytes, + WTF::ArrayBufferContents result(std::move(data), WTF::ArrayBufferContents::kNotShared); result.Transfer(dest_contents); return true; @@ -136,7 +136,7 @@ initialization_policy); if (!data) return false; - WTF::ArrayBufferContents result(std::move(data), alloc_size_in_bytes, + WTF::ArrayBufferContents result(std::move(data), WTF::ArrayBufferContents::kNotShared); SkColorType color_type = @@ -160,73 +160,4 @@ return sync_token; } -bool StaticBitmapImage::CopyImageToPlatformTexture( - gpu::gles2::GLES2Interface* gl, - GLenum target, - GLuint texture, - bool premultiply_alpha, - bool flip_y, - const IntPoint& dest_point, - const IntRect& source_sub_rectangle) { - if (!IsTextureBacked() || !IsValid()) - return false; - - // Get the texture ID, flushing pending operations if needed. - const GrGLTextureInfo* texture_info = skia::GrBackendObjectToGrGLTextureInfo( - PaintImageForCurrentFrame().GetSkImage()->getTextureHandle(true)); - if (!texture_info || !texture_info->fID) - return false; - - WebGraphicsContext3DProvider* provider = ContextProvider(); - if (!provider || !provider->GetGrContext()) - return false; - gpu::gles2::GLES2Interface* source_gl = provider->ContextGL(); - - gpu::Mailbox mailbox; - - // Contexts may be in a different share group. We must transfer the texture - // through a mailbox first. - source_gl->GenMailboxCHROMIUM(mailbox.name); - source_gl->ProduceTextureDirectCHROMIUM(texture_info->fID, mailbox.name); - // TODO(xlai): This one might need to be replaced with ShallowFlushCHROMIUM(). - // See crbug.com/794706. - source_gl->Flush(); - - gpu::SyncToken produce_sync_token; - source_gl->GenSyncTokenCHROMIUM(produce_sync_token.GetData()); - gl->WaitSyncTokenCHROMIUM(produce_sync_token.GetConstData()); - - GLuint source_texture = gl->CreateAndConsumeTextureCHROMIUM(mailbox.name); - - // The canvas is stored in a premultiplied format, so unpremultiply if - // necessary. The canvas is also stored in an inverted position, so the flip - // semantics are reversed. - // It is expected that callers of this method have already allocated - // the platform texture with the appropriate size. - gl->CopySubTextureCHROMIUM( - source_texture, 0, target, texture, 0, dest_point.X(), dest_point.Y(), - source_sub_rectangle.X(), source_sub_rectangle.Y(), - source_sub_rectangle.Width(), source_sub_rectangle.Height(), - flip_y ? GL_FALSE : GL_TRUE, GL_FALSE, - premultiply_alpha ? GL_FALSE : GL_TRUE); - - gl->DeleteTextures(1, &source_texture); - - gl->Flush(); - - gpu::SyncToken copy_sync_token; - gl->GenSyncTokenCHROMIUM(copy_sync_token.GetData()); - source_gl->WaitSyncTokenCHROMIUM(copy_sync_token.GetConstData()); - // This disassociates the texture from the mailbox to avoid leaking the - // mapping between the two in cases where the texture is recycled by skia. - source_gl->ProduceTextureDirectCHROMIUM(0, mailbox.name); - - // Undo grContext texture binding changes introduced in this function. - GrContext* gr_context = provider->GetGrContext(); - CHECK(gr_context); // We already check / early-out above if null. - gr_context->resetContext(kTextureBinding_GrGLBackendState); - - return true; -} - } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h index 73caa51..890b7c08 100644 --- a/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h +++ b/third_party/WebKit/Source/platform/graphics/StaticBitmapImage.h
@@ -29,7 +29,6 @@ namespace blink { -class WebGraphicsContext3DProvider; class WebGraphicsContext3DProviderWrapper; class PLATFORM_EXPORT StaticBitmapImage : public Image { @@ -73,26 +72,17 @@ virtual scoped_refptr<StaticBitmapImage> MakeUnaccelerated() { return this; } // Methods overridden by AcceleratedStaticBitmapImage only - virtual void CopyToTexture(WebGraphicsContext3DProvider*, + // Assumes the destination texture has already been allocated. + virtual bool CopyToTexture(gpu::gles2::GLES2Interface*, GLenum, GLuint, bool, + bool, const IntPoint&, const IntRect&) { NOTREACHED(); + return false; } - // TODO: Merge CopyImageToPlatformTexture function with CopyToTexture - // function above and probably with CopyToPlatformTexture in DrawingBuffer - // too. See crbug.com/794706. - // Destroys the TEXTURE_2D binding for the active texture unit of the passed - // context. Assumes the destination texture has already been allocated. - bool CopyImageToPlatformTexture(gpu::gles2::GLES2Interface*, - GLenum target, - GLuint texture, - bool premultiply_alpha, - bool flip_y, - const IntPoint& dest_point, - const IntRect& source_sub_rectangle); // EnsureMailbox modifies the internal state of an accelerated static bitmap // image to make sure that it is represented by a Mailbox. This must be
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp index 69b40485..aa92d0a 100644 --- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp +++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -680,7 +680,13 @@ (webgl_version_ > kWebGL1 || extensions_util_->SupportsExtension("GL_EXT_texture_storage")) && anti_aliasing_mode_ == kScreenSpaceAntialiasing; - sample_count_ = std::min(8, max_sample_count); + // Performance regreses by 30% in WebGL apps for AMD Stoney + // if sample count is 8x + if (ContextProvider()->GetGpuFeatureInfo().IsWorkaroundEnabled( + gpu::MAX_MSAA_SAMPLE_COUNT_4)) + sample_count_ = std::min(4, max_sample_count); + else + sample_count_ = std::min(8, max_sample_count); texture_target_ = GL_TEXTURE_2D; #if defined(OS_MACOSX)
diff --git a/third_party/WebKit/Source/platform/heap/HeapAllocator.h b/third_party/WebKit/Source/platform/heap/HeapAllocator.h index c13288b..92a1f63 100644 --- a/third_party/WebKit/Source/platform/heap/HeapAllocator.h +++ b/third_party/WebKit/Source/platform/heap/HeapAllocator.h
@@ -245,8 +245,12 @@ // children but rather push all blink::GarbageCollected objects and only // eagerly trace non-managed objects. DCHECK(!thread_state->Heap().GetStackFrameDepth().IsEnabled()); - HeapAllocator::template Trace<Visitor*, T, Traits>( - thread_state->CurrentVisitor(), *object); + TraceCollectionIfEnabled< + WTF::IsTraceableInCollectionTrait<Traits>::value, + // No weak handling for write barriers. The weak references will be + // updated in the atomic pause. + WTF::kNoWeakHandlingInCollections, WTF::kWeakPointersActWeak, T, + Traits>::Trace(thread_state->CurrentVisitor(), *object); } #endif // BUILDFLAG(BLINK_HEAP_INCREMENTAL_MARKING) } @@ -263,8 +267,12 @@ DCHECK(thread_state->CurrentVisitor()); DCHECK(!thread_state->Heap().GetStackFrameDepth().IsEnabled()); while (len-- > 0) { - HeapAllocator::template Trace<Visitor*, T, Traits>( - thread_state->CurrentVisitor(), *array); + TraceCollectionIfEnabled< + WTF::IsTraceableInCollectionTrait<Traits>::value, + // No weak handling for write barriers. The weak references will be + // updated in the atomic pause. + WTF::kNoWeakHandlingInCollections, WTF::kWeakPointersActWeak, T, + Traits>::Trace(thread_state->CurrentVisitor(), *array); array++; } }
diff --git a/third_party/WebKit/Source/platform/heap/IncrementalMarkingTest.cpp b/third_party/WebKit/Source/platform/heap/IncrementalMarkingTest.cpp index e74ac2b..62b6192d 100644 --- a/third_party/WebKit/Source/platform/heap/IncrementalMarkingTest.cpp +++ b/third_party/WebKit/Source/platform/heap/IncrementalMarkingTest.cpp
@@ -53,6 +53,9 @@ CallbackStack* const marking_stack_; }; +// Expects that the write barrier fires for the objects passed to the +// constructor. This requires that the objects are added to the marking stack +// as well as headers being marked. template <typename T> class ExpectWriteBarrierFires : public IncrementalMarkingScope { public: @@ -82,7 +85,9 @@ // the marking stack. If it fails then the write barrier fired for an // unexpected object. EXPECT_NE(objects_.end(), pos); - objects_.erase(pos); + // Avoid crashing. + if (objects_.end() != pos) + objects_.erase(pos); } EXPECT_TRUE(objects_.empty()); } @@ -92,25 +97,35 @@ std::vector<HeapObjectHeader*> headers_; }; +// Expects that no write barrier fires for the objects passed to the +// constructor. This requires that the marking stack stays empty and the marking +// state of the object stays the same across the lifetime of the scope. template <typename T> class ExpectNoWriteBarrierFires : public IncrementalMarkingScope { public: - ExpectNoWriteBarrierFires(ThreadState* thread_state, T* object) - : IncrementalMarkingScope(thread_state), - object_(object), - header_(HeapObjectHeader::FromPayload(object_)) { + ExpectNoWriteBarrierFires(ThreadState* thread_state, + std::initializer_list<T*> objects) + : IncrementalMarkingScope(thread_state), objects_(objects) { EXPECT_TRUE(marking_stack_->IsEmpty()); - EXPECT_TRUE(header_->IsMarked()); + for (T* object : objects_) { + HeapObjectHeader* header = HeapObjectHeader::FromPayload(object); + headers_.push_back(header); + was_marked_.push_back(header->IsMarked()); + } + EXPECT_FALSE(objects_.empty()); } ~ExpectNoWriteBarrierFires() { EXPECT_TRUE(marking_stack_->IsEmpty()); - EXPECT_TRUE(header_->IsMarked()); + for (size_t i = 0; i < headers_.size(); i++) { + EXPECT_EQ(was_marked_[i], headers_[i]->IsMarked()); + } } private: - T* const object_; - HeapObjectHeader* const header_; + std::vector<T*> objects_; + std::vector<HeapObjectHeader*> headers_; + std::vector<bool> was_marked_; }; class Object : public GarbageCollected<Object> { @@ -176,7 +191,7 @@ Object* child = Object::Create(); HeapObjectHeader::FromPayload(child)->Mark(); { - ExpectNoWriteBarrierFires<Object> scope(ThreadState::Current(), child); + ExpectNoWriteBarrierFires<Object> scope(ThreadState::Current(), {child}); parent->set_next(child); } } @@ -293,7 +308,7 @@ Mixin* mixin = static_cast<Mixin*>(child); EXPECT_NE(static_cast<void*>(child), static_cast<void*>(mixin)); { - ExpectNoWriteBarrierFires<Child> scope(ThreadState::Current(), child); + ExpectNoWriteBarrierFires<Child> scope(ThreadState::Current(), {child}); parent->set_mixin(mixin); } } @@ -661,53 +676,150 @@ } // ============================================================================= -// HeapHashSet support. ======================================================== +// HeapHashSet/HeapLinkedHashSet support. ====================================== // ============================================================================= -TEST(IncrementalMarkingTest, HeapHashSetSetMember) { +namespace { + +template <typename Container> +void Set() { Object* obj = Object::Create(); - HeapHashSet<Member<Object>> set; + Container container; { ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj}); - set.insert(obj); + container.insert(obj); } } -TEST(IncrementalMarkingTest, HeapHashSetCopyMember) { +template <typename Container> +void SetNoBarrier() { Object* obj = Object::Create(); - HeapHashSet<Member<Object>> set1; - set1.insert(obj); + Container container; { - ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj}); - HeapHashSet<Member<Object>> set2(set1); - EXPECT_TRUE(set1.Contains(obj)); - EXPECT_TRUE(set2.Contains(obj)); + ExpectNoWriteBarrierFires<Object> scope(ThreadState::Current(), {obj}); + container.insert(obj); } } -TEST(IncrementalMarkingTest, HeapHashSetMoveMember) { +template <typename Container> +void Copy() { Object* obj = Object::Create(); - HeapHashSet<Member<Object>> set1; - set1.insert(obj); + Container container1; + container1.insert(obj); { ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj}); - HeapHashSet<Member<Object>> set2(std::move(set1)); + Container container2(container1); + EXPECT_TRUE(container1.Contains(obj)); + EXPECT_TRUE(container2.Contains(obj)); } } -TEST(IncrementalMarkingTest, HeapHashSetSwapMember) { +template <typename Container> +void CopyNoBarrier() { + Object* obj = Object::Create(); + Container container1; + container1.insert(obj); + { + ExpectNoWriteBarrierFires<Object> scope(ThreadState::Current(), {obj}); + Container container2(container1); + EXPECT_TRUE(container1.Contains(obj)); + EXPECT_TRUE(container2.Contains(obj)); + } +} + +template <typename Container> +void Move() { + Object* obj = Object::Create(); + Container container1; + container1.insert(obj); + { + ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj}); + Container container2(std::move(container1)); + } +} + +template <typename Container> +void MoveNoBarrier() { + Object* obj = Object::Create(); + Container container1; + container1.insert(obj); + { + ExpectNoWriteBarrierFires<Object> scope(ThreadState::Current(), {obj}); + Container container2(std::move(container1)); + } +} + +template <typename Container> +void Swap() { Object* obj1 = Object::Create(); Object* obj2 = Object::Create(); - HeapHashSet<Member<Object>> set1; - set1.insert(obj1); - HeapHashSet<Member<Object>> set2; - set2.insert(obj2); + Container container1; + container1.insert(obj1); + Container container2; + container2.insert(obj2); { ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj1, obj2}); - std::swap(set1, set2); + std::swap(container1, container2); } } +template <typename Container> +void SwapNoBarrier() { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + Container container1; + container1.insert(obj1); + Container container2; + container2.insert(obj2); + { + ExpectNoWriteBarrierFires<Object> scope(ThreadState::Current(), + {obj1, obj2}); + std::swap(container1, container2); + } +} + +} // namespace + +TEST(IncrementalMarkingTest, HeapHashSetSet) { + Set<HeapHashSet<Member<Object>>>(); + SetNoBarrier<HeapHashSet<WeakMember<Object>>>(); +} + +TEST(IncrementalMarkingTest, HeapHashSetCopy) { + Copy<HeapHashSet<Member<Object>>>(); + CopyNoBarrier<HeapHashSet<WeakMember<Object>>>(); +} + +TEST(IncrementalMarkingTest, HeapHashSetMove) { + Move<HeapHashSet<Member<Object>>>(); + MoveNoBarrier<HeapHashSet<WeakMember<Object>>>(); +} + +TEST(IncrementalMarkingTest, HeapHashSetSwap) { + Swap<HeapHashSet<Member<Object>>>(); + SwapNoBarrier<HeapHashSet<WeakMember<Object>>>(); +} + +TEST(IncrementalMarkingTest, HeapLinkedHashSetSet) { + Set<HeapLinkedHashSet<Member<Object>>>(); + SetNoBarrier<HeapLinkedHashSet<WeakMember<Object>>>(); +} + +TEST(IncrementalMarkingTest, HeapLinkedHashSetCopy) { + Copy<HeapLinkedHashSet<Member<Object>>>(); + CopyNoBarrier<HeapLinkedHashSet<WeakMember<Object>>>(); +} + +TEST(IncrementalMarkingTest, HeapLinkedHashSetMove) { + Move<HeapLinkedHashSet<Member<Object>>>(); + MoveNoBarrier<HeapLinkedHashSet<WeakMember<Object>>>(); +} + +TEST(IncrementalMarkingTest, HeapLinkedHashSetSwap) { + Swap<HeapLinkedHashSet<Member<Object>>>(); + SwapNoBarrier<HeapLinkedHashSet<WeakMember<Object>>>(); +} + class StrongWeakPair : public std::pair<Member<Object>, WeakMember<Object>> { DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); @@ -814,6 +926,19 @@ } } +TEST(IncrementalMarkingTest, HeapLinkedHashSetStrongWeakPair) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + HeapLinkedHashSet<StrongWeakPair> set; + { + // Only the strong field in the StrongWeakPair should be hit by the + // write barrier. + ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj1}); + set.insert(StrongWeakPair(obj1, obj2)); + EXPECT_FALSE(obj2->IsMarked()); + } +} + // ============================================================================= // HeapTerminatedArray support. ================================================ // ============================================================================= @@ -869,6 +994,37 @@ } } +TEST(IncrementalMarkingTest, HeapHashMapInsertWeakMember) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + HeapHashMap<WeakMember<Object>, WeakMember<Object>> map; + { + ExpectNoWriteBarrierFires<Object> scope(ThreadState::Current(), + {obj1, obj2}); + map.insert(obj1, obj2); + } +} + +TEST(IncrementalMarkingTest, HeapHashMapInsertMemberWeakMember) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + HeapHashMap<Member<Object>, WeakMember<Object>> map; + { + ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj1}); + map.insert(obj1, obj2); + } +} + +TEST(IncrementalMarkingTest, HeapHashMapInsertWeakMemberMember) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + HeapHashMap<WeakMember<Object>, Member<Object>> map; + { + ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj2}); + map.insert(obj1, obj2); + } +} + TEST(IncrementalMarkingTest, HeapHashMapSetMember) { Object* obj1 = Object::Create(); Object* obj2 = Object::Create(); @@ -937,6 +1093,75 @@ } } +TEST(IncrementalMarkingTest, HeapHashMapInsertStrongWeakPairMember) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + Object* obj3 = Object::Create(); + HeapHashMap<StrongWeakPair, Member<Object>> map; + { + // Tests that the write barrier also fires for entities such as + // StrongWeakPair that don't overload assignment operators in translators. + ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj1, obj3}); + map.insert(StrongWeakPair(obj1, obj2), obj3); + } +} + +TEST(IncrementalMarkingTest, HeapHashMapInsertMemberStrongWeakPair) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + Object* obj3 = Object::Create(); + HeapHashMap<Member<Object>, StrongWeakPair> map; + { + // Tests that the write barrier also fires for entities such as + // StrongWeakPair that don't overload assignment operators in translators. + ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj1, obj2}); + map.insert(obj1, StrongWeakPair(obj2, obj3)); + } +} + +TEST(IncrementalMarkingTest, HeapHashMapCopyWeakMember) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + HeapHashMap<WeakMember<Object>, WeakMember<Object>> map1; + map1.insert(obj1, obj2); + { + ExpectNoWriteBarrierFires<Object> scope(ThreadState::Current(), + {obj1, obj2}); + EXPECT_TRUE(map1.Contains(obj1)); + HeapHashMap<WeakMember<Object>, WeakMember<Object>> map2(map1); + EXPECT_TRUE(map1.Contains(obj1)); + EXPECT_TRUE(map2.Contains(obj1)); + } +} + +TEST(IncrementalMarkingTest, HeapHashMapCopyMemberWeakMember) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + HeapHashMap<Member<Object>, WeakMember<Object>> map1; + map1.insert(obj1, obj2); + { + ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj1}); + EXPECT_TRUE(map1.Contains(obj1)); + HeapHashMap<Member<Object>, WeakMember<Object>> map2(map1); + EXPECT_TRUE(map1.Contains(obj1)); + EXPECT_TRUE(map2.Contains(obj1)); + } +} + +TEST(IncrementalMarkingTest, HeapHashMapCopyWeakMemberMember) { + Object* obj1 = Object::Create(); + Object* obj2 = Object::Create(); + HeapHashMap<WeakMember<Object>, Member<Object>> map1; + map1.insert(obj1, obj2); + { + ExpectWriteBarrierFires<Object> scope(ThreadState::Current(), {obj2}); + EXPECT_TRUE(map1.Contains(obj1)); + HeapHashMap<WeakMember<Object>, Member<Object>> map2(map1); + EXPECT_TRUE(map1.Contains(obj1)); + EXPECT_TRUE(map2.Contains(obj1)); + } +} + } // namespace incremental_marking_test } // namespace blink
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp index 3573424..9e33722 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
@@ -27,12 +27,12 @@ #include "platform/loader/fetch/ResourceRequest.h" #include <memory> + #include "platform/network/NetworkUtils.h" #include "platform/network/http_names.h" #include "platform/runtime_enabled_features.h" #include "platform/weborigin/SecurityOrigin.h" #include "platform/wtf/PtrUtil.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebURLRequest.h" namespace blink { @@ -377,13 +377,14 @@ } void ResourceRequest::SetExternalRequestStateFromRequestorAddressSpace( - WebAddressSpace requestor_space) { - static_assert(kWebAddressSpaceLocal < kWebAddressSpacePrivate, + mojom::IPAddressSpace requestor_space) { + static_assert(mojom::IPAddressSpace::kLocal < mojom::IPAddressSpace::kPrivate, "Local is inside Private"); - static_assert(kWebAddressSpaceLocal < kWebAddressSpacePublic, + static_assert(mojom::IPAddressSpace::kLocal < mojom::IPAddressSpace::kPublic, "Local is inside Public"); - static_assert(kWebAddressSpacePrivate < kWebAddressSpacePublic, - "Private is inside Public"); + static_assert( + mojom::IPAddressSpace::kPrivate < mojom::IPAddressSpace::kPublic, + "Private is inside Public"); // TODO(mkwst): This only checks explicit IP addresses. We'll have to move all // this up to //net and //content in order to have any real impact on gateway @@ -393,11 +394,11 @@ return; } - WebAddressSpace target_space = kWebAddressSpacePublic; + mojom::IPAddressSpace target_space = mojom::IPAddressSpace::kPublic; if (NetworkUtils::IsReservedIPAddress(url_.Host())) - target_space = kWebAddressSpacePrivate; + target_space = mojom::IPAddressSpace::kPrivate; if (SecurityOrigin::Create(url_)->IsLocalhost()) - target_space = kWebAddressSpaceLocal; + target_space = mojom::IPAddressSpace::kLocal; is_external_request_ = requestor_space > target_space; }
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h index a61ce5e..ae0dd4c 100644 --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h
@@ -39,12 +39,12 @@ #include "platform/weborigin/SecurityOrigin.h" #include "platform/wtf/Optional.h" #include "platform/wtf/RefCounted.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebURLRequest.h" #include "public/platform/modules/fetch/fetch_api_request.mojom-shared.h" #include "services/network/public/interfaces/cors.mojom-blink.h" #include "services/network/public/interfaces/fetch_api.mojom-blink.h" #include "services/network/public/interfaces/request_context_frame_type.mojom-shared.h" +#include "third_party/WebKit/common/net/ip_address_space.mojom-blink.h" namespace blink { @@ -326,7 +326,7 @@ // https://wicg.github.io/cors-rfc1918/#external-request bool IsExternalRequest() const { return is_external_request_; } - void SetExternalRequestStateFromRequestorAddressSpace(WebAddressSpace); + void SetExternalRequestStateFromRequestorAddressSpace(mojom::IPAddressSpace); network::mojom::CORSPreflightPolicy CORSPreflightPolicy() const { return cors_preflight_policy_;
diff --git a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp index d9fe78e6..0aeced5 100644 --- a/third_party/WebKit/Source/platform/network/HTTPParsers.cpp +++ b/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
@@ -854,14 +854,12 @@ break; } + String value = ""; if (tokenizer.Consume('=')) { - String value; - if (!tokenizer.ConsumeTokenOrQuotedString(Mode::kNormal, value)) { - break; - } - - header.SetParameter(parameter_name, value); + tokenizer.ConsumeTokenOrQuotedString(Mode::kNormal, value); + tokenizer.ConsumeBeforeAnyCharMatch({',', ';'}); } + header.SetParameter(parameter_name, value); } headers->push_back(std::make_unique<ServerTimingHeader>(header));
diff --git a/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp b/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp index e01bf70..82e42e9 100644 --- a/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp +++ b/third_party/WebKit/Source/platform/network/HTTPParsersTest.cpp
@@ -508,28 +508,25 @@ } TEST(HTTPParsersTest, ParseServerTimingHeader) { + // empty string testServerTimingHeader("", {}); + + // name only testServerTimingHeader("metric", {{"metric", "0", ""}}); - testServerTimingHeader("metric;dur", {{"metric", "0", ""}}); + + // name and duration testServerTimingHeader("metric;dur=123.4", {{"metric", "123.4", ""}}); testServerTimingHeader("metric;dur=\"123.4\"", {{"metric", "123.4", ""}}); - testServerTimingHeader("metric;desc", {{"metric", "0", ""}}); + // name and description testServerTimingHeader("metric;desc=description", {{"metric", "0", "description"}}); testServerTimingHeader("metric;desc=\"description\"", {{"metric", "0", "description"}}); - testServerTimingHeader("metric;dur;desc", {{"metric", "0", ""}}); - testServerTimingHeader("metric;dur=123.4;desc", {{"metric", "123.4", ""}}); - testServerTimingHeader("metric;dur;desc=description", - {{"metric", "0", "description"}}); + // name, duration, and description testServerTimingHeader("metric;dur=123.4;desc=description", {{"metric", "123.4", "description"}}); - testServerTimingHeader("metric;desc;dur", {{"metric", "0", ""}}); - testServerTimingHeader("metric;desc;dur=123.4", {{"metric", "123.4", ""}}); - testServerTimingHeader("metric;desc=description;dur", - {{"metric", "0", "description"}}); testServerTimingHeader("metric;desc=description;dur=123.4", {{"metric", "123.4", "description"}}); @@ -541,18 +538,33 @@ testServerTimingHeader("metric;desc=\"descr;,=iption\";dur=123.4", {{"metric", "123.4", "descr;,=iption"}}); - // whitespace + // spaces testServerTimingHeader("metric ; ", {{"metric", "0", ""}}); testServerTimingHeader("metric , ", {{"metric", "0", ""}}); testServerTimingHeader("metric ; dur = 123.4 ; desc = description", {{"metric", "123.4", "description"}}); testServerTimingHeader("metric ; desc = description ; dur = 123.4", {{"metric", "123.4", "description"}}); + testServerTimingHeader("metric;desc = \"description\"", + {{"metric", "0", "description"}}); + + // tabs + /* known failures: + https://bugs.chromium.org/p/chromium/issues/detail?id=798446 + testServerTimingHeader("metric\t;\t", {{"metric", "0", ""}}); + testServerTimingHeader("metric\t,\t", {{"metric", "0", ""}}); + testServerTimingHeader("metric\t;\tdur\t=\t123.4\t;\tdesc\t=\tdescription", + {{"metric", "123.4", "description"}}); + testServerTimingHeader("metric\t;\tdesc\t=\tdescription\t;\tdur\t=\t123.4", + {{"metric", "123.4", "description"}}); + testServerTimingHeader("metric;desc\t=\t\"description\"", {{"metric", "0", + "description"}}); + */ // multiple entries testServerTimingHeader( - "metric1;dur=12.3;desc=description1,metric2;dur=45.6;" - "desc=description2,metric3;dur=78.9;desc=description3", + "metric1;dur=12.3;desc=description1,metric2;dur=45.6;desc=description2," + "metric3;dur=78.9;desc=description3", {{"metric1", "12.3", "description1"}, {"metric2", "45.6", "description2"}, {"metric3", "78.9", "description3"}}); @@ -563,7 +575,15 @@ {"metric4", "0", ""}, {"metric5", "0", ""}}); - // quoted-strings + // quoted-strings - happy path + testServerTimingHeader("metric;desc=\"description\"", + {{"metric", "0", "description"}}); + testServerTimingHeader("metric;desc=\"\t description \t\"", + {{"metric", "0", "\t description \t"}}); + testServerTimingHeader("metric;desc=\"descr\\\"iption\"", + {{"metric", "0", "descr\"iption"}}); + + // quoted-strings - others // metric;desc=\ --> '' testServerTimingHeader("metric;desc=\\", {{"metric", "0", ""}}); // metric;desc=" --> '' @@ -627,51 +647,58 @@ // duplicate entry names testServerTimingHeader( - "metric;dur=12.3;desc=description1,metric;dur=45.6;" - "desc=description2", + "metric;dur=12.3;desc=description1,metric;dur=45.6;desc=description2", {{"metric", "12.3", "description1"}, {"metric", "45.6", "description2"}}); + // param name case sensitivity + testServerTimingHeader("metric;DuR=123.4;DeSc=description", + {{"metric", "123.4", "description"}}); + // non-numeric durations testServerTimingHeader("metric;dur=foo", {{"metric", "0", ""}}); testServerTimingHeader("metric;dur=\"foo\"", {{"metric", "0", ""}}); // unrecognized param names testServerTimingHeader( - "metric;foo=bar;desc=description;foo=bar;dur=123.4;foo=bar", - {{"metric", "123.4", "description"}}); + "metric1;foo=bar;desc=description;foo=bar;dur=123.4;foo=bar,metric2", + {{"metric1", "123.4", "description"}, {"metric2", "0", ""}}); // duplicate param names testServerTimingHeader("metric;dur=123.4;dur=567.8", {{"metric", "123.4", ""}}); + testServerTimingHeader("metric;dur=foo;dur=567.8", {{"metric", "0", ""}}); testServerTimingHeader("metric;desc=description1;desc=description2", {{"metric", "0", "description1"}}); - testServerTimingHeader("metric;dur=foo;dur=567.8", {{"metric", "", ""}}); - // unspecified param values - testServerTimingHeader("metric;dur;dur=123.4", {{"metric", "123.4", ""}}); - testServerTimingHeader("metric;desc;desc=description", + // incomplete params + testServerTimingHeader("metric;dur;dur=123.4;desc=description", {{"metric", "0", "description"}}); + testServerTimingHeader("metric;dur=;dur=123.4;desc=description", + {{"metric", "0", "description"}}); + testServerTimingHeader("metric;desc;desc=description;dur=123.4", + {{"metric", "123.4", ""}}); + testServerTimingHeader("metric;desc=;desc=description;dur=123.4", + {{"metric", "123.4", ""}}); - // param name case - testServerTimingHeader("metric;DuR=123.4;DeSc=description", - {{"metric", "123.4", "description"}}); + // extraneous characters after param value as token + testServerTimingHeader("metric;desc=d1 d2;dur=123.4", + {{"metric", "123.4", "d1"}}); + testServerTimingHeader("metric1;desc=d1 d2,metric2", + {{"metric1", "0", "d1"}, {"metric2", "0", ""}}); - // nonsense - testServerTimingHeader("metric=foo;dur;dur=123.4,metric2", - {{"metric", "0", ""}}); - testServerTimingHeader("metric\"foo;dur;dur=123.4,metric2", - {{"metric", "0", ""}}); + // extraneous characters after param value as quoted-string + testServerTimingHeader("metric;desc=\"d1\" d2;dur=123.4", + {{"metric", "123.4", "d1"}}); + testServerTimingHeader("metric1;desc=\"d1\" d2,metric2", + {{"metric1", "0", "d1"}, {"metric2", "0", ""}}); - // TODO(cvazac) the following tests should actually NOT pass - // According to the definition of token/tchar - // (https://tools.ietf.org/html/rfc7230#appendix-B), - // HeaderFieldTokenizer.IsTokenCharacter is being too permissive for the - // following chars (decimal): - // 123 '{', 125 '}', and 127 (not defined) - testServerTimingHeader("{", {{"{", "0", ""}}); - testServerTimingHeader("}", {{"}", "0", ""}}); - testServerTimingHeader("{}", {{"{}", "0", ""}}); - testServerTimingHeader("{\"foo\":\"bar\"},metric", {{"{", "0", ""}}); + // nonsense - extraneous characters after entry name token + testServerTimingHeader("metric== \"\"foo;dur=123.4", {{"metric", "0", ""}}); + testServerTimingHeader("metric1== \"\"foo,metric2", {{"metric1", "0", ""}}); + + // nonsense - extraneous characters after param name token + testServerTimingHeader("metric;dur foo=12", {{"metric", "0", ""}}); + testServerTimingHeader("metric;foo dur=12", {{"metric", "0", ""}}); // nonsense - return zero entries testServerTimingHeader(" ", {}); @@ -687,6 +714,17 @@ testServerTimingHeader(";,", {}); testServerTimingHeader(",;", {}); testServerTimingHeader("=;,", {}); + + // TODO(cvazac) the following tests should actually NOT pass + // According to the definition of token/tchar + // (https://tools.ietf.org/html/rfc7230#appendix-B), + // HeaderFieldTokenizer.IsTokenCharacter is being too permissive for the + // following chars (decimal): + // 123 '{', 125 '}', and 127 (not defined) + testServerTimingHeader("{", {{"{", "0", ""}}); + testServerTimingHeader("}", {{"}", "0", ""}}); + testServerTimingHeader("{}", {{"{}", "0", ""}}); + testServerTimingHeader("{\"foo\":\"bar\"},metric", {{"{", "0", ""}}); } TEST(HTTPParsersTest, ParseContentTypeOptionsTest) {
diff --git a/third_party/WebKit/Source/platform/network/HeaderFieldTokenizer.cpp b/third_party/WebKit/Source/platform/network/HeaderFieldTokenizer.cpp index 7518a868..543fe45 100644 --- a/third_party/WebKit/Source/platform/network/HeaderFieldTokenizer.cpp +++ b/third_party/WebKit/Source/platform/network/HeaderFieldTokenizer.cpp
@@ -14,6 +14,7 @@ using Mode = HeaderFieldTokenizer::Mode; bool IsTokenCharacter(Mode mode, UChar c) { + // TODO(cvazac) change this to use LChar // TODO(cvazac) Check HTTPArchive for usage and possible deprecation. // According to https://tools.ietf.org/html/rfc7230#appendix-B, the // following characters (ASCII decimal) should not be included in a TOKEN: @@ -60,6 +61,7 @@ HeaderFieldTokenizer::HeaderFieldTokenizer(HeaderFieldTokenizer&&) = default; bool HeaderFieldTokenizer::Consume(char c) { + // TODO(cvazac) change this to use LChar DCHECK_NE(c, ' '); if (IsConsumed() || input_[index_] != c) @@ -131,4 +133,22 @@ ++index_; } +void HeaderFieldTokenizer::ConsumeBeforeAnyCharMatch(Vector<LChar> chars) { + // TODO(cvazac) move this to HeaderFieldTokenizer c'tor + DCHECK(input_.Is8Bit()); + + DCHECK_GT(chars.size(), 0U); + DCHECK_LT(chars.size(), 3U); + + while (!IsConsumed()) { + for (const auto& c : chars) { + if (c == input_[index_]) { + return; + } + } + + ++index_; + } +} + } // namespace blink
diff --git a/third_party/WebKit/Source/platform/network/HeaderFieldTokenizer.h b/third_party/WebKit/Source/platform/network/HeaderFieldTokenizer.h index 5b4ab11..5c855b1a 100644 --- a/third_party/WebKit/Source/platform/network/HeaderFieldTokenizer.h +++ b/third_party/WebKit/Source/platform/network/HeaderFieldTokenizer.h
@@ -30,6 +30,12 @@ bool ConsumeToken(Mode, StringView& output); bool ConsumeTokenOrQuotedString(Mode, String& output); + // Consume all characters before (but excluding) any of the characters from + // the Vector parameter are found. + // Because we potentially have to iterate through the entire Vector for each + // character of the base string, the Vector should be small (< 3 members). + void ConsumeBeforeAnyCharMatch(Vector<LChar>); + unsigned Index() const { return index_; } bool IsConsumed() const { return index_ >= input_.length(); }
diff --git a/third_party/WebKit/Source/platform/runtime_enabled_features.json5 b/third_party/WebKit/Source/platform/runtime_enabled_features.json5 index ec61d3e0..31addf85 100644 --- a/third_party/WebKit/Source/platform/runtime_enabled_features.json5 +++ b/third_party/WebKit/Source/platform/runtime_enabled_features.json5
@@ -242,6 +242,10 @@ status: "experimental", }, { + name: "CSSMatches", + status: "experimental", + }, + { name: "CSSOffsetPathRay", status: "experimental", }, @@ -895,6 +899,10 @@ name: "RootLayerScrolling", }, { + name: "RTCUnifiedPlan", + status: "experimental", + }, + { name: "ScriptedSpeech", status: "stable", },
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc index 36288686..82bc41cf 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
@@ -876,6 +876,23 @@ immediate_incoming_queue().push_back(std::move(task)); } +void TaskQueueImpl::RequeueDeferredNonNestableTask( + TaskQueueImpl::Task&& task, + Sequence::WorkType work_type) { + DCHECK(task.nestable == base::Nestable::kNonNestable); + // The re-queued tasks have to be pushed onto the front because we'd otherwise + // violate the strict monotonically increasing enqueue order within the + // WorkQueue. We can't assign them a new enqueue order here because that will + // not behave correctly with fences and things will break (e.g Idle TQ). + if (work_type == Sequence::WorkType::kDelayed) { + main_thread_only().delayed_work_queue->PushNonNestableTaskToFront( + std::move(task)); + } else { + main_thread_only().immediate_work_queue->PushNonNestableTaskToFront( + std::move(task)); + } +} + void TaskQueueImpl::SetOnNextWakeUpChangedCallback( TaskQueueImpl::OnNextWakeUpChangedCallback callback) { #if DCHECK_IS_ON()
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h index 9fc65585..e91f141 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
@@ -21,6 +21,7 @@ #include "platform/scheduler/base/enqueue_order.h" #include "platform/scheduler/base/graceful_queue_shutdown_helper.h" #include "platform/scheduler/base/intrusive_heap.h" +#include "platform/scheduler/base/sequence.h" #include "platform/scheduler/base/task_queue.h" #include "platform/wtf/Deque.h" @@ -229,6 +230,11 @@ main_thread_only().heap_handle = heap_handle; } + // Pushes |task| onto the front of the specified work queue. Caution must be + // taken with this API because you could easily starve out other work. + void RequeueDeferredNonNestableTask(TaskQueueImpl::Task&& task, + Sequence::WorkType work_type); + void PushImmediateIncomingTaskForTest(TaskQueueImpl::Task&& task); EnqueueOrder GetFenceForTest() const;
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc index 8e38cbe2..0107afb 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc
@@ -173,14 +173,37 @@ { base::AutoLock lock(any_thread_lock_); any_thread().immediate_do_work_posted_count++; - any_thread().is_nested = true; + any_thread().nesting_depth++; } - if (observer_) + main_thread_only().nesting_depth++; + if (observer_ && main_thread_only().nesting_depth == 1) observer_->OnBeginNestedRunLoop(); controller_->ScheduleWork(); } +void TaskQueueManager::OnExitNestedRunLoop() { + { + base::AutoLock lock(any_thread_lock_); + any_thread().nesting_depth--; + } + main_thread_only().nesting_depth--; + DCHECK_GE(main_thread_only().nesting_depth, 0); + if (main_thread_only().nesting_depth == 0) { + // While we were nested some non-nestable tasks may have become eligible to + // run. We push them back onto the front of their original work queues. + while (!main_thread_only().non_nestable_task_queue.empty()) { + NonNestableTask& non_nestable_task = + *main_thread_only().non_nestable_task_queue.begin(); + non_nestable_task.task_queue->RequeueDeferredNonNestableTask( + std::move(non_nestable_task.task), non_nestable_task.work_type); + main_thread_only().non_nestable_task_queue.pop_front(); + } + if (observer_) + observer_->OnExitNestedRunLoop(); + } +} + void TaskQueueManager::OnQueueHasIncomingImmediateWork( internal::TaskQueueImpl* queue, internal::EnqueueOrder enqueue_order, @@ -204,7 +227,7 @@ { MoveableAutoLock auto_lock(std::move(lock)); // Unless we're nested, try to avoid posting redundant DoWorks. - if (!any_thread().is_nested && + if (any_thread().nesting_depth == 0 && (any_thread().do_work_running_count == 1 || any_thread().immediate_do_work_posted_count > 0)) { return; @@ -233,7 +256,7 @@ // Unless we're nested, don't post a delayed DoWork if there's an immediate // DoWork in flight or we're inside a DoWork. We can rely on DoWork posting // a delayed continuation as needed. - if (!any_thread().is_nested && + if (any_thread().nesting_depth == 0 && (any_thread().immediate_do_work_posted_count > 0 || any_thread().do_work_running_count == 1)) { return; @@ -270,7 +293,6 @@ work_type == WorkType::kDelayed); LazyNow lazy_now(real_time_domain()->CreateLazyNow()); - bool is_nested = controller_->IsNested(); // This must be done before running any tasks because they could invoke a // nested run loop and we risk having a stale |next_delayed_do_work_|. @@ -280,7 +302,6 @@ for (int i = 0; i < work_batch_size_; i++) { IncomingImmediateWorkMap queues_to_reload; - bool was_nested = false; { base::AutoLock lock(any_thread_lock_); if (i == 0) { @@ -290,22 +311,10 @@ any_thread().immediate_do_work_posted_count--; DCHECK_GE(any_thread().immediate_do_work_posted_count, 0); } - } else { - // Ideally we'd have an OnNestedMessageloopExit observer, but in it's - // absence we may need to clear this flag after running a task (which - // ran a nested messageloop). - // TODO(altimin): Add OnNestedMessageLoopExit observer. - if (any_thread().is_nested && !is_nested) - was_nested = true; - any_thread().is_nested = is_nested; } - DCHECK_EQ(any_thread().is_nested, controller_->IsNested()); std::swap(queues_to_reload, any_thread().has_incoming_immediate_work); } - if (observer_ && was_nested) - observer_->OnExitNestedRunLoop(); - // It's important we call ReloadEmptyWorkQueues out side of the lock to // avoid a lock order inversion. ReloadEmptyWorkQueues(queues_to_reload); @@ -318,8 +327,7 @@ // NB this may unregister |work_queue|. base::TimeTicks time_after_task; - switch (ProcessTaskFromWorkQueue(work_queue, is_nested, lazy_now, - &time_after_task)) { + switch (ProcessTaskFromWorkQueue(work_queue, lazy_now, &time_after_task)) { case ProcessTaskResult::kDeferred: // If a task was deferred, try again with another task. continue; @@ -334,18 +342,17 @@ // Only run a single task per batch in nested run loops so that we can // properly exit the nested loop when someone calls RunLoop::Quit(). - if (is_nested) + if (main_thread_only().nesting_depth > 0) break; } - if (!is_nested) + if (main_thread_only().nesting_depth == 0) CleanUpQueues(); // TODO(alexclarke): Consider refactoring the above loop to terminate only // when there's no more work left to be done, rather than posting a // continuation task. - bool was_nested = false; { MoveableAutoLock lock(any_thread_lock_); base::Optional<NextTaskDelay> next_delay = @@ -354,16 +361,8 @@ any_thread().do_work_running_count--; DCHECK_GE(any_thread().do_work_running_count, 0); - if (any_thread().is_nested && !is_nested) - was_nested = true; - any_thread().is_nested = is_nested; - DCHECK_EQ(any_thread().is_nested, controller_->IsNested()); - PostDoWorkContinuationLocked(next_delay, &lazy_now, std::move(lock)); } - - if (observer_ && was_nested) - observer_->OnExitNestedRunLoop(); } void TaskQueueManager::PostDoWorkContinuationLocked( @@ -469,7 +468,6 @@ TaskQueueManager::ProcessTaskResult TaskQueueManager::ProcessTaskFromWorkQueue( internal::WorkQueue* work_queue, - bool is_nested, LazyNow time_before_task, base::TimeTicks* time_after_task) { DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_); @@ -487,14 +485,18 @@ internal::TaskQueueImpl* queue = work_queue->task_queue(); if (queue->GetQuiescenceMonitored()) task_was_run_on_quiescence_monitored_queue_ = true; - - if (pending_task.nestable == base::Nestable::kNonNestable && is_nested) { - // Defer non-nestable work to the main task runner. NOTE these tasks can be - // arbitrarily delayed so the additional delay should not be a problem. - // TODO(skyostil): Figure out a way to not forget which task queue the - // task is associated with. See http://crbug.com/522843. - controller_->PostNonNestableTask(pending_task.posted_from, - std::move(pending_task.task)); + if (pending_task.nestable == base::Nestable::kNonNestable && + main_thread_only().nesting_depth > 0) { + // Defer non-nestable work. NOTE these tasks can be arbitrarily delayed so + // the additional delay should not be a problem. + // Note because we don't delete queues while nested, it's perfectly OK to + // store the raw pointer for |queue| here. + NonNestableTask deferred_task{std::move(pending_task), queue, + work_queue->queue_type()}; + // We push these tasks onto the front to make sure that when requeued they + // are pushed in the right order. + main_thread_only().non_nestable_task_queue.push_front( + std::move(deferred_task)); return ProcessTaskResult::kDeferred; } @@ -552,7 +554,7 @@ queue->NotifyWillProcessTask(pending_task); } - bool notify_time_observers = !controller_->IsNested() && + bool notify_time_observers = main_thread_only().nesting_depth == 0 && (task_time_observers_.might_have_observers() || queue->RequiresTaskTiming()); if (!notify_time_observers) @@ -711,7 +713,7 @@ state->EndArray(); { base::AutoLock lock(any_thread_lock_); - state->SetBoolean("is_nested", any_thread().is_nested); + state->SetInteger("nesting_depth", any_thread().nesting_depth); state->SetInteger("do_work_running_count", any_thread().do_work_running_count); state->SetInteger("immediate_do_work_posted_count",
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h index b61a714..c99e33f1 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
@@ -286,8 +286,7 @@ int do_work_running_count = 0; int immediate_do_work_posted_count = 0; - // Whether or not the message loop is currently nested. - bool is_nested = false; + int nesting_depth = 0; }; // TODO(alexclarke): Add a MainThreadOnly struct too. @@ -299,6 +298,7 @@ // base::RunLoop::NestingObserver: void OnBeginNestedRunLoop() override; + void OnExitNestedRunLoop() override; // Called by the task queue to register a new pending task. void DidQueueTask(const internal::TaskQueueImpl::Task& pending_task); @@ -326,7 +326,6 @@ // set (not guaranteed), sampling |real_time_domain()->Now()| immediately // after running the task. ProcessTaskResult ProcessTaskFromWorkQueue(internal::WorkQueue* work_queue, - bool is_nested, LazyNow time_before_task, base::TimeTicks* time_after_task); @@ -421,6 +420,30 @@ return any_thread_; } + // TODO(scheduler-dev): Review if we really need non-nestable tasks at all. + struct NonNestableTask { + internal::TaskQueueImpl::Task task; + internal::TaskQueueImpl* task_queue; + Sequence::WorkType work_type; + }; + using NonNestableTaskDeque = WTF::Deque<NonNestableTask, 8>; + + // TODO(alexclarke): Move more things into MainThreadOnly + struct MainThreadOnly { + int nesting_depth = 0; + NonNestableTaskDeque non_nestable_task_queue; + }; + + MainThreadOnly main_thread_only_; + MainThreadOnly& main_thread_only() { + DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_); + return main_thread_only_; + } + const MainThreadOnly& main_thread_only() const { + DCHECK_CALLED_ON_VALID_THREAD(main_thread_checker_); + return main_thread_only_; + } + NextDelayedDoWork next_delayed_do_work_; int work_batch_size_ = 1;
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc index 8b1c75ed..d03dd7ac 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
@@ -234,12 +234,12 @@ for (size_t i = 0; i < 3; i++) runners_.push_back(CreateTaskQueue()); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); - runners_[1]->PostTask(FROM_HERE, base::Bind(&NopTask)); - runners_[1]->PostTask(FROM_HERE, base::Bind(&NopTask)); - runners_[2]->PostTask(FROM_HERE, base::Bind(&NopTask)); - runners_[2]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); + runners_[1]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); + runners_[1]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); + runners_[2]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); + runners_[2]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); base::RunLoop().RunUntilIdle(); // Now is called each time a task is queued, when first task is started @@ -265,13 +265,14 @@ std::vector<std::pair<base::Closure, bool>> tasks_to_post_from_nested_loop; for (int i = 0; i < 7; ++i) { tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&NopTask), true)); + std::make_pair(base::BindRepeating(&NopTask), true)); } runners_[0]->PostTask( - FROM_HERE, base::Bind(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), - base::Unretained(&tasks_to_post_from_nested_loop))); + FROM_HERE, + base::BindRepeating(&PostFromNestedRunloop, message_loop_.get(), + base::RetainedRef(runners_[0]), + base::Unretained(&tasks_to_post_from_nested_loop))); base::RunLoop().RunUntilIdle(); // We need to call Now twice, to measure the start and end of the outermost @@ -291,9 +292,12 @@ Initialize(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1, 2, 3)); @@ -303,12 +307,18 @@ Initialize(3u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - runners_[1]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); - runners_[1]->PostTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order)); - runners_[2]->PostTask(FROM_HERE, base::Bind(&TestTask, 5, &run_order)); - runners_[2]->PostTask(FROM_HERE, base::Bind(&TestTask, 6, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); + runners_[1]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); + runners_[1]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order)); + runners_[2]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 5, &run_order)); + runners_[2]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 6, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1, 2, 3, 4, 5, 6)); @@ -318,8 +328,8 @@ InitializeWithRealMessageLoop(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostNonNestableTask(FROM_HERE, - base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostNonNestableTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order)); base::RunLoop().RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1)); @@ -329,40 +339,49 @@ InitializeWithRealMessageLoop(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order)); - runners_[0]->PostNonNestableTask(FROM_HERE, - base::Bind(&TestTask, 5, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order)); + runners_[0]->PostNonNestableTask( + FROM_HERE, base::BindRepeating(&TestTask, 5, &run_order)); base::RunLoop().RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1, 2, 3, 4, 5)); } -TEST_F(TaskQueueManagerTest, NonNestableTaskDoesntExecuteInNestedLoop) { +TEST_F(TaskQueueManagerTest, NonNestableTasksDoesntExecuteInNestedLoop) { InitializeWithRealMessageLoop(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); std::vector<std::pair<base::Closure, bool>> tasks_to_post_from_nested_loop; tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&TestTask, 3, &run_order), false)); + std::make_pair(base::BindRepeating(&TestTask, 3, &run_order), false)); tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&TestTask, 4, &run_order), true)); + std::make_pair(base::BindRepeating(&TestTask, 4, &run_order), false)); tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&TestTask, 5, &run_order), true)); + std::make_pair(base::BindRepeating(&TestTask, 5, &run_order), true)); + tasks_to_post_from_nested_loop.push_back( + std::make_pair(base::BindRepeating(&TestTask, 6, &run_order), true)); runners_[0]->PostTask( - FROM_HERE, base::Bind(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), - base::Unretained(&tasks_to_post_from_nested_loop))); + FROM_HERE, + base::BindRepeating(&PostFromNestedRunloop, message_loop_.get(), + base::RetainedRef(runners_[0]), + base::Unretained(&tasks_to_post_from_nested_loop))); base::RunLoop().RunUntilIdle(); - // Note we expect task 3 to run last because it's non-nestable. - EXPECT_THAT(run_order, ElementsAre(1, 2, 4, 5, 3)); + // Note we expect tasks 3 & 4 to run last because they're non-nestable. + EXPECT_THAT(run_order, ElementsAre(1, 2, 5, 6, 3, 4)); } TEST_F(TaskQueueManagerTest, HasPendingImmediateWork_ImmediateTask) { @@ -370,7 +389,8 @@ std::vector<EnqueueOrder> run_order; EXPECT_FALSE(runners_[0]->HasTaskToRunImmediately()); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); EXPECT_TRUE(runners_[0]->HasTaskToRunImmediately()); // Move the task into the |immediate_work_queue|. @@ -394,8 +414,8 @@ std::vector<EnqueueOrder> run_order; base::TimeDelta delay(base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay); EXPECT_FALSE(runners_[0]->HasTaskToRunImmediately()); now_src_.Advance(delay); EXPECT_TRUE(runners_[0]->HasTaskToRunImmediately()); @@ -415,8 +435,8 @@ std::vector<EnqueueOrder> run_order; base::TimeDelta delay(base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay); EXPECT_EQ(delay, test_task_runner_->DelayToNextTaskTime()); EXPECT_FALSE(runners_[0]->HasTaskToRunImmediately()); EXPECT_TRUE(run_order.empty()); @@ -440,11 +460,11 @@ Initialize(1u); base::TimeDelta delay(base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), delay); size_t task_count = 0; test_task_runner_->RunTasksWhile( - base::Bind(&MessageLoopTaskCounter, &task_count)); + base::BindRepeating(&MessageLoopTaskCounter, &task_count)); EXPECT_EQ(1u, task_count); } @@ -452,13 +472,16 @@ Initialize(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order), base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order), base::TimeDelta::FromMilliseconds(8)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order), base::TimeDelta::FromMilliseconds(5)); EXPECT_EQ(base::TimeDelta::FromMilliseconds(5), @@ -482,13 +505,16 @@ Initialize(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order), base::TimeDelta::FromMilliseconds(1)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order), base::TimeDelta::FromMilliseconds(5)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order), base::TimeDelta::FromMilliseconds(10)); EXPECT_EQ(base::TimeDelta::FromMilliseconds(1), @@ -513,12 +539,12 @@ std::vector<EnqueueOrder> run_order; base::TimeDelta delay(base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), - delay); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), - delay); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 2, &run_order), delay); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 3, &run_order), delay); EXPECT_EQ(1u, test_task_runner_->NumPendingTasks()); } @@ -541,10 +567,12 @@ base::TimeDelta delay(base::TimeDelta::FromMilliseconds(10)); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&TestObject::Run, base::Owned(new TestObject())), + FROM_HERE, + base::BindRepeating(&TestObject::Run, base::Owned(new TestObject())), delay); runners_[0]->PostTask( - FROM_HERE, base::Bind(&TestObject::Run, base::Owned(new TestObject()))); + FROM_HERE, + base::BindRepeating(&TestObject::Run, base::Owned(new TestObject()))); manager_.reset(); @@ -558,7 +586,8 @@ std::vector<EnqueueOrder> run_order; // Posting a task when pumping is disabled doesn't result in work getting // posted. - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); EXPECT_FALSE(test_task_runner_->HasPendingTasks()); // However polling still works. @@ -579,7 +608,8 @@ runners_[0]->CreateQueueEnabledVoter(); voter->SetQueueEnabled(false); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); runners_[0]->RemoveFence(); EXPECT_FALSE(test_task_runner_->HasPendingTasks()); @@ -593,7 +623,8 @@ runners_[0]->CreateQueueEnabledVoter(); voter->SetQueueEnabled(false); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); voter->SetQueueEnabled(true); EXPECT_FALSE(test_task_runner_->HasPendingTasks()); @@ -606,7 +637,8 @@ std::unique_ptr<TaskQueue::QueueEnabledVoter> voter = runners_[0]->CreateQueueEnabledVoter(); voter->SetQueueEnabled(false); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); EXPECT_FALSE(test_task_runner_->HasPendingTasks()); test_task_runner_->RunUntilIdle(); @@ -621,7 +653,8 @@ Initialize(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); std::unique_ptr<TaskQueue::QueueEnabledVoter> voter = runners_[0]->CreateQueueEnabledVoter(); EXPECT_TRUE(test_task_runner_->HasPendingTasks()); @@ -643,7 +676,8 @@ std::unique_ptr<TaskQueue::QueueEnabledVoter> voter = runners_[0]->CreateQueueEnabledVoter(); voter->SetQueueEnabled(false); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_TRUE(run_order.empty()); @@ -662,8 +696,8 @@ // Posting a delayed task when fenced will apply the delay, but won't cause // work to executed afterwards. base::TimeDelta delay(base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay); // The task does not run even though it's delay is up. test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(10)); @@ -686,12 +720,12 @@ base::TimeDelta delay1(base::TimeDelta::FromMilliseconds(1)); base::TimeDelta delay2(base::TimeDelta::FromMilliseconds(10)); base::TimeDelta delay3(base::TimeDelta::FromMilliseconds(20)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay1); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), - delay2); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), - delay3); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay1); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 2, &run_order), delay2); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 3, &run_order), delay3); now_src_.Advance(base::TimeDelta::FromMilliseconds(15)); test_task_runner_->RunUntilIdle(); @@ -709,8 +743,8 @@ std::vector<EnqueueOrder> run_order; base::TimeDelta delay(base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay); test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(10)); EXPECT_TRUE(run_order.empty()); @@ -720,17 +754,21 @@ Initialize(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1, 2)); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); // Subsequent tasks should be blocked. - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1, 2, 3)); } @@ -741,8 +779,10 @@ runners_[0]->RemoveFence(); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1, 2)); @@ -753,8 +793,10 @@ runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); runners_[0]->RemoveFence(); test_task_runner_->RunUntilIdle(); @@ -766,9 +808,11 @@ runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1)); } @@ -783,7 +827,7 @@ runners_[0]->RemoveFence(); EXPECT_FALSE(runners_[0]->BlockedByFence()); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); EXPECT_FALSE(runners_[0]->BlockedByFence()); @@ -797,7 +841,7 @@ TEST_F(TaskQueueManagerTest, BlockedByFence_BothTypesOfFence) { Initialize(1u); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); EXPECT_FALSE(runners_[0]->BlockedByFence()); @@ -821,13 +865,13 @@ std::vector<base::TimeTicks> run_times; runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&RecordTimeTask, &run_times, &now_src_), + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_), base::TimeDelta::FromMilliseconds(100)); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&RecordTimeTask, &run_times, &now_src_), + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_), base::TimeDelta::FromMilliseconds(200)); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&RecordTimeTask, &run_times, &now_src_), + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_), base::TimeDelta::FromMilliseconds(300)); runners_[0]->InsertFenceAt(Now() + base::TimeDelta::FromMilliseconds(250)); @@ -858,8 +902,8 @@ runners_[0]->InsertFenceAt(Now() + base::TimeDelta::FromMilliseconds(250)); for (int i = 0; i < 5; ++i) { - runners_[0]->PostTask(FROM_HERE, - base::Bind(&RecordTimeTask, &run_times, &now_src_)); + runners_[0]->PostTask( + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_)); test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(100)); if (i < 2) { EXPECT_FALSE(runners_[0]->HasActiveFence()); @@ -892,8 +936,8 @@ runners_[0]->InsertFenceAt(Now() + base::TimeDelta::FromMilliseconds(250)); for (int i = 0; i < 3; ++i) { - runners_[0]->PostTask(FROM_HERE, - base::Bind(&RecordTimeTask, &run_times, &now_src_)); + runners_[0]->PostTask( + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_)); EXPECT_FALSE(runners_[0]->HasActiveFence()); test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(100)); } @@ -902,8 +946,8 @@ runners_[0]->RemoveFence(); for (int i = 0; i < 2; ++i) { - runners_[0]->PostTask(FROM_HERE, - base::Bind(&RecordTimeTask, &run_times, &now_src_)); + runners_[0]->PostTask( + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_)); test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(100)); EXPECT_FALSE(runners_[0]->HasActiveFence()); } @@ -946,9 +990,11 @@ Initialize(1u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); manager_.reset(); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_TRUE(run_order.empty()); @@ -956,7 +1002,7 @@ void PostTaskToRunner(scoped_refptr<base::SingleThreadTaskRunner> runner, std::vector<EnqueueOrder>* run_order) { - runner->PostTask(FROM_HERE, base::Bind(&TestTask, 1, run_order)); + runner->PostTask(FROM_HERE, base::BindRepeating(&TestTask, 1, run_order)); } TEST_F(TaskQueueManagerTest, PostFromThread) { @@ -966,7 +1012,8 @@ base::Thread thread("TestThread"); thread.Start(); thread.task_runner()->PostTask( - FROM_HERE, base::Bind(&PostTaskToRunner, runners_[0], &run_order)); + FROM_HERE, + base::BindRepeating(&PostTaskToRunner, runners_[0], &run_order)); thread.Stop(); base::RunLoop().RunUntilIdle(); @@ -985,7 +1032,8 @@ int run_count = 0; runners_[0]->PostTask( - FROM_HERE, base::Bind(&RePostingTestTask, runners_[0], &run_count)); + FROM_HERE, + base::BindRepeating(&RePostingTestTask, runners_[0], &run_count)); test_task_runner_->RunPendingTasks(); // NOTE without the executing_task_ check in MaybeScheduleDoWork there @@ -1000,14 +1048,17 @@ std::vector<EnqueueOrder> run_order; std::vector<std::pair<base::Closure, bool>> tasks_to_post_from_nested_loop; tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&TestTask, 1, &run_order), true)); + std::make_pair(base::BindRepeating(&TestTask, 1, &run_order), true)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 0, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 0, &run_order)); runners_[0]->PostTask( - FROM_HERE, base::Bind(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), - base::Unretained(&tasks_to_post_from_nested_loop))); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + FROM_HERE, + base::BindRepeating(&PostFromNestedRunloop, message_loop_.get(), + base::RetainedRef(runners_[0]), + base::Unretained(&tasks_to_post_from_nested_loop))); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); base::RunLoop().RunUntilIdle(); @@ -1020,10 +1071,14 @@ manager_->SetWorkBatchSize(2); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order)); // Running one task in the host message loop should cause two posted tasks to // get executed. @@ -1051,8 +1106,10 @@ manager_->AddTaskObserver(&observer); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); EXPECT_CALL(observer, WillProcessTask(_)).Times(2); EXPECT_CALL(observer, DidProcessTask(_)).Times(2); @@ -1067,7 +1124,8 @@ manager_->RemoveTaskObserver(&observer); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); EXPECT_CALL(observer, WillProcessTask(_)).Times(0); EXPECT_CALL(observer, DidProcessTask(_)).Times(0); @@ -1087,7 +1145,8 @@ manager_->AddTaskObserver(&observer); runners_[0]->PostTask( - FROM_HERE, base::Bind(&RemoveObserverTask, manager_.get(), &observer)); + FROM_HERE, + base::BindRepeating(&RemoveObserverTask, manager_.get(), &observer)); EXPECT_CALL(observer, WillProcessTask(_)).Times(1); EXPECT_CALL(observer, DidProcessTask(_)).Times(0); @@ -1102,8 +1161,10 @@ runners_[0]->AddTaskObserver(&observer); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[1]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[1]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); EXPECT_CALL(observer, WillProcessTask(_)).Times(1); EXPECT_CALL(observer, DidProcessTask(_)).Times(1); @@ -1118,7 +1179,8 @@ runners_[0]->RemoveTaskObserver(&observer); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); EXPECT_CALL(observer, WillProcessTask(_)).Times(0); EXPECT_CALL(observer, DidProcessTask(_)).Times(0); @@ -1136,8 +1198,8 @@ MockTaskObserver observer; runners_[0]->AddTaskObserver(&observer); - runners_[0]->PostTask( - FROM_HERE, base::Bind(&RemoveQueueObserverTask, runners_[0], &observer)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&RemoveQueueObserverTask, + runners_[0], &observer)); EXPECT_CALL(observer, WillProcessTask(_)).Times(1); EXPECT_CALL(observer, DidProcessTask(_)).Times(0); @@ -1160,30 +1222,33 @@ EXPECT_FALSE(manager_->real_time_domain()->NextScheduledRunTime(&run_time)); // With a non-delayed task. - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); EXPECT_FALSE(manager_->real_time_domain()->NextScheduledRunTime(&run_time)); // With a delayed task. base::TimeDelta expected_delay = base::TimeDelta::FromMilliseconds(50); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), expected_delay); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + expected_delay); EXPECT_TRUE(manager_->real_time_domain()->NextScheduledRunTime(&run_time)); EXPECT_EQ(now_src_.NowTicks() + expected_delay, run_time); // With another delayed task in the same queue with a longer delay. - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromMilliseconds(100)); EXPECT_TRUE(manager_->real_time_domain()->NextScheduledRunTime(&run_time)); EXPECT_EQ(now_src_.NowTicks() + expected_delay, run_time); // With another delayed task in the same queue with a shorter delay. expected_delay = base::TimeDelta::FromMilliseconds(20); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), expected_delay); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + expected_delay); EXPECT_TRUE(manager_->real_time_domain()->NextScheduledRunTime(&run_time)); EXPECT_EQ(now_src_.NowTicks() + expected_delay, run_time); // With another delayed task in a different queue with a shorter delay. expected_delay = base::TimeDelta::FromMilliseconds(10); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), expected_delay); + runners_[1]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + expected_delay); EXPECT_TRUE(manager_->real_time_domain()->NextScheduledRunTime(&run_time)); EXPECT_EQ(now_src_.NowTicks() + expected_delay, run_time); @@ -1199,10 +1264,13 @@ base::TimeDelta delay1 = base::TimeDelta::FromMilliseconds(50); base::TimeDelta delay2 = base::TimeDelta::FromMilliseconds(5); base::TimeDelta delay3 = base::TimeDelta::FromMilliseconds(10); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay1); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay2); - runners_[2]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay3); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay1); + runners_[1]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay2); + runners_[2]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay3); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); base::TimeTicks run_time; EXPECT_TRUE(manager_->real_time_domain()->NextScheduledRunTime(&run_time)); @@ -1213,8 +1281,9 @@ Initialize(1u); runners_[0]->PostTask( - FROM_HERE, base::Bind(&TaskQueueManagerTest::DeleteTaskQueueManager, - base::Unretained(this))); + FROM_HERE, + base::BindRepeating(&TaskQueueManagerTest::DeleteTaskQueueManager, + base::Unretained(this))); // This should not crash, assuming DoWork detects the TaskQueueManager has // been deleted. @@ -1230,22 +1299,22 @@ EXPECT_TRUE(manager_->GetAndClearSystemIsQuiescentBit()); - queue0->PostTask(FROM_HERE, base::Bind(&NopTask)); + queue0->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); test_task_runner_->RunUntilIdle(); EXPECT_FALSE(manager_->GetAndClearSystemIsQuiescentBit()); EXPECT_TRUE(manager_->GetAndClearSystemIsQuiescentBit()); - queue1->PostTask(FROM_HERE, base::Bind(&NopTask)); + queue1->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); test_task_runner_->RunUntilIdle(); EXPECT_FALSE(manager_->GetAndClearSystemIsQuiescentBit()); EXPECT_TRUE(manager_->GetAndClearSystemIsQuiescentBit()); - queue2->PostTask(FROM_HERE, base::Bind(&NopTask)); + queue2->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); test_task_runner_->RunUntilIdle(); EXPECT_TRUE(manager_->GetAndClearSystemIsQuiescentBit()); - queue0->PostTask(FROM_HERE, base::Bind(&NopTask)); - queue1->PostTask(FROM_HERE, base::Bind(&NopTask)); + queue0->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); + queue1->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); test_task_runner_->RunUntilIdle(); EXPECT_FALSE(manager_->GetAndClearSystemIsQuiescentBit()); EXPECT_TRUE(manager_->GetAndClearSystemIsQuiescentBit()); @@ -1255,7 +1324,7 @@ Initialize(1u); EXPECT_FALSE(runners_[0]->HasTaskToRunImmediately()); - runners_[0]->PostTask(FROM_HERE, base::Bind(NullTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(NullTask)); EXPECT_TRUE(runners_[0]->HasTaskToRunImmediately()); test_task_runner_->RunUntilIdle(); @@ -1266,7 +1335,7 @@ Initialize(1u); EXPECT_FALSE(runners_[0]->HasTaskToRunImmediately()); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(NullTask), + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(NullTask), base::TimeDelta::FromMilliseconds(12)); EXPECT_FALSE(runners_[0]->HasTaskToRunImmediately()); @@ -1298,7 +1367,8 @@ base::TimeDelta delay = base::TimeDelta::FromMilliseconds(10); for (int i = 10; i < 19; i++) { runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&ExpensiveTestTask, i, &now_src_, &run_order), + FROM_HERE, + base::BindRepeating(&ExpensiveTestTask, i, &now_src_, &run_order), delay); } @@ -1306,7 +1376,8 @@ for (int i = 0; i < 9; i++) { runners_[0]->PostTask( - FROM_HERE, base::Bind(&ExpensiveTestTask, i, &now_src_, &run_order)); + FROM_HERE, + base::BindRepeating(&ExpensiveTestTask, i, &now_src_, &run_order)); } test_task_runner_->SetAutoAdvanceNowToPendingTasks(true); @@ -1325,10 +1396,12 @@ std::vector<EnqueueOrder> run_order; base::TimeDelta delay = base::TimeDelta::FromMilliseconds(10); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay); now_src_.Advance(delay * 2); test_task_runner_->RunUntilIdle(); @@ -1342,10 +1415,12 @@ std::vector<EnqueueOrder> run_order; base::TimeDelta delay = base::TimeDelta::FromMilliseconds(10); - runners_[1]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - runners_[1]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay); + runners_[1]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); + runners_[1]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay); now_src_.Advance(delay * 2); test_task_runner_->RunUntilIdle(); @@ -1359,10 +1434,10 @@ std::vector<EnqueueOrder> run_order; base::TimeDelta delay1 = base::TimeDelta::FromMilliseconds(10); base::TimeDelta delay2 = base::TimeDelta::FromMilliseconds(5); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), - delay1); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), - delay2); + runners_[0]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order), delay1); + runners_[1]->PostDelayedTask( + FROM_HERE, base::BindRepeating(&TestTask, 2, &run_order), delay2); now_src_.Advance(delay1 * 2); test_task_runner_->RunUntilIdle(); @@ -1380,7 +1455,7 @@ base::MessageLoop::ScopedNestableTaskAllower allow( base::MessageLoop::current()); runner->PostTask(FROM_HERE, run_loop->QuitClosure()); - runner->PostTask(FROM_HERE, base::Bind(&CheckIsNested, was_nested)); + runner->PostTask(FROM_HERE, base::BindRepeating(&CheckIsNested, was_nested)); run_loop->Run(); } @@ -1392,10 +1467,11 @@ bool was_nested = true; base::RunLoop run_loop; - runners_[0]->PostTask(FROM_HERE, base::Bind(&PostAndQuitFromNestedRunloop, - base::Unretained(&run_loop), - base::RetainedRef(runners_[0]), - base::Unretained(&was_nested))); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&PostAndQuitFromNestedRunloop, + base::Unretained(&run_loop), + base::RetainedRef(runners_[0]), + base::Unretained(&was_nested))); base::RunLoop().RunUntilIdle(); EXPECT_FALSE(was_nested); @@ -1426,13 +1502,17 @@ // Register four tasks that will run in reverse order. std::vector<EnqueueOrder> run_order; - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order), base::TimeDelta::FromMilliseconds(30)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order), base::TimeDelta::FromMilliseconds(20)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order), base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order)); test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(40)); ASSERT_THAT(run_order, ElementsAre(4, 3, 2, 1)); @@ -1457,9 +1537,9 @@ ASSERT_NE(queue2, queue3); std::vector<EnqueueOrder> run_order; - queue1->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - queue2->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - queue3->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); + queue1->PostTask(FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order)); + queue2->PostTask(FROM_HERE, base::BindRepeating(&TestTask, 2, &run_order)); + queue3->PostTask(FROM_HERE, base::BindRepeating(&TestTask, 3, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_THAT(run_order, ElementsAre(1, 2, 3)); @@ -1477,9 +1557,9 @@ ASSERT_NE(queue2, queue3); std::vector<EnqueueOrder> run_order; - queue1->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - queue2->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - queue3->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); + queue1->PostTask(FROM_HERE, base::BindRepeating(&TestTask, 1, &run_order)); + queue2->PostTask(FROM_HERE, base::BindRepeating(&TestTask, 2, &run_order)); + queue3->PostTask(FROM_HERE, base::BindRepeating(&TestTask, 3, &run_order)); queue2->ShutdownTaskQueue(); test_task_runner_->RunUntilIdle(); @@ -1492,11 +1572,14 @@ // Register three delayed tasks std::vector<EnqueueOrder> run_order; - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order), base::TimeDelta::FromMilliseconds(10)); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), + runners_[1]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order), base::TimeDelta::FromMilliseconds(20)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order), base::TimeDelta::FromMilliseconds(30)); runners_[1]->ShutdownTaskQueue(); @@ -1516,11 +1599,16 @@ Initialize(3u); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&ShutdownQueue, runners_[1])); - runners_[0]->PostTask(FROM_HERE, base::Bind(&ShutdownQueue, runners_[2])); - runners_[1]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - runners_[2]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&ShutdownQueue, runners_[1])); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&ShutdownQueue, runners_[2])); + runners_[1]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); + runners_[2]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); test_task_runner_->RunUntilIdle(); ASSERT_THAT(run_order, ElementsAre(1)); @@ -1549,7 +1637,7 @@ task_queue->CreateQueueEnabledVoter(); voter->SetQueueEnabled(false); - task_queue->PostTask(FROM_HERE, base::Bind(&NopTask)); + task_queue->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); // Trick |task_queue| into posting a DoWork. By default PostTask with a // disabled queue won't post a DoWork until we enable the queue. @@ -1570,7 +1658,7 @@ scoped_refptr<TaskQueue> task_queue = CreateTaskQueueWithSpec( TaskQueue::Spec("test").SetShouldReportWhenExecutionBlocked(true)); - task_queue->PostTask(FROM_HERE, base::Bind(&NopTask)); + task_queue->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); EXPECT_CALL(observer, OnTriedToExecuteBlockedTask()).Times(0); test_task_runner_->RunPendingTasks(); @@ -1593,17 +1681,18 @@ // reference until the nested run loop exits. // NB: This first HasOneRefTask is a sanity check. tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&NopTask), true)); + std::make_pair(base::BindRepeating(&NopTask), true)); tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&TaskQueue::ShutdownTaskQueue, - base::Unretained(task_queue.get())), + std::make_pair(base::BindRepeating(&TaskQueue::ShutdownTaskQueue, + base::Unretained(task_queue.get())), true)); tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&NopTask), true)); + std::make_pair(base::BindRepeating(&NopTask), true)); runners_[0]->PostTask( - FROM_HERE, base::Bind(&PostFromNestedRunloop, message_loop_.get(), - base::RetainedRef(runners_[0]), - base::Unretained(&tasks_to_post_from_nested_loop))); + FROM_HERE, + base::BindRepeating(&PostFromNestedRunloop, message_loop_.get(), + base::RetainedRef(runners_[0]), + base::Unretained(&tasks_to_post_from_nested_loop))); base::RunLoop().RunUntilIdle(); // Just make sure that we don't crash. @@ -1623,18 +1712,24 @@ runners_[1]->SetTimeDomain(domain_b.get()); std::vector<EnqueueOrder> run_order; - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order), base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order), base::TimeDelta::FromMilliseconds(20)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order), base::TimeDelta::FromMilliseconds(30)); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order), + runners_[1]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order), base::TimeDelta::FromMilliseconds(10)); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 5, &run_order), + runners_[1]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 5, &run_order), base::TimeDelta::FromMilliseconds(20)); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 6, &run_order), + runners_[1]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 6, &run_order), base::TimeDelta::FromMilliseconds(30)); domain_b->AdvanceTo(start_time + base::TimeDelta::FromMilliseconds(50)); @@ -1666,13 +1761,17 @@ runners_[0]->SetTimeDomain(domain_a.get()); std::vector<EnqueueOrder> run_order; - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order), base::TimeDelta::FromMilliseconds(10)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order), base::TimeDelta::FromMilliseconds(20)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order), base::TimeDelta::FromMilliseconds(30)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order), base::TimeDelta::FromMilliseconds(40)); domain_a->AdvanceTo(start_time + base::TimeDelta::FromMilliseconds(20)); @@ -1710,7 +1809,8 @@ runners_[0]->SetTimeDomain(domain_a.get()); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); runners_[0]->SetTimeDomain(domain_b.get()); test_task_runner_->RunUntilIdle(); @@ -1734,19 +1834,23 @@ manager_->RegisterTimeDomain(domain_b.get()); runners_[0]->SetTimeDomain(domain_a.get()); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order), base::TimeDelta::FromMilliseconds(40)); runners_[0]->SetTimeDomain(domain_b.get()); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order), base::TimeDelta::FromMilliseconds(30)); runners_[0]->SetTimeDomain(domain_a.get()); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order), base::TimeDelta::FromMilliseconds(20)); runners_[0]->SetTimeDomain(domain_b.get()); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order), + runners_[0]->PostDelayedTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order), base::TimeDelta::FromMilliseconds(10)); test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(40)); @@ -1777,18 +1881,18 @@ // We should get a notification when a task is posted on an empty queue. EXPECT_CALL(observer, OnQueueNextWakeUpChanged(runners_[0].get(), _)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); Mock::VerifyAndClearExpectations(&observer); // But not subsequently. EXPECT_CALL(observer, OnQueueNextWakeUpChanged(_, _)).Times(0); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); Mock::VerifyAndClearExpectations(&observer); // Unless the immediate work queue is emptied. runners_[0]->GetTaskQueueImpl()->ReloadImmediateWorkQueueIfEmpty(); EXPECT_CALL(observer, OnQueueNextWakeUpChanged(runners_[0].get(), _)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); // Tidy up. runners_[0]->ShutdownTaskQueue(); @@ -1809,18 +1913,21 @@ // queue. EXPECT_CALL(observer, OnQueueNextWakeUpChanged(runners_[0].get(), start_time + delay10s)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay10s); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay10s); Mock::VerifyAndClearExpectations(&observer); // We should not get a notification for a longer delay. EXPECT_CALL(observer, OnQueueNextWakeUpChanged(_, _)).Times(0); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay100s); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay100s); Mock::VerifyAndClearExpectations(&observer); // We should get a notification for a shorter delay. EXPECT_CALL(observer, OnQueueNextWakeUpChanged(runners_[0].get(), start_time + delay1s)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay1s); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay1s); Mock::VerifyAndClearExpectations(&observer); std::unique_ptr<TaskQueue::QueueEnabledVoter> voter = @@ -1856,8 +1963,10 @@ EXPECT_CALL(observer, OnQueueNextWakeUpChanged(runners_[1].get(), start_time + delay10s)) .Times(1); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay1s); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay10s); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay1s); + runners_[1]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay10s); ::testing::Mock::VerifyAndClearExpectations(&observer); std::unique_ptr<TaskQueue::QueueEnabledVoter> voter0 = @@ -1912,7 +2021,8 @@ // We should get a notification when a delayed task is posted on an empty // queue. EXPECT_CALL(observer, OnQueueNextWakeUpChanged(_, _)); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay1s); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay1s); Mock::VerifyAndClearExpectations(&observer); std::unique_ptr<TimeDomain> mock_time_domain = @@ -1961,13 +2071,13 @@ std::vector<base::TimeTicks> run_times; runners_[0]->PostDelayedTask( FROM_HERE, - base::Bind(&CancelableTask::RecordTimeTask, - task1.weak_factory_.GetWeakPtr(), &run_times), + base::BindRepeating(&CancelableTask::RecordTimeTask, + task1.weak_factory_.GetWeakPtr(), &run_times), delay1); runners_[0]->PostDelayedTask( FROM_HERE, - base::Bind(&CancelableTask::RecordTimeTask, - task2.weak_factory_.GetWeakPtr(), &run_times), + base::BindRepeating(&CancelableTask::RecordTimeTask, + task2.weak_factory_.GetWeakPtr(), &run_times), delay2); task1.weak_factory_.InvalidateWeakPtrs(); @@ -1997,7 +2107,7 @@ for (int i = 1; i < 100; i++) { runners_[0]->PostDelayedTask( FROM_HERE, - base::Bind(&ChromiumRunloopInspectionTask, test_task_runner_), + base::BindRepeating(&ChromiumRunloopInspectionTask, test_task_runner_), base::TimeDelta::FromMilliseconds(i)); } test_task_runner_->RunUntilIdle(); @@ -2012,7 +2122,7 @@ base::SimpleTestTickClock* now_src) : count_(0), task_queue_(task_queue), delay_(delay), now_src_(now_src) {} - void SetShouldExit(base::Callback<bool()> should_exit) { + void SetShouldExit(base::RepeatingCallback<bool()> should_exit) { should_exit_ = should_exit; } @@ -2021,10 +2131,12 @@ return; count_++; task_queue_->PostDelayedTask( - FROM_HERE, base::Bind(&QuadraticTask::Run, base::Unretained(this)), + FROM_HERE, + base::BindRepeating(&QuadraticTask::Run, base::Unretained(this)), delay_); task_queue_->PostDelayedTask( - FROM_HERE, base::Bind(&QuadraticTask::Run, base::Unretained(this)), + FROM_HERE, + base::BindRepeating(&QuadraticTask::Run, base::Unretained(this)), delay_); now_src_->Advance(base::TimeDelta::FromMilliseconds(5)); } @@ -2035,7 +2147,7 @@ int count_; scoped_refptr<TaskQueue> task_queue_; base::TimeDelta delay_; - base::Callback<bool()> should_exit_; + base::RepeatingCallback<bool()> should_exit_; base::SimpleTestTickClock* now_src_; }; @@ -2046,7 +2158,7 @@ base::SimpleTestTickClock* now_src) : count_(0), task_queue_(task_queue), delay_(delay), now_src_(now_src) {} - void SetShouldExit(base::Callback<bool()> should_exit) { + void SetShouldExit(base::RepeatingCallback<bool()> should_exit) { should_exit_ = should_exit; } @@ -2055,8 +2167,8 @@ return; count_++; task_queue_->PostDelayedTask( - FROM_HERE, base::Bind(&LinearTask::Run, base::Unretained(this)), - delay_); + FROM_HERE, + base::BindRepeating(&LinearTask::Run, base::Unretained(this)), delay_); now_src_->Advance(base::TimeDelta::FromMilliseconds(5)); } @@ -2066,7 +2178,7 @@ int count_; scoped_refptr<TaskQueue> task_queue_; base::TimeDelta delay_; - base::Callback<bool()> should_exit_; + base::RepeatingCallback<bool()> should_exit_; base::SimpleTestTickClock* now_src_; }; @@ -2083,8 +2195,8 @@ QuadraticTask quadratic_delayed_task( runners_[0], base::TimeDelta::FromMilliseconds(10), &now_src_); LinearTask linear_immediate_task(runners_[0], base::TimeDelta(), &now_src_); - base::Callback<bool()> should_exit = - base::Bind(ShouldExit, &quadratic_delayed_task, &linear_immediate_task); + base::RepeatingCallback<bool()> should_exit = base::BindRepeating( + ShouldExit, &quadratic_delayed_task, &linear_immediate_task); quadratic_delayed_task.SetShouldExit(should_exit); linear_immediate_task.SetShouldExit(should_exit); @@ -2108,8 +2220,8 @@ &now_src_); LinearTask linear_delayed_task( runners_[0], base::TimeDelta::FromMilliseconds(10), &now_src_); - base::Callback<bool()> should_exit = - base::Bind(&ShouldExit, &quadratic_immediate_task, &linear_delayed_task); + base::RepeatingCallback<bool()> should_exit = base::BindRepeating( + &ShouldExit, &quadratic_immediate_task, &linear_delayed_task); quadratic_immediate_task.SetShouldExit(should_exit); linear_delayed_task.SetShouldExit(should_exit); @@ -2136,8 +2248,8 @@ QuadraticTask quadratic_delayed_task( runners_[0], base::TimeDelta::FromMilliseconds(10), &now_src_); LinearTask linear_immediate_task(runners_[1], base::TimeDelta(), &now_src_); - base::Callback<bool()> should_exit = - base::Bind(ShouldExit, &quadratic_delayed_task, &linear_immediate_task); + base::RepeatingCallback<bool()> should_exit = base::BindRepeating( + ShouldExit, &quadratic_delayed_task, &linear_immediate_task); quadratic_delayed_task.SetShouldExit(should_exit); linear_immediate_task.SetShouldExit(should_exit); @@ -2162,8 +2274,8 @@ &now_src_); LinearTask linear_delayed_task( runners_[1], base::TimeDelta::FromMilliseconds(10), &now_src_); - base::Callback<bool()> should_exit = - base::Bind(&ShouldExit, &quadratic_immediate_task, &linear_delayed_task); + base::RepeatingCallback<bool()> should_exit = base::BindRepeating( + &ShouldExit, &quadratic_immediate_task, &linear_delayed_task); quadratic_immediate_task.SetShouldExit(should_exit); linear_delayed_task.SetShouldExit(should_exit); @@ -2204,10 +2316,12 @@ TestTaskQueue* queue1 = runners_[1].get(); std::vector<internal::TaskQueueImpl*> task_sources; - queue0->PostTask(FROM_HERE, base::Bind(&CurrentlyExecutingTaskQueueTestTask, - manager_.get(), &task_sources)); - queue1->PostTask(FROM_HERE, base::Bind(&CurrentlyExecutingTaskQueueTestTask, - manager_.get(), &task_sources)); + queue0->PostTask(FROM_HERE, + base::BindRepeating(&CurrentlyExecutingTaskQueueTestTask, + manager_.get(), &task_sources)); + queue1->PostTask(FROM_HERE, + base::BindRepeating(&CurrentlyExecutingTaskQueueTestTask, + manager_.get(), &task_sources)); test_task_runner_->RunUntilIdle(); EXPECT_THAT(task_sources, ElementsAre(queue0->GetTaskQueueImpl(), @@ -2244,18 +2358,19 @@ std::vector<std::pair<base::Closure, TestTaskQueue*>> tasks_to_post_from_nested_loop; tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&CurrentlyExecutingTaskQueueTestTask, - manager_.get(), &task_sources), + std::make_pair(base::BindRepeating(&CurrentlyExecutingTaskQueueTestTask, + manager_.get(), &task_sources), queue1)); tasks_to_post_from_nested_loop.push_back( - std::make_pair(base::Bind(&CurrentlyExecutingTaskQueueTestTask, - manager_.get(), &task_sources), + std::make_pair(base::BindRepeating(&CurrentlyExecutingTaskQueueTestTask, + manager_.get(), &task_sources), queue2)); queue0->PostTask( - FROM_HERE, base::Bind(&RunloopCurrentlyExecutingTaskQueueTestTask, - message_loop_.get(), manager_.get(), &task_sources, - &tasks_to_post_from_nested_loop)); + FROM_HERE, + base::BindRepeating(&RunloopCurrentlyExecutingTaskQueueTestTask, + message_loop_.get(), manager_.get(), &task_sources, + &tasks_to_post_from_nested_loop)); base::RunLoop().RunUntilIdle(); EXPECT_THAT( @@ -2320,7 +2435,7 @@ "scope", 0, nullptr); blame_context.Initialize(); queue->SetBlameContext(&blame_context); - queue->PostTask(FROM_HERE, base::Bind(&NopTask)); + queue->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); base::RunLoop().RunUntilIdle(); } StopTracing(); @@ -2350,20 +2465,24 @@ base::TimeDelta delay4(base::TimeDelta::FromSeconds(30)); std::vector<base::TimeTicks> run_times; runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task1.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task1.weak_factory_.GetWeakPtr(), &run_times), delay1); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task2.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task2.weak_factory_.GetWeakPtr(), &run_times), delay2); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task3.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task3.weak_factory_.GetWeakPtr(), &run_times), delay3); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task4.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task4.weak_factory_.GetWeakPtr(), &run_times), delay4); task2.weak_factory_.InvalidateWeakPtrs(); @@ -2371,7 +2490,7 @@ std::set<base::TimeTicks> wake_up_times; - RunUntilIdle(base::Bind( + RunUntilIdle(base::BindRepeating( [](std::set<base::TimeTicks>* wake_up_times, base::SimpleTestTickClock* clock) { wake_up_times->insert(clock->NowTicks()); @@ -2398,20 +2517,24 @@ base::TimeDelta delay4(base::TimeDelta::FromSeconds(30)); std::vector<base::TimeTicks> run_times; runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task4.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task4.weak_factory_.GetWeakPtr(), &run_times), delay4); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task3.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task3.weak_factory_.GetWeakPtr(), &run_times), delay3); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task2.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task2.weak_factory_.GetWeakPtr(), &run_times), delay2); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task1.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task1.weak_factory_.GetWeakPtr(), &run_times), delay1); task2.weak_factory_.InvalidateWeakPtrs(); @@ -2419,7 +2542,7 @@ std::set<base::TimeTicks> wake_up_times; - RunUntilIdle(base::Bind( + RunUntilIdle(base::BindRepeating( [](std::set<base::TimeTicks>* wake_up_times, base::SimpleTestTickClock* clock) { wake_up_times->insert(clock->NowTicks()); @@ -2446,28 +2569,33 @@ base::TimeDelta delay4(base::TimeDelta::FromSeconds(30)); std::vector<base::TimeTicks> run_times; runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task1.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task1.weak_factory_.GetWeakPtr(), &run_times), delay1); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task2.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task2.weak_factory_.GetWeakPtr(), &run_times), delay2); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task3.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task3.weak_factory_.GetWeakPtr(), &run_times), delay3); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task4.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task4.weak_factory_.GetWeakPtr(), &run_times), delay4); // Post a non-canceled task with |delay3|. So we should still get a wake-up at // |delay3| even though we cancel |task3|. - runners_[0]->PostDelayedTask(FROM_HERE, - base::Bind(&CancelableTask::RecordTimeTask, - base::Unretained(&task3), &run_times), - delay3); + runners_[0]->PostDelayedTask( + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + base::Unretained(&task3), &run_times), + delay3); task2.weak_factory_.InvalidateWeakPtrs(); task3.weak_factory_.InvalidateWeakPtrs(); @@ -2475,7 +2603,7 @@ std::set<base::TimeTicks> wake_up_times; - RunUntilIdle(base::Bind( + RunUntilIdle(base::BindRepeating( [](std::set<base::TimeTicks>* wake_up_times, base::SimpleTestTickClock* clock) { wake_up_times->insert(clock->NowTicks()); @@ -2578,20 +2706,24 @@ base::TimeDelta delay4(base::TimeDelta::FromSeconds(30)); std::vector<base::TimeTicks> run_times; runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task1.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task1.weak_factory_.GetWeakPtr(), &run_times), delay1); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task2.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task2.weak_factory_.GetWeakPtr(), &run_times), delay2); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task3.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task3.weak_factory_.GetWeakPtr(), &run_times), delay3); runners_[0]->PostDelayedTask( - FROM_HERE, base::Bind(&CancelableTask::RecordTimeTask, - task4.weak_factory_.GetWeakPtr(), &run_times), + FROM_HERE, + base::BindRepeating(&CancelableTask::RecordTimeTask, + task4.weak_factory_.GetWeakPtr(), &run_times), delay4); EXPECT_EQ(4u, runners_[0]->GetNumberOfPendingTasks()); @@ -2615,25 +2747,25 @@ LazyNow lazy_now(&now_src_); EXPECT_FALSE(static_cast<bool>(ComputeDelayTillNextTask(&lazy_now))); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromSeconds(10)); EXPECT_EQ(base::TimeDelta::FromSeconds(10), ComputeDelayTillNextTask(&lazy_now)->delay()); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[1]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromSeconds(15)); EXPECT_EQ(base::TimeDelta::FromSeconds(10), ComputeDelayTillNextTask(&lazy_now)->delay()); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[1]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromSeconds(5)); EXPECT_EQ(base::TimeDelta::FromSeconds(5), ComputeDelayTillNextTask(&lazy_now)->delay()); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); EXPECT_EQ(base::TimeDelta(), ComputeDelayTillNextTask(&lazy_now)->delay()); } @@ -2644,7 +2776,7 @@ std::unique_ptr<TaskQueue::QueueEnabledVoter> voter = runners_[0]->CreateQueueEnabledVoter(); voter->SetQueueEnabled(false); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); LazyNow lazy_now(&now_src_); EXPECT_FALSE(ComputeDelayTillNextTask(&lazy_now)); @@ -2654,7 +2786,7 @@ Initialize(1u); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); LazyNow lazy_now(&now_src_); EXPECT_FALSE(ComputeDelayTillNextTask(&lazy_now)); @@ -2664,7 +2796,7 @@ Initialize(1u); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); runners_[0]->InsertFence(TaskQueue::InsertFencePosition::kNow); LazyNow lazy_now(&now_src_); @@ -2674,7 +2806,7 @@ TEST_F(TaskQueueManagerTest, ComputeDelayTillNextTask_DelayedTaskReady) { Initialize(1u); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromSeconds(1)); now_src_.Advance(base::TimeDelta::FromSeconds(10)); @@ -2828,9 +2960,10 @@ TEST_F(TaskQueueManagerTest, DelayedTaskRunsInNestedMessageLoop) { InitializeWithRealMessageLoop(1u); base::RunLoop run_loop; - runners_[0]->PostTask(FROM_HERE, base::Bind(&MessageLoopTaskWithDelayedQuit, - message_loop_.get(), &now_src_, - base::RetainedRef(runners_[0]))); + runners_[0]->PostTask( + FROM_HERE, + base::BindRepeating(&MessageLoopTaskWithDelayedQuit, message_loop_.get(), + &now_src_, base::RetainedRef(runners_[0]))); run_loop.RunUntilIdle(); } @@ -2843,7 +2976,7 @@ base::RunLoop run_loop; // Needed because entering the nested run loop causes a DoWork to get // posted. - task_queue->PostTask(FROM_HERE, base::Bind(&NopTask)); + task_queue->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); task_queue->PostTask(FROM_HERE, run_loop.QuitClosure()); run_loop.Run(); non_nested_quit_closure.Run(); @@ -2856,8 +2989,9 @@ base::RunLoop run_loop; runners_[0]->PostDelayedTask( FROM_HERE, - base::Bind(&MessageLoopTaskWithImmediateQuit, message_loop_.get(), - run_loop.QuitClosure(), base::RetainedRef(runners_[0])), + base::BindRepeating(&MessageLoopTaskWithImmediateQuit, + message_loop_.get(), run_loop.QuitClosure(), + base::RetainedRef(runners_[0])), base::TimeDelta::FromMilliseconds(100)); now_src_.Advance(base::TimeDelta::FromMilliseconds(200)); @@ -2910,7 +3044,7 @@ TEST_F(TaskQueueManagerTest, DelayedDoWorkNotPostedForDisabledQueue) { Initialize(1u); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromMilliseconds(1)); ASSERT_TRUE(test_task_runner_->HasPendingTasks()); EXPECT_EQ(base::TimeDelta::FromMilliseconds(1), @@ -2932,11 +3066,11 @@ TEST_F(TaskQueueManagerTest, DisablingQueuesChangesDelayTillNextDoWork) { Initialize(3u); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromMilliseconds(1)); - runners_[1]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[1]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromMilliseconds(10)); - runners_[2]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[2]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromMilliseconds(100)); std::unique_ptr<TaskQueue::QueueEnabledVoter> voter0 = @@ -2976,10 +3110,12 @@ base::TimeDelta delay1 = base::TimeDelta::FromMilliseconds(10); base::TimeDelta delay2 = base::TimeDelta::FromMilliseconds(2); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay1); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay1); EXPECT_EQ(start_time + delay1, runners_[0]->GetNextScheduledWakeUp()); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), delay2); + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), + delay2); EXPECT_EQ(start_time + delay2, runners_[0]->GetNextScheduledWakeUp()); // We don't have wake-ups scheduled for disabled queues. @@ -2992,7 +3128,7 @@ EXPECT_EQ(start_time + delay2, runners_[0]->GetNextScheduledWakeUp()); // Immediate tasks shouldn't make any difference. - runners_[0]->PostTask(FROM_HERE, base::Bind(&NopTask)); + runners_[0]->PostTask(FROM_HERE, base::BindRepeating(&NopTask)); EXPECT_EQ(start_time + delay2, runners_[0]->GetNextScheduledWakeUp()); // Neither should fences. @@ -3006,7 +3142,7 @@ MockTaskQueueObserver observer; runners_[0]->SetObserver(&observer); - runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&NopTask), + runners_[0]->PostDelayedTask(FROM_HERE, base::BindRepeating(&NopTask), base::TimeDelta::FromMilliseconds(1)); std::unique_ptr<TaskQueue::QueueEnabledVoter> voter = @@ -3031,10 +3167,10 @@ int* start_counter, int* complete_counter) { task_queue->GetTaskQueueImpl()->SetOnTaskStartedHandler( - base::Bind([](int* counter, const TaskQueue::Task& task, - base::TimeTicks start) { ++(*counter); }, - start_counter)); - task_queue->GetTaskQueueImpl()->SetOnTaskCompletedHandler(base::Bind( + base::BindRepeating([](int* counter, const TaskQueue::Task& task, + base::TimeTicks start) { ++(*counter); }, + start_counter)); + task_queue->GetTaskQueueImpl()->SetOnTaskCompletedHandler(base::BindRepeating( [](int* counter, const TaskQueue::Task& task, base::TimeTicks start, base::TimeTicks end) { ++(*counter); }, complete_counter)); @@ -3042,11 +3178,12 @@ void UnsetOnTaskHandlers(scoped_refptr<TestTaskQueue> task_queue) { task_queue->GetTaskQueueImpl()->SetOnTaskStartedHandler( - base::Callback<void(const TaskQueue::Task& task, - base::TimeTicks start)>()); + base::RepeatingCallback<void(const TaskQueue::Task& task, + base::TimeTicks start)>()); task_queue->GetTaskQueueImpl()->SetOnTaskCompletedHandler( - base::Callback<void(const TaskQueue::Task& task, base::TimeTicks start, - base::TimeTicks end)>()); + base::RepeatingCallback<void(const TaskQueue::Task& task, + base::TimeTicks start, + base::TimeTicks end)>()); } } // namespace @@ -3057,9 +3194,12 @@ std::vector<EnqueueOrder> run_order; SetOnTaskHandlers(runners_[0], &start_counter, &complete_counter); EXPECT_TRUE(runners_[0]->GetTaskQueueImpl()->RequiresTaskTiming()); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_EQ(start_counter, 3); EXPECT_EQ(complete_counter, 3); @@ -3067,9 +3207,12 @@ UnsetOnTaskHandlers(runners_[0]); EXPECT_FALSE(runners_[0]->GetTaskQueueImpl()->RequiresTaskTiming()); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 5, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 6, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 5, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 6, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_EQ(start_counter, 3); EXPECT_EQ(complete_counter, 3); @@ -3085,8 +3228,10 @@ SetOnTaskHandlers(runners_[0], &start_counter, &complete_counter); EXPECT_TRUE(runners_[0]->GetTaskQueueImpl()->RequiresTaskTiming()); std::vector<EnqueueOrder> run_order; - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 2, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 1, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 2, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_EQ(start_counter, 2); EXPECT_EQ(complete_counter, 2); @@ -3094,16 +3239,20 @@ UnsetOnTaskHandlers(runners_[0]); EXPECT_FALSE(runners_[0]->GetTaskQueueImpl()->RequiresTaskTiming()); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 3, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 4, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 3, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 4, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_EQ(start_counter, 2); EXPECT_EQ(complete_counter, 2); EXPECT_THAT(run_order, ElementsAre(1, 2, 3, 4)); manager_->RemoveTaskTimeObserver(&test_task_time_observer_); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 5, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 6, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 5, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 6, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_EQ(start_counter, 2); EXPECT_EQ(complete_counter, 2); @@ -3111,8 +3260,10 @@ EXPECT_THAT(run_order, ElementsAre(1, 2, 3, 4, 5, 6)); SetOnTaskHandlers(runners_[0], &start_counter, &complete_counter); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 7, &run_order)); - runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 8, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 7, &run_order)); + runners_[0]->PostTask(FROM_HERE, + base::BindRepeating(&TestTask, 8, &run_order)); test_task_runner_->RunUntilIdle(); EXPECT_EQ(start_counter, 4); EXPECT_EQ(complete_counter, 4); @@ -3133,9 +3284,9 @@ EXPECT_EQ(0u, manager_->QueuesToDeleteCount()); for (int i = 1; i <= 5; ++i) { - main_tq->PostDelayedTask(FROM_HERE, - base::Bind(&RecordTimeTask, &run_times, &now_src_), - base::TimeDelta::FromMilliseconds(i * 100)); + main_tq->PostDelayedTask( + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_), + base::TimeDelta::FromMilliseconds(i * 100)); } test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(250)); @@ -3189,7 +3340,7 @@ for (int i = 1; i <= 5; ++i) { main_tqs[0]->PostDelayedTask( - FROM_HERE, base::Bind(&RecordTimeTask, &run_times, &now_src_), + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_), base::TimeDelta::FromMilliseconds(i * 100)); } test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(250)); @@ -3227,9 +3378,9 @@ EXPECT_EQ(0u, manager_->QueuesToDeleteCount()); for (int i = 1; i <= 5; ++i) { - main_tq->PostDelayedTask(FROM_HERE, - base::Bind(&RecordTimeTask, &run_times, &now_src_), - base::TimeDelta::FromMilliseconds(i * 100)); + main_tq->PostDelayedTask( + FROM_HERE, base::BindRepeating(&RecordTimeTask, &run_times, &now_src_), + base::TimeDelta::FromMilliseconds(i * 100)); } test_task_runner_->RunForPeriod(base::TimeDelta::FromMilliseconds(250));
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_selector.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_selector.cc index 6692854..62882dd 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_selector.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_selector.cc
@@ -272,9 +272,11 @@ } TrySelectingBlockedQueueOverEnabledQueue(**out_work_queue); - DidSelectQueueWithPriority( - (*out_work_queue)->task_queue()->GetQueuePriority(), - chose_delayed_over_immediate); + // We could use |(*out_work_queue)->task_queue()->GetQueuePriority()| here but + // for re-queued non-nestable tasks |task_queue()| returns null. + DidSelectQueueWithPriority(static_cast<TaskQueue::QueuePriority>( + (*out_work_queue)->work_queue_set_index()), + chose_delayed_over_immediate); return true; }
diff --git a/third_party/WebKit/Source/platform/scheduler/base/thread_controller.h b/third_party/WebKit/Source/platform/scheduler/base/thread_controller.h index 06fda3e3..56a22d8 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/thread_controller.h +++ b/third_party/WebKit/Source/platform/scheduler/base/thread_controller.h
@@ -60,11 +60,6 @@ // These methods exist due to current integration of TaskQueueManager // with MessageLoop. - // TaskQueueManager should schedule non-nestable work itself when - // appropriate. - virtual void PostNonNestableTask(const base::Location& from_here, - base::OnceClosure task) = 0; - virtual bool RunsTasksInCurrentSequence() = 0; virtual base::TickClock* GetClock() = 0; @@ -74,8 +69,6 @@ virtual void RestoreDefaultTaskRunner() = 0; - virtual bool IsNested() = 0; - virtual void AddNestingObserver(base::RunLoop::NestingObserver* observer) = 0; virtual void RemoveNestingObserver(
diff --git a/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.cc index 4270502..62d0fa2 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.cc
@@ -68,11 +68,6 @@ cancelable_delayed_do_work_closure_.Cancel(); } -void ThreadControllerImpl::PostNonNestableTask(const base::Location& from_here, - base::OnceClosure task) { - task_runner_->PostNonNestableTask(from_here, std::move(task)); -} - bool ThreadControllerImpl::RunsTasksInCurrentSequence() { return task_runner_->RunsTasksInCurrentSequence(); } @@ -94,11 +89,6 @@ message_loop_->SetTaskRunner(message_loop_task_runner_); } -bool ThreadControllerImpl::IsNested() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return base::RunLoop::IsNestedOnCurrentThread(); -} - void ThreadControllerImpl::DoWork(Sequence::WorkType work_type) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(sequence_);
diff --git a/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.h b/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.h index 8e0f8ee9..e0ae6e4 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/base/thread_controller_impl.h
@@ -39,14 +39,11 @@ void ScheduleDelayedWork(base::TimeDelta delay) override; void CancelDelayedWork() override; void SetSequence(Sequence* sequence) override; - void PostNonNestableTask(const base::Location& from_here, - base::OnceClosure task) override; bool RunsTasksInCurrentSequence() override; base::TickClock* GetClock() override; void SetDefaultTaskRunner( scoped_refptr<base::SingleThreadTaskRunner>) override; void RestoreDefaultTaskRunner() override; - bool IsNested() override; void AddNestingObserver(base::RunLoop::NestingObserver* observer) override; void RemoveNestingObserver(base::RunLoop::NestingObserver* observer) override;
diff --git a/third_party/WebKit/Source/platform/scheduler/base/work_queue.cc b/third_party/WebKit/Source/platform/scheduler/base/work_queue.cc index 3d7d757..c415b3a0 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/work_queue.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/work_queue.cc
@@ -67,6 +67,10 @@ DCHECK(task.enqueue_order_set()); #endif + // Make sure the |enqueue_order()| is monotonically increasing. + DCHECK(was_empty || + work_queue_.rbegin()->enqueue_order() < task.enqueue_order()); + // Amoritized O(1). work_queue_.push_back(std::move(task)); @@ -78,6 +82,38 @@ work_queue_sets_->OnTaskPushedToEmptyQueue(this); } +void WorkQueue::PushNonNestableTaskToFront(TaskQueueImpl::Task task) { + DCHECK(task.nestable == base::Nestable::kNonNestable); + + bool was_empty = work_queue_.empty(); +#ifndef NDEBUG + DCHECK(task.enqueue_order_set()); +#endif + + if (!was_empty) { + // Make sure the |enqueue_order()| is monotonically increasing. + DCHECK_LE(task.enqueue_order(), work_queue_.front().enqueue_order()) + << task_queue_->GetName() << " : " << work_queue_sets_->GetName() + << " : " << name_; + } + + // Amoritized O(1). + work_queue_.push_front(std::move(task)); + + if (!work_queue_sets_) + return; + + // Pretend to WorkQueueSets that nothing has changed if we're blocked. + if (BlockedByFence()) + return; + + if (was_empty) { + work_queue_sets_->OnTaskPushedToEmptyQueue(this); + } else { + work_queue_sets_->OnFrontTaskChanged(this); + } +} + void WorkQueue::ReloadEmptyImmediateQueue() { DCHECK(work_queue_.empty());
diff --git a/third_party/WebKit/Source/platform/scheduler/base/work_queue.h b/third_party/WebKit/Source/platform/scheduler/base/work_queue.h index 06604adc..9a1355dc 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/work_queue.h +++ b/third_party/WebKit/Source/platform/scheduler/base/work_queue.h
@@ -13,6 +13,7 @@ #include "base/trace_event/trace_event_argument.h" #include "platform/scheduler/base/enqueue_order.h" #include "platform/scheduler/base/intrusive_heap.h" +#include "platform/scheduler/base/sequence.h" #include "platform/scheduler/base/task_queue_impl.h" namespace blink { @@ -32,8 +33,9 @@ // throttling mechanisms. class PLATFORM_EXPORT WorkQueue { public: - enum class QueueType { kDelayed, kImmediate }; + using QueueType = Sequence::WorkType; + // Note |task_queue| can be null if queue_type is kNonNestable. WorkQueue(TaskQueueImpl* task_queue, const char* name, QueueType queue_type); ~WorkQueue(); @@ -67,6 +69,11 @@ // it informs the WorkQueueSets if the head changed. void Push(TaskQueueImpl::Task task); + // Pushes the task onto the front of the |work_queue_| and if it's before any + // fence it informs the WorkQueueSets the head changed. Use with caution this + // API can easily lead to task starvation if misused. + void PushNonNestableTaskToFront(TaskQueueImpl::Task task); + // Reloads the empty |work_queue_| with // |task_queue_->TakeImmediateIncomingQueue| and if a fence hasn't been // reached it informs the WorkQueueSets if the head changed. @@ -91,6 +98,8 @@ void set_heap_handle(HeapHandle handle) { heap_handle_ = handle; } + QueueType queue_type() const { return queue_type_; } + // Returns true if the front task in this queue has an older enqueue order // than the front task of |other_queue|. Both queue are assumed to be // non-empty. This method ignores any fences.
diff --git a/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.cc b/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.cc index 89563d6..d2ff24c 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.cc
@@ -53,6 +53,15 @@ work_queue_heaps_[set_index].insert({enqueue_order, work_queue}); } +void WorkQueueSets::OnFrontTaskChanged(WorkQueue* work_queue) { + EnqueueOrder enqueue_order; + bool has_enqueue_order = work_queue->GetFrontTaskEnqueueOrder(&enqueue_order); + DCHECK(has_enqueue_order); + size_t set = work_queue->work_queue_set_index(); + work_queue_heaps_[set].ChangeKey(work_queue->heap_handle(), + {enqueue_order, work_queue}); +} + void WorkQueueSets::OnTaskPushedToEmptyQueue(WorkQueue* work_queue) { // NOTE if this function changes, we need to keep |WorkQueueSets::AddQueue| in // sync.
diff --git a/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.h b/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.h index c293405e..8fad910 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.h +++ b/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets.h
@@ -43,6 +43,9 @@ void ChangeSetIndex(WorkQueue* queue, size_t set_index); // O(log num queues) + void OnFrontTaskChanged(WorkQueue* queue); + + // O(log num queues) void OnTaskPushedToEmptyQueue(WorkQueue* work_queue); // If empty it's O(1) amortized, otherwise it's O(log num queues)
diff --git a/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets_unittest.cc b/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets_unittest.cc index 1879bed..b3be1e2 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/work_queue_sets_unittest.cc
@@ -44,12 +44,21 @@ TaskQueueImpl::Task FakeTaskWithEnqueueOrder(int enqueue_order) { TaskQueueImpl::Task fake_task( - TaskQueue::PostedTask(base::Bind([] {}), FROM_HERE), base::TimeTicks(), - 0); + TaskQueue::PostedTask(base::BindOnce([] {}), FROM_HERE), + base::TimeTicks(), 0); fake_task.set_enqueue_order(enqueue_order); return fake_task; } + TaskQueueImpl::Task FakeNonNestableTaskWithEnqueueOrder(int enqueue_order) { + TaskQueueImpl::Task fake_task( + TaskQueue::PostedTask(base::BindOnce([] {}), FROM_HERE), + base::TimeTicks(), 0); + fake_task.set_enqueue_order(enqueue_order); + fake_task.nestable = base::Nestable::kNonNestable; + return fake_task; + } + std::vector<std::unique_ptr<WorkQueue>> work_queues_; std::unique_ptr<WorkQueueSets> work_queue_sets_; }; @@ -293,6 +302,28 @@ EXPECT_EQ(selected_work_queue, queue2); } +TEST_F(WorkQueueSetsTest, PushNonNestableTaskToFront) { + WorkQueue* queue1 = NewTaskQueue("queue1"); + WorkQueue* queue2 = NewTaskQueue("queue2"); + WorkQueue* queue3 = NewTaskQueue("queue3"); + queue1->Push(FakeTaskWithEnqueueOrder(6)); + queue2->Push(FakeTaskWithEnqueueOrder(5)); + queue3->Push(FakeTaskWithEnqueueOrder(4)); + size_t set = 4; + work_queue_sets_->ChangeSetIndex(queue1, set); + work_queue_sets_->ChangeSetIndex(queue2, set); + work_queue_sets_->ChangeSetIndex(queue3, set); + + WorkQueue* selected_work_queue; + EXPECT_TRUE(work_queue_sets_->GetOldestQueueInSet(set, &selected_work_queue)); + EXPECT_EQ(queue3, selected_work_queue); + + queue1->PushNonNestableTaskToFront(FakeNonNestableTaskWithEnqueueOrder(2)); + + EXPECT_TRUE(work_queue_sets_->GetOldestQueueInSet(set, &selected_work_queue)); + EXPECT_EQ(queue1, selected_work_queue); +} + } // namespace internal } // namespace scheduler } // namespace blink
diff --git a/third_party/WebKit/Source/platform/scheduler/base/work_queue_unittest.cc b/third_party/WebKit/Source/platform/scheduler/base/work_queue_unittest.cc index 52364b9..bbfbd49f 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/work_queue_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/work_queue_unittest.cc
@@ -38,12 +38,21 @@ protected: TaskQueueImpl::Task FakeTaskWithEnqueueOrder(int enqueue_order) { TaskQueueImpl::Task fake_task( - TaskQueue::PostedTask(base::Bind(&NopTask), FROM_HERE), + TaskQueue::PostedTask(base::BindOnce(&NopTask), FROM_HERE), base::TimeTicks(), 0); fake_task.set_enqueue_order(enqueue_order); return fake_task; } + TaskQueueImpl::Task FakeNonNestableTaskWithEnqueueOrder(int enqueue_order) { + TaskQueueImpl::Task fake_task( + TaskQueue::PostedTask(base::BindOnce(&NopTask), FROM_HERE), + base::TimeTicks(), 0); + fake_task.set_enqueue_order(enqueue_order); + fake_task.nestable = base::Nestable::kNonNestable; + return fake_task; + } + std::unique_ptr<RealTimeDomain> time_domain_; std::unique_ptr<TaskQueueImpl> task_queue_; std::unique_ptr<WorkQueue> work_queue_; @@ -122,6 +131,42 @@ EXPECT_FALSE(work_queue_sets_->GetOldestQueueInSet(0, &work_queue)); } +TEST_F(WorkQueueTest, PushNonNestableTaskToFront) { + WorkQueue* work_queue; + EXPECT_FALSE(work_queue_sets_->GetOldestQueueInSet(0, &work_queue)); + + work_queue_->PushNonNestableTaskToFront( + FakeNonNestableTaskWithEnqueueOrder(3)); + EXPECT_TRUE(work_queue_sets_->GetOldestQueueInSet(0, &work_queue)); + EXPECT_EQ(work_queue_.get(), work_queue); + + work_queue_->PushNonNestableTaskToFront( + FakeNonNestableTaskWithEnqueueOrder(2)); + + EXPECT_EQ(2ull, work_queue_->GetFrontTask()->enqueue_order()); + EXPECT_EQ(3ull, work_queue_->GetBackTask()->enqueue_order()); +} + +TEST_F(WorkQueueTest, PushNonNestableTaskToFrontAfterFenceHit) { + work_queue_->InsertFence(1); + WorkQueue* work_queue; + EXPECT_FALSE(work_queue_sets_->GetOldestQueueInSet(0, &work_queue)); + + work_queue_->PushNonNestableTaskToFront( + FakeNonNestableTaskWithEnqueueOrder(2)); + EXPECT_FALSE(work_queue_sets_->GetOldestQueueInSet(0, &work_queue)); +} + +TEST_F(WorkQueueTest, PushNonNestableTaskToFrontBeforeFenceHit) { + work_queue_->InsertFence(3); + WorkQueue* work_queue; + EXPECT_FALSE(work_queue_sets_->GetOldestQueueInSet(0, &work_queue)); + + work_queue_->PushNonNestableTaskToFront( + FakeNonNestableTaskWithEnqueueOrder(2)); + EXPECT_TRUE(work_queue_sets_->GetOldestQueueInSet(0, &work_queue)); +} + TEST_F(WorkQueueTest, ReloadEmptyImmediateQueue) { task_queue_->PushImmediateIncomingTaskForTest(FakeTaskWithEnqueueOrder(2)); task_queue_->PushImmediateIncomingTaskForTest(FakeTaskWithEnqueueOrder(3));
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc index 44bfd51..c7fe1d2 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
@@ -116,6 +116,76 @@ return RuntimeEnabledFeatures::StopLoadingInBackgroundEnabled(); } +const char* TaskTypeToString(TaskType task_type) { + switch (task_type) { + case TaskType::kDOMManipulation: + return "DOMManipultion"; + case TaskType::kUserInteraction: + return "UserInteraction"; + case TaskType::kNetworking: + return "Networking"; + case TaskType::kNetworkingControl: + return "NetworkingControl"; + case TaskType::kHistoryTraversal: + return "HistoryTraversal"; + case TaskType::kEmbed: + return "Embed"; + case TaskType::kMediaElementEvent: + return "MediaElementEvent"; + case TaskType::kCanvasBlobSerialization: + return "CanvasBlobSerialization"; + case TaskType::kMicrotask: + return "Microtask"; + case TaskType::kJavascriptTimer: + return "JavascriptTimer"; + case TaskType::kRemoteEvent: + return "RemoteEvent"; + case TaskType::kWebSocket: + return "WebSocket"; + case TaskType::kPostedMessage: + return "PostedMessage"; + case TaskType::kUnshippedPortMessage: + return "UnshipedPortMessage"; + case TaskType::kFileReading: + return "FileReading"; + case TaskType::kDatabaseAccess: + return "DatabaseAccess"; + case TaskType::kPresentation: + return "Presentation"; + case TaskType::kSensor: + return "Sensor"; + case TaskType::kPerformanceTimeline: + return "PerformanceTimeline"; + case TaskType::kWebGL: + return "WebGL"; + case TaskType::kIdleTask: + return "IdleTask"; + case TaskType::kMiscPlatformAPI: + return "MiscPlatformAPI"; + case TaskType::kUnspecedTimer: + return "UnspecedTimer"; + case TaskType::kUnspecedLoading: + return "UnspecedLoading"; + case TaskType::kUnthrottled: + return "Unthrottled"; + case TaskType::kInternalTest: + return "InternalTest"; + case TaskType::kCount: + return "Count"; + } + NOTREACHED(); + return ""; +} + +const char* OptionalTaskDescriptionToString( + base::Optional<RendererSchedulerImpl::TaskDescriptionForTracing> opt_desc) { + if (!opt_desc) + return nullptr; + if (opt_desc->task_type) + return TaskTypeToString(opt_desc->task_type.value()); + return MainThreadTaskQueue::NameForQueueType(opt_desc->queue_type); +} + } // namespace RendererSchedulerImpl::RendererSchedulerImpl( @@ -374,6 +444,10 @@ "RendererScheduler.ProcessType", renderer_scheduler_impl, RendererProcessTypeToString), + task_description_for_tracing(base::nullopt, + "RendererScheduler.MainThreadTask", + renderer_scheduler_impl, + OptionalTaskDescriptionToString), virtual_time_policy(VirtualTimePolicy::kAdvance), virtual_time_pause_count(0), max_virtual_time_task_starvation_count(0), @@ -2272,6 +2346,8 @@ seqlock_queueing_time_estimator_.seqlock.WriteBegin(); seqlock_queueing_time_estimator_.data.OnTopLevelTaskStarted(start, queue); seqlock_queueing_time_estimator_.seqlock.WriteEnd(); + main_thread_only().task_description_for_tracing = + TaskDescriptionForTracing{task.task_type(), queue->queue_type()}; } void RendererSchedulerImpl::OnTaskCompleted(MainThreadTaskQueue* queue, @@ -2287,6 +2363,7 @@ // TODO(altimin): Per-page metrics should also be considered. main_thread_only().metrics_helper.RecordTaskMetrics(queue, task, start, end); + main_thread_only().task_description_for_tracing = base::nullopt; } void RendererSchedulerImpl::OnBeginNestedRunLoop() { @@ -2432,6 +2509,7 @@ main_thread_only().has_navigated.OnTraceLogEnabled(); main_thread_only().pause_timers_for_webview.OnTraceLogEnabled(); main_thread_only().process_type.OnTraceLogEnabled(); + main_thread_only().task_description_for_tracing.OnTraceLogEnabled(); for (WebViewSchedulerImpl* web_view_scheduler : main_thread_only().web_view_schedulers) {
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h index d639006..2949feb 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
@@ -90,6 +90,18 @@ kUseCaseCount, kFirstUseCase = kNone, }; + + // Don't use except for tracing. + struct TaskDescriptionForTracing { + base::Optional<TaskType> task_type; + MainThreadTaskQueue::QueueType queue_type; + + // Required in order to wrap in TraceableState. + constexpr bool operator!=(const TaskDescriptionForTracing& rhs) const { + return task_type != rhs.task_type || queue_type != rhs.queue_type; + } + }; + static const char* UseCaseToString(UseCase use_case); static const char* RAILModeToString(v8::RAILMode rail_mode); static const char* VirtualTimePolicyToString( @@ -682,6 +694,9 @@ RendererMetricsHelper metrics_helper; TraceableState<RendererProcessType, kTracingCategoryNameDefault> process_type; + TraceableState<base::Optional<TaskDescriptionForTracing>, + kTracingCategoryNameInfo> + task_description_for_tracing; // Don't use except for tracing. base::ObserverList<VirtualTimeObserver> virtual_time_observers; base::TimeTicks initial_virtual_time; VirtualTimePolicy virtual_time_policy;
diff --git a/third_party/WebKit/Source/platform/scheduler/test/create_task_queue_manager_for_test.cc b/third_party/WebKit/Source/platform/scheduler/test/create_task_queue_manager_for_test.cc index b6c1a7f4..717dbaa1 100644 --- a/third_party/WebKit/Source/platform/scheduler/test/create_task_queue_manager_for_test.cc +++ b/third_party/WebKit/Source/platform/scheduler/test/create_task_queue_manager_for_test.cc
@@ -42,12 +42,6 @@ ThreadControllerImpl::RemoveNestingObserver(observer); } - bool IsNested() { - if (!message_loop_) - return false; - return ThreadControllerImpl::IsNested(); - } - ~ThreadControllerForTest() override {} };
diff --git a/third_party/WebKit/Source/platform/scheduler/test/lazy_thread_controller_for_test.cc b/third_party/WebKit/Source/platform/scheduler/test/lazy_thread_controller_for_test.cc index 7ff9ce4..1785d3e4 100644 --- a/third_party/WebKit/Source/platform/scheduler/test/lazy_thread_controller_for_test.cc +++ b/third_party/WebKit/Source/platform/scheduler/test/lazy_thread_controller_for_test.cc
@@ -88,11 +88,6 @@ base::RunLoop::RemoveNestingObserverOnCurrentThread(observer); } -bool LazyThreadControllerForTest::IsNested() { - EnsureMessageLoop(); - return ThreadControllerImpl::IsNested(); -} - bool LazyThreadControllerForTest::RunsTasksInCurrentSequence() { return thread_ref_ == base::PlatformThread::CurrentRef(); } @@ -112,13 +107,6 @@ ThreadControllerImpl::CancelDelayedWork(); } -void LazyThreadControllerForTest::PostNonNestableTask( - const base::Location& from_here, - base::OnceClosure task) { - EnsureMessageLoop(); - ThreadControllerImpl::PostNonNestableTask(from_here, std::move(task)); -} - void LazyThreadControllerForTest::SetDefaultTaskRunner( scoped_refptr<base::SingleThreadTaskRunner> task_runner) { if (!HasMessageLoop()) {
diff --git a/third_party/WebKit/Source/platform/scheduler/test/lazy_thread_controller_for_test.h b/third_party/WebKit/Source/platform/scheduler/test/lazy_thread_controller_for_test.h index 2d2783ec..15da532f 100644 --- a/third_party/WebKit/Source/platform/scheduler/test/lazy_thread_controller_for_test.h +++ b/third_party/WebKit/Source/platform/scheduler/test/lazy_thread_controller_for_test.h
@@ -25,15 +25,12 @@ ~LazyThreadControllerForTest(); // internal::ThreadControllerImpl: - bool IsNested() override; void AddNestingObserver(base::RunLoop::NestingObserver* observer) override; void RemoveNestingObserver(base::RunLoop::NestingObserver* observer) override; bool RunsTasksInCurrentSequence() override; void ScheduleWork() override; void ScheduleDelayedWork(base::TimeDelta delta) override; void CancelDelayedWork() override; - void PostNonNestableTask(const base::Location& from_here, - base::OnceClosure task); void SetDefaultTaskRunner( scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; void RestoreDefaultTaskRunner() override;
diff --git a/third_party/WebKit/Source/platform/scheduler/util/tracing_helper.h b/third_party/WebKit/Source/platform/scheduler/util/tracing_helper.h index 18fdc25b..7b497c8 100644 --- a/third_party/WebKit/Source/platform/scheduler/util/tracing_helper.h +++ b/third_party/WebKit/Source/platform/scheduler/util/tracing_helper.h
@@ -52,13 +52,13 @@ object_(object), converter_(converter), state_(initial_state), - started_(false) { + slice_is_open_(false) { internal::ValidateTracingCategory(category); Trace(); } ~TraceableState() { - if (started_) + if (slice_is_open_) TRACE_EVENT_ASYNC_END0(category, name_, object_); } @@ -91,18 +91,24 @@ } void Trace() { - if (started_) + if (slice_is_open_) { TRACE_EVENT_ASYNC_END0(category, name_, object_); - - started_ = is_enabled(); - if (started_) { - // Trace viewer logic relies on subslice starting at the exact same time - // as the async event. - base::TimeTicks now = base::TimeTicks::Now(); - TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(category, name_, object_, now); - TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(category, name_, object_, - converter_(state_), now); + slice_is_open_ = false; } + if (!is_enabled()) + return; + // Converter returns nullptr to indicate the absence of state. + const char* state_str = converter_(state_); + if (!state_str) + return; + + // Trace viewer logic relies on subslice starting at the exact same time + // as the async event. + base::TimeTicks now = base::TimeTicks::Now(); + TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(category, name_, object_, now); + TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(category, name_, object_, + state_str, now); + slice_is_open_ = true; } bool is_enabled() const { @@ -116,9 +122,9 @@ const ConverterFuncPtr converter_; T state_; - // We have to track |started_| state to avoid race condition since SetState - // might be called before OnTraceLogEnabled notification. - bool started_; + // We have to track whether slice is open to avoid confusion since assignment, + // "absent" state and OnTraceLogEnabled can happen anytime. + bool slice_is_open_; DISALLOW_COPY(TraceableState); };
diff --git a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp index 37065eb..a4c3db14 100644 --- a/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp +++ b/third_party/WebKit/Source/platform/testing/TestingPlatformSupport.cpp
@@ -33,7 +33,6 @@ #include <memory> #include "base/command_line.h" #include "base/memory/discardable_memory_allocator.h" -#include "base/metrics/statistics_recorder.h" #include "base/run_loop.h" #include "base/test/icu_test_util.h" #include "base/test/test_discardable_memory_allocator.h" @@ -228,7 +227,6 @@ WTF::WrapUnique(new base::TestDiscardableMemoryAllocator); base::DiscardableMemoryAllocator::SetInstance( discardable_memory_allocator_.get()); - base::StatisticsRecorder::Initialize(); dummy_platform_ = WTF::WrapUnique(new DummyPlatform); Platform::SetCurrentPlatformForTesting(dummy_platform_.get());
diff --git a/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp b/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp index be2765c..21f027728 100644 --- a/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp +++ b/third_party/WebKit/Source/platform/text/TextBreakIterator.cpp
@@ -277,23 +277,19 @@ is_space = IsBreakableSpace(ch); switch (break_space) { - case BreakSpaceType::kBefore: + case BreakSpaceType::kBeforeEverySpace: if (is_space) return i; break; - case BreakSpaceType::kBeforeSpace: - if (ch == kSpaceCharacter) - return i; - if (is_space) + case BreakSpaceType::kBeforeSpaceRun: + // Theoritically, preserved newline characters are different from space + // and tab characters. The difference is not implemented because the + // LayoutNG line breaker handles preserved newline characters by itself. + if (is_space) { + if (!is_last_space) + return i; continue; - if (is_last_space && last_ch != kSpaceCharacter) - return i; - break; - case BreakSpaceType::kAfter: - if (is_space) - continue; - if (is_last_space) - return i; + } break; } @@ -329,20 +325,8 @@ } } } - if (i == next_break) { - switch (break_space) { - case BreakSpaceType::kBefore: - if (!is_last_space) - return i; - break; - case BreakSpaceType::kBeforeSpace: - if (last_ch != kSpaceCharacter) - return i; - break; - case BreakSpaceType::kAfter: - return i; - } - } + if (i == next_break && !is_last_space) + return i; } } @@ -354,19 +338,16 @@ int pos, const CharacterType* str) const { switch (break_space_) { - case BreakSpaceType::kBefore: + case BreakSpaceType::kBeforeEverySpace: return NextBreakablePosition<CharacterType, lineBreakType, - BreakSpaceType::kBefore>(pos, str); - case BreakSpaceType::kBeforeSpace: + BreakSpaceType::kBeforeEverySpace>(pos, str); + case BreakSpaceType::kBeforeSpaceRun: return NextBreakablePosition<CharacterType, lineBreakType, - BreakSpaceType::kBeforeSpace>(pos, str); - case BreakSpaceType::kAfter: - return NextBreakablePosition<CharacterType, lineBreakType, - BreakSpaceType::kAfter>(pos, str); + BreakSpaceType::kBeforeSpaceRun>(pos, str); } NOTREACHED(); return NextBreakablePosition<CharacterType, lineBreakType, - BreakSpaceType::kBefore>(pos, str); + BreakSpaceType::kBeforeEverySpace>(pos, str); } template <LineBreakType lineBreakType> @@ -438,12 +419,10 @@ std::ostream& operator<<(std::ostream& ostream, BreakSpaceType break_space) { switch (break_space) { - case BreakSpaceType::kBefore: - return ostream << "Before"; - case BreakSpaceType::kBeforeSpace: - return ostream << "BeforeSpace"; - case BreakSpaceType::kAfter: - return ostream << "After"; + case BreakSpaceType::kBeforeEverySpace: + return ostream << "kBeforeEverySpace"; + case BreakSpaceType::kBeforeSpaceRun: + return ostream << "kBeforeSpaceRun"; } NOTREACHED(); return ostream << "BreakSpaceType::" << static_cast<int>(break_space);
diff --git a/third_party/WebKit/Source/platform/text/TextBreakIterator.h b/third_party/WebKit/Source/platform/text/TextBreakIterator.h index 10c0fa53..d65682a7 100644 --- a/third_party/WebKit/Source/platform/text/TextBreakIterator.h +++ b/third_party/WebKit/Source/platform/text/TextBreakIterator.h
@@ -93,22 +93,23 @@ // Determines break opportunities around collapsible space characters (space, // newline, and tabulation characters.) enum class BreakSpaceType { - // Break before collapsible space characters. + // Break before every collapsible space character. // This is a specialized optimization for CSS, where leading/trailing spaces // in each line are removed, and thus breaking before spaces can save // computing hanging spaces. - kBefore, + // Callers are expected to handle spaces by themselves. Because a run of + // spaces can include different types of spaces, break opportunity is given + // for every space character. + // Pre-LayoutNG line breaker uses this type. + kBeforeEverySpace, - // Break before space characters, but after newline and tabulation characters. - // This is for CSS line breaking as in |kBefore|, but when whitespace - // collapsing is already applied to the target string. - kBeforeSpace, - - // Break after collapsible space characters. - // When 'white-space:pre-wrap', or when in editing, leaging/trailing spaces - // need to be preserved, and that the |kBefore| optimization cannot work. - // This mode is compatible with UAX#14/ICU. http://unicode.org/reports/tr14/ - kAfter, + // Break before a run of white space characters. + // This is for CSS line breaking as in |kBeforeEverySpace|, but when + // whitespace collapsing is already applied to the target string. In this + // case, a run of white spaces are preserved spaces. There should not be break + // opportunities between white spaces. + // LayoutNG line breaker uses this type. + kBeforeSpaceRun, }; PLATFORM_EXPORT std::ostream& operator<<(std::ostream&, LineBreakType); @@ -294,7 +295,7 @@ mutable const UChar* cached_prior_context_; mutable unsigned cached_prior_context_length_; LineBreakType break_type_; - BreakSpaceType break_space_ = BreakSpaceType::kBefore; + BreakSpaceType break_space_ = BreakSpaceType::kBeforeEverySpace; }; // Iterates over "extended grapheme clusters", as defined in UAX #29.
diff --git a/third_party/WebKit/Source/platform/text/TextBreakIteratorTest.cpp b/third_party/WebKit/Source/platform/text/TextBreakIteratorTest.cpp index d75c0c6..4711fe0 100644 --- a/third_party/WebKit/Source/platform/text/TextBreakIteratorTest.cpp +++ b/third_party/WebKit/Source/platform/text/TextBreakIteratorTest.cpp
@@ -17,9 +17,10 @@ } // The expected break positions must be specified UTF-16 character boundaries. - void MatchLineBreaks(LineBreakType line_break_type, - const Vector<int> expected_break_positions, - BreakSpaceType break_space = BreakSpaceType::kBefore) { + void MatchLineBreaks( + LineBreakType line_break_type, + const Vector<int> expected_break_positions, + BreakSpaceType break_space = BreakSpaceType::kBeforeEverySpace) { if (test_string_.Is8Bit()) { test_string_ = String::Make16BitFrom8BitSource(test_string_.Characters8(), test_string_.length()); @@ -98,25 +99,22 @@ TEST_F(TextBreakIteratorTest, Basic) { SetTestString("a b c"); MatchLineBreaks(LineBreakType::kNormal, {1, 3, 4, 6}); - MatchLineBreaks(LineBreakType::kNormal, {1, 3, 4, 6}, - BreakSpaceType::kBeforeSpace); - MatchLineBreaks(LineBreakType::kNormal, {2, 5, 6}, BreakSpaceType::kAfter); + MatchLineBreaks(LineBreakType::kNormal, {1, 3, 6}, + BreakSpaceType::kBeforeSpaceRun); } TEST_F(TextBreakIteratorTest, Newline) { - SetTestString("a\nb\n\nc"); - MatchLineBreaks(LineBreakType::kNormal, {1, 3, 4, 6}); - MatchLineBreaks(LineBreakType::kNormal, {2, 5, 6}, - BreakSpaceType::kBeforeSpace); - MatchLineBreaks(LineBreakType::kNormal, {2, 5, 6}, BreakSpaceType::kAfter); + SetTestString("a\nb\n\nc\n d"); + MatchLineBreaks(LineBreakType::kNormal, {1, 3, 4, 6, 7, 9}); + MatchLineBreaks(LineBreakType::kNormal, {1, 3, 6, 9}, + BreakSpaceType::kBeforeSpaceRun); } TEST_F(TextBreakIteratorTest, Tab) { SetTestString("a\tb\t\tc"); MatchLineBreaks(LineBreakType::kNormal, {1, 3, 4, 6}); - MatchLineBreaks(LineBreakType::kNormal, {2, 5, 6}, - BreakSpaceType::kBeforeSpace); - MatchLineBreaks(LineBreakType::kNormal, {2, 5, 6}, BreakSpaceType::kAfter); + MatchLineBreaks(LineBreakType::kNormal, {1, 3, 6}, + BreakSpaceType::kBeforeSpaceRun); } TEST_F(TextBreakIteratorTest, LatinPunctuation) { @@ -125,9 +123,6 @@ MatchLineBreaks(LineBreakType::kBreakAll, {2, 4, 6, 8}); MatchLineBreaks(LineBreakType::kBreakCharacter, {1, 2, 3, 4, 5, 6, 7, 8}); MatchLineBreaks(LineBreakType::kKeepAll, {4, 8}); - MatchLineBreaks(LineBreakType::kNormal, {5, 8}, BreakSpaceType::kAfter); - MatchLineBreaks(LineBreakType::kBreakAll, {2, 5, 6, 8}, - BreakSpaceType::kAfter); } TEST_F(TextBreakIteratorTest, Chinese) { @@ -136,10 +131,6 @@ MatchLineBreaks(LineBreakType::kBreakAll, {1, 2, 3, 4, 5}); MatchLineBreaks(LineBreakType::kBreakCharacter, {1, 2, 3, 4, 5}); MatchLineBreaks(LineBreakType::kKeepAll, {5}); - MatchLineBreaks(LineBreakType::kNormal, {1, 2, 3, 4, 5}, - BreakSpaceType::kAfter); - MatchLineBreaks(LineBreakType::kBreakAll, {1, 2, 3, 4, 5}, - BreakSpaceType::kAfter); } TEST_F(TextBreakIteratorTest, ChineseMixed) { @@ -149,10 +140,6 @@ MatchLineBreaks(LineBreakType::kBreakCharacter, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}); MatchLineBreaks(LineBreakType::kKeepAll, {1, 4, 9, 10}); - MatchLineBreaks(LineBreakType::kNormal, {1, 4, 5, 7, 9, 10}, - BreakSpaceType::kAfter); - MatchLineBreaks(LineBreakType::kBreakAll, {1, 4, 5, 6, 7, 9, 10}, - BreakSpaceType::kAfter); } TEST_F(TextBreakIteratorTest, ChineseSpaces) { @@ -162,12 +149,8 @@ MatchLineBreaks(LineBreakType::kBreakCharacter, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}); MatchLineBreaks(LineBreakType::kKeepAll, {1, 2, 4, 5, 7, 8, 10}); - MatchLineBreaks(LineBreakType::kNormal, {1, 2, 4, 5, 7, 8, 10}, - BreakSpaceType::kBeforeSpace); - MatchLineBreaks(LineBreakType::kNormal, {3, 6, 9, 10}, - BreakSpaceType::kAfter); - MatchLineBreaks(LineBreakType::kBreakAll, {3, 6, 9, 10}, - BreakSpaceType::kAfter); + MatchLineBreaks(LineBreakType::kNormal, {1, 4, 7, 10}, + BreakSpaceType::kBeforeSpaceRun); } TEST_F(TextBreakIteratorTest, KeepEmojiZWJFamilyIsolate) { @@ -176,8 +159,6 @@ MatchLineBreaks(LineBreakType::kBreakAll, {11}); MatchLineBreaks(LineBreakType::kBreakCharacter, {11}); MatchLineBreaks(LineBreakType::kKeepAll, {11}); - MatchLineBreaks(LineBreakType::kNormal, {11}, BreakSpaceType::kAfter); - MatchLineBreaks(LineBreakType::kBreakAll, {11}, BreakSpaceType::kAfter); } TEST_F(TextBreakIteratorTest, KeepEmojiModifierSequenceIsolate) { @@ -186,8 +167,6 @@ MatchLineBreaks(LineBreakType::kBreakAll, {3}); MatchLineBreaks(LineBreakType::kBreakCharacter, {3}); MatchLineBreaks(LineBreakType::kKeepAll, {3}); - MatchLineBreaks(LineBreakType::kNormal, {3}, BreakSpaceType::kAfter); - MatchLineBreaks(LineBreakType::kBreakAll, {3}, BreakSpaceType::kAfter); } TEST_F(TextBreakIteratorTest, KeepEmojiZWJSequence) { @@ -198,9 +177,6 @@ MatchLineBreaks(LineBreakType::kBreakCharacter, {1, 2, 3, 4, 15, 16, 17, 18, 19}); MatchLineBreaks(LineBreakType::kKeepAll, {3, 15, 19}); - MatchLineBreaks(LineBreakType::kNormal, {4, 16, 19}, BreakSpaceType::kAfter); - MatchLineBreaks(LineBreakType::kBreakAll, {1, 2, 4, 16, 17, 18, 19}, - BreakSpaceType::kAfter); } TEST_F(TextBreakIteratorTest, KeepEmojiModifierSequence) { @@ -210,9 +186,6 @@ MatchLineBreaks(LineBreakType::kBreakCharacter, {1, 2, 3, 4, 7, 8, 9, 10, 11}); MatchLineBreaks(LineBreakType::kKeepAll, {3, 7, 11}); - MatchLineBreaks(LineBreakType::kNormal, {4, 8, 11}, BreakSpaceType::kAfter); - MatchLineBreaks(LineBreakType::kBreakAll, {1, 2, 4, 8, 9, 10, 11}, - BreakSpaceType::kAfter); } TEST_F(TextBreakIteratorTest, NextBreakOpportunityAtEnd) {
diff --git a/third_party/WebKit/Source/platform/wtf/HashTable.h b/third_party/WebKit/Source/platform/wtf/HashTable.h index cc6bd7f..b337742 100644 --- a/third_party/WebKit/Source/platform/wtf/HashTable.h +++ b/third_party/WebKit/Source/platform/wtf/HashTable.h
@@ -564,7 +564,6 @@ template <typename T, typename U, typename V> static void Translate(T& location, U&&, V&& value) { location = std::forward<V>(value); - ConstructTraits<T, Traits, Allocator>::NotifyNewElements(&location, 1); } }; @@ -1305,6 +1304,9 @@ HashTranslator::Translate(*entry, std::forward<T>(key), std::forward<Extra>(extra)); DCHECK(!IsEmptyOrDeletedBucket(*entry)); + // Translate constructs an element so we need to notify using the trait. Avoid + // doing that in the translator so that they can be easily customized. + ConstructTraits<ValueType, Traits, Allocator>::NotifyNewElements(entry, 1); ++key_count_; @@ -1371,6 +1373,9 @@ HashTranslator::Translate(*entry, std::forward<T>(key), std::forward<Extra>(extra), h); DCHECK(!IsEmptyOrDeletedBucket(*entry)); + // Translate constructs an element so we need to notify using the trait. Avoid + // doing that in the translator so that they can be easily customized. + ConstructTraits<ValueType, Traits, Allocator>::NotifyNewElements(entry, 1); ++key_count_; if (ShouldExpand())
diff --git a/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBuffer.h b/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBuffer.h index 3058fad2..5846ef2e 100644 --- a/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBuffer.h +++ b/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBuffer.h
@@ -247,7 +247,7 @@ } unsigned ArrayBuffer::ByteLength() const { - return contents_.SizeInBytes(); + return contents_.DataLength(); } scoped_refptr<ArrayBuffer> ArrayBuffer::Slice(int begin, int end) const {
diff --git a/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.cpp b/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.cpp index c360c00b..99511a1 100644 --- a/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.cpp +++ b/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.cpp
@@ -62,7 +62,7 @@ ArrayBufferContents::InitializationPolicy policy) : holder_(base::AdoptRef(new DataHolder())) { // Do not allow 32-bit overflow of the total size. - unsigned total_size = num_elements * element_byte_size; + size_t total_size = num_elements * element_byte_size; if (num_elements) { if (total_size / num_elements != element_byte_size) { return; @@ -73,17 +73,14 @@ } ArrayBufferContents::ArrayBufferContents(DataHandle data, - unsigned size_in_bytes, SharingType is_shared) : holder_(base::AdoptRef(new DataHolder())) { if (data) { - holder_->Adopt(std::move(data), size_in_bytes, is_shared); + holder_->Adopt(std::move(data), is_shared); } else { - DCHECK_EQ(size_in_bytes, 0u); - size_in_bytes = 0; // Allow null data if size is 0 bytes, make sure data is valid pointer. // (PartitionAlloc guarantees valid pointer for size 0) - holder_->AllocateNew(size_in_bytes, is_shared, kZeroInitialize); + holder_->AllocateNew(0, is_shared, kZeroInitialize); } } @@ -173,81 +170,71 @@ size_t size, InitializationPolicy policy) { return DataHandle(ArrayBufferContents::AllocateMemoryOrNull(size, policy), - FreeMemory); + size, FreeMemory); } ArrayBufferContents::DataHolder::DataHolder() - : data_(nullptr, FreeMemory), - size_in_bytes_(0), + : data_(nullptr, 0, FreeMemory), is_shared_(kNotShared), has_registered_external_allocation_(false) {} ArrayBufferContents::DataHolder::~DataHolder() { if (has_registered_external_allocation_) - AdjustAmountOfExternalAllocatedMemory( - -static_cast<int64_t>(size_in_bytes_)); + AdjustAmountOfExternalAllocatedMemory(-static_cast<int64_t>(DataLength())); - size_in_bytes_ = 0; is_shared_ = kNotShared; } -void ArrayBufferContents::DataHolder::AllocateNew(unsigned size_in_bytes, +void ArrayBufferContents::DataHolder::AllocateNew(size_t length, SharingType is_shared, InitializationPolicy policy) { DCHECK(!data_); - DCHECK_EQ(size_in_bytes_, 0u); DCHECK(!has_registered_external_allocation_); - data_ = CreateDataHandle(size_in_bytes, policy); + data_ = CreateDataHandle(length, policy); if (!data_) return; - size_in_bytes_ = size_in_bytes; is_shared_ = is_shared; - AdjustAmountOfExternalAllocatedMemory(size_in_bytes_); + AdjustAmountOfExternalAllocatedMemory(length); } void ArrayBufferContents::DataHolder::Adopt(DataHandle data, - unsigned size_in_bytes, SharingType is_shared) { DCHECK(!data_); - DCHECK_EQ(size_in_bytes_, 0u); DCHECK(!has_registered_external_allocation_); data_ = std::move(data); - size_in_bytes_ = size_in_bytes; is_shared_ = is_shared; - AdjustAmountOfExternalAllocatedMemory(size_in_bytes_); + AdjustAmountOfExternalAllocatedMemory(data.DataLength()); } void ArrayBufferContents::DataHolder::CopyMemoryFrom(const DataHolder& source) { DCHECK(!data_); - DCHECK_EQ(size_in_bytes_, 0u); DCHECK(!has_registered_external_allocation_); - data_ = CreateDataHandle(source.SizeInBytes(), kDontInitialize); + data_ = CreateDataHandle(source.DataLength(), kDontInitialize); if (!data_) return; - size_in_bytes_ = source.SizeInBytes(); - memcpy(data_.Data(), source.Data(), source.SizeInBytes()); + memcpy(data_.Data(), source.Data(), source.DataLength()); - AdjustAmountOfExternalAllocatedMemory(size_in_bytes_); + AdjustAmountOfExternalAllocatedMemory(source.DataLength()); } void ArrayBufferContents::DataHolder:: RegisterExternalAllocationWithCurrentContext() { DCHECK(!has_registered_external_allocation_); - AdjustAmountOfExternalAllocatedMemory(static_cast<int64_t>(size_in_bytes_)); + AdjustAmountOfExternalAllocatedMemory(static_cast<int64_t>(DataLength())); } void ArrayBufferContents::DataHolder:: UnregisterExternalAllocationWithCurrentContext() { if (!has_registered_external_allocation_) return; - AdjustAmountOfExternalAllocatedMemory(-static_cast<int64_t>(size_in_bytes_)); + AdjustAmountOfExternalAllocatedMemory(-static_cast<int64_t>(DataLength())); } } // namespace WTF
diff --git a/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.h b/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.h index 3fab7f9..bd50895 100644 --- a/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.h +++ b/third_party/WebKit/Source/platform/wtf/typed_arrays/ArrayBufferContents.h
@@ -45,10 +45,10 @@ // Types that need to be used when injecting external memory. // DataHandle allows specifying a deleter which will be invoked when // DataHandle instance goes out of scope. If the data memory is allocated - // using ArrayBufferContents::allocateMemoryOrNull, it is necessary to - // specify ArrayBufferContents::freeMemory as the DataDeleter. - // Most clients would want to use ArrayBufferContents::createData, which - // allocates memory and specifies the correct deleter. + // using ArrayBufferContents::AllocateMemoryOrNull, it is necessary to specify + // ArrayBufferContents::FreeMemory as the DataDeleter. Most clients would want + // to use ArrayBufferContents::CreateDataHandle, which allocates memory and + // specifies the correct deleter. using DataDeleter = void (*)(void* data); enum class AllocationKind { kNormal, kReservation }; @@ -57,11 +57,11 @@ DISALLOW_COPY_AND_ASSIGN(DataHandle); public: - DataHandle(void* data, DataDeleter deleter) + DataHandle(void* data, size_t length, DataDeleter deleter) : allocation_base_(data), - allocation_length_(0), + allocation_length_(length), data_(data), - data_length_(0), + data_length_(length), kind_(AllocationKind::kNormal), deleter_(deleter) {} DataHandle(void* allocation_base, @@ -151,7 +151,6 @@ SharingType is_shared, InitializationPolicy); ArrayBufferContents(DataHandle, - unsigned size_in_bytes, SharingType is_shared); ArrayBufferContents(ArrayBufferContents&&) = default; @@ -170,7 +169,7 @@ return DataMaybeShared(); } void* DataMaybeShared() const { return holder_ ? holder_->Data() : nullptr; } - unsigned SizeInBytes() const { return holder_ ? holder_->SizeInBytes() : 0; } + size_t DataLength() const { return holder_ ? holder_->DataLength() : 0; } bool IsShared() const { return holder_ ? holder_->IsShared() : false; } void Transfer(ArrayBufferContents& other); @@ -213,15 +212,15 @@ DataHolder(); ~DataHolder(); - void AllocateNew(unsigned size_in_bytes, + void AllocateNew(size_t length, SharingType is_shared, InitializationPolicy); - void Adopt(DataHandle, unsigned size_in_bytes, SharingType is_shared); + void Adopt(DataHandle, SharingType is_shared); void CopyMemoryFrom(const DataHolder& source); const void* Data() const { return data_.Data(); } void* Data() { return data_.Data(); } - unsigned SizeInBytes() const { return size_in_bytes_; } + size_t DataLength() const { return data_.DataLength(); } bool IsShared() const { return is_shared_ == kShared; } void RegisterExternalAllocationWithCurrentContext(); @@ -236,7 +235,7 @@ adjust_amount_of_external_allocated_memory_function_(diff); } - void AdjustAmountOfExternalAllocatedMemory(unsigned diff) { + void AdjustAmountOfExternalAllocatedMemory(size_t diff) { AdjustAmountOfExternalAllocatedMemory(static_cast<int64_t>(diff)); } @@ -256,7 +255,6 @@ } DataHandle data_; - unsigned size_in_bytes_; SharingType is_shared_; bool has_registered_external_allocation_; };
diff --git a/third_party/WebKit/Tools/Scripts/audit-non-blink-usage.py b/third_party/WebKit/Tools/Scripts/audit-non-blink-usage.py index 5fc8252..abeb5bff 100755 --- a/third_party/WebKit/Tools/Scripts/audit-non-blink-usage.py +++ b/third_party/WebKit/Tools/Scripts/audit-non-blink-usage.py
@@ -135,6 +135,8 @@ # These modules need access to GL drawing, cross-process image # transport, and related interfaces. 'allowed': [ + 'gfx::GpuFence', + 'gfx::GpuFenceHandle', 'gfx::GpuMemoryBufferHandle', 'gpu::gles2::GLES2Interface', 'gpu::MailboxHolder',
diff --git a/third_party/WebKit/common/BUILD.gn b/third_party/WebKit/common/BUILD.gn index 53f7209..56344951 100644 --- a/third_party/WebKit/common/BUILD.gn +++ b/third_party/WebKit/common/BUILD.gn
@@ -114,6 +114,7 @@ "clipboard/clipboard.mojom", "color_chooser/color_chooser.mojom", "feature_policy/feature_policy.mojom", + "net/ip_address_space.mojom", "page/page_visibility_state.mojom", "quota/quota_dispatcher_host.mojom", "quota/quota_types.mojom",
diff --git a/third_party/WebKit/common/net/OWNERS b/third_party/WebKit/common/net/OWNERS new file mode 100644 index 0000000..08850f4 --- /dev/null +++ b/third_party/WebKit/common/net/OWNERS
@@ -0,0 +1,2 @@ +per-file *.mojom=set noparent +per-file *.mojom=file://ipc/SECURITY_OWNERS
diff --git a/third_party/WebKit/public/platform/address_space.mojom b/third_party/WebKit/common/net/ip_address_space.mojom similarity index 69% rename from third_party/WebKit/public/platform/address_space.mojom rename to third_party/WebKit/common/net/ip_address_space.mojom index 3a29e427..c094297 100644 --- a/third_party/WebKit/public/platform/address_space.mojom +++ b/third_party/WebKit/common/net/ip_address_space.mojom
@@ -1,4 +1,4 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. +// Copyright 2018 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. @@ -7,10 +7,7 @@ // Represents AddressSpace from the "CORS and RFC1918" spec. The ordering is // important, as it's used to determine whether preflights are required, as per // https://wicg.github.io/cors-rfc1918/#framework -// -// TODO(darin): Update all WebAddressSpace consumers to use this type instead, -// and remove the typemap. -enum AddressSpace { +enum IPAddressSpace { kLocal, // loopback, link local kPrivate, // Reserved by RFC1918 kPublic, // Everything else
diff --git a/third_party/WebKit/public/BUILD.gn b/third_party/WebKit/public/BUILD.gn index 93fe9be..9aa4657 100644 --- a/third_party/WebKit/public/BUILD.gn +++ b/third_party/WebKit/public/BUILD.gn
@@ -127,7 +127,6 @@ "platform/TaskType.h", "platform/URLConversion.h", "platform/UserMetricsAction.h", - "platform/WebAddressSpace.h", "platform/WebApplicationCacheHost.h", "platform/WebApplicationCacheHostClient.h", "platform/WebAudioBus.h", @@ -332,7 +331,6 @@ "platform/WebSpellCheckPanelHostClient.h", "platform/WebStorageArea.h", "platform/WebStorageNamespace.h", - "platform/WebStorageQuotaCallbacks.h", "platform/WebString.h", "platform/WebSurfaceLayerBridge.h", "platform/WebTextInputInfo.h", @@ -746,7 +744,6 @@ "//third_party/WebKit/Source/platform:blink_platform_public_deps", ] sources = [ - "platform/address_space.mojom", "platform/content_security_policy.mojom", "platform/dedicated_worker_factory.mojom", "platform/display_mode.mojom",
diff --git a/third_party/WebKit/public/platform/AddressSpaceStructTraits.h b/third_party/WebKit/public/platform/AddressSpaceStructTraits.h deleted file mode 100644 index f6f98e5..0000000 --- a/third_party/WebKit/public/platform/AddressSpaceStructTraits.h +++ /dev/null
@@ -1,49 +0,0 @@ -// Copyright 2017 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 AddressSpaceStructTraits_h -#define AddressSpaceStructTraits_h - -#include "mojo/public/cpp/bindings/enum_traits.h" -#include "third_party/WebKit/public/platform/WebAddressSpace.h" -#include "third_party/WebKit/public/platform/address_space.mojom-shared.h" - -namespace mojo { - -template <> -struct EnumTraits<::blink::mojom::AddressSpace, ::blink::WebAddressSpace> { - static ::blink::mojom::AddressSpace ToMojom(::blink::WebAddressSpace input) { - switch (input) { - case ::blink::kWebAddressSpaceLocal: - return ::blink::mojom::AddressSpace::kLocal; - case ::blink::kWebAddressSpacePrivate: - return ::blink::mojom::AddressSpace::kPrivate; - case ::blink::kWebAddressSpacePublic: - return ::blink::mojom::AddressSpace::kPublic; - } - NOTREACHED(); - return ::blink::mojom::AddressSpace::kLocal; - } - - static bool FromMojom(::blink::mojom::AddressSpace input, - ::blink::WebAddressSpace* output) { - switch (input) { - case ::blink::mojom::AddressSpace::kLocal: - *output = ::blink::kWebAddressSpaceLocal; - return true; - case ::blink::mojom::AddressSpace::kPrivate: - *output = ::blink::kWebAddressSpacePrivate; - return true; - case ::blink::mojom::AddressSpace::kPublic: - *output = ::blink::kWebAddressSpacePublic; - return true; - } - NOTREACHED(); - return false; - } -}; - -} // namespace mojo - -#endif // AddressSpaceStructTraits_h
diff --git a/third_party/WebKit/public/platform/Platform.h b/third_party/WebKit/public/platform/Platform.h index f063ac5..cc2a721a 100644 --- a/third_party/WebKit/public/platform/Platform.h +++ b/third_party/WebKit/public/platform/Platform.h
@@ -49,7 +49,6 @@ #include "WebPlatformEventType.h" #include "WebSize.h" #include "WebSpeechSynthesizer.h" -#include "WebStorageQuotaCallbacks.h" #include "WebString.h" #include "WebURLError.h" #include "WebURLLoader.h" @@ -696,14 +695,15 @@ // Quota ----------------------------------------------------------- // Queries the storage partition's storage usage and quota information. - // WebStorageQuotaCallbacks::DidQueryStorageUsageAndQuota will be called - // with the current usage and quota information for the partition. When - // an error occurs WebStorageQuotaCallbacks::DidFail is called with an - // error code. + // The callback will be called with the current usage and quota information + // for the partition. When an error occurs the callback is called with a + // status code other than kOk. + using QueryStorageUsageAndQuotaCallback = + base::OnceCallback<void(mojom::QuotaStatusCode, int64_t, int64_t)>; virtual void QueryStorageUsageAndQuota( const WebSecurityOrigin& storage_partition, mojom::StorageType, - WebStorageQuotaCallbacks) {} + QueryStorageUsageAndQuotaCallback) {} // WebDatabase --------------------------------------------------------
diff --git a/third_party/WebKit/public/platform/WebAddressSpace.h b/third_party/WebKit/public/platform/WebAddressSpace.h deleted file mode 100644 index 4475a94..0000000 --- a/third_party/WebKit/public/platform/WebAddressSpace.h +++ /dev/null
@@ -1,22 +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 WebAddressSpace_h -#define WebAddressSpace_h - -namespace blink { - -// Represents AddressSpace from the "CORS and RFC1918" spec. The ordering is -// important, as it's used to determine whether preflights are required, as per -// https://wicg.github.io/cors-rfc1918/#framework -enum WebAddressSpace { - kWebAddressSpaceLocal = 0, // loopback, link local - kWebAddressSpacePrivate, // Reserved by RFC1918 - kWebAddressSpacePublic, // Everything else - kWebAddressSpaceLast = kWebAddressSpacePublic -}; - -} // namespace blink - -#endif // WebAddressSpace_h
diff --git a/third_party/WebKit/public/platform/WebCoalescedInputEvent.h b/third_party/WebKit/public/platform/WebCoalescedInputEvent.h index ee7e7996..5ce9263e 100644 --- a/third_party/WebKit/public/platform/WebCoalescedInputEvent.h +++ b/third_party/WebKit/public/platform/WebCoalescedInputEvent.h
@@ -7,6 +7,7 @@ #include "WebCommon.h" #include "WebInputEvent.h" +#include "WebPointerEvent.h" #include <memory> #include <vector> @@ -20,6 +21,8 @@ explicit WebCoalescedInputEvent(const WebInputEvent&); WebCoalescedInputEvent(const WebInputEvent&, const std::vector<const WebInputEvent*>&); + WebCoalescedInputEvent(const WebPointerEvent&, + const std::vector<WebPointerEvent>&); // Copy constructor to deep copy the event. WebCoalescedInputEvent(const WebCoalescedInputEvent&);
diff --git a/third_party/WebKit/public/platform/WebLocalizedString.h b/third_party/WebKit/public/platform/WebLocalizedString.h index e40d6508..e9dbaf2 100644 --- a/third_party/WebKit/public/platform/WebLocalizedString.h +++ b/third_party/WebKit/public/platform/WebLocalizedString.h
@@ -103,7 +103,6 @@ kOverflowMenuCast, kOverflowMenuEnterFullscreen, kOverflowMenuExitFullscreen, - kOverflowMenuStopCast, kOverflowMenuMute, kOverflowMenuUnmute, kOverflowMenuPlay,
diff --git a/third_party/WebKit/public/platform/WebPointerEvent.h b/third_party/WebKit/public/platform/WebPointerEvent.h index 3257701..9cde1c32 100644 --- a/third_party/WebKit/public/platform/WebPointerEvent.h +++ b/third_party/WebKit/public/platform/WebPointerEvent.h
@@ -25,13 +25,24 @@ public: WebPointerEvent() : WebInputEvent(sizeof(WebPointerEvent)), WebPointerProperties(0) {} + WebPointerEvent(WebInputEvent::Type type_param, + WebPointerProperties web_pointer_properties_param, + float width_param, + float height_param) + : WebInputEvent(sizeof(WebPointerEvent)), + WebPointerProperties(web_pointer_properties_param), + width(width_param), + height(height_param) { + SetType(type_param); + } BLINK_PLATFORM_EXPORT WebPointerEvent(const WebTouchEvent&, const WebTouchPoint&); BLINK_PLATFORM_EXPORT WebPointerEvent(WebInputEvent::Type, const WebMouseEvent&); - // Creates a PointerCausedUaAction pointer event. - BLINK_PLATFORM_EXPORT WebPointerEvent(WebPointerProperties::PointerType, - double time_stamp_seconds); + + BLINK_PLATFORM_EXPORT static WebPointerEvent CreatePointerCausesUaActionEvent( + WebPointerProperties::PointerType, + double time_stamp_seconds); // ------------ Touch Point Specific ------------
diff --git a/third_party/WebKit/public/platform/WebPointerProperties.h b/third_party/WebKit/public/platform/WebPointerProperties.h index 3e4efbb..2f38c8484 100644 --- a/third_party/WebKit/public/platform/WebPointerProperties.h +++ b/third_party/WebKit/public/platform/WebPointerProperties.h
@@ -58,7 +58,9 @@ PointerType pointer_type_param = PointerType::kUnknown, Button button_param = Button::kNoButton, WebFloatPoint position_in_widget = WebFloatPoint(), - WebFloatPoint position_in_screen = WebFloatPoint()) + WebFloatPoint position_in_screen = WebFloatPoint(), + int movement_x = 0, + int movement_y = 0) : id(id_param), force(std::numeric_limits<float>::quiet_NaN()), tilt_x(0), @@ -67,8 +69,8 @@ twist(0), button(button_param), pointer_type(pointer_type_param), - movement_x(0), - movement_y(0), + movement_x(movement_x), + movement_y(movement_y), position_in_widget_(position_in_widget), position_in_screen_(position_in_screen) {}
diff --git a/third_party/WebKit/public/platform/WebRTCConfiguration.h b/third_party/WebKit/public/platform/WebRTCConfiguration.h index 9d60ce7..2e6a3d6 100644 --- a/third_party/WebKit/public/platform/WebRTCConfiguration.h +++ b/third_party/WebKit/public/platform/WebRTCConfiguration.h
@@ -54,6 +54,8 @@ enum class WebRTCRtcpMuxPolicy { kNegotiate, kRequire }; +enum class WebRTCSdpSemantics { kDefault, kPlanB, kUnifiedPlan }; + struct WebRTCConfiguration { WebVector<WebRTCIceServer> ice_servers; WebRTCIceTransportPolicy ice_transport_policy = @@ -62,6 +64,7 @@ WebRTCRtcpMuxPolicy rtcp_mux_policy = WebRTCRtcpMuxPolicy::kRequire; WebVector<std::unique_ptr<WebRTCCertificate>> certificates; int ice_candidate_pool_size = 0; + WebRTCSdpSemantics sdp_semantics = WebRTCSdpSemantics::kDefault; }; } // namespace blink
diff --git a/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h b/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h deleted file mode 100644 index c2c623ac..0000000 --- a/third_party/WebKit/public/platform/WebStorageQuotaCallbacks.h +++ /dev/null
@@ -1,78 +0,0 @@ -/* - * Copyright (C) 2013 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "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 THE COPYRIGHT - * OWNER 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. - */ - -#ifndef WebStorageQuotaCallbacks_h -#define WebStorageQuotaCallbacks_h - -#include "WebCommon.h" -#include "WebPrivatePtr.h" -#include "third_party/WebKit/common/quota/quota_types.mojom-shared.h" - -namespace blink { - -class StorageQuotaCallbacks; - -class WebStorageQuotaCallbacks { - public: - ~WebStorageQuotaCallbacks() { Reset(); } - WebStorageQuotaCallbacks() = default; - WebStorageQuotaCallbacks(const WebStorageQuotaCallbacks& c) { Assign(c); } - WebStorageQuotaCallbacks& operator=(const WebStorageQuotaCallbacks& c) { - Assign(c); - return *this; - } - - BLINK_PLATFORM_EXPORT void Reset(); - BLINK_PLATFORM_EXPORT void Assign(const WebStorageQuotaCallbacks&); - -#if INSIDE_BLINK - BLINK_PLATFORM_EXPORT WebStorageQuotaCallbacks(StorageQuotaCallbacks*); -#endif - - // Callback for Platform::QueryStorageUsageAndQuota. - BLINK_PLATFORM_EXPORT void DidQueryStorageUsageAndQuota( - unsigned long long usage_in_bytes, - unsigned long long quota_in_bytes); - - // Callback for WebFrameClient::RequestStorageQuota. - // This may return a smaller amount of quota than the requested. - BLINK_PLATFORM_EXPORT void DidGrantStorageQuota( - unsigned long long usage_in_bytes, - unsigned long long granted_quota_in_bytes); - - BLINK_PLATFORM_EXPORT void DidFail(mojom::QuotaStatusCode); - - private: - WebPrivatePtr<StorageQuotaCallbacks> private_; -}; - -} // namespace blink - -#endif // WebStorageQuotaCallbacks_h
diff --git a/third_party/WebKit/public/platform/WebVector.h b/third_party/WebKit/public/platform/WebVector.h index beb7b49..d21fa2c 100644 --- a/third_party/WebKit/public/platform/WebVector.h +++ b/third_party/WebKit/public/platform/WebVector.h
@@ -75,8 +75,13 @@ ~WebVector() = default; + // Create an empty vector. + // + // The vector can be populated using reserve() and emplace_back(). + WebVector() = default; + // Create a vector with |size| default-constructed elements. - explicit WebVector(size_t size = 0) : data_(size) {} + explicit WebVector(size_t size) : data_(size) {} template <typename U> WebVector(const U* values, size_t size) : data_(values, values + size) {}
diff --git a/third_party/WebKit/public/platform/WebWorkerFetchContext.h b/third_party/WebKit/public/platform/WebWorkerFetchContext.h index 30cd20a0..0dd49f17 100644 --- a/third_party/WebKit/public/platform/WebWorkerFetchContext.h +++ b/third_party/WebKit/public/platform/WebWorkerFetchContext.h
@@ -57,8 +57,8 @@ virtual WebURL SiteForCookies() const = 0; // Reports the certificate error to the browser process. - virtual void DidRunContentWithCertificateErrors(const WebURL& url) {} - virtual void DidDisplayContentWithCertificateErrors(const WebURL& url) {} + virtual void DidRunContentWithCertificateErrors() {} + virtual void DidDisplayContentWithCertificateErrors() {} // Reports that the security origin has run active content from an insecure // source.
diff --git a/third_party/WebKit/public/platform/address_space.typemap b/third_party/WebKit/public/platform/address_space.typemap deleted file mode 100644 index 9d0047ee..0000000 --- a/third_party/WebKit/public/platform/address_space.typemap +++ /dev/null
@@ -1,9 +0,0 @@ -# Copyright 2017 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. - -mojom = "//third_party/WebKit/public/platform/address_space.mojom" -public_headers = [ "//third_party/WebKit/public/platform/WebAddressSpace.h" ] -traits_headers = - [ "//third_party/WebKit/public/platform/AddressSpaceStructTraits.h" ] -type_mappings = [ "blink.mojom.AddressSpace=::blink::WebAddressSpace" ]
diff --git a/third_party/WebKit/public/platform/modules/locks/lock_manager.mojom b/third_party/WebKit/public/platform/modules/locks/lock_manager.mojom index 8cd5a60f..1029dbf 100644 --- a/third_party/WebKit/public/platform/modules/locks/lock_manager.mojom +++ b/third_party/WebKit/public/platform/modules/locks/lock_manager.mojom
@@ -23,6 +23,16 @@ Abort(string reason); }; +enum LockMode { + SHARED, + EXCLUSIVE +}; + +struct LockInfo { + string name; + LockMode mode; +}; + // Implementation of the proposed "Web Locks API". This provides a "lock" // primitive for coordination of resource usage across window and worker // contexts in a web application. A resource is identified by an abstract @@ -34,18 +44,22 @@ // Proposal: https://github.com/inexorabletash/web-locks interface LockManager { - enum LockMode { - SHARED, - EXCLUSIVE - }; - enum WaitMode { WAIT, NO_WAIT }; + // Request a lock. One of |request|'s methods will be called + // when the lock is granted or if the request fails. If |request|'s + // channel is closed (e.g. due to terminated process) the request + // is removed from the manager's queues, which can unblock later + // requests. RequestLock(string name, LockMode mode, WaitMode wait, LockRequest request); + + // Produces a snapshot of the lock manager's state. Web applications + // can use this for diagnostic purposes. + QueryState() => (array<LockInfo> requested, array<LockInfo> held); };
diff --git a/third_party/WebKit/public/platform/web_feature.mojom b/third_party/WebKit/public/platform/web_feature.mojom index fb53e9261..acbde07 100644 --- a/third_party/WebKit/public/platform/web_feature.mojom +++ b/third_party/WebKit/public/platform/web_feature.mojom
@@ -1828,6 +1828,7 @@ kCSSSelectorWebkitUnknownPseudo = 2319, kFilterAsContainingBlockMayChangeOutput = 2320, kDispatchMouseUpDownEventOnDisabledFormControl = 2321, + kCSSSelectorPseudoMatches = 2322, // 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/WebKit/public/public_typemaps.gni b/third_party/WebKit/public/public_typemaps.gni index f40027c7..b4244c2 100644 --- a/third_party/WebKit/public/public_typemaps.gni +++ b/third_party/WebKit/public/public_typemaps.gni
@@ -4,7 +4,6 @@ # These are typemaps which are shared between Blink public and its embedder. typemaps = [ - "//third_party/WebKit/public/platform/address_space.typemap", "//third_party/WebKit/public/platform/content_security_policy.typemap", "//third_party/WebKit/public/platform/display_mode.typemap", "//third_party/WebKit/public/platform/referrer_policy.typemap",
diff --git a/third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h b/third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h index 2935d26..b78d77d 100644 --- a/third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h +++ b/third_party/WebKit/public/web/WebEmbeddedWorkerStartData.h
@@ -31,11 +31,11 @@ #ifndef WebEmbeddedWorkerStartData_h #define WebEmbeddedWorkerStartData_h -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebContentSecurityPolicy.h" #include "public/platform/WebString.h" #include "public/platform/WebURL.h" #include "public/web/WebSettings.h" +#include "third_party/WebKit/common/net/ip_address_space.mojom-shared.h" namespace blink { @@ -57,7 +57,7 @@ WebString instrumentation_token; WebSettings::V8CacheOptions v8_cache_options; - WebAddressSpace address_space; + mojom::IPAddressSpace address_space; WebEmbeddedWorkerStartData() : pause_after_download_mode(kDontPauseAfterDownload),
diff --git a/third_party/WebKit/public/web/WebFrameClient.h b/third_party/WebKit/public/web/WebFrameClient.h index 81075c1..bab2dbc8 100644 --- a/third_party/WebKit/public/web/WebFrameClient.h +++ b/third_party/WebKit/public/web/WebFrameClient.h
@@ -63,7 +63,6 @@ #include "public/platform/WebSecurityOrigin.h" #include "public/platform/WebSetSinkIdCallbacks.h" #include "public/platform/WebSourceLocation.h" -#include "public/platform/WebStorageQuotaCallbacks.h" #include "public/platform/WebSuddenTerminationDisablerType.h" #include "public/platform/WebURLError.h" #include "public/platform/WebURLLoaderFactory.h" @@ -494,14 +493,8 @@ virtual void SetEffectiveConnectionTypeForTesting( WebEffectiveConnectionType) {} - // Returns whether or not Client LoFi is enabled for the frame (and - // so any image requests may be replaced with a placeholder). - virtual bool IsClientLoFiActiveForFrame() { return false; } - - // Returns whether or not the requested image should be replaced with a - // placeholder as part of the Client Lo-Fi previews feature. - virtual bool ShouldUseClientLoFiForRequest(const WebURLRequest&) { - return false; + virtual WebURLRequest::PreviewsState GetPreviewsStateForFrame() const { + return WebURLRequest::kPreviewsUnspecified; } // This frame tried to navigate its top level frame to the given url without @@ -537,6 +530,7 @@ // These methods allow the client to intercept and overrule editing // operations. virtual void DidChangeSelection(bool is_selection_empty) {} + virtual void DidChangeContents() {} // This method is called in response to handleInputEvent() when the // default action for the current keyboard event is not suppressed by the @@ -628,10 +622,10 @@ // This frame has displayed inactive content (such as an image) from // a connection with certificate errors. - virtual void DidDisplayContentWithCertificateErrors(const WebURL& url) {} + virtual void DidDisplayContentWithCertificateErrors() {} // This frame has run active content (such as a script) from a // connection with certificate errors. - virtual void DidRunContentWithCertificateErrors(const WebURL& url) {} + virtual void DidRunContentWithCertificateErrors() {} // This frame loaded a resource with an otherwise-valid legacy Symantec // certificate that is slated for distrust. Returns true and populates @@ -712,16 +706,17 @@ // Quota --------------------------------------------------------- // Requests a new quota size for the origin's storage. - // |newQuotaInBytes| indicates how much storage space (in bytes) the - // caller expects to need. - // WebStorageQuotaCallbacks::didGrantStorageQuota will be called when - // a new quota is granted. WebStorageQuotaCallbacks::didFail - // is called with an error code otherwise. - // Note that the requesting quota size may not always be granted and - // a smaller amount of quota than requested might be returned. + // |newQuotaInBytes| indicates how much storage space (in bytes) the caller + // expects to need. + // The callback will be called when a new quota is granted, with kOk as the + // status code if successful or with an error code otherwise. + // Note that the requesting quota size may not always be granted and a smaller + // amount of quota than requested might be returned. + using RequestStorageQuotaCallback = + base::OnceCallback<void(mojom::QuotaStatusCode, int64_t, int64_t)>; virtual void RequestStorageQuota(mojom::StorageType, unsigned long long new_quota_in_bytes, - WebStorageQuotaCallbacks) {} + RequestStorageQuotaCallback) {} // MediaStream -----------------------------------------------------
diff --git a/third_party/WebKit/public/web/WebSharedWorker.h b/third_party/WebKit/public/web/WebSharedWorker.h index e0b6831..9fba0ac5 100644 --- a/third_party/WebKit/public/web/WebSharedWorker.h +++ b/third_party/WebKit/public/web/WebSharedWorker.h
@@ -32,9 +32,9 @@ #define WebSharedWorker_h #include "mojo/public/cpp/system/message_pipe.h" -#include "public/platform/WebAddressSpace.h" #include "public/platform/WebCommon.h" #include "public/platform/WebContentSecurityPolicy.h" +#include "third_party/WebKit/common/net/ip_address_space.mojom-shared.h" namespace blink { @@ -56,7 +56,7 @@ const WebString& name, const WebString& content_security_policy, WebContentSecurityPolicyType, - WebAddressSpace, + mojom::IPAddressSpace, const WebString& instrumentation_token, mojo::ScopedMessagePipeHandle content_settings_handle, mojo::ScopedMessagePipeHandle interface_provider) = 0;
diff --git a/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h b/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h index 472b635..5f1fdb50 100644 --- a/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h +++ b/third_party/WebKit/public/web/WebSharedWorkerRepositoryClient.h
@@ -32,8 +32,8 @@ #define WebSharedWorkerRepositoryClient_h #include <memory> -#include "public/platform/WebAddressSpace.h" #include "public/web/shared_worker_creation_context_type.mojom-shared.h" +#include "third_party/WebKit/common/net/ip_address_space.mojom-shared.h" namespace blink { @@ -55,7 +55,7 @@ DocumentID, const WebString& content_security_policy, WebContentSecurityPolicyType, - WebAddressSpace, + mojom::IPAddressSpace, mojom::SharedWorkerCreationContextType, MessagePortChannel, std::unique_ptr<blink::WebSharedWorkerConnectListener>) = 0;
diff --git a/third_party/WebKit/public/web/WebSurroundingText.h b/third_party/WebKit/public/web/WebSurroundingText.h index 450b3cbb..f3536a09 100644 --- a/third_party/WebKit/public/web/WebSurroundingText.h +++ b/third_party/WebKit/public/web/WebSurroundingText.h
@@ -38,23 +38,17 @@ // API. It allows caller to know the text surrounding a point or a range. class WebSurroundingText { public: - BLINK_EXPORT WebSurroundingText(); - - // TODO(xiaochengh): Rename to IsEmpty() to be more intuitive. - BLINK_EXPORT bool IsNull() const; - // Initializes the object with the current selection in a given frame. - // The maximum length of the contents retrieved is defined by maxLength. + // The maximum length of the contents retrieved is defined by max_length. // It does not include the text inside the range. - // TODO(xiaochengh): Merge this funciton into the constructor. - BLINK_EXPORT void InitializeFromCurrentSelection(WebLocalFrame*, - size_t max_length); + BLINK_EXPORT WebSurroundingText(WebLocalFrame*, size_t max_length); #if INSIDE_BLINK - BLINK_EXPORT void InitializeFromRange(const EphemeralRange&, - size_t max_length); + BLINK_EXPORT WebSurroundingText(const EphemeralRange&, size_t max_length); #endif + BLINK_EXPORT bool IsEmpty() const; + // Surrounding text content retrieved. BLINK_EXPORT WebString TextContent() const;
diff --git a/third_party/WebKit/public/web/WebViewClient.h b/third_party/WebKit/public/web/WebViewClient.h index df166cd..06b6c492 100644 --- a/third_party/WebKit/public/web/WebViewClient.h +++ b/third_party/WebKit/public/web/WebViewClient.h
@@ -112,12 +112,6 @@ // in screen coordinates. virtual WebRect RootWindowRect() { return WebRect(); } - // Editing ------------------------------------------------------------- - - // These methods allow the client to intercept and overrule editing - // operations. - virtual void DidChangeContents() {} - // Dialogs ------------------------------------------------------------- // Ask users to choose date/time for the specified parameters. When a user
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp index 0bc3689..f6a2f6b2 100644 --- a/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp +++ b/third_party/android_crazy_linker/src/src/crazy_linker_library_list.cpp
@@ -241,7 +241,7 @@ } } *count = 0; - return NULL; + return static_cast<_Unwind_Ptr>(NULL); } #else // !__arm__ int LibraryList::IteratePhdr(PhdrIterationCallback callback, void* data) {
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_thread.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_thread.cpp index 21e7ac08..acc82fb 100644 --- a/third_party/android_crazy_linker/src/src/crazy_linker_thread.cpp +++ b/third_party/android_crazy_linker/src/src/crazy_linker_thread.cpp
@@ -7,6 +7,7 @@ #include <pthread.h> #include <stdio.h> #include <stdlib.h> +#include <cstring> namespace {
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_util.h b/third_party/android_crazy_linker/src/src/crazy_linker_util.h index 5cf2006..d6ad67cf 100644 --- a/third_party/android_crazy_linker/src/src/crazy_linker_util.h +++ b/third_party/android_crazy_linker/src/src/crazy_linker_util.h
@@ -9,6 +9,8 @@ #include <stdarg.h> #include <stdio.h> #include <unistd.h> +#include <cstdlib> +#include <cstring> namespace crazy {
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_wrappers.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_wrappers.cpp index 6d5a1fb..5dcd6a8 100644 --- a/third_party/android_crazy_linker/src/src/crazy_linker_wrappers.cpp +++ b/third_party/android_crazy_linker/src/src/crazy_linker_wrappers.cpp
@@ -234,7 +234,8 @@ { ScopedGlobalLock lock; LibraryList* list = Globals::GetLibraries(); - _Unwind_Ptr result = list->FindArmExIdx(pc, pcount); + _Unwind_Ptr result = + list->FindArmExIdx(reinterpret_cast<void*>(pc), pcount); if (result) return result; }
diff --git a/third_party/content_shell_fonts/BUILD.gn b/third_party/content_shell_fonts/BUILD.gn index d739d5e..7f3d49e 100644 --- a/third_party/content_shell_fonts/BUILD.gn +++ b/third_party/content_shell_fonts/BUILD.gn
@@ -6,7 +6,9 @@ sources = [ "LICENSE", "content_shell_test_fonts/DejaVuSans.ttf", + "content_shell_test_fonts/Garuda.ttf", "content_shell_test_fonts/Lohit-Devanagari.ttf", + "content_shell_test_fonts/Lohit-Gurmukhi.ttf", "content_shell_test_fonts/Lohit-Tamil.ttf", "content_shell_test_fonts/MuktiNarrow.ttf", "content_shell_test_fonts/NotoSansKhmer-Regular.ttf",
diff --git a/third_party/content_shell_fonts/LICENSE b/third_party/content_shell_fonts/LICENSE index 9d5ca60..9b24d45 100644 --- a/third_party/content_shell_fonts/LICENSE +++ b/third_party/content_shell_fonts/LICENSE
@@ -1,6 +1,7 @@ The SIL OPEN FONT LICENSE applies to the following files: -Lohit-Tamil.ttf Lohit-Devanagari.ttf +Lohit-Gurmukhi.ttf +Lohit-Tamil.ttf Copyright 2011-13 Lohit Fonts Project contributors @@ -101,6 +102,7 @@ -------------------------------------------------------------------------------- The GPL v2 license applies to the following files +Garuda.ttf MuktiNarrow.ttf GNU GENERAL PUBLIC LICENSE
diff --git a/third_party/content_shell_fonts/README.chromium b/third_party/content_shell_fonts/README.chromium index 4f082633..c4a2718 100644 --- a/third_party/content_shell_fonts/README.chromium +++ b/third_party/content_shell_fonts/README.chromium
@@ -36,8 +36,10 @@ Font Origins: -Lohit-Tamil.ttf https://pagure.io/lohit -Lohit-Devanagari.ttf https://pagure.io/lohit -MuktiNarrow.ttf http://www.nongnu.org/freebangfont/downloads.html#mukti DejaVuSans.ttf https://dejavu-fonts.github.io/Download.html +Garuda.ttf https://linux.thai.net/projects/fonts-tlwg +Lohit-Devanagari.ttf https://pagure.io/lohit +Lohit-Gurmukhi.ttf https://pagure.io/lohit +Lohit-Tamil.ttf https://pagure.io/lohit +MuktiNarrow.ttf http://www.nongnu.org/freebangfont/downloads.html#mukti NotoSansKhmer-Regular.ttf https://www.google.com/get/noto/#sans-khmr
diff --git a/third_party/content_shell_fonts/content_shell_test_fonts.tar.gz.sha1 b/third_party/content_shell_fonts/content_shell_test_fonts.tar.gz.sha1 index 92ea2dd8..a3773b8 100644 --- a/third_party/content_shell_fonts/content_shell_test_fonts.tar.gz.sha1 +++ b/third_party/content_shell_fonts/content_shell_test_fonts.tar.gz.sha1
@@ -1 +1 @@ -9e03fcd58f35b73a4d008995e7431a06e182c47a \ No newline at end of file +df8105c58d91885e7cf812488a26cdcb6363f187 \ No newline at end of file
diff --git a/third_party/libvpx/README.chromium b/third_party/libvpx/README.chromium index a1d5159..37f8e05 100644 --- a/third_party/libvpx/README.chromium +++ b/third_party/libvpx/README.chromium
@@ -5,9 +5,9 @@ License File: source/libvpx/LICENSE Security Critical: yes -Date: Tuesday December 19 2017 +Date: Thursday December 21 2017 Branch: master -Commit: a2127236ae4742f329e5571d76b84de08cd3b8ea +Commit: 8a4336ed2edea09b67f49828df1f8c526a85a7a6 Description: Contains the sources used to compile libvpx binaries used by Google Chrome and
diff --git a/third_party/libvpx/source/config/vpx_version.h b/third_party/libvpx/source/config/vpx_version.h index 8f44efe1..6518a40 100644 --- a/third_party/libvpx/source/config/vpx_version.h +++ b/third_party/libvpx/source/config/vpx_version.h
@@ -2,7 +2,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 6 #define VERSION_PATCH 1 -#define VERSION_EXTRA "1464-ga2127236a" +#define VERSION_EXTRA "1473-g8a4336ed2" #define VERSION_PACKED ((VERSION_MAJOR<<16)|(VERSION_MINOR<<8)|(VERSION_PATCH)) -#define VERSION_STRING_NOSP "v1.6.1-1464-ga2127236a" -#define VERSION_STRING " v1.6.1-1464-ga2127236a" +#define VERSION_STRING_NOSP "v1.6.1-1473-g8a4336ed2" +#define VERSION_STRING " v1.6.1-1473-g8a4336ed2"
diff --git a/third_party/libvpx/source/config/win/ia32/vpx_config.h b/third_party/libvpx/source/config/win/ia32/vpx_config.h index 22a892e2..a2dfec7 100644 --- a/third_party/libvpx/source/config/win/ia32/vpx_config.h +++ b/third_party/libvpx/source/config/win/ia32/vpx_config.h
@@ -9,7 +9,7 @@ #ifndef VPX_CONFIG_H #define VPX_CONFIG_H #define RESTRICT -#define INLINE __forceinline +#define INLINE __inline #define ARCH_ARM 0 #define ARCH_MIPS 0 #define ARCH_X86 1
diff --git a/third_party/libvpx/source/config/win/x64/vpx_config.h b/third_party/libvpx/source/config/win/x64/vpx_config.h index e2b5f13..c3a567e 100644 --- a/third_party/libvpx/source/config/win/x64/vpx_config.h +++ b/third_party/libvpx/source/config/win/x64/vpx_config.h
@@ -9,7 +9,7 @@ #ifndef VPX_CONFIG_H #define VPX_CONFIG_H #define RESTRICT -#define INLINE __forceinline +#define INLINE __inline #define ARCH_ARM 0 #define ARCH_MIPS 0 #define ARCH_X86 0
diff --git a/third_party/libxml/chromium/roll.py b/third_party/libxml/chromium/roll.py index fa837c8..3ed0bc62 100755 --- a/third_party/libxml/chromium/roll.py +++ b/third_party/libxml/chromium/roll.py
@@ -10,6 +10,7 @@ import shutil import subprocess import sys +import stat import tempfile # How to patch libxml2 in Chromium: @@ -137,8 +138,10 @@ FILES_TO_REMOVE = [ 'src/DOCBparser.c', 'src/HACKING', + 'src/INSTALL', 'src/INSTALL.libxml2', 'src/MAINTAINERS', + 'src/Makefile.in', 'src/Makefile.win', 'src/README.cvs-commits', # This is unneeded "legacy" SAX API, even though we enable SAX1. @@ -150,18 +153,29 @@ 'src/build_glob.py', 'src/c14n.c', 'src/catalog.c', + 'src/compile', + 'src/config.guess', + 'src/config.sub', + 'src/configure', 'src/chvalid.def', 'src/debugXML.c', + 'src/depcomp', 'src/doc', 'src/example', 'src/genChRanges.py', 'src/global.data', + 'src/include/libxml/Makefile.in', 'src/include/libxml/xmlversion.h', 'src/include/libxml/xmlwin32version.h', 'src/include/libxml/xmlwin32version.h.in', + 'src/include/Makefile.in', + 'src/install-sh', 'src/legacy.c', 'src/libxml2.doap', + 'src/ltmain.sh', + 'src/m4', 'src/macos/libxml2.mcp.xml.sit.hqx', + 'src/missing', 'src/optim', 'src/os400', 'src/python', @@ -383,6 +397,8 @@ with WorkingDir(os.path.join(full_path_to_third_party_libxml, 'mac')): subprocess.check_call(['autoreconf', '-i', '../src']) + os.chmod('../src/configure', + os.stat('../src/configure').st_mode | stat.S_IXUSR) subprocess.check_call(['../src/configure'] + XML_CONFIGURE_OPTIONS) sed_in_place('config.h', 's/#define HAVE_RAND_R 1//')
diff --git a/third_party/libxml/src/INSTALL b/third_party/libxml/src/INSTALL deleted file mode 100644 index 2099840..0000000 --- a/third_party/libxml/src/INSTALL +++ /dev/null
@@ -1,370 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, -Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell command `./configure && make && make install' -should configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `<wchar.h>' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf limitation. Until the limitation is lifted, you can use -this workaround: - - CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details.
diff --git a/third_party/libxml/src/Makefile.in b/third_party/libxml/src/Makefile.in deleted file mode 100644 index 509eb5b5..0000000 --- a/third_party/libxml/src/Makefile.in +++ /dev/null
@@ -1,2997 +0,0 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2017 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -check_PROGRAMS = testSchemas$(EXEEXT) testRelax$(EXEEXT) \ - testSAX$(EXEEXT) testHTML$(EXEEXT) testXPath$(EXEEXT) \ - testURI$(EXEEXT) testThreads$(EXEEXT) testC14N$(EXEEXT) \ - testAutomata$(EXEEXT) testRegexp$(EXEEXT) testReader$(EXEEXT) \ - testapi$(EXEEXT) testModule$(EXEEXT) runtest$(EXEEXT) \ - runsuite$(EXEEXT) testchar$(EXEEXT) testdict$(EXEEXT) \ - runxmlconf$(EXEEXT) testrecurse$(EXEEXT) testlimits$(EXEEXT) -bin_PROGRAMS = xmllint$(EXEEXT) xmlcatalog$(EXEEXT) -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = libxml2.spec libxml-2.0.pc \ - libxml-2.0-uninstalled.pc libxml2-config.cmake xml2-config -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ - "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(cmakedir)" \ - "$(DESTDIR)$(confexecdir)" "$(DESTDIR)$(m4datadir)" \ - "$(DESTDIR)$(pkgconfigdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) -am__DEPENDENCIES_1 = -libxml2_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am__libxml2_la_SOURCES_DIST = SAX.c entities.c encoding.c error.c \ - parserInternals.c parser.c tree.c hash.c list.c xmlIO.c \ - xmlmemory.c uri.c valid.c xlink.c HTMLparser.c HTMLtree.c \ - debugXML.c xpath.c xpointer.c xinclude.c nanohttp.c nanoftp.c \ - DOCBparser.c catalog.c globals.c threads.c c14n.c xmlstring.c \ - buf.c xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ - triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \ - xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c xmlmodule.c \ - schematron.c xzlib.c -@WITH_SAX1_SOURCES_TRUE@am__objects_1 = DOCBparser.lo -@WITH_TRIO_SOURCES_TRUE@am__objects_2 = triostr.lo trio.lo -am_libxml2_la_OBJECTS = SAX.lo entities.lo encoding.lo error.lo \ - parserInternals.lo parser.lo tree.lo hash.lo list.lo xmlIO.lo \ - xmlmemory.lo uri.lo valid.lo xlink.lo HTMLparser.lo \ - HTMLtree.lo debugXML.lo xpath.lo xpointer.lo xinclude.lo \ - nanohttp.lo nanoftp.lo $(am__objects_1) catalog.lo globals.lo \ - threads.lo c14n.lo xmlstring.lo buf.lo xmlregexp.lo \ - xmlschemas.lo xmlschemastypes.lo xmlunicode.lo \ - $(am__objects_2) xmlreader.lo relaxng.lo dict.lo SAX2.lo \ - xmlwriter.lo legacy.lo chvalid.lo pattern.lo xmlsave.lo \ - xmlmodule.lo schematron.lo xzlib.lo -libxml2_la_OBJECTS = $(am_libxml2_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libxml2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libxml2_la_LDFLAGS) $(LDFLAGS) -o $@ -testdso_la_LIBADD = -am_testdso_la_OBJECTS = testdso.lo -testdso_la_OBJECTS = $(am_testdso_la_OBJECTS) -testdso_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testdso_la_LDFLAGS) $(LDFLAGS) -o $@ -PROGRAMS = $(bin_PROGRAMS) -am_runsuite_OBJECTS = runsuite.$(OBJEXT) -runsuite_OBJECTS = $(am_runsuite_OBJECTS) -am__DEPENDENCIES_2 = $(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) -runsuite_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(runsuite_LDFLAGS) $(LDFLAGS) -o $@ -am_runtest_OBJECTS = runtest.$(OBJEXT) -runtest_OBJECTS = $(am_runtest_OBJECTS) -runtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(runtest_LDFLAGS) $(LDFLAGS) -o $@ -am_runxmlconf_OBJECTS = runxmlconf.$(OBJEXT) -runxmlconf_OBJECTS = $(am_runxmlconf_OBJECTS) -runxmlconf_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(runxmlconf_LDFLAGS) $(LDFLAGS) -o $@ -am_testAutomata_OBJECTS = testAutomata.$(OBJEXT) -testAutomata_OBJECTS = $(am_testAutomata_OBJECTS) -testAutomata_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testAutomata_LDFLAGS) $(LDFLAGS) -o $@ -am_testC14N_OBJECTS = testC14N.$(OBJEXT) -testC14N_OBJECTS = $(am_testC14N_OBJECTS) -testC14N_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testC14N_LDFLAGS) $(LDFLAGS) -o $@ -am_testHTML_OBJECTS = testHTML.$(OBJEXT) -testHTML_OBJECTS = $(am_testHTML_OBJECTS) -testHTML_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testHTML_LDFLAGS) $(LDFLAGS) -o $@ -am_testModule_OBJECTS = testModule.$(OBJEXT) -testModule_OBJECTS = $(am_testModule_OBJECTS) -testModule_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testModule_LDFLAGS) $(LDFLAGS) -o $@ -am_testReader_OBJECTS = testReader.$(OBJEXT) -testReader_OBJECTS = $(am_testReader_OBJECTS) -testReader_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testReader_LDFLAGS) $(LDFLAGS) -o $@ -am_testRegexp_OBJECTS = testRegexp.$(OBJEXT) -testRegexp_OBJECTS = $(am_testRegexp_OBJECTS) -testRegexp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testRegexp_LDFLAGS) $(LDFLAGS) -o $@ -am_testRelax_OBJECTS = testRelax.$(OBJEXT) -testRelax_OBJECTS = $(am_testRelax_OBJECTS) -testRelax_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testRelax_LDFLAGS) $(LDFLAGS) -o $@ -am_testSAX_OBJECTS = testSAX.$(OBJEXT) -testSAX_OBJECTS = $(am_testSAX_OBJECTS) -testSAX_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testSAX_LDFLAGS) $(LDFLAGS) -o $@ -am_testSchemas_OBJECTS = testSchemas.$(OBJEXT) -testSchemas_OBJECTS = $(am_testSchemas_OBJECTS) -testSchemas_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testSchemas_LDFLAGS) $(LDFLAGS) -o $@ -am__testThreads_SOURCES_DIST = testThreads.c testThreadsWin32.c -@THREADS_W32_FALSE@am_testThreads_OBJECTS = testThreads.$(OBJEXT) -@THREADS_W32_TRUE@am_testThreads_OBJECTS = testThreadsWin32.$(OBJEXT) -testThreads_OBJECTS = $(am_testThreads_OBJECTS) -testThreads_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testThreads_LDFLAGS) $(LDFLAGS) -o $@ -am_testURI_OBJECTS = testURI.$(OBJEXT) -testURI_OBJECTS = $(am_testURI_OBJECTS) -testURI_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testURI_LDFLAGS) $(LDFLAGS) -o $@ -am_testXPath_OBJECTS = testXPath.$(OBJEXT) -testXPath_OBJECTS = $(am_testXPath_OBJECTS) -testXPath_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testXPath_LDFLAGS) $(LDFLAGS) -o $@ -am_testapi_OBJECTS = testapi-testapi.$(OBJEXT) -testapi_OBJECTS = $(am_testapi_OBJECTS) -testapi_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(testapi_CFLAGS) \ - $(CFLAGS) $(testapi_LDFLAGS) $(LDFLAGS) -o $@ -am_testchar_OBJECTS = testchar.$(OBJEXT) -testchar_OBJECTS = $(am_testchar_OBJECTS) -testchar_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testchar_LDFLAGS) $(LDFLAGS) -o $@ -am_testdict_OBJECTS = testdict.$(OBJEXT) -testdict_OBJECTS = $(am_testdict_OBJECTS) -testdict_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testdict_LDFLAGS) $(LDFLAGS) -o $@ -am_testlimits_OBJECTS = testlimits.$(OBJEXT) -testlimits_OBJECTS = $(am_testlimits_OBJECTS) -testlimits_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testlimits_LDFLAGS) $(LDFLAGS) -o $@ -am_testrecurse_OBJECTS = testrecurse.$(OBJEXT) -testrecurse_OBJECTS = $(am_testrecurse_OBJECTS) -testrecurse_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testrecurse_LDFLAGS) $(LDFLAGS) -o $@ -am_xmlcatalog_OBJECTS = xmlcatalog.$(OBJEXT) -xmlcatalog_OBJECTS = $(am_xmlcatalog_OBJECTS) -xmlcatalog_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(xmlcatalog_LDFLAGS) $(LDFLAGS) -o $@ -am_xmllint_OBJECTS = xmllint.$(OBJEXT) -xmllint_OBJECTS = $(am_xmllint_OBJECTS) -xmllint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(xmllint_LDFLAGS) $(LDFLAGS) -o $@ -SCRIPTS = $(bin_SCRIPTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libxml2_la_SOURCES) $(testdso_la_SOURCES) \ - $(runsuite_SOURCES) $(runtest_SOURCES) $(runxmlconf_SOURCES) \ - $(testAutomata_SOURCES) $(testC14N_SOURCES) \ - $(testHTML_SOURCES) $(testModule_SOURCES) \ - $(testReader_SOURCES) $(testRegexp_SOURCES) \ - $(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) \ - $(testThreads_SOURCES) $(testURI_SOURCES) $(testXPath_SOURCES) \ - $(testapi_SOURCES) $(testchar_SOURCES) $(testdict_SOURCES) \ - $(testlimits_SOURCES) $(testrecurse_SOURCES) \ - $(xmlcatalog_SOURCES) $(xmllint_SOURCES) -DIST_SOURCES = $(am__libxml2_la_SOURCES_DIST) $(testdso_la_SOURCES) \ - $(runsuite_SOURCES) $(runtest_SOURCES) $(runxmlconf_SOURCES) \ - $(testAutomata_SOURCES) $(testC14N_SOURCES) \ - $(testHTML_SOURCES) $(testModule_SOURCES) \ - $(testReader_SOURCES) $(testRegexp_SOURCES) \ - $(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) \ - $(am__testThreads_SOURCES_DIST) $(testURI_SOURCES) \ - $(testXPath_SOURCES) $(testapi_SOURCES) $(testchar_SOURCES) \ - $(testdict_SOURCES) $(testlimits_SOURCES) \ - $(testrecurse_SOURCES) $(xmlcatalog_SOURCES) \ - $(xmllint_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -man1dir = $(mandir)/man1 -man3dir = $(mandir)/man3 -NROFF = nroff -MANS = $(man_MANS) -DATA = $(cmake_DATA) $(confexec_DATA) $(m4data_DATA) $(pkgconfig_DATA) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/libxml-2.0-uninstalled.pc.in \ - $(srcdir)/libxml-2.0.pc.in $(srcdir)/libxml.spec.in \ - $(srcdir)/libxml2-config.cmake.in $(srcdir)/xml2-config.in \ - AUTHORS COPYING ChangeLog INSTALL NEWS README TODO compile \ - config.guess config.sub depcomp install-sh ltmain.sh missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ -C14N_OBJ = @C14N_OBJ@ -CATALOG_OBJ = @CATALOG_OBJ@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ -CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ -DEBUG_OBJ = @DEBUG_OBJ@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DOCB_OBJ = @DOCB_OBJ@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FTP_OBJ = @FTP_OBJ@ -GREP = @GREP@ -HAVE_ISINF = @HAVE_ISINF@ -HAVE_ISNAN = @HAVE_ISNAN@ -HTML_DIR = @HTML_DIR@ -HTML_OBJ = @HTML_OBJ@ -HTTP_OBJ = @HTTP_OBJ@ -ICONV_LIBS = @ICONV_LIBS@ -ICU_CFLAGS = @ICU_CFLAGS@ -ICU_LIBS = @ICU_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ -LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ -LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ -LIBXML_VERSION = @LIBXML_VERSION@ -LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ -LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ -LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LZMA_CFLAGS = @LZMA_CFLAGS@ -LZMA_LIBS = @LZMA_LIBS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MODULE_EXTENSION = @MODULE_EXTENSION@ -MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PYTHON = @PYTHON@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_TESTS = @PYTHON_TESTS@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RDL_LIBS = @RDL_LIBS@ -READER_TEST = @READER_TEST@ -RELDATE = @RELDATE@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STATIC_BINARIES = @STATIC_BINARIES@ -STRIP = @STRIP@ -TAR = @TAR@ -TEST_C14N = @TEST_C14N@ -TEST_CATALOG = @TEST_CATALOG@ -TEST_DEBUG = @TEST_DEBUG@ -TEST_HTML = @TEST_HTML@ -TEST_MODULES = @TEST_MODULES@ -TEST_PATTERN = @TEST_PATTERN@ -TEST_PHTML = @TEST_PHTML@ -TEST_PUSH = @TEST_PUSH@ -TEST_REGEXPS = @TEST_REGEXPS@ -TEST_SAX = @TEST_SAX@ -TEST_SCHEMAS = @TEST_SCHEMAS@ -TEST_SCHEMATRON = @TEST_SCHEMATRON@ -TEST_THREADS = @TEST_THREADS@ -TEST_VALID = @TEST_VALID@ -TEST_VTIME = @TEST_VTIME@ -TEST_XINCLUDE = @TEST_XINCLUDE@ -TEST_XPATH = @TEST_XPATH@ -TEST_XPTR = @TEST_XPTR@ -THREAD_CFLAGS = @THREAD_CFLAGS@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WGET = @WGET@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@ -WITH_C14N = @WITH_C14N@ -WITH_CATALOG = @WITH_CATALOG@ -WITH_DEBUG = @WITH_DEBUG@ -WITH_DOCB = @WITH_DOCB@ -WITH_FTP = @WITH_FTP@ -WITH_HTML = @WITH_HTML@ -WITH_HTTP = @WITH_HTTP@ -WITH_ICONV = @WITH_ICONV@ -WITH_ICU = @WITH_ICU@ -WITH_ISO8859X = @WITH_ISO8859X@ -WITH_LEGACY = @WITH_LEGACY@ -WITH_LZMA = @WITH_LZMA@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_OUTPUT = @WITH_OUTPUT@ -WITH_PATTERN = @WITH_PATTERN@ -WITH_PUSH = @WITH_PUSH@ -WITH_READER = @WITH_READER@ -WITH_REGEXPS = @WITH_REGEXPS@ -WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ -WITH_SAX1 = @WITH_SAX1@ -WITH_SCHEMAS = @WITH_SCHEMAS@ -WITH_SCHEMATRON = @WITH_SCHEMATRON@ -WITH_THREADS = @WITH_THREADS@ -WITH_THREAD_ALLOC = @WITH_THREAD_ALLOC@ -WITH_TREE = @WITH_TREE@ -WITH_TRIO = @WITH_TRIO@ -WITH_VALID = @WITH_VALID@ -WITH_WRITER = @WITH_WRITER@ -WITH_XINCLUDE = @WITH_XINCLUDE@ -WITH_XPATH = @WITH_XPATH@ -WITH_XPTR = @WITH_XPTR@ -WITH_ZLIB = @WITH_ZLIB@ -XINCLUDE_OBJ = @XINCLUDE_OBJ@ -XMLLINT = @XMLLINT@ -XML_CFLAGS = @XML_CFLAGS@ -XML_INCLUDEDIR = @XML_INCLUDEDIR@ -XML_LIBDIR = @XML_LIBDIR@ -XML_LIBS = @XML_LIBS@ -XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ -XPATH_OBJ = @XPATH_OBJ@ -XPTR_OBJ = @XPTR_OBJ@ -XSLTPROC = @XSLTPROC@ -Z_CFLAGS = @Z_CFLAGS@ -Z_LIBS = @Z_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR) -DIST_SUBDIRS = include . doc example python xstc -AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include -AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS) -bin_SCRIPTS = xml2-config -lib_LTLIBRARIES = libxml2.la -libxml2_la_LIBADD = $(ICU_LIBS) $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) -@USE_VERSION_SCRIPT_FALSE@LIBXML2_VERSION_SCRIPT = -@USE_VERSION_SCRIPT_TRUE@LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms -libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \ - $(LIBXML2_VERSION_SCRIPT) \ - -version-info $(LIBXML_VERSION_INFO) \ - $(MODULE_PLATFORM_LIBS) - -@WITH_SAX1_SOURCES_FALSE@docb_sources = -@WITH_SAX1_SOURCES_TRUE@docb_sources = DOCBparser.c -@WITH_TRIO_SOURCES_FALSE@trio_sources = -@WITH_TRIO_SOURCES_TRUE@trio_sources = triostr.c trio.c -libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ - parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ - valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ - xpointer.c xinclude.c nanohttp.c nanoftp.c \ - $(docb_sources) \ - catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \ - xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ - $(trio_sources) \ - xmlreader.c relaxng.c dict.c SAX2.c \ - xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ - 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) -man_MANS = xml2-config.1 libxml.3 -m4datadir = $(datadir)/aclocal -m4data_DATA = libxml.m4 -runtest_SOURCES = runtest.c -runtest_LDFLAGS = -runtest_DEPENDENCIES = $(DEPS) -runtest_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) -testrecurse_SOURCES = testrecurse.c -testrecurse_LDFLAGS = -testrecurse_DEPENDENCIES = $(DEPS) -testrecurse_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) -testlimits_SOURCES = testlimits.c -testlimits_LDFLAGS = -testlimits_DEPENDENCIES = $(DEPS) -testlimits_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) -testchar_SOURCES = testchar.c -testchar_LDFLAGS = -testchar_DEPENDENCIES = $(DEPS) -testchar_LDADD = $(RDL_LIBS) $(LDADDS) -testdict_SOURCES = testdict.c -testdict_LDFLAGS = -testdict_DEPENDENCIES = $(DEPS) -testdict_LDADD = $(RDL_LIBS) $(LDADDS) -runsuite_SOURCES = runsuite.c -runsuite_LDFLAGS = -runsuite_DEPENDENCIES = $(DEPS) -runsuite_LDADD = $(RDL_LIBS) $(LDADDS) -xmllint_SOURCES = xmllint.c -xmllint_LDFLAGS = -xmllint_DEPENDENCIES = $(DEPS) -xmllint_LDADD = $(RDL_LIBS) $(LDADDS) -testSAX_SOURCES = testSAX.c -testSAX_LDFLAGS = -testSAX_DEPENDENCIES = $(DEPS) -testSAX_LDADD = $(LDADDS) -testHTML_SOURCES = testHTML.c -testHTML_LDFLAGS = -testHTML_DEPENDENCIES = $(DEPS) -testHTML_LDADD = $(LDADDS) -xmlcatalog_SOURCES = xmlcatalog.c -xmlcatalog_LDFLAGS = -xmlcatalog_DEPENDENCIES = $(DEPS) -xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) -testXPath_SOURCES = testXPath.c -testXPath_LDFLAGS = -testXPath_DEPENDENCIES = $(DEPS) -testXPath_LDADD = $(LDADDS) -testC14N_SOURCES = testC14N.c -testC14N_LDFLAGS = -testC14N_DEPENDENCIES = $(DEPS) -testC14N_LDADD = $(LDADDS) -@THREADS_W32_FALSE@testThreads_SOURCES = testThreads.c -@THREADS_W32_TRUE@testThreads_SOURCES = testThreadsWin32.c -testThreads_LDFLAGS = -testThreads_DEPENDENCIES = $(DEPS) -testThreads_LDADD = $(BASE_THREAD_LIBS) $(LDADDS) -testURI_SOURCES = testURI.c -testURI_LDFLAGS = -testURI_DEPENDENCIES = $(DEPS) -testURI_LDADD = $(LDADDS) -testRegexp_SOURCES = testRegexp.c -testRegexp_LDFLAGS = -testRegexp_DEPENDENCIES = $(DEPS) -testRegexp_LDADD = $(LDADDS) -testAutomata_SOURCES = testAutomata.c -testAutomata_LDFLAGS = -testAutomata_DEPENDENCIES = $(DEPS) -testAutomata_LDADD = $(LDADDS) -testSchemas_SOURCES = testSchemas.c -testSchemas_LDFLAGS = -testSchemas_DEPENDENCIES = $(DEPS) -testSchemas_LDADD = $(LDADDS) -testRelax_SOURCES = testRelax.c -testRelax_LDFLAGS = -testRelax_DEPENDENCIES = $(DEPS) -testRelax_LDADD = $(LDADDS) -testReader_SOURCES = testReader.c -testReader_LDFLAGS = -testReader_DEPENDENCIES = $(DEPS) -testReader_LDADD = $(LDADDS) -testModule_SOURCES = testModule.c -testModule_LDFLAGS = -testModule_DEPENDENCIES = $(DEPS) -testModule_LDADD = $(LDADDS) -noinst_LTLIBRARIES = testdso.la -testdso_la_SOURCES = testdso.c -testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir) -BUILT_SOURCES = testapi.c -testapi_SOURCES = testapi.c -testapi_LDFLAGS = -testapi_DEPENDENCIES = $(DEPS) -testapi_LDADD = $(LDADDS) -testapi_CFLAGS = -Wno-unused-function -runxmlconf_SOURCES = runxmlconf.c -runxmlconf_LDFLAGS = -runxmlconf_DEPENDENCIES = $(DEPS) -runxmlconf_LDADD = $(LDADDS) -CLEANFILES = runxmlconf.log test.out xml2Conf.sh *.gcda *.gcno *.res -DISTCLEANFILES = COPYING missing.lst -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 \ - check-xsddata-test-suite.py check-xinclude-test-suite.py \ - example/Makefile.am example/gjobread.c example/gjobs.xml \ - $(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 \ - enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ - dbgen.pl dbgenattr.pl regressions.py regressions.xml \ - README.tests Makefile.tests libxml2.syms timsort.h \ - README.zOS \ - $(CVS_EXTRA_DIST) - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libxml-2.0.pc -cmakedir = $(libdir)/cmake/libxml2 -cmake_DATA = libxml2-config.cmake - -# -# Install the tests program sources as examples -# -BASE_DIR = $(datadir)/doc -DOC_MODULE = libxml2-$(VERSION) -EXAMPLES_DIR = $(BASE_DIR)/$(DOC_MODULE)/examples - -# -# Coverage support, largely borrowed from libvirt -# Both binaries comes from the lcov package in Fedora -# -LCOV = /usr/bin/lcov -GENHTML = /usr/bin/genhtml -all: $(BUILT_SOURCES) config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -libxml2.spec: $(top_builddir)/config.status $(srcdir)/libxml.spec.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libxml-2.0.pc: $(top_builddir)/config.status $(srcdir)/libxml-2.0.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libxml-2.0-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/libxml-2.0-uninstalled.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libxml2-config.cmake: $(top_builddir)/config.status $(srcdir)/libxml2-config.cmake.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -xml2-config: $(top_builddir)/config.status $(srcdir)/xml2-config.in - cd $(top_builddir) && $(SHELL) ./config.status $@ - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES) - $(AM_V_CCLD)$(libxml2_la_LINK) -rpath $(libdir) $(libxml2_la_OBJECTS) $(libxml2_la_LIBADD) $(LIBS) - -testdso.la: $(testdso_la_OBJECTS) $(testdso_la_DEPENDENCIES) $(EXTRA_testdso_la_DEPENDENCIES) - $(AM_V_CCLD)$(testdso_la_LINK) $(testdso_la_OBJECTS) $(testdso_la_LIBADD) $(LIBS) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - || test -f $$p1 \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -clean-checkPROGRAMS: - @list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -runsuite$(EXEEXT): $(runsuite_OBJECTS) $(runsuite_DEPENDENCIES) $(EXTRA_runsuite_DEPENDENCIES) - @rm -f runsuite$(EXEEXT) - $(AM_V_CCLD)$(runsuite_LINK) $(runsuite_OBJECTS) $(runsuite_LDADD) $(LIBS) - -runtest$(EXEEXT): $(runtest_OBJECTS) $(runtest_DEPENDENCIES) $(EXTRA_runtest_DEPENDENCIES) - @rm -f runtest$(EXEEXT) - $(AM_V_CCLD)$(runtest_LINK) $(runtest_OBJECTS) $(runtest_LDADD) $(LIBS) - -runxmlconf$(EXEEXT): $(runxmlconf_OBJECTS) $(runxmlconf_DEPENDENCIES) $(EXTRA_runxmlconf_DEPENDENCIES) - @rm -f runxmlconf$(EXEEXT) - $(AM_V_CCLD)$(runxmlconf_LINK) $(runxmlconf_OBJECTS) $(runxmlconf_LDADD) $(LIBS) - -testAutomata$(EXEEXT): $(testAutomata_OBJECTS) $(testAutomata_DEPENDENCIES) $(EXTRA_testAutomata_DEPENDENCIES) - @rm -f testAutomata$(EXEEXT) - $(AM_V_CCLD)$(testAutomata_LINK) $(testAutomata_OBJECTS) $(testAutomata_LDADD) $(LIBS) - -testC14N$(EXEEXT): $(testC14N_OBJECTS) $(testC14N_DEPENDENCIES) $(EXTRA_testC14N_DEPENDENCIES) - @rm -f testC14N$(EXEEXT) - $(AM_V_CCLD)$(testC14N_LINK) $(testC14N_OBJECTS) $(testC14N_LDADD) $(LIBS) - -testHTML$(EXEEXT): $(testHTML_OBJECTS) $(testHTML_DEPENDENCIES) $(EXTRA_testHTML_DEPENDENCIES) - @rm -f testHTML$(EXEEXT) - $(AM_V_CCLD)$(testHTML_LINK) $(testHTML_OBJECTS) $(testHTML_LDADD) $(LIBS) - -testModule$(EXEEXT): $(testModule_OBJECTS) $(testModule_DEPENDENCIES) $(EXTRA_testModule_DEPENDENCIES) - @rm -f testModule$(EXEEXT) - $(AM_V_CCLD)$(testModule_LINK) $(testModule_OBJECTS) $(testModule_LDADD) $(LIBS) - -testReader$(EXEEXT): $(testReader_OBJECTS) $(testReader_DEPENDENCIES) $(EXTRA_testReader_DEPENDENCIES) - @rm -f testReader$(EXEEXT) - $(AM_V_CCLD)$(testReader_LINK) $(testReader_OBJECTS) $(testReader_LDADD) $(LIBS) - -testRegexp$(EXEEXT): $(testRegexp_OBJECTS) $(testRegexp_DEPENDENCIES) $(EXTRA_testRegexp_DEPENDENCIES) - @rm -f testRegexp$(EXEEXT) - $(AM_V_CCLD)$(testRegexp_LINK) $(testRegexp_OBJECTS) $(testRegexp_LDADD) $(LIBS) - -testRelax$(EXEEXT): $(testRelax_OBJECTS) $(testRelax_DEPENDENCIES) $(EXTRA_testRelax_DEPENDENCIES) - @rm -f testRelax$(EXEEXT) - $(AM_V_CCLD)$(testRelax_LINK) $(testRelax_OBJECTS) $(testRelax_LDADD) $(LIBS) - -testSAX$(EXEEXT): $(testSAX_OBJECTS) $(testSAX_DEPENDENCIES) $(EXTRA_testSAX_DEPENDENCIES) - @rm -f testSAX$(EXEEXT) - $(AM_V_CCLD)$(testSAX_LINK) $(testSAX_OBJECTS) $(testSAX_LDADD) $(LIBS) - -testSchemas$(EXEEXT): $(testSchemas_OBJECTS) $(testSchemas_DEPENDENCIES) $(EXTRA_testSchemas_DEPENDENCIES) - @rm -f testSchemas$(EXEEXT) - $(AM_V_CCLD)$(testSchemas_LINK) $(testSchemas_OBJECTS) $(testSchemas_LDADD) $(LIBS) - -testThreads$(EXEEXT): $(testThreads_OBJECTS) $(testThreads_DEPENDENCIES) $(EXTRA_testThreads_DEPENDENCIES) - @rm -f testThreads$(EXEEXT) - $(AM_V_CCLD)$(testThreads_LINK) $(testThreads_OBJECTS) $(testThreads_LDADD) $(LIBS) - -testURI$(EXEEXT): $(testURI_OBJECTS) $(testURI_DEPENDENCIES) $(EXTRA_testURI_DEPENDENCIES) - @rm -f testURI$(EXEEXT) - $(AM_V_CCLD)$(testURI_LINK) $(testURI_OBJECTS) $(testURI_LDADD) $(LIBS) - -testXPath$(EXEEXT): $(testXPath_OBJECTS) $(testXPath_DEPENDENCIES) $(EXTRA_testXPath_DEPENDENCIES) - @rm -f testXPath$(EXEEXT) - $(AM_V_CCLD)$(testXPath_LINK) $(testXPath_OBJECTS) $(testXPath_LDADD) $(LIBS) - -testapi$(EXEEXT): $(testapi_OBJECTS) $(testapi_DEPENDENCIES) $(EXTRA_testapi_DEPENDENCIES) - @rm -f testapi$(EXEEXT) - $(AM_V_CCLD)$(testapi_LINK) $(testapi_OBJECTS) $(testapi_LDADD) $(LIBS) - -testchar$(EXEEXT): $(testchar_OBJECTS) $(testchar_DEPENDENCIES) $(EXTRA_testchar_DEPENDENCIES) - @rm -f testchar$(EXEEXT) - $(AM_V_CCLD)$(testchar_LINK) $(testchar_OBJECTS) $(testchar_LDADD) $(LIBS) - -testdict$(EXEEXT): $(testdict_OBJECTS) $(testdict_DEPENDENCIES) $(EXTRA_testdict_DEPENDENCIES) - @rm -f testdict$(EXEEXT) - $(AM_V_CCLD)$(testdict_LINK) $(testdict_OBJECTS) $(testdict_LDADD) $(LIBS) - -testlimits$(EXEEXT): $(testlimits_OBJECTS) $(testlimits_DEPENDENCIES) $(EXTRA_testlimits_DEPENDENCIES) - @rm -f testlimits$(EXEEXT) - $(AM_V_CCLD)$(testlimits_LINK) $(testlimits_OBJECTS) $(testlimits_LDADD) $(LIBS) - -testrecurse$(EXEEXT): $(testrecurse_OBJECTS) $(testrecurse_DEPENDENCIES) $(EXTRA_testrecurse_DEPENDENCIES) - @rm -f testrecurse$(EXEEXT) - $(AM_V_CCLD)$(testrecurse_LINK) $(testrecurse_OBJECTS) $(testrecurse_LDADD) $(LIBS) - -xmlcatalog$(EXEEXT): $(xmlcatalog_OBJECTS) $(xmlcatalog_DEPENDENCIES) $(EXTRA_xmlcatalog_DEPENDENCIES) - @rm -f xmlcatalog$(EXEEXT) - $(AM_V_CCLD)$(xmlcatalog_LINK) $(xmlcatalog_OBJECTS) $(xmlcatalog_LDADD) $(LIBS) - -xmllint$(EXEEXT): $(xmllint_OBJECTS) $(xmllint_DEPENDENCIES) $(EXTRA_xmllint_DEPENDENCIES) - @rm -f xmllint$(EXEEXT) - $(AM_V_CCLD)$(xmllint_LINK) $(xmllint_OBJECTS) $(xmllint_LDADD) $(LIBS) -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DOCBparser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTMLparser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTMLtree.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAX.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAX2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c14n.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/catalog.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chvalid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugXML.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoding.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entities.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanoftp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanohttp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parserInternals.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pattern.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relaxng.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runsuite.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runxmlconf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schematron.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testAutomata.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testC14N.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testHTML.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testModule.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testReader.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testRegexp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testRelax.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSAX.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSchemas.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testThreads.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testThreadsWin32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testURI.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testXPath.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testapi-testapi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testchar.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdso.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlimits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrecurse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/triostr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uri.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/valid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xinclude.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xlink.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlIO.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlcatalog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmllint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlmemory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlmodule.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlreader.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlregexp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlsave.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlschemas.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlschemastypes.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlstring.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlunicode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwriter.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpath.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpointer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xzlib.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -testapi-testapi.o: testapi.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testapi_CFLAGS) $(CFLAGS) -MT testapi-testapi.o -MD -MP -MF $(DEPDIR)/testapi-testapi.Tpo -c -o testapi-testapi.o `test -f 'testapi.c' || echo '$(srcdir)/'`testapi.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testapi-testapi.Tpo $(DEPDIR)/testapi-testapi.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testapi.c' object='testapi-testapi.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testapi_CFLAGS) $(CFLAGS) -c -o testapi-testapi.o `test -f 'testapi.c' || echo '$(srcdir)/'`testapi.c - -testapi-testapi.obj: testapi.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testapi_CFLAGS) $(CFLAGS) -MT testapi-testapi.obj -MD -MP -MF $(DEPDIR)/testapi-testapi.Tpo -c -o testapi-testapi.obj `if test -f 'testapi.c'; then $(CYGPATH_W) 'testapi.c'; else $(CYGPATH_W) '$(srcdir)/testapi.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/testapi-testapi.Tpo $(DEPDIR)/testapi-testapi.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='testapi.c' object='testapi-testapi.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(testapi_CFLAGS) $(CFLAGS) -c -o testapi-testapi.obj `if test -f 'testapi.c'; then $(CYGPATH_W) 'testapi.c'; else $(CYGPATH_W) '$(srcdir)/testapi.c'; fi` - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt -install-man1: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man1dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.1[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) -install-man3: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man3dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.3[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ - done; } - -uninstall-man3: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man3dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.3[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) -install-cmakeDATA: $(cmake_DATA) - @$(NORMAL_INSTALL) - @list='$(cmake_DATA)'; test -n "$(cmakedir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \ - done - -uninstall-cmakeDATA: - @$(NORMAL_UNINSTALL) - @list='$(cmake_DATA)'; test -n "$(cmakedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir) -install-confexecDATA: $(confexec_DATA) - @$(NORMAL_INSTALL) - @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(confexecdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(confexecdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confexecdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(confexecdir)" || exit $$?; \ - done - -uninstall-confexecDATA: - @$(NORMAL_UNINSTALL) - @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(confexecdir)'; $(am__uninstall_files_from_dir) -install-m4dataDATA: $(m4data_DATA) - @$(NORMAL_INSTALL) - @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(m4datadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(m4datadir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4datadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(m4datadir)" || exit $$?; \ - done - -uninstall-m4dataDATA: - @$(NORMAL_UNINSTALL) - @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(m4datadir)'; $(am__uninstall_files_from_dir) -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ - config.h -install-binPROGRAMS: install-libLTLIBRARIES - -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(confexecdir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-recursive - -clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: install-cmakeDATA install-data-local \ - install-m4dataDATA install-man install-pkgconfigDATA - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-binSCRIPTS \ - install-confexecDATA install-libLTLIBRARIES - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: install-man1 install-man3 - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-cmakeDATA uninstall-confexecDATA \ - uninstall-libLTLIBRARIES uninstall-local uninstall-m4dataDATA \ - uninstall-man uninstall-pkgconfigDATA - -uninstall-man: uninstall-man1 uninstall-man3 - -.MAKE: $(am__recursive_targets) all check check-am install install-am \ - install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-binPROGRAMS \ - clean-checkPROGRAMS clean-cscope clean-generic \ - clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \ - cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ - dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-binSCRIPTS install-cmakeDATA \ - install-confexecDATA install-data install-data-am \ - install-data-local install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-libLTLIBRARIES install-m4dataDATA \ - install-man install-man1 install-man3 install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-cmakeDATA uninstall-confexecDATA \ - uninstall-libLTLIBRARIES uninstall-local uninstall-m4dataDATA \ - uninstall-man uninstall-man1 uninstall-man3 \ - uninstall-pkgconfigDATA - -.PRECIOUS: Makefile - - -# that one forces the rebuild when "make rebuild" is run on doc/ -rebuild_testapi: - -@(if [ "$(PYTHON)" != "" ] ; then \ - $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) - -# that one is just to make sure it is rebuilt if missing -# but adding the dependances generate mess -testapi.c: $(srcdir)/gentest.py - -@(if [ "$(PYTHON)" != "" ] ; then \ - $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) - -#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c -#testOOM_LDFLAGS = -#testOOM_DEPENDENCIES = $(DEPS) -#testOOM_LDADD= $(LDADDS) - -runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \ - testchar$(EXEEXT) testdict$(EXEEXT) runxmlconf$(EXEEXT) - [ -d test ] || $(LN_S) $(srcdir)/test . - [ -d result ] || $(LN_S) $(srcdir)/result . - $(CHECKER) ./runtest$(EXEEXT) && \ - $(CHECKER) ./testrecurse$(EXEEXT) && \ - ASAN_OPTIONS="$$ASAN_OPTIONS:detect_leaks=0" $(CHECKER) ./testapi$(EXEEXT) && \ - $(CHECKER) ./testchar$(EXEEXT) && \ - $(CHECKER) ./testdict$(EXEEXT) && \ - $(CHECKER) ./runxmlconf$(EXEEXT) - @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ - $(MAKE) tests ; fi) - -check: all runtests - -check-valgrind valgrind: all - @echo '## Running the regression tests under Valgrind' - @echo '## Go get a cup of coffee it is gonna take a while ...' - $(MAKE) CHECKER='valgrind -q' runtests - -asan: - @echo '## rebuilding for ASAN' - ./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined" CC="clang" CXX="clang++" --disable-shared ; OptimOff ; $(MAKE) clean ; $(MAKE) - -testall : tests SVGtests SAXtests - -tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES) - @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ - $(MAKE) -s tests ; fi) - @(cd doc/examples ; $(MAKE) -s tests) - -APItests: testapi$(EXEEXT) - @echo "## Running the API regression tests this may take a little while" - -@(ASAN_OPTIONS="$$ASAN_OPTIONS:detect_leaks=0" $(CHECKER) $(top_builddir)/testapi -q) - -HTMLtests : testHTML$(EXEEXT) - @(echo > .memdump) - @echo "## HTML regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name result.$$name ; \ - diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \ - $(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name result2.$$name error.$$name ; \ - fi ; fi ; done) - -HTMLPushtests : testHTML$(EXEEXT) - @echo "## Push HTML regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name result.$$name ; \ - cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \ - cut -b 1-15 error.$$name > errorcut2.$$name; \ - diff -b errorcut.$$name errorcut2.$$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \ - fi ; fi ; done) - @echo "## HTML SAX regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name.sax ; \ - fi ; fi ; done) - @echo "## Push HTML SAX regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name.sax ; \ - fi ; fi ; done) - -XMLtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ;\ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - @echo "## XML regression tests on memory" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --memory $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - diff result.$$name result2.$$name ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -XMLPushtests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML push regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --push $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --push result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -NStests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML Namespaces regression tests" - -@(for i in $(srcdir)/test/namespaces/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/namespaces/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i \ - 2> $(srcdir)/result/namespaces/$$name.err \ - > $(srcdir)/result/namespaces/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/namespaces/$$name result.$$name ; \ - diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## xml:id regression tests" - -@(for i in $(srcdir)/test/xmlid/id_*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/xmlid/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" \ - 2> $(srcdir)/result/xmlid/$$name.err \ - > $(srcdir)/result/xmlid/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/xmlid/$$name result.$$name ; \ - diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Errtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Error cases regression tests" - -@(for i in $(srcdir)/test/errors/*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/errors/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i \ - 2> $(srcdir)/result/errors/$$name.err \ - > $(srcdir)/result/errors/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/errors/$$name result.$$name ; \ - diff $(srcdir)/result/errors/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - @echo "## Error cases regression tests (old 1.0)" - -@(for i in $(srcdir)/test/errors10/*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/errors10/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --oldxml10 $$i \ - 2> $(srcdir)/result/errors10/$$name.err \ - > $(srcdir)/result/errors10/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --oldxml10 $$i 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/errors10/$$name result.$$name ; \ - diff $(srcdir)/result/errors10/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - @echo "## Error cases stream regression tests" - -@(for i in $(srcdir)/test/errors/*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/errors/$$name.str ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --stream $$i \ - 2> $(srcdir)/result/errors/$$name.str \ - > /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/errors/$$name.str error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm error.$$name ; \ - fi ; fi ; done) - -Docbtests : xmllint$(EXEEXT) - -XMLenttests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML entity subst regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/noent/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noent $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/noent/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -URItests : testURI$(EXEEXT) - @(echo > .memdump) - @echo "## URI module regression tests" - -@(for i in $(srcdir)/test/URI/*.data ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/URI/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/URI/*.uri ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/URI/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -XPathtests : testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## XPath regression tests" - -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \ - then echo Skipping debug not compiled in ; exit 0 ; fi ; \ - for i in $(srcdir)/test/XPath/expr/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; \ - for i in $(srcdir)/test/XPath/docs/* ; do \ - if [ ! -d $$i ] ; then \ - doc=`basename $$i`; \ - for j in $(srcdir)/test/XPath/tests/$$doc* ; do \ - if [ ! -f $$j ] ; then continue ; fi ; \ - name=`basename $$j`; \ - if [ ! -d $$j ] ; then \ - if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; fi ; done) - -XPtrtests : testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## XPointer regression tests" - -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \ - then echo Skipping debug not compiled in ; exit 0 ; fi ; \ - for i in $(srcdir)/test/XPath/docs/* ; do \ - if [ ! -d $$i ] ; then \ - doc=`basename $$i`; \ - for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \ - if [ ! -f $$j ] ; then continue ; fi ; \ - name=`basename $$j`; \ - if [ ! -d $$j ] ; then \ - if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; fi ; done) - -XIncludetests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XInclude regression tests" - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name result.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name result.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - @(echo > .memdump) - @echo "## XInclude xmlReader regression tests" - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Scripttests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Scripts regression tests" - @echo "## Some of the base computations may be different if srcdir != ." - -@(for i in $(srcdir)/test/scripts/*.script ; do \ - name=`basename $$i .script`; \ - xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \ - if [ -f $$xml ] ; then \ - if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/scripts/$$name result.$$name ; \ - diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name result.$$name.err ; \ - fi ; fi ; done) - -Catatests : xmlcatalog$(EXEEXT) - @(echo > .memdump) - @echo "## Catalog regression tests" - -@(for i in $(srcdir)/test/catalogs/*.script ; do \ - name=`basename $$i .script`; \ - xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \ - if [ -f $$xml ] ; then \ - if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/catalogs/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/catalogs/*.script ; do \ - name=`basename $$i .script`; \ - sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \ - if [ -f $$sgml ] ; then \ - if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/catalogs/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Add and del operations on XML Catalogs" - -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - rm -f $(srcdir)/result/catalogs/mycatalog) - -SVGtests : xmllint$(EXEEXT) - @echo "## SVG parsing regression tests" - -@(for i in $(srcdir)/test/SVG/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - echo Testing $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/SVG/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff result.$$name result2.$$name ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -Threadtests : testThreads$(EXEEXT) - @echo "## Threaded regression tests" - -@($(CHECKER) $(top_builddir)/testThreads ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - exit 0) - -Readertests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Reader regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Reader on memory regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @(echo > .memdump) - @echo "## Walker regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Reader entities substitution regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rde ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > $(srcdir)/result/$$name.rde 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rde result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -SAXtests : testSAX$(EXEEXT) - @(echo > .memdump) - @echo "## SAX1 callbacks regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.sax ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.sax result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## SAX2 callbacks regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.sax2 ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testSAX --sax2 $$i > $(srcdir)/result/$$name.sax2 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSAX --sax2 $$i > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.sax2 result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## SAX2 callbacks regression tests with entity substitution" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/noent/$$name.sax2 ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testSAX --sax2 --noent $$i > $(srcdir)/result/noent/$$name.sax2 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSAX --sax2 --noent $$i > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/noent/$$name.sax2 result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -Validtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Valid documents regression tests" - -@(for i in $(srcdir)/test/VCM/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`;\ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - fi ; done ; exit 0) - @echo "## Validity checking regression tests" - -@(for i in $(srcdir)/test/VC/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/VC/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/VC/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## General documents valid regression tests" - -@(for i in $(srcdir)/test/valid/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/valid/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/valid/$$name result.$$name ; \ - diff $(srcdir)/result/valid/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Regexptests: testRegexp$(EXEEXT) - @(echo > .memdump) - @echo "## Regexp regression tests" - -@(for i in $(srcdir)/test/regexp/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/regexp/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Formal expresssions regression tests" - -@(for i in $(srcdir)/test/expr/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/expr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testRegexp --expr -i $$i > $(srcdir)/result/expr/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/expr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -Automatatests: testAutomata$(EXEEXT) - @(echo > .memdump) - @echo "## Automata regression tests" - -@(for i in $(srcdir)/test/automata/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/automata/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/automata/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -dba100000.xml: dbgenattr.pl - @echo "## generating dba100000.xml" - @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml) - -Timingtests: xmllint$(EXEEXT) dba100000.xml - @echo "## Timing tests to try to detect performance" - @echo "## as well a memory usage breakage when streaming" - @echo "## 1/ using the file interface" - @echo "## 2/ using the memory interface" - @echo "## 3/ repeated DOM parsing" - @echo "## 4/ repeated DOM validation" - -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -VTimingtests: xmllint$(EXEEXT) - -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -C14Ntests : testC14N$(EXEEXT) - @echo "## C14N and XPath regression tests" - -@(for m in with-comments without-comments 1-1-without-comments exc-without-comments ; do \ - for i in $(srcdir)/test/c14n/$$m/*.xml ; do \ - if [ ! -d $$i ] ; then \ - name=`basename $$i .xml`; \ - cmdline="$(CHECKER) $(top_builddir)/testC14N --$$m $$i"; \ - if [ -f $(srcdir)/test/c14n/$$m/$$name.xpath ] ; then \ - cmdline="$$cmdline $(srcdir)/test/c14n/$$m/$$name.xpath"; \ - if [ -f $(srcdir)/test/c14n/$$m/$$name.ns ] ; then \ - cmdline="$$cmdline '`cat $(srcdir)/test/c14n/$$m/$$name.ns`'"; \ - fi; \ - fi; \ - $$cmdline > $(srcdir)/test/c14n/test.tmp 2> /dev/null; \ - if [ $$? -eq 0 ]; then \ - diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp; \ - if [ $$? -ne 0 ]; then \ - echo "Test $$m/$$name failed"; \ - cat $(srcdir)/test/c14n/test.tmp; \ - fi; \ - else \ - echo "C14N failed"; \ - fi; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - fi; \ - rm -f $(srcdir)/test/c14n/test.tmp; \ - done; \ - done) - -Schemastests: testSchemas$(EXEEXT) - @(echo > .memdump) - @echo "## Schemas regression tests" - -@(for i in $(srcdir)/test/schemas/*_*.xsd ; do \ - name=`basename $$i | sed 's+_.*++'`; \ - sno=`basename $$i | sed 's+.*_\(.*\).xsd+\1+'`; \ - for j in $(srcdir)/test/schemas/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$sno"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/testSchemas $$i $$j \ - > $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ - 2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSchemas $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err \ - err.$$name;\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo "$$log" ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ;\ - done; done) - -Relaxtests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Relax-NG regression tests" - -@(for i in $(srcdir)/test/relaxng/*.rng ; do \ - name=`basename $$i | sed 's+\.rng++'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_valid ] ; then \ - echo New schemas $$name ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ - > $(srcdir)/result/relaxng/"$$name"_valid \ - 2> $(srcdir)/result/relaxng/"$$name"_err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_valid \ - res.$$name;\ - diff $(srcdir)/result/relaxng/"$$name"_err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo schemas $$name result ; echo "$$log" ; fi ; \ - rm res.$$name err.$$name ; \ - fi; \ - for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - @echo "## Relax-NG streaming regression tests" - -@(for i in $(srcdir)/test/relaxng/*.rng ; do \ - name=`basename $$i | sed 's+\.rng++'`; \ - for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\ - if [ "$$name" != "tutor10_1" -a "$$name" != "tutor10_2" -a "$$name" != "tutor3_2" -a "$$name" != "307377" -a "$$name" != "tutor8_2" ] ; then \ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - fi ; grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - -Schematrontests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Schematron regression tests" - -@(for i in $(srcdir)/test/schematron/*.sct ; do \ - name=`basename $$i | sed 's+\.sct++'`; \ - for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \ - > $(srcdir)/result/schematron/"$$name"_"$$xno" \ - 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/schematron/"$$name"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - -RelaxNGPythonTests: - @(if [ -x $(PYTHON) ] ; then \ - PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \ - export PYTHONPATH; \ - LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ - export LD_LIBRARY_PATH; \ - echo "## Relax-NG Python based test suite 1" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \ - echo "## Relax-NG Python based test suite 2" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \ - fi) - -SchemasPythonTests: - @(if [ -x $(PYTHON) ] ; then \ - PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \ - export PYTHONPATH; \ - LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ - export LD_LIBRARY_PATH; \ - echo "## XML Schemas datatypes Python based test suite" ; \ - echo "## It is normal to see 11 errors reported" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ - fi) - @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi) - -Patterntests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Pattern regression tests" - -@(for i in $(srcdir)/test/pattern/*.pat ; do \ - name=`basename $$i .pat`; \ - if [ -f $(srcdir)/test/pattern/$$name.xml ] ; then \ - if [ ! -f $(srcdir)/result/pattern/$$name ] ; then \ - rm -f result.$$name ; \ - echo New test file $$name ; \ - for pat in `cat $$i` ; do \ - $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml >> $(srcdir)/result/pattern/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - done ;\ - else \ - rm -f result.$$name ; \ - lst=`cat $$i` ; \ - log=`for pat in $$lst ; do $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml 2>&1 >> result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - done ;\ - diff $(srcdir)/result/pattern/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ;) - -ModuleTests: testModule$(EXEEXT) testdso.la - @echo "## Module tests" - @(./testModule$(EXEEXT)) - -cleanup: - -@(find . -name .\#\* -exec rm {} \;) - -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;) - -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;) - -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 -) - -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 - @(rm -rf $(distdir)/xstc/Test) - -cleantar: - @(rm -f libxml*.tar.gz COPYING.LIB) - -rpm: cleanup cleantar - @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz) - -xml2Conf.sh: xml2Conf.sh.in Makefile - sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \ - -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \ - -e 's?\@VERSION\@?$(VERSION)?g' \ - -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \ - < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \ - && mv xml2Conf.tmp xml2Conf.sh - -install-data-local: - $(MKDIR_P) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -$(INSTALL) -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - $(MKDIR_P) $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) - -uninstall-local: - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testHTML.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testSAX.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/xmllint.c - rm -rf $(DESTDIR)$(EXAMPLES_DIR) - rm -f $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)/Copyright - rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -tst: tst.c - $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma - -sparse: clean - $(MAKE) CC=cgcc - -cov: clean-cov - if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \ - echo not configured with coverage; exit 1 ; fi - if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \ - echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi - -@($(MAKE) check) - -@(./runsuite$(EXEEXT)) - mkdir $(top_builddir)/coverage - $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir) - $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr* - rm $(top_builddir)/coverage/libxml2.info.tmp - $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info - echo "Coverage report is in $(top_builddir)/coverage/index.html" - -clean-cov: - rm -rf $(top_builddir)/coverage - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxml/src/compile b/third_party/libxml/src/compile deleted file mode 100755 index 531136b..0000000 --- a/third_party/libxml/src/compile +++ /dev/null
@@ -1,347 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2012-10-14.11; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# Written by Tom Tromey <tromey@cygnus.com>. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to <bug-automake@gnu.org> or send patches to -# <automake-patches@gnu.org>. - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to <bug-automake@gnu.org>. -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
diff --git a/third_party/libxml/src/config.guess b/third_party/libxml/src/config.guess deleted file mode 100755 index b79252d..0000000 --- a/third_party/libxml/src/config.guess +++ /dev/null
@@ -1,1558 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-06-10' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches with a ChangeLog entry to config-patches@gnu.org. - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include <features.h> - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; -esac - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End:
diff --git a/third_party/libxml/src/config.sub b/third_party/libxml/src/config.sub deleted file mode 100755 index 9633db7..0000000 --- a/third_party/libxml/src/config.sub +++ /dev/null
@@ -1,1791 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-08-10' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches with a ChangeLog entry to config-patches@gnu.org. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2013 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or1k-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End:
diff --git a/third_party/libxml/src/configure b/third_party/libxml/src/configure deleted file mode 100755 index 1f9a5a8..0000000 --- a/third_party/libxml/src/configure +++ /dev/null
@@ -1,18900 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 </dev/null -exec 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="entities.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include <stdio.h> -#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#ifdef HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#ifdef STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# ifdef HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#ifdef HAVE_INTTYPES_H -# include <inttypes.h> -#endif -#ifdef HAVE_STDINT_H -# include <stdint.h> -#endif -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -PYTHON_TESTS -RELDATE -RDL_LIBS -M_LIBS -PYTHON_SITE_PACKAGES -PYTHON_INCLUDES -PYTHON_VERSION -HAVE_ISINF -HAVE_ISNAN -XML_INCLUDEDIR -ICONV_LIBS -XML_LIBTOOLLIBS -XML_LIBS -XML_LIBDIR -XML_CFLAGS -CYGWIN_EXTRA_PYTHON_LIBADD -CYGWIN_EXTRA_LDFLAGS -WIN32_EXTRA_PYTHON_LIBADD -WIN32_EXTRA_LDFLAGS -WIN32_EXTRA_LIBADD -WITH_RUN_DEBUG -WITH_MEM_DEBUG -TEST_DEBUG -DEBUG_OBJ -WITH_DEBUG -TEST_REGEXPS -WITH_REGEXPS -TEST_SCHEMAS -WITH_SCHEMAS -WITH_ISO8859X -WITH_ICU -ICU_LIBS -ICU_CFLAGS -WITH_ICONV -WITH_OUTPUT -TEST_XPATH -XPATH_OBJ -WITH_XPATH -TEST_SCHEMATRON -WITH_SCHEMATRON -TEST_XINCLUDE -XINCLUDE_OBJ -WITH_XINCLUDE -TEST_C14N -C14N_OBJ -WITH_C14N -TEST_XPTR -XPTR_OBJ -WITH_XPTR -DOCB_OBJ -WITH_DOCB -TEST_CATALOG -CATALOG_OBJ -WITH_CATALOG -TEST_VTIME -TEST_VALID -WITH_VALID -TEST_PHTML -TEST_HTML -HTML_OBJ -WITH_HTML -TEST_PUSH -WITH_PUSH -TEST_SAX -WITH_SAX1_SOURCES_FALSE -WITH_SAX1_SOURCES_TRUE -WITH_SAX1 -TEST_PATTERN -WITH_PATTERN -WITH_WRITER -READER_TEST -WITH_READER -WITH_LEGACY -HTTP_OBJ -WITH_HTTP -FTP_OBJ -WITH_FTP -WITH_TREE -THREADS_W32_FALSE -THREADS_W32_TRUE -WITH_THREAD_ALLOC -TEST_THREADS -THREAD_CFLAGS -WITH_THREADS -BASE_THREAD_LIBS -THREAD_LIBS -WITH_TRIO -WITH_TRIO_SOURCES_FALSE -WITH_TRIO_SOURCES_TRUE -STATIC_BINARIES -TEST_MODULES -MODULE_EXTENSION -MODULE_PLATFORM_LIBS -WITH_MODULES -PYTHON_LIBS -PYTHON_SUBDIR -pythondir -WITH_PYTHON_FALSE -WITH_PYTHON_TRUE -PYTHON -WITH_LZMA -LZMA_LIBS -LZMA_CFLAGS -WITH_ZLIB -Z_LIBS -Z_CFLAGS -REBUILD_DOCS_FALSE -REBUILD_DOCS_TRUE -HTML_DIR -USE_VERSION_SCRIPT_FALSE -USE_VERSION_SCRIPT_TRUE -VERSION_SCRIPT_FLAGS -LT_SYS_LIBRARY_PATH -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -ac_ct_AR -AR -DLLTOOL -OBJDUMP -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -LIBTOOL -PKG_CONFIG_LIBDIR -PKG_CONFIG_PATH -PKG_CONFIG -XSLTPROC -XMLLINT -WGET -PERL -TAR -MV -CPP -LN_S -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -LIBXML_VERSION_EXTRA -LIBXML_VERSION_NUMBER -LIBXML_VERSION_INFO -LIBXML_VERSION -LIBXML_MICRO_VERSION -LIBXML_MINOR_VERSION -LIBXML_MAJOR_VERSION -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_maintainer_mode -enable_silent_rules -enable_dependency_tracking -enable_shared -enable_static -with_pic -enable_fast_install -with_aix_soname -with_gnu_ld -with_sysroot -enable_libtool_lock -with_c14n -with_catalog -with_debug -with_docbook -with_fexceptions -with_ftp -with_history -with_html -with_html_dir -with_html_subdir -with_http -with_iconv -with_icu -with_iso8859x -with_legacy -with_mem_debug -with_minimum -with_output -with_pattern -with_push -with_python -with_python_install_dir -with_reader -with_readline -with_regexps -with_run_debug -with_sax1 -with_schemas -with_schematron -with_threads -with_thread_alloc -with_tree -with_valid -with_writer -with_xinclude -with_xpath -with_xptr -with_modules -with_zlib -with_lzma -with_coverage -enable_rebuild_docs -enable_ipv6 -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -PKG_CONFIG -PKG_CONFIG_PATH -PKG_CONFIG_LIBDIR -LT_SYS_LIBRARY_PATH -Z_CFLAGS -Z_LIBS -LZMA_CFLAGS -LZMA_LIBS -ICU_CFLAGS -ICU_LIBS' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-maintainer-mode - disable make rules and dependencies not useful (and - sometimes confusing) to the casual installer - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --enable-rebuild-docs[=yes/no] rebuild some generated docs [default=no] - --enable-ipv6[=yes/no] enables compilation of IPv6 code [default=yes] - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-aix-soname=aix|svr4|both - shared library versioning (aka "SONAME") variant to - provide on AIX, [default=aix]. - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot[=DIR] Search for dependent libraries within DIR (or the - compiler's sysroot if not specified). - --with-c14n add the Canonicalization support (on) - --with-catalog add the Catalog support (on) - --with-debug add the debugging module (on) - --with-docbook add Docbook SGML support (on) - --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off) - --with-ftp add the FTP support (on) - --with-history add history support to xmllint shell(off) - --with-html add the HTML support (on) - --with-html-dir=path path to base html directory, default - $datadir/doc/html - --with-html-subdir=path directory used under html-dir, default - $PACKAGE-$VERSION/html - --with-http add the HTTP support (on) - --with-iconv[=DIR] add ICONV support (on) - --with-icu add ICU support (off) - --with-iso8859x add ISO8859X support if no iconv (on) - --with-legacy add deprecated APIs for compatibility (on) - --with-mem-debug add the memory debugging module (off) - --with-minimum build a minimally sized library (off) - --with-output add the serialization support (on) - --with-pattern add the xmlPattern selection interface (on) - --with-push add the PUSH parser interfaces (on) - --with-python[=DIR] build Python bindings if found - --with-python-install-dir=DIR - install Python bindings in DIR - --with-reader add the xmlReader parsing interface (on) - --with-readline=DIR use readline in DIR - --with-regexps add Regular Expressions support (on) - --with-run-debug add the runtime debugging module (off) - --with-sax1 add the older SAX1 interface (on) - --with-schemas add Relax-NG and Schemas support (on) - --with-schematron add Schematron support (on) - --with-threads add multithread support(on) - --with-thread-alloc add per-thread memory(off) - --with-tree add the DOM like tree manipulation APIs (on) - --with-valid add the DTD validation support (on) - --with-writer add the xmlWriter saving interface (on) - --with-xinclude add the XInclude support (on) - --with-xpath add the XPATH support (on) - --with-xptr add the XPointer support (on) - --with-modules add the dynamic modules support (on) - --with-zlib[=DIR] use libz in DIR - --with-lzma[=DIR] use liblzma in DIR - --with-coverage build for code coverage with GCC (off) - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - LIBS libraries to pass to the linker, e.g. -l<library> - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if - you have headers in a nonstandard directory <include dir> - CPP C preprocessor - PKG_CONFIG path to pkg-config utility - PKG_CONFIG_PATH - directories to add to pkg-config's search path - PKG_CONFIG_LIBDIR - path overriding pkg-config's built-in search path - LT_SYS_LIBRARY_PATH - User-defined run-time library search path. - Z_CFLAGS C compiler flags for Z, overriding pkg-config - Z_LIBS linker flags for Z, overriding pkg-config - LZMA_CFLAGS C compiler flags for LZMA, overriding pkg-config - LZMA_LIBS linker flags for LZMA, overriding pkg-config - ICU_CFLAGS C compiler flags for ICU, overriding pkg-config - ICU_LIBS linker flags for ICU, overriding pkg-config - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case <limits.h> declares $2. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_find_uintX_t LINENO BITS VAR -# ------------------------------------ -# Finds an unsigned integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in #( - uint$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_uintX_t -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_config_headers="$ac_config_headers config.h" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=yes -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -LIBXML_MAJOR_VERSION=2 -LIBXML_MINOR_VERSION=9 -LIBXML_MICRO_VERSION=7 -LIBXML_MICRO_VERSION_SUFFIX= -LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX -LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION - -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 - extra=`git describe 2>/dev/null | sed 's+LIBXML[0-9.]*-++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-GIT$extra" - fi -fi -fi -fi - - - - - - - - -VERSION=${LIBXML_VERSION} - -am__api_version='1.15' - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - - PACKAGE=libxml2 - VERSION=$VERSION - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <http://www.gnu.org/software/coreutils/>. - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -# Support silent build rules, requires at least automake-1.11. Disable -# by either passing --disable-silent-rules to configure or passing V=1 -# to make -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=0;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Extract the first word of "mv", so it can be a program name with args. -set dummy mv; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MV in - [\\/]* | ?:[\\/]*) - ac_cv_path_MV="$MV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MV" && ac_cv_path_MV="/bin/mv" - ;; -esac -fi -MV=$ac_cv_path_MV -if test -n "$MV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 -$as_echo "$MV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "tar", so it can be a program name with args. -set dummy tar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="/bin/tar" - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 -$as_echo "$TAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/bin/perl" - ;; -esac -fi -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "wget", so it can be a program name with args. -set dummy wget; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WGET+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $WGET in - [\\/]* | ?:[\\/]*) - ac_cv_path_WGET="$WGET" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="/usr/bin/wget" - ;; -esac -fi -WGET=$ac_cv_path_WGET -if test -n "$WGET"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 -$as_echo "$WGET" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "xmllint", so it can be a program name with args. -set dummy xmllint; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XMLLINT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XMLLINT in - [\\/]* | ?:[\\/]*) - ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XMLLINT" && ac_cv_path_XMLLINT="/usr/bin/xmllint" - ;; -esac -fi -XMLLINT=$ac_cv_path_XMLLINT -if test -n "$XMLLINT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 -$as_echo "$XMLLINT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "xsltproc", so it can be a program name with args. -set dummy xsltproc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XSLTPROC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XSLTPROC in - [\\/]* | ?:[\\/]*) - ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="/usr/bin/xsltproc" - ;; -esac -fi -XSLTPROC=$ac_cv_path_XSLTPROC -if test -n "$XSLTPROC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 -$as_echo "$XSLTPROC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - - - - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi -fi - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.6' -macro_revision='2.4.6' - - - - - - - - - - - - - -ltmain=$ac_aux_dir/ltmain.sh - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in - *GNU* | *'with BFD'*) - test no != "$with_gnu_ld" && break - ;; - *) - test yes != "$with_gnu_ld" && break - ;; - esac - fi - done - IFS=$lt_save_ifs -else - lt_cv_path_LD=$LD # Let the user override the test with a path. -fi -fi - -LD=$lt_cv_path_LD -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM=$NM -else - lt_nm_to_check=${ac_tool_prefix}nm - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty - case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; - *) lt_bad_file=/dev/null ;; - esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in - *$lt_bad_file* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break 2 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break 2 - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS=$lt_save_ifs - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test : != "$DUMPBIN"; then - NM=$DUMPBIN - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring=ABCD - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then - reload_cmds=false - fi - ;; - darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -os2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test 0 -eq "$ac_status"; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test 0 -ne "$ac_status"; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test ia64 = "$host_cpu"; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case $with_sysroot in #( - yes) - if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else - printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -: ${lt_DD:=$DD} -if test -z "$lt_DD"; then - ac_path_lt_DD_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_lt_DD" || continue -if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: -fi - $ac_path_lt_DD_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_lt_DD"; then - : - fi -else - ac_cv_path_lt_DD=$lt_DD -fi - -rm -f conftest.i conftest2.i conftest.out -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else - printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -lt_cv_truncate_bin= -if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" -fi -rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } - - - - - - - -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in $*""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test no = "$enable_libtool_lock" || enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE=32 - ;; - *ELF-64*) - HPUX_IA64_MODE=64 - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test yes != "$lt_cv_cc_needs_belf"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS - fi - ;; -*-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*|x86_64-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks=$enable_libtool_lock - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test yes = "$lt_cv_apple_cc_single_mod"; then - _lt_dar_single_mod='$single_module' - fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' - fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x$2 in - x) - ;; - *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" - ;; - x:*) - eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" - ;; - *) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" - ;; - esac -} - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else - pic_mode=default -fi - - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - shared_archive_member_spec= -case $host,$enable_shared in -power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } - -# Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : - withval=$with_aix_soname; case $withval in - aix|svr4|both) - ;; - *) - as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_with_aix_soname=aix -fi - - with_aix_soname=$lt_cv_with_aix_soname -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } - if test aix != "$with_aix_soname"; then - # For the AIX way of multilib, we name the shared archive member - # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', - # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. - # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, - # the AIX toolchain works better with OBJECT_MODE set (default 32). - if test 64 = "${OBJECT_MODE-32}"; then - shared_archive_member_spec=shr_64 - else - shared_archive_member_spec=shr - fi - fi - ;; -*) - with_aix_soname=aix - ;; -esac - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld=$lt_cv_prog_gnu_ld - -old_CC=$CC -old_CFLAGS=$CFLAGS - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -func_cc_basename $compiler -cc_basename=$func_cc_basename_result - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/${ac_tool_prefix}file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac -fi - -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac -fi - -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC=$CC -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test yes = "$GCC"; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test yes = "$GCC"; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - lt_prog_compiler_pic='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static='$wl-static' - ;; - esac - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static='$wl-static' - ;; - esac - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='$wl-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test yes = "$lt_cv_prog_compiler_pic_works"; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test yes = "$lt_cv_prog_compiler_static_works"; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test yes = "$lt_use_gnu_ld_interface"; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - export_dynamic_flag_spec='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='$wl--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll - archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test linux-dietlibc = "$host_os"; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - tcc*) - export_dynamic_flag_spec='-rdynamic' - ;; - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test no = "$ld_shlibs"; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then - aix_use_runtimelinking=yes - break - fi - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # traditional, no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - hardcode_direct=no - hardcode_direct_absolute=no - ;; - esac - - if test yes = "$GCC"; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - export_dynamic_flag_spec='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' $wl-bernotok' - allow_undefined_flag=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test yes = "$GCC"; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='$wl-E' - ;; - - hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test yes = "$lt_cv_prog_compiler__b"; then - archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - linux*) - case $cc_basename in - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - ld_shlibs=yes - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' - else - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll - archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes - ;; - - osf3*) - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='$wl' - archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test sequent = "$host_vendor"; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='$wl-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='$wl-z,text' - allow_undefined_flag='$wl-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test sni = "$host_vendor"; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='$wl-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test no = "$ld_shlibs" && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test yes = "$GCC"; then - case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([A-Za-z]:\)|\1|g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - - - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a(lib.so.V)' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec=$LIB - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test yes = "$hardcode_automatic"; then - - # We can hardcode non-existent directories. - if test no != "$hardcode_direct" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && - test no != "$hardcode_minus_L"; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test relink = "$hardcode_action" || - test yes = "$inherit_rpath"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test yes != "$enable_dlopen"; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen=load_add_on - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - - lt_cv_dlopen=dyld - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else - enable_dlopen=yes - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS=$LDFLAGS - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS=$LIBS - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test yes = "$cross_compiling"; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test yes = "$lt_cv_dlopen_self"; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test yes = "$cross_compiling"; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC=$lt_save_CC - - - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - -VERSION_SCRIPT_FLAGS= -# lt_cv_prog_gnu_ld is from libtool 2.+ -if test "$lt_cv_prog_gnu_ld" = yes; then - VERSION_SCRIPT_FLAGS=-Wl,--version-script= -else - case $host in - *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";; - esac -fi - - if test -n "$VERSION_SCRIPT_FLAGS"; then - USE_VERSION_SCRIPT_TRUE= - USE_VERSION_SCRIPT_FALSE='#' -else - USE_VERSION_SCRIPT_TRUE='#' - USE_VERSION_SCRIPT_FALSE= -fi - - - -_cppflags="${CPPFLAGS}" -_libs="${LIBS}" - - -# Check whether --with-c14n was given. -if test "${with_c14n+set}" = set; then : - withval=$with_c14n; -fi - - -# Check whether --with-catalog was given. -if test "${with_catalog+set}" = set; then : - withval=$with_catalog; -fi - - -# Check whether --with-debug was given. -if test "${with_debug+set}" = set; then : - withval=$with_debug; -fi - - -# Check whether --with-docbook was given. -if test "${with_docbook+set}" = set; then : - withval=$with_docbook; -fi - - -# Check whether --with-fexceptions was given. -if test "${with_fexceptions+set}" = set; then : - withval=$with_fexceptions; -fi - - -# Check whether --with-ftp was given. -if test "${with_ftp+set}" = set; then : - withval=$with_ftp; -fi - - -# Check whether --with-history was given. -if test "${with_history+set}" = set; then : - withval=$with_history; -fi - - -# Check whether --with-html was given. -if test "${with_html+set}" = set; then : - withval=$with_html; -fi - - -# Check whether --with-html-dir was given. -if test "${with_html_dir+set}" = set; then : - withval=$with_html_dir; HTML_DIR=$withval -else - HTML_DIR='$(datadir)/doc' -fi - - - -# Check whether --with-html-subdir was given. -if test "${with_html_subdir+set}" = set; then : - withval=$with_html_subdir; test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval" -else - HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html" -fi - - - -# Check whether --with-http was given. -if test "${with_http+set}" = set; then : - withval=$with_http; -fi - - -# Check whether --with-iconv was given. -if test "${with_iconv+set}" = set; then : - withval=$with_iconv; -fi - - -# Check whether --with-icu was given. -if test "${with_icu+set}" = set; then : - withval=$with_icu; -fi - - -# Check whether --with-iso8859x was given. -if test "${with_iso8859x+set}" = set; then : - withval=$with_iso8859x; -fi - - -# Check whether --with-legacy was given. -if test "${with_legacy+set}" = set; then : - withval=$with_legacy; -fi - - -# Check whether --with-mem_debug was given. -if test "${with_mem_debug+set}" = set; then : - withval=$with_mem_debug; -fi - - -# Check whether --with-minimum was given. -if test "${with_minimum+set}" = set; then : - withval=$with_minimum; -fi - - -# Check whether --with-output was given. -if test "${with_output+set}" = set; then : - withval=$with_output; -fi - - -# Check whether --with-pattern was given. -if test "${with_pattern+set}" = set; then : - withval=$with_pattern; -fi - - -# Check whether --with-push was given. -if test "${with_push+set}" = set; then : - withval=$with_push; -fi - - -# Check whether --with-python was given. -if test "${with_python+set}" = set; then : - withval=$with_python; -fi - - -# Check whether --with-python_install_dir was given. -if test "${with_python_install_dir+set}" = set; then : - withval=$with_python_install_dir; -fi - - -# Check whether --with-reader was given. -if test "${with_reader+set}" = set; then : - withval=$with_reader; -fi - - -# Check whether --with-readline was given. -if test "${with_readline+set}" = set; then : - withval=$with_readline; - if test "$withval" != "no" -a "$withval" != "yes"; then - RDL_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" - fi - -fi - - -# Check whether --with-regexps was given. -if test "${with_regexps+set}" = set; then : - withval=$with_regexps; -fi - - -# Check whether --with-run_debug was given. -if test "${with_run_debug+set}" = set; then : - withval=$with_run_debug; -fi - - -# Check whether --with-sax1 was given. -if test "${with_sax1+set}" = set; then : - withval=$with_sax1; -fi - - -# Check whether --with-schemas was given. -if test "${with_schemas+set}" = set; then : - withval=$with_schemas; -fi - - -# Check whether --with-schematron was given. -if test "${with_schematron+set}" = set; then : - withval=$with_schematron; -fi - - -# Check whether --with-threads was given. -if test "${with_threads+set}" = set; then : - withval=$with_threads; -fi - - -# Check whether --with-thread-alloc was given. -if test "${with_thread_alloc+set}" = set; then : - withval=$with_thread_alloc; -fi - - -# Check whether --with-tree was given. -if test "${with_tree+set}" = set; then : - withval=$with_tree; -fi - - -# Check whether --with-valid was given. -if test "${with_valid+set}" = set; then : - withval=$with_valid; -fi - - -# Check whether --with-writer was given. -if test "${with_writer+set}" = set; then : - withval=$with_writer; -fi - - -# Check whether --with-xinclude was given. -if test "${with_xinclude+set}" = set; then : - withval=$with_xinclude; -fi - - -# Check whether --with-xpath was given. -if test "${with_xpath+set}" = set; then : - withval=$with_xpath; -fi - - -# Check whether --with-xptr was given. -if test "${with_xptr+set}" = set; then : - withval=$with_xptr; -fi - - -# Check whether --with-modules was given. -if test "${with_modules+set}" = set; then : - withval=$with_modules; -fi - - -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; - if test "$withval" != "no" -a "$withval" != "yes"; then - Z_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" - fi - -fi - - -# Check whether --with-lzma was given. -if test "${with_lzma+set}" = set; then : - withval=$with_lzma; - if test "$withval" != "no" -a "$withval" != "yes"; then - LZMA_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LDFLAGS="${LDFLAGS} -L$withval/lib" - fi - -fi - - -# Check whether --with-coverage was given. -if test "${with_coverage+set}" = set; then : - withval=$with_coverage; -fi - - -# Check whether --enable-rebuild-docs was given. -if test "${enable_rebuild_docs+set}" = set; then : - enableval=$enable_rebuild_docs; -fi - -if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then - as_fn_error $? "cannot rebuild docs when builddir != srcdir" "$LINENO" 5 -fi - if test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"; then - REBUILD_DOCS_TRUE= - REBUILD_DOCS_FALSE='#' -else - REBUILD_DOCS_TRUE='#' - REBUILD_DOCS_FALSE= -fi - - -if test "$with_schemas" = "yes" -then - with_pattern=yes - with_regexps=yes -fi -if test "$with_schematron" = "yes" -then - with_pattern=yes - with_tree=yes - with_xpath=yes -fi -if test "$with_reader" = "yes" -then - with_push=yes -fi -if test "$with_xptr" = "yes" -then - with_xpath=yes -fi -if test "$with_minimum" = "yes" -then - echo "Configuring for a minimal library" - if test "$with_c14n" = "" - then - with_c14n=no - fi - if test "$with_catalog" = "" - then - with_catalog=no - fi - echo So far so good! - if test "$with_debug" = "" - 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 - fi - if test "$with_html" = "" - then - with_html=no - fi - if test "$with_http" = "" - then - with_http=no - fi - if test "$with_iconv" = "" - then - with_iconv=no - fi - if test "$with_iso8859x" = "" - then - with_iso8859x=no - fi - if test "$with_legacy" = "" - then - with_legacy=no - fi - if test "$with_mem_debug" = "" - then - with_mem_debug=no - fi - if test "$with_output" = "" - then - with_output=no - fi - if test "$with_pattern" = "" - then - with_pattern=no - fi - if test "$with_push" = "" - then - with_push=no - fi - if test "$with_python" = "" - then - with_python=no - fi - if test "$with_reader" = "" - then - with_reader=no - fi - if test "$with_readline" = "" - then - with_readline=no - fi - if test "$with_regexps" = "" - then - with_regexps=no - fi - if test "$with_run_debug" = "" - then - with_run_debug=no - fi - if test "$with_sax1" = "" - then - with_sax1=no - fi - if test "$with_schemas" = "" - then - with_schemas=no - fi - if test "$with_schematron" = "" - then - with_schematron=no - fi - if test "$with_threads" = "" - then - with_threads=no - fi - if test "$with_thread_alloc" = "" - then - with_thread_alloc=no - fi - if test "$with_tree" = "" - then - with_tree=no - fi - if test "$with_valid" = "" - then - with_valid=no - fi - if test "$with_writer" = "" - then - with_writer=no - fi - if test "$with_xinclude" = "" - then - with_xinclude=no - fi - if test "$with_xpath" = "" - then - with_xpath=no - fi - if test "$with_xptr" = "" - then - with_xptr=no - fi - if test "$with_zlib" = "" - then - with_zlib=no - fi - if test "$with_modules" = "" - then - with_modules=no - fi -fi - -echo Checking zlib - - -WITH_ZLIB=0 -if test "$with_zlib" = "no"; then - echo "Disabling compression support" -else - # Try pkg-config first so that static linking works. - # If this succeeeds, we ignore the WITH_ZLIB directory. - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib" >&5 -$as_echo_n "checking for zlib... " >&6; } - -if test -n "$Z_CFLAGS"; then - pkg_cv_Z_CFLAGS="$Z_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib\""; } >&5 - ($PKG_CONFIG --exists --print-errors "zlib") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Z_CFLAGS=`$PKG_CONFIG --cflags "zlib" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$Z_LIBS"; then - pkg_cv_Z_LIBS="$Z_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib\""; } >&5 - ($PKG_CONFIG --exists --print-errors "zlib") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Z_LIBS=`$PKG_CONFIG --libs "zlib" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - Z_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib" 2>&1` - else - Z_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$Z_PKG_ERRORS" >&5 - - have_libz=no -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - have_libz=no -else - Z_CFLAGS=$pkg_cv_Z_CFLAGS - Z_LIBS=$pkg_cv_Z_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_libz=yes -fi - - if test "x$have_libz" = "xno"; then - for ac_header in zlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ZLIB_H 1 -_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 -$as_echo_n "checking for gzread in -lz... " >&6; } -if ${ac_cv_lib_z_gzread+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gzread (); -int -main () -{ -return gzread (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_gzread=yes -else - ac_cv_lib_z_gzread=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 -$as_echo "$ac_cv_lib_z_gzread" >&6; } -if test "x$ac_cv_lib_z_gzread" = xyes; then : - - have_libz=yes - if test "x${Z_DIR}" != "x"; then - Z_CFLAGS="-I${Z_DIR}/include" - Z_LIBS="-L${Z_DIR}/lib -lz" - case ${host} in - *-*-solaris*) - Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" - ;; - esac - else - Z_LIBS="-lz" - fi -else - have_libz=no -fi - - -fi - -done - - else - # we still need to check for zlib.h header - for ac_header in zlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ZLIB_H 1 -_ACEOF - -fi - -done - - fi - - # Found the library via either method? - if test "x$have_libz" = "xyes"; then - -$as_echo "#define HAVE_LIBZ 1" >>confdefs.h - - WITH_ZLIB=1 - fi -fi - - - - - -echo Checking lzma - - -WITH_LZMA=0 -if test "$with_lzma" = "no"; then - echo "Disabling compression support" -else - # Try pkg-config first so that static linking works. - # If this succeeeds, we ignore the WITH_LZMA directory. - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for liblzma" >&5 -$as_echo_n "checking for liblzma... " >&6; } - -if test -n "$LZMA_CFLAGS"; then - pkg_cv_LZMA_CFLAGS="$LZMA_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma\""; } >&5 - ($PKG_CONFIG --exists --print-errors "liblzma") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LZMA_CFLAGS=`$PKG_CONFIG --cflags "liblzma" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$LZMA_LIBS"; then - pkg_cv_LZMA_LIBS="$LZMA_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"liblzma\""; } >&5 - ($PKG_CONFIG --exists --print-errors "liblzma") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_LZMA_LIBS=`$PKG_CONFIG --libs "liblzma" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - LZMA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "liblzma" 2>&1` - else - LZMA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "liblzma" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$LZMA_PKG_ERRORS" >&5 - - have_liblzma=no -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - have_liblzma=no -else - LZMA_CFLAGS=$pkg_cv_LZMA_CFLAGS - LZMA_LIBS=$pkg_cv_LZMA_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_liblzma=yes -fi - - # If pkg-config failed, fall back to AC_CHECK_LIB. This - # will not pick up the necessary LIBS flags for liblzma's - # private dependencies, though, so static linking may fail. - if test "x$have_liblzma" = "xno"; then - for ac_header in lzma.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" -if test "x$ac_cv_header_lzma_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LZMA_H 1 -_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_code in -llzma" >&5 -$as_echo_n "checking for lzma_code in -llzma... " >&6; } -if ${ac_cv_lib_lzma_lzma_code+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-llzma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char lzma_code (); -int -main () -{ -return lzma_code (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_lzma_lzma_code=yes -else - ac_cv_lib_lzma_lzma_code=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_code" >&5 -$as_echo "$ac_cv_lib_lzma_lzma_code" >&6; } -if test "x$ac_cv_lib_lzma_lzma_code" = xyes; then : - - have_liblzma=yes - if test "x${LZMA_DIR}" != "x"; then - LZMA_CFLAGS="-I${LZMA_DIR}/include" - LZMA_LIBS="-L${LZMA_DIR}/lib -llzma" - else - LZMA_LIBS="-llzma" - fi -else - have_liblzma=no -fi - - -fi - -done - - else - # we still need to check for lzma,h header - for ac_header in lzma.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" -if test "x$ac_cv_header_lzma_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LZMA_H 1 -_ACEOF - -fi - -done - - fi - - # Found the library via either method? - if test "x$have_liblzma" = "xyes"; then - -$as_echo "#define HAVE_LIBLZMA 1" >>confdefs.h - - WITH_LZMA=1 - fi -fi - - - - - -CPPFLAGS=${_cppflags} -LIBS=${_libs} - -echo Checking headers - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -for ac_header in fcntl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" -if test "x$ac_cv_header_fcntl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FCNTL_H 1 -_ACEOF - -fi - -done - -for ac_header in unistd.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UNISTD_H 1 -_ACEOF - -fi - -done - -for ac_header in ctype.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" -if test "x$ac_cv_header_ctype_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CTYPE_H 1 -_ACEOF - -fi - -done - -for ac_header in dirent.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" -if test "x$ac_cv_header_dirent_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DIRENT_H 1 -_ACEOF - -fi - -done - -for ac_header in errno.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ERRNO_H 1 -_ACEOF - -fi - -done - -for ac_header in malloc.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" -if test "x$ac_cv_header_malloc_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MALLOC_H 1 -_ACEOF - -fi - -done - -for ac_header in stdarg.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" -if test "x$ac_cv_header_stdarg_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDARG_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/stat.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_stat_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_STAT_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/types.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_types_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TYPES_H 1 -_ACEOF - -fi - -done - -for ac_header in stdint.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" -if test "x$ac_cv_header_stdint_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDINT_H 1 -_ACEOF - -fi - -done - -for ac_header in inttypes.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" -if test "x$ac_cv_header_inttypes_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_INTTYPES_H 1 -_ACEOF - -fi - -done - -for ac_header in time.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" -if test "x$ac_cv_header_time_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_TIME_H 1 -_ACEOF - -fi - -done - -for ac_header in ansidecl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ansidecl.h" "ac_cv_header_ansidecl_h" "$ac_includes_default" -if test "x$ac_cv_header_ansidecl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ANSIDECL_H 1 -_ACEOF - -fi - -done - -for ac_header in ieeefp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" -if test "x$ac_cv_header_ieeefp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IEEEFP_H 1 -_ACEOF - -fi - -done - -for ac_header in nan.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "nan.h" "ac_cv_header_nan_h" "$ac_includes_default" -if test "x$ac_cv_header_nan_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NAN_H 1 -_ACEOF - -fi - -done - -for ac_header in math.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" -if test "x$ac_cv_header_math_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MATH_H 1 -_ACEOF - -fi - -done - -for ac_header in limits.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" -if test "x$ac_cv_header_limits_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF - -fi - -done - -for ac_header in fp_class.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "fp_class.h" "ac_cv_header_fp_class_h" "$ac_includes_default" -if test "x$ac_cv_header_fp_class_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FP_CLASS_H 1 -_ACEOF - -fi - -done - -for ac_header in float.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" -if test "x$ac_cv_header_float_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FLOAT_H 1 -_ACEOF - -fi - -done - -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/socket.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "#if HAVE_SYS_TYPES_H -# include <sys/types.h> -# endif - -" -if test "x$ac_cv_header_sys_socket_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SOCKET_H 1 -_ACEOF - -fi - -done - -for ac_header in netinet/in.h -do : - ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "#if HAVE_SYS_TYPES_H -# include <sys/types.h> -# endif - -" -if test "x$ac_cv_header_netinet_in_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NETINET_IN_H 1 -_ACEOF - -fi - -done - -for ac_header in arpa/inet.h -do : - ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "#if HAVE_SYS_TYPES_H -# include <sys/types.h> -# endif -#if HAVE_ARPA_INET_H -# include <arpa/inet.h> -# endif - -" -if test "x$ac_cv_header_arpa_inet_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ARPA_INET_H 1 -_ACEOF - -fi - -done - -for ac_header in netdb.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NETDB_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/time.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIME_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/select.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_select_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SELECT_H 1 -_ACEOF - -fi - -done - -for ac_header in poll.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" -if test "x$ac_cv_header_poll_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_POLL_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/mman.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MMAN_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/timeb.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_timeb_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIMEB_H 1 -_ACEOF - -fi - -done - -for ac_header in signal.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" -if test "x$ac_cv_header_signal_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SIGNAL_H 1 -_ACEOF - -fi - -done - -for ac_header in arpa/nameser.h -do : - ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "#if HAVE_SYS_TYPES_H -# include <sys/types.h> -# endif - -" -if test "x$ac_cv_header_arpa_nameser_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ARPA_NAMESER_H 1 -_ACEOF - -fi - -done - -for ac_header in resolv.h -do : - ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#if HAVE_SYS_TYPES_H -# include <sys/types.h> -# endif -#if HAVE_NETINET_IN_H -# include <netinet/in.h> -# endif -#if HAVE_ARPA_NAMESER_H -# include <arpa/nameser.h> -# endif - -" -if test "x$ac_cv_header_resolv_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_RESOLV_H 1 -_ACEOF - -fi - -done - -for ac_header in dl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" -if test "x$ac_cv_header_dl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DL_H 1 -_ACEOF - -fi - -done - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - -echo Checking types - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - - - -echo Checking libraries - -for ac_func in strftime -do : - ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" -if test "x$ac_cv_func_strftime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRFTIME 1 -_ACEOF - -else - # strftime is in -lintl on SCO UNIX. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 -$as_echo_n "checking for strftime in -lintl... " >&6; } -if ${ac_cv_lib_intl_strftime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char strftime (); -int -main () -{ -return strftime (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_strftime=yes -else - ac_cv_lib_intl_strftime=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 -$as_echo "$ac_cv_lib_intl_strftime" >&6; } -if test "x$ac_cv_lib_intl_strftime" = xyes; then : - $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h - -LIBS="-lintl $LIBS" -fi - -fi -done - -for ac_func in strdup strndup strerror -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in finite isnand fp_class class fpclass -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in strftime localtime gettimeofday ftime -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in stat _stat signal -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in rand rand_r srand time -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in isascii mmap munmap putenv -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 -$as_echo_n "checking for va_copy... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -va_list ap1,ap2; -int -main () -{ -va_copy(ap1,ap2); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have_va_copy=yes -else - have_va_copy=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_va_copy" >&5 -$as_echo "$have_va_copy" >&6; } -if test x"$have_va_copy" = x"yes"; then - -$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5 -$as_echo_n "checking for __va_copy... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> - va_list ap1,ap2; -int -main () -{ -__va_copy(ap1,ap2); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have___va_copy=yes -else - have___va_copy=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have___va_copy" >&5 -$as_echo "$have___va_copy" >&6; } - if test x"$have___va_copy" = x"yes"; then - -$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h - - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether va_list is an array type" >&5 -$as_echo_n "checking whether va_list is an array type... " >&6; } -cat > conftest.$ac_ext <<EOF -#line 14453 "configure" -#include "confdefs.h" - -#include <stdarg.h> -void a(va_list * ap) {} -int main(void) { - -va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1 -; return 0; } -EOF -if { (eval echo configure:14463: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define VA_LIST_IS_ARRAY 1" >>confdefs.h - -fi -rm -f conftest* - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5 -$as_echo_n "checking for library containing gethostent... " >&6; } -if ${ac_cv_search_gethostent+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostent (); -int -main () -{ -return gethostent (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nsl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_gethostent=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_gethostent+:} false; then : - break -fi -done -if ${ac_cv_search_gethostent+:} false; then : - -else - ac_cv_search_gethostent=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5 -$as_echo "$ac_cv_search_gethostent" >&6; } -ac_res=$ac_cv_search_gethostent -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 -$as_echo_n "checking for library containing setsockopt... " >&6; } -if ${ac_cv_search_setsockopt+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char setsockopt (); -int -main () -{ -return setsockopt (); - ; - return 0; -} -_ACEOF -for ac_lib in '' socket net network; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_setsockopt=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_setsockopt+:} false; then : - break -fi -done -if ${ac_cv_search_setsockopt+:} false; then : - -else - ac_cv_search_setsockopt=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 -$as_echo "$ac_cv_search_setsockopt" >&6; } -ac_res=$ac_cv_search_setsockopt -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing connect" >&5 -$as_echo_n "checking for library containing connect... " >&6; } -if ${ac_cv_search_connect+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char connect (); -int -main () -{ -return connect (); - ; - return 0; -} -_ACEOF -for ac_lib in '' inet; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_connect=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_connect+:} false; then : - break -fi -done -if ${ac_cv_search_connect+:} false; then : - -else - ac_cv_search_connect=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_connect" >&5 -$as_echo "$ac_cv_search_connect" >&6; } -ac_res=$ac_cv_search_connect -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of socket length (socklen_t)" >&5 -$as_echo_n "checking for type of socket length (socklen_t)... " >&6; } -cat > conftest.$ac_ext <<EOF -#line 14653 "configure" -#include "confdefs.h" - -#include <stddef.h> -#include <sys/types.h> -#include <sys/socket.h> -int main(void) { - -(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL) -; return 0; } -EOF -if { (eval echo configure:14664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: socklen_t *" >&5 -$as_echo "socklen_t *" >&6; } - XML_SOCKLEN_T=socklen_t -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - cat > conftest.$ac_ext <<EOF -#line 14676 "configure" -#include "confdefs.h" - -#include <stddef.h> -#include <sys/types.h> -#include <sys/socket.h> -int main(void) { - -(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL) -; return 0; } -EOF -if { (eval echo configure:14687: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t *" >&5 -$as_echo "size_t *" >&6; } - XML_SOCKLEN_T=size_t -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - cat > conftest.$ac_ext <<EOF -#line 14699 "configure" -#include "confdefs.h" - -#include <stddef.h> -#include <sys/types.h> -#include <sys/socket.h> -int main(void) { - -(void)getsockopt (1, 1, 1, NULL, (int *)NULL) -; return 0; } -EOF -if { (eval echo configure:14710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: int *" >&5 -$as_echo "int *" >&6; } - XML_SOCKLEN_T=int -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not determine" >&5 -$as_echo "$as_me: WARNING: could not determine" >&2;} - XML_SOCKLEN_T="int" -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - -cat >>confdefs.h <<_ACEOF -#define XML_SOCKLEN_T $XML_SOCKLEN_T -_ACEOF - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for const gethostbyname() argument" >&5 -$as_echo_n "checking for const gethostbyname() argument... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <netdb.h> -int -main () -{ -(void)gethostbyname((const char *)""); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have_gethostbyname_const_arg=yes -else - have_gethostbyname_const_arg=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_gethostbyname_const_arg" >&5 -$as_echo "$have_gethostbyname_const_arg" >&6; } -if test x"$have_gethostbyname_const_arg" = x"yes"; then - -$as_echo "#define GETHOSTBYNAME_ARG_CAST /**/" >>confdefs.h - -else - -$as_echo "#define GETHOSTBYNAME_ARG_CAST (char *)" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for const send() second argument" >&5 -$as_echo_n "checking for const send() second argument... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <sys/socket.h> -int -main () -{ -(void)send(1,(const char *)"",1,1); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have_send_const_arg2=yes -else - have_send_const_arg2=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_send_const_arg2" >&5 -$as_echo "$have_send_const_arg2" >&6; } -if test x"$have_send_const_arg2" = x"yes"; then - -$as_echo "#define SEND_ARG2_CAST /**/" >>confdefs.h - -else - -$as_echo "#define SEND_ARG2_CAST (char *)" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable IPv6" >&5 -$as_echo_n "checking whether to enable IPv6... " >&6; } -# Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then : - enableval=$enable_ipv6; -else - enable_ipv6=yes -fi - -if test "$with_minimum" = "yes" -then - enable_ipv6=no -fi -if test $enable_ipv6 = yes; then - have_ipv6=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include <sys/types.h> -# include <sys/socket.h> - -int -main () -{ - - struct sockaddr_storage ss; - socket(AF_INET6, SOCK_STREAM, 0) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_ipv6=yes -else - have_ipv6=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ipv6" >&5 -$as_echo "$have_ipv6" >&6; } - - if test $have_ipv6 = yes; then - -$as_echo "#define SUPPORT_IP6 /**/" >>confdefs.h - - have_broken_ss_family=no - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr::ss_family" >&5 -$as_echo_n "checking struct sockaddr::ss_family... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include <sys/types.h> -# include <sys/socket.h> - -int -main () -{ - - struct sockaddr_storage ss ; - ss.ss_family = 0 ; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_ss_family=yes -else - have_ss_family=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ss_family" >&5 -$as_echo "$have_ss_family" >&6; } - if test x$have_ss_family = xno ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking broken struct sockaddr::ss_family" >&5 -$as_echo_n "checking broken struct sockaddr::ss_family... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include <sys/types.h> -# include <sys/socket.h> - -int -main () -{ - - struct sockaddr_storage ss ; - ss.__ss_family = 0 ; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_broken_ss_family=yes -else - have_broken_ss_family=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_broken_ss_family" >&5 -$as_echo "$have_broken_ss_family" >&6; } - if test x$have_broken_ss_family = xyes ; then - -$as_echo "#define HAVE_BROKEN_SS_FAMILY /**/" >>confdefs.h - - -$as_echo "#define ss_family __ss_family" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ss_family and __ss_family not found" >&5 -$as_echo "$as_me: WARNING: ss_family and __ss_family not found" >&2;} - fi - fi - - have_getaddrinfo=no - ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" -if test "x$ac_cv_func_getaddrinfo" = xyes; then : - have_getaddrinfo=yes -fi - - if test $have_getaddrinfo != yes; then - for lib in bsd socket inet; do - as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_getaddrinfo" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -l$lib" >&5 -$as_echo_n "checking for getaddrinfo in -l$lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$lib $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getaddrinfo (); -int -main () -{ -return getaddrinfo (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break -fi - - done - fi - - if test $have_getaddrinfo = yes; then - -$as_echo "#define HAVE_GETADDRINFO /**/" >>confdefs.h - - fi - fi -fi - - -ac_fn_c_check_func "$LINENO" "isnan" "ac_cv_func_isnan" -if test "x$ac_cv_func_isnan" = xyes; then : - -$as_echo "#define HAVE_ISNAN /**/" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnan in -lm" >&5 -$as_echo_n "checking for isnan in -lm... " >&6; } -if ${ac_cv_lib_m_isnan+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char isnan (); -int -main () -{ -return isnan (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_isnan=yes -else - ac_cv_lib_m_isnan=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isnan" >&5 -$as_echo "$ac_cv_lib_m_isnan" >&6; } -if test "x$ac_cv_lib_m_isnan" = xyes; then : - -$as_echo "#define HAVE_ISNAN /**/" >>confdefs.h - -fi - -fi - - -ac_fn_c_check_func "$LINENO" "isinf" "ac_cv_func_isinf" -if test "x$ac_cv_func_isinf" = xyes; then : - -$as_echo "#define HAVE_ISINF /**/" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf in -lm" >&5 -$as_echo_n "checking for isinf in -lm... " >&6; } -if ${ac_cv_lib_m_isinf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char isinf (); -int -main () -{ -return isinf (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_isinf=yes -else - ac_cv_lib_m_isinf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isinf" >&5 -$as_echo "$ac_cv_lib_m_isinf" >&6; } -if test "x$ac_cv_lib_m_isinf" = xyes; then : - -$as_echo "#define HAVE_ISINF /**/" >>confdefs.h - -fi - -fi - - -XML_LIBDIR='-L${libdir}' -XML_INCLUDEDIR='-I${includedir}/libxml2' - -XML_CFLAGS="" -RDL_LIBS="" - -if test "${GCC}" != "yes" ; then - case "${host}" in - hppa*-*-hpux* ) - CFLAGS="${CFLAGS} -Wp,-H30000" - ;; - *-dec-osf* ) - CFLAGS="${CFLAGS} -ieee" - ;; - alpha*-*-linux* ) - CFLAGS="${CFLAGS} -ieee" - ;; - esac -else - if test "$with_fexceptions" = "yes" - then - # - # Not activated by default because this inflates the code size - # Used to allow propagation of C++ exceptions through the library - # - CFLAGS="${CFLAGS} -fexceptions" - fi - - # warnings we'd like to see - CFLAGS="${CFLAGS} -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" - # warnings we'd like to supress - CFLAGS="${CFLAGS} -Wno-long-long" - case "${host}" in - alpha*-*-linux* ) - CFLAGS="${CFLAGS} -mieee" - ;; - alpha*-*-osf* ) - CFLAGS="${CFLAGS} -mieee" - ;; - esac -fi -case ${host} in - *-*-solaris*) - XML_LIBDIR="${XML_LIBDIR} -R${libdir}" - ;; - hppa*-hp-mpeix) - NEED_TRIO=1 - ;; - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) - # If the host is Windows, and shared libraries are disabled, we - # need to add -DLIBXML_STATIC to CFLAGS in order for linking to - # work properly (without it, xmlexports.h would force the use of - # DLL imports, which obviously aren't present in a static - # library). - if test "x$enable_shared" = "xno"; then - XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC" - CFLAGS="$CFLAGS -DLIBXML_STATIC" - fi - ;; -esac - - - -PYTHON_VERSION= -PYTHON_INCLUDES= -PYTHON_SITE_PACKAGES= -PYTHON_TESTS= -pythondir= -if test "$with_python" != "no" ; then - if test -x "$with_python/bin/python" - then - echo Found python in $with_python/bin/python - PYTHON="$with_python/bin/python" - else - if test -x "$with_python/python.exe" - then - echo Found python in $with_python/python.exe - PYTHON="$with_python/python.exe" - else - if test -x "$with_python" - then - echo Found python in $with_python - PYTHON="$with_python" - else - if test -x "$PYTHON" - then - echo Found python in environment PYTHON=$PYTHON - with_python=`$PYTHON -c "import sys; print(sys.exec_prefix)"` - else - # Extract the first word of "python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5", so it can be a program name with args. -set dummy python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PYTHON+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -$as_echo "$PYTHON" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi - fi - fi - fi - if test "$PYTHON" != "" - then - PYTHON_VERSION=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_version())"` - PYTHON_INCLUDES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"` -# does not work as it produce a /usr/lib/python path instead of/usr/lib64/python -# -# PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"` - echo Found Python version $PYTHON_VERSION - fi - if test "$PYTHON_VERSION" != "" -a "$PYTHON_INCLUDES" = "" - then - if test -r $with_python/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION - else - if test -r $prefix/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION - else - if test -r /usr/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION - else - if test -r $with_python/include/Python.h - then - PYTHON_INCLUDES=$with_python/include - else - echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h - fi - fi - fi - fi - fi - if test "$with_python_install_dir" != "" - then - PYTHON_SITE_PACKAGES="$with_python_install_dir" - fi - if test "$PYTHON_VERSION" != "" -a "$PYTHON_SITE_PACKAGES" = "" - then - if test -d $libdir/python$PYTHON_VERSION/site-packages - then - PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages - else - if test -d $with_python/lib/site-packages - then - PYTHON_SITE_PACKAGES=$with_python/lib/site-packages - else - PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_lib())"` - fi - fi - fi - pythondir='$(PYTHON_SITE_PACKAGES)' - PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags` -else - PYTHON= -fi - if test "$PYTHON_INCLUDES" != ""; then - WITH_PYTHON_TRUE= - WITH_PYTHON_FALSE='#' -else - WITH_PYTHON_TRUE='#' - WITH_PYTHON_FALSE= -fi - -if test "$PYTHON_INCLUDES" != "" -then - PYTHON_SUBDIR=python -else - PYTHON_SUBDIR= -fi - - - - -WITH_MODULES=0 -TEST_MODULES= - -if test "$with_modules" != "no" ; then - case "$host" in - *-*-cygwin*) - MODULE_EXTENSION=".dll" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lcygwin" >&5 -$as_echo_n "checking for dlopen in -lcygwin... " >&6; } -if ${ac_cv_lib_cygwin_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcygwin $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_cygwin_dlopen=yes -else - ac_cv_lib_cygwin_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cygwin_dlopen" >&5 -$as_echo "$ac_cv_lib_cygwin_dlopen" >&6; } -if test "x$ac_cv_lib_cygwin_dlopen" = xyes; then : - - WITH_MODULES=1 - MODULE_PLATFORM_LIBS= - -$as_echo "#define HAVE_DLOPEN /**/" >>confdefs.h - - -fi - - ;; - *-*-mingw*) - MODULE_EXTENSION=".dll" - WITH_MODULES=1 - ;; - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - libxml_have_shl_load=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - - MODULE_PLATFORM_LIBS="-ldld" - libxml_have_shl_load=yes -else - - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - libxml_have_dlopen=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - - MODULE_PLATFORM_LIBS="-ldl" - libxml_have_dlopen=yes -fi - -fi - -fi - -fi - - - if test "${libxml_have_shl_load}" = "yes"; then - MODULE_EXTENSION=".sl" - WITH_MODULES=1 - -$as_echo "#define HAVE_SHLLOAD /**/" >>confdefs.h - - fi - - if test "${libxml_have_dlopen}" = "yes"; then - case "${host}" in - *-*-hpux* ) - MODULE_EXTENSION=".sl" - ;; - * ) - MODULE_EXTENSION=".so" - ;; - esac - - WITH_MODULES=1 - -$as_echo "#define HAVE_DLOPEN /**/" >>confdefs.h - - fi - ;; - esac -fi - -if test "${WITH_MODULES}" = "1"; then - TEST_MODULES="ModuleTests" -fi - - - - - - - -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 - 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" -else - STATIC_BINARIES= -fi - - - -if test "${NEED_TRIO}" = "1" ; then - echo Adding trio library for string functions - WITH_TRIO=1 -else - WITH_TRIO=0 -fi - if test "${NEED_TRIO}" = "1"; then - WITH_TRIO_SOURCES_TRUE= - WITH_TRIO_SOURCES_FALSE='#' -else - WITH_TRIO_SOURCES_TRUE='#' - WITH_TRIO_SOURCES_FALSE= -fi - - - -echo Checking configuration requirements - -THREAD_LIBS="" -BASE_THREAD_LIBS="" -WITH_THREADS=0 -THREAD_CFLAGS="" -TEST_THREADS="" -THREADS_W32="" -WITH_THREAD_ALLOC=0 - -if test "$with_threads" = "no" ; then - echo Disabling multithreaded support -else - echo Enabling multithreaded support - - case $host_os in - *mingw*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then - WITH_THREADS="1" - THREADS_W32="1" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" - fi - ;; - esac - - if test -z "$THREADS_W32"; then - if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 -$as_echo_n "checking for pthread_join in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_join+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_join (); -int -main () -{ -return pthread_join (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_join=yes -else - ac_cv_lib_pthread_pthread_join=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_join" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_join" >&6; } -if test "x$ac_cv_lib_pthread_pthread_join" = xyes; then : - - THREAD_LIBS="-lpthread" - -$as_echo "#define HAVE_LIBPTHREAD /**/" >>confdefs.h - - -$as_echo "#define HAVE_PTHREAD_H /**/" >>confdefs.h - - WITH_THREADS="1" -fi - -fi - - - fi - fi - - case $host_os in - *cygwin*) THREAD_LIBS="" - ;; - *beos*) WITH_THREADS="1" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" - ;; - *linux*) - if test "${GCC}" = "yes" ; then - GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'` - GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'` - GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[0-9]*\.++' | sed 's+\..*++'` - if test "${THREAD_LIBS}" = "-lpthread" ; then - if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null - then - THREAD_LIBS="" - BASE_THREAD_LIBS="-lpthread" - else - if expr ${GCC_MAJOR} \> 3 > /dev/null - then - THREAD_LIBS="" - BASE_THREAD_LIBS="-lpthread" - else - echo old GCC disabling weak symbols for pthread - fi - fi - fi - fi - ;; - esac - if test "$WITH_THREADS" = "1" ; then - THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" - TEST_THREADS="Threadtests" - fi -fi -if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then - WITH_THREAD_ALLOC=1 -fi - - - - - - - - if test -n "$THREADS_W32"; then - THREADS_W32_TRUE= - THREADS_W32_FALSE='#' -else - THREADS_W32_TRUE='#' - THREADS_W32_FALSE= -fi - - -if test "$with_history" = "yes" ; then - echo Enabling xmllint shell history - unset tcap - for termlib in ncurses curses termcap terminfo termlib; do - as_ac_Lib=`$as_echo "ac_cv_lib_${termlib}''_tputs" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tputs in -l${termlib}" >&5 -$as_echo_n "checking for tputs in -l${termlib}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${termlib} $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tputs (); -int -main () -{ -return tputs (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - tcap="-l$termlib" -fi - - test -n "$tcap" && break - done - - ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_history_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -lhistory" >&5 -$as_echo_n "checking for append_history in -lhistory... " >&6; } -if ${ac_cv_lib_history_append_history+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhistory $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char append_history (); -int -main () -{ -return append_history (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_history_append_history=yes -else - ac_cv_lib_history_append_history=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_history_append_history" >&5 -$as_echo "$ac_cv_lib_history_append_history" >&6; } -if test "x$ac_cv_lib_history_append_history" = xyes; then : - - RDL_LIBS="-lhistory" - -$as_echo "#define HAVE_LIBHISTORY /**/" >>confdefs.h - -fi - -fi - - - ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_readline_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 -$as_echo_n "checking for readline in -lreadline... " >&6; } -if ${ac_cv_lib_readline_readline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lreadline $tcap $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char readline (); -int -main () -{ -return readline (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_readline_readline=yes -else - ac_cv_lib_readline_readline=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 -$as_echo "$ac_cv_lib_readline_readline" >&6; } -if test "x$ac_cv_lib_readline_readline" = xyes; then : - - RDL_LIBS="-lreadline $RDL_LIBS $tcap" - -$as_echo "#define HAVE_LIBREADLINE /**/" >>confdefs.h - -fi - -fi - - - if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then - CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" - RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" - fi -fi - -if test "$with_tree" = "no" ; then - echo Disabling DOM like tree manipulation APIs - WITH_TREE=0 -else - WITH_TREE=1 -fi - - -if test "$with_ftp" = "no" ; then - echo Disabling FTP support - WITH_FTP=0 - FTP_OBJ= -else - WITH_FTP=1 - FTP_OBJ=nanoftp.o -fi - - - -if test "$with_http" = "no" ; then - echo Disabling HTTP support - WITH_HTTP=0 - HTTP_OBJ= -else - WITH_HTTP=1 - HTTP_OBJ=nanohttp.o -fi - - - -if test "$with_legacy" = "no" ; then - echo Disabling deprecated APIs - WITH_LEGACY=0 -else - WITH_LEGACY=1 -fi - - -if test "$with_reader" = "no" ; then - echo Disabling the xmlReader parsing interface - WITH_READER=0 - READER_TEST= -else - WITH_READER=1 - READER_TEST=Readertests - if test "$with_push" = "no" ; then - echo xmlReader requires Push interface - enabling it - with_push=yes - fi -fi - - - -if test "$with_writer" = "no" ; then - echo Disabling the xmlWriter saving interface - WITH_WRITER=0 -# WRITER_TEST= -else - WITH_WRITER=1 -# WRITER_TEST=Writertests - if test "$with_push" = "no" ; then - echo xmlWriter requires Push interface - enabling it - with_push=yes - fi - if test "$with_output" = "no" ; then - echo xmlWriter requires Output interface - enabling it - with_output=yes - fi -fi - -#AC_SUBST(WRITER_TEST) - -if test "$with_pattern" = "no" ; then - echo Disabling the xmlPattern parsing interface - WITH_PATTERN=0 - TEST_PATTERN= -else - WITH_PATTERN=1 - TEST_PATTERN=Patterntests -fi - - - -if test "$with_sax1" = "no" ; then - echo Disabling the older SAX1 interface - WITH_SAX1=0 - TEST_SAX= -else - WITH_SAX1=1 - TEST_SAX=SAXtests -fi - - if test "${WITH_TRIO}" = "1"; then - WITH_SAX1_SOURCES_TRUE= - WITH_SAX1_SOURCES_FALSE='#' -else - WITH_SAX1_SOURCES_TRUE='#' - WITH_SAX1_SOURCES_FALSE= -fi - - - -if test "$with_push" = "no" ; then - echo Disabling the PUSH parser interfaces - WITH_PUSH=0 - TEST_PUSH= -else - WITH_PUSH=1 - TEST_PUSH="XMLPushtests" -fi - - - -if test "$with_html" = "no" ; then - echo Disabling HTML support - WITH_HTML=0 - HTML_OBJ= - TEST_HTML= -else - WITH_HTML=1 - HTML_OBJ="HTMLparser.o HTMLtree.o" - TEST_HTML=HTMLtests - if test "$with_push" != "no" ; then - TEST_PHTML=HTMLPushtests - else - TEST_PHTML= - fi -fi - - - - - -if test "$with_valid" = "no" ; then - echo Disabling DTD validation support - WITH_VALID=0 - TEST_VALID= - TEST_VTIME= -else - WITH_VALID=1 - TEST_VALID=Validtests - TEST_VTIME=VTimingtests -fi - - - - -if test "$with_catalog" = "no" ; then - echo Disabling Catalog support - WITH_CATALOG=0 - CATALOG_OBJ= - TEST_CATALOG= -else - WITH_CATALOG=1 - CATALOG_OBJ="catalog.o" - TEST_CATALOG=Catatests -fi - - - - -if test "$with_docbook" = "no" ; then - echo Disabling Docbook support - WITH_DOCB=0 - DOCB_OBJ= -else - WITH_DOCB=1 - DOCB_OBJ="DOCBparser.o" -fi - - - - -if test "$with_xptr" = "no" ; then - echo Disabling XPointer support - WITH_XPTR=0 - XPTR_OBJ= - TEST_XPTR= -else - WITH_XPTR=1 - XPTR_OBJ=xpointer.o - TEST_XPTR=XPtrtests - if test "$with_xpath" = "no" ; then - echo XPointer requires XPath support - enabling it - with_xpath=yes - fi -fi - - - - -if test "$with_c14n" = "no" ; then - echo Disabling C14N support - WITH_C14N=0 - C14N_OBJ= - TEST_C14N= -else - WITH_C14N=1 - C14N_OBJ="c14n.c" - TEST_C14N=C14Ntests - if test "$with_xpath" = "no" ; then - echo C14N requires XPath support - enabling it - with_xpath=yes - fi -fi - - - - -if test "$with_xinclude" = "no" ; then - echo Disabling XInclude support - WITH_XINCLUDE=0 - XINCLUDE_OBJ= - with_xinclude="no" - TEST_XINCLUDE= -else - WITH_XINCLUDE=1 - XINCLUDE_OBJ=xinclude.o - TEST_XINCLUDE=XIncludetests - if test "$with_xpath" = "no" ; then - echo XInclude requires XPath support - enabling it - with_xpath=yes - fi -fi - - - - -if test "$with_xptr" = "" -a "$with_xpath" = "no" ; then - with_xptr=no -fi - -if test "$with_schematron" = "" -a "$with_xpath" = "no" ; then - with_schematron=no -fi - -if test "$with_schematron" = "no" ; then - echo "Disabling Schematron support" - WITH_SCHEMATRON=0 - TEST_SCHEMATRON= -else - echo "Enabled Schematron support" - WITH_SCHEMATRON=1 - TEST_SCHEMATRON="Schematrontests" - with_xpath=yes - with_pattern=yes - with_schematron=yes -fi - - - -if test "$with_xpath" = "no" ; then - echo Disabling XPATH support - WITH_XPATH=0 - XPATH_OBJ= - TEST_XPATH= -else - WITH_XPATH=1 - XPATH_OBJ=xpath.o - TEST_XPATH=XPathtests -fi - - - - -if test "$with_output" = "no" ; then - echo Disabling serialization/saving support - WITH_OUTPUT=0 -else - WITH_OUTPUT=1 -fi - - -WITH_ICONV=0 -if test "$with_iconv" = "no" ; then - echo Disabling ICONV support -else - if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then - CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" - # Export this since our headers include iconv.h - XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" - ICONV_LIBS="-L$with_iconv/lib" - fi - - ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" -if test "x$ac_cv_header_iconv_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 -$as_echo_n "checking for iconv... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <iconv.h> -int -main () -{ - -iconv_t cd = iconv_open ("",""); -iconv (cd, NULL, NULL, NULL, NULL); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - WITH_ICONV=1 -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 -$as_echo_n "checking for iconv in -liconv... " >&6; } - - _ldflags="${LDFLAGS}" - _libs="${LIBS}" - LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" - LIBS="${LIBS} -liconv" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <iconv.h> -int -main () -{ - -iconv_t cd = iconv_open ("",""); -iconv (cd, NULL, NULL, NULL, NULL); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - WITH_ICONV=1 - ICONV_LIBS="${ICONV_LIBS} -liconv" - LIBS="${_libs}" - LDFLAGS="${_ldflags}" -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LIBS="${_libs}" - LDFLAGS="${_ldflags}" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi - - - - if test "$WITH_ICONV" = "1" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 -$as_echo_n "checking for iconv declaration... " >&6; } - if ${xml_cv_iconv_arg2+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <iconv.h> -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - xml_cv_iconv_arg2="" -else - xml_cv_iconv_arg2="const" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - - xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${xml_xxx:- - }$xml_cv_iconv_decl" >&5 -$as_echo "${xml_xxx:- - }$xml_cv_iconv_decl" >&6; } - -cat >>confdefs.h <<_ACEOF -#define ICONV_CONST $xml_cv_iconv_arg2 -_ACEOF - - fi -fi -case "$host" in - *mingw*) M_LIBS="" - ;; - *beos*) M_LIBS="" - ;; - *haiku*) M_LIBS="" - ;; - *) M_LIBS="-lm" - ;; -esac - - -WITH_ICU=0 -ICU_LIBS="" -if test "$with_icu" != "yes" ; then - echo Disabling ICU support -else - # Try pkg-config first so that static linking works. - # If this succeeeds, we ignore the WITH_ICU directory. - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu-i18n" >&5 -$as_echo_n "checking for icu-i18n... " >&6; } - -if test -n "$ICU_CFLAGS"; then - pkg_cv_ICU_CFLAGS="$ICU_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n\""; } >&5 - ($PKG_CONFIG --exists --print-errors "icu-i18n") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-i18n" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$ICU_LIBS"; then - pkg_cv_ICU_LIBS="$ICU_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-i18n\""; } >&5 - ($PKG_CONFIG --exists --print-errors "icu-i18n") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-i18n" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-i18n" 2>&1` - else - ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-i18n" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$ICU_PKG_ERRORS" >&5 - - have_libicu=no -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - have_libicu=no -else - ICU_CFLAGS=$pkg_cv_ICU_CFLAGS - ICU_LIBS=$pkg_cv_ICU_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_libicu=yes -fi - - # If pkg-config failed, fall back to AC_CHECK_LIB. This - # will not pick up the necessary LIBS flags for liblzma's - # private dependencies, though, so static linking may fail. - if test "x$have_libicu" = "xno"; then - ICU_CONFIG=icu-config - if ${ICU_CONFIG} --cflags >/dev/null 2>&1 - then - ICU_LIBS=`${ICU_CONFIG} --ldflags` - have_libicu=yes - echo Enabling ICU support - 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_fn_c_check_header_mongrel "$LINENO" "unicode/ucnv.h" "ac_cv_header_unicode_ucnv_h" "$ac_includes_default" -if test "x$ac_cv_header_unicode_ucnv_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu" >&5 -$as_echo_n "checking for icu... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <unicode/ucnv.h> -int -main () -{ - - UConverter *utf = ucnv_open("UTF-8", NULL); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_libicu=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for icu in -licucore" >&5 -$as_echo_n "checking for icu in -licucore... " >&6; } - - _ldflags="${LDFLAGS}" - _libs="${LIBS}" - LDFLAGS="${LDFLAGS} ${ICU_LIBS}" - LIBS="${LIBS} -licucore" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <unicode/ucnv.h> -int -main () -{ - - UConverter *utf = ucnv_open("UTF-8", NULL); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_libicu=yes - ICU_LIBS="${ICU_LIBS} -licucore" - LIBS="${_libs}" - LDFLAGS="${_ldflags}" -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LIBS="${_libs}" - LDFLAGS="${_ldflags}" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi - - - fi - fi - - # Found the library via either method? - if test "x$have_libicu" = "xyes"; then - WITH_ICU=1 - fi -fi -XML_LIBS="-lxml2 $Z_LIBS $LZMA_LIBS $THREAD_LIBS $ICONV_LIBS $ICU_LIBS $M_LIBS $LIBS" -XML_LIBTOOLLIBS="libxml2.la" - - -WITH_ISO8859X=1 -if test "$WITH_ICONV" != "1" ; then -if test "$with_iso8859x" = "no" ; then - echo Disabling ISO8859X support - WITH_ISO8859X=0 -fi -fi - - -if test "$with_schemas" = "no" ; then - echo "Disabling Schemas/Relax-NG support" - WITH_SCHEMAS=0 - TEST_SCHEMAS= -else - echo "Enabled Schemas/Relax-NG support" - WITH_SCHEMAS=1 - TEST_SCHEMAS="Schemastests Relaxtests" - if test "$PYTHON_INCLUDES" != "" ; then - PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests" - fi - with_regexps=yes -fi - - - -if test "$with_regexps" = "no" ; then - echo Disabling Regexps support - WITH_REGEXPS=0 - TEST_REGEXPS= -else - WITH_REGEXPS=1 - TEST_REGEXPS="Regexptests Automatatests" -fi - - - -if test "$with_debug" = "no" ; then - echo Disabling DEBUG support - WITH_DEBUG=0 - DEBUG_OBJ= - TEST_DEBUG= -else - WITH_DEBUG=1 - DEBUG_OBJ=debugXML.o - TEST_DEBUG=Scripttests -fi - - - - -if test "$with_mem_debug" = "yes" ; then - if test "$with_thread_alloc" = "yes" ; then - echo Disabling memory debug - cannot use mem-debug with thread-alloc! - WITH_MEM_DEBUG=0 - else - echo Enabling memory debug support - WITH_MEM_DEBUG=1 - fi -else - WITH_MEM_DEBUG=0 -fi - - -if test "$with_run_debug" = "yes" ; then - echo Enabling runtime debug support - WITH_RUN_DEBUG=1 -else - WITH_RUN_DEBUG=0 -fi - - -WIN32_EXTRA_LIBADD= -WIN32_EXTRA_LDFLAGS= -CYGWIN_EXTRA_LDFLAGS= -CYGWIN_EXTRA_PYTHON_LIBADD= -WIN32_EXTRA_PYTHON_LIBADD= -case "$host" in - *-*-mingw*) - CPPFLAGS="$CPPFLAGS -DWIN32" - WIN32_EXTRA_LIBADD="-lws2_32" - WIN32_EXTRA_LDFLAGS="-no-undefined" - if test "${PYTHON}" != "" - then - WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" - fi - ;; - *-*-cygwin*) - CYGWIN_EXTRA_LDFLAGS="-no-undefined" - if test "${PYTHON}" != "" - then - CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" - fi - ;; -esac - - - - - - -for ac_func in printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - NEED_TRIO=1 -fi -done - - -if test "$with_coverage" = "yes" -a "${GCC}" = "yes" -then - echo Enabling code coverage for GCC - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage" -else - echo Disabling code coverage for GCC -fi - - - - - - - - - - - - - - - - - - - - - - - -RELDATE=`date +'%a %b %e %Y'` - - - -rm -f COPYING.LIB COPYING -ln -s $srcdir/Copyright COPYING - -# keep on one line for cygwin c.f. #130896 -ac_config_files="$ac_config_files libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake" - -ac_config_files="$ac_config_files python/setup.py" - -ac_config_files="$ac_config_files xml2-config" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_VERSION_SCRIPT_TRUE}" && test -z "${USE_VERSION_SCRIPT_FALSE}"; then - as_fn_error $? "conditional \"USE_VERSION_SCRIPT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${REBUILD_DOCS_TRUE}" && test -z "${REBUILD_DOCS_FALSE}"; then - as_fn_error $? "conditional \"REBUILD_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_PYTHON_TRUE}" && test -z "${WITH_PYTHON_FALSE}"; then - as_fn_error $? "conditional \"WITH_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_TRIO_SOURCES_TRUE}" && test -z "${WITH_TRIO_SOURCES_FALSE}"; then - as_fn_error $? "conditional \"WITH_TRIO_SOURCES\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${THREADS_W32_TRUE}" && test -z "${THREADS_W32_FALSE}"; then - as_fn_error $? "conditional \"THREADS_W32\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_SAX1_SOURCES_TRUE}" && test -z "${WITH_SAX1_SOURCES_FALSE}"; then - as_fn_error $? "conditional \"WITH_SAX1_SOURCES\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' -configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_import \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -lt_cv_nm_interface \ -nm_file_list_spec \ -lt_cv_truncate_bin \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -configure_time_dlsearch_path \ -configure_time_lt_sys_library_path; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' - -# See if we are running on zsh, and set the options that allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - RM='$RM' - ofile='$ofile' - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "libxml2.spec") CONFIG_FILES="$CONFIG_FILES libxml2.spec:libxml.spec.in" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; - "include/libxml/Makefile") CONFIG_FILES="$CONFIG_FILES include/libxml/Makefile" ;; - "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "doc/examples/Makefile") CONFIG_FILES="$CONFIG_FILES doc/examples/Makefile" ;; - "doc/devhelp/Makefile") CONFIG_FILES="$CONFIG_FILES doc/devhelp/Makefile" ;; - "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;; - "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; - "python/tests/Makefile") CONFIG_FILES="$CONFIG_FILES python/tests/Makefile" ;; - "xstc/Makefile") CONFIG_FILES="$CONFIG_FILES xstc/Makefile" ;; - "include/libxml/xmlversion.h") CONFIG_FILES="$CONFIG_FILES include/libxml/xmlversion.h" ;; - "libxml-2.0.pc") CONFIG_FILES="$CONFIG_FILES libxml-2.0.pc" ;; - "libxml-2.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES libxml-2.0-uninstalled.pc" ;; - "libxml2-config.cmake") CONFIG_FILES="$CONFIG_FILES libxml2-config.cmake" ;; - "python/setup.py") CONFIG_FILES="$CONFIG_FILES python/setup.py" ;; - "xml2-config") CONFIG_FILES="$CONFIG_FILES xml2-config" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' <confdefs.h | sed ' -s/'"$ac_delim"'/"\\\ -"/g' >>$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options that allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST - fi - - cfgfile=${ofile}T - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL -# Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. - -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit, 1996 - -# Copyright (C) 2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program or library that is built -# using GNU Libtool, you may include this file under the same -# distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - - -# The names of the tagged configurations supported by this script. -available_tags='' - -# Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shared archive member basename,for filename based shared library versioning on AIX. -shared_archive_member_spec=$shared_archive_member_spec - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm into a list of symbols to manually relocate. -global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# The name lister interface. -nm_interface=$lt_lt_cv_nm_interface - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and where our libraries should be installed. -lt_sysroot=$lt_sysroot - -# Command to truncate a binary pipe. -lt_truncate_bin=$lt_lt_cv_truncate_bin - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Detected run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path - -# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. -configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# ### END LIBTOOL CONFIG - -_LT_EOF - - cat <<'_LT_EOF' >> "$cfgfile" - -# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE - -# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x$2 in - x) - ;; - *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" - ;; - x:*) - eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" - ;; - *) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" - ;; - esac -} - - -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in $*""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} - - -# ### END FUNCTIONS SHARED WITH CONFIGURE - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain=$ac_aux_dir/ltmain.sh - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - ;; - "python/setup.py":F) chmod +x python/setup.py ;; - "xml2-config":F) chmod +x xml2-config ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - -echo Done configuring
diff --git a/third_party/libxml/src/depcomp b/third_party/libxml/src/depcomp deleted file mode 100755 index 4ebd5b3a..0000000 --- a/third_party/libxml/src/depcomp +++ /dev/null
@@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2013-05-30.07; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to <bug-automake@gnu.org>. -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
diff --git a/third_party/libxml/src/include/Makefile.in b/third_party/libxml/src/include/Makefile.in deleted file mode 100644 index 28114067..0000000 --- a/third_party/libxml/src/include/Makefile.in +++ /dev/null
@@ -1,733 +0,0 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2017 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = include -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - distdir -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ -C14N_OBJ = @C14N_OBJ@ -CATALOG_OBJ = @CATALOG_OBJ@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ -CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ -DEBUG_OBJ = @DEBUG_OBJ@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DOCB_OBJ = @DOCB_OBJ@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FTP_OBJ = @FTP_OBJ@ -GREP = @GREP@ -HAVE_ISINF = @HAVE_ISINF@ -HAVE_ISNAN = @HAVE_ISNAN@ -HTML_DIR = @HTML_DIR@ -HTML_OBJ = @HTML_OBJ@ -HTTP_OBJ = @HTTP_OBJ@ -ICONV_LIBS = @ICONV_LIBS@ -ICU_CFLAGS = @ICU_CFLAGS@ -ICU_LIBS = @ICU_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ -LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ -LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ -LIBXML_VERSION = @LIBXML_VERSION@ -LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ -LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ -LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LZMA_CFLAGS = @LZMA_CFLAGS@ -LZMA_LIBS = @LZMA_LIBS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MODULE_EXTENSION = @MODULE_EXTENSION@ -MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PYTHON = @PYTHON@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_TESTS = @PYTHON_TESTS@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RDL_LIBS = @RDL_LIBS@ -READER_TEST = @READER_TEST@ -RELDATE = @RELDATE@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STATIC_BINARIES = @STATIC_BINARIES@ -STRIP = @STRIP@ -TAR = @TAR@ -TEST_C14N = @TEST_C14N@ -TEST_CATALOG = @TEST_CATALOG@ -TEST_DEBUG = @TEST_DEBUG@ -TEST_HTML = @TEST_HTML@ -TEST_MODULES = @TEST_MODULES@ -TEST_PATTERN = @TEST_PATTERN@ -TEST_PHTML = @TEST_PHTML@ -TEST_PUSH = @TEST_PUSH@ -TEST_REGEXPS = @TEST_REGEXPS@ -TEST_SAX = @TEST_SAX@ -TEST_SCHEMAS = @TEST_SCHEMAS@ -TEST_SCHEMATRON = @TEST_SCHEMATRON@ -TEST_THREADS = @TEST_THREADS@ -TEST_VALID = @TEST_VALID@ -TEST_VTIME = @TEST_VTIME@ -TEST_XINCLUDE = @TEST_XINCLUDE@ -TEST_XPATH = @TEST_XPATH@ -TEST_XPTR = @TEST_XPTR@ -THREAD_CFLAGS = @THREAD_CFLAGS@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WGET = @WGET@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@ -WITH_C14N = @WITH_C14N@ -WITH_CATALOG = @WITH_CATALOG@ -WITH_DEBUG = @WITH_DEBUG@ -WITH_DOCB = @WITH_DOCB@ -WITH_FTP = @WITH_FTP@ -WITH_HTML = @WITH_HTML@ -WITH_HTTP = @WITH_HTTP@ -WITH_ICONV = @WITH_ICONV@ -WITH_ICU = @WITH_ICU@ -WITH_ISO8859X = @WITH_ISO8859X@ -WITH_LEGACY = @WITH_LEGACY@ -WITH_LZMA = @WITH_LZMA@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_OUTPUT = @WITH_OUTPUT@ -WITH_PATTERN = @WITH_PATTERN@ -WITH_PUSH = @WITH_PUSH@ -WITH_READER = @WITH_READER@ -WITH_REGEXPS = @WITH_REGEXPS@ -WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ -WITH_SAX1 = @WITH_SAX1@ -WITH_SCHEMAS = @WITH_SCHEMAS@ -WITH_SCHEMATRON = @WITH_SCHEMATRON@ -WITH_THREADS = @WITH_THREADS@ -WITH_THREAD_ALLOC = @WITH_THREAD_ALLOC@ -WITH_TREE = @WITH_TREE@ -WITH_TRIO = @WITH_TRIO@ -WITH_VALID = @WITH_VALID@ -WITH_WRITER = @WITH_WRITER@ -WITH_XINCLUDE = @WITH_XINCLUDE@ -WITH_XPATH = @WITH_XPATH@ -WITH_XPTR = @WITH_XPTR@ -WITH_ZLIB = @WITH_ZLIB@ -XINCLUDE_OBJ = @XINCLUDE_OBJ@ -XMLLINT = @XMLLINT@ -XML_CFLAGS = @XML_CFLAGS@ -XML_INCLUDEDIR = @XML_INCLUDEDIR@ -XML_LIBDIR = @XML_LIBDIR@ -XML_LIBS = @XML_LIBS@ -XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ -XPATH_OBJ = @XPATH_OBJ@ -XPTR_OBJ = @XPTR_OBJ@ -XSLTPROC = @XSLTPROC@ -Z_CFLAGS = @Z_CFLAGS@ -Z_LIBS = @Z_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = libxml -EXTRA_DIST = win32config.h wsockcompat.h -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ - check-am clean clean-generic clean-libtool cscopelist-am ctags \ - ctags-am distclean 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 \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxml/src/include/libxml/Makefile.in b/third_party/libxml/src/include/libxml/Makefile.in deleted file mode 100644 index 9ba83f5..0000000 --- a/third_party/libxml/src/include/libxml/Makefile.in +++ /dev/null
@@ -1,724 +0,0 @@ -# Makefile.in generated by automake 1.15.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2017 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = include/libxml -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(xmlinc_HEADERS) \ - $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = xmlversion.h -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(xmlincdir)" -HEADERS = $(xmlinc_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/xmlversion.h.in -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ -C14N_OBJ = @C14N_OBJ@ -CATALOG_OBJ = @CATALOG_OBJ@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ -CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ -DEBUG_OBJ = @DEBUG_OBJ@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DOCB_OBJ = @DOCB_OBJ@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FTP_OBJ = @FTP_OBJ@ -GREP = @GREP@ -HAVE_ISINF = @HAVE_ISINF@ -HAVE_ISNAN = @HAVE_ISNAN@ -HTML_DIR = @HTML_DIR@ -HTML_OBJ = @HTML_OBJ@ -HTTP_OBJ = @HTTP_OBJ@ -ICONV_LIBS = @ICONV_LIBS@ -ICU_CFLAGS = @ICU_CFLAGS@ -ICU_LIBS = @ICU_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ -LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ -LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ -LIBXML_VERSION = @LIBXML_VERSION@ -LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ -LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ -LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -LZMA_CFLAGS = @LZMA_CFLAGS@ -LZMA_LIBS = @LZMA_LIBS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MODULE_EXTENSION = @MODULE_EXTENSION@ -MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PKG_CONFIG = @PKG_CONFIG@ -PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ -PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PYTHON = @PYTHON@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_TESTS = @PYTHON_TESTS@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RDL_LIBS = @RDL_LIBS@ -READER_TEST = @READER_TEST@ -RELDATE = @RELDATE@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STATIC_BINARIES = @STATIC_BINARIES@ -STRIP = @STRIP@ -TAR = @TAR@ -TEST_C14N = @TEST_C14N@ -TEST_CATALOG = @TEST_CATALOG@ -TEST_DEBUG = @TEST_DEBUG@ -TEST_HTML = @TEST_HTML@ -TEST_MODULES = @TEST_MODULES@ -TEST_PATTERN = @TEST_PATTERN@ -TEST_PHTML = @TEST_PHTML@ -TEST_PUSH = @TEST_PUSH@ -TEST_REGEXPS = @TEST_REGEXPS@ -TEST_SAX = @TEST_SAX@ -TEST_SCHEMAS = @TEST_SCHEMAS@ -TEST_SCHEMATRON = @TEST_SCHEMATRON@ -TEST_THREADS = @TEST_THREADS@ -TEST_VALID = @TEST_VALID@ -TEST_VTIME = @TEST_VTIME@ -TEST_XINCLUDE = @TEST_XINCLUDE@ -TEST_XPATH = @TEST_XPATH@ -TEST_XPTR = @TEST_XPTR@ -THREAD_CFLAGS = @THREAD_CFLAGS@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WGET = @WGET@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@ -WITH_C14N = @WITH_C14N@ -WITH_CATALOG = @WITH_CATALOG@ -WITH_DEBUG = @WITH_DEBUG@ -WITH_DOCB = @WITH_DOCB@ -WITH_FTP = @WITH_FTP@ -WITH_HTML = @WITH_HTML@ -WITH_HTTP = @WITH_HTTP@ -WITH_ICONV = @WITH_ICONV@ -WITH_ICU = @WITH_ICU@ -WITH_ISO8859X = @WITH_ISO8859X@ -WITH_LEGACY = @WITH_LEGACY@ -WITH_LZMA = @WITH_LZMA@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_OUTPUT = @WITH_OUTPUT@ -WITH_PATTERN = @WITH_PATTERN@ -WITH_PUSH = @WITH_PUSH@ -WITH_READER = @WITH_READER@ -WITH_REGEXPS = @WITH_REGEXPS@ -WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ -WITH_SAX1 = @WITH_SAX1@ -WITH_SCHEMAS = @WITH_SCHEMAS@ -WITH_SCHEMATRON = @WITH_SCHEMATRON@ -WITH_THREADS = @WITH_THREADS@ -WITH_THREAD_ALLOC = @WITH_THREAD_ALLOC@ -WITH_TREE = @WITH_TREE@ -WITH_TRIO = @WITH_TRIO@ -WITH_VALID = @WITH_VALID@ -WITH_WRITER = @WITH_WRITER@ -WITH_XINCLUDE = @WITH_XINCLUDE@ -WITH_XPATH = @WITH_XPATH@ -WITH_XPTR = @WITH_XPTR@ -WITH_ZLIB = @WITH_ZLIB@ -XINCLUDE_OBJ = @XINCLUDE_OBJ@ -XMLLINT = @XMLLINT@ -XML_CFLAGS = @XML_CFLAGS@ -XML_INCLUDEDIR = @XML_INCLUDEDIR@ -XML_LIBDIR = @XML_LIBDIR@ -XML_LIBS = @XML_LIBS@ -XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ -XPATH_OBJ = @XPATH_OBJ@ -XPTR_OBJ = @XPTR_OBJ@ -XSLTPROC = @XSLTPROC@ -Z_CFLAGS = @Z_CFLAGS@ -Z_LIBS = @Z_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xmlincdir = $(includedir)/libxml2/libxml -xmlinc_HEADERS = \ - SAX.h \ - entities.h \ - encoding.h \ - parser.h \ - parserInternals.h \ - xmlerror.h \ - HTMLparser.h \ - HTMLtree.h \ - debugXML.h \ - tree.h \ - list.h \ - hash.h \ - xpath.h \ - xpathInternals.h \ - xpointer.h \ - xinclude.h \ - xmlIO.h \ - xmlmemory.h \ - nanohttp.h \ - nanoftp.h \ - uri.h \ - valid.h \ - xlink.h \ - xmlversion.h \ - DOCBparser.h \ - catalog.h \ - threads.h \ - globals.h \ - c14n.h \ - xmlautomata.h \ - xmlregexp.h \ - xmlmodule.h \ - xmlschemas.h \ - schemasInternals.h \ - xmlschemastypes.h \ - xmlstring.h \ - xmlunicode.h \ - xmlreader.h \ - relaxng.h \ - dict.h \ - SAX2.h \ - xmlexports.h \ - xmlwriter.h \ - chvalid.h \ - pattern.h \ - xmlsave.h \ - schematron.h - -EXTRA_DIST = xmlversion.h.in -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/libxml/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-xmlincHEADERS: $(xmlinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(xmlinc_HEADERS)'; test -n "$(xmlincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(xmlincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(xmlincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xmlincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(xmlincdir)" || exit $$?; \ - done - -uninstall-xmlincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(xmlinc_HEADERS)'; test -n "$(xmlincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(xmlincdir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(xmlincdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-xmlincHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-xmlincHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libtool cscopelist-am ctags ctags-am distclean \ - 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 \ - install-xmlincHEADERS installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-am uninstall uninstall-am uninstall-xmlincHEADERS - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxml/src/install-sh b/third_party/libxml/src/install-sh deleted file mode 100755 index 377bb868..0000000 --- a/third_party/libxml/src/install-sh +++ /dev/null
@@ -1,527 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2011-11-20.07; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
diff --git a/third_party/libxml/src/ltmain.sh b/third_party/libxml/src/ltmain.sh deleted file mode 100644 index b6f3fcb..0000000 --- a/third_party/libxml/src/ltmain.sh +++ /dev/null
@@ -1,11149 +0,0 @@ -#! /bin/sh -## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 - -# libtool (GNU libtool) 2.4.6 -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 - -# Copyright (C) 1996-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - - -PROGRAM=libtool -PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 - - -## ------ ## -## Usage. ## -## ------ ## - -# Run './libtool --help' for help with using this script from the -# command line. - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# After configure completes, it has a better idea of some of the -# shell tools we need than the defaults used by the functions shared -# with bootstrap, so set those here where they can still be over- -# ridden by the user, but otherwise take precedence. - -: ${AUTOCONF="autoconf"} -: ${AUTOMAKE="automake"} - - -## -------------------------- ## -## Source external libraries. ## -## -------------------------- ## - -# Much of our low-level functionality needs to be sourced from external -# libraries, which are installed to $pkgauxdir. - -# Set a version string for this script. -scriptversion=2015-01-20.17; # UTC - -# General shell script boiler plate, and helper functions. -# Written by Gary V. Vaughan, 2004 - -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Please report bugs or propose patches to gary@gnu.org. - - -## ------ ## -## Usage. ## -## ------ ## - -# Evaluate this file near the top of your script to gain access to -# the functions and variables defined here: -# -# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh -# -# If you need to override any of the default environment variable -# settings, do that before evaluating this file. - - -## -------------------- ## -## Shell normalisation. ## -## -------------------- ## - -# Some shells need a little help to be as Bourne compatible as possible. -# Before doing anything else, make sure all that help has been provided! - -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac -fi - -# NLS nuisances: We save the old values in case they are required later. -_G_user_locale= -_G_safe_locale= -for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test set = \"\${$_G_var+set}\"; then - save_$_G_var=\$$_G_var - $_G_var=C - export $_G_var - _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" - _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" - fi" -done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Make sure IFS has a sensible default -sp=' ' -nl=' -' -IFS="$sp $nl" - -# There are apparently some retarded systems that use ';' as a PATH separator! -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - - -## ------------------------- ## -## Locate command utilities. ## -## ------------------------- ## - - -# func_executable_p FILE -# ---------------------- -# Check that FILE is an executable regular file. -func_executable_p () -{ - test -f "$1" && test -x "$1" -} - - -# func_path_progs PROGS_LIST CHECK_FUNC [PATH] -# -------------------------------------------- -# Search for either a program that responds to --version with output -# containing "GNU", or else returned by CHECK_FUNC otherwise, by -# trying all the directories in PATH with each of the elements of -# PROGS_LIST. -# -# CHECK_FUNC should accept the path to a candidate program, and -# set $func_check_prog_result if it truncates its output less than -# $_G_path_prog_max characters. -func_path_progs () -{ - _G_progs_list=$1 - _G_check_func=$2 - _G_PATH=${3-"$PATH"} - - _G_path_prog_max=0 - _G_path_prog_found=false - _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} - for _G_dir in $_G_PATH; do - IFS=$_G_save_IFS - test -z "$_G_dir" && _G_dir=. - for _G_prog_name in $_G_progs_list; do - for _exeext in '' .EXE; do - _G_path_prog=$_G_dir/$_G_prog_name$_exeext - func_executable_p "$_G_path_prog" || continue - case `"$_G_path_prog" --version 2>&1` in - *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; - *) $_G_check_func $_G_path_prog - func_path_progs_result=$func_check_prog_result - ;; - esac - $_G_path_prog_found && break 3 - done - done - done - IFS=$_G_save_IFS - test -z "$func_path_progs_result" && { - echo "no acceptable sed could be found in \$PATH" >&2 - exit 1 - } -} - - -# We want to be able to use the functions in this file before configure -# has figured out where the best binaries are kept, which means we have -# to search for them ourselves - except when the results are already set -# where we skip the searches. - -# Unless the user overrides by setting SED, search the path for either GNU -# sed, or the sed that truncates its output the least. -test -z "$SED" && { - _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for _G_i in 1 2 3 4 5 6 7; do - _G_sed_script=$_G_sed_script$nl$_G_sed_script - done - echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed - _G_sed_script= - - func_check_prog_sed () - { - _G_path_prog=$1 - - _G_count=0 - printf 0123456789 >conftest.in - while : - do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo '' >> conftest.nl - "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break - diff conftest.out conftest.nl >/dev/null 2>&1 || break - _G_count=`expr $_G_count + 1` - if test "$_G_count" -gt "$_G_path_prog_max"; then - # Best one so far, save it but keep looking for a better one - func_check_prog_result=$_G_path_prog - _G_path_prog_max=$_G_count - fi - # 10*(2^10) chars as input seems more than enough - test 10 -lt "$_G_count" && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out - } - - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin - rm -f conftest.sed - SED=$func_path_progs_result -} - - -# Unless the user overrides by setting GREP, search the path for either GNU -# grep, or the grep that truncates its output the least. -test -z "$GREP" && { - func_check_prog_grep () - { - _G_path_prog=$1 - - _G_count=0 - _G_path_prog_max=0 - printf 0123456789 >conftest.in - while : - do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo 'GREP' >> conftest.nl - "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break - diff conftest.out conftest.nl >/dev/null 2>&1 || break - _G_count=`expr $_G_count + 1` - if test "$_G_count" -gt "$_G_path_prog_max"; then - # Best one so far, save it but keep looking for a better one - func_check_prog_result=$_G_path_prog - _G_path_prog_max=$_G_count - fi - # 10*(2^10) chars as input seems more than enough - test 10 -lt "$_G_count" && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out - } - - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin - GREP=$func_path_progs_result -} - - -## ------------------------------- ## -## User overridable command paths. ## -## ------------------------------- ## - -# All uppercase variable names are used for environment variables. These -# variables can be overridden by the user before calling a script that -# uses them if a suitable command of that name is not already available -# in the command search PATH. - -: ${CP="cp -f"} -: ${ECHO="printf %s\n"} -: ${EGREP="$GREP -E"} -: ${FGREP="$GREP -F"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} - - -## -------------------- ## -## Useful sed snippets. ## -## -------------------- ## - -sed_dirname='s|/[^/]*$||' -sed_basename='s|^.*/||' - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Same as above, but do not quote variable references. -sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' - -# Sed substitution that converts a w32 file name or path -# that contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-'\' parameter expansions in output of sed_double_quote_subst that -# were '\'-ed in input to the same. If an odd number of '\' preceded a -# '$' in input to sed_double_quote_subst, that '$' was protected from -# expansion. Since each input '\' is now two '\'s, look for any number -# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. -_G_bs='\\' -_G_bs2='\\\\' -_G_bs4='\\\\\\\\' -_G_dollar='\$' -sed_double_backslash="\ - s/$_G_bs4/&\\ -/g - s/^$_G_bs2$_G_dollar/$_G_bs&/ - s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g - s/\n//g" - - -## ----------------- ## -## Global variables. ## -## ----------------- ## - -# Except for the global variables explicitly listed below, the following -# functions in the '^func_' namespace, and the '^require_' namespace -# variables initialised in the 'Resource management' section, sourcing -# this file will not pollute your global namespace with anything -# else. There's no portable way to scope variables in Bourne shell -# though, so actually running these functions will sometimes place -# results into a variable named after the function, and often use -# temporary variables in the '^_G_' namespace. If you are careful to -# avoid using those namespaces casually in your sourcing script, things -# should continue to work as you expect. And, of course, you can freely -# overwrite any of the functions or variables defined here before -# calling anything to customize them. - -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -# Allow overriding, eg assuming that you follow the convention of -# putting '$debug_cmd' at the start of all your functions, you can get -# bash to show function call trace with: -# -# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name -debug_cmd=${debug_cmd-":"} -exit_cmd=: - -# By convention, finish your script with: -# -# exit $exit_status -# -# so that you can set exit_status to non-zero if you want to indicate -# something went wrong during execution without actually bailing out at -# the point of failure. -exit_status=$EXIT_SUCCESS - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath=$0 - -# The name of this program. -progname=`$ECHO "$progpath" |$SED "$sed_basename"` - -# Make sure we have an absolute progpath for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` - progdir=`cd "$progdir" && pwd` - progpath=$progdir/$progname - ;; - *) - _G_IFS=$IFS - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS=$_G_IFS - test -x "$progdir/$progname" && break - done - IFS=$_G_IFS - test -n "$progdir" || progdir=`pwd` - progpath=$progdir/$progname - ;; -esac - - -## ----------------- ## -## Standard options. ## -## ----------------- ## - -# The following options affect the operation of the functions defined -# below, and should be set appropriately depending on run-time para- -# meters passed on the command line. - -opt_dry_run=false -opt_quiet=false -opt_verbose=false - -# Categories 'all' and 'none' are always available. Append any others -# you will pass as the first argument to func_warning from your own -# code. -warning_categories= - -# By default, display warnings according to 'opt_warning_types'. Set -# 'warning_func' to ':' to elide all warnings, or func_fatal_error to -# treat the next displayed warning as a fatal error. -warning_func=func_warn_and_continue - -# Set to 'all' to display all warnings, 'none' to suppress all -# warnings, or a space delimited list of some subset of -# 'warning_categories' to display only the listed warnings. -opt_warning_types=all - - -## -------------------- ## -## Resource management. ## -## -------------------- ## - -# This section contains definitions for functions that each ensure a -# particular resource (a file, or a non-empty configuration variable for -# example) is available, and if appropriate to extract default values -# from pertinent package files. Call them using their associated -# 'require_*' variable to ensure that they are executed, at most, once. -# -# It's entirely deliberate that calling these functions can set -# variables that don't obey the namespace limitations obeyed by the rest -# of this file, in order that that they be as useful as possible to -# callers. - - -# require_term_colors -# ------------------- -# Allow display of bold text on terminals that support it. -require_term_colors=func_require_term_colors -func_require_term_colors () -{ - $debug_cmd - - test -t 1 && { - # COLORTERM and USE_ANSI_COLORS environment variables take - # precedence, because most terminfo databases neglect to describe - # whether color sequences are supported. - test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} - - if test 1 = "$USE_ANSI_COLORS"; then - # Standard ANSI escape sequences - tc_reset='[0m' - tc_bold='[1m'; tc_standout='[7m' - tc_red='[31m'; tc_green='[32m' - tc_blue='[34m'; tc_cyan='[36m' - else - # Otherwise trust the terminfo database after all. - test -n "`tput sgr0 2>/dev/null`" && { - tc_reset=`tput sgr0` - test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` - tc_standout=$tc_bold - test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` - test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` - test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` - test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` - test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` - } - fi - } - - require_term_colors=: -} - - -## ----------------- ## -## Function library. ## -## ----------------- ## - -# This section contains a variety of useful functions to call in your -# scripts. Take note of the portable wrappers for features provided by -# some modern shells, which will fall back to slower equivalents on -# less featureful shells. - - -# func_append VAR VALUE -# --------------------- -# Append VALUE onto the existing contents of VAR. - - # We should try to minimise forks, especially on Windows where they are - # unreasonably slow, so skip the feature probes when bash or zsh are - # being used: - if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then - : ${_G_HAVE_ARITH_OP="yes"} - : ${_G_HAVE_XSI_OPS="yes"} - # The += operator was introduced in bash 3.1 - case $BASH_VERSION in - [12].* | 3.0 | 3.0*) ;; - *) - : ${_G_HAVE_PLUSEQ_OP="yes"} - ;; - esac - fi - - # _G_HAVE_PLUSEQ_OP - # Can be empty, in which case the shell is probed, "yes" if += is - # useable or anything else if it does not work. - test -z "$_G_HAVE_PLUSEQ_OP" \ - && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ - && _G_HAVE_PLUSEQ_OP=yes - -if test yes = "$_G_HAVE_PLUSEQ_OP" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_append () - { - $debug_cmd - - eval "$1+=\$2" - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_append () - { - $debug_cmd - - eval "$1=\$$1\$2" - } -fi - - -# func_append_quoted VAR VALUE -# ---------------------------- -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -if test yes = "$_G_HAVE_PLUSEQ_OP"; then - eval 'func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" - }' -else - func_append_quoted () - { - $debug_cmd - - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" - } -fi - - -# func_append_uniq VAR VALUE -# -------------------------- -# Append unique VALUE onto the existing contents of VAR, assuming -# entries are delimited by the first character of VALUE. For example: -# -# func_append_uniq options " --another-option option-argument" -# -# will only append to $options if " --another-option option-argument " -# is not already present somewhere in $options already (note spaces at -# each end implied by leading space in second argument). -func_append_uniq () -{ - $debug_cmd - - eval _G_current_value='`$ECHO $'$1'`' - _G_delim=`expr "$2" : '\(.\)'` - - case $_G_delim$_G_current_value$_G_delim in - *"$2$_G_delim"*) ;; - *) func_append "$@" ;; - esac -} - - -# func_arith TERM... -# ------------------ -# Set func_arith_result to the result of evaluating TERMs. - test -z "$_G_HAVE_ARITH_OP" \ - && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ - && _G_HAVE_ARITH_OP=yes - -if test yes = "$_G_HAVE_ARITH_OP"; then - eval 'func_arith () - { - $debug_cmd - - func_arith_result=$(( $* )) - }' -else - func_arith () - { - $debug_cmd - - func_arith_result=`expr "$@"` - } -fi - - -# func_basename FILE -# ------------------ -# Set func_basename_result to FILE with everything up to and including -# the last / stripped. -if test yes = "$_G_HAVE_XSI_OPS"; then - # If this shell supports suffix pattern removal, then use it to avoid - # forking. Hide the definitions single quotes in case the shell chokes - # on unsupported syntax... - _b='func_basename_result=${1##*/}' - _d='case $1 in - */*) func_dirname_result=${1%/*}$2 ;; - * ) func_dirname_result=$3 ;; - esac' - -else - # ...otherwise fall back to using sed. - _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' - _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` - if test "X$func_dirname_result" = "X$1"; then - func_dirname_result=$3 - else - func_append func_dirname_result "$2" - fi' -fi - -eval 'func_basename () -{ - $debug_cmd - - '"$_b"' -}' - - -# func_dirname FILE APPEND NONDIR_REPLACEMENT -# ------------------------------------------- -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -eval 'func_dirname () -{ - $debug_cmd - - '"$_d"' -}' - - -# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT -# -------------------------------------------------------- -# Perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# For efficiency, we do not delegate to the functions above but instead -# duplicate the functionality here. -eval 'func_dirname_and_basename () -{ - $debug_cmd - - '"$_b"' - '"$_d"' -}' - - -# func_echo ARG... -# ---------------- -# Echo program name prefixed message. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $ECHO "$progname: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_echo_all ARG... -# -------------------- -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - - -# func_echo_infix_1 INFIX ARG... -# ------------------------------ -# Echo program name, followed by INFIX on the first line, with any -# additional lines not showing INFIX. -func_echo_infix_1 () -{ - $debug_cmd - - $require_term_colors - - _G_infix=$1; shift - _G_indent=$_G_infix - _G_prefix="$progname: $_G_infix: " - _G_message=$* - - # Strip color escape sequences before counting printable length - for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" - do - test -n "$_G_tc" && { - _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` - _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` - } - done - _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes - - func_echo_infix_1_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_infix_1_IFS - $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 - _G_prefix=$_G_indent - done - IFS=$func_echo_infix_1_IFS -} - - -# func_error ARG... -# ----------------- -# Echo program name prefixed message to standard error. -func_error () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 -} - - -# func_fatal_error ARG... -# ----------------------- -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - $debug_cmd - - func_error "$*" - exit $EXIT_FAILURE -} - - -# func_grep EXPRESSION FILENAME -# ----------------------------- -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $debug_cmd - - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_len STRING -# --------------- -# Set func_len_result to the length of STRING. STRING may not -# start with a hyphen. - test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_len () - { - $debug_cmd - - func_len_result=${#1} - }' -else - func_len () - { - $debug_cmd - - func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` - } -fi - - -# func_mkdir_p DIRECTORY-PATH -# --------------------------- -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - $debug_cmd - - _G_directory_path=$1 - _G_dir_list= - - if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then - - # Protect directory names starting with '-' - case $_G_directory_path in - -*) _G_directory_path=./$_G_directory_path ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$_G_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - _G_dir_list=$_G_directory_path:$_G_dir_list - - # If the last portion added has no slash in it, the list is done - case $_G_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` - done - _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` - - func_mkdir_p_IFS=$IFS; IFS=: - for _G_dir in $_G_dir_list; do - IFS=$func_mkdir_p_IFS - # mkdir can fail with a 'File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$_G_dir" 2>/dev/null || : - done - IFS=$func_mkdir_p_IFS - - # Bail out if we (or some other process) failed to create a directory. - test -d "$_G_directory_path" || \ - func_fatal_error "Failed to create '$1'" - fi -} - - -# func_mktempdir [BASENAME] -# ------------------------- -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, BASENAME is the basename for that directory. -func_mktempdir () -{ - $debug_cmd - - _G_template=${TMPDIR-/tmp}/${1-$progname} - - if test : = "$opt_dry_run"; then - # Return a directory name, but don't create it in dry-run mode - _G_tmpdir=$_G_template-$$ - else - - # If mktemp works, use that first and foremost - _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` - - if test ! -d "$_G_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - _G_tmpdir=$_G_template-${RANDOM-0}$$ - - func_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$_G_tmpdir" - umask $func_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$_G_tmpdir" || \ - func_fatal_error "cannot create temporary directory '$_G_tmpdir'" - fi - - $ECHO "$_G_tmpdir" -} - - -# func_normal_abspath PATH -# ------------------------ -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -func_normal_abspath () -{ - $debug_cmd - - # These SED scripts presuppose an absolute path with a trailing slash. - _G_pathcar='s|^/\([^/]*\).*$|\1|' - _G_pathcdr='s|^/[^/]*||' - _G_removedotparts=':dotsl - s|/\./|/|g - t dotsl - s|/\.$|/|' - _G_collapseslashes='s|/\{1,\}|/|g' - _G_finalslash='s|/*$|/|' - - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` - while :; do - # Processed it all yet? - if test / = "$func_normal_abspath_tpath"; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result"; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$_G_pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - - -# func_notquiet ARG... -# -------------------- -# Echo program name prefixed message only when not in quiet mode. -func_notquiet () -{ - $debug_cmd - - $opt_quiet || func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - - -# func_relative_path SRCDIR DSTDIR -# -------------------------------- -# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. -func_relative_path () -{ - $debug_cmd - - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=$func_dirname_result - if test -z "$func_relative_path_tlibdir"; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test -n "$func_stripname_result"; then - func_append func_relative_path_result "/$func_stripname_result" - fi - - # Normalisation. If bindir is libdir, return '.' else relative path. - if test -n "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - fi - - test -n "$func_relative_path_result" || func_relative_path_result=. - - : -} - - -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () -{ - $debug_cmd - - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - case $1 in - *[\\\`\"\$]*) - _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; - *) - _G_unquoted_arg=$1 ;; - esac - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi - - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" - ;; - *) - _G_quoted_arg=$_G_unquoted_arg - ;; - esac - - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift - done -} - - -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd - - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; - esac - - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" - ;; - esac - - func_quote_for_expand_result=$_G_arg -} - - -# func_stripname PREFIX SUFFIX NAME -# --------------------------------- -# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_stripname () - { - $debug_cmd - - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are - # positional parameters, so assign one to ordinary variable first. - func_stripname_result=$3 - func_stripname_result=${func_stripname_result#"$1"} - func_stripname_result=${func_stripname_result%"$2"} - }' -else - func_stripname () - { - $debug_cmd - - case $2 in - .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; - *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; - esac - } -fi - - -# func_show_eval CMD [FAIL_EXP] -# ----------------------------- -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" - - $opt_dry_run || { - eval "$_G_cmd" - _G_status=$? - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_show_eval_locale CMD [FAIL_EXP] -# ------------------------------------ -# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - $debug_cmd - - _G_cmd=$1 - _G_fail_exp=${2-':'} - - $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - $opt_dry_run || { - eval "$_G_user_locale - $_G_cmd" - _G_status=$? - eval "$_G_safe_locale" - if test 0 -ne "$_G_status"; then - eval "(exit $_G_status); $_G_fail_exp" - fi - } -} - - -# func_tr_sh -# ---------- -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - $debug_cmd - - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_verbose ARG... -# ------------------- -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $debug_cmd - - $opt_verbose && func_echo "$*" - - : -} - - -# func_warn_and_continue ARG... -# ----------------------------- -# Echo program name prefixed warning message to standard error. -func_warn_and_continue () -{ - $debug_cmd - - $require_term_colors - - func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 -} - - -# func_warning CATEGORY ARG... -# ---------------------------- -# Echo program name prefixed warning message to standard error. Warning -# messages can be filtered according to CATEGORY, where this function -# elides messages where CATEGORY is not listed in the global variable -# 'opt_warning_types'. -func_warning () -{ - $debug_cmd - - # CATEGORY must be in the warning_categories list! - case " $warning_categories " in - *" $1 "*) ;; - *) func_internal_error "invalid warning category '$1'" ;; - esac - - _G_category=$1 - shift - - case " $opt_warning_types " in - *" $_G_category "*) $warning_func ${1+"$@"} ;; - esac -} - - -# func_sort_ver VER1 VER2 -# ----------------------- -# 'sort -V' is not generally available. -# Note this deviates from the version comparison in automake -# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a -# but this should suffice as we won't be specifying old -# version formats or redundant trailing .0 in bootstrap.conf. -# If we did want full compatibility then we should probably -# use m4_version_compare from autoconf. -func_sort_ver () -{ - $debug_cmd - - printf '%s\n%s\n' "$1" "$2" \ - | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n -} - -# func_lt_ver PREV CURR -# --------------------- -# Return true if PREV and CURR are in the correct order according to -# func_sort_ver, otherwise false. Use it like this: -# -# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." -func_lt_ver () -{ - $debug_cmd - - test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: -#! /bin/sh - -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - -# A portable, pluggable option parser for Bourne shell. -# Written by Gary V. Vaughan, 2010 - -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# Please report bugs or propose patches to gary@gnu.org. - - -## ------ ## -## Usage. ## -## ------ ## - -# This file is a library for parsing options in your shell scripts along -# with assorted other useful supporting features that you can make use -# of too. -# -# For the simplest scripts you might need only: -# -# #!/bin/sh -# . relative/path/to/funclib.sh -# . relative/path/to/options-parser -# scriptversion=1.0 -# func_options ${1+"$@"} -# eval set dummy "$func_options_result"; shift -# ...rest of your script... -# -# In order for the '--version' option to work, you will need to have a -# suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. -# -# For '-h' and '--help' to work, you will also need a one line -# description of your script's purpose in a comment directly above the -# '# Written by ' line, like the one at the top of this file. -# -# The default options also support '--debug', which will turn on shell -# execution tracing (see the comment above debug_cmd below for another -# use), and '--verbose' and the func_verbose function to allow your script -# to display verbose messages only when your user has specified -# '--verbose'. -# -# After sourcing this file, you can plug processing for additional -# options by amending the variables from the 'Configuration' section -# below, and following the instructions in the 'Option parsing' -# section further down. - -## -------------- ## -## Configuration. ## -## -------------- ## - -# You should override these variables in your script after sourcing this -# file so that they reflect the customisations you have added to the -# option parser. - -# The usage line for option parsing errors and the start of '-h' and -# '--help' output messages. You can embed shell variables for delayed -# expansion at the time the message is displayed, but you will need to -# quote other shell meta-characters carefully to prevent them being -# expanded when the contents are evaled. -usage='$progpath [OPTION]...' - -# Short help message in response to '-h' and '--help'. Add to this or -# override it after sourcing this library to reflect the full set of -# options your script accepts. -usage_message="\ - --debug enable verbose shell tracing - -W, --warnings=CATEGORY - report the warnings falling in CATEGORY [all] - -v, --verbose verbosely report processing - --version print version information and exit - -h, --help print short or long help message and exit -" - -# Additional text appended to 'usage_message' in response to '--help'. -long_help_message=" -Warning categories include: - 'all' show all warnings - 'none' turn off all the warnings - 'error' warnings are treated as fatal errors" - -# Help message printed before fatal option parsing errors. -fatal_help="Try '\$progname --help' for more information." - - - -## ------------------------- ## -## Hook function management. ## -## ------------------------- ## - -# This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. - -# func_hookable FUNC_NAME -# ----------------------- -# Declare that FUNC_NAME will run hooks added with -# 'func_add_hook FUNC_NAME ...'. -func_hookable () -{ - $debug_cmd - - func_append hookable_fns " $1" -} - - -# func_add_hook FUNC_NAME HOOK_FUNC -# --------------------------------- -# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must -# first have been declared "hookable" by a call to 'func_hookable'. -func_add_hook () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not accept hook functions." ;; - esac - - eval func_append ${1}_hooks '" $2"' -} - - -# func_remove_hook FUNC_NAME HOOK_FUNC -# ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. -func_remove_hook () -{ - $debug_cmd - - eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' -} - - -# func_run_hooks FUNC_NAME [ARG]... -# --------------------------------- -# Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more -# than a whitespace-delimited list of legal shell function names, and -# no effort is wasted trying to catch shell meta-characters or preserve -# whitespace. -func_run_hooks () -{ - $debug_cmd - - case " $hookable_fns " in - *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; - esac - - eval _G_hook_fns=\$$1_hooks; shift - - for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift - done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result -} - - - -## --------------- ## -## Option parsing. ## -## --------------- ## - -# In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '<hooked_function_name>_result', escaped suitably for -# 'eval'. Like this: -# -# my_options_prep () -# { -# $debug_cmd -# -# # Extend the existing usage message. -# usage_message=$usage_message' -# -s, --silent don'\''t print informational messages -# ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result -# } -# func_add_hook func_options_prep my_options_prep -# -# -# my_silent_option () -# { -# $debug_cmd -# -# # Note that for efficiency, we parse as many options as we can -# # recognise in a loop before passing the remainder back to the -# # caller on the first unrecognised argument we encounter. -# while test $# -gt 0; do -# opt=$1; shift -# case $opt in -# --silent|-s) opt_silent=: ;; -# # Separate non-argument short options: -# -s*) func_split_short_opt "$_G_opt" -# set dummy "$func_split_short_opt_name" \ -# "-$func_split_short_opt_arg" ${1+"$@"} -# shift -# ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; -# esac -# done -# -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result -# } -# func_add_hook func_parse_options my_silent_option -# -# -# my_option_validation () -# { -# $debug_cmd -# -# $opt_silent && $opt_verbose && func_fatal_help "\ -# '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result -# } -# func_add_hook func_validate_options my_option_validation -# -# You'll alse need to manually amend $usage_message to reflect the extra -# options you parse. It's preferable to append if you can, so that -# multiple option parsing hooks can be added safely. - - -# func_options [ARG]... -# --------------------- -# All the functions called inside func_options are hookable. See the -# individual implementations for details. -func_hookable func_options -func_options () -{ - $debug_cmd - - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} - - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} - - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result -} - - -# func_options_prep [ARG]... -# -------------------------- -# All initialisations required before starting the option parse loop. -# Note that when calling hook functions, we pass through the list of -# positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. -func_hookable func_options_prep -func_options_prep () -{ - $debug_cmd - - # Option defaults: - opt_verbose=false - opt_warning_types= - - func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result -} - - -# func_parse_options [ARG]... -# --------------------------- -# The main option parsing loop. -func_hookable func_parse_options -func_parse_options () -{ - $debug_cmd - - func_parse_options_result= - - # this just eases exit handling - while test $# -gt 0; do - # Defer to hook functions for initial option parsing, so they - # get priority in the event of reusing an option name. - func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift - - # Break out of the loop if we already parsed every option. - test $# -gt 0 || break - - _G_opt=$1 - shift - case $_G_opt in - --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" - $debug_cmd - ;; - - --no-warnings|--no-warning|--no-warn) - set dummy --warnings none ${1+"$@"} - shift - ;; - - --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break - case " $warning_categories $1" in - *" $1 "*) - # trailing space prevents matching last $1 above - func_append_uniq opt_warning_types " $1" - ;; - *all) - opt_warning_types=$warning_categories - ;; - *none) - opt_warning_types=none - warning_func=: - ;; - *error) - opt_warning_types=$warning_categories - warning_func=func_fatal_error - ;; - *) - func_fatal_error \ - "unsupported warning category: '$1'" - ;; - esac - shift - ;; - - --verbose|-v) opt_verbose=: ;; - --version) func_version ;; - -\?|-h) func_usage ;; - --help) func_help ;; - - # Separate optargs to long options (plugins may need this): - --*=*) func_split_equals "$_G_opt" - set dummy "$func_split_equals_lhs" \ - "$func_split_equals_rhs" ${1+"$@"} - shift - ;; - - # Separate optargs to short options: - -W*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-v*|-x*) - func_split_short_opt "$_G_opt" - set dummy "$func_split_short_opt_name" \ - "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; - esac - done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result -} - - -# func_validate_options [ARG]... -# ------------------------------ -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -func_hookable func_validate_options -func_validate_options () -{ - $debug_cmd - - # Display all warnings if -W was not given. - test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" - - func_run_hooks func_validate_options ${1+"$@"} - - # Bail if the options were screwed! - $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result -} - - - -## ----------------- ## -## Helper functions. ## -## ----------------- ## - -# This section contains the helper functions used by the rest of the -# hookable option parser framework in ascii-betical order. - - -# func_fatal_help ARG... -# ---------------------- -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - $debug_cmd - - eval \$ECHO \""Usage: $usage"\" - eval \$ECHO \""$fatal_help"\" - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - - -# func_help -# --------- -# Echo long help message to standard output and exit. -func_help () -{ - $debug_cmd - - func_usage_message - $ECHO "$long_help_message" - exit 0 -} - - -# func_missing_arg ARGNAME -# ------------------------ -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $debug_cmd - - func_error "Missing argument for '$1'." - exit_cmd=exit -} - - -# func_split_equals STRING -# ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. -test -z "$_G_HAVE_XSI_OPS" \ - && (eval 'x=a/b/c; - test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ - && _G_HAVE_XSI_OPS=yes - -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_equals () - { - $debug_cmd - - func_split_equals_lhs=${1%%=*} - func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_equals () - { - $debug_cmd - - func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` - func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ - || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` - } -fi #func_split_equals - - -# func_split_short_opt SHORTOPT -# ----------------------------- -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -if test yes = "$_G_HAVE_XSI_OPS" -then - # This is an XSI compatible shell, allowing a faster implementation... - eval 'func_split_short_opt () - { - $debug_cmd - - func_split_short_opt_arg=${1#??} - func_split_short_opt_name=${1%"$func_split_short_opt_arg"} - }' -else - # ...otherwise fall back to using expr, which is often a shell builtin. - func_split_short_opt () - { - $debug_cmd - - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` - func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` - } -fi #func_split_short_opt - - -# func_usage -# ---------- -# Echo short help message to standard output and exit. -func_usage () -{ - $debug_cmd - - func_usage_message - $ECHO "Run '$progname --help |${PAGER-more}' for full usage" - exit 0 -} - - -# func_usage_message -# ------------------ -# Echo short help message to standard output. -func_usage_message () -{ - $debug_cmd - - eval \$ECHO \""Usage: $usage"\" - echo - $SED -n 's|^# || - /^Written by/{ - x;p;x - } - h - /^Written by/q' < "$progpath" - echo - eval \$ECHO \""$usage_message"\" -} - - -# func_version -# ------------ -# Echo version message to standard output and exit. -func_version () -{ - $debug_cmd - - printf '%s\n' "$progname $scriptversion" - $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p - } - /^# Written by / { - s|^# || - p - } - /^warranty; /q' < "$progpath" - - exit $? -} - - -# Local variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" -# time-stamp-time-zone: "UTC" -# End: - -# Set a version string. -scriptversion='(GNU libtool) 2.4.6' - - -# func_echo ARG... -# ---------------- -# Libtool also displays the current mode in messages, so override -# funclib.sh func_echo with this custom definition. -func_echo () -{ - $debug_cmd - - _G_message=$* - - func_echo_IFS=$IFS - IFS=$nl - for _G_line in $_G_message; do - IFS=$func_echo_IFS - $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" - done - IFS=$func_echo_IFS -} - - -# func_warning ARG... -# ------------------- -# Libtool warnings are not categorized, so override funclib.sh -# func_warning with this simpler definition. -func_warning () -{ - $debug_cmd - - $warning_func ${1+"$@"} -} - - -## ---------------- ## -## Options parsing. ## -## ---------------- ## - -# Hook in the functions to make sure our own options are parsed during -# the option parsing loop. - -usage='$progpath [OPTION]... [MODE-ARG]...' - -# Short help message in response to '-h'. -usage_message="Options: - --config show all configuration variables - --debug enable verbose shell tracing - -n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --mode=MODE use operation mode MODE - --no-warnings equivalent to '-Wnone' - --preserve-dup-deps don't remove duplicate dependency libraries - --quiet, --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - -v, --verbose print more informational messages than default - --version print version information - -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] - -h, --help, --help-all print short, long, or detailed help message -" - -# Additional text appended to 'usage_message' in response to '--help'. -func_help () -{ - $debug_cmd - - func_usage_message - $ECHO "$long_help_message - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. When passed as first option, -'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. -Try '$progname --help --mode=MODE' for a more detailed description of MODE. - -When reporting a bug, please describe a test case to reproduce it and -include the following information: - - host-triplet: $host - shell: $SHELL - compiler: $LTCC - compiler flags: $LTCFLAGS - linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 - automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` - autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` - -Report bugs to <bug-libtool@gnu.org>. -GNU libtool home page: <http://www.gnu.org/software/libtool/>. -General help using GNU software: <http://www.gnu.org/gethelp/>." - exit 0 -} - - -# func_lo2o OBJECT-NAME -# --------------------- -# Transform OBJECT-NAME from a '.lo' suffix to the platform specific -# object suffix. - -lo2o=s/\\.lo\$/.$objext/ -o2lo=s/\\.$objext\$/.lo/ - -if test yes = "$_G_HAVE_XSI_OPS"; then - eval 'func_lo2o () - { - case $1 in - *.lo) func_lo2o_result=${1%.lo}.$objext ;; - * ) func_lo2o_result=$1 ;; - esac - }' - - # func_xform LIBOBJ-OR-SOURCE - # --------------------------- - # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) - # suffix to a '.lo' libtool-object suffix. - eval 'func_xform () - { - func_xform_result=${1%.*}.lo - }' -else - # ...otherwise fall back to using sed. - func_lo2o () - { - func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` - } - - func_xform () - { - func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` - } -fi - - -# func_fatal_configuration ARG... -# ------------------------------- -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func__fatal_error ${1+"$@"} \ - "See the $PACKAGE documentation for more information." \ - "Fatal configuration error." -} - - -# func_config -# ----------- -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - - -# func_features -# ------------- -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test yes = "$build_libtool_libs"; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test yes = "$build_old_libs"; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - - -# func_enable_tag TAGNAME -# ----------------------- -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname=$1 - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf=/$re_begincf/,/$re_endcf/p - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - - -# func_check_version_match -# ------------------------ -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# libtool_options_prep [ARG]... -# ----------------------------- -# Preparation for options parsed by libtool. -libtool_options_prep () -{ - $debug_mode - - # Option defaults: - opt_config=false - opt_dlopen= - opt_dry_run=false - opt_help=false - opt_mode= - opt_preserve_dup_deps=false - opt_quiet=false - - nonopt= - preserve_args= - - # Shorthand for --mode=foo, only valid as the first argument - case $1 in - clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; - compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; - execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; - finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; - install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; - link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; - esac - - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result -} -func_add_hook func_options_prep libtool_options_prep - - -# libtool_parse_options [ARG]... -# --------------------------------- -# Provide handling for libtool specific options. -libtool_parse_options () -{ - $debug_cmd - - # Perform our own loop to consume as many options as possible in - # each iteration. - while test $# -gt 0; do - _G_opt=$1 - shift - case $_G_opt in - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - - --config) func_config ;; - - --dlopen|-dlopen) - opt_dlopen="${opt_dlopen+$opt_dlopen -}$1" - shift - ;; - - --preserve-dup-deps) - opt_preserve_dup_deps=: ;; - - --features) func_features ;; - - --finish) set dummy --mode finish ${1+"$@"}; shift ;; - - --help) opt_help=: ;; - - --help-all) opt_help=': help-all' ;; - - --mode) test $# = 0 && func_missing_arg $_G_opt && break - opt_mode=$1 - case $1 in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $_G_opt" - exit_cmd=exit - break - ;; - esac - shift - ;; - - --no-silent|--no-quiet) - opt_quiet=false - func_append preserve_args " $_G_opt" - ;; - - --no-warnings|--no-warning|--no-warn) - opt_warning=false - func_append preserve_args " $_G_opt" - ;; - - --no-verbose) - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --silent|--quiet) - opt_quiet=: - opt_verbose=false - func_append preserve_args " $_G_opt" - ;; - - --tag) test $# = 0 && func_missing_arg $_G_opt && break - opt_tag=$1 - func_append preserve_args " $_G_opt $1" - func_enable_tag "$1" - shift - ;; - - --verbose|-v) opt_quiet=false - opt_verbose=: - func_append preserve_args " $_G_opt" - ;; - - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; - esac - done - - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result -} -func_add_hook func_parse_options libtool_parse_options - - - -# libtool_validate_options [ARG]... -# --------------------------------- -# Perform any sanity checks on option settings and/or unconsumed -# arguments. -libtool_validate_options () -{ - # save first non-option argument - if test 0 -lt $#; then - nonopt=$1 - shift - fi - - # preserve --debug - test : = "$debug_cmd" || func_append preserve_args " --debug" - - case $host in - # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 - # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - test yes != "$build_libtool_libs" \ - && test yes != "$build_old_libs" \ - && func_fatal_configuration "not configured to build any kind of library" - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test execute != "$opt_mode"; then - func_error "unrecognized option '-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help=$help - help="Try '$progname --help --mode=$opt_mode' for more information." - } - - # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result -} -func_add_hook func_validate_options libtool_validate_options - - -# Process options as early as possible so that --help and --version -# can return quickly. -func_options ${1+"$@"} -eval set dummy "$func_options_result"; shift - - - -## ----------- ## -## Main. ## -## ----------- ## - -magic='%%%MAGIC variable%%%' -magic_exe='%%%MAGIC EXE variable%%%' - -# Global variables. -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# func_generated_by_libtool -# True iff stdin has been generated by Libtool. This function is only -# a basic sanity check; it will hardly flush out determined imposters. -func_generated_by_libtool_p () -{ - $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool '.la' library or '.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if 'file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case $lalib_p_line in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test yes = "$lalib_p" -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - test -f "$1" && - $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $debug_cmd - - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$sp$nl - eval cmd=\"$cmd\" - IFS=$save_ifs - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# 'FILE.' does not work on cygwin managed mounts. -func_source () -{ - $debug_cmd - - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case $lt_sysroot:$1 in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result='='$func_stripname_result - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $debug_cmd - - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with '--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=$1 - if test yes = "$build_libtool_libs"; then - write_lobj=\'$2\' - else - write_lobj=none - fi - - if test yes = "$build_old_libs"; then - write_oldobj=\'$3\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T <<EOF -# $write_libobj - a libtool object file -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# Name of the PIC object. -pic_object=$write_lobj - -# Name of the non-PIC object -non_pic_object=$write_oldobj - -EOF - $MV "${write_libobj}T" "$write_libobj" - } -} - - -################################################## -# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # -################################################## - -# func_convert_core_file_wine_to_w32 ARG -# Helper function used by file name conversion functions when $build is *nix, -# and $host is mingw, cygwin, or some other w32 environment. Relies on a -# correctly configured wine environment available, with the winepath program -# in $build's $PATH. -# -# ARG is the $build file name to be converted to w32 format. -# Result is available in $func_convert_core_file_wine_to_w32_result, and will -# be empty on error (or when ARG is empty) -func_convert_core_file_wine_to_w32 () -{ - $debug_cmd - - func_convert_core_file_wine_to_w32_result=$1 - if test -n "$1"; then - # Unfortunately, winepath does not exit with a non-zero error code, so we - # are forced to check the contents of stdout. On the other hand, if the - # command is not found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both error code of - # zero AND non-empty stdout, which explains the odd construction: - func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $debug_cmd - - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result= - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result"; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $debug_cmd - - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $debug_cmd - - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $debug_cmd - - if test -z "$2" && test -n "$1"; then - func_error "Could not determine host file name corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result=$1 - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $debug_cmd - - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " '$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result=$3 - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $debug_cmd - - case $4 in - $1 ) func_to_host_path_result=$3$func_to_host_path_result - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via '$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $debug_cmd - - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $debug_cmd - - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result=$1 -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result=$func_convert_core_msys_to_w32_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result=$func_convert_core_file_wine_to_w32_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result=$func_cygpath_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $debug_cmd - - func_to_host_file_result=$1 - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result=$func_cygpath_result - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via '$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $debug_cmd - - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd=func_convert_path_$func_stripname_result - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $debug_cmd - - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result=$1 -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_msys_to_w32_result - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result=$func_convert_core_path_wine_to_w32_result - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result=$func_cygpath_result - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $debug_cmd - - func_to_host_path_result=$1 - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result=$func_cygpath_result - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_dll_def_p FILE -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with _LT_DLL_DEF_P in libtool.m4 -func_dll_def_p () -{ - $debug_cmd - - func_dll_def_p_tmp=`$SED -n \ - -e 's/^[ ]*//' \ - -e '/^\(;.*\)*$/d' \ - -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ - -e q \ - "$1"` - test DEF = "$func_dll_def_p_tmp" -} - - -# func_mode_compile arg... -func_mode_compile () -{ - $debug_cmd - - # Get the compilation command and the source file. - base_compile= - srcfile=$nonopt # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg=$arg - arg_mode=normal - ;; - - target ) - libobj=$arg - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify '-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs=$IFS; IFS=, - for arg in $args; do - IFS=$save_ifs - func_append_quoted lastarg "$arg" - done - IFS=$save_ifs - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg=$srcfile - srcfile=$arg - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with '-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj=$func_basename_result - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from '$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test yes = "$build_libtool_libs" \ - || func_fatal_configuration "cannot build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name '$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname=$func_basename_result - xdir=$func_dirname_result - lobj=$xdir$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test yes = "$build_old_libs"; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test no = "$compiler_c_o"; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext - lockfile=$output_obj.lock - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test yes = "$need_locks"; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test warn = "$need_locks"; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test yes = "$build_libtool_libs"; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test no != "$pic_mode"; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test warn = "$need_locks" && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test yes = "$suppress_opt"; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test yes = "$build_old_libs"; then - if test yes != "$pic_mode"; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test yes = "$compiler_c_o"; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test warn = "$need_locks" && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support '-c' and '-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test no != "$need_locks"; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test compile = "$opt_mode" && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a '.o' file suitable for static linking - -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a 'standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix '.c' with the -library object suffix, '.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to '-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the '--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the 'install' or 'cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE use a list of object files found in FILE to specify objects - -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with '-') are ignored. - -Every other argument is treated as a filename. Files ending in '.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in '.la', then a libtool library is created, -only library objects ('.lo' files) may be specified, and '-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created -using 'ar' and 'ranlib', or on Windows using 'lib'. - -If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode '$opt_mode'" - ;; - esac - - echo - $ECHO "Try '$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test : = "$opt_help"; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | $SED -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - $SED '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $debug_cmd - - # The first argument is the command name. - cmd=$nonopt - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "'$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "'$file' was not linked with '-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir=$func_dirname_result - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir=$func_dirname_result - ;; - - *) - func_warning "'-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir=$absdir - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic=$magic - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file=$progdir/$program - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file=$progdir/$program - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if $opt_dry_run; then - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - else - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd=\$cmd$args - fi -} - -test execute = "$opt_mode" && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $debug_cmd - - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "'$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument '$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and '=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_quiet && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the '-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the '$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the '$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the '$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test finish = "$opt_mode" && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $debug_cmd - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac - then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=false - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=: ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test X-m = "X$prev" && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the '$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=: - if $isdir; then - destdir=$dest - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir=$func_dirname_result - destname=$func_basename_result - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "'$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "'$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic=$magic - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "'$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir=$func_dirname_result - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking '$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname=$1 - shift - - srcname=$realname - test -n "$relink_command" && srcname=${realname}T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme=$stripme - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme= - ;; - esac - ;; - os2*) - case $realname in - *_dll.a) - tstripme= - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try 'ln -sf' first, because the 'ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib=$destdir/$realname - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name=$func_basename_result - instname=$dir/${name}i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile=$destdir/$destname - else - func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest=$destfile - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to '$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test yes = "$build_old_libs"; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile=$destdir/$destname - else - func_basename "$file" - destfile=$func_basename_result - destfile=$destdir/$destfile - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext= - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=.exe - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script '$wrapper'" - - finalize=: - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "'$lib' has not been installed in '$libdir'" - finalize=false - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test no = "$fast_install" && test -n "$relink_command"; then - $opt_dry_run || { - if $finalize; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file=$func_basename_result - outputname=$tmpdir/$file - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink '$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file=$outputname - else - func_warning "cannot relink '$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name=$func_basename_result - - # Set up the ranlib parameters. - oldlib=$destdir/$name - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run '$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test install = "$opt_mode" && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $debug_cmd - - my_outputname=$1 - my_originator=$2 - my_pic_p=${3-false} - my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms=${my_outputname}S.c - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist=$output_objdir/$my_outputname.nm - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - -/* External symbol declarations for the compiler. */\ -" - - if test yes = "$dlself"; then - func_verbose "generating symbol list for '$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from '$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols=$output_objdir/$outputname.exp - $opt_dry_run || { - $RM $export_symbols - eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from '$dlprefile'" - func_basename "$dlprefile" - name=$func_basename_result - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename= - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname"; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename=$func_basename_result - else - # no lafile. user explicitly requested -dlpreopen <import library>. - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename"; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 </dev/null >/dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - func_show_eval '$RM "${nlist}I"' - if test -n "$global_symbol_to_import"; then - eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[];\ -" - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ -static void lt_syminit(void) -{ - LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; - for (; symbol->name; ++symbol) - {" - $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" - echo >> "$output_objdir/$my_dlsyms" "\ - } -}" - fi - echo >> "$output_objdir/$my_dlsyms" "\ -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{ {\"$my_originator\", (void *) 0}," - - if test -s "$nlist"I; then - echo >> "$output_objdir/$my_dlsyms" "\ - {\"@INIT@\", (void *) <_syminit}," - fi - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - $my_pic_p && pic_flag_for_symtable=" $pic_flag" - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' - - # Transform the symbol file into the correct name. - symfileobj=$output_objdir/${my_outputname}S.$objext - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for '$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $debug_cmd - - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $debug_cmd - - win32_libid_type=unknown - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - case $nm_interface in - "MS dumpbin") - if func_cygming_ms_implib_p "$1" || - func_cygming_gnu_implib_p "$1" - then - win32_nmres=import - else - win32_nmres= - fi - ;; - *) - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s|.*|import| - p - q - } - }'` - ;; - esac - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $debug_cmd - - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $debug_cmd - - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive that possess that section. Heuristic: eliminate - # all those that have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $debug_cmd - - if func_cygming_gnu_implib_p "$1"; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1"; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result= - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $debug_cmd - - f_ex_an_ar_dir=$1; shift - f_ex_an_ar_oldlib=$1 - if test yes = "$lock_old_archive_extraction"; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test yes = "$lock_old_archive_extraction"; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $debug_cmd - - my_gentop=$1; shift - my_oldlibs=${1+"$@"} - my_oldobjs= - my_xlib= - my_xabs= - my_xdir= - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib=$func_basename_result - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir=$my_gentop/$my_xlib_u - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - func_basename "$darwin_archive" - darwin_base_archive=$func_basename_result - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches; do - func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" - $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" - cd "unfat-$$/$darwin_base_archive-$darwin_arch" - func_extract_an_archive "`pwd`" "$darwin_base_archive" - cd "$darwin_curdir" - $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result=$my_oldobjs -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory where it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test yes = "$fast_install"; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - \$ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat <<EOF - -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname - Generated by $PROGRAM (GNU $PACKAGE) $VERSION - - The $output program cannot be directly executed until all the libtool - libraries that it depends on are installed. - - This wrapper executable should never be moved out of the build directory. - If it is, it will not operate correctly. -*/ -EOF - cat <<"EOF" -#ifdef _MSC_VER -# define _CRT_SECURE_NO_DEPRECATE 1 -#endif -#include <stdio.h> -#include <stdlib.h> -#ifdef _MSC_VER -# include <direct.h> -# include <process.h> -# include <io.h> -#else -# include <unistd.h> -# include <stdint.h> -# ifdef __CYGWIN__ -# include <io.h> -# endif -#endif -#include <malloc.h> -#include <stdarg.h> -#include <assert.h> -#include <string.h> -#include <ctype.h> -#include <errno.h> -#include <fcntl.h> -#include <sys/stat.h> - -#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) - -/* declarations of non-ANSI functions */ -#if defined __MINGW32__ -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined __CYGWIN__ -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined other_platform || defined ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined _MSC_VER -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -#elif defined __MINGW32__ -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined __CYGWIN__ -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined other platforms ... */ -#endif - -#if defined PATH_MAX -# define LT_PATHMAX PATH_MAX -#elif defined MAXPATHLEN -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ - defined __OS2__ -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free (stale); stale = 0; } \ -} while (0) - -#if defined LT_DEBUGWRAPPER -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <<EOF -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) -# define externally_visible volatile -#else -# define externally_visible __attribute__((externally_visible)) volatile -#endif -externally_visible const char * MAGIC_EXE = "$magic_exe"; -const char * LIB_PATH_VARNAME = "$shlibpath_var"; -EOF - - if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - func_to_host_path "$temp_rpath" - cat <<EOF -const char * LIB_PATH_VALUE = "$func_to_host_path_result"; -EOF - else - cat <<"EOF" -const char * LIB_PATH_VALUE = ""; -EOF - fi - - if test -n "$dllsearchpath"; then - func_to_host_path "$dllsearchpath:" - cat <<EOF -const char * EXE_PATH_VARNAME = "PATH"; -const char * EXE_PATH_VALUE = "$func_to_host_path_result"; -EOF - else - cat <<"EOF" -const char * EXE_PATH_VARNAME = ""; -const char * EXE_PATH_VALUE = ""; -EOF - fi - - if test yes = "$fast_install"; then - cat <<EOF -const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */ -EOF - else - cat <<EOF -const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */ -EOF - fi - - - cat <<"EOF" - -#define LTWRAPPER_OPTION_PREFIX "--lt-" - -static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; -static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; -static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug"; - -int -main (int argc, char *argv[]) -{ - char **newargz; - int newargc; - char *tmp_pathspec; - char *actual_cwrapper_path; - char *actual_cwrapper_name; - char *target_name; - char *lt_argv_zero; - int rval = 127; - - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - newargz = XMALLOC (char *, (size_t) argc + 1); - - /* very simple arg parsing; don't want to rely on getopt - * also, copy all non cwrapper options to newargz, except - * argz[0], which is handled differently - */ - newargc=0; - for (i = 1; i < argc; i++) - { - if (STREQ (argv[i], dumpscript_opt)) - { -EOF - case $host in - *mingw* | *cygwin* ) - # make stdout use "unix" line endings - echo " setmode(1,_O_BINARY);" - ;; - esac - - cat <<"EOF" - lt_dump_script (stdout); - return 0; - } - if (STREQ (argv[i], debug_opt)) - { - lt_debug = 1; - continue; - } - if (STREQ (argv[i], ltwrapper_option_prefix)) - { - /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX - namespace, but it is not one of the ones we know about and - have already dealt with, above (inluding dump-script), then - report an error. Otherwise, targets might begin to believe - they are allowed to use options in the LTWRAPPER_OPTION_PREFIX - namespace. The first time any user complains about this, we'll - need to make LTWRAPPER_OPTION_PREFIX a configure-time option - or a configure.ac-settable value. - */ - lt_fatal (__FILE__, __LINE__, - "unrecognized %s option: '%s'", - ltwrapper_option_prefix, argv[i]); - } - /* otherwise ... */ - newargz[++newargc] = xstrdup (argv[i]); - } - newargz[++newargc] = NULL; - -EOF - cat <<EOF - /* The GNU banner must be the first non-error debug message */ - lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n"); -EOF - cat <<"EOF" - lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]); - lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name); - - tmp_pathspec = find_executable (argv[0]); - if (tmp_pathspec == NULL) - lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]); - lt_debugprintf (__FILE__, __LINE__, - "(main) found exe (before symlink chase) at: %s\n", - tmp_pathspec); - - actual_cwrapper_path = chase_symlinks (tmp_pathspec); - lt_debugprintf (__FILE__, __LINE__, - "(main) found exe (after symlink chase) at: %s\n", - actual_cwrapper_path); - XFREE (tmp_pathspec); - - actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path)); - strendzap (actual_cwrapper_path, actual_cwrapper_name); - - /* wrapper name transforms */ - strendzap (actual_cwrapper_name, ".exe"); - tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1); - XFREE (actual_cwrapper_name); - actual_cwrapper_name = tmp_pathspec; - tmp_pathspec = 0; - - /* target_name transforms -- use actual target program name; might have lt- prefix */ - target_name = xstrdup (base_name (TARGET_PROGRAM_NAME)); - strendzap (target_name, ".exe"); - tmp_pathspec = lt_extend_str (target_name, ".exe", 1); - XFREE (target_name); - target_name = tmp_pathspec; - tmp_pathspec = 0; - - lt_debugprintf (__FILE__, __LINE__, - "(main) libtool target name: %s\n", - target_name); -EOF - - cat <<EOF - newargz[0] = - XMALLOC (char, (strlen (actual_cwrapper_path) + - strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1)); - strcpy (newargz[0], actual_cwrapper_path); - strcat (newargz[0], "$objdir"); - strcat (newargz[0], "/"); -EOF - - cat <<"EOF" - /* stop here, and copy so we don't have to do this twice */ - tmp_pathspec = xstrdup (newargz[0]); - - /* do NOT want the lt- prefix here, so use actual_cwrapper_name */ - strcat (newargz[0], actual_cwrapper_name); - - /* DO want the lt- prefix here if it exists, so use target_name */ - lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1); - XFREE (tmp_pathspec); - tmp_pathspec = NULL; -EOF - - case $host_os in - mingw*) - cat <<"EOF" - { - char* p; - while ((p = strchr (newargz[0], '\\')) != NULL) - { - *p = '/'; - } - while ((p = strchr (lt_argv_zero, '\\')) != NULL) - { - *p = '/'; - } - } -EOF - ;; - esac - - cat <<"EOF" - XFREE (target_name); - XFREE (actual_cwrapper_path); - XFREE (actual_cwrapper_name); - - lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */ - lt_setenv ("DUALCASE", "1"); /* for MSK sh */ - /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must - be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath) - because on Windows, both *_VARNAMEs are PATH but uninstalled - libraries must come first. */ - lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); - lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); - - lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", - nonnull (lt_argv_zero)); - for (i = 0; i < newargc; i++) - { - lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", - i, nonnull (newargz[i])); - } - -EOF - - case $host_os in - mingw*) - cat <<"EOF" - /* execv doesn't actually work on mingw as expected on unix */ - newargz = prepare_spawn (newargz); - rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); - if (rval == -1) - { - /* failed to start process */ - lt_debugprintf (__FILE__, __LINE__, - "(main) failed to launch target \"%s\": %s\n", - lt_argv_zero, nonnull (strerror (errno))); - return 127; - } - return rval; -EOF - ;; - *) - cat <<"EOF" - execv (lt_argv_zero, newargz); - return rval; /* =127, but avoids unused variable warning */ -EOF - ;; - esac - - cat <<"EOF" -} - -void * -xmalloc (size_t num) -{ - void *p = (void *) malloc (num); - if (!p) - lt_fatal (__FILE__, __LINE__, "memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), - string) : NULL; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined HAVE_DOS_BASED_FILE_SYSTEM - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char) name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable (const char *path) -{ - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - size_t tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined HAVE_DOS_BASED_FILE_SYSTEM - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined HAVE_DOS_BASED_FILE_SYSTEM - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = (size_t) (q - p); - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (STREQ (str, pat)) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - size_t len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - size_t orig_value_len = strlen (orig_value); - size_t add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - size_t len = strlen (new_value); - while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[--len] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $debug_cmd - - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_suncc_cstd_abi -# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! -# Several compiler flags select an ABI that is incompatible with the -# Cstd library. Avoid specifying it if any are in CXXFLAGS. -func_suncc_cstd_abi () -{ - $debug_cmd - - case " $compile_command " in - *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) - suncc_use_cstd_abi=no - ;; - *) - suncc_use_cstd_abi=yes - ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $debug_cmd - - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # what system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll that has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - os2dllname= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=false - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module=$wl-single_module - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test yes != "$build_libtool_libs" \ - && func_fatal_configuration "cannot build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg=$1 - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir=$arg - prev= - continue - ;; - dlfiles|dlprefiles) - $preload || { - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=: - } - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test no = "$dlself"; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test dlprefiles = "$prev"; then - dlself=yes - elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test dlfiles = "$prev"; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols=$arg - test -f "$arg" \ - || func_fatal_error "symbol file '$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex=$arg - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir=$arg - prev= - continue - ;; - mllvm) - # Clang does not use LLVM to link, so we can simply discard any - # '-mllvm $arg' options when doing the link step. - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - if test none != "$pic_object"; then - # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object - - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg=$pic_object - fi - - # Non-PIC object. - if test none != "$non_pic_object"; then - # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "'$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file '$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - os2dllname) - os2dllname=$arg - prev= - continue - ;; - precious_regex) - precious_files_regex=$arg - prev= - continue - ;; - release) - release=-$arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test rpath = "$prev"; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds=$arg - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg=$arg - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "'-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test X-export-symbols = "X$arg"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between '-L' and '$1'" - else - func_fatal_error "need path for '-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of '$dir'" - dir=$absdir - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test X-lc = "X$arg" || test X-lm = "X$arg"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test X-lc = "X$arg" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) - # Do not include libc due to us having libc/libc_r. - test X-lc = "X$arg" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test X-lc = "X$arg" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test X-lc = "X$arg" && continue - ;; - esac - elif test X-lc_r = "X$arg"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -mllvm) - prev=mllvm - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module=$wl-multi_module - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "'-no-install' is ignored for $host" - func_warning "assuming '-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -os2dllname) - prev=os2dllname - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs=$IFS; IFS=, - for flag in $args; do - IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" - done - IFS=$save_ifs - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs=$IFS; IFS=, - for flag in $args; do - IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS=$save_ifs - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # -fstack-protector* stack protector flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - # -stdlib=* select c++ std lib with clang - # -fsanitize=* Clang memory and address sanitizer - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -fsanitize=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - -Z*) - if test os2 = "`expr $host : '.*\(os2\)'`"; then - # OS/2 uses -Zxxx to specify OS/2-specific options - compiler_flags="$compiler_flags $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case $arg in - -Zlinker | -Zstack) - prev=xcompiler - ;; - esac - continue - else - # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - fi - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test none = "$pic_object" && - test none = "$non_pic_object"; then - func_fatal_error "cannot find name of object for '$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - test none = "$pic_object" || { - # Prepend the subdirectory the object is found in. - pic_object=$xdir$pic_object - - if test dlfiles = "$prev"; then - if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test dlprefiles = "$prev"; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg=$pic_object - } - - # Non-PIC object. - if test none != "$non_pic_object"; then - # Prepend the subdirectory the object is found in. - non_pic_object=$xdir$non_pic_object - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test none = "$pic_object"; then - arg=$non_pic_object - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object=$pic_object - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir=$func_dirname_result - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "'$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test dlfiles = "$prev"; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test dlprefiles = "$prev"; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the '$prevarg' option requires an argument" - - if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname=$func_basename_result - libobjs_save=$libobjs - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - # Definition is injected by LT_CONFIG during libtool generation. - func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" - - func_dirname "$output" "/" "" - output_objdir=$func_dirname_result$objdir - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test lib = "$linkmode"; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=false - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test lib,link = "$linkmode,$pass"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs=$tmp_deplibs - fi - - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass"; then - libs=$deplibs - deplibs= - fi - if test prog = "$linkmode"; then - case $pass in - dlopen) libs=$dlfiles ;; - dlpreopen) libs=$dlprefiles ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test lib,dlpreopen = "$linkmode,$pass"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs=$dlprefiles - fi - if test dlopen = "$pass"; then - # Collect dlpreopened libraries - save_deplibs=$deplibs - deplibs= - fi - - for deplib in $libs; do - lib= - found=false - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test lib = "$linkmode"; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test lib != "$linkmode" && test prog != "$linkmode"; then - func_warning "'-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test lib = "$linkmode"; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib=$searchdir/lib$name$search_ext - if test -f "$lib"; then - if test .la = "$search_ext"; then - found=: - else - found=false - fi - break 2 - fi - done - done - if $found; then - # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll=$l - done - if test "X$ll" = "X$old_library"; then # only static version available - found=false - func_dirname "$lib" "" "." - ladir=$func_dirname_result - lib=$ladir/$old_library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - else - # deplib doesn't seem to be a libtool library - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - ;; # -l - *.ltframework) - if test prog,link = "$linkmode,$pass"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test lib = "$linkmode"; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test conv = "$pass" && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - continue - fi - if test scan = "$pass"; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "'-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test link = "$pass"; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=false - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=: - fi - ;; - pass_all) - valid_a_lib=: - ;; - esac - if $valid_a_lib; then - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - else - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - fi - ;; - esac - continue - ;; - prog) - if test link != "$pass"; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test conv = "$pass"; then - deplibs="$deplib $deplibs" - elif test prog = "$linkmode"; then - if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=: - continue - ;; - esac # case $deplib - - $found || test -f "$lib" \ - || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "'$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir=$func_dirname_result - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test lib,link = "$linkmode,$pass" || - test prog,scan = "$linkmode,$pass" || - { test prog != "$linkmode" && test lib != "$linkmode"; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test conv = "$pass"; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for '$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - elif test prog != "$linkmode" && test lib != "$linkmode"; then - func_fatal_error "'$lib' is not a convenience library" - fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test yes = "$prefer_static_libs" || - test built,no = "$prefer_static_libs,$installed"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib=$l - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for '$lib'" - fi - - # This library was specified with -dlopen. - if test dlopen = "$pass"; then - test -z "$libdir" \ - && func_fatal_error "cannot -dlopen a convenience library: '$lib'" - if test -z "$dlname" || - test yes != "$dlopen_support" || - test no = "$build_libtool_libs" - then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of '$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir=$ladir - fi - ;; - esac - func_basename "$lib" - laname=$func_basename_result - - # Find the relevant object directory and library name. - if test yes = "$installed"; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library '$lib' was moved." - dir=$ladir - absdir=$abs_ladir - libdir=$abs_ladir - else - dir=$lt_sysroot$libdir - absdir=$lt_sysroot$libdir - fi - test yes = "$hardcode_automatic" && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir=$ladir - absdir=$abs_ladir - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir=$ladir/$objdir - absdir=$abs_ladir/$objdir - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test dlpreopen = "$pass"; then - if test -z "$libdir" && test prog = "$linkmode"; then - func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" - fi - case $host in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test lib = "$linkmode"; then - deplibs="$dir/$old_library $deplibs" - elif test prog,link = "$linkmode,$pass"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test prog = "$linkmode" && test link != "$pass"; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=false - if test no != "$link_all_deplibs" || test -z "$library_names" || - test no = "$build_libtool_libs"; then - linkalldeplibs=: - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if $linkalldeplibs; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test prog,link = "$linkmode,$pass"; then - if test -n "$library_names" && - { { test no = "$prefer_static_libs" || - test built,yes = "$prefer_static_libs,$installed"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then - # Make sure the rpath contains only unique directories. - case $temp_rpath: in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if $alldeplibs && - { test pass_all = "$deplibs_check_method" || - { test yes = "$build_libtool_libs" && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test built = "$use_static_libs" && test yes = "$installed"; then - use_static_libs=no - fi - if test -n "$library_names" && - { test no = "$use_static_libs" || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc* | *os2*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test no = "$installed"; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule= - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule=$dlpremoduletest - break - fi - done - if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then - echo - if test prog = "$linkmode"; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test lib = "$linkmode" && - test yes = "$hardcode_into_libs"; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname=$1 - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname=$dlname - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc* | *os2*) - func_arith $current - $age - major=$func_arith_result - versuffix=-$major - ;; - esac - eval soname=\"$soname_spec\" - else - soname=$realname - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot=$soname - func_basename "$soroot" - soname=$func_basename_result - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from '$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for '$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test prog = "$linkmode" || test relink != "$opt_mode"; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test no = "$hardcode_direct"; then - add=$dir/$linklib - case $host in - *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; - *-*-sysv4*uw2*) add_dir=-L$dir ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir=-L$dir ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we cannot - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library"; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add=$dir/$old_library - fi - elif test -n "$old_library"; then - add=$dir/$old_library - fi - fi - esac - elif test no = "$hardcode_minus_L"; then - case $host in - *-*-sunos*) add_shlibpath=$dir ;; - esac - add_dir=-L$dir - add=-l$name - elif test no = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name - else - lib_linked=no - fi - ;; - relink) - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$dir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$absdir - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - add_shlibpath=$dir - add=-l$name - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test yes != "$lib_linked"; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test prog = "$linkmode"; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test yes != "$hardcode_direct" && - test yes != "$hardcode_minus_L" && - test yes = "$hardcode_shlibpath_var"; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test prog = "$linkmode" || test relink = "$opt_mode"; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test yes = "$hardcode_direct" && - test no = "$hardcode_direct_absolute"; then - add=$libdir/$linklib - elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir - add=-l$name - elif test yes = "$hardcode_shlibpath_var"; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add=-l$name - elif test yes = "$hardcode_automatic"; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib"; then - add=$inst_prefix_dir$libdir/$linklib - else - add=$libdir/$linklib - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add=-l$name - fi - - if test prog = "$linkmode"; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test prog = "$linkmode"; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test unsupported != "$hardcode_direct"; then - test -n "$old_library" && linklib=$old_library - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test yes = "$build_libtool_libs"; then - # Not a shared library - if test pass_all != "$deplibs_check_method"; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system cannot link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test yes = "$module"; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." - fi - if test no = "$build_old_libs"; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test lib = "$linkmode"; then - if test -n "$dependency_libs" && - { test yes != "$hardcode_into_libs" || - test yes = "$build_old_libs" || - test yes = "$link_static"; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs=$temp_deplibs - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test no != "$link_all_deplibs"; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path=$deplib ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of '$dir'" - absdir=$dir - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names"; then - for tmp in $deplibrary_names; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl"; then - depdepl=$absdir/$objdir/$depdepl - darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" - func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" - path= - fi - fi - ;; - *) - path=-L$absdir/$objdir - ;; - esac - else - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "'$deplib' seems to be moved" - - path=-L$absdir - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test link = "$pass"; then - if test prog = "$linkmode"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs=$newdependency_libs - if test dlpreopen = "$pass"; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test dlopen != "$pass"; then - test conv = "$pass" || { - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - } - - if test prog,link = "$linkmode,$pass"; then - vars="compile_deplibs finalize_deplibs" - else - vars=deplibs - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - - # Add Sun CC postdeps if required: - test CXX = "$tagname" && { - case $host_os in - linux*) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C++ 5.9 - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - func_append postdeps ' -library=Cstd -library=Crun' - fi - ;; - esac - ;; - - solaris*) - func_cc_basename "$CC" - case $func_cc_basename_result in - CC* | sunCC*) - func_suncc_cstd_abi - - if test no != "$suncc_use_cstd_abi"; then - func_append postdeps ' -library=Cstd -library=Crun' - fi - ;; - esac - ;; - esac - } - - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i= - ;; - esac - if test -n "$i"; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test prog = "$linkmode"; then - dlfiles=$newdlfiles - fi - if test prog = "$linkmode" || test lib = "$linkmode"; then - dlprefiles=$newdlprefiles - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "'-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "'-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "'-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "'-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs=$output - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form 'libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test no = "$module" \ - && func_fatal_help "libtool library '$output' must begin with 'lib'" - - if test no != "$need_lib_prefix"; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test pass_all != "$deplibs_check_method"; then - func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test no = "$dlself" \ - || func_warning "'-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test 1 -lt "$#" \ - && func_warning "ignoring multiple '-rpath's for a libtool library" - - install_libdir=$1 - - oldlibs= - if test -z "$rpath"; then - if test yes = "$build_libtool_libs"; then - # Building a libtool convenience library. - # Some compilers have problems with a '.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "'-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "'-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs=$IFS; IFS=: - set dummy $vinfo 0 0 0 - shift - IFS=$save_ifs - - test -n "$7" && \ - func_fatal_help "too many parameters to '-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major=$1 - number_minor=$2 - number_revision=$3 - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # that has an extra 1 added just for fun - # - case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age=$number_minor - revision=$number_revision - ;; - freebsd-aout|qnx|sunos) - current=$number_major - revision=$number_minor - age=0 - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age=$number_minor - revision=$number_minor - lt_irix_increment=no - ;; - esac - ;; - no) - current=$1 - revision=$2 - age=$3 - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT '$current' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION '$revision' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE '$age' must be a nonnegative integer" - func_fatal_error "'$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE '$age' is greater than the current interface number '$current'" - func_fatal_error "'$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - # On Darwin other compilers - case $CC in - nagfor*) - verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" - ;; - *) - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - esac - ;; - - freebsd-aout) - major=.$current - versuffix=.$current.$revision - ;; - - freebsd-elf) - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - ;; - - irix | nonstopux) - if test no = "$lt_irix_increment"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring=$verstring_prefix$major.$revision - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test 0 -ne "$loop"; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring=$verstring_prefix$major.$iface:$verstring - done - - # Before this point, $major must not contain '.'. - major=.$major - versuffix=$major.$revision - ;; - - linux) # correct to gnu/linux during the next big refactor - func_arith $current - $age - major=.$func_arith_result - versuffix=$major.$age.$revision - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=.$current.$age.$revision - verstring=$current.$age.$revision - - # Add in all the interfaces that we are compatible with. - loop=$age - while test 0 -ne "$loop"; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring=$verstring:$iface.0 - done - - # Make executables depend on our current version. - func_append verstring ":$current.0" - ;; - - qnx) - major=.$current - versuffix=.$current - ;; - - sco) - major=.$current - versuffix=.$current - ;; - - sunos) - major=.$current - versuffix=.$current.$revision - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 file systems. - func_arith $current - $age - major=$func_arith_result - versuffix=-$major - ;; - - *) - func_fatal_configuration "unknown library version type '$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring=0.0 - ;; - esac - if test no = "$need_version"; then - versuffix= - else - versuffix=.0.0 - fi - fi - - # Remove version info from name if versioning should be avoided - if test yes,no = "$avoid_version,$need_version"; then - major= - versuffix= - verstring= - fi - - # Check to see if the archive will have undefined symbols. - if test yes = "$allow_undefined"; then - if test unsupported = "$allow_undefined_flag"; then - if test yes = "$build_old_libs"; then - func_warning "undefined symbols not allowed in $host shared libraries; building static only" - build_libtool_libs=no - else - func_fatal_error "can't build $host shared library unless -no-undefined is specified" - fi - fi - else - # Don't allow undefined symbols. - allow_undefined_flag=$no_undefined_flag - fi - - fi - - func_generate_dlsyms "$libname" "$libname" : - func_append libobjs " $symfileobj" - test " " = "$libobjs" && libobjs= - - if test relink != "$opt_mode"; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) - if test -n "$precious_files_regex"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles=$dlfiles - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles=$dlprefiles - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test yes = "$build_libtool_libs"; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test yes = "$build_libtool_need_lc"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release= - versuffix= - major= - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c <<EOF - int main() { return 0; } -EOF - $opt_dry_run || $RM conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then - ldd_output=`ldd conftest` - for i in $deplibs; do - case $i in - -l*) - func_stripname -l '' "$i" - name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $i "*) - func_append newdeplibs " $i" - i= - ;; - esac - fi - if test -n "$i"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` - set dummy $deplib_matches; shift - deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then - func_append newdeplibs " $i" - else - droppeddeps=yes - echo - $ECHO "*** Warning: dynamic linker does not accept needed library $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which I believe you do not have" - echo "*** because a test_compile did reveal that the linker did not use it for" - echo "*** its dynamic dependency list that programs get resolved with at runtime." - fi - fi - ;; - *) - func_append newdeplibs " $i" - ;; - esac - done - else - # Error occurred in the first compile. Let's try to salvage - # the situation: Compile a separate program for each library. - for i in $deplibs; do - case $i in - -l*) - func_stripname -l '' "$i" - name=$func_stripname_result - $opt_dry_run || $RM conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $i; then - ldd_output=`ldd conftest` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $i "*) - func_append newdeplibs " $i" - i= - ;; - esac - fi - if test -n "$i"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` - set dummy $deplib_matches; shift - deplib_match=$1 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then - func_append newdeplibs " $i" - else - droppeddeps=yes - echo - $ECHO "*** Warning: dynamic linker does not accept needed library $i." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because a test_compile did reveal that the linker did not use this one" - echo "*** as a dynamic dependency that programs can get resolved with at runtime." - fi - fi - else - droppeddeps=yes - echo - $ECHO "*** Warning! Library $i is needed by this library but I was not able to" - echo "*** make it link in! You will probably need to install it or some" - echo "*** library that it depends on before this library will be fully" - echo "*** functional. Installing it before continuing would be even better." - fi - ;; - *) - func_append newdeplibs " $i" - ;; - esac - done - fi - ;; - file_magic*) - set dummy $deplibs_check_method; shift - file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib= - ;; - esac - fi - if test -n "$a_deplib"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - if test -n "$file_magic_glob"; then - libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` - else - libnameglob=$libname - fi - test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - if test yes = "$want_nocaseglob"; then - shopt -s nocaseglob - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib=$potent_lib - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | $SED 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; - *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib= - break 2 - fi - done - done - fi - if test -n "$a_deplib"; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib= - ;; - esac - fi - if test -n "$a_deplib"; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib=$potent_lib # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib= - break 2 - fi - done - done - fi - if test -n "$a_deplib"; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib"; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs= - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test yes = "$allow_libtool_libs_with_static_runtimes"; then - for i in $predeps $postdeps; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test none = "$deplibs_check_method"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test yes = "$droppeddeps"; then - if test yes = "$module"; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." - fi - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test no = "$allow_undefined"; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test no = "$build_old_libs"; then - oldlibs=$output_objdir/$libname.$libext - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs=$new_libs - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test yes = "$build_libtool_libs"; then - # Remove $wl instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test yes = "$hardcode_into_libs"; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath=$finalize_rpath - test relink = "$opt_mode" || rpath=$compile_rpath$rpath - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath=$finalize_shlibpath - test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname=$1 - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname=$realname - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib=$output_objdir/$realname - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols=$output_objdir/$libname.uexp - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - func_dll_def_p "$export_symbols" || { - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols=$export_symbols - export_symbols= - always_export_symbols=yes - } - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs=$IFS; IFS='~' - for cmd1 in $cmds; do - IFS=$save_ifs - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test yes = "$try_normal_branch" \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=$output_objdir/$output_la.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS=$save_ifs - if test -n "$export_symbols_regex" && test : != "$skipped_export"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test : != "$skipped_export" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs=$tmp_deplibs - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test yes = "$compiler_needs_object" && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test relink = "$opt_mode"; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test : != "$skipped_export" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then - output=$output_objdir/$output_la.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then - output=$output_objdir/$output_la.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test yes = "$compiler_needs_object"; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-$k.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test -z "$objlist" || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test 1 -eq "$k"; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-$k.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-$k.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - ${skipped_export-false} && { - func_verbose "generating symbol list for '$libname.la'" - export_symbols=$output_objdir/$libname.exp - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - } - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs=$IFS; IFS='~' - for cmd in $concat_cmds; do - IFS=$save_ifs - $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS=$save_ifs - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - ${skipped_export-false} && { - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols=$export_symbols - test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for '$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands, which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - } - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test yes = "$module" && test -n "$module_cmds"; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs=$IFS; IFS='~' - for cmd in $cmds; do - IFS=$sp$nl - eval cmd=\"$cmd\" - IFS=$save_ifs - $opt_quiet || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS=$save_ifs - - # Restore the uninstalled library and exit - if test relink = "$opt_mode"; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test yes = "$module" || test yes = "$export_dynamic"; then - # On all known operating systems, these are identical. - dlname=$soname - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then - func_warning "'-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "'-l' and '-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "'-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "'-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "'-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object '$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj=$output - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # if reload_cmds runs $LD directly, get rid of -Wl from - # whole_archive_flag_spec and hope we can get by with turning comma - # into space. - case $reload_cmds in - *\$LD[\ \$]*) wl= ;; - esac - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags - else - gentop=$output_objdir/${obj}x - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test yes = "$build_libtool_libs" || libobjs=$non_pic_objects - - # Create the old-style object. - reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs - - output=$obj - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - test yes = "$build_libtool_libs" || { - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - } - - if test -n "$pic_flag" || test default != "$pic_mode"; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output=$libobj - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "'-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "'-release' is ignored for programs" - - $preload \ - && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ - && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test CXX = "$tagname"; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " $wl-bind_at_load" - func_append finalize_command " $wl-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs=$new_libs - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath=$rpath - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs=$libdir - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir=$hardcode_libdirs - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath=$rpath - - if test -n "$libobjs" && test yes = "$build_old_libs"; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" false - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=: - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=false - ;; - *cygwin* | *mingw* ) - test yes = "$build_libtool_libs" || wrappers_required=false - ;; - *) - if test no = "$need_relink" || test yes != "$build_libtool_libs"; then - wrappers_required=false - fi - ;; - esac - $wrappers_required || { - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command=$compile_command$compile_rpath - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.$objext"; then - func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' - fi - - exit $exit_status - } - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test yes = "$no_install"; then - # We don't need to create a wrapper script. - link_command=$compile_var$compile_command$compile_rpath - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - case $hardcode_action,$fast_install in - relink,*) - # Fast installation is not supported - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "'$output' will be relinked during installation" - ;; - *,yes) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - ;; - *,no) - link_command=$compile_var$compile_command$compile_rpath - relink_command=$finalize_var$finalize_command$finalize_rpath - ;; - *,needless) - link_command=$finalize_var$compile_command$finalize_rpath - relink_command= - ;; - esac - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource=$output_path/$objdir/lt-$output_name.c - cwrapper=$output_path/$output_name.exe - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host"; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - case $build_libtool_libs in - convenience) - oldobjs="$libobjs_save $symfileobj" - addlibs=$convenience - build_libtool_libs=no - ;; - module) - oldobjs=$libobjs_save - addlibs=$old_convenience - build_libtool_libs=no - ;; - *) - oldobjs="$old_deplibs $non_pic_objects" - $preload && test -f "$symfileobj" \ - && func_append oldobjs " $symfileobj" - addlibs=$old_convenience - ;; - esac - - if test -n "$addlibs"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop=$output_objdir/${outputname}x - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase=$func_basename_result - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj"; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test -z "$oldobjs"; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test yes = "$build_old_libs" && old_library=$libname.$libext - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test yes = "$hardcode_automatic"; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test yes = "$installed"; then - if test -z "$install_libdir"; then - break - fi - output=$output_objdir/${outputname}i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name=$func_basename_result - func_resolve_sysroot "$deplib" - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` - test -z "$libdir" && \ - func_fatal_error "'$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs=$newdependency_libs - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles=$newdlfiles - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name=$func_basename_result - eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "'$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles=$newdlprefiles - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles=$newdlfiles - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles=$newdlprefiles - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test -n "$bindir"; then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result/$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that cannot go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test no,yes = "$installed,$need_relink"; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -if test link = "$opt_mode" || test relink = "$opt_mode"; then - func_mode_link ${1+"$@"} -fi - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $debug_cmd - - RM=$nonopt - files= - rmforce=false - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic=$magic - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=: ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir=$func_dirname_result - if test . = "$dir"; then - odir=$objdir - else - odir=$dir/$objdir - fi - func_basename "$file" - name=$func_basename_result - test uninstall = "$opt_mode" && odir=$dir - - # Remember odir for removal later, being careful to avoid duplicates - if test clean = "$opt_mode"; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif $rmforce; then - continue - fi - - rmfiles=$file - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case $opt_mode in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && test none != "$pic_object"; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && test none != "$non_pic_object"; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test clean = "$opt_mode"; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.$objext" - if test yes = "$fast_install" && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name"; then - func_append rmfiles " $odir/lt-$noexename.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the $objdir's in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then - func_mode_uninstall ${1+"$@"} -fi - -test -z "$opt_mode" && { - help=$generic_help - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode '$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# where we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End:
diff --git a/third_party/libxml/src/m4/libtool.m4 b/third_party/libxml/src/m4/libtool.m4 deleted file mode 100644 index a3bc337..0000000 --- a/third_party/libxml/src/m4/libtool.m4 +++ /dev/null
@@ -1,8369 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program or library that is built -# using GNU Libtool, you may include this file under the same -# distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -]) - -# serial 58 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_PREPARE_CC_BASENAME -# ----------------------- -m4_defun([_LT_PREPARE_CC_BASENAME], [ -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in @S|@*""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} -])# _LT_PREPARE_CC_BASENAME - - -# _LT_CC_BASENAME(CC) -# ------------------- -# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, -# but that macro is also expanded into generated libtool script, which -# arranges for $SED and $ECHO to be set by different means. -m4_defun([_LT_CC_BASENAME], -[m4_require([_LT_PREPARE_CC_BASENAME])dnl -AC_REQUIRE([_LT_DECL_SED])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl -func_cc_basename $1 -cc_basename=$func_cc_basename_result -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl -dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl -m4_require([_LT_CMD_TRUNCATE])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options that allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld=$lt_cv_prog_gnu_ld - -old_CC=$CC -old_CFLAGS=$CFLAGS - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from 'configure', and 'config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# 'config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain=$ac_aux_dir/ltmain.sh -])# _LT_PROG_LTMAIN - - -## ------------------------------------- ## -## Accumulate code for creating libtool. ## -## ------------------------------------- ## - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the 'libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - -## ------------------------ ## -## FIXME: Eliminate VARNAME ## -## ------------------------ ## - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to 'config.status' so that its -# declaration there will have the same value as in 'configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags='_LT_TAGS'dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into 'config.status', and then the shell code to quote escape them in -# for loops in 'config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -_LT_OUTPUT_LIBTOOL_INIT -]) - -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# '#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test 0 = "$lt_write_fail" && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -'$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to <bug-libtool@gnu.org>." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2011 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test 0 != $[#] -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try '$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try '$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test yes = "$silent" && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options that allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST - fi - - cfgfile=${ofile}T - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL -# Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. - -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit, 1996 - -_LT_COPYING -_LT_LIBTOOL_TAGS - -# Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - cat <<'_LT_EOF' >> "$cfgfile" - -# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE - -_LT_PREPARE_MUNGE_PATH_LIST -_LT_PREPARE_CC_BASENAME - -# ### END FUNCTIONS SHARED WITH CONFIGURE - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Go], [_LT_LANG(GO)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -m4_ifndef([AC_PROG_GO], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_GO. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ -m4_defun([AC_PROG_GO], -[AC_LANG_PUSH(Go)dnl -AC_ARG_VAR([GOC], [Go compiler command])dnl -AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl -_AC_ARG_VAR_LDFLAGS()dnl -AC_CHECK_TOOL(GOC, gccgo) -if test -z "$GOC"; then - if test -n "$ac_tool_prefix"; then - AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) - fi -fi -if test -z "$GOC"; then - AC_CHECK_PROG(GOC, gccgo, gccgo, false) -fi -])#m4_defun -])#m4_ifndef - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([AC_PROG_GO], - [LT_LANG(GO)], - [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS=$save_LDFLAGS - ]) - - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test yes = "$lt_cv_apple_cc_single_mod"; then - _lt_dar_single_mod='$single_module' - fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' - fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES([TAG]) -# --------------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test yes = "$lt_cv_ld_force_load"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], - [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - m4_if([$1], [CXX], -[ if test yes != "$lt_cv_apple_cc_single_mod"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script that will find a shell with a builtin -# printf (that we can use as an echo command). -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -case $ECHO in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], - [Search for dependent libraries within DIR (or the compiler's sysroot - if not specified).])], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case $with_sysroot in #( - yes) - if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([$with_sysroot]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac - - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and where our libraries should be installed.])]) - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test no = "$enable_libtool_lock" || enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE=32 - ;; - *ELF-64*) - HPUX_IA64_MODE=64 - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test yes != "$lt_cv_cc_needs_belf"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS - fi - ;; -*-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*|x86_64-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks=$enable_libtool_lock -])# _LT_ENABLE_LOCK - - -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test 0 -eq "$ac_status"; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test 0 -ne "$ac_status"; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test yes = "[$]$2"; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS -]) - -if test yes = "[$]$2"; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring=ABCD - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n "$lt_cv_sys_max_cmd_len"; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test yes = "$cross_compiling"; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test yes != "$enable_dlopen"; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen=load_add_on - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ - lt_cv_dlopen=dyld - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen=shl_load], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen=dlopen], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else - enable_dlopen=yes - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS=$LDFLAGS - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS=$LIBS - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test yes = "$lt_cv_dlopen_self"; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links=nottested -if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test no = "$hard_links"; then - AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", - [Define to the sub-directory where libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then - - # We can hardcode non-existent directories. - if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && - test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || - test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_PREPARE_MUNGE_PATH_LIST -# --------------------------- -# Make sure func_munge_path_list() is defined correctly. -m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], -[[# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x@S|@2 in - x) - ;; - *:) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" - ;; - x:*) - eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" - ;; - *) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" - ;; - esac -} -]])# _LT_PREPARE_PATH_LIST - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test yes = "$GCC"; then - case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -AC_ARG_VAR([LT_SYS_LIBRARY_PATH], -[User-defined run-time library search path.]) - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[[4-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a[(]lib.so.V[)]' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec=$LIB - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[23]].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], - [Detected run-time system search path for libraries]) -_LT_DECL([], [configure_time_lt_sys_library_path], [2], - [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program that can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$1"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac]) -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program that can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test no = "$withval" || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in - *GNU* | *'with BFD'*) - test no != "$with_gnu_ld" && break - ;; - *) - test yes != "$with_gnu_ld" && break - ;; - esac - fi - done - IFS=$lt_save_ifs -else - lt_cv_path_LD=$LD # Let the user override the test with a path. -fi]) -LD=$lt_cv_path_LD -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -_LT_PATH_LD_GNU -AC_SUBST([LD]) - -_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) -])# LT_PATH_LD - -# Old names: -AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) -AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_LD], []) -dnl AC_DEFUN([AC_PROG_LD], []) - - -# _LT_PATH_LD_GNU -#- -------------- -m4_defun([_LT_PATH_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac]) -with_gnu_ld=$lt_cv_prog_gnu_ld -])# _LT_PATH_LD_GNU - - -# _LT_CMD_RELOAD -# -------------- -# find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -m4_defun([_LT_CMD_RELOAD], -[AC_CACHE_CHECK([for $LD option to reload object files], - lt_cv_ld_reload_flag, - [lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then - reload_cmds=false - fi - ;; - darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac -_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_TAGDECL([], [reload_cmds], [2])dnl -])# _LT_CMD_RELOAD - - -# _LT_PATH_DD -# ----------- -# find a working dd -m4_defun([_LT_PATH_DD], -[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD], -[printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -: ${lt_DD:=$DD} -AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], -[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: -fi]) -rm -f conftest.i conftest2.i conftest.out]) -])# _LT_PATH_DD - - -# _LT_CMD_TRUNCATE -# ---------------- -# find command to truncate a binary pipe -m4_defun([_LT_CMD_TRUNCATE], -[m4_require([_LT_PATH_DD]) -AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], -[printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -lt_cv_truncate_bin= -if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" -fi -rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) -_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], - [Command to truncate a binary pipe]) -])# _LT_CMD_TRUNCATE - - -# _LT_CHECK_MAGIC_METHOD -# ---------------------- -# how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_MAGIC_METHOD], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -AC_CACHE_CHECK([how to recognize dependent libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[[4-9]]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[[45]]*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -os2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM=$NM -else - lt_nm_to_check=${ac_tool_prefix}nm - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty - case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; - *) lt_bad_file=/dev/null ;; - esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in - *$lt_bad_file* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break 2 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break 2 - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS=$lt_save_ifs - done - : ${lt_cv_path_NM=no} -fi]) -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" - ;; - *) - DUMPBIN=: - ;; - esac - fi - AC_SUBST([DUMPBIN]) - if test : != "$DUMPBIN"; then - NM=$DUMPBIN - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test yes != "$lt_cv_path_mainfest_tool"; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# _LT_DLL_DEF_P([FILE]) -# --------------------- -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with func_dll_def_p in the libtool script -AC_DEFUN([_LT_DLL_DEF_P], -[dnl - test DEF = "`$SED -n dnl - -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace - -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments - -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl - -e q dnl Only consider the first "real" line - $1`" dnl -])# _LT_DLL_DEF_P - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM=-lm) - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test yes = "$GCC"; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test ia64 = "$host_cpu"; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], - [Transform the output of nm into a list of symbols to manually relocate]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], - [The name lister interface]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test yes = "$GXX"; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - if test ia64 != "$host_cpu"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test yes = "$GCC"; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ F* | *Sun*Fortran*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Intel*\ [[CF]]*Compiler*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - *Portland\ Group*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - with_gnu_ld=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test yes = "$lt_use_gnu_ld_interface"; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test linux-dietlibc = "$host_os"; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - tcc*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' - ;; - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then - aix_use_runtimelinking=yes - break - fi - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # traditional, no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - ;; - esac - - if test yes = "$GCC"; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - ;; - - hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) - ;; - esac - fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS=$save_LDFLAGS]) - if test yes = "$lt_cv_irix_exported_symbol"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' - fi - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - linux*) - case $cc_basename in - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(ld_shlibs, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - osf3*) - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test sequent = "$host_vendor"; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test sni = "$host_vendor"; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting $shlibpath_var if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC=$CC -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report what library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC=$lt_save_CC -])# _LT_LANG_C_CONFIG - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test yes = "$GXX"; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test yes = "$GXX"; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test yes = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='$wl' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - ;; - esac - - if test yes = "$GXX"; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - # The "-G" linker flag allows undefined symbols. - _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared - # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require '-G' NOT '-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - - _LT_TAGVAR(GCC, $1)=$GXX - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test yes != "$_lt_caught_CXX_error" - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case @S|@2 in - .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; - *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF -package foo -func foo() { -} -_LT_EOF -]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test no = "$pre_test_object_deps_done"; then - case $prev in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)=$prev$p - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test no = "$pre_test_object_deps_done"; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)=$p - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)=$p - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test no = "$F77"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_F77"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)=$G77 - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_F77" - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test no = "$FC"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_FC"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_FC" - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_GO_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Go compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_GO_CONFIG], -[AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE - -# Source file extension for Go test sources. -ac_ext=go - -# Object file extension for compiled Go test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="package main; func main() { }" - -# Code to be used in simple link tests -lt_simple_link_test_code='package main; func main() { }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GOC-"gccgo"} -CFLAGS=$GOFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD -_LT_CC_BASENAME([$compiler]) - -# Go did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GO_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code=$lt_simple_compile_test_code - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_GO -# ---------- -AC_DEFUN([LT_PROG_GO], -[AC_CHECK_TOOL(GOC, gccgo,) -]) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -############################################################ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -############################################################ - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f "$lt_ac_sed" && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test 10 -lt "$lt_ac_count" && break - lt_ac_count=`expr $lt_ac_count + 1` - if test "$lt_ac_count" -gt "$lt_ac_max"; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine what file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/third_party/libxml/src/m4/ltoptions.m4 b/third_party/libxml/src/m4/ltoptions.m4 deleted file mode 100644 index 94b08297..0000000 --- a/third_party/libxml/src/m4/ltoptions.m4 +++ /dev/null
@@ -1,437 +0,0 @@ -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 8 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option '$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl 'shared' nor 'disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], - [_LT_WITH_AIX_SONAME([aix])]) - ]) -])# _LT_SET_OPTIONS - - -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the 'shared' and -# 'disable-shared' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the 'static' and -# 'disable-static' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the 'fast-install' -# and 'disable-fast-install' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_AIX_SONAME([DEFAULT]) -# ---------------------------------- -# implement the --with-aix-soname flag, and support the `aix-soname=aix' -# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT -# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. -m4_define([_LT_WITH_AIX_SONAME], -[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl -shared_archive_member_spec= -case $host,$enable_shared in -power*-*-aix[[5-9]]*,yes) - AC_MSG_CHECKING([which variant of shared library versioning to provide]) - AC_ARG_WITH([aix-soname], - [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], - [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], - [case $withval in - aix|svr4|both) - ;; - *) - AC_MSG_ERROR([Unknown argument to --with-aix-soname]) - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname], - [AC_CACHE_VAL([lt_cv_with_aix_soname], - [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) - with_aix_soname=$lt_cv_with_aix_soname]) - AC_MSG_RESULT([$with_aix_soname]) - if test aix != "$with_aix_soname"; then - # For the AIX way of multilib, we name the shared archive member - # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', - # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. - # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, - # the AIX toolchain works better with OBJECT_MODE set (default 32). - if test 64 = "${OBJECT_MODE-32}"; then - shared_archive_member_spec=shr_64 - else - shared_archive_member_spec=shr - fi - fi - ;; -*) - with_aix_soname=aix - ;; -esac - -_LT_DECL([], [shared_archive_member_spec], [0], - [Shared archive member basename, for filename based shared library versioning on AIX])dnl -])# _LT_WITH_AIX_SONAME - -LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) -LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) -LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' -# LT_INIT options. -# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [pic_mode=m4_default([$1], [default])]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - -## ----------------- ## -## LTDL_INIT Options ## -## ----------------- ## - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/third_party/libxml/src/m4/ltsugar.m4 b/third_party/libxml/src/m4/ltsugar.m4 deleted file mode 100644 index 9000a05..0000000 --- a/third_party/libxml/src/m4/ltsugar.m4 +++ /dev/null
@@ -1,123 +0,0 @@ -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -])
diff --git a/third_party/libxml/src/m4/ltversion.m4 b/third_party/libxml/src/m4/ltversion.m4 deleted file mode 100644 index fa04b52..0000000 --- a/third_party/libxml/src/m4/ltversion.m4 +++ /dev/null
@@ -1,23 +0,0 @@ -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# @configure_input@ - -# serial 4179 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -])
diff --git a/third_party/libxml/src/m4/lt~obsolete.m4 b/third_party/libxml/src/m4/lt~obsolete.m4 deleted file mode 100644 index c573da9..0000000 --- a/third_party/libxml/src/m4/lt~obsolete.m4 +++ /dev/null
@@ -1,98 +0,0 @@ -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/third_party/libxml/src/missing b/third_party/libxml/src/missing deleted file mode 100755 index db98974f..0000000 --- a/third_party/libxml/src/missing +++ /dev/null
@@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2013-10-28.13; # UTC - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to <bug-automake@gnu.org>." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
diff --git a/third_party/libxslt/chromium/roll.py b/third_party/libxslt/chromium/roll.py index 3b044aa..b731ab5c 100755 --- a/third_party/libxslt/chromium/roll.py +++ b/third_party/libxslt/chromium/roll.py
@@ -117,9 +117,20 @@ # encoding. 'src/NEWS', 'src/ChangeLog', - # These have shebang but not executable bit; presubmit will barf on them. - 'src/autogen.sh', + # These are auto-generated by autoconf/automake and should not be included + # with the source code + 'src/Makefile.in', + 'src/aclocal.m4', + 'src/compile', + 'src/config.guess', + 'src/config.sub', + 'src/configure', + 'src/depcomp', + 'src/install-sh', + 'src/libexslt/Makefile.in', + 'src/libxslt/Makefile.in', 'src/ltmain.sh', + 'src/missing', 'src/xslt-config.in', # These are not needed. 'src/doc',
diff --git a/third_party/libxslt/linux/Makefile b/third_party/libxslt/linux/Makefile deleted file mode 100644 index cf7495ae..0000000 --- a/third_party/libxslt/linux/Makefile +++ /dev/null
@@ -1,1071 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - - -VPATH = ../src -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/libxslt -pkgincludedir = $(includedir)/libxslt -pkglibdir = $(libdir)/libxslt -pkglibexecdir = $(libexecdir)/libxslt -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -subdir = . -DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog COPYING \ - $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(srcdir)/libxslt.pc.in \ - $(srcdir)/libexslt.pc.in $(srcdir)/xslt-config.in \ - $(srcdir)/libxslt.spec.in TODO compile config.guess config.sub \ - install-sh missing ltmain.sh -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = libxslt.pc libexslt.pc xslt-config libxslt.spec -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(confexecdir)" \ - "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)" -SCRIPTS = $(bin_SCRIPTS) -AM_V_P = $(am__v_P_$(V)) -am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -DATA = $(confexec_DATA) $(m4data_DATA) $(pkgconfig_DATA) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing aclocal-1.14 -AMTAR = $${TAR-tar} -AM_DEFAULT_VERBOSITY = 0 -AR = ar -AS = as -AUTOCONF = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing autoconf -AUTOHEADER = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing autoheader -AUTOMAKE = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing automake-1.14 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -Wall -Wformat=2 -Wmissing-format-attribute -CPP = gcc -E -CPPFLAGS = -CRYPTO_TESTDIR = crypto -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -DLLTOOL = false -DSYMUTIL = -DUMPBIN = -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -EXSLT_INCLUDEDIR = -I${includedir} -EXSLT_LIBDIR = -L${libdir} -EXSLT_LIBS = -lexslt -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -lgcrypt -EXTRA_LIBS = -FGREP = /bin/grep -F -GREP = /bin/grep -HTML_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -LIBEXSLT_MAJOR_VERSION = 0 -LIBEXSLT_MICRO_VERSION = 17 -LIBEXSLT_MINOR_VERSION = 8 -LIBEXSLT_VERSION = 0.8.17 -LIBEXSLT_VERSION_EXTRA = -LIBEXSLT_VERSION_INFO = 8:17:8 -LIBEXSLT_VERSION_NUMBER = 817 -LIBGCRYPT_CFLAGS = -LIBGCRYPT_CONFIG = /usr/bin/libgcrypt-config -LIBGCRYPT_LIBS = -lgcrypt -LIBOBJS = -LIBS = -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIBXML_CFLAGS = -I/usr/local/google/work/ca/src/third_party/libxml/linux/include -LIBXML_LIBS = -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -LIBXML_REQUIRED_VERSION = 2.6.27 -LIBXML_SRC = /usr/local/google/work/ca/src/third_party/libxml/linux -LIBXSLT_DEFAULT_PLUGINS_PATH = /usr/local/lib/libxslt-plugins -LIBXSLT_MAJOR_MINOR_VERSION = 1.1 -LIBXSLT_MAJOR_VERSION = 1 -LIBXSLT_MICRO_VERSION = 29 -LIBXSLT_MINOR_VERSION = 1 -LIBXSLT_VERSION = 1.1.29 -LIBXSLT_VERSION_EXTRA = -LIBXSLT_VERSION_INFO = 2:29:1 -LIBXSLT_VERSION_NUMBER = 10129 -LIPO = -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing makeinfo -MANIFEST_TOOL = : -MKDIR_P = /bin/mkdir -p -MV = /bin/mv -M_LIBS = -lm -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OTOOL = -OTOOL64 = -PACKAGE = libxslt -PACKAGE_BUGREPORT = -PACKAGE_NAME = -PACKAGE_STRING = -PACKAGE_TARNAME = -PACKAGE_URL = -PACKAGE_VERSION = -PATH_SEPARATOR = : -PERL = perl -PYTHON = /usr/bin/python -PYTHONSODV = -PYTHON_INCLUDES = /usr/include/python2.7 -PYTHON_LIBS = -lpthread -ldl -lutil -lm -lpython2.7 -PYTHON_SITE_PACKAGES = /usr/lib/python2.7/dist-packages -PYTHON_SUBDIR = python -PYTHON_VERSION = 2.7 -RANLIB = ranlib -RELDATE = Mon May 8 2017 -RM = /bin/rm -SED = /bin/sed -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -TAR = /bin/tar -THREAD_LIBS = -lpthread -VERSION = 1.1.29 -VERSION_SCRIPT_FLAGS = -Wl,--version-script= -WIN32_EXTRA_LDFLAGS = -WIN32_EXTRA_LIBADD = -WITH_CRYPTO = 1 -WITH_DEBUGGER = 0 -WITH_MEM_DEBUG = 0 -WITH_MODULES = 0 -WITH_TRIO = 0 -WITH_XSLT_DEBUG = 0 -XMLLINT = /usr/bin/xmllint -XML_CONFIG = /usr/local/google/work/ca/src/third_party/libxml/linux/xml2-config -XSLTPROC = /usr/bin/xsltproc -XSLTPROCDV = -XSLT_INCLUDEDIR = -I${includedir} -XSLT_LIBDIR = -L${libdir} -XSLT_LIBS = -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -XSLT_LOCALE_WINAPI = 0 -XSLT_LOCALE_XLOCALE = 1 -abs_builddir = /usr/local/google/work/ca/src/third_party/libxslt/linux -abs_srcdir = /usr/local/google/work/ca/src/third_party/libxslt/linux/../src -abs_top_builddir = /usr/local/google/work/ca/src/third_party/libxslt/linux -abs_top_srcdir = /usr/local/google/work/ca/src/third_party/libxslt/linux/../src -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_DUMPBIN = -am__include = include -am__leading_dot = . -am__quote = -am__tar = $${TAR-tar} chof - "$$tardir" -am__untar = $${TAR-tar} xf - -bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu -build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -docdir = ${datarootdir}/doc/${PACKAGE} -dvidir = ${docdir} -exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu -host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -mandir = ${datarootdir}/man -mkdir_p = $(MKDIR_P) -oldincludedir = /usr/include -pdfdir = ${docdir} -prefix = /usr/local -program_transform_name = s,x,x, -psdir = ${docdir} -pythondir = $(libdir)/python$(PYTHON_VERSION)/site-packages -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -srcdir = ../src -sysconfdir = ${prefix}/etc -target_alias = -top_build_prefix = -top_builddir = . -top_srcdir = ../src -SUBDIRS = \ - libxslt \ - libexslt \ - xsltproc \ - doc \ - $(PYTHON_SUBDIR) \ - tests - -DIST_SUBDIRS = libxslt libexslt xsltproc python doc tests -confexecdir = $(libdir) -confexec_DATA = xsltConf.sh -bin_SCRIPTS = xslt-config -CVS_EXTRA_DIST = -EXTRA_DIST = xsltConf.sh.in xslt-config.in libxslt.spec libxslt.spec.in \ - FEATURES TODO Copyright libxslt.m4 \ - win32/libxslt/libxslt.def win32/libxslt/libxslt.dsw \ - win32/libxslt/libxslt_so.dsp win32/libxslt/xsltproc.dsp \ - $(CVS_EXTRA_DIST) - -CLEANFILES = xsltConf.sh -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libxslt.pc libexslt.pc -m4datadir = $(datadir)/aclocal -m4data_DATA = libxslt.m4 -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -libxslt.pc: $(top_builddir)/config.status $(srcdir)/libxslt.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libexslt.pc: $(top_builddir)/config.status $(srcdir)/libexslt.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -xslt-config: $(top_builddir)/config.status $(srcdir)/xslt-config.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libxslt.spec: $(top_builddir)/config.status $(srcdir)/libxslt.spec.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt -install-confexecDATA: $(confexec_DATA) - @$(NORMAL_INSTALL) - @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(confexecdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(confexecdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confexecdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(confexecdir)" || exit $$?; \ - done - -uninstall-confexecDATA: - @$(NORMAL_UNINSTALL) - @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(confexecdir)'; $(am__uninstall_files_from_dir) -install-m4dataDATA: $(m4data_DATA) - @$(NORMAL_INSTALL) - @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(m4datadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(m4datadir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4datadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(m4datadir)" || exit $$?; \ - done - -uninstall-m4dataDATA: - @$(NORMAL_UNINSTALL) - @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(m4datadir)'; $(am__uninstall_files_from_dir) -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-local -check: check-recursive -all-am: Makefile $(SCRIPTS) $(DATA) config.h -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(confexecdir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: install-m4dataDATA install-pkgconfigDATA - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: install-binSCRIPTS install-confexecDATA - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-binSCRIPTS uninstall-confexecDATA \ - uninstall-m4dataDATA uninstall-pkgconfigDATA - -.MAKE: $(am__recursive_targets) all check-am install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am check-local clean clean-cscope \ - clean-generic clean-libtool cscope cscopelist-am ctags \ - ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-binSCRIPTS install-confexecDATA 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-m4dataDATA install-man install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-binSCRIPTS uninstall-confexecDATA \ - uninstall-m4dataDATA uninstall-pkgconfigDATA - - -dist-hook: cleanup libxslt.spec - touch $(distdir)/doc/*.xml - touch $(distdir)/doc/EXSLT/*.xml - touch $(distdir)/libxslt/*.syms - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn win32 vms examples) | (cd $(distdir); tar xf -) - -xsltConf.sh: xsltConf.sh.in Makefile - sed -e 's?\@XSLT_LIBDIR\@?$(XSLT_LIBDIR)?g' \ - -e 's?\@XSLT_INCLUDEDIR\@?$(XSLT_INCLUDEDIR)?g' \ - -e 's?\@VERSION\@?$(VERSION)?g' \ - -e 's?\@XSLT_LIBS\@?$(XSLT_LIBS) $(EXTRA_LIBS)?g' \ - < $(srcdir)/xsltConf.sh.in > xsltConf.tmp \ - && mv xsltConf.tmp xsltConf.sh - -check-local: tests - -dummy: - -tests: dummy - @echo '## Running the regression test suite' - @(cd tests ; $(MAKE) tests) - @(cd xsltproc ; $(MAKE) tests) - @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; $(MAKE) tests ; fi) - -valgrind: - @echo '## Running the regression tests under Valgrind' - @echo '## Go get a cup of coffee it is gonna take a while ...' - @(cd tests ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests) - @(cd xsltproc ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests) - -cleanup: - -@(find . -name .\#\* -exec rm {} \;) - -cleantar: - @(rm -f libxslt*.tar.gz) - -rpm: cleantar - @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxslt/linux/config.log b/third_party/libxslt/linux/config.log deleted file mode 100644 index 3b9e5cf..0000000 --- a/third_party/libxslt/linux/config.log +++ /dev/null
@@ -1,2156 +0,0 @@ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by configure, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ ../src/configure --without-debug --without-debugger --without-mem-debug --without-plugins --with-libxml-src=/usr/local/google/work/ca/src/third_party/libxml/linux - -## --------- ## -## Platform. ## -## --------- ## - -hostname = REDACTED -uname -m = x86_64 -uname -r = 3.13.0-108-generic -uname -s = Linux -uname -v = #155-Ubuntu SMP Wed Jan 11 16:58:52 UTC 2017 - -/usr/bin/uname -p = unknown -/bin/uname -X = unknown - -/bin/arch = unknown -/usr/bin/arch -k = unknown -/usr/convex/getsysinfo = unknown -/usr/bin/hostinfo = unknown -/bin/machine = unknown -/usr/bin/oslevel = unknown -/bin/universe = unknown - -PATH: /usr/local/google/home/dominicc/depot_tools -PATH: /usr/local/google/home/dominicc/depot_tools -PATH: /usr/lib/google-golang/bin -PATH: /usr/local/buildtools/java/jdk/bin -PATH: /usr/local/sbin -PATH: /usr/local/bin -PATH: /usr/sbin -PATH: /usr/bin -PATH: /sbin -PATH: /bin - - -## ----------- ## -## Core tests. ## -## ----------- ## - -configure:2328: checking build system type -configure:2342: result: x86_64-unknown-linux-gnu -configure:2362: checking host system type -configure:2375: result: x86_64-unknown-linux-gnu -configure:2446: checking for gcc -configure:2462: found /usr/bin/gcc -configure:2473: result: gcc -configure:2702: checking for C compiler version -configure:2711: gcc --version >&5 -gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 -Copyright (C) 2013 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -configure:2722: $? = 0 -configure:2711: gcc -v >&5 -Using built-in specs. -COLLECT_GCC=gcc -COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper -Target: x86_64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu -Thread model: posix -gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) -configure:2722: $? = 0 -configure:2711: gcc -V >&5 -gcc: error: unrecognized command line option '-V' -gcc: fatal error: no input files -compilation terminated. -configure:2722: $? = 4 -configure:2711: gcc -qversion >&5 -gcc: error: unrecognized command line option '-qversion' -gcc: fatal error: no input files -compilation terminated. -configure:2722: $? = 4 -configure:2742: checking whether the C compiler works -configure:2764: gcc conftest.c >&5 -configure:2768: $? = 0 -configure:2816: result: yes -configure:2819: checking for C compiler default output file name -configure:2821: result: a.out -configure:2827: checking for suffix of executables -configure:2834: gcc -o conftest conftest.c >&5 -configure:2838: $? = 0 -configure:2860: result: -configure:2882: checking whether we are cross compiling -configure:2890: gcc -o conftest conftest.c >&5 -configure:2894: $? = 0 -configure:2901: ./conftest -configure:2905: $? = 0 -configure:2920: result: no -configure:2925: checking for suffix of object files -configure:2947: gcc -c conftest.c >&5 -configure:2951: $? = 0 -configure:2972: result: o -configure:2976: checking whether we are using the GNU C compiler -configure:2995: gcc -c conftest.c >&5 -configure:2995: $? = 0 -configure:3004: result: yes -configure:3013: checking whether gcc accepts -g -configure:3033: gcc -c -g conftest.c >&5 -configure:3033: $? = 0 -configure:3074: result: yes -configure:3091: checking for gcc option to accept ISO C89 -configure:3154: gcc -c -g -O2 conftest.c >&5 -configure:3154: $? = 0 -configure:3167: result: none needed -configure:3192: checking whether gcc understands -c and -o together -configure:3214: gcc -c conftest.c -o conftest2.o -configure:3217: $? = 0 -configure:3214: gcc -c conftest.c -o conftest2.o -configure:3217: $? = 0 -configure:3229: result: yes -configure:3252: checking how to run the C preprocessor -configure:3283: gcc -E conftest.c -configure:3283: $? = 0 -configure:3297: gcc -E conftest.c -conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory - #include <ac_nonexistent.h> - ^ -compilation terminated. -configure:3297: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| /* end confdefs.h. */ -| #include <ac_nonexistent.h> -configure:3322: result: gcc -E -configure:3342: gcc -E conftest.c -configure:3342: $? = 0 -configure:3356: gcc -E conftest.c -conftest.c:9:28: fatal error: ac_nonexistent.h: No such file or directory - #include <ac_nonexistent.h> - ^ -compilation terminated. -configure:3356: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| /* end confdefs.h. */ -| #include <ac_nonexistent.h> -configure:3385: checking for grep that handles long lines and -e -configure:3443: result: /bin/grep -configure:3448: checking for egrep -configure:3510: result: /bin/grep -E -configure:3515: checking for ANSI C header files -configure:3535: gcc -c -g -O2 conftest.c >&5 -configure:3535: $? = 0 -configure:3608: gcc -o conftest -g -O2 conftest.c >&5 -configure:3608: $? = 0 -configure:3608: ./conftest -configure:3608: $? = 0 -configure:3619: result: yes -configure:3632: checking for sys/types.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3632: checking for sys/stat.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3632: checking for stdlib.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3632: checking for string.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3632: checking for memory.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3632: checking for strings.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3632: checking for inttypes.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3632: checking for stdint.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3632: checking for unistd.h -configure:3632: gcc -c -g -O2 conftest.c >&5 -configure:3632: $? = 0 -configure:3632: result: yes -configure:3645: checking minix/config.h usability -configure:3645: gcc -c -g -O2 conftest.c >&5 -conftest.c:52:26: fatal error: minix/config.h: No such file or directory - #include <minix/config.h> - ^ -compilation terminated. -configure:3645: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| /* end confdefs.h. */ -| #include <stdio.h> -| #ifdef HAVE_SYS_TYPES_H -| # include <sys/types.h> -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include <sys/stat.h> -| #endif -| #ifdef STDC_HEADERS -| # include <stdlib.h> -| # include <stddef.h> -| #else -| # ifdef HAVE_STDLIB_H -| # include <stdlib.h> -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include <memory.h> -| # endif -| # include <string.h> -| #endif -| #ifdef HAVE_STRINGS_H -| # include <strings.h> -| #endif -| #ifdef HAVE_INTTYPES_H -| # include <inttypes.h> -| #endif -| #ifdef HAVE_STDINT_H -| # include <stdint.h> -| #endif -| #ifdef HAVE_UNISTD_H -| # include <unistd.h> -| #endif -| #include <minix/config.h> -configure:3645: result: no -configure:3645: checking minix/config.h presence -configure:3645: gcc -E conftest.c -conftest.c:19:26: fatal error: minix/config.h: No such file or directory - #include <minix/config.h> - ^ -compilation terminated. -configure:3645: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| /* end confdefs.h. */ -| #include <minix/config.h> -configure:3645: result: no -configure:3645: checking for minix/config.h -configure:3645: result: no -configure:3666: checking whether it is safe to define __EXTENSIONS__ -configure:3684: gcc -c -g -O2 conftest.c >&5 -configure:3684: $? = 0 -configure:3691: result: yes -configure:3792: checking for a BSD-compatible install -configure:3860: result: /usr/bin/install -c -configure:3871: checking whether build environment is sane -configure:3926: result: yes -configure:4074: checking for a thread-safe mkdir -p -configure:4113: result: /bin/mkdir -p -configure:4120: checking for gawk -configure:4136: found /usr/bin/gawk -configure:4147: result: gawk -configure:4158: checking whether make sets $(MAKE) -configure:4180: result: yes -configure:4210: checking for style of include used by make -configure:4238: result: GNU -configure:4272: checking whether make supports nested variables -configure:4289: result: yes -configure:4375: checking dependency style of gcc -configure:4486: result: gcc3 -configure:4560: checking whether make supports nested variables -configure:4577: result: yes -configure:4659: checking for gcc -configure:4686: result: gcc -configure:4915: checking for C compiler version -configure:4924: gcc --version >&5 -gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 -Copyright (C) 2013 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -configure:4935: $? = 0 -configure:4924: gcc -v >&5 -Using built-in specs. -COLLECT_GCC=gcc -COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper -Target: x86_64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.3' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu -Thread model: posix -gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) -configure:4935: $? = 0 -configure:4924: gcc -V >&5 -gcc: error: unrecognized command line option '-V' -gcc: fatal error: no input files -compilation terminated. -configure:4935: $? = 4 -configure:4924: gcc -qversion >&5 -gcc: error: unrecognized command line option '-qversion' -gcc: fatal error: no input files -compilation terminated. -configure:4935: $? = 4 -configure:4939: checking whether we are using the GNU C compiler -configure:4967: result: yes -configure:4976: checking whether gcc accepts -g -configure:5037: result: yes -configure:5054: checking for gcc option to accept ISO C89 -configure:5130: result: none needed -configure:5155: checking whether gcc understands -c and -o together -configure:5192: result: yes -configure:5215: checking how to run the C preprocessor -configure:5285: result: gcc -E -configure:5305: gcc -E conftest.c -configure:5305: $? = 0 -configure:5319: gcc -E conftest.c -conftest.c:26:28: fatal error: ac_nonexistent.h: No such file or directory - #include <ac_nonexistent.h> - ^ -compilation terminated. -configure:5319: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| /* end confdefs.h. */ -| #include <ac_nonexistent.h> -configure:5349: checking for rm -configure:5367: found /bin/rm -configure:5380: result: /bin/rm -configure:5390: checking for mv -configure:5408: found /bin/mv -configure:5421: result: /bin/mv -configure:5431: checking for tar -configure:5449: found /bin/tar -configure:5462: result: /bin/tar -configure:5472: checking for xmllint -configure:5490: found /usr/bin/xmllint -configure:5503: result: /usr/bin/xmllint -configure:5513: checking for xsltproc -configure:5531: found /usr/bin/xsltproc -configure:5544: result: /usr/bin/xsltproc -configure:5553: checking for ANSI C header files -configure:5657: result: yes -configure:5712: checking how to print strings -configure:5739: result: printf -configure:5760: checking for a sed that does not truncate output -configure:5824: result: /bin/sed -configure:5842: checking for fgrep -configure:5904: result: /bin/grep -F -configure:5939: checking for ld used by gcc -configure:6006: result: /usr/bin/ld -configure:6013: checking if the linker (/usr/bin/ld) is GNU ld -configure:6028: result: yes -configure:6040: checking for BSD- or MS-compatible name lister (nm) -configure:6089: result: /usr/bin/nm -B -configure:6219: checking the name lister (/usr/bin/nm -B) interface -configure:6226: gcc -c -g -O2 conftest.c >&5 -configure:6229: /usr/bin/nm -B "conftest.o" -configure:6232: output -0000000000000000 B some_variable -configure:6239: result: BSD nm -configure:6242: checking whether ln -s works -configure:6246: result: yes -configure:6254: checking the maximum length of command line arguments -configure:6385: result: 1572864 -configure:6402: checking whether the shell understands some XSI constructs -configure:6412: result: yes -configure:6416: checking whether the shell understands "+=" -configure:6422: result: yes -configure:6457: checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format -configure:6497: result: func_convert_file_noop -configure:6504: checking how to convert x86_64-unknown-linux-gnu file names to toolchain format -configure:6524: result: func_convert_file_noop -configure:6531: checking for /usr/bin/ld option to reload object files -configure:6538: result: -r -configure:6612: checking for objdump -configure:6628: found /usr/bin/objdump -configure:6639: result: objdump -configure:6668: checking how to recognize dependent libraries -configure:6866: result: pass_all -configure:6951: checking for dlltool -configure:6981: result: no -configure:7008: checking how to associate runtime and link libraries -configure:7035: result: printf %s\n -configure:7095: checking for ar -configure:7111: found /usr/bin/ar -configure:7122: result: ar -configure:7159: checking for archiver @FILE support -configure:7176: gcc -c -g -O2 conftest.c >&5 -configure:7176: $? = 0 -configure:7179: ar cru libconftest.a @conftest.lst >&5 -configure:7182: $? = 0 -configure:7187: ar cru libconftest.a @conftest.lst >&5 -ar: conftest.o: No such file or directory -configure:7190: $? = 1 -configure:7202: result: @ -configure:7260: checking for strip -configure:7276: found /usr/bin/strip -configure:7287: result: strip -configure:7359: checking for ranlib -configure:7375: found /usr/bin/ranlib -configure:7386: result: ranlib -configure:7488: checking command to parse /usr/bin/nm -B output from gcc object -configure:7608: gcc -c -g -O2 conftest.c >&5 -configure:7611: $? = 0 -configure:7615: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm -configure:7618: $? = 0 -configure:7684: gcc -o conftest -g -O2 conftest.c conftstm.o >&5 -configure:7687: $? = 0 -configure:7725: result: ok -configure:7762: checking for sysroot -configure:7792: result: no -configure:7869: gcc -c -g -O2 conftest.c >&5 -configure:7872: $? = 0 -configure:8061: checking for mt -configure:8077: found /bin/mt -configure:8088: result: mt -configure:8111: checking if mt is a manifest tool -configure:8117: mt '-?' -configure:8125: result: no -configure:8764: checking for dlfcn.h -configure:8764: gcc -c -g -O2 conftest.c >&5 -configure:8764: $? = 0 -configure:8764: result: yes -configure:9268: checking for objdir -configure:9283: result: .libs -configure:9550: checking if gcc supports -fno-rtti -fno-exceptions -configure:9568: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 -cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C [enabled by default] -configure:9572: $? = 0 -configure:9585: result: no -configure:9912: checking for gcc option to produce PIC -configure:9919: result: -fPIC -DPIC -configure:9927: checking if gcc PIC flag -fPIC -DPIC works -configure:9945: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 -configure:9949: $? = 0 -configure:9962: result: yes -configure:9991: checking if gcc static flag -static works -configure:10019: result: yes -configure:10034: checking if gcc supports -c -o file.o -configure:10055: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 -configure:10059: $? = 0 -configure:10081: result: yes -configure:10089: checking if gcc supports -c -o file.o -configure:10136: result: yes -configure:10169: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries -configure:11326: result: yes -configure:11363: checking whether -lc should be explicitly linked in -configure:11371: gcc -c -g -O2 conftest.c >&5 -configure:11374: $? = 0 -configure:11389: gcc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /bin/grep -lc \>/dev/null 2\>\&1 -configure:11392: $? = 0 -configure:11406: result: no -configure:11566: checking dynamic linker characteristics -configure:12066: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5 -configure:12066: $? = 0 -configure:12300: result: GNU/Linux ld.so -configure:12407: checking how to hardcode library paths into programs -configure:12432: result: immediate -configure:12972: checking whether stripping libraries is possible -configure:12977: result: yes -configure:13012: checking if libtool supports shared libraries -configure:13014: result: yes -configure:13017: checking whether to build shared libraries -configure:13038: result: yes -configure:13041: checking whether to build static libraries -configure:13045: result: yes -configure:13087: checking for sys/types.h -configure:13087: result: yes -configure:13087: checking sys/time.h usability -configure:13087: gcc -c -g -O2 conftest.c >&5 -configure:13087: $? = 0 -configure:13087: result: yes -configure:13087: checking sys/time.h presence -configure:13087: gcc -E conftest.c -configure:13087: $? = 0 -configure:13087: result: yes -configure:13087: checking for sys/time.h -configure:13087: result: yes -configure:13087: checking for stdlib.h -configure:13087: result: yes -configure:13087: checking for unistd.h -configure:13087: result: yes -configure:13087: checking for string.h -configure:13087: result: yes -configure:13098: checking how to pass version script to the linker (/usr/bin/ld -m elf_x86_64) -configure:13106: result: -Wl,--version-script= -configure:13122: checking pthread.h usability -configure:13122: gcc -c -g -O2 conftest.c >&5 -configure:13122: $? = 0 -configure:13122: result: yes -configure:13122: checking pthread.h presence -configure:13122: gcc -E conftest.c -configure:13122: $? = 0 -configure:13122: result: yes -configure:13122: checking for pthread.h -configure:13122: result: yes -configure:13124: checking for pthread_join in -lpthread -configure:13149: gcc -o conftest -g -O2 conftest.c -lpthread >&5 -configure:13149: $? = 0 -configure:13158: result: yes -configure:13186: checking locale.h usability -configure:13186: gcc -c -g -O2 conftest.c >&5 -configure:13186: $? = 0 -configure:13186: result: yes -configure:13186: checking locale.h presence -configure:13186: gcc -E conftest.c -configure:13186: $? = 0 -configure:13186: result: yes -configure:13186: checking for locale.h -configure:13186: result: yes -configure:13186: checking xlocale.h usability -configure:13186: gcc -c -g -O2 conftest.c >&5 -configure:13186: $? = 0 -configure:13186: result: yes -configure:13186: checking xlocale.h presence -configure:13186: gcc -E conftest.c -configure:13186: $? = 0 -configure:13186: result: yes -configure:13186: checking for xlocale.h -configure:13186: result: yes -configure:13197: checking if xlocale program link -configure:13255: gcc -o conftest -g -O2 conftest.c >&5 -configure:13255: $? = 0 -configure:13256: result: yes -configure:13281: checking ieeefp.h usability -configure:13281: gcc -c -g -O2 conftest.c >&5 -conftest.c:71:20: fatal error: ieeefp.h: No such file or directory - #include <ieeefp.h> - ^ -compilation terminated. -configure:13281: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| /* end confdefs.h. */ -| #include <stdio.h> -| #ifdef HAVE_SYS_TYPES_H -| # include <sys/types.h> -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include <sys/stat.h> -| #endif -| #ifdef STDC_HEADERS -| # include <stdlib.h> -| # include <stddef.h> -| #else -| # ifdef HAVE_STDLIB_H -| # include <stdlib.h> -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include <memory.h> -| # endif -| # include <string.h> -| #endif -| #ifdef HAVE_STRINGS_H -| # include <strings.h> -| #endif -| #ifdef HAVE_INTTYPES_H -| # include <inttypes.h> -| #endif -| #ifdef HAVE_STDINT_H -| # include <stdint.h> -| #endif -| #ifdef HAVE_UNISTD_H -| # include <unistd.h> -| #endif -| #include <ieeefp.h> -configure:13281: result: no -configure:13281: checking ieeefp.h presence -configure:13281: gcc -E conftest.c -conftest.c:38:20: fatal error: ieeefp.h: No such file or directory - #include <ieeefp.h> - ^ -compilation terminated. -configure:13281: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| /* end confdefs.h. */ -| #include <ieeefp.h> -configure:13281: result: no -configure:13281: checking for ieeefp.h -configure:13281: result: no -configure:13281: checking nan.h usability -configure:13281: gcc -c -g -O2 conftest.c >&5 -conftest.c:71:17: fatal error: nan.h: No such file or directory - #include <nan.h> - ^ -compilation terminated. -configure:13281: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| /* end confdefs.h. */ -| #include <stdio.h> -| #ifdef HAVE_SYS_TYPES_H -| # include <sys/types.h> -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include <sys/stat.h> -| #endif -| #ifdef STDC_HEADERS -| # include <stdlib.h> -| # include <stddef.h> -| #else -| # ifdef HAVE_STDLIB_H -| # include <stdlib.h> -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include <memory.h> -| # endif -| # include <string.h> -| #endif -| #ifdef HAVE_STRINGS_H -| # include <strings.h> -| #endif -| #ifdef HAVE_INTTYPES_H -| # include <inttypes.h> -| #endif -| #ifdef HAVE_STDINT_H -| # include <stdint.h> -| #endif -| #ifdef HAVE_UNISTD_H -| # include <unistd.h> -| #endif -| #include <nan.h> -configure:13281: result: no -configure:13281: checking nan.h presence -configure:13281: gcc -E conftest.c -conftest.c:38:17: fatal error: nan.h: No such file or directory - #include <nan.h> - ^ -compilation terminated. -configure:13281: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| /* end confdefs.h. */ -| #include <nan.h> -configure:13281: result: no -configure:13281: checking for nan.h -configure:13281: result: no -configure:13281: checking math.h usability -configure:13281: gcc -c -g -O2 conftest.c >&5 -configure:13281: $? = 0 -configure:13281: result: yes -configure:13281: checking math.h presence -configure:13281: gcc -E conftest.c -configure:13281: $? = 0 -configure:13281: result: yes -configure:13281: checking for math.h -configure:13281: result: yes -configure:13281: checking fp_class.h usability -configure:13281: gcc -c -g -O2 conftest.c >&5 -conftest.c:72:22: fatal error: fp_class.h: No such file or directory - #include <fp_class.h> - ^ -compilation terminated. -configure:13281: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| #define HAVE_MATH_H 1 -| /* end confdefs.h. */ -| #include <stdio.h> -| #ifdef HAVE_SYS_TYPES_H -| # include <sys/types.h> -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include <sys/stat.h> -| #endif -| #ifdef STDC_HEADERS -| # include <stdlib.h> -| # include <stddef.h> -| #else -| # ifdef HAVE_STDLIB_H -| # include <stdlib.h> -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include <memory.h> -| # endif -| # include <string.h> -| #endif -| #ifdef HAVE_STRINGS_H -| # include <strings.h> -| #endif -| #ifdef HAVE_INTTYPES_H -| # include <inttypes.h> -| #endif -| #ifdef HAVE_STDINT_H -| # include <stdint.h> -| #endif -| #ifdef HAVE_UNISTD_H -| # include <unistd.h> -| #endif -| #include <fp_class.h> -configure:13281: result: no -configure:13281: checking fp_class.h presence -configure:13281: gcc -E conftest.c -conftest.c:39:22: fatal error: fp_class.h: No such file or directory - #include <fp_class.h> - ^ -compilation terminated. -configure:13281: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| #define HAVE_MATH_H 1 -| /* end confdefs.h. */ -| #include <fp_class.h> -configure:13281: result: no -configure:13281: checking for fp_class.h -configure:13281: result: no -configure:13281: checking float.h usability -configure:13281: gcc -c -g -O2 conftest.c >&5 -configure:13281: $? = 0 -configure:13281: result: yes -configure:13281: checking float.h presence -configure:13281: gcc -E conftest.c -configure:13281: $? = 0 -configure:13281: result: yes -configure:13281: checking for float.h -configure:13281: result: yes -configure:13281: checking ansidecl.h usability -configure:13281: gcc -c -g -O2 conftest.c >&5 -conftest.c:73:22: fatal error: ansidecl.h: No such file or directory - #include <ansidecl.h> - ^ -compilation terminated. -configure:13281: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| #define HAVE_MATH_H 1 -| #define HAVE_FLOAT_H 1 -| /* end confdefs.h. */ -| #include <stdio.h> -| #ifdef HAVE_SYS_TYPES_H -| # include <sys/types.h> -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include <sys/stat.h> -| #endif -| #ifdef STDC_HEADERS -| # include <stdlib.h> -| # include <stddef.h> -| #else -| # ifdef HAVE_STDLIB_H -| # include <stdlib.h> -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include <memory.h> -| # endif -| # include <string.h> -| #endif -| #ifdef HAVE_STRINGS_H -| # include <strings.h> -| #endif -| #ifdef HAVE_INTTYPES_H -| # include <inttypes.h> -| #endif -| #ifdef HAVE_STDINT_H -| # include <stdint.h> -| #endif -| #ifdef HAVE_UNISTD_H -| # include <unistd.h> -| #endif -| #include <ansidecl.h> -configure:13281: result: no -configure:13281: checking ansidecl.h presence -configure:13281: gcc -E conftest.c -conftest.c:40:22: fatal error: ansidecl.h: No such file or directory - #include <ansidecl.h> - ^ -compilation terminated. -configure:13281: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| #define HAVE_MATH_H 1 -| #define HAVE_FLOAT_H 1 -| /* end confdefs.h. */ -| #include <ansidecl.h> -configure:13281: result: no -configure:13281: checking for ansidecl.h -configure:13281: result: no -configure:13294: checking sys/timeb.h usability -configure:13294: gcc -c -g -O2 conftest.c >&5 -configure:13294: $? = 0 -configure:13294: result: yes -configure:13294: checking sys/timeb.h presence -configure:13294: gcc -E conftest.c -configure:13294: $? = 0 -configure:13294: result: yes -configure:13294: checking for sys/timeb.h -configure:13294: result: yes -configure:13294: checking time.h usability -configure:13294: gcc -c -g -O2 conftest.c >&5 -configure:13294: $? = 0 -configure:13294: result: yes -configure:13294: checking time.h presence -configure:13294: gcc -E conftest.c -configure:13294: $? = 0 -configure:13294: result: yes -configure:13294: checking for time.h -configure:13294: result: yes -configure:13294: checking for sys/stat.h -configure:13294: result: yes -configure:13294: checking sys/select.h usability -configure:13294: gcc -c -g -O2 conftest.c >&5 -configure:13294: $? = 0 -configure:13294: result: yes -configure:13294: checking sys/select.h presence -configure:13294: gcc -E conftest.c -configure:13294: $? = 0 -configure:13294: result: yes -configure:13294: checking for sys/select.h -configure:13294: result: yes -configure:13294: checking stdarg.h usability -configure:13294: gcc -c -g -O2 conftest.c >&5 -configure:13294: $? = 0 -configure:13294: result: yes -configure:13294: checking stdarg.h presence -configure:13294: gcc -E conftest.c -configure:13294: $? = 0 -configure:13294: result: yes -configure:13294: checking for stdarg.h -configure:13294: result: yes -configure:13306: checking errno.h usability -configure:13306: gcc -c -g -O2 conftest.c >&5 -configure:13306: $? = 0 -configure:13306: result: yes -configure:13306: checking errno.h presence -configure:13306: gcc -E conftest.c -configure:13306: $? = 0 -configure:13306: result: yes -configure:13306: checking for errno.h -configure:13306: result: yes -configure:13319: checking for stat -configure:13319: gcc -o conftest -g -O2 conftest.c >&5 -configure:13319: $? = 0 -configure:13319: result: yes -configure:13319: checking for _stat -configure:13319: gcc -o conftest -g -O2 conftest.c >&5 -/tmp/cc3qGAxT.o: In function `main': -/usr/local/google/work/ca/src/third_party/libxslt/linux/conftest.c:81: undefined reference to `_stat' -collect2: error: ld returned 1 exit status -configure:13319: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| #define HAVE_MATH_H 1 -| #define HAVE_FLOAT_H 1 -| #define HAVE_SYS_TIMEB_H 1 -| #define HAVE_TIME_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_SYS_SELECT_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_ERRNO_H 1 -| #define HAVE_STAT 1 -| /* end confdefs.h. */ -| /* Define _stat to an innocuous variant, in case <limits.h> declares _stat. -| For example, HP-UX 11i <limits.h> declares gettimeofday. */ -| #define _stat innocuous__stat -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char _stat (); below. -| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since -| <limits.h> exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include <limits.h> -| #else -| # include <assert.h> -| #endif -| -| #undef _stat -| -| /* Override any GCC internal prototype to avoid an error. -| Use char because int might match the return type of a GCC -| builtin and then its argument prototype would still apply. */ -| #ifdef __cplusplus -| extern "C" -| #endif -| char _stat (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined __stub__stat || defined __stub____stat -| choke me -| #endif -| -| int -| main () -| { -| return _stat (); -| ; -| return 0; -| } -configure:13319: result: no -configure:13328: checking for pow -configure:13328: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:70:6: warning: conflicting types for built-in function 'pow' [enabled by default] - char pow (); - ^ -/tmp/ccb9DfHV.o: In function `main': -/usr/local/google/work/ca/src/third_party/libxslt/linux/conftest.c:81: undefined reference to `pow' -collect2: error: ld returned 1 exit status -configure:13328: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| #define HAVE_MATH_H 1 -| #define HAVE_FLOAT_H 1 -| #define HAVE_SYS_TIMEB_H 1 -| #define HAVE_TIME_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_SYS_SELECT_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_ERRNO_H 1 -| #define HAVE_STAT 1 -| /* end confdefs.h. */ -| /* Define pow to an innocuous variant, in case <limits.h> declares pow. -| For example, HP-UX 11i <limits.h> declares gettimeofday. */ -| #define pow innocuous_pow -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char pow (); below. -| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since -| <limits.h> exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include <limits.h> -| #else -| # include <assert.h> -| #endif -| -| #undef pow -| -| /* Override any GCC internal prototype to avoid an error. -| Use char because int might match the return type of a GCC -| builtin and then its argument prototype would still apply. */ -| #ifdef __cplusplus -| extern "C" -| #endif -| char pow (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined __stub_pow || defined __stub___pow -| choke me -| #endif -| -| int -| main () -| { -| return pow (); -| ; -| return 0; -| } -configure:13328: result: no -configure:13332: checking for pow in -lm -configure:13357: gcc -o conftest -g -O2 conftest.c -lm >&5 -conftest.c:54:6: warning: conflicting types for built-in function 'pow' [enabled by default] - char pow (); - ^ -configure:13357: $? = 0 -configure:13366: result: yes -configure:13377: checking for floor -configure:13377: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:71:6: warning: conflicting types for built-in function 'floor' [enabled by default] - char floor (); - ^ -/tmp/ccD4WWW5.o: In function `main': -/usr/local/google/work/ca/src/third_party/libxslt/linux/conftest.c:82: undefined reference to `floor' -collect2: error: ld returned 1 exit status -configure:13377: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| #define HAVE_MATH_H 1 -| #define HAVE_FLOAT_H 1 -| #define HAVE_SYS_TIMEB_H 1 -| #define HAVE_TIME_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_SYS_SELECT_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_ERRNO_H 1 -| #define HAVE_STAT 1 -| #define HAVE_POW /**/ -| /* end confdefs.h. */ -| /* Define floor to an innocuous variant, in case <limits.h> declares floor. -| For example, HP-UX 11i <limits.h> declares gettimeofday. */ -| #define floor innocuous_floor -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char floor (); below. -| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since -| <limits.h> exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include <limits.h> -| #else -| # include <assert.h> -| #endif -| -| #undef floor -| -| /* Override any GCC internal prototype to avoid an error. -| Use char because int might match the return type of a GCC -| builtin and then its argument prototype would still apply. */ -| #ifdef __cplusplus -| extern "C" -| #endif -| char floor (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined __stub_floor || defined __stub___floor -| choke me -| #endif -| -| int -| main () -| { -| return floor (); -| ; -| return 0; -| } -configure:13377: result: no -configure:13381: checking for floor in -lm -configure:13406: gcc -o conftest -g -O2 conftest.c -lm >&5 -conftest.c:55:6: warning: conflicting types for built-in function 'floor' [enabled by default] - char floor (); - ^ -configure:13406: $? = 0 -configure:13415: result: yes -configure:13426: checking for fabs -configure:13426: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:72:6: warning: conflicting types for built-in function 'fabs' [enabled by default] - char fabs (); - ^ -/tmp/cchlGQle.o: In function `main': -/usr/local/google/work/ca/src/third_party/libxslt/linux/conftest.c:83: undefined reference to `fabs' -collect2: error: ld returned 1 exit status -configure:13426: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "" -| #define PACKAGE_TARNAME "" -| #define PACKAGE_VERSION "" -| #define PACKAGE_STRING "" -| #define PACKAGE_BUGREPORT "" -| #define PACKAGE_URL "" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define __EXTENSIONS__ 1 -| #define _ALL_SOURCE 1 -| #define _GNU_SOURCE 1 -| #define _POSIX_PTHREAD_SEMANTICS 1 -| #define _TANDEM_SOURCE 1 -| #define PACKAGE "libxslt" -| #define VERSION "1.1.29" -| #define STDC_HEADERS 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_TIME_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_LIBPTHREAD /**/ -| #define HAVE_PTHREAD_H /**/ -| #define HAVE_LOCALE_H 1 -| #define HAVE_XLOCALE_H 1 -| #define HAVE_MATH_H 1 -| #define HAVE_FLOAT_H 1 -| #define HAVE_SYS_TIMEB_H 1 -| #define HAVE_TIME_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_SYS_SELECT_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_ERRNO_H 1 -| #define HAVE_STAT 1 -| #define HAVE_POW /**/ -| #define HAVE_FLOOR /**/ -| /* end confdefs.h. */ -| /* Define fabs to an innocuous variant, in case <limits.h> declares fabs. -| For example, HP-UX 11i <limits.h> declares gettimeofday. */ -| #define fabs innocuous_fabs -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char fabs (); below. -| Prefer <limits.h> to <assert.h> if __STDC__ is defined, since -| <limits.h> exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include <limits.h> -| #else -| # include <assert.h> -| #endif -| -| #undef fabs -| -| /* Override any GCC internal prototype to avoid an error. -| Use char because int might match the return type of a GCC -| builtin and then its argument prototype would still apply. */ -| #ifdef __cplusplus -| extern "C" -| #endif -| char fabs (); -| /* The GNU C library defines this for functions which it implements -| to always fail with ENOSYS. Some functions are actually named -| something starting with __ and the normal name is an alias. */ -| #if defined __stub_fabs || defined __stub___fabs -| choke me -| #endif -| -| int -| main () -| { -| return fabs (); -| ; -| return 0; -| } -configure:13426: result: no -configure:13430: checking for fabs in -lm -configure:13455: gcc -o conftest -g -O2 conftest.c -lm >&5 -conftest.c:56:6: warning: conflicting types for built-in function 'fabs' [enabled by default] - char fabs (); - ^ -configure:13455: $? = 0 -configure:13464: result: yes -configure:13478: checking for gettimeofday -configure:13478: gcc -o conftest -g -O2 conftest.c >&5 -configure:13478: $? = 0 -configure:13478: result: yes -configure:13490: checking for localtime -configure:13490: gcc -o conftest -g -O2 conftest.c >&5 -configure:13490: $? = 0 -configure:13490: result: yes -configure:13490: checking for localtime_r -configure:13490: gcc -o conftest -g -O2 conftest.c >&5 -configure:13490: $? = 0 -configure:13490: result: yes -configure:13490: checking for time -configure:13490: gcc -o conftest -g -O2 conftest.c >&5 -configure:13490: $? = 0 -configure:13490: result: yes -configure:13490: checking for gmtime -configure:13490: gcc -o conftest -g -O2 conftest.c >&5 -configure:13490: $? = 0 -configure:13490: result: yes -configure:13490: checking for gmtime_r -configure:13490: gcc -o conftest -g -O2 conftest.c >&5 -configure:13490: $? = 0 -configure:13490: result: yes -configure:13490: checking for ftime -configure:13490: gcc -o conftest -g -O2 conftest.c >&5 -configure:13490: $? = 0 -configure:13490: result: yes -configure:13503: checking for printf -configure:13503: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:80:6: warning: conflicting types for built-in function 'printf' [enabled by default] - char printf (); - ^ -configure:13503: $? = 0 -configure:13503: result: yes -configure:13503: checking for sprintf -configure:13503: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:81:6: warning: conflicting types for built-in function 'sprintf' [enabled by default] - char sprintf (); - ^ -configure:13503: $? = 0 -configure:13503: result: yes -configure:13503: checking for fprintf -configure:13503: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:82:6: warning: conflicting types for built-in function 'fprintf' [enabled by default] - char fprintf (); - ^ -configure:13503: $? = 0 -configure:13503: result: yes -configure:13503: checking for snprintf -configure:13503: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:83:6: warning: conflicting types for built-in function 'snprintf' [enabled by default] - char snprintf (); - ^ -configure:13503: $? = 0 -configure:13503: result: yes -configure:13503: checking for vfprintf -configure:13503: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:84:6: warning: conflicting types for built-in function 'vfprintf' [enabled by default] - char vfprintf (); - ^ -configure:13503: $? = 0 -configure:13503: result: yes -configure:13503: checking for vsprintf -configure:13503: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:85:6: warning: conflicting types for built-in function 'vsprintf' [enabled by default] - char vsprintf (); - ^ -configure:13503: $? = 0 -configure:13503: result: yes -configure:13503: checking for vsnprintf -configure:13503: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:86:6: warning: conflicting types for built-in function 'vsnprintf' [enabled by default] - char vsnprintf (); - ^ -configure:13503: $? = 0 -configure:13503: result: yes -configure:13503: checking for sscanf -configure:13503: gcc -o conftest -g -O2 conftest.c >&5 -conftest.c:87:6: warning: conflicting types for built-in function 'sscanf' [enabled by default] - char sscanf (); - ^ -configure:13503: $? = 0 -configure:13503: result: yes -configure:13517: checking for clock_gettime -configure:13517: gcc -o conftest -g -O2 conftest.c >&5 -configure:13517: $? = 0 -configure:13517: result: yes -configure:13588: checking for perl -configure:13604: found /usr/bin/perl -configure:13616: result: perl -configure:13662: checking for python -configure:13680: found /usr/bin/python -configure:13692: result: /usr/bin/python -configure:13835: checking for libgcrypt-config -configure:13853: found /usr/bin/libgcrypt-config -configure:13865: result: /usr/bin/libgcrypt-config -configure:14011: checking for libxml libraries >= 2.6.27 -configure:14160: checking for xml2-config -configure:14178: found /usr/bin/xml2-config -configure:14190: result: /usr/bin/xml2-config -configure:14257: result: 2.9.4 found -configure:14286: checking whether shared libraries will be built (required for plugins) -configure:14297: result: yes -configure:14509: checking that generated files are newer than configure -configure:14515: result: done -configure:14554: creating ./config.status - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by config.status, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status - -on REDACTED - -config.status:1237: creating Makefile -config.status:1237: creating libxslt.pc -config.status:1237: creating libexslt.pc -config.status:1237: creating libxslt/Makefile -config.status:1237: creating libxslt/xsltconfig.h -config.status:1237: creating libxslt/xsltwin32config.h -config.status:1237: creating libexslt/Makefile -config.status:1237: creating libexslt/exsltconfig.h -config.status:1237: creating xsltproc/Makefile -config.status:1237: creating python/Makefile -config.status:1237: creating python/tests/Makefile -config.status:1237: creating tests/Makefile -config.status:1237: creating tests/docs/Makefile -config.status:1237: creating tests/REC1/Makefile -config.status:1237: creating tests/REC2/Makefile -config.status:1237: creating tests/REC/Makefile -config.status:1237: creating tests/general/Makefile -config.status:1237: creating tests/reports/Makefile -config.status:1237: creating tests/extensions/Makefile -config.status:1237: creating tests/namespaces/Makefile -config.status:1237: creating tests/keys/Makefile -config.status:1237: creating tests/numbers/Makefile -config.status:1237: creating tests/documents/Makefile -config.status:1237: creating tests/xmlspec/Makefile -config.status:1237: creating tests/multiple/Makefile -config.status:1237: creating tests/xinclude/Makefile -config.status:1237: creating tests/XSLTMark/Makefile -config.status:1237: creating tests/docbook/Makefile -config.status:1237: creating tests/exslt/Makefile -config.status:1237: creating tests/exslt/common/Makefile -config.status:1237: creating tests/exslt/functions/Makefile -config.status:1237: creating tests/exslt/math/Makefile -config.status:1237: creating tests/exslt/saxon/Makefile -config.status:1237: creating tests/exslt/sets/Makefile -config.status:1237: creating tests/exslt/strings/Makefile -config.status:1237: creating tests/exslt/date/Makefile -config.status:1237: creating tests/exslt/dynamic/Makefile -config.status:1237: creating tests/exslt/crypto/Makefile -config.status:1237: creating tests/plugins/Makefile -config.status:1237: creating doc/Makefile -config.status:1237: creating xslt-config -config.status:1237: creating libxslt.spec -config.status:1237: creating config.h -config.status:1451: executing depfiles commands -config.status:1451: executing libtool commands - -## ---------------- ## -## Cache variables. ## -## ---------------- ## - -ac_cv_build=x86_64-unknown-linux-gnu -ac_cv_c_compiler_gnu=yes -ac_cv_env_CC_set= -ac_cv_env_CC_value= -ac_cv_env_CFLAGS_set= -ac_cv_env_CFLAGS_value= -ac_cv_env_CPPFLAGS_set= -ac_cv_env_CPPFLAGS_value= -ac_cv_env_CPP_set= -ac_cv_env_CPP_value= -ac_cv_env_LDFLAGS_set= -ac_cv_env_LDFLAGS_value= -ac_cv_env_LIBS_set= -ac_cv_env_LIBS_value= -ac_cv_env_build_alias_set= -ac_cv_env_build_alias_value= -ac_cv_env_host_alias_set= -ac_cv_env_host_alias_value= -ac_cv_env_target_alias_set= -ac_cv_env_target_alias_value= -ac_cv_func__stat=no -ac_cv_func_clock_gettime=yes -ac_cv_func_fabs=no -ac_cv_func_floor=no -ac_cv_func_fprintf=yes -ac_cv_func_ftime=yes -ac_cv_func_gettimeofday=yes -ac_cv_func_gmtime=yes -ac_cv_func_gmtime_r=yes -ac_cv_func_localtime=yes -ac_cv_func_localtime_r=yes -ac_cv_func_pow=no -ac_cv_func_printf=yes -ac_cv_func_snprintf=yes -ac_cv_func_sprintf=yes -ac_cv_func_sscanf=yes -ac_cv_func_stat=yes -ac_cv_func_time=yes -ac_cv_func_vfprintf=yes -ac_cv_func_vsnprintf=yes -ac_cv_func_vsprintf=yes -ac_cv_header_ansidecl_h=no -ac_cv_header_dlfcn_h=yes -ac_cv_header_errno_h=yes -ac_cv_header_float_h=yes -ac_cv_header_fp_class_h=no -ac_cv_header_ieeefp_h=no -ac_cv_header_inttypes_h=yes -ac_cv_header_locale_h=yes -ac_cv_header_math_h=yes -ac_cv_header_memory_h=yes -ac_cv_header_minix_config_h=no -ac_cv_header_nan_h=no -ac_cv_header_pthread_h=yes -ac_cv_header_stdarg_h=yes -ac_cv_header_stdc=yes -ac_cv_header_stdint_h=yes -ac_cv_header_stdlib_h=yes -ac_cv_header_string_h=yes -ac_cv_header_strings_h=yes -ac_cv_header_sys_select_h=yes -ac_cv_header_sys_stat_h=yes -ac_cv_header_sys_time_h=yes -ac_cv_header_sys_timeb_h=yes -ac_cv_header_sys_types_h=yes -ac_cv_header_time_h=yes -ac_cv_header_unistd_h=yes -ac_cv_header_xlocale_h=yes -ac_cv_host=x86_64-unknown-linux-gnu -ac_cv_lib_m_fabs=yes -ac_cv_lib_m_floor=yes -ac_cv_lib_m_pow=yes -ac_cv_lib_pthread_pthread_join=yes -ac_cv_objext=o -ac_cv_path_EGREP='/bin/grep -E' -ac_cv_path_FGREP='/bin/grep -F' -ac_cv_path_GREP=/bin/grep -ac_cv_path_MV=/bin/mv -ac_cv_path_PYTHON=/usr/bin/python -ac_cv_path_RM=/bin/rm -ac_cv_path_SED=/bin/sed -ac_cv_path_TAR=/bin/tar -ac_cv_path_XMLLINT=/usr/bin/xmllint -ac_cv_path_XSLTPROC=/usr/bin/xsltproc -ac_cv_path_ac_pt_LIBGCRYPT_CONFIG=/usr/bin/libgcrypt-config -ac_cv_path_ac_pt_XML_CONFIG=/usr/bin/xml2-config -ac_cv_path_install='/usr/bin/install -c' -ac_cv_path_mkdir=/bin/mkdir -ac_cv_prog_AWK=gawk -ac_cv_prog_CPP='gcc -E' -ac_cv_prog_PERL=perl -ac_cv_prog_ac_ct_AR=ar -ac_cv_prog_ac_ct_CC=gcc -ac_cv_prog_ac_ct_MANIFEST_TOOL=mt -ac_cv_prog_ac_ct_OBJDUMP=objdump -ac_cv_prog_ac_ct_RANLIB=ranlib -ac_cv_prog_ac_ct_STRIP=strip -ac_cv_prog_cc_c89= -ac_cv_prog_cc_g=yes -ac_cv_prog_make_make_set=yes -ac_cv_safe_to_define___extensions__=yes -am_cv_CC_dependencies_compiler_type=gcc3 -am_cv_make_support_nested_variables=yes -am_cv_prog_cc_c_o=yes -lt_cv_ar_at_file=@ -lt_cv_archive_cmds_need_lc=no -lt_cv_deplibs_check_method=pass_all -lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_ld_reload_flag=-r -lt_cv_nm_interface='BSD nm' -lt_cv_objdir=.libs -lt_cv_path_LD=/usr/bin/ld -lt_cv_path_NM='/usr/bin/nm -B' -lt_cv_path_mainfest_tool=no -lt_cv_prog_compiler_c_o=yes -lt_cv_prog_compiler_pic='-fPIC -DPIC' -lt_cv_prog_compiler_pic_works=yes -lt_cv_prog_compiler_rtti_exceptions=no -lt_cv_prog_compiler_static_works=yes -lt_cv_prog_gnu_ld=yes -lt_cv_sharedlib_from_linklib_cmd='printf %s\n' -lt_cv_shlibpath_overrides_runpath=no -lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' -lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\2", (void *) \&\2},/p'\''' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \([^ ]*\)[ ]*$/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' -lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' -lt_cv_sys_max_cmd_len=1572864 -lt_cv_to_host_file_cmd=func_convert_file_noop -lt_cv_to_tool_file_cmd=func_convert_file_noop - -## ----------------- ## -## Output variables. ## -## ----------------- ## - -ACLOCAL='${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing aclocal-1.14' -AMDEPBACKSLASH='\' -AMDEP_FALSE='#' -AMDEP_TRUE='' -AMTAR='$${TAR-tar}' -AM_BACKSLASH='\' -AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -AM_DEFAULT_VERBOSITY='0' -AM_V='$(V)' -AR='ar' -AS='as' -AUTOCONF='${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing autoconf' -AUTOHEADER='${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing autoheader' -AUTOMAKE='${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing automake-1.14' -AWK='gawk' -CC='gcc' -CCDEPMODE='depmode=gcc3' -CFLAGS='-g -O2 -Wall -Wformat=2 -Wmissing-format-attribute' -CPP='gcc -E' -CPPFLAGS='' -CRYPTO_TESTDIR='crypto' -CYGPATH_W='echo' -DEFS='-DHAVE_CONFIG_H' -DEPDIR='.deps' -DLLTOOL='false' -DSYMUTIL='' -DUMPBIN='' -ECHO_C='' -ECHO_N='-n' -ECHO_T='' -EGREP='/bin/grep -E' -EXEEXT='' -EXSLT_INCLUDEDIR='-I${includedir}' -EXSLT_LIBDIR='-L${libdir}' -EXSLT_LIBS='-lexslt -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -lgcrypt' -EXTRA_LIBS='' -FGREP='/bin/grep -F' -GREP='/bin/grep' -HTML_DIR='$(datadir)/doc/$(PACKAGE)-$(VERSION)/html' -INSTALL_DATA='${INSTALL} -m 644' -INSTALL_PROGRAM='${INSTALL}' -INSTALL_SCRIPT='${INSTALL}' -INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' -LD='/usr/bin/ld -m elf_x86_64' -LDFLAGS='' -LIBEXSLT_MAJOR_VERSION='0' -LIBEXSLT_MICRO_VERSION='17' -LIBEXSLT_MINOR_VERSION='8' -LIBEXSLT_VERSION='0.8.17' -LIBEXSLT_VERSION_EXTRA='' -LIBEXSLT_VERSION_INFO='8:17:8' -LIBEXSLT_VERSION_NUMBER='817' -LIBGCRYPT_CFLAGS='' -LIBGCRYPT_CONFIG='/usr/bin/libgcrypt-config' -LIBGCRYPT_LIBS='-lgcrypt' -LIBOBJS='' -LIBS='' -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -LIBXML_CFLAGS='-I/usr/local/google/work/ca/src/third_party/libxml/linux/include' -LIBXML_LIBS='-L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm' -LIBXML_REQUIRED_VERSION='2.6.27' -LIBXML_SRC='/usr/local/google/work/ca/src/third_party/libxml/linux' -LIBXSLT_DEFAULT_PLUGINS_PATH='/usr/local/lib/libxslt-plugins' -LIBXSLT_MAJOR_MINOR_VERSION='1.1' -LIBXSLT_MAJOR_VERSION='1' -LIBXSLT_MICRO_VERSION='29' -LIBXSLT_MINOR_VERSION='1' -LIBXSLT_VERSION='1.1.29' -LIBXSLT_VERSION_EXTRA='' -LIBXSLT_VERSION_INFO='2:29:1' -LIBXSLT_VERSION_NUMBER='10129' -LIPO='' -LN_S='ln -s' -LTLIBOBJS='' -MAKEINFO='${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing makeinfo' -MANIFEST_TOOL=':' -MKDIR_P='/bin/mkdir -p' -MV='/bin/mv' -M_LIBS='-lm' -NM='/usr/bin/nm -B' -NMEDIT='' -OBJDUMP='objdump' -OBJEXT='o' -OTOOL64='' -OTOOL='' -PACKAGE='libxslt' -PACKAGE_BUGREPORT='' -PACKAGE_NAME='' -PACKAGE_STRING='' -PACKAGE_TARNAME='' -PACKAGE_URL='' -PACKAGE_VERSION='' -PATH_SEPARATOR=':' -PERL='perl' -PYTHON='/usr/bin/python' -PYTHONSODV='' -PYTHON_INCLUDES='/usr/include/python2.7' -PYTHON_LIBS='-lpthread -ldl -lutil -lm -lpython2.7' -PYTHON_SITE_PACKAGES='/usr/lib/python2.7/dist-packages' -PYTHON_SUBDIR='python' -PYTHON_VERSION='2.7' -RANLIB='ranlib' -RELDATE='Mon May 8 2017' -RM='/bin/rm' -SED='/bin/sed' -SET_MAKE='' -SHELL='/bin/sh' -STRIP='strip' -TAR='/bin/tar' -THREAD_LIBS='-lpthread' -USE_VERSION_SCRIPT_FALSE='#' -USE_VERSION_SCRIPT_TRUE='' -VERSION='1.1.29' -VERSION_SCRIPT_FLAGS='-Wl,--version-script=' -WIN32_EXTRA_LDFLAGS='' -WIN32_EXTRA_LIBADD='' -WITH_CRYPTO='1' -WITH_DEBUGGER='0' -WITH_MEM_DEBUG='0' -WITH_MODULES='0' -WITH_MODULES_FALSE='' -WITH_MODULES_TRUE='#' -WITH_PERL_FALSE='#' -WITH_PERL_TRUE='' -WITH_PYTHON_FALSE='#' -WITH_PYTHON_TRUE='' -WITH_TRIO='0' -WITH_XSLT_DEBUG='0' -XMLLINT='/usr/bin/xmllint' -XML_CONFIG='/usr/local/google/work/ca/src/third_party/libxml/linux/xml2-config' -XSLTPROC='/usr/bin/xsltproc' -XSLTPROCDV='' -XSLT_INCLUDEDIR='-I${includedir}' -XSLT_LIBDIR='-L${libdir}' -XSLT_LIBS='-lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm' -XSLT_LOCALE_WINAPI='0' -XSLT_LOCALE_XLOCALE='1' -ac_ct_AR='ar' -ac_ct_CC='gcc' -ac_ct_DUMPBIN='' -am__EXEEXT_FALSE='' -am__EXEEXT_TRUE='#' -am__fastdepCC_FALSE='#' -am__fastdepCC_TRUE='' -am__include='include' -am__isrc=' -I$(srcdir)' -am__leading_dot='.' -am__nodep='_no' -am__quote='' -am__tar='$${TAR-tar} chof - "$$tardir"' -am__untar='$${TAR-tar} xf -' -bindir='${exec_prefix}/bin' -build='x86_64-unknown-linux-gnu' -build_alias='' -build_cpu='x86_64' -build_os='linux-gnu' -build_vendor='unknown' -datadir='${datarootdir}' -datarootdir='${prefix}/share' -docdir='${datarootdir}/doc/${PACKAGE}' -dvidir='${docdir}' -exec_prefix='${prefix}' -host='x86_64-unknown-linux-gnu' -host_alias='' -host_cpu='x86_64' -host_os='linux-gnu' -host_vendor='unknown' -htmldir='${docdir}' -includedir='${prefix}/include' -infodir='${datarootdir}/info' -install_sh='${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/install-sh' -libdir='${exec_prefix}/lib' -libexecdir='${exec_prefix}/libexec' -localedir='${datarootdir}/locale' -localstatedir='${prefix}/var' -mandir='${datarootdir}/man' -mkdir_p='$(MKDIR_P)' -oldincludedir='/usr/include' -pdfdir='${docdir}' -prefix='/usr/local' -program_transform_name='s,x,x,' -psdir='${docdir}' -pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages' -sbindir='${exec_prefix}/sbin' -sharedstatedir='${prefix}/com' -sysconfdir='${prefix}/etc' -target_alias='' - -## ----------- ## -## confdefs.h. ## -## ----------- ## - -/* confdefs.h */ -#define PACKAGE_NAME "" -#define PACKAGE_TARNAME "" -#define PACKAGE_VERSION "" -#define PACKAGE_STRING "" -#define PACKAGE_BUGREPORT "" -#define PACKAGE_URL "" -#define STDC_HEADERS 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_UNISTD_H 1 -#define __EXTENSIONS__ 1 -#define _ALL_SOURCE 1 -#define _GNU_SOURCE 1 -#define _POSIX_PTHREAD_SEMANTICS 1 -#define _TANDEM_SOURCE 1 -#define PACKAGE "libxslt" -#define VERSION "1.1.29" -#define STDC_HEADERS 1 -#define HAVE_DLFCN_H 1 -#define LT_OBJDIR ".libs/" -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_STRING_H 1 -#define HAVE_LIBPTHREAD /**/ -#define HAVE_PTHREAD_H /**/ -#define HAVE_LOCALE_H 1 -#define HAVE_XLOCALE_H 1 -#define HAVE_MATH_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_SYS_TIMEB_H 1 -#define HAVE_TIME_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_SELECT_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_ERRNO_H 1 -#define HAVE_STAT 1 -#define HAVE_POW /**/ -#define HAVE_FLOOR /**/ -#define HAVE_FABS /**/ -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_LOCALTIME 1 -#define HAVE_LOCALTIME_R 1 -#define HAVE_TIME 1 -#define HAVE_GMTIME 1 -#define HAVE_GMTIME_R 1 -#define HAVE_FTIME 1 -#define HAVE_PRINTF 1 -#define HAVE_SPRINTF 1 -#define HAVE_FPRINTF 1 -#define HAVE_SNPRINTF 1 -#define HAVE_VFPRINTF 1 -#define HAVE_VSPRINTF 1 -#define HAVE_VSNPRINTF 1 -#define HAVE_SSCANF 1 -#define HAVE_CLOCK_GETTIME 1 -#define HAVE_GCRYPT 1 - -configure: exit 0
diff --git a/third_party/libxslt/linux/libexslt.pc b/third_party/libxslt/linux/libexslt.pc deleted file mode 100644 index 9dba614..0000000 --- a/third_party/libxslt/linux/libexslt.pc +++ /dev/null
@@ -1,12 +0,0 @@ -prefix=/usr/local -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - - -Name: libexslt -Version: 0.8.17 -Description: EXSLT Extension library -Requires: libxml-2.0 -Libs: -L${libdir} -lexslt -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -lgcrypt -Cflags: -I${includedir}
diff --git a/third_party/libxslt/linux/libexslt/Makefile b/third_party/libxslt/linux/libexslt/Makefile deleted file mode 100644 index 1a59e8b..0000000 --- a/third_party/libxslt/linux/libexslt/Makefile +++ /dev/null
@@ -1,832 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# libexslt/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - - -VPATH = ../../src/libexslt -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/libxslt -pkgincludedir = $(includedir)/libxslt -pkglibdir = $(libdir)/libxslt -pkglibexecdir = $(libexecdir)/libxslt -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -subdir = libexslt -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/exsltconfig.h.in $(top_srcdir)/depcomp \ - $(exsltinc_HEADERS) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = exsltconfig.h -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \ - "$(DESTDIR)$(exsltincdir)" "$(DESTDIR)$(exsltincdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libexslt_la_DEPENDENCIES = $(top_builddir)/libxslt/libxslt.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_libexslt_la_OBJECTS = exslt.lo common.lo crypto.lo math.lo sets.lo \ - functions.lo strings.lo date.lo saxon.lo dynamic.lo -libexslt_la_OBJECTS = $(am_libexslt_la_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent -am__v_lt_1 = -libexslt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libexslt_la_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_$(V)) -am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libexslt_la_SOURCES) -DIST_SOURCES = $(libexslt_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -man3dir = $(mandir)/man3 -NROFF = nroff -MANS = $(man_MANS) -HEADERS = $(exsltinc_HEADERS) $(nodist_exsltinc_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing aclocal-1.14 -AMTAR = $${TAR-tar} -AM_DEFAULT_VERBOSITY = 0 -AR = ar -AS = as -AUTOCONF = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing autoconf -AUTOHEADER = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing autoheader -AUTOMAKE = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing automake-1.14 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -Wall -Wformat=2 -Wmissing-format-attribute -CPP = gcc -E -CPPFLAGS = -CRYPTO_TESTDIR = crypto -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -DLLTOOL = false -DSYMUTIL = -DUMPBIN = -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -EXSLT_INCLUDEDIR = -I${includedir} -EXSLT_LIBDIR = -L${libdir} -EXSLT_LIBS = -lexslt -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -lgcrypt -EXTRA_LIBS = -FGREP = /bin/grep -F -GREP = /bin/grep -HTML_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -LIBEXSLT_MAJOR_VERSION = 0 -LIBEXSLT_MICRO_VERSION = 17 -LIBEXSLT_MINOR_VERSION = 8 -LIBEXSLT_VERSION = 0.8.17 -LIBEXSLT_VERSION_EXTRA = -LIBEXSLT_VERSION_INFO = 8:17:8 -LIBEXSLT_VERSION_NUMBER = 817 -LIBGCRYPT_CFLAGS = -LIBGCRYPT_CONFIG = /usr/bin/libgcrypt-config -LIBGCRYPT_LIBS = -lgcrypt -LIBOBJS = -LIBS = -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIBXML_CFLAGS = -I/usr/local/google/work/ca/src/third_party/libxml/linux/include -LIBXML_LIBS = -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -LIBXML_REQUIRED_VERSION = 2.6.27 -LIBXML_SRC = /usr/local/google/work/ca/src/third_party/libxml/linux -LIBXSLT_DEFAULT_PLUGINS_PATH = /usr/local/lib/libxslt-plugins -LIBXSLT_MAJOR_MINOR_VERSION = 1.1 -LIBXSLT_MAJOR_VERSION = 1 -LIBXSLT_MICRO_VERSION = 29 -LIBXSLT_MINOR_VERSION = 1 -LIBXSLT_VERSION = 1.1.29 -LIBXSLT_VERSION_EXTRA = -LIBXSLT_VERSION_INFO = 2:29:1 -LIBXSLT_VERSION_NUMBER = 10129 -LIPO = -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing makeinfo -MANIFEST_TOOL = : -MKDIR_P = /bin/mkdir -p -MV = /bin/mv -M_LIBS = -lm -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OTOOL = -OTOOL64 = -PACKAGE = libxslt -PACKAGE_BUGREPORT = -PACKAGE_NAME = -PACKAGE_STRING = -PACKAGE_TARNAME = -PACKAGE_URL = -PACKAGE_VERSION = -PATH_SEPARATOR = : -PERL = perl -PYTHON = /usr/bin/python -PYTHONSODV = -PYTHON_INCLUDES = /usr/include/python2.7 -PYTHON_LIBS = -lpthread -ldl -lutil -lm -lpython2.7 -PYTHON_SITE_PACKAGES = /usr/lib/python2.7/dist-packages -PYTHON_SUBDIR = python -PYTHON_VERSION = 2.7 -RANLIB = ranlib -RELDATE = Mon May 8 2017 -RM = /bin/rm -SED = /bin/sed -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -TAR = /bin/tar -THREAD_LIBS = -lpthread -VERSION = 1.1.29 -VERSION_SCRIPT_FLAGS = -Wl,--version-script= -WIN32_EXTRA_LDFLAGS = -WIN32_EXTRA_LIBADD = -WITH_CRYPTO = 1 -WITH_DEBUGGER = 0 -WITH_MEM_DEBUG = 0 -WITH_MODULES = 0 -WITH_TRIO = 0 -WITH_XSLT_DEBUG = 0 -XMLLINT = /usr/bin/xmllint -XML_CONFIG = /usr/local/google/work/ca/src/third_party/libxml/linux/xml2-config -XSLTPROC = /usr/bin/xsltproc -XSLTPROCDV = -XSLT_INCLUDEDIR = -I${includedir} -XSLT_LIBDIR = -L${libdir} -XSLT_LIBS = -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -XSLT_LOCALE_WINAPI = 0 -XSLT_LOCALE_XLOCALE = 1 -abs_builddir = /usr/local/google/work/ca/src/third_party/libxslt/linux/libexslt -abs_srcdir = /usr/local/google/work/ca/src/third_party/libxslt/linux/../src/libexslt -abs_top_builddir = /usr/local/google/work/ca/src/third_party/libxslt/linux -abs_top_srcdir = /usr/local/google/work/ca/src/third_party/libxslt/linux/../src -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_DUMPBIN = -am__include = include -am__leading_dot = . -am__quote = -am__tar = $${TAR-tar} chof - "$$tardir" -am__untar = $${TAR-tar} xf - -bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu -build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -docdir = ${datarootdir}/doc/${PACKAGE} -dvidir = ${docdir} -exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu -host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -mandir = ${datarootdir}/man -mkdir_p = $(MKDIR_P) -oldincludedir = /usr/include -pdfdir = ${docdir} -prefix = /usr/local -program_transform_name = s,x,x, -psdir = ${docdir} -pythondir = $(libdir)/python$(PYTHON_VERSION)/site-packages -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -srcdir = ../../src/libexslt -sysconfdir = ${prefix}/etc -target_alias = -top_build_prefix = ../ -top_builddir = .. -top_srcdir = ../../src -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libxslt -I$(top_srcdir)/libexslt \ - -I$(top_builddir) -I$(top_builddir)/libxslt \ - -I$(top_builddir)/libexslt - -AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS) -lib_LTLIBRARIES = libexslt.la -exsltincdir = $(includedir)/libexslt -exsltinc_HEADERS = \ - exslt.h \ - exsltexports.h - -nodist_exsltinc_HEADERS = \ - exsltconfig.h - -libexslt_la_SOURCES = \ - exslt.c \ - common.c \ - crypto.c \ - math.c \ - sets.c \ - functions.c \ - strings.c \ - date.c \ - saxon.c \ - libexslt.h \ - dynamic.c - -libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS) $(LIBGCRYPT_LIBS) $(M_LIBS) -libexslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info $(LIBEXSLT_VERSION_INFO) -man_MANS = libexslt.3 -EXTRA_DIST = $(man_MANS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libexslt/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu libexslt/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -exsltconfig.h: $(top_builddir)/config.status $(srcdir)/exsltconfig.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libexslt.la: $(libexslt_la_OBJECTS) $(libexslt_la_DEPENDENCIES) $(EXTRA_libexslt_la_DEPENDENCIES) - $(AM_V_CCLD)$(libexslt_la_LINK) -rpath $(libdir) $(libexslt_la_OBJECTS) $(libexslt_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/common.Plo -include ./$(DEPDIR)/crypto.Plo -include ./$(DEPDIR)/date.Plo -include ./$(DEPDIR)/dynamic.Plo -include ./$(DEPDIR)/exslt.Plo -include ./$(DEPDIR)/functions.Plo -include ./$(DEPDIR)/math.Plo -include ./$(DEPDIR)/saxon.Plo -include ./$(DEPDIR)/sets.Plo -include ./$(DEPDIR)/strings.Plo - -.c.o: - $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# $(AM_V_CC)source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(AM_V_CC_no)$(COMPILE) -c -o $@ $< - -.c.obj: - $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` - $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# $(AM_V_CC)source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: - $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -# $(AM_V_CC)source='$<' object='$@' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-man3: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man3dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.3[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ - done; } - -uninstall-man3: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man3dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.3[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) -install-exsltincHEADERS: $(exsltinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(exsltincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(exsltincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(exsltincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(exsltincdir)" || exit $$?; \ - done - -uninstall-exsltincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(exsltincdir)'; $(am__uninstall_files_from_dir) -install-nodist_exsltincHEADERS: $(nodist_exsltinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(nodist_exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(exsltincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(exsltincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(exsltincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(exsltincdir)" || exit $$?; \ - done - -uninstall-nodist_exsltincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(exsltincdir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(exsltincdir)" "$(DESTDIR)$(exsltincdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-exsltincHEADERS install-man \ - install-nodist_exsltincHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: install-man3 - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-exsltincHEADERS uninstall-libLTLIBRARIES \ - uninstall-man uninstall-nodist_exsltincHEADERS - -uninstall-man: uninstall-man3 - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES 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-exsltincHEADERS install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-man3 \ - install-nodist_exsltincHEADERS 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 uninstall-exsltincHEADERS \ - uninstall-libLTLIBRARIES uninstall-man uninstall-man3 \ - uninstall-nodist_exsltincHEADERS - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxslt/linux/libxslt.pc b/third_party/libxslt/linux/libxslt.pc deleted file mode 100644 index fb9c3c7..0000000 --- a/third_party/libxslt/linux/libxslt.pc +++ /dev/null
@@ -1,12 +0,0 @@ -prefix=/usr/local -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - - -Name: libxslt -Version: 1.1.29 -Description: XSLT library version 2. -Requires: libxml-2.0 -Libs: -L${libdir} -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -Cflags: -I${includedir}
diff --git a/third_party/libxslt/linux/libxslt.spec b/third_party/libxslt/linux/libxslt.spec deleted file mode 100644 index 98dc64a6..0000000 --- a/third_party/libxslt/linux/libxslt.spec +++ /dev/null
@@ -1,133 +0,0 @@ -Summary: Library providing the GNOME XSLT engine -Name: libxslt -Version: 1.1.29 -Release: 1%{?dist}%{?extra_release} -License: MIT -Group: Development/Libraries -Source: ftp://xmlsoft.org/XSLT/libxslt-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-root -URL: http://xmlsoft.org/XSLT/ -Requires: libxml2 >= 2.6.27 -BuildRequires: libxml2-devel >= 2.6.27 -BuildRequires: python python-devel -BuildRequires: libxml2-python -BuildRequires: libgcrypt-devel -Prefix: %{_prefix} -Docdir: %{_docdir} - -%description -This C library allows to transform XML files into other XML files -(or HTML, text, ...) using the standard XSLT stylesheet transformation -mechanism. To use it you need to have a version of libxml2 >= 2.6.27 -installed. The xsltproc command is a command line interface to the XSLT engine - -%package devel -Summary: Libraries, includes, etc. to embed the GNOME XSLT engine -Group: Development/Libraries -Requires: libxslt = %{version}-%{release} -Requires: libxml2-devel >= 2.6.27 -Requires: libgcrypt-devel -Requires: pkgconfig - -%description devel -This C library allows to transform XML files into other XML files -(or HTML, text, ...) using the standard XSLT stylesheet transformation -mechanism. To use it you need to have a version of libxml2 >= 2.6.27 -installed. - -%package python -Summary: Python bindings for the libxslt library -Group: Development/Libraries -Requires: libxslt = %{version}-%{release} -Requires: libxml2 >= 2.6.27 -Requires: libxml2-python >= 2.6.27 -Requires: python - -%description python -The libxslt-python package contains a module that permits applications -written in the Python programming language to use the interface -supplied by the libxslt library to apply XSLT transformations. - -This library allows to parse sytlesheets, uses the libxml2-python -to load and save XML and HTML files. Direct access to XPath and -the XSLT transformation context are possible to extend the XSLT language -with XPath functions written in Python. - -%prep -%setup -q - -%build -%configure -make -gzip -9 ChangeLog - -%install -rm -fr %{buildroot} - -%makeinstall - -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la -rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}{,-python}-%{version} - -%check -make check - -%clean -rm -fr %{buildroot} - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -%defattr(-, root, root) - -%doc AUTHORS ChangeLog.gz NEWS README Copyright TODO FEATURES -%doc doc/*.html doc/html doc/tutorial doc/tutorial2 doc/*.gif -%doc doc/EXSLT -%doc %{_mandir}/man1/xsltproc.1* -%{_libdir}/lib*.so.* -%{_libdir}/libxslt-plugins -%{prefix}/bin/xsltproc - -%files devel -%defattr(-, root, root) - -%doc AUTHORS ChangeLog.gz NEWS README Copyright TODO FEATURES -%doc doc/libxslt-api.xml -%doc doc/libxslt-refs.xml -%doc doc/EXSLT/libexslt-api.xml -%doc doc/EXSLT/libexslt-refs.xml -%doc %{_mandir}/man3/libxslt.3* -%doc %{_mandir}/man3/libexslt.3* -%doc doc/*.html doc/html doc/*.gif doc/*.png -%doc doc/tutorial -%doc doc/tutorial2 -%doc doc/images -%doc doc/EXSLT -%{_libdir}/lib*.so -%{_libdir}/*a -%{_libdir}/*.sh -%{prefix}/share/aclocal/libxslt.m4 -%{prefix}/include/* -%{prefix}/bin/xslt-config -%{_libdir}/pkgconfig/libxslt.pc -%{_libdir}/pkgconfig/libexslt.pc - -%files python -%defattr(-, root, root) - -%doc AUTHORS ChangeLog.gz NEWS README Copyright FEATURES -%{_libdir}/python*/site-packages/libxslt.py* -%{_libdir}/python*/site-packages/libxsltmod* -%doc python/TODO -%doc python/libxsltclass.txt -%doc python/tests/*.py -%doc python/tests/*.xml -%doc python/tests/*.xsl - -%changelog -* Mon May 8 2017 Daniel Veillard <veillard@redhat.com> -- upstream release 1.1.29 see http://xmlsoft.org/XSLT/news.html
diff --git a/third_party/libxslt/linux/libxslt/Makefile b/third_party/libxslt/linux/libxslt/Makefile deleted file mode 100644 index d947b887..0000000 --- a/third_party/libxslt/linux/libxslt/Makefile +++ /dev/null
@@ -1,888 +0,0 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. -# libxslt/Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994-2013 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - - - - -VPATH = ../../src/libxslt -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/libxslt -pkgincludedir = $(includedir)/libxslt -pkglibdir = $(libdir)/libxslt -pkglibexecdir = $(libexecdir)/libxslt -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -subdir = libxslt -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(srcdir)/xsltconfig.h.in $(srcdir)/xsltwin32config.h.in \ - $(top_srcdir)/depcomp $(xsltinc_HEADERS) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = xsltconfig.h xsltwin32config.h -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \ - "$(DESTDIR)$(xsltincdir)" "$(DESTDIR)$(xsltincdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libxslt_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_libxslt_la_OBJECTS = attrvt.lo xslt.lo xsltlocale.lo xsltutils.lo \ - pattern.lo templates.lo variables.lo keys.lo numbers.lo \ - extensions.lo extra.lo functions.lo namespaces.lo imports.lo \ - attributes.lo documents.lo preproc.lo transform.lo security.lo -nodist_libxslt_la_OBJECTS = -libxslt_la_OBJECTS = $(am_libxslt_la_OBJECTS) \ - $(nodist_libxslt_la_OBJECTS) -AM_V_lt = $(am__v_lt_$(V)) -am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) -am__v_lt_0 = --silent -am__v_lt_1 = -libxslt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libxslt_la_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_$(V)) -am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_$(V)) -am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_$(V)) -am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_$(V)) -am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libxslt_la_SOURCES) $(nodist_libxslt_la_SOURCES) -DIST_SOURCES = $(libxslt_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -man3dir = $(mandir)/man3 -NROFF = nroff -MANS = $(man_MANS) -HEADERS = $(nodist_xsltinc_HEADERS) $(xsltinc_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing aclocal-1.14 -AMTAR = $${TAR-tar} -AM_DEFAULT_VERBOSITY = 0 -AR = ar -AS = as -AUTOCONF = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing autoconf -AUTOHEADER = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing autoheader -AUTOMAKE = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing automake-1.14 -AWK = gawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -g -O2 -Wall -Wformat=2 -Wmissing-format-attribute -CPP = gcc -E -CPPFLAGS = -CRYPTO_TESTDIR = crypto -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -DLLTOOL = false -DSYMUTIL = -DUMPBIN = -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -EXSLT_INCLUDEDIR = -I${includedir} -EXSLT_LIBDIR = -L${libdir} -EXSLT_LIBS = -lexslt -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -lgcrypt -EXTRA_LIBS = -FGREP = /bin/grep -F -GREP = /bin/grep -HTML_DIR = $(datadir)/doc/$(PACKAGE)-$(VERSION)/html -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -LIBEXSLT_MAJOR_VERSION = 0 -LIBEXSLT_MICRO_VERSION = 17 -LIBEXSLT_MINOR_VERSION = 8 -LIBEXSLT_VERSION = 0.8.17 -LIBEXSLT_VERSION_EXTRA = -LIBEXSLT_VERSION_INFO = 8:17:8 -LIBEXSLT_VERSION_NUMBER = 817 -LIBGCRYPT_CFLAGS = -LIBGCRYPT_CONFIG = /usr/bin/libgcrypt-config -LIBGCRYPT_LIBS = -lgcrypt -LIBOBJS = -LIBS = -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIBXML_CFLAGS = -I/usr/local/google/work/ca/src/third_party/libxml/linux/include -LIBXML_LIBS = -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -LIBXML_REQUIRED_VERSION = 2.6.27 -LIBXML_SRC = /usr/local/google/work/ca/src/third_party/libxml/linux -LIBXSLT_DEFAULT_PLUGINS_PATH = /usr/local/lib/libxslt-plugins -LIBXSLT_MAJOR_MINOR_VERSION = 1.1 -LIBXSLT_MAJOR_VERSION = 1 -LIBXSLT_MICRO_VERSION = 29 -LIBXSLT_MINOR_VERSION = 1 -LIBXSLT_VERSION = 1.1.29 -LIBXSLT_VERSION_EXTRA = -LIBXSLT_VERSION_INFO = 2:29:1 -LIBXSLT_VERSION_NUMBER = 10129 -LIPO = -LN_S = ln -s -LTLIBOBJS = -MAKEINFO = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/missing makeinfo -MANIFEST_TOOL = : -MKDIR_P = /bin/mkdir -p -MV = /bin/mv -M_LIBS = -lm -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJEXT = o -OTOOL = -OTOOL64 = -PACKAGE = libxslt -PACKAGE_BUGREPORT = -PACKAGE_NAME = -PACKAGE_STRING = -PACKAGE_TARNAME = -PACKAGE_URL = -PACKAGE_VERSION = -PATH_SEPARATOR = : -PERL = perl -PYTHON = /usr/bin/python -PYTHONSODV = -PYTHON_INCLUDES = /usr/include/python2.7 -PYTHON_LIBS = -lpthread -ldl -lutil -lm -lpython2.7 -PYTHON_SITE_PACKAGES = /usr/lib/python2.7/dist-packages -PYTHON_SUBDIR = python -PYTHON_VERSION = 2.7 -RANLIB = ranlib -RELDATE = Mon May 8 2017 -RM = /bin/rm -SED = /bin/sed -SET_MAKE = -SHELL = /bin/sh -STRIP = strip -TAR = /bin/tar -THREAD_LIBS = -lpthread -VERSION = 1.1.29 -VERSION_SCRIPT_FLAGS = -Wl,--version-script= -WIN32_EXTRA_LDFLAGS = -WIN32_EXTRA_LIBADD = -WITH_CRYPTO = 1 -WITH_DEBUGGER = 0 -WITH_MEM_DEBUG = 0 -WITH_MODULES = 0 -WITH_TRIO = 0 -WITH_XSLT_DEBUG = 0 -XMLLINT = /usr/bin/xmllint -XML_CONFIG = /usr/local/google/work/ca/src/third_party/libxml/linux/xml2-config -XSLTPROC = /usr/bin/xsltproc -XSLTPROCDV = -XSLT_INCLUDEDIR = -I${includedir} -XSLT_LIBDIR = -L${libdir} -XSLT_LIBS = -lxslt -L/usr/local/google/work/ca/src/third_party/libxml/linux -L/usr/local/lib -lxml2 -licui18n -licuuc -licudata -lm -lm -XSLT_LOCALE_WINAPI = 0 -XSLT_LOCALE_XLOCALE = 1 -abs_builddir = /usr/local/google/work/ca/src/third_party/libxslt/linux/libxslt -abs_srcdir = /usr/local/google/work/ca/src/third_party/libxslt/linux/../src/libxslt -abs_top_builddir = /usr/local/google/work/ca/src/third_party/libxslt/linux -abs_top_srcdir = /usr/local/google/work/ca/src/third_party/libxslt/linux/../src -ac_ct_AR = ar -ac_ct_CC = gcc -ac_ct_DUMPBIN = -am__include = include -am__leading_dot = . -am__quote = -am__tar = $${TAR-tar} chof - "$$tardir" -am__untar = $${TAR-tar} xf - -bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu -build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -docdir = ${datarootdir}/doc/${PACKAGE} -dvidir = ${docdir} -exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu -host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = ${SHELL} /usr/local/google/work/ca/src/third_party/libxslt/src/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -mandir = ${datarootdir}/man -mkdir_p = $(MKDIR_P) -oldincludedir = /usr/include -pdfdir = ${docdir} -prefix = /usr/local -program_transform_name = s,x,x, -psdir = ${docdir} -pythondir = $(libdir)/python$(PYTHON_VERSION)/site-packages -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -srcdir = ../../src/libxslt -sysconfdir = ${prefix}/etc -target_alias = -top_build_prefix = ../ -top_builddir = .. -top_srcdir = ../../src -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libxslt -AM_CFLAGS = $(LIBXML_CFLAGS) -lib_LTLIBRARIES = libxslt.la -xsltincdir = $(includedir)/libxslt -xsltinc_HEADERS = \ - xslt.h \ - xsltutils.h \ - pattern.h \ - templates.h \ - variables.h \ - keys.h \ - numbersInternals.h \ - extensions.h \ - extra.h \ - functions.h \ - namespaces.h \ - imports.h \ - attributes.h \ - documents.h \ - preproc.h \ - transform.h \ - security.h \ - xsltInternals.h \ - xsltexports.h \ - xsltlocale.h - -nodist_xsltinc_HEADERS = \ - xsltconfig.h - -libxslt_la_SOURCES = \ - attrvt.c \ - xslt.c \ - xsltlocale.c \ - xsltutils.c \ - pattern.c \ - templates.c \ - variables.c \ - keys.c \ - numbers.c \ - extensions.c \ - extra.c \ - functions.c \ - namespaces.c \ - imports.c \ - attributes.c \ - documents.c \ - preproc.c \ - transform.c \ - security.c \ - win32config.h \ - xsltwin32config.h.in \ - libxslt.h - -nodist_libxslt_la_SOURCES = \ - xsltwin32config.h - -#LIBXSLT_VERSION_SCRIPT = -LIBXSLT_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxslt.syms -libxslt_la_LIBADD = $(LIBXML_LIBS) $(EXTRA_LIBS) $(M_LIBS) -libxslt_la_LDFLAGS = \ - $(WIN32_EXTRA_LDFLAGS) \ - $(LIBXSLT_VERSION_SCRIPT) \ - -version-info $(LIBXSLT_VERSION_INFO) - -man_MANS = libxslt.3 -EXTRA_DIST = $(man_MANS) trio.h triodef.h libxslt.syms -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libxslt/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu libxslt/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -xsltconfig.h: $(top_builddir)/config.status $(srcdir)/xsltconfig.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -xsltwin32config.h: $(top_builddir)/config.status $(srcdir)/xsltwin32config.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libxslt.la: $(libxslt_la_OBJECTS) $(libxslt_la_DEPENDENCIES) $(EXTRA_libxslt_la_DEPENDENCIES) - $(AM_V_CCLD)$(libxslt_la_LINK) -rpath $(libdir) $(libxslt_la_OBJECTS) $(libxslt_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/attributes.Plo -include ./$(DEPDIR)/attrvt.Plo -include ./$(DEPDIR)/documents.Plo -include ./$(DEPDIR)/extensions.Plo -include ./$(DEPDIR)/extra.Plo -include ./$(DEPDIR)/functions.Plo -include ./$(DEPDIR)/imports.Plo -include ./$(DEPDIR)/keys.Plo -include ./$(DEPDIR)/namespaces.Plo -include ./$(DEPDIR)/numbers.Plo -include ./$(DEPDIR)/pattern.Plo -include ./$(DEPDIR)/preproc.Plo -include ./$(DEPDIR)/security.Plo -include ./$(DEPDIR)/templates.Plo -include ./$(DEPDIR)/transform.Plo -include ./$(DEPDIR)/variables.Plo -include ./$(DEPDIR)/xslt.Plo -include ./$(DEPDIR)/xsltlocale.Plo -include ./$(DEPDIR)/xsltutils.Plo - -.c.o: - $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# $(AM_V_CC)source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(AM_V_CC_no)$(COMPILE) -c -o $@ $< - -.c.obj: - $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` - $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# $(AM_V_CC)source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: - $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -# $(AM_V_CC)source='$<' object='$@' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-man3: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man3dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.3[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ - done; } - -uninstall-man3: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man3dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.3[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) -install-nodist_xsltincHEADERS: $(nodist_xsltinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(nodist_xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(xsltincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(xsltincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xsltincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(xsltincdir)" || exit $$?; \ - done - -uninstall-nodist_xsltincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(xsltincdir)'; $(am__uninstall_files_from_dir) -install-xsltincHEADERS: $(xsltinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(xsltincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(xsltincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xsltincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(xsltincdir)" || exit $$?; \ - done - -uninstall-xsltincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(xsltincdir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(xsltincdir)" "$(DESTDIR)$(xsltincdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-man install-nodist_xsltincHEADERS \ - install-xsltincHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: install-man3 - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-libLTLIBRARIES uninstall-man \ - uninstall-nodist_xsltincHEADERS uninstall-xsltincHEADERS - -uninstall-man: uninstall-man3 - -.MAKE: install-am install-exec-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES 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-exec-hook install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-man install-man3 install-nodist_xsltincHEADERS \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip install-xsltincHEADERS 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 uninstall-libLTLIBRARIES \ - uninstall-man uninstall-man3 uninstall-nodist_xsltincHEADERS \ - uninstall-xsltincHEADERS - - -xsltproc: all - @(cd ../xsltproc ; $(MAKE)) - -install-exec-hook: - $(MKDIR_P) "$(DESTDIR)$(libdir)/libxslt-plugins" - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxslt/linux/stamp-h1 b/third_party/libxslt/linux/stamp-h1 deleted file mode 100644 index 4547fe1b..0000000 --- a/third_party/libxslt/linux/stamp-h1 +++ /dev/null
@@ -1 +0,0 @@ -timestamp for config.h
diff --git a/third_party/libxslt/src/Makefile.in b/third_party/libxslt/src/Makefile.in deleted file mode 100644 index 5e272eb4..0000000 --- a/third_party/libxslt/src/Makefile.in +++ /dev/null
@@ -1,1083 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = libxslt.pc libexslt.pc xslt-config libxslt.spec -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(confexecdir)" \ - "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)" -SCRIPTS = $(bin_SCRIPTS) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -DATA = $(confexec_DATA) $(m4data_DATA) $(pkgconfig_DATA) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/libexslt.pc.in $(srcdir)/libxslt.pc.in \ - $(srcdir)/libxslt.spec.in $(srcdir)/xslt-config.in AUTHORS \ - COPYING ChangeLog INSTALL NEWS README TODO compile \ - config.guess config.sub depcomp install-sh ltmain.sh missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CRYPTO_TESTDIR = @CRYPTO_TESTDIR@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -EXSLT_INCLUDEDIR = @EXSLT_INCLUDEDIR@ -EXSLT_LIBDIR = @EXSLT_LIBDIR@ -EXSLT_LIBS = @EXSLT_LIBS@ -EXTRA_LIBS = @EXTRA_LIBS@ -FGREP = @FGREP@ -GREP = @GREP@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBEXSLT_MAJOR_VERSION = @LIBEXSLT_MAJOR_VERSION@ -LIBEXSLT_MICRO_VERSION = @LIBEXSLT_MICRO_VERSION@ -LIBEXSLT_MINOR_VERSION = @LIBEXSLT_MINOR_VERSION@ -LIBEXSLT_VERSION = @LIBEXSLT_VERSION@ -LIBEXSLT_VERSION_EXTRA = @LIBEXSLT_VERSION_EXTRA@ -LIBEXSLT_VERSION_INFO = @LIBEXSLT_VERSION_INFO@ -LIBEXSLT_VERSION_NUMBER = @LIBEXSLT_VERSION_NUMBER@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_CFLAGS = @LIBXML_CFLAGS@ -LIBXML_LIBS = @LIBXML_LIBS@ -LIBXML_REQUIRED_VERSION = @LIBXML_REQUIRED_VERSION@ -LIBXML_SRC = @LIBXML_SRC@ -LIBXSLT_DEFAULT_PLUGINS_PATH = @LIBXSLT_DEFAULT_PLUGINS_PATH@ -LIBXSLT_MAJOR_MINOR_VERSION = @LIBXSLT_MAJOR_MINOR_VERSION@ -LIBXSLT_MAJOR_VERSION = @LIBXSLT_MAJOR_VERSION@ -LIBXSLT_MICRO_VERSION = @LIBXSLT_MICRO_VERSION@ -LIBXSLT_MINOR_VERSION = @LIBXSLT_MINOR_VERSION@ -LIBXSLT_VERSION = @LIBXSLT_VERSION@ -LIBXSLT_VERSION_EXTRA = @LIBXSLT_VERSION_EXTRA@ -LIBXSLT_VERSION_INFO = @LIBXSLT_VERSION_INFO@ -LIBXSLT_VERSION_NUMBER = @LIBXSLT_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PYTHON = @PYTHON@ -PYTHONSODV = @PYTHONSODV@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RELDATE = @RELDATE@ -RM = @RM@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TAR = @TAR@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WITH_CRYPTO = @WITH_CRYPTO@ -WITH_DEBUGGER = @WITH_DEBUGGER@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_TRIO = @WITH_TRIO@ -WITH_XSLT_DEBUG = @WITH_XSLT_DEBUG@ -XMLLINT = @XMLLINT@ -XML_CONFIG = @XML_CONFIG@ -XSLTPROC = @XSLTPROC@ -XSLTPROCDV = @XSLTPROCDV@ -XSLT_INCLUDEDIR = @XSLT_INCLUDEDIR@ -XSLT_LIBDIR = @XSLT_LIBDIR@ -XSLT_LIBS = @XSLT_LIBS@ -XSLT_LOCALE_WINAPI = @XSLT_LOCALE_WINAPI@ -XSLT_LOCALE_XLOCALE = @XSLT_LOCALE_XLOCALE@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = \ - libxslt \ - libexslt \ - xsltproc \ - doc \ - $(PYTHON_SUBDIR) \ - tests - -DIST_SUBDIRS = libxslt libexslt xsltproc python doc tests -confexecdir = $(libdir) -confexec_DATA = xsltConf.sh -bin_SCRIPTS = xslt-config -CVS_EXTRA_DIST = -EXTRA_DIST = xsltConf.sh.in xslt-config.in libxslt.spec libxslt.spec.in \ - FEATURES TODO Copyright libxslt.m4 \ - win32/libxslt/libxslt.def win32/libxslt/libxslt.dsw \ - win32/libxslt/libxslt_so.dsp win32/libxslt/xsltproc.dsp \ - $(CVS_EXTRA_DIST) - -CLEANFILES = xsltConf.sh -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libxslt.pc libexslt.pc -m4datadir = $(datadir)/aclocal -m4data_DATA = libxslt.m4 -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -libxslt.pc: $(top_builddir)/config.status $(srcdir)/libxslt.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libexslt.pc: $(top_builddir)/config.status $(srcdir)/libexslt.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -xslt-config: $(top_builddir)/config.status $(srcdir)/xslt-config.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libxslt.spec: $(top_builddir)/config.status $(srcdir)/libxslt.spec.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt -install-confexecDATA: $(confexec_DATA) - @$(NORMAL_INSTALL) - @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(confexecdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(confexecdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confexecdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(confexecdir)" || exit $$?; \ - done - -uninstall-confexecDATA: - @$(NORMAL_UNINSTALL) - @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(confexecdir)'; $(am__uninstall_files_from_dir) -install-m4dataDATA: $(m4data_DATA) - @$(NORMAL_INSTALL) - @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(m4datadir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(m4datadir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4datadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(m4datadir)" || exit $$?; \ - done - -uninstall-m4dataDATA: - @$(NORMAL_UNINSTALL) - @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(m4datadir)'; $(am__uninstall_files_from_dir) -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) check-local -check: check-recursive -all-am: Makefile $(SCRIPTS) $(DATA) config.h -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(confexecdir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr \ - distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: install-m4dataDATA install-pkgconfigDATA - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: install-binSCRIPTS install-confexecDATA - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-binSCRIPTS uninstall-confexecDATA \ - uninstall-m4dataDATA uninstall-pkgconfigDATA - -.MAKE: $(am__recursive_targets) all check-am install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am check-local clean clean-cscope \ - clean-generic clean-libtool cscope cscopelist-am ctags \ - ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-binSCRIPTS install-confexecDATA 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-m4dataDATA install-man install-pdf \ - install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-binSCRIPTS uninstall-confexecDATA \ - uninstall-m4dataDATA uninstall-pkgconfigDATA - -.PRECIOUS: Makefile - - -dist-hook: cleanup libxslt.spec - touch $(distdir)/doc/*.xml - touch $(distdir)/doc/EXSLT/*.xml - touch $(distdir)/libxslt/*.syms - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn win32 vms examples) | (cd $(distdir); tar xf -) - -xsltConf.sh: xsltConf.sh.in Makefile - sed -e 's?\@XSLT_LIBDIR\@?$(XSLT_LIBDIR)?g' \ - -e 's?\@XSLT_INCLUDEDIR\@?$(XSLT_INCLUDEDIR)?g' \ - -e 's?\@VERSION\@?$(VERSION)?g' \ - -e 's?\@XSLT_LIBS\@?$(XSLT_LIBS) $(EXTRA_LIBS)?g' \ - < $(srcdir)/xsltConf.sh.in > xsltConf.tmp \ - && mv xsltConf.tmp xsltConf.sh - -check-local: tests - -dummy: - -tests: dummy - @echo '## Running the regression test suite' - @(cd tests ; $(MAKE) tests) - @(cd xsltproc ; $(MAKE) tests) - @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; $(MAKE) tests ; fi) - -valgrind: - @echo '## Running the regression tests under Valgrind' - @echo '## Go get a cup of coffee it is gonna take a while ...' - @(cd tests ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests) - @(cd xsltproc ; $(MAKE) CHECKER='libtool --mode=execute valgrind -q --leak-check=full' tests) - -cleanup: - -@(find . -name .\#\* -exec rm {} \;) - -cleantar: - @(rm -f libxslt*.tar.gz) - -rpm: cleantar - @(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz) - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxslt/src/aclocal.m4 b/third_party/libxslt/src/aclocal.m4 deleted file mode 100644 index 1b8890b..0000000 --- a/third_party/libxslt/src/aclocal.m4 +++ /dev/null
@@ -1,10181 +0,0 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program or library that is built -# using GNU Libtool, you may include this file under the same -# distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. -]) - -# serial 58 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_PREPARE_CC_BASENAME -# ----------------------- -m4_defun([_LT_PREPARE_CC_BASENAME], [ -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in @S|@*""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} -])# _LT_PREPARE_CC_BASENAME - - -# _LT_CC_BASENAME(CC) -# ------------------- -# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, -# but that macro is also expanded into generated libtool script, which -# arranges for $SED and $ECHO to be set by different means. -m4_defun([_LT_CC_BASENAME], -[m4_require([_LT_PREPARE_CC_BASENAME])dnl -AC_REQUIRE([_LT_DECL_SED])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl -func_cc_basename $1 -cc_basename=$func_cc_basename_result -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl -dnl -_LT_DECL([], [host_alias], [0], [The host system])dnl -_LT_DECL([], [host], [0])dnl -_LT_DECL([], [host_os], [0])dnl -dnl -_LT_DECL([], [build_alias], [0], [The build system])dnl -_LT_DECL([], [build], [0])dnl -_LT_DECL([], [build_os], [0])dnl -dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -test -z "$LN_S" && LN_S="ln -s" -_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl -dnl -AC_REQUIRE([LT_CMD_MAX_LEN])dnl -_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl -_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl -dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl -m4_require([_LT_CMD_RELOAD])dnl -m4_require([_LT_CHECK_MAGIC_METHOD])dnl -m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl -m4_require([_LT_CMD_OLD_ARCHIVE])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_WITH_SYSROOT])dnl -m4_require([_LT_CMD_TRUNCATE])dnl - -_LT_CONFIG_LIBTOOL_INIT([ -# See if we are running on zsh, and set the options that allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi -]) -if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - -_LT_CHECK_OBJDIR - -m4_require([_LT_TAG_COMPILER])dnl - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld=$lt_cv_prog_gnu_ld - -old_CC=$CC -old_CFLAGS=$CFLAGS - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from 'configure', and 'config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# 'config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain=$ac_aux_dir/ltmain.sh -])# _LT_PROG_LTMAIN - - - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the 'libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to 'config.status' so that its -# declaration there will have the same value as in 'configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags='_LT_TAGS'dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into 'config.status', and then the shell code to quote escape them in -# for loops in 'config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -_LT_OUTPUT_LIBTOOL_INIT -]) - -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# '#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test 0 = "$lt_write_fail" && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -'$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to <bug-libtool@gnu.org>." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2011 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test 0 != $[#] -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try '$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try '$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test yes = "$silent" && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options that allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST - fi - - cfgfile=${ofile}T - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL -# Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. - -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit, 1996 - -_LT_COPYING -_LT_LIBTOOL_TAGS - -# Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - cat <<'_LT_EOF' >> "$cfgfile" - -# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE - -_LT_PREPARE_MUNGE_PATH_LIST -_LT_PREPARE_CC_BASENAME - -# ### END FUNCTIONS SHARED WITH CONFIGURE - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -], -[cat <<_LT_EOF >> "$ofile" - -dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded -dnl in a comment (ie after a #). -# ### BEGIN LIBTOOL TAG CONFIG: $1 -_LT_LIBTOOL_TAG_VARS(_LT_TAG) -# ### END LIBTOOL TAG CONFIG: $1 -_LT_EOF -])dnl /m4_if -], -[m4_if([$1], [], [ - PACKAGE='$PACKAGE' - VERSION='$VERSION' - RM='$RM' - ofile='$ofile'], []) -])dnl /_LT_CONFIG_SAVE_COMMANDS -])# _LT_CONFIG - - -# LT_SUPPORTED_TAG(TAG) -# --------------------- -# Trace this macro to discover what tags are supported by the libtool -# --tag option, using: -# autoconf --trace 'LT_SUPPORTED_TAG:$1' -AC_DEFUN([LT_SUPPORTED_TAG], []) - - -# C support is built-in for now -m4_define([_LT_LANG_C_enabled], []) -m4_define([_LT_TAGS], []) - - -# LT_LANG(LANG) -# ------------- -# Enable libtool support for the given language if not already enabled. -AC_DEFUN([LT_LANG], -[AC_BEFORE([$0], [LT_OUTPUT])dnl -m4_case([$1], - [C], [_LT_LANG(C)], - [C++], [_LT_LANG(CXX)], - [Go], [_LT_LANG(GO)], - [Java], [_LT_LANG(GCJ)], - [Fortran 77], [_LT_LANG(F77)], - [Fortran], [_LT_LANG(FC)], - [Windows Resource], [_LT_LANG(RC)], - [m4_ifdef([_LT_LANG_]$1[_CONFIG], - [_LT_LANG($1)], - [m4_fatal([$0: unsupported language: "$1"])])])dnl -])# LT_LANG - - -# _LT_LANG(LANGNAME) -# ------------------ -m4_defun([_LT_LANG], -[m4_ifdef([_LT_LANG_]$1[_enabled], [], - [LT_SUPPORTED_TAG([$1])dnl - m4_append([_LT_TAGS], [$1 ])dnl - m4_define([_LT_LANG_]$1[_enabled], [])dnl - _LT_LANG_$1_CONFIG($1)])dnl -])# _LT_LANG - - -m4_ifndef([AC_PROG_GO], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_GO. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -m4_defun([AC_PROG_GO], -[AC_LANG_PUSH(Go)dnl -AC_ARG_VAR([GOC], [Go compiler command])dnl -AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl -_AC_ARG_VAR_LDFLAGS()dnl -AC_CHECK_TOOL(GOC, gccgo) -if test -z "$GOC"; then - if test -n "$ac_tool_prefix"; then - AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) - fi -fi -if test -z "$GOC"; then - AC_CHECK_PROG(GOC, gccgo, gccgo, false) -fi -])#m4_defun -])#m4_ifndef - - -# _LT_LANG_DEFAULT_CONFIG -# ----------------------- -m4_defun([_LT_LANG_DEFAULT_CONFIG], -[AC_PROVIDE_IFELSE([AC_PROG_CXX], - [LT_LANG(CXX)], - [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) - -AC_PROVIDE_IFELSE([AC_PROG_F77], - [LT_LANG(F77)], - [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) - -AC_PROVIDE_IFELSE([AC_PROG_FC], - [LT_LANG(FC)], - [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) - -dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal -dnl pulling things in needlessly. -AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [LT_LANG(GCJ)], - [AC_PROVIDE_IFELSE([LT_PROG_GCJ], - [LT_LANG(GCJ)], - [m4_ifdef([AC_PROG_GCJ], - [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([A][M_PROG_GCJ], - [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) - m4_ifdef([LT_PROG_GCJ], - [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) - -AC_PROVIDE_IFELSE([AC_PROG_GO], - [LT_LANG(GO)], - [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) - -AC_PROVIDE_IFELSE([LT_PROG_RC], - [LT_LANG(RC)], - [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) -])# _LT_LANG_DEFAULT_CONFIG - -# Obsolete macros: -AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) -AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) -AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) -AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi]) - - AC_CACHE_CHECK([for -exported_symbols_list linker flag], - [lt_cv_ld_exported_symbols_list], - [lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [lt_cv_ld_exported_symbols_list=yes], - [lt_cv_ld_exported_symbols_list=no]) - LDFLAGS=$save_LDFLAGS - ]) - - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&AS_MESSAGE_LOG_FD - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test yes = "$lt_cv_apple_cc_single_mod"; then - _lt_dar_single_mod='$single_module' - fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' - fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES([TAG]) -# --------------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test yes = "$lt_cv_ld_force_load"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], - [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - m4_if([$1], [CXX], -[ if test yes != "$lt_cv_apple_cc_single_mod"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) -# ---------------------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -# Store the results from the different compilers for each TAGNAME. -# Allow to override them for all tags through lt_cv_aix_libpath. -m4_defun([_LT_SYS_MODULE_PATH_AIX], -[m4_require([_LT_DECL_SED])dnl -if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], - [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ - lt_aix_libpath_sed='[ - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }]' - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi],[]) - if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then - _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib - fi - ]) - aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) -fi -])# _LT_SYS_MODULE_PATH_AIX - - -# _LT_SHELL_INIT(ARG) -# ------------------- -m4_define([_LT_SHELL_INIT], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script that will find a shell with a builtin -# printf (that we can use as an echo command). -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -case $ECHO in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_WITH_SYSROOT -# ---------------- -AC_DEFUN([_LT_WITH_SYSROOT], -[AC_MSG_CHECKING([for sysroot]) -AC_ARG_WITH([sysroot], -[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], - [Search for dependent libraries within DIR (or the compiler's sysroot - if not specified).])], -[], [with_sysroot=no]) - -dnl lt_sysroot will always be passed unquoted. We quote it here -dnl in case the user passed a directory name. -lt_sysroot= -case $with_sysroot in #( - yes) - if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - AC_MSG_RESULT([$with_sysroot]) - AC_MSG_ERROR([The sysroot must be an absolute path.]) - ;; -esac - - AC_MSG_RESULT([${lt_sysroot:-no}]) -_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl -[dependent libraries, and where our libraries should be installed.])]) - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test no = "$enable_libtool_lock" || enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE=32 - ;; - *ELF-64*) - HPUX_IA64_MODE=64 - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test yes != "$lt_cv_cc_needs_belf"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS - fi - ;; -*-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*|x86_64-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks=$enable_libtool_lock -])# _LT_ENABLE_LOCK - - -# _LT_PROG_AR -# ----------- -m4_defun([_LT_PROG_AR], -[AC_CHECK_TOOLS(AR, [ar], false) -: ${AR=ar} -: ${AR_FLAGS=cru} -_LT_DECL([], [AR], [1], [The archiver]) -_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) - -AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], - [lt_cv_ar_at_file=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM], - [echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' - AC_TRY_EVAL([lt_ar_try]) - if test 0 -eq "$ac_status"; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - AC_TRY_EVAL([lt_ar_try]) - if test 0 -ne "$ac_status"; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - ]) - ]) - -if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi -_LT_DECL([], [archiver_list_spec], [1], - [How to feed a file listing to the archiver]) -])# _LT_PROG_AR - - -# _LT_CMD_OLD_ARCHIVE -# ------------------- -m4_defun([_LT_CMD_OLD_ARCHIVE], -[_LT_PROG_AR - -AC_CHECK_TOOL(STRIP, strip, :) -test -z "$STRIP" && STRIP=: -_LT_DECL([], [STRIP], [1], [A symbol stripping program]) - -AC_CHECK_TOOL(RANLIB, ranlib, :) -test -z "$RANLIB" && RANLIB=: -_LT_DECL([], [RANLIB], [1], - [Commands used to install an old-style archive]) - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test yes = "[$]$2"; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS -]) - -if test yes = "[$]$2"; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring=ABCD - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n "$lt_cv_sys_max_cmd_len"; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test yes = "$cross_compiling"; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test yes != "$enable_dlopen"; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen=load_add_on - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ - lt_cv_dlopen=dyld - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen=shl_load], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen=dlopen], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else - enable_dlopen=yes - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS=$LDFLAGS - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS=$LIBS - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test yes = "$lt_cv_dlopen_self"; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links=nottested -if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test no = "$hard_links"; then - AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", - [Define to the sub-directory where libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then - - # We can hardcode non-existent directories. - if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && - test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || - test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_PREPARE_MUNGE_PATH_LIST -# --------------------------- -# Make sure func_munge_path_list() is defined correctly. -m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], -[[# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x@S|@2 in - x) - ;; - *:) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" - ;; - x:*) - eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" - ;; - *) - eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" - ;; - esac -} -]])# _LT_PREPARE_PATH_LIST - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test yes = "$GCC"; then - case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -AC_ARG_VAR([LT_SYS_LIBRARY_PATH], -[User-defined run-time library search path.]) - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[[4-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a[(]lib.so.V[)]' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec=$LIB - if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[23]].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - -_LT_DECL([], [variables_saved_for_relink], [1], - [Variables whose values should be saved in libtool wrapper scripts and - restored at link time]) -_LT_DECL([], [need_lib_prefix], [0], - [Do we need the "lib" prefix for modules?]) -_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) -_LT_DECL([], [version_type], [0], [Library versioning type]) -_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) -_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) -_LT_DECL([], [shlibpath_overrides_runpath], [0], - [Is shlibpath searched before the hard-coded library search path?]) -_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) -_LT_DECL([], [library_names_spec], [1], - [[List of archive names. First name is the real one, the rest are links. - The last name is the one that the linker finds with -lNAME]]) -_LT_DECL([], [soname_spec], [1], - [[The coded name of the library, if different from the real name]]) -_LT_DECL([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], - [Detected run-time system search path for libraries]) -_LT_DECL([], [configure_time_lt_sys_library_path], [2], - [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program that can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$1"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac]) -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program that can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test no = "$withval" || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in - *GNU* | *'with BFD'*) - test no != "$with_gnu_ld" && break - ;; - *) - test yes != "$with_gnu_ld" && break - ;; - esac - fi - done - IFS=$lt_save_ifs -else - lt_cv_path_LD=$LD # Let the user override the test with a path. -fi]) -LD=$lt_cv_path_LD -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -_LT_PATH_LD_GNU -AC_SUBST([LD]) - -_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) -])# LT_PATH_LD - -# Old names: -AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) -AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_LD], []) -dnl AC_DEFUN([AC_PROG_LD], []) - - -# _LT_PATH_LD_GNU -#- -------------- -m4_defun([_LT_PATH_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac]) -with_gnu_ld=$lt_cv_prog_gnu_ld -])# _LT_PATH_LD_GNU - - -# _LT_CMD_RELOAD -# -------------- -# find reload flag for linker -# -- PORTME Some linkers may need a different reload flag. -m4_defun([_LT_CMD_RELOAD], -[AC_CACHE_CHECK([for $LD option to reload object files], - lt_cv_ld_reload_flag, - [lt_cv_ld_reload_flag='-r']) -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then - reload_cmds=false - fi - ;; - darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac -_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl -_LT_TAGDECL([], [reload_cmds], [2])dnl -])# _LT_CMD_RELOAD - - -# _LT_PATH_DD -# ----------- -# find a working dd -m4_defun([_LT_PATH_DD], -[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD], -[printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -: ${lt_DD:=$DD} -AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], -[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: -fi]) -rm -f conftest.i conftest2.i conftest.out]) -])# _LT_PATH_DD - - -# _LT_CMD_TRUNCATE -# ---------------- -# find command to truncate a binary pipe -m4_defun([_LT_CMD_TRUNCATE], -[m4_require([_LT_PATH_DD]) -AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], -[printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -lt_cv_truncate_bin= -if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" -fi -rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) -_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], - [Command to truncate a binary pipe]) -])# _LT_CMD_TRUNCATE - - -# _LT_CHECK_MAGIC_METHOD -# ---------------------- -# how to check for library dependencies -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_MAGIC_METHOD], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -AC_CACHE_CHECK([how to recognize dependent libraries], -lt_cv_deplibs_check_method, -[lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[[4-9]]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[[45]]*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -os2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - -_LT_DECL([], [deplibs_check_method], [1], - [Method to check whether dependent libraries are shared objects]) -_LT_DECL([], [file_magic_cmd], [1], - [Command to use when deplibs_check_method = "file_magic"]) -_LT_DECL([], [file_magic_glob], [1], - [How to find potential files when deplibs_check_method = "file_magic"]) -_LT_DECL([], [want_nocaseglob], [1], - [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) -])# _LT_CHECK_MAGIC_METHOD - - -# LT_PATH_NM -# ---------- -# find the pathname to a BSD- or MS-compatible name lister -AC_DEFUN([LT_PATH_NM], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM=$NM -else - lt_nm_to_check=${ac_tool_prefix}nm - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty - case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; - *) lt_bad_file=/dev/null ;; - esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in - *$lt_bad_file* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break 2 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break 2 - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS=$lt_save_ifs - done - : ${lt_cv_path_NM=no} -fi]) -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" - ;; - *) - DUMPBIN=: - ;; - esac - fi - AC_SUBST([DUMPBIN]) - if test : != "$DUMPBIN"; then - NM=$DUMPBIN - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - -# _LT_CHECK_SHAREDLIB_FROM_LINKLIB -# -------------------------------- -# how to determine the name of the shared library -# associated with a specific link library. -# -- PORTME fill in with the dynamic library characteristics -m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], -[m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) -m4_require([_LT_DECL_DLLTOOL]) -AC_CACHE_CHECK([how to associate runtime and link libraries], -lt_cv_sharedlib_from_linklib_cmd, -[lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO - ;; -esac -]) -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - -_LT_DECL([], [sharedlib_from_linklib_cmd], [1], - [Command to associate shared and link libraries]) -])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB - - -# _LT_PATH_MANIFEST_TOOL -# ---------------------- -# locate the manifest tool -m4_defun([_LT_PATH_MANIFEST_TOOL], -[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], - [lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&AS_MESSAGE_LOG_FD - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest*]) -if test yes != "$lt_cv_path_mainfest_tool"; then - MANIFEST_TOOL=: -fi -_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl -])# _LT_PATH_MANIFEST_TOOL - - -# _LT_DLL_DEF_P([FILE]) -# --------------------- -# True iff FILE is a Windows DLL '.def' file. -# Keep in sync with func_dll_def_p in the libtool script -AC_DEFUN([_LT_DLL_DEF_P], -[dnl - test DEF = "`$SED -n dnl - -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace - -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments - -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl - -e q dnl Only consider the first "real" line - $1`" dnl -])# _LT_DLL_DEF_P - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM=-lm) - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test yes = "$GCC"; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test ia64 = "$host_cpu"; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx]" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if AC_TRY_EVAL(ac_compile); then - # Now try to grab the symbols. - nlist=conftest.nm - if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT@&t@_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT@&t@_DLSYM_CONST -#else -# define LT@&t@_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT@&t@_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[[]] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext - CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - -_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], - [Take the output of nm and produce a listing of raw symbols and C names]) -_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], - [Transform the output of nm in a proper C declaration]) -_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], - [Transform the output of nm into a list of symbols to manually relocate]) -_LT_DECL([global_symbol_to_c_name_address], - [lt_cv_sys_global_symbol_to_c_name_address], [1], - [Transform the output of nm in a C name address pair]) -_LT_DECL([global_symbol_to_c_name_address_lib_prefix], - [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], - [Transform the output of nm in a C name address pair when lib prefix is needed]) -_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], - [The name lister interface]) -_LT_DECL([], [nm_file_list_spec], [1], - [Specify filename containing input files for $NM]) -]) # _LT_CMD_GLOBAL_SYMBOLS - - -# _LT_COMPILER_PIC([TAGNAME]) -# --------------------------- -m4_defun([_LT_COMPILER_PIC], -[m4_require([_LT_TAG_COMPILER])dnl -_LT_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_TAGVAR(lt_prog_compiler_static, $1)= - -m4_if([$1], [CXX], [ - # C++ specific cases for pic, static, wl, etc. - if test yes = "$GXX"; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - if test ia64 != "$host_cpu"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64, which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test yes = "$GCC"; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - case $host_os in - os2*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' - ;; - esac - ;; - - hpux9* | hpux10* | hpux11*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - nagfor*) - # NAG Fortran compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ F* | *Sun*Fortran*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - *Intel*\ [[CF]]*Compiler*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - *Portland\ Group*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -AC_CACHE_CHECK([for $compiler option to produce PIC], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) -_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then - _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], - [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], - [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], - [Additional compiler flags for building library objects]) - -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], - [How to pass a linker flag through the compiler]) -# -# Check to make sure the static flag actually works. -# -wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" -_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) -_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], - [Compiler flag to prevent dynamic linking]) -])# _LT_COMPILER_PIC - - -# _LT_LINKER_SHLIBS([TAGNAME]) -# ---------------------------- -# See if the linker supports building shared libraries. -m4_defun([_LT_LINKER_SHLIBS], -[AC_REQUIRE([LT_PATH_LD])dnl -AC_REQUIRE([LT_PATH_NM])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -m4_if([$1], [CXX], [ - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - case $host_os in - aix[[4-9]]*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds - ;; - cygwin* | mingw* | cegcc*) - case $cc_basename in - cl*) - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - ;; - esac - ;; - *) - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -], [ - runpath_var= - _LT_TAGVAR(allow_undefined_flag, $1)= - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(archive_cmds, $1)= - _LT_TAGVAR(archive_expsym_cmds, $1)= - _LT_TAGVAR(compiler_needs_object, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(hardcode_automatic, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_separator, $1)= - _LT_TAGVAR(hardcode_minus_L, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_TAGVAR(inherit_rpath, $1)=no - _LT_TAGVAR(link_all_deplibs, $1)=unknown - _LT_TAGVAR(module_cmds, $1)= - _LT_TAGVAR(module_expsym_cmds, $1)= - _LT_TAGVAR(old_archive_from_new_cmds, $1)= - _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_TAGVAR(thread_safe_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. -dnl Note also adjust exclude_expsyms for C++ above. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - with_gnu_ld=no - ;; - esac - - _LT_TAGVAR(ld_shlibs, $1)=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test yes = "$lt_use_gnu_ld_interface"; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' - _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test linux-dietlibc = "$host_os"; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - tcc*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' - ;; - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then - runpath_var= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix[[4-9]]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then - aix_use_runtimelinking=yes - break - fi - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # traditional, no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - ;; - esac - - if test yes = "$GCC"; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - esac - ;; - - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - dgux*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - ;; - - hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) - ;; - esac - fi - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], - [lt_cv_irix_exported_symbol], - [save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" - AC_LINK_IFELSE( - [AC_LANG_SOURCE( - [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], - [C++], [[int foo (void) { return 0; }]], - [Fortran 77], [[ - subroutine foo - end]], - [Fortran], [[ - subroutine foo - end]])])], - [lt_cv_irix_exported_symbol=yes], - [lt_cv_irix_exported_symbol=no]) - LDFLAGS=$save_LDFLAGS]) - if test yes = "$lt_cv_irix_exported_symbol"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' - fi - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - linux*) - case $cc_basename in - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - _LT_TAGVAR(ld_shlibs, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - osf3*) - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='$wl' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - fi - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test sequent = "$host_vendor"; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - if test sni = "$host_vendor"; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' - ;; - esac - fi - fi -]) -AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) -test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - -_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld - -_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl -_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl -_LT_DECL([], [extract_expsyms_cmds], [2], - [The commands to extract the exported symbol list from a shared archive]) - -# -# Do we need to explicitly link libc? -# -case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $_LT_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_separator], [1], - [Whether we need a single "-rpath" flag with a separated argument]) -_LT_TAGDECL([], [hardcode_direct], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes - DIR into the resulting binary]) -_LT_TAGDECL([], [hardcode_direct_absolute], [0], - [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes - DIR into the resulting binary and the resulting library dependency is - "absolute", i.e impossible to change by setting $shlibpath_var if the - library is relocated]) -_LT_TAGDECL([], [hardcode_minus_L], [0], - [Set to "yes" if using the -LDIR flag during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_shlibpath_var], [0], - [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR - into the resulting binary]) -_LT_TAGDECL([], [hardcode_automatic], [0], - [Set to "yes" if building a shared library automatically hardcodes DIR - into the library and all subsequent libraries and executables linked - against it]) -_LT_TAGDECL([], [inherit_rpath], [0], - [Set to yes if linker adds runtime paths of dependent libraries - to runtime path list]) -_LT_TAGDECL([], [link_all_deplibs], [0], - [Whether libtool must link a program against all its dependency libraries]) -_LT_TAGDECL([], [always_export_symbols], [0], - [Set to "yes" if exported symbols are required]) -_LT_TAGDECL([], [export_symbols_cmds], [2], - [The commands to list exported symbols]) -_LT_TAGDECL([], [exclude_expsyms], [1], - [Symbols that should not be listed in the preloaded symbols]) -_LT_TAGDECL([], [include_expsyms], [1], - [Symbols that must always be exported]) -_LT_TAGDECL([], [prelink_cmds], [2], - [Commands necessary for linking programs (against libraries) with templates]) -_LT_TAGDECL([], [postlink_cmds], [2], - [Commands necessary for finishing linking programs]) -_LT_TAGDECL([], [file_list_spec], [1], - [Specify filename containing input files]) -dnl FIXME: Not yet implemented -dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], -dnl [Compiler flag to generate thread safe objects]) -])# _LT_LINKER_SHLIBS - - -# _LT_LANG_C_CONFIG([TAG]) -# ------------------------ -# Ensure that the configuration variables for a C compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_C_CONFIG], -[m4_require([_LT_DECL_EGREP])dnl -lt_save_CC=$CC -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - -_LT_TAG_COMPILER -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - LT_SYS_DLOPEN_SELF - _LT_CMD_STRIPLIB - - # Report what library types will actually be built - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_CONFIG($1) -fi -AC_LANG_POP -CC=$lt_save_CC -])# _LT_LANG_C_CONFIG - - -# _LT_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PATH_MANIFEST_TOOL])dnl -if test -n "$CXX" && ( test no != "$CXX" && - ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || - (test g++ != "$CXX"))); then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_caught_CXX_error"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_CFLAGS=$CFLAGS - lt_save_LD=$LD - lt_save_GCC=$GCC - GCC=$GXX - lt_save_with_gnu_ld=$with_gnu_ld - lt_save_path_LD=$lt_cv_path_LD - if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx - else - $as_unset lt_cv_prog_gnu_ld - fi - if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX - else - $as_unset lt_cv_path_LD - fi - test -z "${LDCXX+set}" || LD=$LDCXX - CC=${CXX-"c++"} - CFLAGS=$CXXFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - # We don't want -fno-exception when compiling C++ code, so set the - # no_builtin_flag separately - if test yes = "$GXX"; then - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - else - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - fi - - if test yes = "$GXX"; then - # Set up default GNU C++ configuration - - LT_PATH_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test yes = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='$wl' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=no - ;; - esac - - if test yes = "$GXX"; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag=$shared_flag' $wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to - # export. - _LT_TAGVAR(always_export_symbols, $1)=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - # The "-G" linker flag allows undefined symbols. - _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' - # Determine the default libpath from the value encoded in an empty - # executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX([$1]) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared - # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - # Don't use ranlib - _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' - _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - func_to_tool_file "$lt_outputfile"~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # g++ - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - darwin* | rhapsody*) - _LT_DARWIN_LINKER_FEATURES($1) - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - shrext_cmds=.dll - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - freebsd2.*) - # C++ shared libraries reported to be fairly broken before - # switch to ELF - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - freebsd-elf*) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - - freebsd* | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - hpux10*|hpux11*) - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test yes = "$GXX"; then - if test no = "$with_gnu_ld"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - if test yes = "$supports_anon_versioning"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test yes,no = "$GXX,$with_gnu_ld"; then - _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require '-G' NOT '-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no - - _LT_TAGVAR(GCC, $1)=$GXX - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS - LDCXX=$LD - LD=$lt_save_LD - GCC=$lt_save_GCC - with_gnu_ld=$lt_save_with_gnu_ld - lt_cv_path_LDCXX=$lt_cv_path_LD - lt_cv_path_LD=$lt_save_path_LD - lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld - lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -fi # test yes != "$_lt_caught_CXX_error" - -AC_LANG_POP -])# _LT_LANG_CXX_CONFIG - - -# _LT_FUNC_STRIPNAME_CNF -# ---------------------- -# func_stripname_cnf prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# -# This function is identical to the (non-XSI) version of func_stripname, -# except this one can be used by m4 code that may be executed by configure, -# rather than the libtool script. -m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl -AC_REQUIRE([_LT_DECL_SED]) -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) -func_stripname_cnf () -{ - case @S|@2 in - .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; - *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; - esac -} # func_stripname_cnf -])# _LT_FUNC_STRIPNAME_CNF - - -# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) -# --------------------------------- -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -m4_defun([_LT_SYS_HIDDEN_LIBDEPS], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl -# Dependencies to place before and after the object being linked: -_LT_TAGVAR(predep_objects, $1)= -_LT_TAGVAR(postdep_objects, $1)= -_LT_TAGVAR(predeps, $1)= -_LT_TAGVAR(postdeps, $1)= -_LT_TAGVAR(compiler_lib_search_path, $1)= - -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF -int a; -void foo (void) { a = 0; } -_LT_EOF -], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF -class Foo -{ -public: - Foo (void) { a = 0; } -private: - int a; -}; -_LT_EOF -], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer*4 a - a=0 - return - end -_LT_EOF -], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF - subroutine foo - implicit none - integer a - a=0 - return - end -_LT_EOF -], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF -public class foo { - private int a; - public void bar (void) { - a = 0; - } -}; -_LT_EOF -], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF -package foo -func foo() { -} -_LT_EOF -]) - -_lt_libdeps_save_CFLAGS=$CFLAGS -case "$CC $CFLAGS " in #( -*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; -*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; -*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; -esac - -dnl Parse the compiler output and extract the necessary -dnl objects, libraries and library flags. -if AC_TRY_EVAL(ac_compile); then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. - - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - - for p in `eval "$output_verbose_link_cmd"`; do - case $prev$p in - - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then - prev=$p - continue - fi - - # Expand the sysroot to ease extracting the directories later. - if test -z "$prev"; then - case $p in - -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; - -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; - -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; - esac - fi - case $p in - =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; - esac - if test no = "$pre_test_object_deps_done"; then - case $prev in - -L | -R) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then - _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p - else - _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$_LT_TAGVAR(postdeps, $1)"; then - _LT_TAGVAR(postdeps, $1)=$prev$p - else - _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" - fi - fi - prev= - ;; - - *.lto.$objext) ;; # Ignore GCC LTO objects - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi - - if test no = "$pre_test_object_deps_done"; then - if test -z "$_LT_TAGVAR(predep_objects, $1)"; then - _LT_TAGVAR(predep_objects, $1)=$p - else - _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" - fi - else - if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then - _LT_TAGVAR(postdep_objects, $1)=$p - else - _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" - fi - fi - ;; - - *) ;; # Ignore the rest. - - esac - done - - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling $1 test program" -fi - -$RM -f confest.$objext -CFLAGS=$_lt_libdeps_save_CFLAGS - -# PORTME: override above test on systems where it is broken -m4_if([$1], [CXX], -[case $host_os in -interix[[3-9]]*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - _LT_TAGVAR(predep_objects,$1)= - _LT_TAGVAR(postdep_objects,$1)= - _LT_TAGVAR(postdeps,$1)= - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test no = "$F77"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_F77"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${F77-"f77"} - CFLAGS=$FFLAGS - compiler=$CC - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - GCC=$G77 - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)=$G77 - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_F77" - -AC_LANG_POP -])# _LT_LANG_F77_CONFIG - - -# _LT_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test no = "$FC"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_separator, $1)= -_LT_TAGVAR(hardcode_minus_L, $1)=no -_LT_TAGVAR(hardcode_automatic, $1)=no -_LT_TAGVAR(inherit_rpath, $1)=no -_LT_TAGVAR(module_cmds, $1)= -_LT_TAGVAR(module_expsym_cmds, $1)= -_LT_TAGVAR(link_all_deplibs, $1)=unknown -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test yes != "$_lt_disable_FC"; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_GCC=$GCC - lt_save_CFLAGS=$CFLAGS - CC=${FC-"f95"} - CFLAGS=$FCFLAGS - compiler=$CC - GCC=$ac_cv_fc_compiler_gnu - - _LT_TAGVAR(compiler, $1)=$CC - _LT_CC_BASENAME([$compiler]) - - if test -n "$compiler"; then - AC_MSG_CHECKING([if libtool supports shared libraries]) - AC_MSG_RESULT([$can_build_shared]) - - AC_MSG_CHECKING([whether to build shared libraries]) - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - aix[[4-9]]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - AC_MSG_RESULT([$enable_shared]) - - AC_MSG_CHECKING([whether to build static libraries]) - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - AC_MSG_RESULT([$enable_static]) - - _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu - _LT_TAGVAR(LD, $1)=$LD - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - GCC=$lt_save_GCC - CC=$lt_save_CC - CFLAGS=$lt_save_CFLAGS -fi # test yes != "$_lt_disable_FC" - -AC_LANG_POP -])# _LT_LANG_FC_CONFIG - - -# _LT_LANG_GCJ_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Java Compiler compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_GCJ_CONFIG], -[AC_REQUIRE([LT_PROG_GCJ])dnl -AC_LANG_SAVE - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}" - -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GCJ-"gcj"} -CFLAGS=$GCJFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD -_LT_CC_BASENAME([$compiler]) - -# GCJ did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GCJ_CONFIG - - -# _LT_LANG_GO_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for the GNU Go compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_GO_CONFIG], -[AC_REQUIRE([LT_PROG_GO])dnl -AC_LANG_SAVE - -# Source file extension for Go test sources. -ac_ext=go - -# Object file extension for compiled Go test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="package main; func main() { }" - -# Code to be used in simple link tests -lt_simple_link_test_code='package main; func main() { }' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC=yes -CC=${GOC-"gccgo"} -CFLAGS=$GOFLAGS -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_TAGVAR(LD, $1)=$LD -_LT_CC_BASENAME([$compiler]) - -# Go did not exist at the time GCC didn't implicitly link libc in. -_LT_TAGVAR(archive_cmds_need_lc, $1)=no - -_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_GO_CONFIG - - -# _LT_LANG_RC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for the Windows resource compiler -# are suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to 'libtool'. -m4_defun([_LT_LANG_RC_CONFIG], -[AC_REQUIRE([LT_PROG_RC])dnl -AC_LANG_SAVE - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' - -# Code to be used in simple link tests -lt_simple_link_test_code=$lt_simple_compile_test_code - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_TAG_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_CFLAGS=$CFLAGS -lt_save_GCC=$GCC -GCC= -CC=${RC-"windres"} -CFLAGS= -compiler=$CC -_LT_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) -_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - -if test -n "$compiler"; then - : - _LT_CONFIG($1) -fi - -GCC=$lt_save_GCC -AC_LANG_RESTORE -CC=$lt_save_CC -CFLAGS=$lt_save_CFLAGS -])# _LT_LANG_RC_CONFIG - - -# LT_PROG_GCJ -# ----------- -AC_DEFUN([LT_PROG_GCJ], -[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], - [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], - [AC_CHECK_TOOL(GCJ, gcj,) - test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS)])])[]dnl -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_GCJ], []) - - -# LT_PROG_GO -# ---------- -AC_DEFUN([LT_PROG_GO], -[AC_CHECK_TOOL(GOC, gccgo,) -]) - - -# LT_PROG_RC -# ---------- -AC_DEFUN([LT_PROG_RC], -[AC_CHECK_TOOL(RC, windres,) -]) - -# Old name: -AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_RC], []) - - -# _LT_DECL_EGREP -# -------------- -# If we don't have a new enough Autoconf to choose the best grep -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_EGREP], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_REQUIRE([AC_PROG_FGREP])dnl -test -z "$GREP" && GREP=grep -_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) -_LT_DECL([], [EGREP], [1], [An ERE matcher]) -_LT_DECL([], [FGREP], [1], [A literal string matcher]) -dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too -AC_SUBST([GREP]) -]) - - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - -# _LT_DECL_DLLTOOL -# ---------------- -# Ensure DLLTOOL variable is set. -m4_defun([_LT_DECL_DLLTOOL], -[AC_CHECK_TOOL(DLLTOOL, dlltool, false) -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) -AC_SUBST([DLLTOOL]) -]) - -# _LT_DECL_SED -# ------------ -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -m4_defun([_LT_DECL_SED], -[AC_PROG_SED -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" -_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) -_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], - [Sed that helps us avoid accidentally triggering echo(1) options like -n]) -])# _LT_DECL_SED - -m4_ifndef([AC_PROG_SED], [ -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # - -m4_defun([AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f "$lt_ac_sed" && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test 10 -lt "$lt_ac_count" && break - lt_ac_count=`expr $lt_ac_count + 1` - if test "$lt_ac_count" -gt "$lt_ac_max"; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -])#AC_PROG_SED -])#m4_ifndef - -# Old name: -AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([LT_AC_PROG_SED], []) - - -# _LT_CHECK_SHELL_FEATURES -# ------------------------ -# Find out whether the shell is Bourne or XSI compatible, -# or has some other useful features. -m4_defun([_LT_CHECK_SHELL_FEATURES], -[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi -_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac -_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl -_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl -])# _LT_CHECK_SHELL_FEATURES - - -# _LT_PATH_CONVERSION_FUNCTIONS -# ----------------------------- -# Determine what file name conversion functions should be used by -# func_to_host_file (and, implicitly, by func_to_host_path). These are needed -# for certain cross-compile configurations and native mingw. -m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_MSG_CHECKING([how to convert $build file names to $host format]) -AC_CACHE_VAL(lt_cv_to_host_file_cmd, -[case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac -]) -to_host_file_cmd=$lt_cv_to_host_file_cmd -AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) -_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], - [0], [convert $build file names to $host format])dnl - -AC_MSG_CHECKING([how to convert $build file names to toolchain format]) -AC_CACHE_VAL(lt_cv_to_tool_file_cmd, -[#assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac -]) -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) -_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], - [0], [convert $build files to toolchain format])dnl -])# _LT_PATH_CONVERSION_FUNCTIONS - -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software -# Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 8 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option '$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl 'shared' nor 'disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], - [_LT_WITH_AIX_SONAME([aix])]) - ]) -])# _LT_SET_OPTIONS - - - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the 'shared' and -# 'disable-shared' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the 'static' and -# 'disable-static' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the 'fast-install' -# and 'disable-fast-install' LT_INIT options. -# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the 'disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_AIX_SONAME([DEFAULT]) -# ---------------------------------- -# implement the --with-aix-soname flag, and support the `aix-soname=aix' -# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT -# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. -m4_define([_LT_WITH_AIX_SONAME], -[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl -shared_archive_member_spec= -case $host,$enable_shared in -power*-*-aix[[5-9]]*,yes) - AC_MSG_CHECKING([which variant of shared library versioning to provide]) - AC_ARG_WITH([aix-soname], - [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], - [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], - [case $withval in - aix|svr4|both) - ;; - *) - AC_MSG_ERROR([Unknown argument to --with-aix-soname]) - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname], - [AC_CACHE_VAL([lt_cv_with_aix_soname], - [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) - with_aix_soname=$lt_cv_with_aix_soname]) - AC_MSG_RESULT([$with_aix_soname]) - if test aix != "$with_aix_soname"; then - # For the AIX way of multilib, we name the shared archive member - # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', - # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. - # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, - # the AIX toolchain works better with OBJECT_MODE set (default 32). - if test 64 = "${OBJECT_MODE-32}"; then - shared_archive_member_spec=shr_64 - else - shared_archive_member_spec=shr - fi - fi - ;; -*) - with_aix_soname=aix - ;; -esac - -_LT_DECL([], [shared_archive_member_spec], [0], - [Shared archive member basename, for filename based shared library versioning on AIX])dnl -])# _LT_WITH_AIX_SONAME - -LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) -LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) -LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' -# LT_INIT options. -# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac], - [pic_mode=m4_default([$1], [default])]) - -_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl -])# _LT_WITH_PIC - -LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) - -# Old name: -AU_DEFUN([AC_LIBTOOL_PICMODE], -[_LT_SET_OPTION([LT_INIT], [pic-only]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the 'pic-only' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) - - -m4_define([_LTDL_MODE], []) -LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], - [m4_define([_LTDL_MODE], [nonrecursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [recursive], - [m4_define([_LTDL_MODE], [recursive])]) -LT_OPTION_DEFINE([LTDL_INIT], [subproject], - [m4_define([_LTDL_MODE], [subproject])]) - -m4_define([_LTDL_TYPE], []) -LT_OPTION_DEFINE([LTDL_INIT], [installable], - [m4_define([_LTDL_TYPE], [installable])]) -LT_OPTION_DEFINE([LTDL_INIT], [convenience], - [m4_define([_LTDL_TYPE], [convenience])]) - -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software -# Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59, which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) - -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# @configure_input@ - -# serial 4179 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.4.6]) -m4_define([LT_PACKAGE_REVISION], [2.4.6]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.4.6' -macro_revision='2.4.6' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) - -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software -# Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) - -# Copyright (C) 2002-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.15' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.15], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.15])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <http://www.gnu.org/software/coreutils/>. - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 1999-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2014 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar <conftest.tar]) - AM_RUN_LOG([cat conftest.dir/file]) - grep GrepMe conftest.dir/file >/dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR -
diff --git a/third_party/libxslt/src/compile b/third_party/libxslt/src/compile deleted file mode 100755 index 531136b..0000000 --- a/third_party/libxslt/src/compile +++ /dev/null
@@ -1,347 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2012-10-14.11; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. -# Written by Tom Tromey <tromey@cygnus.com>. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to <bug-automake@gnu.org> or send patches to -# <automake-patches@gnu.org>. - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to <bug-automake@gnu.org>. -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
diff --git a/third_party/libxslt/src/config.guess b/third_party/libxslt/src/config.guess deleted file mode 100755 index b79252d..0000000 --- a/third_party/libxslt/src/config.guess +++ /dev/null
@@ -1,1558 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-06-10' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). -# -# Originally written by Per Bothner. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -# -# Please send patches with a ChangeLog entry to config-patches@gnu.org. - - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright 1992-2013 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -case "${UNAME_SYSTEM}" in -Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu - - eval $set_cc_for_build - cat <<-EOF > $dummy.c - #include <features.h> - #if defined(__UCLIBC__) - LIBC=uclibc - #elif defined(__dietlibc__) - LIBC=dietlibc - #else - LIBC=gnu - #endif - EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - ;; -esac - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include <stdio.h> /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <sys/systemcfg.h> - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include <unistd.h> - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - aarch64_be:Linux:*:*) - UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi - else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } - ;; - or1k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; - ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; - ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL - elif /bin/uname -X 2>/dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes <hewes@openmarket.com>. - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc - fi - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi - fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; - x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; -esac - -eval $set_cc_for_build -cat >$dummy.c <<EOF -#ifdef _SEQUENT_ -# include <sys/types.h> -# include <sys/utsname.h> -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include <sys/param.h> - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include <sys/param.h> -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 <<EOF -$0: unable to guess system type - -This script, last modified $timestamp, has failed to recognize -the operating system you are using. It is advised that you -download the most up to date version of the config scripts from - - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD -and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -If the version you run ($0) is already up to date, please -send the following data and any information you think might be -pertinent to <config-patches@gnu.org> in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End:
diff --git a/third_party/libxslt/src/config.sub b/third_party/libxslt/src/config.sub deleted file mode 100755 index 9633db7..0000000 --- a/third_party/libxslt/src/config.sub +++ /dev/null
@@ -1,1791 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright 1992-2013 Free Software Foundation, Inc. - -timestamp='2013-08-10' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that -# program. This Exception is an additional permission under section 7 -# of the GNU General Public License, version 3 ("GPLv3"). - - -# Please send patches with a ChangeLog entry to config-patches@gnu.org. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to <config-patches@gnu.org>." - -version="\ -GNU config.sub ($timestamp) - -Copyright 1992-2013 Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 \ - | or1k | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none - ;; - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - c8051-*) - os=-elf - ;; - hexagon-*) - os=-elf - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or1k-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End:
diff --git a/third_party/libxslt/src/configure b/third_party/libxslt/src/configure deleted file mode 100755 index a3c2bbf..0000000 --- a/third_party/libxslt/src/configure +++ /dev/null
@@ -1,17223 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 </dev/null -exec 6>&1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="libxslt/xslt.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include <stdio.h> -#ifdef HAVE_SYS_TYPES_H -# include <sys/types.h> -#endif -#ifdef HAVE_SYS_STAT_H -# include <sys/stat.h> -#endif -#ifdef STDC_HEADERS -# include <stdlib.h> -# include <stddef.h> -#else -# ifdef HAVE_STDLIB_H -# include <stdlib.h> -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include <memory.h> -# endif -# include <string.h> -#endif -#ifdef HAVE_STRINGS_H -# include <strings.h> -#endif -#ifdef HAVE_INTTYPES_H -# include <inttypes.h> -#endif -#ifdef HAVE_STDINT_H -# include <stdint.h> -#endif -#ifdef HAVE_UNISTD_H -# include <unistd.h> -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -RELDATE -M_LIBS -EXTRA_LIBS -EXSLT_LIBS -EXSLT_INCLUDEDIR -EXSLT_LIBDIR -XSLT_LIBS -XSLT_INCLUDEDIR -XSLT_LIBDIR -PYTHON_SITE_PACKAGES -PYTHON_INCLUDES -PYTHON_VERSION -LIBXML_CFLAGS -LIBXML_LIBS -PYTHONSODV -XSLTPROCDV -WIN32_EXTRA_LDFLAGS -WIN32_EXTRA_LIBADD -LIBXSLT_DEFAULT_PLUGINS_PATH -WITH_MODULES_FALSE -WITH_MODULES_TRUE -WITH_MODULES -XML_CONFIG -LIBXML_REQUIRED_VERSION -LIBXML_SRC -WITH_DEBUGGER -WITH_MEM_DEBUG -WITH_XSLT_DEBUG -LIBGCRYPT_LIBS -LIBGCRYPT_CFLAGS -CRYPTO_TESTDIR -WITH_CRYPTO -LIBGCRYPT_CONFIG -PYTHON_LIBS -PYTHON_SUBDIR -pythondir -WITH_PYTHON_FALSE -WITH_PYTHON_TRUE -PYTHON -WITH_PERL_FALSE -WITH_PERL_TRUE -PERL -WITH_TRIO -XSLT_LOCALE_WINAPI -XSLT_LOCALE_XLOCALE -THREAD_LIBS -USE_VERSION_SCRIPT_FALSE -USE_VERSION_SCRIPT_TRUE -VERSION_SCRIPT_FLAGS -LT_SYS_LIBRARY_PATH -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -ac_ct_AR -AR -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -SED -LIBTOOL -OBJDUMP -DLLTOOL -AS -XSLTPROC -XMLLINT -TAR -MV -RM -HTML_DIR -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -LIBEXSLT_VERSION_EXTRA -LIBEXSLT_VERSION_NUMBER -LIBEXSLT_VERSION_INFO -LIBEXSLT_VERSION -LIBEXSLT_MICRO_VERSION -LIBEXSLT_MINOR_VERSION -LIBEXSLT_MAJOR_VERSION -LIBXSLT_MAJOR_MINOR_VERSION -LIBXSLT_VERSION_EXTRA -LIBXSLT_VERSION_NUMBER -LIBXSLT_VERSION_INFO -LIBXSLT_VERSION -LIBXSLT_MICRO_VERSION -LIBXSLT_MINOR_VERSION -LIBXSLT_MAJOR_VERSION -EGREP -GREP -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_dependency_tracking -enable_silent_rules -with_html_dir -with_html_subdir -enable_shared -enable_static -with_pic -enable_fast_install -with_aix_soname -with_gnu_ld -with_sysroot -enable_libtool_lock -with_python -with_crypto -with_debug -with_mem_debug -with_debugger -with_libxml_prefix -with_libxml_include_prefix -with_libxml_libs_prefix -with_libxml_src -with_plugins -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -LT_SYS_LIBRARY_PATH' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-html-dir=path path to base html directory, default - $datadir/doc/html - --with-html-subdir=path directory used under html-dir, default - $PACKAGE-$VERSION/html - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-aix-soname=aix|svr4|both - shared library versioning (aka "SONAME") variant to - provide on AIX, [default=aix]. - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot[=DIR] Search for dependent libraries within DIR (or the - compiler's sysroot if not specified). - --with-python=DIR Build Python bindings if found - --with-crypto Add crypto support to exslt (on) - --with-debug Add the debugging code (on) - --with-mem-debug Add the memory debugging module (off) - --with-debugger Add the debugging support (on) - --with-libxml-prefix=PFX Specify location of libxml config - --with-libxml-include-prefix=PFX Specify location of libxml headers - --with-libxml-libs-prefix=PFX Specify location of libxml libs - --with-libxml-src=DIR For libxml thats not installed yet (sets all three above) - --with-plugins Add plugin extension support (on) - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a - nonstandard directory <lib dir> - LIBS libraries to pass to the linker, e.g. -l<library> - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if - you have headers in a nonstandard directory <include dir> - CPP C preprocessor - LT_SYS_LIBRARY_PATH - User-defined run-time library search path. - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case <limits.h> declares $2. - For example, HP-UX 11i <limits.h> declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - <limits.h> exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -ac_config_headers="$ac_config_headers config.h" - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdio.h> -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h - - -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h - - -$as_echo "#define _MINIX 1" >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes -else - ac_cv_safe_to_define___extensions__=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - - - -LIBXSLT_MAJOR_VERSION=1 -LIBXSLT_MINOR_VERSION=1 -LIBXSLT_MICRO_VERSION=29 -PACKAGE=libxslt -LIBEXSLT_MAJOR_VERSION=0 -LIBEXSLT_MINOR_VERSION=8 -LIBEXSLT_MICRO_VERSION=17 -LIBXML_REQUIRED_VERSION=2.6.27 - - -LIBXSLT_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION.$LIBXSLT_MICRO_VERSION -LIBXSLT_VERSION_INFO=`expr $LIBXSLT_MAJOR_VERSION + $LIBXSLT_MINOR_VERSION`:$LIBXSLT_MICRO_VERSION:$LIBXSLT_MINOR_VERSION - -LIBXSLT_VERSION_NUMBER=`expr $LIBXSLT_MAJOR_VERSION \* 10000 + $LIBXSLT_MINOR_VERSION \* 100 + $LIBXSLT_MICRO_VERSION` -LIBXSLT_MAJOR_MINOR_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION - -if test -f CVS/Entries; then - extra=`grep ChangeLog CVS/Entries | grep -v LIBXSLT | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%` - echo extra=$extra - if test "$extra" != "" - then - LIBXSLT_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 - LIBXSLT_VERSION_EXTRA="-SVN$extra" - fi -else if test -d .git ; then - extra=`git describe | sed 's+LIBXSLT[0-9.]*-++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXSLT_VERSION_EXTRA="-GIT$extra" - fi -fi -fi -fi - - - - - - - - - - - -LIBEXSLT_VERSION=$LIBEXSLT_MAJOR_VERSION.$LIBEXSLT_MINOR_VERSION.$LIBEXSLT_MICRO_VERSION -LIBEXSLT_VERSION_INFO=`expr $LIBEXSLT_MAJOR_VERSION + $LIBEXSLT_MINOR_VERSION`:$LIBEXSLT_MICRO_VERSION:$LIBEXSLT_MINOR_VERSION - -LIBEXSLT_VERSION_NUMBER=`expr $LIBEXSLT_MAJOR_VERSION \* 10000 + $LIBEXSLT_MINOR_VERSION \* 100 + $LIBEXSLT_MICRO_VERSION` - -if test -f CVS/Entries; then - LIBEXSLT_VERSION_EXTRA=-CVS`grep ChangeLog CVS/Entries | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%` -fi - - - - - - - - - -VERSION=${LIBXSLT_VERSION} - -am__api_version='1.15' - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - - PACKAGE=$PACKAGE - VERSION=$VERSION - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html> -# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html> -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542> - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: <http://www.gnu.org/software/coreutils/>. - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -# AM_MAINTAINER_MODE - -# Support silent build rules, requires at least automake-1.11. Disable -# by either passing --disable-silent-rules to configure or passing V=1 -# to make -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=0;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - - - - -# Check whether --with-html-dir was given. -if test "${with_html_dir+set}" = set; then : - withval=$with_html_dir; HTML_DIR=$withval -else - HTML_DIR='$(datadir)/doc' -fi - - - -# Check whether --with-html-subdir was given. -if test "${with_html_subdir+set}" = set; then : - withval=$with_html_subdir; test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval" -else - HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html" -fi - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdio.h> -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since - # <limits.h> exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include <limits.h> -#else -# include <assert.h> -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ac_nonexistent.h> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Extract the first word of "rm", so it can be a program name with args. -set dummy rm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RM in - [\\/]* | ?:[\\/]*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/rm" - ;; -esac -fi -RM=$ac_cv_path_RM -if test -n "$RM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 -$as_echo "$RM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "mv", so it can be a program name with args. -set dummy mv; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MV in - [\\/]* | ?:[\\/]*) - ac_cv_path_MV="$MV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MV" && ac_cv_path_MV="/bin/mv" - ;; -esac -fi -MV=$ac_cv_path_MV -if test -n "$MV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 -$as_echo "$MV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "tar", so it can be a program name with args. -set dummy tar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="/bin/tar" - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 -$as_echo "$TAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "xmllint", so it can be a program name with args. -set dummy xmllint; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XMLLINT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XMLLINT in - [\\/]* | ?:[\\/]*) - ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XMLLINT" && ac_cv_path_XMLLINT="/usr/bin/xmllint" - ;; -esac -fi -XMLLINT=$ac_cv_path_XMLLINT -if test -n "$XMLLINT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 -$as_echo "$XMLLINT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "xsltproc", so it can be a program name with args. -set dummy xsltproc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XSLTPROC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XSLTPROC in - [\\/]* | ?:[\\/]*) - ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="/usr/bin/xsltproc" - ;; -esac -fi -XSLTPROC=$ac_cv_path_XSLTPROC -if test -n "$XSLTPROC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 -$as_echo "$XSLTPROC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> -#include <stdarg.h> -#include <string.h> -#include <float.h> - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <string.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdlib.h> - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <ctype.h> -#include <stdlib.h> -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.6' -macro_revision='2.4.6' - - - - - - - - - - - - - -ltmain=$ac_aux_dir/ltmain.sh - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test yes = "$GCC"; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return, which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD=$ac_prog - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD=$ac_dir/$ac_prog - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in - *GNU* | *'with BFD'*) - test no != "$with_gnu_ld" && break - ;; - *) - test yes != "$with_gnu_ld" && break - ;; - esac - fi - done - IFS=$lt_save_ifs -else - lt_cv_path_LD=$LD # Let the user override the test with a path. -fi -fi - -LD=$lt_cv_path_LD -if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 </dev/null` in -*GNU* | *'with BFD'*) - lt_cv_prog_gnu_ld=yes - ;; -*) - lt_cv_prog_gnu_ld=no - ;; -esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM=$NM -else - lt_nm_to_check=${ac_tool_prefix}nm - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - tmp_nm=$ac_dir/$lt_tmp_nm - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the 'sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty - case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; - *) lt_bad_file=/dev/null ;; - esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in - *$lt_bad_file* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break 2 - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break 2 - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS=$lt_save_ifs - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test no != "$lt_cv_path_NM"; then - NM=$lt_cv_path_NM -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols -headers" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test : != "$DUMPBIN"; then - NM=$DUMPBIN - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring=ABCD - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len" && \ - test undefined != "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test X`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test 17 != "$i" # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test yes != "$GCC"; then - reload_cmds=false - fi - ;; - darwin*) - if test yes = "$GCC"; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# 'unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# that responds to the $file_magic_cmd with a given extended regex. -# If you have 'file' or equivalent on your system and you're not sure -# whether 'pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - if ( file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd* | bitrig*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -os2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh; - # decide which one to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd=$ECHO - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test 0 -eq "$ac_status"; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test 0 -ne "$ac_status"; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test ia64 = "$host_cpu"; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" - # Adjust the below global symbol transforms to fixup imported variables. - lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" - lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" - lt_c_name_lib_hook="\ - -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ - -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" -else - # Disable hooks by default. - lt_cv_sys_global_symbol_to_import= - lt_cdecl_hook= - lt_c_name_hook= - lt_c_name_lib_hook= -fi - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ -$lt_cdecl_hook\ -" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ -$lt_c_name_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" - -# Transform an extracted symbol line into symbol name with lib prefix and -# symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ -$lt_c_name_lib_hook\ -" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ -" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ -" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function, - # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ -" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ -" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ -" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ -" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE -/* DATA imports from DLLs on WIN32 can't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined __osf__ -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS=conftstm.$ac_objext - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test yes = "$pipe_works"; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case $with_sysroot in #( - yes) - if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else - printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -: ${lt_DD:=$DD} -if test -z "$lt_DD"; then - ac_path_lt_DD_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_lt_DD" || continue -if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: -fi - $ac_path_lt_DD_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_lt_DD"; then - : - fi -else - ac_cv_path_lt_DD=$lt_DD -fi - -rm -f conftest.i conftest2.i conftest.out -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else - printf 0123456789abcdef0123456789abcdef >conftest.i -cat conftest.i conftest.i >conftest2.i -lt_cv_truncate_bin= -if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then - cmp -s conftest.i conftest.out \ - && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" -fi -rm -f conftest.i conftest2.i conftest.out -test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } - - - - - - - -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in $*""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test no = "$enable_libtool_lock" || enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out what ABI is being produced by ac_compile, and set mode - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE=32 - ;; - *ELF-64*) - HPUX_IA64_MODE=64 - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -mips64*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - emul=elf - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - emul="${emul}32" - ;; - *64-bit*) - emul="${emul}64" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *MSB*) - emul="${emul}btsmip" - ;; - *LSB*) - emul="${emul}ltsmip" - ;; - esac - case `/usr/bin/file conftest.$ac_objext` in - *N32*) - emul="${emul}n32" - ;; - esac - LD="${LD-ld} -m $emul" - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. Note that the listed cases only cover the - # situations where additional linker options are needed (such as when - # doing 32-bit compilation for a host where ld defaults to 64-bit, or - # vice versa); the common cases where no linker options are needed do - # not appear in the list. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in - *x86-64*) - LD="${LD-ld} -m elf32_x86_64" - ;; - *) - LD="${LD-ld} -m elf_i386" - ;; - esac - ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test yes != "$lt_cv_cc_needs_belf"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS=$SAVE_CFLAGS - fi - ;; -*-*solaris*) - # Find out what ABI is being produced by ac_compile, and set linker - # options accordingly. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*|x86_64-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD=${LD-ld}_sol2 - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks=$enable_libtool_lock - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "$LT_MULTI_MODULE"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test 0 = "$_lt_result"; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test yes = "$lt_cv_apple_cc_single_mod"; then - _lt_dar_single_mod='$single_module' - fi - if test yes = "$lt_cv_ld_exported_symbols_list"; then - _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' - fi - if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x$2 in - x) - ;; - *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" - ;; - x:*) - eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" - ;; - *) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" - ;; - esac -} - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - - - -# Set options -enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AS" = x; then - AS="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AS=$ac_ct_AS - fi -else - AS="$ac_cv_prog_AS" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - - ;; -esac - -test -z "$AS" && AS=as - - - - - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - enable_dlopen=no - - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else - pic_mode=default -fi - - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for pkg in $enableval; do - IFS=$lt_save_ifs - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - shared_archive_member_spec= -case $host,$enable_shared in -power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } - -# Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : - withval=$with_aix_soname; case $withval in - aix|svr4|both) - ;; - *) - as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_with_aix_soname=aix -fi - - with_aix_soname=$lt_cv_with_aix_soname -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } - if test aix != "$with_aix_soname"; then - # For the AIX way of multilib, we name the shared archive member - # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', - # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. - # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, - # the AIX toolchain works better with OBJECT_MODE set (default 32). - if test 64 = "${OBJECT_MODE-32}"; then - shared_archive_member_spec=shr_64 - else - shared_archive_member_spec=shr - fi - fi - ;; -*) - with_aix_soname=aix - ;; -esac - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS=$ltmain - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld=$lt_cv_prog_gnu_ld - -old_CC=$CC -old_CFLAGS=$CFLAGS - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -func_cc_basename $compiler -cc_basename=$func_cc_basename_result - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/${ac_tool_prefix}file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac -fi - -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD=$MAGIC_CMD - lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS=$lt_save_ifs - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/file"; then - lt_cv_path_MAGIC_CMD=$ac_dir/"file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD=$lt_cv_path_MAGIC_CMD - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS=$lt_save_ifs - MAGIC_CMD=$lt_save_MAGIC_CMD - ;; -esac -fi - -MAGIC_CMD=$lt_cv_path_MAGIC_CMD -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC=$CC -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test yes = "$GCC"; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test yes = "$GCC"; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - lt_prog_compiler_pic='-fPIC' - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the '-m68020' flag to GCC prevents building anything better, - # like '-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static='$wl-static' - ;; - esac - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test ia64 = "$host_cpu"; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - case $cc_basename in - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - case $host_os in - os2*) - lt_prog_compiler_static='$wl-static' - ;; - esac - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='$wl-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - case $cc_basename in - # old Intel for x86_64, which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms that do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test yes = "$lt_cv_prog_compiler_pic_works"; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test yes = "$lt_cv_prog_compiler_static_works"; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links=nottested -if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ' (' and ')$', so one must not match beginning or - # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', - # as well as any symbol that contains 'd'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test yes != "$GCC"; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd* | bitrig*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test yes = "$with_gnu_ld"; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test yes = "$lt_use_gnu_ld_interface"; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='$wl' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - export_dynamic_flag_spec='$wl--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test ia64 != "$host_cpu"; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach <jrb3@best.com> says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='$wl--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file, use it as - # is; otherwise, prepend EXPORTS... - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll - archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test linux-dietlibc = "$host_os"; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test no = "$tmp_diet" - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - nagfor*) # NAGFOR 5.3 - tmp_sharedflag='-Wl,-shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - tcc*) - export_dynamic_flag_spec='-rdynamic' - ;; - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test yes = "$supports_anon_versioning"; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test no = "$ld_shlibs"; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test ia64 = "$host_cpu"; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag= - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to GNU nm, but means don't demangle to AIX nm. - # Without the "-l" option, or with the "-B" option, AIX nm treats - # weak defined symbols like other global defined symbols, whereas - # GNU nm marks them as "W". - # While the 'weak' keyword is ignored in the Export File, we need - # it in the Import File for the 'aix-soname' feature, so we have - # to replace the "-B" option with "-P" for AIX nm. - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # have runtime linking enabled, and use it for executables. - # For shared libraries, we enable/disable runtime linking - # depending on the kind of the shared library created - - # when "with_aix_soname,aix_use_runtimelinking" is: - # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables - # "aix,yes" lib.so shared, rtl:yes, for executables - # lib.a static archive - # "both,no" lib.so.V(shr.o) shared, rtl:yes - # lib.a(lib.so.V) shared, rtl:no, for executables - # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a(lib.so.V) shared, rtl:no - # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables - # lib.a static archive - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then - aix_use_runtimelinking=yes - break - fi - done - if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then - # With aix-soname=svr4, we create the lib.so.V shared archives only, - # so we don't have lib.a shared libs to link our executables. - # We have to force runtime linking in this case. - aix_use_runtimelinking=yes - LDFLAGS="$LDFLAGS -Wl,-brtl" - fi - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='$wl-f,' - case $with_aix_soname,$aix_use_runtimelinking in - aix,*) ;; # traditional, no import file - svr4,* | *,yes) # use import file - # The Import File defines what to hardcode. - hardcode_direct=no - hardcode_direct_absolute=no - ;; - esac - - if test yes = "$GCC"; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`$CC -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test yes = "$aix_use_runtimelinking"; then - shared_flag="$shared_flag "'$wl-G' - fi - # Need to ensure runtime linking is disabled for the traditional - # shared library, or the linker may eventually find shared libraries - # /with/ Import File - we do not want to mix them. - shared_flag_aix='-shared' - shared_flag_svr4='-shared $wl-G' - else - # not using gcc - if test ia64 = "$host_cpu"; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test yes = "$aix_use_runtimelinking"; then - shared_flag='$wl-G' - else - shared_flag='$wl-bM:SRE' - fi - shared_flag_aix='$wl-bM:SRE' - shared_flag_svr4='$wl-G' - fi - fi - - export_dynamic_flag_spec='$wl-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag - else - if test ia64 = "$host_cpu"; then - hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test set = "${lt_cv_aix_libpath+set}"; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=/usr/lib:/lib - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' $wl-bernotok' - allow_undefined_flag=' $wl-berok' - if test yes = "$with_gnu_ld"; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' - # -brtl affects multiple linker settings, -berok does not and is overridden later - compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' - if test svr4 != "$with_aix_soname"; then - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' - fi - if test aix != "$with_aix_soname"; then - archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' - else - # used by -dlpreopen to get the symbols - archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' - fi - archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' - archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then - cp "$export_symbols" "$output_objdir/$soname.def"; - echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; - else - $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile=$lt_outputfile.exe - lt_tool_outputfile=$lt_tool_outputfile.exe - ;; - esac~ - if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=.dll - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test yes = "$lt_cv_ld_force_load"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag=$_lt_dar_allow_undefined - case $cc_basename in - ifort*|nagfor*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test yes = "$_lt_dar_can_shared"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test yes = "$GCC"; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='$wl-E' - ;; - - hpux10*) - if test yes,no = "$GCC,$with_gnu_ld"; then - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test yes,no = "$GCC,$with_gnu_ld"; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS=$save_LDFLAGS - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test yes = "$lt_cv_prog_compiler__b"; then - archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test no = "$with_gnu_ld"; then - hardcode_libdir_flag_spec='$wl+b $wl$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='$wl-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test yes = "$GCC"; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test yes = "$lt_cv_irix_exported_symbol"; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - linux*) - case $cc_basename in - tcc*) - # Fabrice Bellard et al's Tiny C Compiler - ld_shlibs=yes - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd* | bitrig*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - export_dynamic_flag_spec='$wl-E' - else - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='$wl-rpath,$libdir' - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - shrext_cmds=.dll - archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ - $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ - $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ - $ECHO EXPORTS >> $output_objdir/$libname.def~ - prefix_cmds="$SED"~ - if test EXPORTS = "`$SED 1q $export_symbols`"; then - prefix_cmds="$prefix_cmds -e 1d"; - fi~ - prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ - cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ - $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ - emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' - enable_shared_with_static_runtimes=yes - ;; - - osf3*) - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test yes = "$GCC"; then - allow_undefined_flag=' $wl-expect_unresolved $wl\*' - archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' - hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test yes = "$GCC"; then - wlarc='$wl' - archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='$wl' - archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands '-z linker_flag'. GCC discards it without '$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test yes = "$GCC"; then - whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test sequent = "$host_vendor"; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='$wl-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We CANNOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='$wl-z,text' - allow_undefined_flag='$wl-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='$wl-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='$wl-Bexport' - runpath_var='LD_RUN_PATH' - - if test yes = "$GCC"; then - archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test sni = "$host_vendor"; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='$wl-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test no = "$ld_shlibs" && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test yes,yes = "$GCC,$enable_shared"; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test yes = "$GCC"; then - case $host_os in - darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; - *) lt_awk_arg='/^libraries:/' ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; - *) lt_sed_strip_eq='s|=/|/|g' ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary... - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - # ...but if some path component already ends with the multilib dir we assume - # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). - case "$lt_multi_os_dir; $lt_search_path_spec " in - "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) - lt_multi_os_dir= - ;; - esac - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" - elif test -n "$lt_multi_os_dir"; then - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS = " "; FS = "/|\n";} { - lt_foo = ""; - lt_count = 0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo = "/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's|/\([A-Za-z]:\)|\1|g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=.so -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - - - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='$libname$release$shared_ext$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test ia64 = "$host_cpu"; then - # AIX 5 supports IA64 - library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line '#! .'. This would cause the generated library to - # depend on '.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # Using Import Files as archive members, it is possible to support - # filename-based versioning of shared library archives on AIX. While - # this would work for both with and without runtime linking, it will - # prevent static linking of such archives. So we do filename-based - # shared library versioning with .so extension only, which is used - # when both runtime linking and shared linking is enabled. - # Unfortunately, runtime linking may impact performance, so we do - # not want this to be the default eventually. Also, we use the - # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. - # To allow for filename-based versioning support, we need to create - # libNAME.so.V as an archive file, containing: - # *) an Import File, referring to the versioned filename of the - # archive as well as the shared archive member, telling the - # bitwidth (32 or 64) of that shared object, and providing the - # list of exported symbols of that shared object, eventually - # decorated with the 'weak' keyword - # *) the shared object with the F_LOADONLY flag set, to really avoid - # it being seen by the linker. - # At run time we better use the real file rather than another symlink, - # but for link time we create the symlink libNAME.so -> libNAME.so.V - - case $with_aix_soname,$aix_use_runtimelinking in - # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - aix,yes) # traditional libtool - dynamic_linker='AIX unversionable lib.so' - # If using run time linking (on AIX 4.2 or later) use lib<name>.so - # instead of lib<name>.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - aix,no) # traditional AIX only - dynamic_linker='AIX lib.a(lib.so.V)' - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - ;; - svr4,*) # full svr4 only - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,yes) # both, prefer svr4 - dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" - library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' - # unpreferred sharedlib libNAME.a needs extra handling - postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' - postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' - # We do not specify a path in Import Files, so LIBPATH fires. - shlibpath_overrides_runpath=yes - ;; - *,no) # both, prefer aix - dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" - library_names_spec='$libname$release.a $libname.a' - soname_spec='$libname$release$shared_ext$major' - # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling - postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' - postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' - ;; - esac - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='$libname$shared_ext' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' - library_names_spec='$libname.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec=$LIB - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' - soname_spec='$libname$release$major$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=no - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - if test 32 = "$HPUX_IA64_MODE"; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - sys_lib_dlsearch_path_spec=/usr/lib/hpux32 - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - sys_lib_dlsearch_path_spec=/usr/lib/hpux64 - fi - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test yes = "$lt_cv_prog_gnu_ld"; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" - sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -linux*android*) - version_type=none # Android doesn't support versioned libraries. - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext' - soname_spec='$libname$release$shared_ext' - finish_cmds= - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Ideally, we could use ldconfig to report *all* directores which are - # searched for libraries, however this is still not possible. Aside from not - # being certain /sbin/ldconfig is available, command - # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, - # even though it is searched at run-time. Try to do the best guess by - # appending ld.so.conf contents (and includes) to the search path. - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd* | bitrig*) - version_type=sunos - sys_lib_dlsearch_path_spec=/usr/lib - need_lib_prefix=no - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then - need_version=no - else - need_version=yes - fi - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -os2*) - libname_spec='$name' - version_type=windows - shrext_cmds=.dll - need_version=no - need_lib_prefix=no - # OS/2 can only load a DLL with a base name of 8 characters or less. - soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; - v=$($ECHO $release$versuffix | tr -d .-); - n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); - $ECHO $n$v`$shared_ext' - library_names_spec='${libname}_dll.$libext' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=BEGINLIBPATH - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - postinstall_cmds='base_file=`basename \$file`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='$libname$release$shared_ext$major' - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test yes = "$with_gnu_ld"; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec; then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' - soname_spec='$libname$shared_ext.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=sco - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test yes = "$with_gnu_ld"; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' - soname_spec='$libname$release$shared_ext$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test no = "$dynamic_linker" && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test yes = "$GCC"; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then - sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec -fi - -if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then - sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec -fi - -# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... -configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec - -# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code -func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" - -# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool -configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test yes = "$hardcode_automatic"; then - - # We can hardcode non-existent directories. - if test no != "$hardcode_direct" && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && - test no != "$hardcode_minus_L"; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test relink = "$hardcode_action" || - test yes = "$inherit_rpath"; then - # Fast installation is not supported - enable_fast_install=no -elif test yes = "$shlibpath_overrides_runpath" || - test no = "$enable_shared"; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test yes != "$enable_dlopen"; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen=load_add_on - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen=LoadLibrary - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - - lt_cv_dlopen=dyld - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - tpf*) - # Don't try to run any link tests for TPF. We know it's impossible - # because TPF is a cross-compiler, and we know how we open DSOs. - lt_cv_dlopen=dlopen - lt_cv_dlopen_libs= - lt_cv_dlopen_self=no - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test no = "$lt_cv_dlopen"; then - enable_dlopen=no - else - enable_dlopen=yes - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS=$CPPFLAGS - test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS=$LDFLAGS - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS=$LIBS - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test yes = "$cross_compiling"; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test yes = "$lt_cv_dlopen_self"; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test yes = "$cross_compiling"; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include <dlfcn.h> -#endif - -#include <stdio.h> - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisibility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS=$save_CPPFLAGS - LDFLAGS=$save_LDFLAGS - LIBS=$save_LIBS - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test no = "$can_build_shared" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test yes = "$enable_shared" && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test ia64 != "$host_cpu"; then - case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in - yes,aix,yes) ;; # shared object as lib.so file only - yes,svr4,*) ;; # shared object as lib.so archive member only - yes,*) enable_static=no ;; # shared object in lib.a archive as well - esac - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC=$lt_save_CC - - - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - - -for ac_header in sys/types.h sys/time.h stdlib.h unistd.h string.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to pass version script to the linker ($LD)" >&5 -$as_echo_n "checking how to pass version script to the linker ($LD)... " >&6; } -VERSION_SCRIPT_FLAGS=none -if $LD --help 2>&1 | grep "version-script" >/dev/null 2>/dev/null; then - VERSION_SCRIPT_FLAGS=-Wl,--version-script= -elif $LD --help 2>&1 | grep "M mapfile" >/dev/null 2>/dev/null; then - VERSION_SCRIPT_FLAGS="-Wl,-M -Wl," -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $VERSION_SCRIPT_FLAGS" >&5 -$as_echo "$VERSION_SCRIPT_FLAGS" >&6; } - - if test "$VERSION_SCRIPT_FLAGS" != none; then - USE_VERSION_SCRIPT_TRUE= - USE_VERSION_SCRIPT_FALSE='#' -else - USE_VERSION_SCRIPT_TRUE='#' - USE_VERSION_SCRIPT_FALSE= -fi - - -case $host in - *-mingw*) ;; - *) -THREAD_LIBS="" -ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 -$as_echo_n "checking for pthread_join in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_join+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_join (); -int -main () -{ -return pthread_join (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_join=yes -else - ac_cv_lib_pthread_pthread_join=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_join" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_join" >&6; } -if test "x$ac_cv_lib_pthread_pthread_join" = xyes; then : - - -$as_echo "#define HAVE_LIBPTHREAD /**/" >>confdefs.h - - -$as_echo "#define HAVE_PTHREAD_H /**/" >>confdefs.h - - THREAD_LIBS="-lpthread" -fi - -fi - - - ;; -esac - - - - -XSLT_LOCALE_XLOCALE=0 -XSLT_LOCALE_WINAPI=0 - -for ac_header in locale.h xlocale.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -if test $ac_cv_header_xlocale_h = yes; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if xlocale program link" >&5 -$as_echo_n "checking if xlocale program link... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef HAVE_LOCALE_H -#include <locale.h> -#endif -#ifdef HAVE_XLOCALE_H -#include <xlocale.h> -#endif -#ifdef HAVE_STRING_H -#include <string.h> -#endif -#ifdef HAVE_STDLIB_H -#include <stdlib.h> -#endif - -#ifdef __GLIBC__ -typedef __locale_t xsltLocale; -#else -typedef locale_t xsltLocale; -#endif -#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ <= 2 -#define newlocale __newlocale -#define freelocale __freelocale -#define strxfrm_l __strxfrm_l -#define LC_COLLATE_MASK (1 << LC_COLLATE) -#endif - -int -main () -{ - - xsltLocale locale; - const char *src[2] = { "\xc3\x84rger", "Zeppelin" }; - char *dst[2]; - size_t len, r; - int i; - - locale = newlocale(LC_COLLATE_MASK, "en_US.utf8", NULL); - if (locale == NULL) exit(1); - for (i=0; i<2; ++i) { - len = strxfrm_l(NULL, src[i], 0, locale) + 1; - dst[i] = malloc(len); - if(dst[i] == NULL) exit(1); - r = strxfrm_l(dst[i], src[i], len, locale); - if(r >= len) exit(1); - } - if (strcmp(dst[0], dst[1]) >= 0) exit(1); - - exit(0); - return(0); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; }; XSLT_LOCALE_XLOCALE=1 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -else - case "$host" in - *-*-mingw*) - { $as_echo "$as_me:${as_lineno-$LINENO}: using winapi locale" >&5 -$as_echo "$as_me: using winapi locale" >&6;} - XSLT_LOCALE_WINAPI=1;; - esac -fi - - - - - -for ac_header in ieeefp.h nan.h math.h fp_class.h float.h ansidecl.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in sys/timeb.h time.h sys/stat.h sys/select.h stdarg.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in errno.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ERRNO_H 1 -_ACEOF - -fi - -done - -for ac_func in stat _stat -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" -if test "x$ac_cv_func_pow" = xyes; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 -$as_echo_n "checking for pow in -lm... " >&6; } -if ${ac_cv_lib_m_pow+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pow (); -int -main () -{ -return pow (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_pow=yes -else - ac_cv_lib_m_pow=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 -$as_echo "$ac_cv_lib_m_pow" >&6; } -if test "x$ac_cv_lib_m_pow" = xyes; then : - M_LIBS="-lm"; -$as_echo "#define HAVE_POW /**/" >>confdefs.h - -fi - -fi - - -ac_fn_c_check_func "$LINENO" "floor" "ac_cv_func_floor" -if test "x$ac_cv_func_floor" = xyes; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5 -$as_echo_n "checking for floor in -lm... " >&6; } -if ${ac_cv_lib_m_floor+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char floor (); -int -main () -{ -return floor (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_floor=yes -else - ac_cv_lib_m_floor=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5 -$as_echo "$ac_cv_lib_m_floor" >&6; } -if test "x$ac_cv_lib_m_floor" = xyes; then : - M_LIBS="-lm"; -$as_echo "#define HAVE_FLOOR /**/" >>confdefs.h - -fi - -fi - - -ac_fn_c_check_func "$LINENO" "fabs" "ac_cv_func_fabs" -if test "x$ac_cv_func_fabs" = xyes; then : - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabs in -lm" >&5 -$as_echo_n "checking for fabs in -lm... " >&6; } -if ${ac_cv_lib_m_fabs+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char fabs (); -int -main () -{ -return fabs (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_fabs=yes -else - ac_cv_lib_m_fabs=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_fabs" >&5 -$as_echo "$ac_cv_lib_m_fabs" >&6; } -if test "x$ac_cv_lib_m_fabs" = xyes; then : - M_LIBS="-lm"; -$as_echo "#define HAVE_FABS /**/" >>confdefs.h - -fi - -fi - - - -for ac_func in gettimeofday -do : - ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" -if test "x$ac_cv_func_gettimeofday" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETTIMEOFDAY 1 -_ACEOF - -fi -done - -for ac_func in localtime localtime_r time gmtime gmtime_r ftime -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -for ac_func in printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - NEED_TRIO=1 -fi -done - - -for ac_func in clock_gettime -do : - ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" -if test "x$ac_cv_func_clock_gettime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CLOCK_GETTIME 1 -_ACEOF - -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 -$as_echo_n "checking for clock_gettime in -lrt... " >&6; } -if ${ac_cv_lib_rt_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lrt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char clock_gettime (); -int -main () -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_rt_clock_gettime=yes -else - ac_cv_lib_rt_clock_gettime=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 -$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } -if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : - - $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h - - EXTRA_LIBS="$EXTRA_LIBS -lrt" - -fi - - -fi -done - - - -if test "${NEED_TRIO}" = "1" ; then - echo Reusing trio library for string functions - WITH_TRIO=1 -else - WITH_TRIO=0 -fi - - - - - -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$PERL"; then - ac_cv_prog_PERL="$PERL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PERL="perl" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_prog_PERL" && ac_cv_prog_PERL="false" -fi -fi -PERL=$ac_cv_prog_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "$PERL" != "false"; then - WITH_PERL_TRUE= - WITH_PERL_FALSE='#' -else - WITH_PERL_TRUE='#' - WITH_PERL_FALSE= -fi - - - -PYTHON_VERSION= -PYTHON_INCLUDES= -PYTHON_SITE_PACKAGES= -pythondir= - -# Check whether --with-python was given. -if test "${with_python+set}" = set; then : - withval=$with_python; -fi - -if test "$with_python" != "no" ; then - if test -x "$with_python/bin/python" - then - echo Found python in $with_python/bin/python - PYTHON="$with_python/bin/python" - else - if test -x "$with_python" - then - echo Found python in $with_python - PYTHON="$with_python" - else - if test -x "$PYTHON" - then - echo Found python in environment PYTHON=$PYTHON - with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` - else - # Extract the first word of "python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5", so it can be a program name with args. -set dummy python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PYTHON+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -$as_echo "$PYTHON" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi - fi - fi - if test "$PYTHON" != "" - then - echo "PYTHON is pointing at $PYTHON" - PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[0:3]"` - echo Found Python version $PYTHON_VERSION - LIBXML2_PYTHON=`$PYTHON -c "try : import libxml2 ; print 1 -except: print 0"` - if test "$LIBXML2_PYTHON" = "1" - then - echo Found libxml2-python module - else - echo Warning: Missing libxml2-python - fi - fi - if test "$PYTHON_VERSION" != "" - then - if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ - -d $with_python/lib/python$PYTHON_VERSION/site-packages - then - PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' - else - if test -r $prefix/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' - else - if test -r /usr/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES='$(libdir)/python$(PYTHON_VERSION)/site-packages' - else - echo could not find python$PYTHON_VERSION/Python.h - fi - fi - if test ! -d "$PYTHON_SITE_PACKAGES" - then - PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` - fi - fi - PYTHON_LIBS=`python$PYTHON_VERSION-config --libs` - fi - if test "$with_python" != "" - then - pythondir='$(PYTHON_SITE_PACKAGES)' - else - pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages' - fi -fi - if test "$PYTHON_INCLUDES" != ""; then - WITH_PYTHON_TRUE= - WITH_PYTHON_FALSE='#' -else - WITH_PYTHON_TRUE='#' - WITH_PYTHON_FALSE= -fi - -if test "$PYTHON_INCLUDES" != "" -then - PYTHON_SUBDIR=python -else - PYTHON_SUBDIR= -fi - - - - - -# Check whether --with-crypto was given. -if test "${with_crypto+set}" = set; then : - withval=$with_crypto; -fi - -WITH_CRYPTO=0 -CRYPTO_TESTDIR= -if test "$with_crypto" = "no" ; then - echo Disabling crypto support - LIBGCRYPT_CFLAGS="" - LIBGCRYPT_LIBS="" -else -case $host in - *-mingw*) - WITH_CRYPTO=1 - CRYPTO_TESTDIR=crypto - ;; - *) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}libgcrypt-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}libgcrypt-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_LIBGCRYPT_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $LIBGCRYPT_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_LIBGCRYPT_CONFIG="$LIBGCRYPT_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -LIBGCRYPT_CONFIG=$ac_cv_path_LIBGCRYPT_CONFIG -if test -n "$LIBGCRYPT_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBGCRYPT_CONFIG" >&5 -$as_echo "$LIBGCRYPT_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_LIBGCRYPT_CONFIG"; then - ac_pt_LIBGCRYPT_CONFIG=$LIBGCRYPT_CONFIG - # Extract the first word of "libgcrypt-config", so it can be a program name with args. -set dummy libgcrypt-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_LIBGCRYPT_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_LIBGCRYPT_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_LIBGCRYPT_CONFIG="$ac_pt_LIBGCRYPT_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_LIBGCRYPT_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_LIBGCRYPT_CONFIG=$ac_cv_path_ac_pt_LIBGCRYPT_CONFIG -if test -n "$ac_pt_LIBGCRYPT_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_LIBGCRYPT_CONFIG" >&5 -$as_echo "$ac_pt_LIBGCRYPT_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_LIBGCRYPT_CONFIG" = x; then - LIBGCRYPT_CONFIG="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIBGCRYPT_CONFIG=$ac_pt_LIBGCRYPT_CONFIG - fi -else - LIBGCRYPT_CONFIG="$ac_cv_path_LIBGCRYPT_CONFIG" -fi - - if test "$LIBGCRYPT_CONFIG" != "no" ; then - LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version` - if test `echo $LIBGCRYPT_VERSION | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` -lt `echo "1.1.42" | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - then - LIBGCRYPT_CFLAGS="" - LIBGCRYPT_LIBS="" - echo 'gcrypt library version < 1.1.42 - Crypto extensions will not be available.' - else - LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags` - LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs` - -$as_echo "#define HAVE_GCRYPT 1" >>confdefs.h - - echo 'Crypto extensions will be available.' - WITH_CRYPTO=1 - CRYPTO_TESTDIR=crypto - fi - else - LIBGCRYPT_CFLAGS="" - LIBGCRYPT_LIBS="" - echo 'Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.' - fi -esac -fi - - - - - -if [ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XSLT" ] || \ - [ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxslt" ] - then - if test "${with_mem_debug}" = "" ; - then - with_mem_debug="yes" - fi - CFLAGS="-Wall -g -O -ansi -pedantic -W -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat=2 -Wmissing-format-attribute -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline " -fi - - -# Check whether --with-debug was given. -if test "${with_debug+set}" = set; then : - withval=$with_debug; -fi - -if test "$with_debug" = "no" ; then - echo Disabling debug support - WITH_XSLT_DEBUG=0 -else - WITH_XSLT_DEBUG=1 -fi - - - -# Check whether --with-mem_debug was given. -if test "${with_mem_debug+set}" = set; then : - withval=$with_mem_debug; -fi - -if test "$with_mem_debug" = "yes" ; then - echo Enabling memory debug support - WITH_MEM_DEBUG=1 -else - WITH_MEM_DEBUG=0 -fi - - - -# Check whether --with-debugger was given. -if test "${with_debugger+set}" = set; then : - withval=$with_debugger; -fi - -if test "$with_debugger" = "no" ; then - echo Disabling debugger - WITH_DEBUGGER=0 -else - echo Enabling debugger - WITH_DEBUGGER=1 - -$as_echo "#define WITH_DEBUGGER /**/" >>confdefs.h - -fi - - - -LIBXML_CONFIG_PREFIX="" -LIBXML_SRC="" - - -# Check whether --with-libxml-prefix was given. -if test "${with_libxml_prefix+set}" = set; then : - withval=$with_libxml_prefix; LIBXML_CONFIG_PREFIX=$withval - -fi - - - -# Check whether --with-libxml-include-prefix was given. -if test "${with_libxml_include_prefix+set}" = set; then : - withval=$with_libxml_include_prefix; LIBXML_CFLAGS="-I$withval" - -fi - - - -# Check whether --with-libxml-libs-prefix was given. -if test "${with_libxml_libs_prefix+set}" = set; then : - withval=$with_libxml_libs_prefix; LIBXML_LIBS="-L$withval" - -fi - - - -# Check whether --with-libxml-src was given. -if test "${with_libxml_src+set}" = set; then : - withval=$with_libxml_src; LIBXML_SRC="$withval" - -fi - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml libraries >= $LIBXML_REQUIRED_VERSION" >&5 -$as_echo_n "checking for libxml libraries >= $LIBXML_REQUIRED_VERSION... " >&6; } -if test "x$LIBXML_CONFIG_PREFIX" != "x" -then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}xml2-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}xml2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XML_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XML_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_XML_CONFIG="$XML_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in ${LIBXML_CONFIG_PREFIX}/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XML_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XML_CONFIG=$ac_cv_path_XML_CONFIG -if test -n "$XML_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML_CONFIG" >&5 -$as_echo "$XML_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_XML_CONFIG"; then - ac_pt_XML_CONFIG=$XML_CONFIG - # Extract the first word of "xml2-config", so it can be a program name with args. -set dummy xml2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_XML_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_XML_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_XML_CONFIG="$ac_pt_XML_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in ${LIBXML_CONFIG_PREFIX}/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_XML_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_XML_CONFIG=$ac_cv_path_ac_pt_XML_CONFIG -if test -n "$ac_pt_XML_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_XML_CONFIG" >&5 -$as_echo "$ac_pt_XML_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_XML_CONFIG" = x; then - XML_CONFIG="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - XML_CONFIG=$ac_pt_XML_CONFIG - fi -else - XML_CONFIG="$ac_cv_path_XML_CONFIG" -fi - -else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}xml2-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}xml2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XML_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XML_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_XML_CONFIG="$XML_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_XML_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -XML_CONFIG=$ac_cv_path_XML_CONFIG -if test -n "$XML_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XML_CONFIG" >&5 -$as_echo "$XML_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_path_XML_CONFIG"; then - ac_pt_XML_CONFIG=$XML_CONFIG - # Extract the first word of "xml2-config", so it can be a program name with args. -set dummy xml2-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_XML_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $ac_pt_XML_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_XML_CONFIG="$ac_pt_XML_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_XML_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_XML_CONFIG=$ac_cv_path_ac_pt_XML_CONFIG -if test -n "$ac_pt_XML_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_XML_CONFIG" >&5 -$as_echo "$ac_pt_XML_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_pt_XML_CONFIG" = x; then - XML_CONFIG="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - XML_CONFIG=$ac_pt_XML_CONFIG - fi -else - XML_CONFIG="$ac_cv_path_XML_CONFIG" -fi - -fi - -if test "${GCC}" != "yes" ; then - case "${host}" in - *-*-hpux* ) - CFLAGS="${CFLAGS} -Wp,-H30000" - ;; - *-dec-osf* ) - CFLAGS="${CFLAGS} -ieee" - ;; - esac -else - CFLAGS="${CFLAGS} -Wall -Wformat=2 -Wmissing-format-attribute" - case "${host}" in - alpha*-*-linux* ) - CFLAGS="${CFLAGS} -mieee" - ;; - alpha*-*-osf* ) - CFLAGS="${CFLAGS} -mieee" - ;; - esac -fi - - -if test "x$LIBXML_SRC" != "x" -then - CWD=`pwd` - if cd $LIBXML_SRC - then - SRC_DIR=`pwd` - XML_CONFIG=${SRC_DIR}/xml2-config - LIBXML_CFLAGS="-I${SRC_DIR}/include" - LIBXML_LIBS="-L${SRC_DIR}" - cd $CWD - else - as_fn_error $? "libxml source dir not found (${LIBXML_SRC}), typo?" "$LINENO" 5 - fi -fi - - -if ${XML_CONFIG} --libs print > /dev/null 2>&1 -then - XMLVERS=`$XML_CONFIG --version` - if test `echo $XMLVERS | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` -ge `echo $LIBXML_REQUIRED_VERSION | sed -e 's/libxml //' | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` - then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLVERS found" >&5 -$as_echo "$XMLVERS found" >&6; } - else - as_fn_error $? "Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt" "$LINENO" 5 - fi - LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`" - if test "x$LIBXML_SRC" = "x"; then - LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`" - fi -else - as_fn_error $? "Could not find libxml2 anywhere, check ftp://xmlsoft.org/." "$LINENO" 5 -fi - - - - - - - -# Check whether --with-plugins was given. -if test "${with_plugins+set}" = set; then : - withval=$with_plugins; -fi - -if test "$with_plugins" = "" -then - with_plugins=yes -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether shared libraries will be built (required for plugins)" >&5 -$as_echo_n "checking whether shared libraries will be built (required for plugins)... " >&6; } -if test "$enable_shared" = "no" -a "$with_plugins" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling plugin support." >&5 -$as_echo "$as_me: WARNING: Disabling plugin support." >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Plugins require that shared libraries be built." >&5 -$as_echo "$as_me: WARNING: Plugins require that shared libraries be built." >&2;} - with_plugins=no -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi - -if test "$with_plugins" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking libxml2 module support" >&5 -$as_echo_n "checking libxml2 module support... " >&6; } - WITH_MODULES="`$XML_CONFIG --modules`" - if test "${WITH_MODULES}" = "1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - WITH_MODULES="0" - fi -else - WITH_MODULES="0" -fi - - - if test "$WITH_MODULES" = "1"; then - WITH_MODULES_TRUE= - WITH_MODULES_FALSE='#' -else - WITH_MODULES_TRUE='#' - WITH_MODULES_FALSE= -fi - - -expanded_libdir=$( - test "x$prefix" = xNONE && prefix="$ac_default_prefix" - test "x$exec_prefix" = xNONE && exec_prefix="$prefix" - while test "$libdir_old" != "$libdir"; do - libdir_old="$libdir" - eval libdir="$libdir" - done - echo "$libdir" -) -LIBXSLT_DEFAULT_PLUGINS_PATH="$expanded_libdir/libxslt-plugins" - - -WIN32_EXTRA_LIBADD= -WIN32_EXTRA_LDFLAGS= -case "$host" in - *-*-cygwin*) - WIN32_EXTRA_LDFLAGS="-no-undefined" - ;; - *-*-mingw*) - WIN32_EXTRA_LIBADD="-lwsock32" - WIN32_EXTRA_LDFLAGS="-no-undefined" - -$as_echo "#define _WINSOCKAPI_ 1" >>confdefs.h - - -$as_echo "#define snprintf _snprintf" >>confdefs.h - - -$as_echo "#define vsnprintf _vsnprintf" >>confdefs.h - - ;; -esac - - - - - - - - - - - - - - -XSLT_LIBDIR='-L${libdir}' -XSLT_INCLUDEDIR='-I${includedir}' -XSLT_LIBS="-lxslt $LIBXML_LIBS $M_LIBS" - - - - -EXSLT_LIBDIR='-L${libdir}' -EXSLT_INCLUDEDIR='-I${includedir}' -EXSLT_LIBS="-lexslt $XSLT_LIBS $LIBGCRYPT_LIBS" - - - - - - - - -RELDATE=`date +'%a %b %e %Y'` - - -rm -f COPYING.LIB COPYING 2>/dev/null && $LN_S $srcdir/Copyright COPYING - - -ac_config_files="$ac_config_files Makefile libxslt.pc libexslt.pc libxslt/Makefile libxslt/xsltconfig.h libxslt/xsltwin32config.h libexslt/Makefile libexslt/exsltconfig.h xsltproc/Makefile python/Makefile python/tests/Makefile tests/Makefile tests/docs/Makefile tests/REC1/Makefile tests/REC2/Makefile tests/REC/Makefile tests/general/Makefile tests/reports/Makefile tests/extensions/Makefile tests/namespaces/Makefile tests/keys/Makefile tests/numbers/Makefile tests/documents/Makefile tests/xmlspec/Makefile tests/multiple/Makefile tests/xinclude/Makefile tests/XSLTMark/Makefile tests/docbook/Makefile tests/exslt/Makefile tests/exslt/common/Makefile tests/exslt/functions/Makefile tests/exslt/math/Makefile tests/exslt/saxon/Makefile tests/exslt/sets/Makefile tests/exslt/strings/Makefile tests/exslt/date/Makefile tests/exslt/dynamic/Makefile tests/exslt/crypto/Makefile tests/plugins/Makefile doc/Makefile xslt-config libxslt.spec" - - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${USE_VERSION_SCRIPT_TRUE}" && test -z "${USE_VERSION_SCRIPT_FALSE}"; then - as_fn_error $? "conditional \"USE_VERSION_SCRIPT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_PERL_TRUE}" && test -z "${WITH_PERL_FALSE}"; then - as_fn_error $? "conditional \"WITH_PERL\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_PYTHON_TRUE}" && test -z "${WITH_PYTHON_FALSE}"; then - as_fn_error $? "conditional \"WITH_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_MODULES_TRUE}" && test -z "${WITH_MODULES_FALSE}"; then - as_fn_error $? "conditional \"WITH_MODULES\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' -configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in AS \ -DLLTOOL \ -OBJDUMP \ -SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_import \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -lt_cv_nm_interface \ -nm_file_list_spec \ -lt_cv_truncate_bin \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -configure_time_dlsearch_path \ -configure_time_lt_sys_library_path; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' - -# See if we are running on zsh, and set the options that allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - RM='$RM' - ofile='$ofile' - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "libxslt.pc") CONFIG_FILES="$CONFIG_FILES libxslt.pc" ;; - "libexslt.pc") CONFIG_FILES="$CONFIG_FILES libexslt.pc" ;; - "libxslt/Makefile") CONFIG_FILES="$CONFIG_FILES libxslt/Makefile" ;; - "libxslt/xsltconfig.h") CONFIG_FILES="$CONFIG_FILES libxslt/xsltconfig.h" ;; - "libxslt/xsltwin32config.h") CONFIG_FILES="$CONFIG_FILES libxslt/xsltwin32config.h" ;; - "libexslt/Makefile") CONFIG_FILES="$CONFIG_FILES libexslt/Makefile" ;; - "libexslt/exsltconfig.h") CONFIG_FILES="$CONFIG_FILES libexslt/exsltconfig.h" ;; - "xsltproc/Makefile") CONFIG_FILES="$CONFIG_FILES xsltproc/Makefile" ;; - "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; - "python/tests/Makefile") CONFIG_FILES="$CONFIG_FILES python/tests/Makefile" ;; - "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; - "tests/docs/Makefile") CONFIG_FILES="$CONFIG_FILES tests/docs/Makefile" ;; - "tests/REC1/Makefile") CONFIG_FILES="$CONFIG_FILES tests/REC1/Makefile" ;; - "tests/REC2/Makefile") CONFIG_FILES="$CONFIG_FILES tests/REC2/Makefile" ;; - "tests/REC/Makefile") CONFIG_FILES="$CONFIG_FILES tests/REC/Makefile" ;; - "tests/general/Makefile") CONFIG_FILES="$CONFIG_FILES tests/general/Makefile" ;; - "tests/reports/Makefile") CONFIG_FILES="$CONFIG_FILES tests/reports/Makefile" ;; - "tests/extensions/Makefile") CONFIG_FILES="$CONFIG_FILES tests/extensions/Makefile" ;; - "tests/namespaces/Makefile") CONFIG_FILES="$CONFIG_FILES tests/namespaces/Makefile" ;; - "tests/keys/Makefile") CONFIG_FILES="$CONFIG_FILES tests/keys/Makefile" ;; - "tests/numbers/Makefile") CONFIG_FILES="$CONFIG_FILES tests/numbers/Makefile" ;; - "tests/documents/Makefile") CONFIG_FILES="$CONFIG_FILES tests/documents/Makefile" ;; - "tests/xmlspec/Makefile") CONFIG_FILES="$CONFIG_FILES tests/xmlspec/Makefile" ;; - "tests/multiple/Makefile") CONFIG_FILES="$CONFIG_FILES tests/multiple/Makefile" ;; - "tests/xinclude/Makefile") CONFIG_FILES="$CONFIG_FILES tests/xinclude/Makefile" ;; - "tests/XSLTMark/Makefile") CONFIG_FILES="$CONFIG_FILES tests/XSLTMark/Makefile" ;; - "tests/docbook/Makefile") CONFIG_FILES="$CONFIG_FILES tests/docbook/Makefile" ;; - "tests/exslt/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/Makefile" ;; - "tests/exslt/common/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/common/Makefile" ;; - "tests/exslt/functions/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/functions/Makefile" ;; - "tests/exslt/math/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/math/Makefile" ;; - "tests/exslt/saxon/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/saxon/Makefile" ;; - "tests/exslt/sets/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/sets/Makefile" ;; - "tests/exslt/strings/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/strings/Makefile" ;; - "tests/exslt/date/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/date/Makefile" ;; - "tests/exslt/dynamic/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/dynamic/Makefile" ;; - "tests/exslt/crypto/Makefile") CONFIG_FILES="$CONFIG_FILES tests/exslt/crypto/Makefile" ;; - "tests/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES tests/plugins/Makefile" ;; - "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "xslt-config") CONFIG_FILES="$CONFIG_FILES xslt-config" ;; - "libxslt.spec") CONFIG_FILES="$CONFIG_FILES libxslt.spec" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' <conf$$subs.awk | sed ' -/^[^""]/{ - N - s/\n// -} -' >>$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' <confdefs.h | sed ' -s/'"$ac_delim"'/"\\\ -"/g' >>$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options that allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}"; then - setopt NO_GLOB_SUBST - fi - - cfgfile=${ofile}T - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL -# Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. - -# Provide generalized library-building support services. -# Written by Gordon Matzigkeit, 1996 - -# Copyright (C) 2014 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program or library that is built -# using GNU Libtool, you may include this file under the same -# distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - - -# The names of the tagged configurations supported by this script. -available_tags='' - -# Configured defaults for sys_lib_dlsearch_path munging. -: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Assembler program. -AS=$lt_AS - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Object dumper program. -OBJDUMP=$lt_OBJDUMP - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shared archive member basename,for filename based shared library versioning on AIX. -shared_archive_member_spec=$shared_archive_member_spec - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm into a list of symbols to manually relocate. -global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# The name lister interface. -nm_interface=$lt_lt_cv_nm_interface - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and where our libraries should be installed. -lt_sysroot=$lt_sysroot - -# Command to truncate a binary pipe. -lt_truncate_bin=$lt_lt_cv_truncate_bin - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Detected run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path - -# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. -configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# ### END LIBTOOL CONFIG - -_LT_EOF - - cat <<'_LT_EOF' >> "$cfgfile" - -# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE - -# func_munge_path_list VARIABLE PATH -# ----------------------------------- -# VARIABLE is name of variable containing _space_ separated list of -# directories to be munged by the contents of PATH, which is string -# having a format: -# "DIR[:DIR]:" -# string "DIR[ DIR]" will be prepended to VARIABLE -# ":DIR[:DIR]" -# string "DIR[ DIR]" will be appended to VARIABLE -# "DIRP[:DIRP]::[DIRA:]DIRA" -# string "DIRP[ DIRP]" will be prepended to VARIABLE and string -# "DIRA[ DIRA]" will be appended to VARIABLE -# "DIR[:DIR]" -# VARIABLE will be replaced by "DIR[ DIR]" -func_munge_path_list () -{ - case x$2 in - x) - ;; - *:) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" - ;; - x:*) - eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" - ;; - *::*) - eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" - eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" - ;; - *) - eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" - ;; - esac -} - - -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -func_cc_basename () -{ - for cc_temp in $*""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac - done - func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -} - - -# ### END FUNCTIONS SHARED WITH CONFIGURE - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test set != "${COLLECT_NAMES+set}"; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain=$ac_aux_dir/ltmain.sh - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi -
diff --git a/third_party/libxslt/src/depcomp b/third_party/libxslt/src/depcomp deleted file mode 100755 index 4ebd5b3a..0000000 --- a/third_party/libxslt/src/depcomp +++ /dev/null
@@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2013-05-30.07; # UTC - -# Copyright (C) 1999-2013 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to <bug-automake@gnu.org>. -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
diff --git a/third_party/libxslt/src/install-sh b/third_party/libxslt/src/install-sh deleted file mode 100755 index 377bb868..0000000 --- a/third_party/libxslt/src/install-sh +++ /dev/null
@@ -1,527 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2011-11-20.07; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
diff --git a/third_party/libxslt/src/libexslt/Makefile.in b/third_party/libxslt/src/libexslt/Makefile.in deleted file mode 100644 index c8b99b6..0000000 --- a/third_party/libxslt/src/libexslt/Makefile.in +++ /dev/null
@@ -1,845 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = libexslt -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(exsltinc_HEADERS) \ - $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = exsltconfig.h -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \ - "$(DESTDIR)$(exsltincdir)" "$(DESTDIR)$(exsltincdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libexslt_la_DEPENDENCIES = $(top_builddir)/libxslt/libxslt.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_libexslt_la_OBJECTS = exslt.lo common.lo crypto.lo math.lo sets.lo \ - functions.lo strings.lo date.lo saxon.lo dynamic.lo -libexslt_la_OBJECTS = $(am_libexslt_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libexslt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libexslt_la_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libexslt_la_SOURCES) -DIST_SOURCES = $(libexslt_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -man3dir = $(mandir)/man3 -NROFF = nroff -MANS = $(man_MANS) -HEADERS = $(exsltinc_HEADERS) $(nodist_exsltinc_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/exsltconfig.h.in \ - $(top_srcdir)/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CRYPTO_TESTDIR = @CRYPTO_TESTDIR@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -EXSLT_INCLUDEDIR = @EXSLT_INCLUDEDIR@ -EXSLT_LIBDIR = @EXSLT_LIBDIR@ -EXSLT_LIBS = @EXSLT_LIBS@ -EXTRA_LIBS = @EXTRA_LIBS@ -FGREP = @FGREP@ -GREP = @GREP@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBEXSLT_MAJOR_VERSION = @LIBEXSLT_MAJOR_VERSION@ -LIBEXSLT_MICRO_VERSION = @LIBEXSLT_MICRO_VERSION@ -LIBEXSLT_MINOR_VERSION = @LIBEXSLT_MINOR_VERSION@ -LIBEXSLT_VERSION = @LIBEXSLT_VERSION@ -LIBEXSLT_VERSION_EXTRA = @LIBEXSLT_VERSION_EXTRA@ -LIBEXSLT_VERSION_INFO = @LIBEXSLT_VERSION_INFO@ -LIBEXSLT_VERSION_NUMBER = @LIBEXSLT_VERSION_NUMBER@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_CFLAGS = @LIBXML_CFLAGS@ -LIBXML_LIBS = @LIBXML_LIBS@ -LIBXML_REQUIRED_VERSION = @LIBXML_REQUIRED_VERSION@ -LIBXML_SRC = @LIBXML_SRC@ -LIBXSLT_DEFAULT_PLUGINS_PATH = @LIBXSLT_DEFAULT_PLUGINS_PATH@ -LIBXSLT_MAJOR_MINOR_VERSION = @LIBXSLT_MAJOR_MINOR_VERSION@ -LIBXSLT_MAJOR_VERSION = @LIBXSLT_MAJOR_VERSION@ -LIBXSLT_MICRO_VERSION = @LIBXSLT_MICRO_VERSION@ -LIBXSLT_MINOR_VERSION = @LIBXSLT_MINOR_VERSION@ -LIBXSLT_VERSION = @LIBXSLT_VERSION@ -LIBXSLT_VERSION_EXTRA = @LIBXSLT_VERSION_EXTRA@ -LIBXSLT_VERSION_INFO = @LIBXSLT_VERSION_INFO@ -LIBXSLT_VERSION_NUMBER = @LIBXSLT_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PYTHON = @PYTHON@ -PYTHONSODV = @PYTHONSODV@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RELDATE = @RELDATE@ -RM = @RM@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TAR = @TAR@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WITH_CRYPTO = @WITH_CRYPTO@ -WITH_DEBUGGER = @WITH_DEBUGGER@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_TRIO = @WITH_TRIO@ -WITH_XSLT_DEBUG = @WITH_XSLT_DEBUG@ -XMLLINT = @XMLLINT@ -XML_CONFIG = @XML_CONFIG@ -XSLTPROC = @XSLTPROC@ -XSLTPROCDV = @XSLTPROCDV@ -XSLT_INCLUDEDIR = @XSLT_INCLUDEDIR@ -XSLT_LIBDIR = @XSLT_LIBDIR@ -XSLT_LIBS = @XSLT_LIBS@ -XSLT_LOCALE_WINAPI = @XSLT_LOCALE_WINAPI@ -XSLT_LOCALE_XLOCALE = @XSLT_LOCALE_XLOCALE@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libxslt -I$(top_srcdir)/libexslt \ - -I$(top_builddir) -I$(top_builddir)/libxslt \ - -I$(top_builddir)/libexslt - -AM_CFLAGS = $(LIBGCRYPT_CFLAGS) $(LIBXML_CFLAGS) -lib_LTLIBRARIES = libexslt.la -exsltincdir = $(includedir)/libexslt -exsltinc_HEADERS = \ - exslt.h \ - exsltexports.h - -nodist_exsltinc_HEADERS = \ - exsltconfig.h - -libexslt_la_SOURCES = \ - exslt.c \ - common.c \ - crypto.c \ - math.c \ - sets.c \ - functions.c \ - strings.c \ - date.c \ - saxon.c \ - libexslt.h \ - dynamic.c - -libexslt_la_LIBADD = $(top_builddir)/libxslt/libxslt.la $(EXTRA_LIBS) $(LIBGCRYPT_LIBS) $(M_LIBS) -libexslt_la_LDFLAGS = $(WIN32_EXTRA_LDFLAGS) -version-info $(LIBEXSLT_VERSION_INFO) -man_MANS = libexslt.3 -EXTRA_DIST = $(man_MANS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libexslt/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu libexslt/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -exsltconfig.h: $(top_builddir)/config.status $(srcdir)/exsltconfig.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libexslt.la: $(libexslt_la_OBJECTS) $(libexslt_la_DEPENDENCIES) $(EXTRA_libexslt_la_DEPENDENCIES) - $(AM_V_CCLD)$(libexslt_la_LINK) -rpath $(libdir) $(libexslt_la_OBJECTS) $(libexslt_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crypto.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynamic.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exslt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/functions.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saxon.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sets.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strings.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-man3: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man3dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.3[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ - done; } - -uninstall-man3: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man3dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.3[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) -install-exsltincHEADERS: $(exsltinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(exsltincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(exsltincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(exsltincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(exsltincdir)" || exit $$?; \ - done - -uninstall-exsltincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(exsltincdir)'; $(am__uninstall_files_from_dir) -install-nodist_exsltincHEADERS: $(nodist_exsltinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(nodist_exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(exsltincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(exsltincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(exsltincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(exsltincdir)" || exit $$?; \ - done - -uninstall-nodist_exsltincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_exsltinc_HEADERS)'; test -n "$(exsltincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(exsltincdir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(exsltincdir)" "$(DESTDIR)$(exsltincdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-exsltincHEADERS install-man \ - install-nodist_exsltincHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: install-man3 - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-exsltincHEADERS uninstall-libLTLIBRARIES \ - uninstall-man uninstall-nodist_exsltincHEADERS - -uninstall-man: uninstall-man3 - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES 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-exsltincHEADERS install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-man3 \ - install-nodist_exsltincHEADERS 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 uninstall-exsltincHEADERS \ - uninstall-libLTLIBRARIES uninstall-man uninstall-man3 \ - uninstall-nodist_exsltincHEADERS - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxslt/src/libxslt/Makefile.in b/third_party/libxslt/src/libxslt/Makefile.in deleted file mode 100644 index b8ec5484..0000000 --- a/third_party/libxslt/src/libxslt/Makefile.in +++ /dev/null
@@ -1,901 +0,0 @@ -# Makefile.in generated by automake 1.15 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2014 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = libxslt -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(xsltinc_HEADERS) \ - $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = xsltconfig.h xsltwin32config.h -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" \ - "$(DESTDIR)$(xsltincdir)" "$(DESTDIR)$(xsltincdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -am__DEPENDENCIES_1 = -libxslt_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_libxslt_la_OBJECTS = attrvt.lo xslt.lo xsltlocale.lo xsltutils.lo \ - pattern.lo templates.lo variables.lo keys.lo numbers.lo \ - extensions.lo extra.lo functions.lo namespaces.lo imports.lo \ - attributes.lo documents.lo preproc.lo transform.lo security.lo -nodist_libxslt_la_OBJECTS = -libxslt_la_OBJECTS = $(am_libxslt_la_OBJECTS) \ - $(nodist_libxslt_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libxslt_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libxslt_la_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libxslt_la_SOURCES) $(nodist_libxslt_la_SOURCES) -DIST_SOURCES = $(libxslt_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -man3dir = $(mandir)/man3 -NROFF = nroff -MANS = $(man_MANS) -HEADERS = $(nodist_xsltinc_HEADERS) $(xsltinc_HEADERS) -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/xsltconfig.h.in \ - $(srcdir)/xsltwin32config.h.in $(top_srcdir)/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CRYPTO_TESTDIR = @CRYPTO_TESTDIR@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -EXSLT_INCLUDEDIR = @EXSLT_INCLUDEDIR@ -EXSLT_LIBDIR = @EXSLT_LIBDIR@ -EXSLT_LIBS = @EXSLT_LIBS@ -EXTRA_LIBS = @EXTRA_LIBS@ -FGREP = @FGREP@ -GREP = @GREP@ -HTML_DIR = @HTML_DIR@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBEXSLT_MAJOR_VERSION = @LIBEXSLT_MAJOR_VERSION@ -LIBEXSLT_MICRO_VERSION = @LIBEXSLT_MICRO_VERSION@ -LIBEXSLT_MINOR_VERSION = @LIBEXSLT_MINOR_VERSION@ -LIBEXSLT_VERSION = @LIBEXSLT_VERSION@ -LIBEXSLT_VERSION_EXTRA = @LIBEXSLT_VERSION_EXTRA@ -LIBEXSLT_VERSION_INFO = @LIBEXSLT_VERSION_INFO@ -LIBEXSLT_VERSION_NUMBER = @LIBEXSLT_VERSION_NUMBER@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_CFLAGS = @LIBXML_CFLAGS@ -LIBXML_LIBS = @LIBXML_LIBS@ -LIBXML_REQUIRED_VERSION = @LIBXML_REQUIRED_VERSION@ -LIBXML_SRC = @LIBXML_SRC@ -LIBXSLT_DEFAULT_PLUGINS_PATH = @LIBXSLT_DEFAULT_PLUGINS_PATH@ -LIBXSLT_MAJOR_MINOR_VERSION = @LIBXSLT_MAJOR_MINOR_VERSION@ -LIBXSLT_MAJOR_VERSION = @LIBXSLT_MAJOR_VERSION@ -LIBXSLT_MICRO_VERSION = @LIBXSLT_MICRO_VERSION@ -LIBXSLT_MINOR_VERSION = @LIBXSLT_MINOR_VERSION@ -LIBXSLT_VERSION = @LIBXSLT_VERSION@ -LIBXSLT_VERSION_EXTRA = @LIBXSLT_VERSION_EXTRA@ -LIBXSLT_VERSION_INFO = @LIBXSLT_VERSION_INFO@ -LIBXSLT_VERSION_NUMBER = @LIBXSLT_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PYTHON = @PYTHON@ -PYTHONSODV = @PYTHONSODV@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RELDATE = @RELDATE@ -RM = @RM@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -TAR = @TAR@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WITH_CRYPTO = @WITH_CRYPTO@ -WITH_DEBUGGER = @WITH_DEBUGGER@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_TRIO = @WITH_TRIO@ -WITH_XSLT_DEBUG = @WITH_XSLT_DEBUG@ -XMLLINT = @XMLLINT@ -XML_CONFIG = @XML_CONFIG@ -XSLTPROC = @XSLTPROC@ -XSLTPROCDV = @XSLTPROCDV@ -XSLT_INCLUDEDIR = @XSLT_INCLUDEDIR@ -XSLT_LIBDIR = @XSLT_LIBDIR@ -XSLT_LIBS = @XSLT_LIBS@ -XSLT_LOCALE_WINAPI = @XSLT_LOCALE_WINAPI@ -XSLT_LOCALE_XLOCALE = @XSLT_LOCALE_XLOCALE@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/libxslt -AM_CFLAGS = $(LIBXML_CFLAGS) -lib_LTLIBRARIES = libxslt.la -xsltincdir = $(includedir)/libxslt -xsltinc_HEADERS = \ - xslt.h \ - xsltutils.h \ - pattern.h \ - templates.h \ - variables.h \ - keys.h \ - numbersInternals.h \ - extensions.h \ - extra.h \ - functions.h \ - namespaces.h \ - imports.h \ - attributes.h \ - documents.h \ - preproc.h \ - transform.h \ - security.h \ - xsltInternals.h \ - xsltexports.h \ - xsltlocale.h - -nodist_xsltinc_HEADERS = \ - xsltconfig.h - -libxslt_la_SOURCES = \ - attrvt.c \ - xslt.c \ - xsltlocale.c \ - xsltutils.c \ - pattern.c \ - templates.c \ - variables.c \ - keys.c \ - numbers.c \ - extensions.c \ - extra.c \ - functions.c \ - namespaces.c \ - imports.c \ - attributes.c \ - documents.c \ - preproc.c \ - transform.c \ - security.c \ - win32config.h \ - xsltwin32config.h.in \ - libxslt.h - -nodist_libxslt_la_SOURCES = \ - xsltwin32config.h - -@USE_VERSION_SCRIPT_FALSE@LIBXSLT_VERSION_SCRIPT = -@USE_VERSION_SCRIPT_TRUE@LIBXSLT_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxslt.syms -libxslt_la_LIBADD = $(LIBXML_LIBS) $(EXTRA_LIBS) $(M_LIBS) -libxslt_la_LDFLAGS = \ - $(WIN32_EXTRA_LDFLAGS) \ - $(LIBXSLT_VERSION_SCRIPT) \ - -version-info $(LIBXSLT_VERSION_INFO) - -man_MANS = libxslt.3 -EXTRA_DIST = $(man_MANS) trio.h triodef.h libxslt.syms -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu libxslt/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu libxslt/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -xsltconfig.h: $(top_builddir)/config.status $(srcdir)/xsltconfig.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ -xsltwin32config.h: $(top_builddir)/config.status $(srcdir)/xsltwin32config.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } - -libxslt.la: $(libxslt_la_OBJECTS) $(libxslt_la_DEPENDENCIES) $(EXTRA_libxslt_la_DEPENDENCIES) - $(AM_V_CCLD)$(libxslt_la_LINK) -rpath $(libdir) $(libxslt_la_OBJECTS) $(libxslt_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attributes.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attrvt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/documents.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extensions.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extra.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/functions.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imports.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keys.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/namespaces.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/numbers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pattern.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preproc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/templates.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/transform.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variables.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xslt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsltlocale.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsltutils.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-man3: $(man_MANS) - @$(NORMAL_INSTALL) - @list1=''; \ - list2='$(man_MANS)'; \ - test -n "$(man3dir)" \ - && test -n "`echo $$list1$$list2`" \ - || exit 0; \ - echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ - { for i in $$list1; do echo "$$i"; done; \ - if test -n "$$list2"; then \ - for i in $$list2; do echo "$$i"; done \ - | sed -n '/\.3[a-z]*$$/p'; \ - fi; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ - done; } - -uninstall-man3: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man3dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.3[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) -install-nodist_xsltincHEADERS: $(nodist_xsltinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(nodist_xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(xsltincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(xsltincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xsltincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(xsltincdir)" || exit $$?; \ - done - -uninstall-nodist_xsltincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(nodist_xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(xsltincdir)'; $(am__uninstall_files_from_dir) -install-xsltincHEADERS: $(xsltinc_HEADERS) - @$(NORMAL_INSTALL) - @list='$(xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(xsltincdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(xsltincdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xsltincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(xsltincdir)" || exit $$?; \ - done - -uninstall-xsltincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(xsltinc_HEADERS)'; test -n "$(xsltincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(xsltincdir)'; $(am__uninstall_files_from_dir) - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(MANS) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(xsltincdir)" "$(DESTDIR)$(xsltincdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-man install-nodist_xsltincHEADERS \ - install-xsltincHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: install-man3 - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-libLTLIBRARIES uninstall-man \ - uninstall-nodist_xsltincHEADERS uninstall-xsltincHEADERS - -uninstall-man: uninstall-man3 - -.MAKE: install-am install-exec-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES 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-exec-hook install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-man install-man3 install-nodist_xsltincHEADERS \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip install-xsltincHEADERS 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 uninstall-libLTLIBRARIES \ - uninstall-man uninstall-man3 uninstall-nodist_xsltincHEADERS \ - uninstall-xsltincHEADERS - -.PRECIOUS: Makefile - - -xsltproc: all - @(cd ../xsltproc ; $(MAKE)) - -install-exec-hook: - $(MKDIR_P) "$(DESTDIR)$(libdir)/libxslt-plugins" - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT:
diff --git a/third_party/libxslt/src/missing b/third_party/libxslt/src/missing deleted file mode 100755 index db98974f..0000000 --- a/third_party/libxslt/src/missing +++ /dev/null
@@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2013-10-28.13; # UTC - -# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to <bug-automake@gnu.org>." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End:
diff --git a/third_party/metrics_proto/README.chromium b/third_party/metrics_proto/README.chromium index 42821e4..766f5e4 100644 --- a/third_party/metrics_proto/README.chromium +++ b/third_party/metrics_proto/README.chromium
@@ -1,6 +1,6 @@ Name: Metrics Protos -Version: 171200293 -Date: 2017/10/02 +Version: 180820879 +Date: 2018/01/04 License: BSD Security Critical: Yes
diff --git a/third_party/metrics_proto/reporting_info.proto b/third_party/metrics_proto/reporting_info.proto index 6a0d1d7..d49af56 100644 --- a/third_party/metrics_proto/reporting_info.proto +++ b/third_party/metrics_proto/reporting_info.proto
@@ -9,7 +9,7 @@ package metrics; // Extra information attached to reports by client at upload time. -// Next tag: 3 +// Next tag: 5 message ReportingInfo { // Number of times upload of the current report has been attempted. optional int32 attempt_count = 1;
diff --git a/third_party/metrics_proto/system_profile.proto b/third_party/metrics_proto/system_profile.proto index 234d3c4..686b81e 100644 --- a/third_party/metrics_proto/system_profile.proto +++ b/third_party/metrics_proto/system_profile.proto
@@ -486,7 +486,7 @@ // Figures that can be used to generate application stability metrics. // All values are counts of events since the last time that these // values were reported. - // Next tag: 28 + // Next tag: 29 message Stability { // Total amount of time that the program was running, in seconds, // since the last time a log was recorded, as measured using a client-side @@ -548,6 +548,11 @@ // The number of times that it didn't exit cleanly (which we assume to be // mostly crashes). optional int32 crash_count = 16; + // Android only. The number of times Chrome didn't exit cleanly and the GMS + // Core version had not changed from the last session. This is a subset of + // |crash_count| where we exclude unclean exits that are likely caused by + // GMS Core updates. + optional int32 crash_count_without_gms_core_update = 28; // The number of times the program began, but did not complete, the shutdown // process. (For example, this may occur when Windows is shutting down, and
diff --git a/third_party/metrics_proto/ukm/source.proto b/third_party/metrics_proto/ukm/source.proto index 5f8756e..fb7a43b2 100644 --- a/third_party/metrics_proto/ukm/source.proto +++ b/third_party/metrics_proto/ukm/source.proto
@@ -9,11 +9,27 @@ package ukm; // Source contains data related to a top-level navigation. -// Next tag: 8 +// Next tag: 9 message Source { // An identifier for the source. This should be unique within a session. optional int64 id = 1; + // Holds data about a URL seen by the client. + message UrlInfo { + // The URL seen by the client. + optional string url = 1; + + // Number of URLs seen for this source before the current URL. + // If unset, it’s equivalent to the count of the UrlInfo before it + 1, + // or 0 if it’s the first UrlInfo. + optional int32 previous_url_count = 2; + } + + // Data about each URL associated with the source_id within the record's + // scope, in the order that the URLs were encountered. Data may include full + // or partial redirect chains for main frame navigations. + repeated UrlInfo urls = 8; + // The URL of the source, as recorded in history. If this URL has not been // discovered by Google's crawler, it should not be recorded. optional string url = 2;
diff --git a/tools/android/memconsumer/memconsumer_hook.cc b/tools/android/memconsumer/memconsumer_hook.cc index 78a98d9..7526b66 100644 --- a/tools/android/memconsumer/memconsumer_hook.cc +++ b/tools/android/memconsumer/memconsumer_hook.cc
@@ -6,6 +6,7 @@ #include <jni.h> #include <stdio.h> #include <string.h> +#include <cstdlib> extern "C" { JNIEXPORT void JNICALL @@ -40,10 +41,9 @@ } g_memory = static_cast<uint32_t*>(malloc(memory)); if (!g_memory) { - __android_log_print(ANDROID_LOG_WARN, - "MemConsumer", + __android_log_print(ANDROID_LOG_WARN, "MemConsumer", "Unable to allocate %lld bytes", - memory); + static_cast<long long>(memory)); } // If memory allocation failed, try to allocate as much as possible. while (!g_memory) {
diff --git a/tools/android/memtrack_helper/memtrack_helper.c b/tools/android/memtrack_helper/memtrack_helper.c index b1185573..0585705 100644 --- a/tools/android/memtrack_helper/memtrack_helper.c +++ b/tools/android/memtrack_helper/memtrack_helper.c
@@ -17,6 +17,7 @@ #include <sys/stat.h> #include <sys/types.h> #include <sys/wait.h> +#include <unistd.h> /* * This is a helper daemon for Android which makes memtrack graphics information
diff --git a/tools/android/sdk_updater/update_sdk.py b/tools/android/sdk_updater/update_sdk.py index 103acbe..3ec2be98 100755 --- a/tools/android/sdk_updater/update_sdk.py +++ b/tools/android/sdk_updater/update_sdk.py
@@ -200,10 +200,9 @@ pkg_version: The version of the package instance. verbose: Enable more logging. """ - if not yaml_file: - pkg_yaml_file = os.path.join(sdk_root, 'cipd_%s.yaml' % package) - if not os.path.exists(pkg_yaml_file): - raise IOError('Cannot find .yaml file for package %s' % package) + pkg_yaml_file = yaml_file or os.path.join(sdk_root, 'cipd_%s.yaml' % package) + if not os.path.exists(pkg_yaml_file): + raise IOError('Cannot find .yaml file for package %s' % package) if dry_run: print 'This `package` command (without -n/--dry-run) would create and',
diff --git a/tools/binary_size/libsupersize/canned_queries.py b/tools/binary_size/libsupersize/canned_queries.py index b3d1dd2..ce4e46d 100644 --- a/tools/binary_size/libsupersize/canned_queries.py +++ b/tools/binary_size/libsupersize/canned_queries.py
@@ -152,10 +152,15 @@ def __init__(self, size_infos): self._size_infos = size_infos - def _SymbolsArg(self, arg): + def _SymbolsArg(self, arg, native_only=False, pak_only=False): arg = arg if arg is not None else self._size_infos[-1] - if isinstance(arg, (models.SizeInfo, models.DeltaSizeInfo)): - arg = arg.symbols + if isinstance(arg, models.BaseSizeInfo): + if native_only: + arg = arg.native_symbols + elif pak_only: + arg = arg.pak_symbols + else: + arg = arg.symbols return arg def CategorizeGenerated(self, symbols=None): @@ -168,20 +173,24 @@ def TemplatesByName(self, symbols=None, depth=0): """Lists C++ templates grouped by name.""" - symbols = self._SymbolsArg(symbols) + symbols = self._SymbolsArg(symbols, native_only=True) # Call Sorted() twice so that subgroups will be sorted. # TODO(agrieve): Might be nice to recursively GroupedByName() on these. return symbols.WhereIsTemplate().Sorted().GroupedByName(depth).Sorted() def StaticInitializers(self, symbols=None): """Lists Static Initializers.""" - symbols = self._SymbolsArg(symbols) + symbols = self._SymbolsArg(symbols, native_only=True) # GCC generates "_GLOBAL__" symbols. Clang generates "startup". return symbols.WhereNameMatches('^startup$|^_GLOBAL__') def LargeFiles(self, symbols=None, min_size=50 * 1024): """Lists source files that are larger than a certain size (default 50kb).""" symbols = self._SymbolsArg(symbols) - # GCC generates "_GLOBAL__" symbols. Clang generates "startup". return symbols.GroupedByPath(fallback=None).WherePssBiggerThan( min_size).Sorted() + + def PakByPath(self, symbols=None): + """Groups .pak.* symbols by path.""" + symbols = self._SymbolsArg(symbols, pak_only=True) + return symbols.WhereIsPak().Sorted().GroupedByPath().Sorted()
diff --git a/tools/binary_size/libsupersize/describe.py b/tools/binary_size/libsupersize/describe.py index 975fe4f..f303aae 100644 --- a/tools/binary_size/libsupersize/describe.py +++ b/tools/binary_size/libsupersize/describe.py
@@ -318,7 +318,8 @@ unique_paths.add(s.object_path) if group.IsDelta(): - unique_part = 'aliases not grouped for diffs' + before_unique, after_unique = group.CountUniqueSymbols() + unique_part = '{:,} -> {:,} unique'.format(before_unique, after_unique) else: unique_part = '{:,} unique'.format(group.CountUniqueSymbols()) @@ -431,11 +432,11 @@ return itertools.chain(diff_summary_desc, path_delta_desc, group_desc) def _DescribeDeltaSizeInfo(self, diff): - common_metadata = {k: v for k, v in diff.before_metadata.iteritems() - if diff.after_metadata[k] == v} - before_metadata = {k: v for k, v in diff.before_metadata.iteritems() + common_metadata = {k: v for k, v in diff.before.metadata.iteritems() + if diff.after.metadata[k] == v} + before_metadata = {k: v for k, v in diff.before.metadata.iteritems() if k not in common_metadata} - after_metadata = {k: v for k, v in diff.after_metadata.iteritems() + after_metadata = {k: v for k, v in diff.after.metadata.iteritems() if k not in common_metadata} metadata_desc = itertools.chain( ('Common Metadata:',),
diff --git a/tools/binary_size/libsupersize/diff.py b/tools/binary_size/libsupersize/diff.py index db5203a..793754b 100644 --- a/tools/binary_size/libsupersize/diff.py +++ b/tools/binary_size/libsupersize/diff.py
@@ -127,5 +127,4 @@ section_sizes[k] = v symbol_diff = _DiffSymbolGroups(before.raw_symbols, after.raw_symbols) - return models.DeltaSizeInfo(section_sizes, symbol_diff, before.metadata, - after.metadata) + return models.DeltaSizeInfo(before, after, section_sizes, symbol_diff)
diff --git a/tools/binary_size/libsupersize/html_report.py b/tools/binary_size/libsupersize/html_report.py index d92fe55..d339bf8 100644 --- a/tools/binary_size/libsupersize/html_report.py +++ b/tools/binary_size/libsupersize/html_report.py
@@ -92,16 +92,16 @@ def _AddSymbolIntoFileNode(node, symbol_type, symbol_name, symbol_size, - include_symbols): + min_symbol_size): """Puts symbol into the file path node |node|.""" node[_NODE_LAST_PATH_ELEMENT_KEY] = True # Don't bother with buckets when not including symbols. - if include_symbols: + if min_symbol_size == 0: node = _GetOrMakeChildNode(node, _NODE_TYPE_BUCKET, symbol_type) node[_NODE_SYMBOL_TYPE_KEY] = symbol_type # 'node' is now the symbol-type bucket. Make the child entry. - if include_symbols or not symbol_name: + if not symbol_name or symbol_size >= min_symbol_size: node_name = symbol_name or '[Anonymous]' elif symbol_name.startswith('*'): node_name = symbol_name @@ -112,7 +112,7 @@ node[_NODE_SYMBOL_TYPE_KEY] = symbol_type -def _MakeCompactTree(symbols, include_symbols): +def _MakeCompactTree(symbols, min_symbol_size): result = { _NODE_NAME_KEY: '/', _NODE_CHILDREN_KEY: {}, @@ -135,14 +135,14 @@ elif symbol.name.endswith(']'): symbol_type = _NODE_SYMBOL_TYPE_GENERATED _AddSymbolIntoFileNode(node, symbol_type, symbol.template_name, symbol.pss, - include_symbols) + min_symbol_size) depth += 2 result[_NODE_MAX_DEPTH_KEY] = max(result[_NODE_MAX_DEPTH_KEY], depth) # The (no path) bucket can be extremely large if we failed to get # path information. Split it into subgroups if needed. no_path_bucket = result[_NODE_CHILDREN_KEY].get(_NAME_NO_PATH_BUCKET) - if no_path_bucket and include_symbols: + if no_path_bucket and min_symbol_size == 0: _SplitLargeBucket(no_path_bucket) _MakeChildrenDictsIntoLists(result) @@ -171,8 +171,9 @@ parser.add_argument('--include-bss', action='store_true', help='Include symbols from .bss (which consume no real ' 'space)') - parser.add_argument('--include-symbols', action='store_true', - help='Use per-symbol granularity rather than per-file.') + parser.add_argument('--min-symbol-size', type=float, default=1024, + help='Minimum size (PSS) for a symbol to be included as ' + 'an independent node.') def Run(args, parser): @@ -181,7 +182,7 @@ logging.info('Reading .size file') size_info = archive.LoadAndPostProcessSizeInfo(args.input_file) - symbols = size_info.symbols + symbols = size_info.raw_symbols if not args.include_bss: symbols = symbols.WhereInSection('b').Inverted() symbols = symbols.WherePssBiggerThan(0) @@ -192,7 +193,7 @@ _CopyTemplateFiles(args.report_dir) logging.info('Creating JSON objects') - tree_root = _MakeCompactTree(symbols, args.include_symbols) + tree_root = _MakeCompactTree(symbols, args.min_symbol_size) logging.info('Serializing JSON') with open(os.path.join(args.report_dir, 'data.js'), 'w') as out_file:
diff --git a/tools/binary_size/libsupersize/integration_test.py b/tools/binary_size/libsupersize/integration_test.py index 224265d7..7befa94 100755 --- a/tools/binary_size/libsupersize/integration_test.py +++ b/tools/binary_size/libsupersize/integration_test.py
@@ -215,7 +215,10 @@ 'ExpandRegex("_foo_")', 'canned_queries.CategorizeGenerated()', 'canned_queries.CategorizeByChromeComponent()', + 'canned_queries.LargeFiles()', 'canned_queries.TemplatesByName()', + 'canned_queries.StaticInitializers()', + 'canned_queries.PakByPath()', 'Print(ReadStringLiterals(elf_path={}))'.format(repr(_TEST_ELF_PATH)), 'Print(size_info, to_file=%r)' % output_file.name, ]
diff --git a/tools/binary_size/libsupersize/models.py b/tools/binary_size/libsupersize/models.py index 0dc9aba8..5ac5dd5 100644 --- a/tools/binary_size/libsupersize/models.py +++ b/tools/binary_size/libsupersize/models.py
@@ -57,6 +57,19 @@ # Used by SymbolGroup when they contain a mix of sections. SECTION_MULTIPLE = '.*' +NATIVE_SECTIONS = ( + SECTION_BSS, + SECTION_DATA, + SECTION_DATA_REL_RO, + SECTION_DATA_REL_RO_LOCAL, + SECTION_RODATA, + SECTION_TEXT, +) +PAK_SECTIONS = ( + SECTION_PAK_NONTRANSLATED, + SECTION_PAK_TRANSLATIONS, +) + SECTION_NAME_TO_SECTION = { SECTION_BSS: 'b', SECTION_DATA: 'd', @@ -102,90 +115,98 @@ STRING_LITERAL_NAME = 'string literal' -class SizeInfo(object): - """Represents all size information for a single binary. +class BaseSizeInfo(object): + """Base class for SizeInfo and DeltaSizeInfo. Fields: section_sizes: A dict of section_name -> size. raw_symbols: A SymbolGroup containing all top-level symbols (no groups). - symbols: A SymbolGroup where symbols have been grouped by full_name (where - applicable). May be re-assigned when it is desirable to show custom - groupings while still printing metadata and section_sizes. - metadata: A dict. - size_path: Path to .size file this was loaded from (or None). + symbols: A SymbolGroup of all symbols, where symbols have been + grouped by full_name (where applicable). May be re-assigned when it is + desirable to show custom groupings while still printing metadata and + section_sizes. + native_symbols: Subset of |symbols| that are from native code. + pak_symbols: Subset of |symbols| that are from pak files. """ __slots__ = ( 'section_sizes', 'raw_symbols', '_symbols', - 'metadata', - 'size_path', + '_native_symbols', + '_pak_symbols', ) - """Root size information.""" - def __init__(self, section_sizes, raw_symbols, metadata=None, symbols=None, - size_path=None): + def __init__(self, section_sizes, raw_symbols, symbols=None): if isinstance(raw_symbols, list): raw_symbols = SymbolGroup(raw_symbols) self.section_sizes = section_sizes # E.g. {SECTION_TEXT: 0} self.raw_symbols = raw_symbols self._symbols = symbols + self._native_symbols = None + self._pak_symbols = None + + @property + def symbols(self): + if self._symbols is None: + logging.debug('Clustering symbols') + self._symbols = self.raw_symbols._Clustered() + logging.debug('Done clustering symbols') + return self._symbols + + @symbols.setter + def symbols(self, value): + self._symbols = value + + @property + def native_symbols(self): + if self._native_symbols is None: + # Use self.symbols rather than raw_symbols here so that _Clustered() + # is not performed twice (slow) if accessing both properties. + self._native_symbols = self.symbols.WhereIsNative() + return self._native_symbols + + @property + def pak_symbols(self): + if self._pak_symbols is None: + self._pak_symbols = self.raw_symbols.WhereIsPak() + return self._pak_symbols + + +class SizeInfo(BaseSizeInfo): + """Represents all size information for a single binary. + + Fields: + metadata: A dict. + size_path: Path to .size file this was loaded from (or None). + """ + __slots__ = ( + 'metadata', + 'size_path', + ) + + def __init__(self, section_sizes, raw_symbols, metadata=None, symbols=None, + size_path=None): + super(SizeInfo, self).__init__(section_sizes, raw_symbols, symbols=symbols) self.metadata = metadata or {} self.size_path = size_path - @property - def symbols(self): - if self._symbols is None: - logging.debug('Clustering symbols') - self._symbols = self.raw_symbols._Clustered() - logging.debug('Done clustering symbols') - return self._symbols - @symbols.setter - def symbols(self, value): - self._symbols = value - - -class DeltaSizeInfo(object): +class DeltaSizeInfo(BaseSizeInfo): """What you get when you Diff() two SizeInfo objects. Fields: - section_sizes: A dict of section_name -> size delta. - raw_symbols: A DeltaSymbolGroup with all top-level symbols in it - (no groups). - symbols: A DeltaSymbolGroup where symbols have been grouped by full_name - (where applicable). May be re-assigned when it is desirable to show - custom groupings while still printing metadata and section_sizes. - before_metadata: metadata of the "before" SizeInfo. - after_metadata: metadata of the "after" SizeInfo. + before: SizeInfo for "before". + after: SizeInfo for "after". """ __slots__ = ( - 'section_sizes', - 'raw_symbols', - '_symbols', - 'before_metadata', - 'after_metadata', + 'before', + 'after', ) - def __init__(self, section_sizes, raw_symbols, before_metadata, - after_metadata): - self.section_sizes = section_sizes - self.raw_symbols = raw_symbols - self.before_metadata = before_metadata - self.after_metadata = after_metadata - self._symbols = None - - @property - def symbols(self): - if self._symbols is None: - logging.debug('Clustering symbols') - self._symbols = self.raw_symbols._Clustered() - logging.debug('Done clustering symbols') - return self._symbols - - @symbols.setter - def symbols(self, value): - self._symbols = value + def __init__(self, before, after, section_sizes, raw_symbols): + super(DeltaSizeInfo, self).__init__(section_sizes, raw_symbols) + self.before = before + self.after = after class BaseSymbol(object): @@ -687,6 +708,14 @@ ret.section_name = SECTION_TO_SECTION_NAME[section] return ret + def WhereIsNative(self): + return self.WhereInSection( + ''.join(SECTION_NAME_TO_SECTION[s] for s in NATIVE_SECTIONS)) + + def WhereIsPak(self): + return self.WhereInSection( + ''.join(SECTION_NAME_TO_SECTION[s] for s in PAK_SECTIONS)) + def WhereIsTemplate(self): return self.Filter(lambda s: s.template_name is not s.name)
diff --git a/tools/binary_size/libsupersize/template/D3SymbolTreeMap.js b/tools/binary_size/libsupersize/template/D3SymbolTreeMap.js index 654a5039..e7d3b6f 100644 --- a/tools/binary_size/libsupersize/template/D3SymbolTreeMap.js +++ b/tools/binary_size/libsupersize/template/D3SymbolTreeMap.js
@@ -78,6 +78,9 @@ 't': '.text', 'v': 'Vtable entry', '!': 'Generated Symbols (typeinfo, thunks, etc)', + 'p': 'Locale Pak Entries', + 'P': 'Non-Locale Pak Entries', + 'o': 'Other Entries', }; D3SymbolTreeMap._NM_SYMBOL_TYPES = ''; for (var symbol_type in D3SymbolTreeMap._NM_SYMBOL_TYPE_DESCRIPTIONS) { @@ -105,6 +108,9 @@ 'rgb(128,177,211)', 'rgb(255,237,111)', 'rgb(204,235,197)', + 'rgb(93,156,110)', + 'rgb(61,109,55)', + 'rgb(255,111,111)', ] D3SymbolTreeMap._initColorMap = function() {
diff --git a/tools/binary_size/libsupersize/template/index.html b/tools/binary_size/libsupersize/template/index.html index 0d41597..81a9e70 100644 --- a/tools/binary_size/libsupersize/template/index.html +++ b/tools/binary_size/libsupersize/template/index.html
@@ -24,7 +24,7 @@ var treemap; var filterChanging = false; var savedSettings = {}; -var NUM_SYMBOL_TYPES = 6 +var NUM_SYMBOL_TYPES = 9; function init() { if (window.metadata !== undefined && window.metadata.subtitle) { @@ -36,6 +36,7 @@ savedSettings.height, savedSettings.maxLevels); treemap.init(); + applyFilter(); // Required to make .other hidden by default. } function getIdealSizes() { @@ -209,7 +210,12 @@ } function initFilterOptions() { - updateFilterText(); + var filterFromUrl = new URL(window.location).searchParams.get('sections'); + if (filterFromUrl) { + document.getElementById('symbol_types_filter').value = filterFromUrl; + } else { + updateFilterText(); + } for (var x=0; x<NUM_SYMBOL_TYPES; x++) { var checkBox = document.getElementById('check_' + x); checkBox.onchange=updateFilterText; @@ -256,6 +262,67 @@ container.style.visibility = 'hidden'; } +function applyFilter() { + // Type filters + var typeFilter = function(datum) { + if (datum.depth === 0) return true; // root node + if (datum.t === undefined) return true; + return savedSettings.symbolTypes !== undefined && + savedSettings.symbolTypes.indexOf(datum.t) !== -1; + } + + // Regex filter + var regexFilter; + if (savedSettings.regex !== undefined && savedSettings.regex.length > 0) { + console.log('filter: regex is "' + savedSettings.regex + '"'); + var regex = new RegExp(savedSettings.regex); + regexFilter = function(datum) { + if (datum.depth === 0) return true; // root node + var fullName = this.pathFor(datum); + if (datum.children === undefined) { // it is a leaf node (symbol) + fullName += ':' + datum.n; + } + return regex.test(fullName); + } + } + + // Exclude regex filter + var excludeRegexFilter = undefined; + if (savedSettings.excludeRegex !== undefined && savedSettings.excludeRegex.length > 0) { + console.log('filter: exclude-regex is "' + savedSettings.excludeRegex + '"'); + var excludeRegex = new RegExp(savedSettings.excludeRegex); + excludeRegexFilter = function(datum) { + if (datum.depth === 0) return true; // root node + var fullName = this.pathFor(datum); + if (datum.children === undefined) { // it is a leaf node (symbol) + fullName += ':' + datum.n; + } + return !excludeRegex.test(fullName); + } + } + + // Size filter + var sizeFilter = undefined; + if (savedSettings.gte !== undefined) { + console.log('filter: minimum size is ' + savedSettings.gte + ' bytes'); + sizeFilter = function(datum) { + if (datum.children !== undefined) return true; // non-leaf + if (datum.value === undefined) console.log('whoops'); + return datum.value >= savedSettings.gte; + } + } + + // Make a filter to apply to the tree + var filter = function(datum) { + if (!typeFilter.call(this, datum)) return false; + if (regexFilter && !regexFilter.call(this, datum)) return false; + if (excludeRegexFilter && !excludeRegexFilter.call(this, datum)) return false; + if (sizeFilter && !sizeFilter.call(this, datum)) return false; + return true; + }; + treemap.filter(filter); +} + function applySettings() { hideOptions(); var oldWidth = savedSettings.width; @@ -275,64 +342,7 @@ var maxLevelsChanged = oldMaxLevels !== savedSettings.maxLevels; if (filterChanged) { - // Type filters - typeFilter = function(datum) { - if (datum.depth === 0) return true; // root node - if (datum.t === undefined) return true; - return savedSettings.symbolTypes !== undefined && - savedSettings.symbolTypes.indexOf(datum.t) !== -1; - } - - // Regex filter - var regexFilter = undefined; - if (savedSettings.regex !== undefined && savedSettings.regex.length > 0) { - console.log('filter: regex is "' + savedSettings.regex + '"'); - var regex = new RegExp(savedSettings.regex); - regexFilter = function(datum) { - if (datum.depth === 0) return true; // root node - var fullName = this.pathFor(datum); - if (datum.children === undefined) { // it is a leaf node (symbol) - fullName += ':' + datum.n; - } - return regex.test(fullName); - } - } - - // Exclude regex filter - var excludeRegexFilter = undefined; - if (savedSettings.excludeRegex !== undefined && savedSettings.excludeRegex.length > 0) { - console.log('filter: exclude-regex is "' + savedSettings.excludeRegex + '"'); - var excludeRegex = new RegExp(savedSettings.excludeRegex); - excludeRegexFilter = function(datum) { - if (datum.depth === 0) return true; // root node - var fullName = this.pathFor(datum); - if (datum.children === undefined) { // it is a leaf node (symbol) - fullName += ':' + datum.n; - } - return !excludeRegex.test(fullName); - } - } - - // Size filter - var sizeFilter = undefined; - if (savedSettings.gte !== undefined) { - console.log('filter: minimum size is ' + savedSettings.gte + ' bytes'); - sizeFilter = function(datum) { - if (datum.children !== undefined) return true; // non-leaf - if (datum.value === undefined) console.log('whoops'); - return datum.value >= savedSettings.gte; - } - } - - // Make a filter to apply to the tree - var filter = function(datum) { - if (typeFilter && !typeFilter.call(this, datum)) return false; - if (regexFilter && !regexFilter.call(this, datum)) return false; - if (excludeRegexFilter && !excludeRegexFilter.call(this, datum)) return false; - if (sizeFilter && !sizeFilter.call(this, datum)) return false; - return true; - }; - treemap.filter(filter); + applyFilter(); } // Adjust levels if needed. @@ -433,6 +443,9 @@ <br><span class='swatch' id='swatch_3'> </span><input checked type='checkbox' id='check_3' value='t'>Code (.text) <br><span class='swatch' id='swatch_4'> </span><input checked type='checkbox' id='check_4' value='v'>Vtable entries <br><span class='swatch' id='swatch_5'> </span><input checked type='checkbox' id='check_5' value='!'>Generated Symbols (typeinfo, thunks, etc) + <br><span class='swatch' id='swatch_6'> </span><input checked type='checkbox' id='check_6' value='p'>Locale Pak Entries + <br><span class='swatch' id='swatch_7'> </span><input checked type='checkbox' id='check_7' value='P'>Non-Locale Pak Entries + <br><span class='swatch' id='swatch_8'> </span><input type='checkbox' id='check_8' value='o'>Other Entries </td> </tr> <tr><td style='text-align: center; white-space: nowrap; padding-top: 1em;'>
diff --git a/tools/binary_size/libsupersize/testdata/Console.golden b/tools/binary_size/libsupersize/testdata/Console.golden index 6d00d099..f54920a 100644 --- a/tools/binary_size/libsupersize/testdata/Console.golden +++ b/tools/binary_size/libsupersize/testdata/Console.golden
@@ -1,16 +1,16 @@ ******************************************************************************** Entering interactive Python shell. Quick reference: -SizeInfo: metadata, raw_symbols, section_sizes, size_path, symbols +SizeInfo: metadata, native_symbols, pak_symbols, raw_symbols, section_sizes, size_path, symbols Symbol: FlagsString, IsBss, IsDelta, IsGeneratedByToolchain, IsGroup, IsPak, IsStringLiteral, IterLeafSymbols, address, aliases, end_address, flags, full_name, generated_source, is_anonymous, name, num_aliases, object_path, padding, padding_pss, pss, pss_without_padding, section, section_name, size, size_without_padding, source_path, template_name -SymbolGroup (extends Symbol): CountUniqueSymbols, Filter, GroupedBy, GroupedByAliases, GroupedByFullName, GroupedByName, GroupedByPath, GroupedBySectionName, Inverted, IterUniqueSymbols, SetName, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAddressInRange, WhereFullNameMatches, WhereGeneratedByToolchain, WhereHasAnyAttribution, WhereHasPath, WhereInSection, WhereIsGroup, WhereIsTemplate, WhereMatches, WhereNameMatches, WhereObjectPathMatches, WherePathMatches, WherePssBiggerThan, WhereSizeBiggerThan, WhereSourceIsGenerated, WhereSourcePathMatches, WhereTemplateNameMatches, index, is_sorted +SymbolGroup (extends Symbol): CountUniqueSymbols, Filter, GroupedBy, GroupedByAliases, GroupedByFullName, GroupedByName, GroupedByPath, GroupedBySectionName, Inverted, IterUniqueSymbols, SetName, Sorted, SortedByAddress, SortedByCount, SortedByName, WhereAddressInRange, WhereFullNameMatches, WhereGeneratedByToolchain, WhereHasAnyAttribution, WhereHasPath, WhereInSection, WhereIsGroup, WhereIsNative, WhereIsPak, WhereIsTemplate, WhereMatches, WhereNameMatches, WhereObjectPathMatches, WherePathMatches, WherePssBiggerThan, WhereSizeBiggerThan, WhereSourceIsGenerated, WhereSourcePathMatches, WhereTemplateNameMatches, index, is_sorted -DeltaSizeInfo: after_metadata, before_metadata, raw_symbols, section_sizes, symbols +DeltaSizeInfo: after, before, native_symbols, pak_symbols, raw_symbols, section_sizes, symbols DeltaSymbol (extends Symbol): after_symbol, before_symbol, diff_status DeltaSymbolGroup (extends SymbolGroup): CountsByDiffStatus, WhereDiffStatusIs, diff_status -canned_queries: CategorizeByChromeComponent, CategorizeGenerated, LargeFiles, StaticInitializers, TemplatesByName +canned_queries: CategorizeByChromeComponent, CategorizeGenerated, LargeFiles, PakByPath, StaticInitializers, TemplatesByName Functions: Csv(), Diff(), Disassemble(), ExpandRegex(), Print(), ReadStringLiterals(), ShowExamples() Variables:
diff --git a/tools/binary_size/libsupersize/testdata/Diff_Basic.golden b/tools/binary_size/libsupersize/testdata/Diff_Basic.golden index 47f4aa32..fec9c5f 100644 --- a/tools/binary_size/libsupersize/testdata/Diff_Basic.golden +++ b/tools/binary_size/libsupersize/testdata/Diff_Basic.golden
@@ -45,7 +45,7 @@ Changed files: third_party/container.c -Showing 1 symbols (aliases not grouped for diffs) with total pss: 10 bytes +Showing 1 symbols (1 -> 1 unique) with total pss: 10 bytes Histogram of symbols based on PSS: [8,16): 1 .text=0 bytes .rodata=0 bytes .data.rel.ro=0 bytes .data=10 bytes .bss=0 bytes total=10 bytes
diff --git a/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden b/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden index d689d22..3f77d804 100644 --- a/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden +++ b/tools/binary_size/libsupersize/testdata/Diff_NullDiff.golden
@@ -24,7 +24,7 @@ Number of unique symbols 48 -> 48 (+0) 0 paths added, 0 removed, 0 changed -Showing 0 symbols (aliases not grouped for diffs) with total pss: 0 bytes +Showing 0 symbols (0 -> 0 unique) with total pss: 0 bytes .text=0 bytes .rodata=0 bytes .data.rel.ro=0 bytes .data=0 bytes .bss=0 bytes .other=0 bytes total=0 bytes Number of unique paths: 0
diff --git a/tools/chrome_proxy/webdriver/lite_page.py b/tools/chrome_proxy/webdriver/lite_page.py index a9d83e2a..2e7a52a 100644 --- a/tools/chrome_proxy/webdriver/lite_page.py +++ b/tools/chrome_proxy/webdriver/lite_page.py
@@ -246,11 +246,12 @@ self.assertIn(response.status, [200, 204]) # Checks that a Nano Lite Page does not have an error when scrolling to the - # bottom of the page and is able to load all resources. This test is only run - # on Android because it depends on window size of the browser. + # bottom of the page and is able to load all resources. Nano pages don't + # request additional resources when scrolling. This test is only run on + # Android because it depends on window size of the browser. @AndroidOnly @ChromeVersionEqualOrAfterM(65) - def testLitePageBTFNano(self): + def testLitePageNano(self): # If it was attempted to run with another experiment, skip this test. if common.ParseFlags().browser_args and ('--data-reduction-proxy-experiment' in common.ParseFlags().browser_args): @@ -272,28 +273,12 @@ if response.url.endswith('html'): if (self.checkLitePageResponse(response)): lite_page_responses = lite_page_responses + 1 - self.assertEqual(1, lite_page_responses) - - # Scroll to the bottom of the window and ensure scrollHeight increases. - original_scroll_height = test_driver.ExecuteJavascriptStatement( - 'document.body.scrollHeight') - test_driver.ExecuteJavascriptStatement( - 'window.scrollTo(0,Math.max(document.body.scrollHeight));') - # Give some time for loading after scrolling. - time.sleep(2) - new_scroll_height = test_driver.ExecuteJavascriptStatement( - 'document.body.scrollHeight') - self.assertGreater(new_scroll_height, original_scroll_height) - - # Make sure there were more requests that were proxied. - responses = test_driver.GetHTTPResponses(override_has_logs=True) - self.assertNotEqual(0, len(responses)) - for response in responses: - if 'content-type' in response.response_headers and ('video/mp4' in - response.response_headers['content-type']): + if 'content-type' in response.response_headers and ('video/mp4' + in response.response_headers['content-type']): continue + # Make sure non-video requests are proxied. self.assertHasChromeProxyViaHeader(response) - self.assertIn(response.status, [200, 204, 304]) + self.assertEqual(1, lite_page_responses) # Lo-Fi fallback is not supported without the # DataReductionProxyDecidesTransform feature. Check that no Lo-Fi response
diff --git a/tools/code_coverage/coverage.py b/tools/code_coverage/coverage.py index 3b97955..faab150 100755 --- a/tools/code_coverage/coverage.py +++ b/tools/code_coverage/coverage.py
@@ -53,6 +53,7 @@ import sys import argparse +import json import os import subprocess import threading @@ -62,9 +63,15 @@ os.path.join( os.path.dirname(__file__), os.path.pardir, os.path.pardir, 'tools', 'clang', 'scripts')) - import update as clang_update +sys.path.append( + os.path.join( + os.path.dirname(__file__), os.path.pardir, os.path.pardir, + 'third_party')) +import jinja2 +from collections import defaultdict + # Absolute path to the root of the checkout. SRC_ROOT_PATH = os.path.abspath( os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)) @@ -99,6 +106,137 @@ # by 'gn refs "testing/gtest"', and it is lazily initialized when needed. GTEST_TARGET_NAMES = None +# The default name of the html coverage report for a directory. +DIRECTORY_COVERAGE_HTML_REPORT_NAME = os.extsep.join(['report', 'html']) + + +class _CoverageSummary(object): + """Encapsulates coverage summary representation.""" + + def __init__(self, regions_total, regions_covered, functions_total, + functions_covered, lines_total, lines_covered): + """Initializes _CoverageSummary object.""" + self._summary = { + 'regions': { + 'total': regions_total, + 'covered': regions_covered + }, + 'functions': { + 'total': functions_total, + 'covered': functions_covered + }, + 'lines': { + 'total': lines_total, + 'covered': lines_covered + } + } + + def Get(self): + """Returns summary as a dictionary.""" + return self._summary + + def AddSummary(self, other_summary): + """Adds another summary to this one element-wise.""" + for feature in self._summary: + self._summary[feature]['total'] += other_summary.Get()[feature]['total'] + self._summary[feature]['covered'] += other_summary.Get()[feature][ + 'covered'] + + +class _DirectoryCoverageReportHtmlGenerator(object): + """Encapsulates coverage html report generation for a directory. + + The generated html has a table that contains links to the coverage report of + its sub-directories and files. Please refer to ./directory_example_report.html + for an example of the generated html file. + """ + + def __init__(self): + """Initializes _DirectoryCoverageReportHtmlGenerator object.""" + css_file_name = os.extsep.join(['style', 'css']) + css_absolute_path = os.path.abspath(os.path.join(OUTPUT_DIR, css_file_name)) + assert os.path.exists(css_absolute_path), ( + 'css file doesn\'t exit. Please make sure "llvm-cov show -format=html" ' + 'is called first, and the css file is generated at: "%s"' % + css_absolute_path) + + self._css_absolute_path = css_absolute_path + self._table_entries = [] + template_dir = os.path.join( + os.path.dirname(os.path.realpath(__file__)), 'html_templates') + + jinja_env = jinja2.Environment( + loader=jinja2.FileSystemLoader(template_dir), trim_blocks=True) + self._header_template = jinja_env.get_template('header.html') + self._table_template = jinja_env.get_template('table.html') + self._footer_template = jinja_env.get_template('footer.html') + + def AddLinkToAnotherReport(self, html_report_path, name, summary): + """Adds a link to another html report in this report. + + The link to be added is assumed to be an entry in this directory. + """ + table_entry = { + 'href': + html_report_path, + 'name': + name, + 'is_dir': + os.path.basename(html_report_path) == + DIRECTORY_COVERAGE_HTML_REPORT_NAME + } + summary_dict = summary.Get() + for feature in summary_dict.keys(): + percentage = round((float(summary_dict[feature]['covered'] + ) / summary_dict[feature]['total']) * 100, 2) + color_class = self._GetColorClass(percentage) + table_entry[feature] = { + 'total': summary_dict[feature]['total'], + 'covered': summary_dict[feature]['covered'], + 'percentage': percentage, + 'color_class': color_class + } + self._table_entries.append(table_entry) + + def _GetColorClass(self, percentage): + """Returns the css color class based on coverage percentage.""" + if percentage >= 0 and percentage < 80: + return 'red' + if percentage >= 80 and percentage < 100: + return 'yellow' + if percentage == 100: + return 'green' + + assert False, 'Invalid coverage percentage: "%d"' % percentage + + def WriteHtmlCoverageReport(self, output_path): + """Write html coverage report for the directory. + + In the report, sub-directories are displayed before files and within each + category, entries are sorted alphabetically. + + Args: + output_path: A path to the html report. + """ + + def EntryCmp(left, right): + """Compare function for table entries.""" + if left['is_dir'] != right['is_dir']: + return -1 if left['is_dir'] == True else 1 + + return left['name'] < right['name'] + + self._table_entries = sorted(self._table_entries, cmp=EntryCmp) + + css_path = os.path.join(OUTPUT_DIR, os.extsep.join(['style', 'css'])) + html_header = self._header_template.render( + css_path=os.path.relpath(css_path, os.path.dirname(output_path))) + html_table = self._table_template.render(entries=self._table_entries) + html_footer = self._footer_template.render() + + with open(output_path, 'w') as html_file: + html_file.write(html_header + html_table + html_footer) + def _GetPlatform(): """Returns current running platform.""" @@ -154,11 +292,10 @@ coverage_revision, coverage_sub_revision = _GetRevisionFromStampFile( coverage_revision_stamp_file, platform) - has_coverage_tools = (os.path.exists(LLVM_COV_PATH) and - os.path.exists(LLVM_PROFDATA_PATH)) + has_coverage_tools = ( + os.path.exists(LLVM_COV_PATH) and os.path.exists(LLVM_PROFDATA_PATH)) - if (has_coverage_tools and - coverage_revision == clang_revision and + if (has_coverage_tools and coverage_revision == clang_revision and coverage_sub_revision == clang_sub_revision): # LLVM coverage tools are up to date, bail out. return clang_revision @@ -199,9 +336,6 @@ profdata_file_path: A path to the profdata file. filters: A list of directories and files to get coverage for. """ - print('Generating per file line-by-line code coverage in html ' - '(this can take a while depending on size of target!)') - # llvm-cov show [options] -instr-profile PROFILE BIN [-object BIN,...] # [[-object BIN]] [SOURCES] # NOTE: For object files, the first one is specified as a positional argument, @@ -218,6 +352,88 @@ subprocess.check_call(subprocess_cmd) +def _GeneratePerDirectoryCoverageInHtml(binary_paths, profdata_file_path, + filters): + """Generates coverage breakdown per directory.""" + per_file_coverage_summary = _GeneratePerFileCoverageSummary( + binary_paths, profdata_file_path, filters) + + per_directory_coverage_summary = defaultdict( + lambda: _CoverageSummary(0, 0, 0, 0, 0, 0)) + + # Calculate per directory code coverage summaries. + for file_path in per_file_coverage_summary: + summary = per_file_coverage_summary[file_path] + parent_dir = os.path.dirname(file_path) + while True: + per_directory_coverage_summary[parent_dir].AddSummary(summary) + + if parent_dir == SRC_ROOT_PATH: + break + parent_dir = os.path.dirname(parent_dir) + + for dir_path in per_directory_coverage_summary: + _GenerateCoverageInHtmlForDirectory( + dir_path, per_directory_coverage_summary, per_file_coverage_summary) + + +def _GenerateCoverageInHtmlForDirectory( + dir_path, per_directory_coverage_summary, per_file_coverage_summary): + """Generates coverage html report for a single directory.""" + html_generator = _DirectoryCoverageReportHtmlGenerator() + + for entry_name in os.listdir(dir_path): + entry_path = os.path.normpath(os.path.join(dir_path, entry_name)) + entry_html_report_path = _GetCoverageHtmlReportPath(entry_path) + + # Use relative paths instead of absolute paths to make the generated + # reports portable. + html_report_path = _GetCoverageHtmlReportPath(dir_path) + entry_html_report_relative_path = os.path.relpath( + entry_html_report_path, os.path.dirname(html_report_path)) + + if entry_path in per_directory_coverage_summary: + html_generator.AddLinkToAnotherReport( + entry_html_report_relative_path, os.path.basename(entry_path), + per_directory_coverage_summary[entry_path]) + elif entry_path in per_file_coverage_summary: + html_generator.AddLinkToAnotherReport( + entry_html_report_relative_path, os.path.basename(entry_path), + per_file_coverage_summary[entry_path]) + + html_generator.WriteHtmlCoverageReport(html_report_path) + + +def _OverwriteHtmlReportsIndexFile(): + """Overwrites the index file to link to the source root directory report.""" + html_index_file_path = os.path.join(OUTPUT_DIR, + os.extsep.join(['index', 'html'])) + src_root_html_report_path = _GetCoverageHtmlReportPath(SRC_ROOT_PATH) + src_root_html_report_relative_path = os.path.relpath( + src_root_html_report_path, os.path.dirname(html_index_file_path)) + content = (""" + <!DOCTYPE html> + <html> + <head> + <!-- HTML meta refresh URL redirection --> + <meta http-equiv="refresh" content="0; url=%s"> + </head> + </html>""" % src_root_html_report_relative_path) + with open(html_index_file_path, 'w') as f: + f.write(content) + + +def _GetCoverageHtmlReportPath(file_or_dir_path): + """Given a file or directory, returns the corresponding html report path.""" + html_path = ( + os.path.join(os.path.abspath(OUTPUT_DIR), 'coverage') + + os.path.abspath(file_or_dir_path)) + if os.path.isdir(file_or_dir_path): + return os.path.join(html_path, DIRECTORY_COVERAGE_HTML_REPORT_NAME) + else: + return os.extsep.join([html_path, 'html']) + + def _CreateCoverageProfileDataForTargets(targets, commands, jobs_count=None): """Builds and runs target to generate the coverage profile data. @@ -248,8 +464,6 @@ targets: A list of targets to build with coverage instrumentation. jobs_count: Number of jobs to run in parallel for compilation. If None, a default value is derived based on CPUs availability. - - """ def _IsGomaConfigured(): @@ -375,6 +589,51 @@ return profdata_file_path +def _GeneratePerFileCoverageSummary(binary_paths, profdata_file_path, filters): + """Generates per file coverage summary using "llvm-cov export" command.""" + # llvm-cov export [options] -instr-profile PROFILE BIN [-object BIN,...] + # [[-object BIN]] [SOURCES]. + # NOTE: For object files, the first one is specified as a positional argument, + # and the rest are specified as keyword argument. + subprocess_cmd = [ + LLVM_COV_PATH, 'export', '-summary-only', + '-instr-profile=' + profdata_file_path, binary_paths[0] + ] + subprocess_cmd.extend( + ['-object=' + binary_path for binary_path in binary_paths[1:]]) + subprocess_cmd.extend(filters) + + json_output = json.loads(subprocess.check_output(subprocess_cmd)) + assert len(json_output['data']) == 1 + files_coverage_data = json_output['data'][0]['files'] + + per_file_coverage_summary = {} + for file_coverage_data in files_coverage_data: + file_path = file_coverage_data['filename'] + summary = file_coverage_data['summary'] + + # TODO(crbug.com/797345): Currently, [SOURCES] parameter doesn't apply to + # llvm-cov export command, so work it around by manually filter the paths. + # Remove this logic once the bug is fixed and clang has rolled past it. + if filters and not any( + os.path.abspath(file_path).startswith(os.path.abspath(filter)) + for filter in filters): + continue + + if summary['lines']['count'] == 0: + continue + + per_file_coverage_summary[file_path] = _CoverageSummary( + regions_total=summary['regions']['count'], + regions_covered=summary['regions']['covered'], + functions_total=summary['functions']['count'], + functions_covered=summary['functions']['covered'], + lines_total=summary['lines']['count'], + lines_covered=summary['lines']['covered']) + + return per_file_coverage_summary + + def _GetBinaryPath(command): """Returns a relative path to the binary to be run by the command. @@ -562,10 +821,19 @@ profdata_file_path = _CreateCoverageProfileDataForTargets( args.targets, args.command, args.jobs) - binary_paths = [_GetBinaryPath(command) for command in args.command] + + print('Generating code coverage report in html (this can take a while ' + 'depending on size of target!)') _GenerateLineByLineFileCoverageInHtml(binary_paths, profdata_file_path, absolute_filter_paths) + _GeneratePerDirectoryCoverageInHtml(binary_paths, profdata_file_path, + absolute_filter_paths) + + # The default index file is generated only for the list of source files, needs + # to overwrite it to display per directory code coverage breakdown. + _OverwriteHtmlReportsIndexFile() + html_index_file_path = 'file://' + os.path.abspath( os.path.join(OUTPUT_DIR, 'index.html')) print('\nCode coverage profile data is created as: %s' % profdata_file_path)
diff --git a/tools/code_coverage/directory_example_report.html b/tools/code_coverage/directory_example_report.html new file mode 100644 index 0000000..a5a3b3d3 --- /dev/null +++ b/tools/code_coverage/directory_example_report.html
@@ -0,0 +1,40 @@ +<!doctype html> +<html> + <head> + <meta name='viewport' content='width=device-width,initial-scale=1'> + <meta charset='UTF-8'> + <link rel='stylesheet' type='text/css' href='/Users/liaoyuke/bling/src/out/Coverage-iphonesimulator/html/style.css'> + </head> + <body> + <h2>Coverage Report</h2> + <p>Click <a href='http://clang.llvm.org/docs/SourceBasedCodeCoverage.html#interpreting-reports'>here</a> for information about interpreting this report.</p> + <div class='centered'> + <table> + <tr> + <td class='column-entry-left'>Directory Name</td> + <td class='column-entry'>Line Coverage</td> + </tr> + <tr class='light-row'> + <td> + <pre><a href='/Users/liaoyuke/bling/src/out/Coverage-iphonesimulator/html/coverage/Users/liaoyuke/bling/src/url/third_party/coverage.html'>third_party</a></pre> + </td> + <td class='column-entry-yellow'> + <pre> 90.31% (699/774)</pre> + </td> + </tr> + <tr> + <td class='column-entry-left'>File Name</td> + <td class='column-entry'>Line Coverage</td> + </tr> + <tr class='light-row'> + <td> + <pre><a href='/Users/liaoyuke/bling/src/out/Coverage-iphonesimulator/html/coverage/Users/liaoyuke/bling/src/url/url_canon_stdurl.cc.html'>url_canon_stdurl.cc</a></pre> + </td> + <td class='column-entry-yellow'> + <pre> 93.94% (124/132)</pre> + </td> + </tr> + </table> + </div> + </body> +</html> \ No newline at end of file
diff --git a/tools/code_coverage/html_templates/footer.html b/tools/code_coverage/html_templates/footer.html new file mode 100644 index 0000000..79532637 --- /dev/null +++ b/tools/code_coverage/html_templates/footer.html
@@ -0,0 +1,4 @@ + </table> + </div> + </body> +</html> \ No newline at end of file
diff --git a/tools/code_coverage/html_templates/header.html b/tools/code_coverage/html_templates/header.html new file mode 100644 index 0000000..0d16a2fd --- /dev/null +++ b/tools/code_coverage/html_templates/header.html
@@ -0,0 +1,12 @@ +<!doctype html> +<html> + <head> + <meta name='viewport' content='width=device-width,initial-scale=1'> + <meta charset='UTF-8'> + <link rel='stylesheet' type='text/css' href='{{ css_path }}'> + </head> + <body> + <h2>Coverage Report</h2> + <p>Click <a href='http://clang.llvm.org/docs/SourceBasedCodeCoverage.html#interpreting-reports'>here</a> for information about interpreting this report.</p> + <div class='centered'> + <table> \ No newline at end of file
diff --git a/tools/code_coverage/html_templates/table.html b/tools/code_coverage/html_templates/table.html new file mode 100644 index 0000000..ae12b269 --- /dev/null +++ b/tools/code_coverage/html_templates/table.html
@@ -0,0 +1,24 @@ +<table> + <tr> + <td class='column-entry-left'>Path</td> + <td class='column-entry'>Line Coverage</td> + <td class='column-entry'>Function Coverage</td> + <td class='column-entry'>Region Coverage</td> + </tr> + {% for entry in entries %} + <tr class='light-row'> + <td> + {% if entry['is_dir'] == True %} + <pre><a href='{{ entry.href }}'>{{ entry.name }}/</a></pre> + {% else %} + <pre><a href='{{ entry.href }}'>{{ entry.name }}</a></pre> + {% endif %} + </td> + {% for feature in ('lines', 'functions', 'regions') %} + <td class='column-entry-{{ entry[feature]["color_class"] }}'> + <pre> {{ entry[feature]["percentage"] }}% ({{ entry[feature]["covered"] }}/{{ entry[feature]["total"] }})</pre> + </td> + {% endfor %} + </tr> + {% endfor %} +</table> \ No newline at end of file
diff --git a/tools/gn/xcode_writer.cc b/tools/gn/xcode_writer.cc index bdfdce04..f5dd65aa 100644 --- a/tools/gn/xcode_writer.cc +++ b/tools/gn/xcode_writer.cc
@@ -35,9 +35,10 @@ using TargetToTarget = std::unordered_map<const Target*, const Target*>; using TargetToPBXTarget = std::unordered_map<const Target*, PBXTarget*>; -const char kEarlGreyFileNameIdentifier[] = "egtest.mm"; -const char kXCTestObjCFileNameIdentifier[] = "xctest.m"; -const char kXCTestObjCppFileNameIdentifier[] = "xctest.mm"; +const char* kXCTestFileSuffixes[] = { + "egtest.m", "egtest.mm", "xctest.m", "xctest.mm", +}; + const char kXCTestModuleTargetNamePostfix[] = "_module"; const char kXCUITestRunnerTargetNamePostfix[] = "_runner"; @@ -126,12 +127,15 @@ } bool IsXCTestFile(const SourceFile& file) { - return base::EndsWith(file.GetName(), kEarlGreyFileNameIdentifier, - base::CompareCase::SENSITIVE) || - base::EndsWith(file.GetName(), kXCTestObjCFileNameIdentifier, - base::CompareCase::SENSITIVE) || - base::EndsWith(file.GetName(), kXCTestObjCppFileNameIdentifier, - base::CompareCase::SENSITIVE); + std::string file_name = file.GetName(); + for (size_t i = 0; i < arraysize(kXCTestFileSuffixes); ++i) { + if (base::EndsWith(file_name, kXCTestFileSuffixes[i], + base::CompareCase::SENSITIVE)) { + return true; + } + } + + return false; } const Target* FindApplicationTargetByName(
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl index 1859af0..3d7b8c44 100644 --- a/tools/mb/mb_config.pyl +++ b/tools/mb/mb_config.pyl
@@ -243,6 +243,7 @@ 'Mac deterministic': 'release_bot_mac_strip', 'Mac deterministic (dbg)': 'debug_bot', 'Mojo ChromiumOS': 'chromeos_with_codecs_release_trybot', + 'Mojo Android': 'android_release_bot_minimal_symbols_arm64', 'Mojo Linux': 'release_trybot', 'Mojo Windows': 'release_bot_x86_minimal_symbols', 'Ozone Linux': 'ozone_linux_release_bot', @@ -554,6 +555,7 @@ # shared library loading is fixed. 'android_cronet_tester': 'android_cronet_debug_static_bot_arm_no_neon', + 'android_mojo': 'android_release_trybot_arm64', 'android_n5x_swarming_dbg': 'android_debug_trybot_arm64', 'android_n5x_swarming_rel': 'android_release_trybot_arm64', 'android_optional_gpu_tests_rel': 'gpu_tests_android_release_trybot_arm64', @@ -763,6 +765,13 @@ 'v8_linux_blink_rel': 'release_trybot', 'v8_linux_chromium_gn_rel': 'release_trybot', }, + + 'tryserver.webrtc': { + 'win_chromium_webrtc_compile_rel_ng': 'gpu_tests_release_trybot_x86_minimal_symbols', + 'mac_chromium_webrtc_compile_rel_ng': 'gpu_tests_release_trybot', + 'linux_chromium_webrtc_compile_rel_ng': 'release_trybot', + 'android_webrtc_compile_rel': 'android_release_trybot', + }, },
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index db372a4..83c0864 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -2599,6 +2599,9 @@ </action> <action name="BindingsMismatchTerminate_RVH_WebUI"> + <obsolete> + Replaced in 1/2018 with bad_message::RVH_WEB_UI_BINDINGS_MISMATCH. + </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <description>Please enter the description of this user action.</description> </action> @@ -18710,6 +18713,9 @@ </action> <action name="Terminate_ProcessMismatch_CreateNewWidget"> + <obsolete> + Replaced in 1/2018 with bad_message::WCI_NEW_WIDGET_PROCESS_MISMATCH. + </obsolete> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <description>Please enter the description of this user action.</description> </action>
diff --git a/tools/metrics/histograms/README.md b/tools/metrics/histograms/README.md index 065c291d..935a7482 100644 --- a/tools/metrics/histograms/README.md +++ b/tools/metrics/histograms/README.md
@@ -81,7 +81,7 @@ 1. Edit [enums.xml](./enums.xml), adding the feature to the `LoginCustomFlags` enum section, with any unique value (just make one up, although whatever it - is needs to appear in sorted order; `pretty-print.py` will do this for you). + is needs to appear in sorted order; `pretty_print.py` will do this for you). 2. Build `unit_tests`, then run `unit_tests --gtest_filter='AboutFlagsHistogramTest.*'` to compute the correct value. 3. Update the entry in [enums.xml](./enums.xml) with the correct value, and move
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 049b765..b5b6395 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -2895,6 +2895,8 @@ <int value="190" label="AIRH_UNEXPECTED_BITSTREAM"/> <int value="191" label="ARH_UNEXPECTED_BITSTREAM"/> <int value="192" label="RDH_NULL_CLIENT"/> + <int value="193" label="RVH_WEB_UI_BINDINGS_MISMATCH"/> + <int value="194" label="WCI_NEW_WIDGET_PROCESS_MISMATCH"/> </enum> <enum name="BadMessageReasonExtensions"> @@ -17354,6 +17356,7 @@ <int value="2319" label="CSSSelectorWebkitUnknownPseudo"/> <int value="2320" label="FilterAsContainingBlockMayChangeOutput"/> <int value="2321" label="DispatchMouseUpDownEventOnDisabledFormControl"/> + <int value="2322" label="CSSSelectorPseudoMatches"/> </enum> <enum name="FeedbackSource"> @@ -22010,19 +22013,19 @@ </enum> <enum name="InfoBarIdentifier"> - <int value="1" label="APP_BANNER_INFOBAR_DELEGATE_ANDROID"/> - <int value="2" label="APP_BANNER_INFOBAR_DELEGATE_DESKTOP"/> + <int value="1" label="APP_BANNER_INFOBAR_DELEGATE"/> + <int value="2" label="APP_BANNER_INFOBAR_DELEGATE_DESKTOP (Obsolete)"/> <int value="3" label="ANDROID_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE (Obsolete)"/> - <int value="4" label="CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBAR_DELEGATE"/> + <int value="4" label="DUPLICATE_DOWNLOAD_INFOBAR_DELEGATE_ANDROID"/> <int value="5" label="DOWNLOAD_REQUEST_INFOBAR_DELEGATE_ANDROID (Obsolete)"/> <int value="6" label="FULLSCREEN_INFOBAR_DELEGATE (Obsolete)"/> <int value="7" label="HUNG_PLUGIN_INFOBAR_DELEGATE"/> - <int value="8" label="HUNG_RENDERER_INFOBAR_DELEGATE"/> + <int value="8" label="HUNG_RENDERER_INFOBAR_DELEGATE_ANDROID"/> <int value="9" label="MEDIA_STREAM_INFOBAR_DELEGATE_ANDROID (Obsolete)"/> <int value="10" label="MEDIA_THROTTLE_INFOBAR_DELEGATE (Obsolete)"/> <int value="11" label="REQUEST_QUOTA_INFOBAR_DELEGATE (Obsolete)"/> - <int value="12" label="DEV_TOOLS_CONFIRM_INFOBAR_DELEGATE"/> + <int value="12" label="DEV_TOOLS_INFOBAR_DELEGATE"/> <int value="13" label="EXTENSION_DEV_TOOLS_INFOBAR_DELEGATE"/> <int value="14" label="INCOGNITO_CONNECTABILITY_INFOBAR_DELEGATE"/> <int value="15" label="THEME_INSTALLED_INFOBAR_DELEGATE"/> @@ -22038,45 +22041,45 @@ <int value="23" label="NOTIFICATION_PERMISSION_INFOBAR_DELEGATE (Obsolete)"/> <int value="24" label="AUTO_SIGNIN_FIRST_RUN_INFOBAR_DELEGATE (Obsolete)"/> <int value="25" label="GENERATED_PASSWORD_SAVED_INFOBAR_DELEGATE_ANDROID"/> - <int value="26" label="SAVE_PASSWORD_INFOBAR_DELEGATE"/> + <int value="26" label="SAVE_PASSWORD_INFOBAR_DELEGATE_MOBILE"/> <int value="27" label="PEPPER_BROKER_INFOBAR_DELEGATE"/> - <int value="28" label="PERMISSION_UPDATE_INFOBAR_DELEGATE"/> + <int value="28" label="PERMISSION_UPDATE_INFOBAR_DELEGATE_ANDROID"/> <int value="29" label="DURABLE_STORAGE_PERMISSION_INFOBAR_DELEGATE_ANDROID (Obsolete)"/> <int value="30" label="NPAPI_REMOVAL_INFOBAR_DELEGATE (Obsolete)"/> <int value="31" label="OUTDATED_PLUGIN_INFOBAR_DELEGATE"/> <int value="32" label="PLUGIN_METRO_MODE_INFOBAR_DELEGATE (Obsolete)"/> <int value="33" label="RELOAD_PLUGIN_INFOBAR_DELEGATE"/> - <int value="34" label="PLUGIN_OBSERVER"/> + <int value="34" label="PLUGIN_OBSERVER_INFOBAR_DELEGATE"/> <int value="35" label="SSL_ADD_CERTIFICATE (Obsolete)"/> <int value="36" label="SSL_ADD_CERTIFICATE_INFOBAR_DELEGATE (Obsolete)"/> - <int value="37" label="POPUP_BLOCKED_INFOBAR_DELEGATE"/> - <int value="38" label="CHROME_SELECT_FILE_POLICY"/> - <int value="39" label="KEYSTONE_PROMOTION_INFOBAR_DELEGATE"/> + <int value="37" label="POPUP_BLOCKED_INFOBAR_DELEGATE_MOBILE"/> + <int value="38" label="FILE_ACCESS_DISABLED_INFOBAR_DELEGATE"/> + <int value="39" label="KEYSTONE_PROMOTION_INFOBAR_DELEGATE_MAC"/> <int value="40" label="COLLECTED_COOKIES_INFOBAR_DELEGATE"/> <int value="41" label="INSTALLATION_ERROR_INFOBAR_DELEGATE"/> <int value="42" label="ALTERNATE_NAV_INFOBAR_DELEGATE"/> - <int value="43" label="BAD_FLAGS_PROMPT"/> + <int value="43" label="BAD_FLAGS_INFOBAR_DELEGATE"/> <int value="44" label="DEFAULT_BROWSER_INFOBAR_DELEGATE"/> <int value="45" label="GOOGLE_API_KEYS_INFOBAR_DELEGATE"/> <int value="46" label="OBSOLETE_SYSTEM_INFOBAR_DELEGATE"/> - <int value="47" label="SESSION_CRASHED_INFOBAR_DELEGATE"/> + <int value="47" label="SESSION_CRASHED_INFOBAR_DELEGATE_MAC_IOS"/> <int value="48" label="PAGE_INFO_INFOBAR_DELEGATE"/> - <int value="49" label="AUTOFILL_CC_INFOBAR_DELEGATE"/> - <int value="50" label="TRANSLATE_INFOBAR_DELEGATE"/> - <int value="51" label="IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE"/> + <int value="49" label="AUTOFILL_CC_INFOBAR_DELEGATE_MOBILE"/> + <int value="50" label="TRANSLATE_INFOBAR_DELEGATE_NON_AURA"/> + <int value="51" label="IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE (Obsolete)"/> <int value="52" label="NATIVE_APP_INSTALLER_INFOBAR_DELEGATE (Obsolete)"/> <int value="53" label="NATIVE_APP_LAUNCHER_INFOBAR_DELEGATE (Obsolete)"/> <int value="54" label="NATIVE_APP_OPEN_POLICY_INFOBAR_DELEGATE (Obsolete)"/> - <int value="55" label="RE_SIGN_IN_INFOBAR_DELEGATE"/> - <int value="56" label="SHOW_PASSKIT_ERROR_INFOBAR_DELEGATE"/> + <int value="55" label="RE_SIGN_IN_INFOBAR_DELEGATE_IOS"/> + <int value="56" label="SHOW_PASSKIT_ERROR_INFOBAR_DELEGATE_IOS"/> <int value="57" label="READER_MODE_INFOBAR_DELEGATE (Obsolete)"/> - <int value="58" label="SYNC_ERROR_INFOBAR_DELEGATE"/> + <int value="58" label="SYNC_ERROR_INFOBAR_DELEGATE_IOS"/> <int value="59" label="UPGRADE_INFOBAR_DELEGATE"/> - <int value="60" label="CHROME_WINDOW_ERROR"/> - <int value="61" label="CONFIRM_DANGEROUS_DOWNLOAD"/> - <int value="62" label="WINDOWS_DESKTOP_SEARCH_INFOBAR_DELEGATE"/> - <int value="63" label="UPDATE_PASSWORD_INFOBAR_DELEGATE (Obsolete)"/> + <int value="60" label="WINDOW_ERROR_INFOBAR_DELEGATE_ANDROID"/> + <int value="61" label="DANGEROUS_DOWNLOAD_INFOBAR_DELEGATE_ANDROID"/> + <int value="62" label="WINDOWS_DESKTOP_SEARCH_INFOBAR_DELEGATE (Obsolete)"/> + <int value="63" label="UPDATE_PASSWORD_INFOBAR_DELEGATE_MOBILE"/> <int value="64" label="DATA_REDUCTION_PROMO_INFOBAR_DELEGATE_ANDROID"/> <int value="65" label="AUTOFILL_CC_ASSIST_INFOBAR_DELEGATE"/> <int value="66" label="ADS_BLOCKED_INFOBAR_DELEGATE_ANDROID"/> @@ -22084,8 +22087,9 @@ <int value="68" label="DATA_REDUCTION_PROXY_PREVIEW_INFOBAR_DELEGATE"/> <int value="69" label="SCREEN_CAPTURE_INFOBAR_DELEGATE_ANDROID"/> <int value="70" label="GROUPED_PERMISSION_INFOBAR_DELEGATE_ANDROID"/> - <int value="71" label="OFFLINE_PAGE_INFOBAR_DELEGATE"/> - <int value="72" label="SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_DELEGATE"/> + <int value="71" label="OFFLINE_PAGE_INFOBAR_DELEGATE_ANDROID"/> + <int value="72" + label="SEARCH_GEOLOCATION_DISCLOSURE_INFOBAR_DELEGATE_ANDROID"/> <int value="73" label="AUTOMATION_INFOBAR_DELEGATE"/> <int value="74" label="VR_SERVICES_UPGRADE_ANDROID"/> <int value="75" label="READER_MODE_INFOBAR_ANDROID"/> @@ -24002,6 +24006,23 @@ <int value="8026721" label="Zaza"/> </enum> +<enum name="LanguageSettingsActionType"> + <int value="0" label="Unknown"/> + <int value="1" label="Click on the 'Add Language' button"/> + <int value="2" label="Language added"/> + <int value="3" label="Language removed"/> + <int value="4" label="Disable global 'Offer to translate' by switch"/> + <int value="5" label="Enable global 'Offer to translate' by switch"/> + <int value="6" label="Disable 'Offer to translate' for single language"/> + <int value="7" label="Enable 'Offer to translate' for single language"/> + <int value="8" label="Language list reordered"/> +</enum> + +<enum name="LanguageSettingsPageType"> + <int value="0" label="Main"/> + <int value="1" label="Add Language"/> +</enum> + <enum name="LastSettingParsed"> <obsolete> Deprecated 2015-10-05 in Issue 433475. Histogram was used temorarily for @@ -25076,6 +25097,8 @@ <int value="-1251411236" label="disable-new-md-input-view"/> <int value="-1248478422" label="enable-zip-archiver-packer"/> <int value="-1246840031" label="OptInImeMenu:disabled"/> + <int value="-1243358233" + label="AutofillUseNewSettingsNameInDropdown:enabled"/> <int value="-1241747717" label="enable-android-password-link"/> <int value="-1235586511" label="enable-datasaver-prompt"/> <int value="-1225198073" label="ReaderModeInCCT:disabled"/> @@ -25110,9 +25133,11 @@ <int value="-1171900360" label="EnablePreventLayerSquashing:disabled"/> <int value="-1162944097" label="enable-color-correct-rendering"/> <int value="-1161409696" label="MediaRemotingEncrypted:enabled"/> + <int value="-1160941363" label="AffiliationBasedMatching:disabled"/> <int value="-1160026273" label="enable-web-notification-custom-layouts"/> <int value="-1159563774" label="enable-accessibility-script-injection"/> <int value="-1158993534" label="PrintScaling:enabled"/> + <int value="-1156179600" label="OmniboxRichEntitySuggestions:enabled"/> <int value="-1155543191" label="CopylessPaste:disabled"/> <int value="-1151766565" label="enable-fullscreen-tab-detaching"/> <int value="-1145702446" label="ChromeHomeInactivitySheetExpansion:enabled"/> @@ -25484,6 +25509,8 @@ <int value="-170986053" label="EnableManualFallbacksFilling:enabled"/> <int value="-165756594" label="enable-touch-feedback"/> <int value="-159877930" label="MaterialDesignUserManager:disabled"/> + <int value="-159046738" + label="AutofillCreditCardDropdownGooglePayBranding:disabled"/> <int value="-158549277" label="enable-embeddedsearch-api"/> <int value="-152677714" label="AsmJsToWebAssembly:enabled"/> <int value="-147283486" label="enable-network-portal-notification"/> @@ -25500,6 +25527,7 @@ <int value="-110465424" label="PictureInPicture:enabled"/> <int value="-108881882" label="NTPCondensedTileLayout:enabled"/> <int value="-102537270" label="extension-content-verification"/> + <int value="-102227288" label="PasswordExport:disabled"/> <int value="-99781021" label="disable-roboto-font-ui"/> <int value="-89690053" label="MaterialDesignUserManager:enabled"/> <int value="-88822940" label="ssl-version-min"/> @@ -25656,6 +25684,7 @@ <int value="367063319" label="PasswordImport:disabled"/> <int value="368854020" label="ash-screen-rotation-animation"/> <int value="369352033" label="GenericSensorExtraClasses:enabled"/> + <int value="369635818" label="PasswordExport:enabled"/> <int value="370486304" label="enable-origin-chip-on-srp"/> <int value="371268743" label="OmniboxUIExperimentVerticalMargin:disabled"/> <int value="372460068" label="QuickUnlockFingerprint:disabled"/> @@ -25738,6 +25767,7 @@ <int value="586021329" label="VibrateRequiresUserGesture:enabled"/> <int value="592050831" label="disable-slimming-paint"/> <int value="593707592" label="disable-network-portal-notification"/> + <int value="595371145" label="OmniboxRichEntitySuggestions:disabled"/> <int value="596106994" label="CustomFeedbackUi:enabled"/> <int value="598827460" label="enable-roboto-font-ui"/> <int value="598926697" label="VrLaunchIntent:disabled"/> @@ -25814,6 +25844,7 @@ <int value="762700519" label="enable-checker-imaging"/> <int value="765306424" label="ModuleScriptsDynamicImport:disabled"/> <int value="765803208" label="AutofillShowTypePredictions:enabled"/> + <int value="772348426" label="AffiliationBasedMatching:enabled"/> <int value="773919225" label="disable-office-editing-component-extension"/> <int value="779086132" label="enable-data-reduction-proxy-alt"/> <int value="782167080" label="enable-new-qp-input-view"/> @@ -25945,6 +25976,8 @@ <int value="1127427821" label="OmniboxEntitySuggestions:disabled"/> <int value="1129888794" label="ash-touch-hud"/> <int value="1133635187" label="force-gpu-rasterization"/> + <int value="1137429237" + label="AutofillCreditCardDropdownGooglePayBranding:enabled"/> <int value="1139226452" label="enable-nacl-debug"/> <int value="1139363314" label="disable-supervised-user-blacklist"/> <int value="1142515376" label="enable-nacl"/> @@ -26072,6 +26105,8 @@ <int value="1441897340" label="AndroidSpellCheckerNonLowEnd:enabled"/> <int value="1442798825" label="enable-quic"/> <int value="1442830837" label="MemoryAblation:disabled"/> + <int value="1449729378" + label="AutofillUseNewSettingsNameInDropdown:disabled"/> <int value="1452546183" label="PwaPersistentNotification:enabled"/> <int value="1454143461" label="CaptureThumbnailOnNavigatingAway:disabled"/> <int value="1454363479" label="disable-storage-manager"/> @@ -26085,8 +26120,8 @@ <int value="1466380480" label="enable-device-discovery-notifications"/> <int value="1466502102" label="DelayNavigation:disabled"/> <int value="1469407485" label="disable-accelerated-2d-canvas"/> + <int value="1474861626" label="disable-multi-mirroring"/> <int value="1479248574" label="disable-voice-input"/> - <int value="1480998407" label="enable-multi-mirroring"/> <int value="1481562816" label="disable-password-link"/> <int value="1486171015" label="disable-fill-on-account-select"/> <int value="1488700164" label="password-import:disabled"/> @@ -31028,6 +31063,10 @@ <int value="13" label="Redirected on flaky network"/> <int value="14" label="Redirected on prohibitively slow network"/> <int value="15" label="Redirected on connected network"/> + <int value="16" label="Digest mismatch on disconnected network"/> + <int value="17" label="Digest mismatch on flaky network"/> + <int value="18" label="Digest mismatch on prohibitively slow network"/> + <int value="19" label="Digest mismatch on connected network"/> </enum> <enum name="OfflinePagesBackgroundImmediateStartStatus"> @@ -37632,6 +37671,13 @@ <int value="9" label="Rollback: SBER2 absent so SBER1 must be cleared"/> </enum> +<enum name="ScrollAnchorRestorationStatus"> + <int value="0" label="SUCCESS"/> + <int value="1" label="FAILED_NO_MATCHES"/> + <int value="2" label="FAILED_NO_VALID_MATCHES"/> + <int value="3" label="FAILED_BAD_SELECTOR"/> +</enum> + <enum name="ScrollingThreadStatus"> <int value="0" label="SCROLLING_ON_COMPOSITOR"/> <int value="1" label="SCROLLING_ON_COMPOSITOR_BLOCKED_ON_MAIN"/> @@ -44369,6 +44415,7 @@ <int value="-2081867874" label="/usbDevices"/> <int value="-2019732586" label="/printing"/> <int value="-1930329480" label="/signOut"/> + <int value="-1924511305" label="/help"/> <int value="-1915654604" label="/sound"/> <int value="-1836863301" label="/ads"/> <int value="-1820397898" label="/manageAccessibility"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index a2bb213..7f029a4 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -70,7 +70,7 @@ If a <histogram> or a <suffix> element is only provided so that its name can be extended by <histogram_suffixes>, the element should be annotated with the -attribute base="true". This instructs tools not to treat the base name as a +attribute 'base="true"'. This instructs tools not to treat the base name as a distinct histogram. If two histogram_suffixes affect the same histogram, generated lists will be @@ -21325,6 +21325,9 @@ <histogram name="Event.MainThreadEventQueue.Continuous.FreshnessTime" units="microseconds"> + <obsolete> + Deprecated 01/2018 due to lack of usage. + </obsolete> <owner>dtapuska@chromium.org</owner> <summary> Time between when a continuous event (touchmove, mousemove, mousewheel) was @@ -21337,6 +21340,9 @@ <histogram name="Event.MainThreadEventQueue.Continuous.QueueingTime" units="microseconds"> + <obsolete> + Deprecated 01/2018 due to lack of usage. + </obsolete> <owner>dtapuska@chromium.org</owner> <summary> Time between when a continuous event (touchmove, mousemove, mousewheel) was @@ -21359,6 +21365,9 @@ <histogram name="Event.MainThreadEventQueue.NonContinuous.QueueingTime" units="microseconds"> + <obsolete> + Deprecated 01/2018 due to lack of usage. + </obsolete> <owner>dtapuska@chromium.org</owner> <summary> Time between when a non-continuous event (not touchmove, mousemove, @@ -31376,6 +31385,20 @@ </summary> </histogram> +<histogram name="LanguageSettings.Actions" enum="LanguageSettingsActionType"> + <owner>googleo@chromium.org</owner> + <summary> + The actions taken on languages settings, recorded every time they happen. + This histogram will record every single event that happens separately. + </summary> +</histogram> + +<histogram name="LanguageSettings.PageImpression" + enum="LanguageSettingsPageType"> + <owner>googleo@chromium.org</owner> + <summary>The type of panes which language settings loads.</summary> +</histogram> + <histogram name="LanguageUsage.AcceptLanguage" enum="LanguageCode"> <owner>Please list the metric's owners. Add more owner tags as needed.</owner> <summary>Accept languages.</summary> @@ -31513,6 +31536,14 @@ </summary> </histogram> +<histogram name="Layout.ScrollAnchor.RestorationStatus" + enum="ScrollAnchorRestorationStatus"> + <owner>pnoland@chromium.org</owner> + <summary> + Records the status of attempts to restore a serialized scroll anchor. + </summary> +</histogram> + <histogram name="Layout.ScrollAnchor.SerializedAnchorSelectorLength" units="characters"> <owner>pnoland@chromium.org</owner> @@ -31543,6 +31574,14 @@ <summary>The time it took to find a suitable anchor element.</summary> </histogram> +<histogram name="Layout.ScrollAnchor.TimeToRestoreAnchor" units="microseconds"> + <owner>pnoland@chromium.org</owner> + <summary> + The time it took to restore the scroll anchor using the serialized anchor + element. + </summary> +</histogram> + <histogram name="LevelDB.Open" enum="LevelDBStatus"> <owner>cmumford@chromium.org</owner> <summary>The result of an open attempt of a leveldb.</summary> @@ -33788,6 +33827,28 @@ </summary> </histogram> +<histogram base="true" name="Media.EME" enum="CdmPromiseResult"> + <owner>sandersd@chromium.org</owner> + <summary>Result of EME promises that were handled by Chromium code.</summary> +</histogram> + +<histogram base="true" name="Media.EME.addKey" enum="MediaKeyException"> + <obsolete> + Deprecated 02/2016 with removal of prefixed EME. + </obsolete> + <owner>xhwang@chromium.org</owner> + <summary>addKey result</summary> +</histogram> + +<histogram base="true" name="Media.EME.cancelKeyRequest" + enum="MediaKeyException"> + <obsolete> + Deprecated 02/2016 with removal of prefixed EME. + </obsolete> + <owner>xhwang@chromium.org</owner> + <summary>cancelKeyRequest result.</summary> +</histogram> + <histogram name="Media.EME.CdmFileIO.FileSizeKBOnError" units="KB"> <owner>xhwang@chromium.org</owner> <summary> @@ -33847,76 +33908,18 @@ <summary>The time spent to load a library CDM.</summary> </histogram> -<histogram name="Media.EME.ClearKey" enum="CdmPromiseResult"> - <owner>sandersd@chromium.org</owner> +<histogram base="true" name="Media.EME.CreateCdm" enum="BooleanSuccess"> + <owner>xhwang@chromium.org</owner> <summary> - Result of promises for Clear Key key systems that were handled by Chromium - code. + Whether the CDM instance is created successfully. Reported each time a CDM + instance creation is attempted, usually as a result of Javascript call of + createMediaKeys(). </summary> </histogram> -<histogram name="Media.EME.ClearKey.addKey" enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> +<histogram base="true" name="Media.EME.CreateCdmTime" units="ms"> <owner>xhwang@chromium.org</owner> - <summary>addKey result using the Clear Key key system.</summary> -</histogram> - -<histogram name="Media.EME.ClearKey.cancelKeyRequest" enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>cancelKeyRequest result using the Clear Key key system.</summary> -</histogram> - -<histogram name="Media.EME.ClearKey.CreateCdm" enum="BooleanSuccess"> - <owner>xhwang@chromium.org</owner> - <summary> - Whether the CDM instance for Clear Key key system is created successfully. - Reported each time a CDM instance creation is attempted, usually as a result - of Javascript call of createMediaKeys(). - </summary> -</histogram> - -<histogram name="Media.EME.ClearKey.CreateCdmTime" units="ms"> - <owner>xhwang@chromium.org</owner> - <summary> - The time it takes to create the CDM instance for Clear Key key system. - </summary> -</histogram> - -<histogram name="Media.EME.ClearKey.generateKeyRequest" - enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>generateKeyRequest result using the Clear Key key system.</summary> -</histogram> - -<histogram name="Media.EME.ClearKey.KeyAdded"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>KeyAdded event count using the Clear Key key system.</summary> -</histogram> - -<histogram name="Media.EME.ClearKey.KeyError" enum="MediaKeyError"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>KeyError event count using the Clear Key key system.</summary> -</histogram> - -<histogram name="Media.EME.ClearKey.TimeTo" units="ms"> - <owner>xhwang@chromium.org</owner> - <summary> - The time it takes to resolve a CDM promise for Clear Key key system. - </summary> + <summary>The time it takes to create the CDM instance.</summary> </histogram> <histogram name="Media.EME.EncryptedEvent" enum="BooleanEncryptedEvent"> @@ -33940,6 +33943,15 @@ </summary> </histogram> +<histogram base="true" name="Media.EME.generateKeyRequest" + enum="MediaKeyException"> + <obsolete> + Deprecated 02/2016 with removal of prefixed EME. + </obsolete> + <owner>xhwang@chromium.org</owner> + <summary>generateKeyRequest result.</summary> +</histogram> + <histogram name="Media.EME.IsIncognito" enum="BooleanIncognito"> <owner>xhwang@chromium.org</owner> <summary> @@ -33949,6 +33961,27 @@ </summary> </histogram> +<histogram base="true" name="Media.EME.KeyAdded"> + <obsolete> + Deprecated 02/2016 with removal of prefixed EME. + </obsolete> + <owner>xhwang@chromium.org</owner> + <summary>KeyAdded event count.</summary> +</histogram> + +<histogram base="true" name="Media.EME.KeyError" enum="MediaKeyError"> + <obsolete> + Deprecated 02/2016 with removal of prefixed EME. + </obsolete> + <owner>xhwang@chromium.org</owner> + <summary>KeyError event count.</summary> +</histogram> + +<histogram base="true" name="Media.EME.KeyStatusSystemCode" units="system code"> + <owner>media-dev@chromium.org</owner> + <summary>System code count associated with key status.</summary> +</histogram> + <histogram name="Media.EME.KeySystemSupport.Widevine" enum="MediaKeySystemSupportStatus"> <obsolete> @@ -33998,166 +34031,14 @@ </summary> </histogram> -<histogram name="Media.EME.Unknown" enum="CdmPromiseResult"> - <owner>sandersd@chromium.org</owner> - <summary> - Result of promises for unknown key systems that were handled by Chromium - code. - </summary> -</histogram> - -<histogram name="Media.EME.Unknown.addKey" enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> +<histogram base="true" name="Media.EME.SystemCode" units="system code"> <owner>xhwang@chromium.org</owner> - <summary>addKey result using an unknown key system.</summary> + <summary>System code count in promise rejection.</summary> </histogram> -<histogram name="Media.EME.Unknown.cancelKeyRequest" enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> +<histogram base="true" name="Media.EME.TimeTo" units="ms"> <owner>xhwang@chromium.org</owner> - <summary>cancelKeyRequest result using an unknown key system.</summary> -</histogram> - -<histogram name="Media.EME.Unknown.CreateCdm" enum="BooleanSuccess"> - <owner>xhwang@chromium.org</owner> - <summary> - Whether the CDM instance for an unknown key system is created successfully. - Reported each time a CDM instance creation is attempted, usually as a result - of Javascript call of createMediaKeys(). - </summary> -</histogram> - -<histogram name="Media.EME.Unknown.CreateCdmTime" units="ms"> - <owner>xhwang@chromium.org</owner> - <summary> - The time it takes to create the CDM instance for an unknown key system. - </summary> -</histogram> - -<histogram name="Media.EME.Unknown.generateKeyRequest" enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>generateKeyRequest result using an unknown key system.</summary> -</histogram> - -<histogram name="Media.EME.Unknown.KeyAdded"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>KeyAdded event count using an unknown key system.</summary> -</histogram> - -<histogram name="Media.EME.Unknown.KeyError" enum="MediaKeyError"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>KeyError event count using an unknown key system.</summary> -</histogram> - -<histogram name="Media.EME.Unknown.SystemCode" units="system code"> - <owner>xhwang@chromium.org</owner> - <summary>System code count using an unknown key system.</summary> -</histogram> - -<histogram name="Media.EME.Unknown.TimeTo" units="ms"> - <owner>xhwang@chromium.org</owner> - <summary> - The time it takes to resolve a CDM promise for an unknown key system. - </summary> -</histogram> - -<histogram name="Media.EME.Widevine" enum="CdmPromiseResult"> - <owner>sandersd@chromium.org</owner> - <summary> - Result of promises for Widevine key systems that were handled by Chromium - code. - </summary> -</histogram> - -<histogram name="Media.EME.Widevine.addKey" enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>addKey result using the Widevine key system.</summary> -</histogram> - -<histogram name="Media.EME.Widevine.cancelKeyRequest" enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>cancelKeyRequest result using the Widevine key system.</summary> -</histogram> - -<histogram name="Media.EME.Widevine.CreateCdm" enum="BooleanSuccess"> - <owner>xhwang@chromium.org</owner> - <summary> - Whether the CDM instance for Widevine key system is created successfully. - Reported each time a CDM instance creation is attempted, usually as a result - of Javascript call of createMediaKeys(). - </summary> -</histogram> - -<histogram name="Media.EME.Widevine.CreateCdmTime" units="ms"> - <owner>xhwang@chromium.org</owner> - <summary> - The time it takes to create the CDM instance for the Widevine key system. - </summary> -</histogram> - -<histogram name="Media.EME.Widevine.generateKeyRequest" - enum="MediaKeyException"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>generateKeyRequest result using the Widevine key system.</summary> -</histogram> - -<histogram name="Media.EME.Widevine.KeyAdded"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>KeyAdded event count using the Widevine key system.</summary> -</histogram> - -<histogram name="Media.EME.Widevine.KeyError" enum="MediaKeyError"> - <obsolete> - Deprecated 02/2016 with removal of prefixed EME. - </obsolete> - <owner>xhwang@chromium.org</owner> - <summary>KeyError event count using the Widevine key system.</summary> -</histogram> - -<histogram name="Media.EME.Widevine.KeyStatusSystemCode" units="system code"> - <owner>media-dev@chromium.org</owner> - <summary> - System code count associated with key status using the Widevine key system. - </summary> -</histogram> - -<histogram name="Media.EME.Widevine.SystemCode" units="system code"> - <owner>xhwang@chromium.org</owner> - <summary> - System code count in promise rejection using the Widevine key system. - </summary> -</histogram> - -<histogram name="Media.EME.Widevine.TimeTo" units="ms"> - <owner>xhwang@chromium.org</owner> - <summary> - The time it takes to resolve a CDM promise for the Widevine key system. - </summary> + <summary>The time it takes to resolve a EME promise.</summary> </histogram> <histogram name="Media.EME.Widevine.VideoCapability.HasEmptyRobustness" @@ -34652,6 +34533,14 @@ </summary> </histogram> +<histogram name="Media.MSE.DemuxerDestructionTime" units="ms"> + <owner>wolenetz@chromium.org</owner> + <summary> + Amount of time taken to destroy one ChunkDemuxer object, not including + initial background task scheduling delay. + </summary> +</histogram> + <histogram name="Media.MSE.DetectedTrackCount.Audio"> <owner>wolenetz@chromium.org</owner> <summary> @@ -43830,24 +43719,36 @@ <histogram name="Net.HttpStreamFactoryJob.Alt.NextState" enum="HttpStreamFactoryJobState"> + <obsolete> + Deprecated as of 1/2018. + </obsolete> <owner>xunjieli@chromium.org</owner> <summary>Reports the next state that the Alternative Job is in.</summary> </histogram> <histogram name="Net.HttpStreamFactoryJob.Alt.State" enum="HttpStreamFactoryJobState"> + <obsolete> + Deprecated as of 1/2018. + </obsolete> <owner>xunjieli@chromium.org</owner> <summary>Reports the state that the Alternative Job is in.</summary> </histogram> <histogram name="Net.HttpStreamFactoryJob.Main.NextState" enum="HttpStreamFactoryJobState"> + <obsolete> + Deprecated as of 1/2018. + </obsolete> <owner>xunjieli@chromium.org</owner> <summary>Reports the next state that the Main Job is in.</summary> </histogram> <histogram name="Net.HttpStreamFactoryJob.Main.State" enum="HttpStreamFactoryJobState"> + <obsolete> + Deprecated as of 1/2018. + </obsolete> <owner>xunjieli@chromium.org</owner> <summary>Reports the state that the Main Job is in.</summary> </histogram> @@ -81331,6 +81232,14 @@ </summary> </histogram> +<histogram base="true" name="SimpleCache.DiskDoomLatency" units="ms"> + <owner>morlovich@chromium.org</owner> + <summary> + The time to remove the cache entry on disk. Includes only individually + doomed entries, not entries bulk-erased during eviction. + </summary> +</histogram> + <histogram base="true" name="SimpleCache.DiskOpenLatency" units="ms"> <owner>rdsmith@chromium.org</owner> <summary> @@ -94459,6 +94368,8 @@ <histogram name="VR.Component.Assets.DurationUntilReady.OnChromeStart" units="ms"> +<!-- Histogram will be deprecated. See crbug/799074. --> + <owner>tiborg@chromium.org</owner> <summary> Duration from starting Chrome until VR assets component is ready to use. @@ -94474,6 +94385,14 @@ </summary> </histogram> +<histogram name="VR.Component.Assets.DurationUntilReady.OnRegisterComponent" + units="ms"> + <owner>tiborg@chromium.org</owner> + <summary> + Duration from registering VR assets component until it is ready to use. + </summary> +</histogram> + <histogram base="true" name="VR.Component.Assets.Status.OnEnter" enum="VRComponentStatus"> <owner>tiborg@chromium.org</owner> @@ -100848,6 +100767,7 @@ <affected-histogram name="SimpleCache.CreationToIndexFail"/> <affected-histogram name="SimpleCache.DiskCloseLatency"/> <affected-histogram name="SimpleCache.DiskCreateLatency"/> + <affected-histogram name="SimpleCache.DiskDoomLatency"/> <affected-histogram name="SimpleCache.DiskOpenLatency"/> <affected-histogram name="SimpleCache.DiskWriteLatency"/> <affected-histogram name="SimpleCache.EntryCreatedAndStream2Omitted"/> @@ -103727,6 +103647,29 @@ <affected-histogram name="JSDialogs.CharacterCount"/> </histogram_suffixes> +<histogram_suffixes name="KeySystemPrefix" separator="." ordering="prefix,2"> + <suffix name="ClearKey" label="Clear Key key system"/> + <suffix name="Unknown" label="Unknown key system"/> + <suffix name="Widevine" label="Widevine key system"/> + <affected-histogram name="Media.EME.addKey"/> + <affected-histogram name="Media.EME.cancelKeyRequest"/> + <affected-histogram name="Media.EME.CreateCdm"/> + <affected-histogram name="Media.EME.CreateCdmTime"/> + <affected-histogram name="Media.EME.generateKeyRequest"/> + <affected-histogram name="Media.EME.KeyAdded"/> + <affected-histogram name="Media.EME.KeyError"/> + <affected-histogram name="Media.EME.KeyStatusSystemCode"/> + <affected-histogram name="Media.EME.SystemCode"/> + <affected-histogram name="Media.EME.TimeTo"/> +</histogram_suffixes> + +<histogram_suffixes name="KeySystemSuffix" separator="."> + <suffix name="ClearKey" label="Clear Key key system"/> + <suffix name="Unknown" label="Unknown key system"/> + <suffix name="Widevine" label="Widevine key system"/> + <affected-histogram name="Media.EME"/> +</histogram_suffixes> + <histogram_suffixes name="LateBindingExperiment" separator="_"> <suffix name="disable_late_binding" label="socket late binding is disabled"/> <suffix name="enable_late_binding" label="socket late binding is enabled"/> @@ -106647,6 +106590,12 @@ <affected-histogram name="OfflinePages.Prefetching.ActionRetryAttempts"/> </histogram_suffixes> +<histogram_suffixes name="OffTheRecordType" separator="."> + <suffix name="OTR" label="Off-the-record profile"/> + <suffix name="NonOTR" label="Non off-the-record profile"/> + <affected-histogram name="Tab.TabUnderAction"/> +</histogram_suffixes> + <histogram_suffixes name="OmniboxPageContext" separator="."> <suffix name="INVALID_SPEC" label="invalid spec; shouldn't happen"/> <suffix name="NTP"
diff --git a/tools/metrics/histograms/print_histogram_names.py b/tools/metrics/histograms/print_histogram_names.py new file mode 100755 index 0000000..9c93500 --- /dev/null +++ b/tools/metrics/histograms/print_histogram_names.py
@@ -0,0 +1,29 @@ +#!/usr/bin/env python +# Copyright 2018 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. + +"""Prints all histogram names.""" + +import os +import sys + +sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common')) +import path_util + +import extract_histograms +import histogram_paths +import merge_xml + +def main(): + doc = merge_xml.MergeFiles(histogram_paths.ALL_XMLS) + histograms, had_errors = extract_histograms.ExtractHistogramsFromDom(doc) + if had_errors: + raise Error("Error parsing inputs.") + names = extract_histograms.ExtractNames(histograms) + for name in names: + print name + +if __name__ == '__main__': + main() +
diff --git a/tools/metrics/ukm/ukm.xml b/tools/metrics/ukm/ukm.xml index 907d53f..71e3701d 100644 --- a/tools/metrics/ukm/ukm.xml +++ b/tools/metrics/ukm/ukm.xml
@@ -1741,6 +1741,38 @@ </summary> </event> +<event name="SiteIsolation.XSD.Browser.Blocked"> + <owner>creis@chromium.org</owner> + <owner>chrome-site-isolation@google.com</owner> + <summary> + Resource request response was blocked by the cross-site document blocking + logic in the browser process. + </summary> + <metric name="CanonicalMimeType"> + <summary> + Classification of the Content-Type HTTP response header into one of the + blockable document flavours: html, xml, json, plain. + </summary> + </metric> + <metric name="ContentResourceType"> + <summary> + content::ResourceType of the blocked resource (e.g. image / script / xhr / + etc.). + </summary> + </metric> + <metric name="HttpResponseCode"> + <summary> + The HTTP response code (e.g. 200 or 404) associated with the blocked + resource request. + </summary> + </metric> + <metric name="NeededSniffing"> + <summary> + Whether the HTTP response needed sniffing to confirm its MIME type. + </summary> + </metric> +</event> + <event name="SubresourceFilter" singular="True"> <owner>bmcquade@chromium.org</owner> <owner>csharrison@chromium.org</owner>
diff --git a/tools/perf/OWNERS b/tools/perf/OWNERS index 4620ea0..e89141fb 100644 --- a/tools/perf/OWNERS +++ b/tools/perf/OWNERS
@@ -2,9 +2,6 @@ nednguyen@google.com sullivan@chromium.org -# For test disabling changes. -rnephew@chromium.org - # For changes related to ChromeOS. achuith@chromium.org
diff --git a/tools/perf/benchmarks/system_health_smoke_test.py b/tools/perf/benchmarks/system_health_smoke_test.py index f98defe..b76334d 100644 --- a/tools/perf/benchmarks/system_health_smoke_test.py +++ b/tools/perf/benchmarks/system_health_smoke_test.py
@@ -67,6 +67,9 @@ # crbug.com/725386 'benchmarks.system_health_smoke_test.SystemHealthBenchmarkSmokeTest.system_health.memory_desktop.browse:social:twitter', # pylint: disable=line-too-long + + # crbug.com/799734 + 'benchmarks.system_health_smoke_test.SystemHealthBenchmarkSmokeTest.system_health.memory_desktop.browse:media:tumblr', # pylint: disable=line-too-long })
diff --git a/tools/perf/contrib/leak_detection/page_sets.py b/tools/perf/contrib/leak_detection/page_sets.py index f5d8e43d..bf42fe1 100644 --- a/tools/perf/contrib/leak_detection/page_sets.py +++ b/tools/perf/contrib/leak_detection/page_sets.py
@@ -35,7 +35,9 @@ 'https://www.facebook.com', 'https://www.baidu.com', 'https://www.wikipedia.org', - 'https://www.yahoo.com', + # TODO(yuzus) Disabling yahoo & quora for the moment because they time + # out on a trybot. + # 'https://www.yahoo.com'. 'https://www.reddit.com', 'http://www.qq.com', 'http://www.amazon.com', @@ -46,7 +48,7 @@ 'http://www.time.com', 'http://infomoney.com.br', 'http://www.cheapoair.com', - 'http://www.quora.com', + # 'http://www.quora.com', 'http://www.onlinedown.net', 'http://www.dailypost.ng', 'http://www.listindiario.com',
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index 570bfd9..71947ef9 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -25,11 +25,16 @@ crbug.com/784540 [ Nexus_5X ] blink_perf.canvas/draw-dynamic-canvas-2d-to-hw-accelerated-canvas-2d.html [ Skip ] crbug.com/738453 [ Nexus_6 ] blink_perf.canvas/putImageData.html [ Skip ] +# Benchmark: blink_perf.events +crbug.com/799184 [ Cherry_Mobile_Android_One ] blink_perf.events/EventsDispatchingInShadowTrees.html [ Skip ] + # Benchmark: blink_perf.layout crbug.com/551950 [ Android_Svelte ] blink_perf.layout/* [ Skip ] # Benchmark: blink_perf.paint crbug.com/574483 [ Android_Svelte ] blink_perf.paint/* [ Skip ] +crbug.com/799540 [ Nexus_5 ] blink_perf.paint/* [ Skip ] +crbug.com/799540 [ Nexus_7 ] blink_perf.paint/* [ Skip ] # Benchmark: blink_perf.parser crbug.com/796115 [ Cherry_Mobile_Android_One ] blink_perf.parser/html5-full-render.html [ Skip ] @@ -180,6 +185,8 @@ crbug.com/769809 [ All ] system_health.common_desktop/browse_accessibility:tools:gmail_compose [ Skip ] crbug.com/673775 [ Win ] system_health.common_desktop/browse:search:google [ Skip ] crbug.com/773393 [ Win ] system_health.common_desktop/browse:media:tumblr [ Skip ] +crbug.com/799106 [ Win ] system_health.common_desktop/browse:media:flickr_infinite_scroll [ Skip ] +crbug.com/799122 [ Mac ] system_health.common_desktop/load:media:youtube [ Skip ] # Benchmark: system_health.common_mobile [ Android_Webview ] system_health.common_mobile/browse:chrome:omnibox [ Skip ] @@ -196,6 +203,7 @@ crbug.com/797261 [ Android_Webview ] system_health.common_mobile/load:games:spychase [ Skip ] crbug.com/798536 [ Android ] system_health.common_mobile/background:news:nytimes [ Skip ] crbug.com/798536 [ Android ] system_health.common_mobile/load:games:spychase [ Skip ] +crbug.com/736147 [ Cherry_Mobile_Android_One ] system_health.common_mobile/browse:social:tumblr_infinite_scroll [ Skip ] # Benchmark: system_health.memory_desktop crbug.com/728576 [ Mac ] system_health.memory_desktop/browse:news:cnn [ Skip ] @@ -210,6 +218,7 @@ crbug.com/673775 [ Win ] system_health.memory_desktop/browse:search:google [ Skip ] crbug.com/664661 [ Mac ] system_health.memory_desktop/load:games:miniclip [ Skip ] crbug.com/728464 [ Win ] system_health.memory_desktop/browse:social:twitter_infinite_scroll [ Skip ] +crbug.com/799106 [ Win ] system_health.memory_desktop/browse:media:flickr_infinite_scroll [ Skip ] # Benchmark: system_health.memory_mobile crbug.com/787001 [ Android_Webview ] system_health.memory_mobile/load:media:soundcloud [ Skip ] @@ -286,9 +295,11 @@ crbug.com/767970 [ Mobile ] v8.browsing_mobile/browse:shopping:flipkart [ Skip ] crbug.com/708300 [ Mobile ] v8.browsing_mobile/browse:shopping:flipkart [ Skip ] [ Android_Webview ] v8.browsing_mobile/browse:chrome:newtab [ Skip ] +crbug.com/799080 [ Nexus_7 ] v8.browsing_mobile-future/browse:news:cnn [ Skip ] # Benchmark: v8.browsing_mobile-future -crbug.com/788797 [ Cherry_Mobile_Android_One ] v8.browsing_mobile/* [ Skip ] +crbug.com/788797 [ Cherry_Mobile_Android_One ] v8.browsing_mobile-future/browse:social:facebook_infinite_scroll [ Skip ] +crbug.com/788797 [ Cherry_Mobile_Android_One ] v8.browsing_mobile-future/browse:social:pinterest_infinite_scroll [ Skip ] crbug.com/768472 [ Cherry_Mobile_Android_One ] v8.browsing_mobile-future/browse:shopping:lazada [ Skip ] crbug.com/714650 [ Android ] v8.browsing_mobile-future/browse:news:globo [ Skip ] crbug.com/767970 [ Cherry_Mobile_Android_One ] v8.browsing_mobile-future/browse:tech:discourse_infinite_scroll [ Skip ] @@ -299,6 +310,11 @@ crbug.com/767970 [ Mobile ] v8.browsing_mobile-future/browse:shopping:flipkart [ Skip ] crbug.com/708300 [ Mobile ] v8.browsing_mobile-future/browse:shopping:flipkart [ Skip ] [ Android_Webview ] v8.browsing_mobile-future/browse:chrome:newtab [ Skip ] +crbug.com/799080 [ Nexus_5 ] v8.browsing_mobile-future/browse:social:tumblr_infinite_scroll [ Skip ] +crbug.com/799080 [ Nexus_5X Android_Webview ] v8.browsing_mobile-future/browse:social:facebook [ Skip ] +crbug.com/799080 [ Nexus_7 ] v8.browsing_mobile-future/browse:news:cnn [ Skip ] +crbug.com/799080 [ Nexus_7 ] v8.browsing_mobile-future/browse:shopping:avito [ Skip ] +crbug.com/799080 [ Nexus_7 ] v8.browsing_mobile-future/browse:social:pinterest_infinite_scroll [ Skip ] # Benchmark: v8.detached_context_age_in_gc crbug.com/770982 [ Win ] v8.detached_context_age_in_gc/Docs_(1_open_document_tab) [ Skip ] @@ -309,6 +325,7 @@ # Benchmark: wasm [ Android ] wasm/WasmTanks [ Skip ] +[ Cherry_Mobile_Android_One ] wasm/WasmSpaceBuggy [ Skip ] ##### Perf FYI benchmarks go after here ##### # Benchmark: loading.desktop.network_service
diff --git a/tools/traffic_annotation/README.md b/tools/traffic_annotation/README.md index 48ae6e7..f7ce4f6 100644 --- a/tools/traffic_annotation/README.md +++ b/tools/traffic_annotation/README.md
@@ -96,5 +96,5 @@ and cc the people listed in OWNERS; they'll be on the hook to rebuild and re-enable the test. -CLANG_REVISION = '317263' -LASTCHANGE=9bbd081d6401276e8173cf0e33b9f93cba1c1b01-refs/heads/master@{#517774} +CLANG_REVISION = '318667' +LASTCHANGE=d182c05f302ad2e7dddca9dba88a453913a3a8c6-refs/heads/master@{#525631}
diff --git a/tools/traffic_annotation/bin/linux64/traffic_annotation_auditor.sha1 b/tools/traffic_annotation/bin/linux64/traffic_annotation_auditor.sha1 index a2ccbd7..8489ab7 100644 --- a/tools/traffic_annotation/bin/linux64/traffic_annotation_auditor.sha1 +++ b/tools/traffic_annotation/bin/linux64/traffic_annotation_auditor.sha1
@@ -1 +1 @@ -72ab0535dfab803324e56f2942a6695f1c1cae70 \ No newline at end of file +d301c9e7449eea6cb1d347d0cdef599515fea344 \ No newline at end of file
diff --git a/tools/traffic_annotation/scripts/check_annotations.py b/tools/traffic_annotation/scripts/check_annotations.py index 9b2d042..9c93fca 100755 --- a/tools/traffic_annotation/scripts/check_annotations.py +++ b/tools/traffic_annotation/scripts/check_annotations.py
@@ -17,12 +17,8 @@ # If this test starts failing, please set TEST_IS_ENABLED to "False" and file a # bug to get this reenabled, and cc the people listed in # //tools/traffic_annotation/OWNERS. +TEST_IS_ENABLED = sys.platform != 'win32' -# TODO(crbug.com/788035) - this test currently takes up to 20 minutes to -# execute even on linux_chromium_rel_ng; we need to figure out how to make -# it be much faster before enabling it anywhere in the CQ. -# TEST_IS_ENABLED = sys.platform != 'win32' -TEST_IS_ENABLED = False class NetworkTrafficAnnotationChecker():
diff --git a/tools/v8_context_snapshot/v8_context_snapshot_generator.cc b/tools/v8_context_snapshot/v8_context_snapshot_generator.cc index d4ae219..6a969a0d 100644 --- a/tools/v8_context_snapshot/v8_context_snapshot_generator.cc +++ b/tools/v8_context_snapshot/v8_context_snapshot_generator.cc
@@ -7,6 +7,7 @@ #include "base/files/file_util.h" #include "base/message_loop/message_loop.h" #include "base/task_scheduler/task_scheduler.h" +#include "base/threading/thread_task_runner_handle.h" #include "gin/v8_initializer.h" #include "mojo/edk/embedder/embedder.h" #include "services/service_manager/public/cpp/binder_registry.h" @@ -22,6 +23,10 @@ bool IsCurrentThread() const override { return true; } blink::WebScheduler* Scheduler() const override { return nullptr; } blink::WebTaskRunner* GetWebTaskRunner() const override { return nullptr; } + scoped_refptr<base::SingleThreadTaskRunner> GetSingleThreadTaskRunner() + const override { + return base::ThreadTaskRunnerHandle::Get(); + } }; class SnapshotPlatform final : public blink::Platform {
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn index c52b603..d79dff1 100644 --- a/ui/android/BUILD.gn +++ b/ui/android/BUILD.gn
@@ -65,6 +65,7 @@ "//skia", "//third_party/WebKit/public:blink_headers", "//ui/base", + "//ui/compositor", "//ui/display", "//ui/events", "//ui/events/devices",
diff --git a/ui/android/DEPS b/ui/android/DEPS index 6c151a2..6f43de6 100644 --- a/ui/android/DEPS +++ b/ui/android/DEPS
@@ -16,6 +16,7 @@ "+third_party/WebKit/public/platform/WebCursorInfo.h", "+third_party/skia", "+ui/base", + "+ui/compositor/compositor_lock.h", "+ui/display", "+ui/events", "+ui/gfx",
diff --git a/ui/android/delegated_frame_host_android.cc b/ui/android/delegated_frame_host_android.cc index 0442c2ae..ee981db 100644 --- a/ui/android/delegated_frame_host_android.cc +++ b/ui/android/delegated_frame_host_android.cc
@@ -104,6 +104,10 @@ } else { support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); } + + if (compositor_attach_until_frame_lock_) { + compositor_attach_until_frame_lock_.reset(); + } } void DelegatedFrameHostAndroid::DidNotProduceFrame( @@ -166,6 +170,12 @@ WindowAndroidCompositor* compositor) { if (registered_parent_compositor_) DetachFromCompositor(); + // Take the compositor lock, preventing frames from being displayed until + // we've produced content. Set a 5 second timeout to prevent locking up the + // browser in cases where the renderer hangs or another factor prevents a + // frame from being produced. + compositor_attach_until_frame_lock_ = + compositor->GetCompositorLock(this, base::TimeDelta::FromSeconds(5)); compositor->AddChildFrameSink(frame_sink_id_); client_->SetBeginFrameSource(&begin_frame_source_); registered_parent_compositor_ = compositor; @@ -174,6 +184,8 @@ void DelegatedFrameHostAndroid::DetachFromCompositor() { if (!registered_parent_compositor_) return; + if (compositor_attach_until_frame_lock_) + compositor_attach_until_frame_lock_.reset(); client_->SetBeginFrameSource(nullptr); support_->SetNeedsBeginFrame(false); registered_parent_compositor_->RemoveChildFrameSink(frame_sink_id_); @@ -222,6 +234,8 @@ client_->OnFrameTokenChanged(frame_token); } +void DelegatedFrameHostAndroid::CompositorLockTimedOut() {} + void DelegatedFrameHostAndroid::CreateNewCompositorFrameSinkSupport() { constexpr bool is_root = false; constexpr bool needs_sync_points = true;
diff --git a/ui/android/delegated_frame_host_android.h b/ui/android/delegated_frame_host_android.h index 3c020914..4b963dde 100644 --- a/ui/android/delegated_frame_host_android.h +++ b/ui/android/delegated_frame_host_android.h
@@ -14,6 +14,7 @@ #include "components/viz/service/frame_sinks/compositor_frame_sink_support.h" #include "services/viz/public/interfaces/compositing/compositor_frame_sink.mojom.h" #include "ui/android/ui_android_export.h" +#include "ui/compositor/compositor_lock.h" namespace cc { class SurfaceLayer; @@ -33,7 +34,8 @@ class UI_ANDROID_EXPORT DelegatedFrameHostAndroid : public viz::mojom::CompositorFrameSinkClient, public viz::ExternalBeginFrameSourceClient, - public viz::HostFrameSinkClient { + public viz::HostFrameSinkClient, + public ui::CompositorLockClient { public: class Client { public: @@ -102,6 +104,9 @@ void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override; void OnFrameTokenChanged(uint32_t frame_token) override; + // ui::CompositorLockClient implementation. + void CompositorLockTimedOut() override; + void CreateNewCompositorFrameSinkSupport(); const viz::FrameSinkId frame_sink_id_; @@ -121,6 +126,11 @@ scoped_refptr<cc::SurfaceLayer> content_layer_; + // A lock that is held from the point at which we attach to the compositor to + // the point at which we submit our first frame to the compositor. This + // ensures that the compositor doesn't swap without a frame available. + std::unique_ptr<ui::CompositorLock> compositor_attach_until_frame_lock_; + DISALLOW_COPY_AND_ASSIGN(DelegatedFrameHostAndroid); };
diff --git a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java index 9c538a8..fb4e107 100644 --- a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java +++ b/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java
@@ -23,15 +23,12 @@ public static final int MINIMUM_TABLET_WIDTH_DP = 600; /** - * @return Whether the app should treat the device as a tablet for layout. This method is not - * affected by Android N multi-window. + * @return Whether the app should currently treat the device as a tablet for layout. This method + * is not affected by Android N multi-window, but can change for external displays. + * E.g. http://developer.samsung.com/samsung-dex/testing */ @CalledByNative public static boolean isTablet() { - // On some devices, OEM modifications have been made to the resource loader that cause the - // DeviceFormFactor calculation of whether a device is using tablet resources to be - // incorrect. Check which resources were actually loaded rather than look at screen size. - // See crbug.com/662338. return ContextUtils.getApplicationContext().getResources().getBoolean(R.bool.is_tablet); }
diff --git a/ui/android/window_android_compositor.h b/ui/android/window_android_compositor.h index 2f4a328..6e0e3bd4 100644 --- a/ui/android/window_android_compositor.h +++ b/ui/android/window_android_compositor.h
@@ -10,6 +10,7 @@ #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/surfaces/frame_sink_id.h" #include "ui/android/ui_android_export.h" +#include "ui/compositor/compositor_lock.h" namespace cc { class Layer; @@ -22,8 +23,6 @@ // Android interface for compositor-related tasks. class UI_ANDROID_EXPORT WindowAndroidCompositor { public: - virtual ~WindowAndroidCompositor() {} - virtual void AttachLayerForReadback(scoped_refptr<cc::Layer> layer) = 0; virtual void RequestCopyOfOutputOnRootLayer( std::unique_ptr<viz::CopyOutputRequest> request) = 0; @@ -32,6 +31,9 @@ virtual viz::FrameSinkId GetFrameSinkId() = 0; virtual void AddChildFrameSink(const viz::FrameSinkId& frame_sink_id) = 0; virtual void RemoveChildFrameSink(const viz::FrameSinkId& frame_sink_id) = 0; + virtual std::unique_ptr<CompositorLock> GetCompositorLock( + CompositorLockClient* client, + base::TimeDelta timeout) = 0; }; } // namespace ui
diff --git a/ui/aura/local/window_port_local.cc b/ui/aura/local/window_port_local.cc index d19d879..c9b3213 100644 --- a/ui/aura/local/window_port_local.cc +++ b/ui/aura/local/window_port_local.cc
@@ -177,8 +177,9 @@ ->GetFrameSinkManager() ->surface_manager() ->reference_factory(); - window_->layer()->SetShowPrimarySurface( - surface_info.id(), window_->bounds().size(), reference_factory); + window_->layer()->SetShowPrimarySurface(surface_info.id(), + window_->bounds().size(), + SK_ColorWHITE, reference_factory); window_->layer()->SetFallbackSurfaceId(surface_info.id()); }
diff --git a/ui/aura/mus/client_surface_embedder.cc b/ui/aura/mus/client_surface_embedder.cc index 3ae556f..17029d2 100644 --- a/ui/aura/mus/client_surface_embedder.cc +++ b/ui/aura/mus/client_surface_embedder.cc
@@ -38,7 +38,7 @@ void ClientSurfaceEmbedder::SetPrimarySurfaceId( const viz::SurfaceId& surface_id) { surface_layer_->SetShowPrimarySurface(surface_id, window_->bounds().size(), - ref_factory_); + SK_ColorWHITE, ref_factory_); } void ClientSurfaceEmbedder::SetFallbackSurfaceInfo(
diff --git a/ui/aura/mus/mus_context_factory.cc b/ui/aura/mus/mus_context_factory.cc index 6175d8d4..f95b744e 100644 --- a/ui/aura/mus/mus_context_factory.cc +++ b/ui/aura/mus/mus_context_factory.cc
@@ -8,7 +8,6 @@ #include "base/memory/ptr_util.h" #include "cc/base/switches.h" #include "components/viz/common/gpu/context_provider.h" -#include "components/viz/common/resources/buffer_to_texture_target_map.h" #include "components/viz/host/renderer_settings_creation.h" #include "services/ui/public/cpp/gpu/gpu.h" #include "ui/aura/mus/window_port_mus.h" @@ -24,7 +23,7 @@ : gpu_(gpu), resource_settings_( // TODO(sad): http://crbug.com/675431 - viz::CreateResourceSettings(viz::BufferUsageAndFormatList())), + viz::CreateResourceSettings()), weak_ptr_factory_(this) {} MusContextFactory::~MusContextFactory() {}
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc index fcc808f4..5b4bcab 100644 --- a/ui/aura/mus/window_port_mus.cc +++ b/ui/aura/mus/window_port_mus.cc
@@ -670,8 +670,9 @@ ->GetFrameSinkManager() ->surface_manager() ->reference_factory(); - window_->layer()->SetShowPrimarySurface( - surface_info.id(), window_->bounds().size(), reference_factory); + window_->layer()->SetShowPrimarySurface(surface_info.id(), + window_->bounds().size(), + SK_ColorWHITE, reference_factory); window_->layer()->SetFallbackSurfaceId(surface_info.id()); }
diff --git a/ui/base/cocoa/a11y_util.h b/ui/base/cocoa/a11y_util.h index df0e5bb4..a304b77c 100644 --- a/ui/base/cocoa/a11y_util.h +++ b/ui/base/cocoa/a11y_util.h
@@ -17,6 +17,11 @@ // voice over (i.e., an icon next to a written description of the icon). UI_BASE_EXPORT void HideImageFromAccessibilityOrder(NSImageView* view); +// Ask VoiceOver to play a sound for |object|, generally a view or window +// (undocumented). Built-in apps seem to use this to indicate that something +// interesting has happened, like a failed download or available completions. +UI_BASE_EXPORT void PlayElementUpdatedSound(id source); + } // namespace a11y_util } // namespace ui
diff --git a/ui/base/cocoa/a11y_util.mm b/ui/base/cocoa/a11y_util.mm index 37098eb6..e6a27ad2 100644 --- a/ui/base/cocoa/a11y_util.mm +++ b/ui/base/cocoa/a11y_util.mm
@@ -15,5 +15,11 @@ forAttribute:NSAccessibilityRoleAttribute]; } +void PlayElementUpdatedSound(id source) { + NSAccessibilityPostNotificationWithUserInfo( + source, @"AXPlaySound", + @{@"AXSoundIdentifier" : @"AXElementUpdatedSound"}); +} + } // namespace a11y_util } // namespace ui
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc index aca89a5..b36db25 100644 --- a/ui/compositor/layer.cc +++ b/ui/compositor/layer.cc
@@ -189,6 +189,7 @@ if (surface_layer_->primary_surface_id().is_valid()) { clone->SetShowPrimarySurface(surface_layer_->primary_surface_id(), frame_size_in_dip_, + surface_layer_->background_color(), surface_layer_->surface_reference_factory()); } if (surface_layer_->fallback_surface_id().is_valid()) @@ -748,6 +749,7 @@ void Layer::SetShowPrimarySurface( const viz::SurfaceId& surface_id, const gfx::Size& frame_size_in_dip, + SkColor default_background_color, scoped_refptr<viz::SurfaceReferenceFactory> ref_factory) { DCHECK(type_ == LAYER_TEXTURED || type_ == LAYER_SOLID_COLOR); @@ -759,13 +761,15 @@ } surface_layer_->SetPrimarySurfaceId(surface_id); + surface_layer_->SetBackgroundColor(default_background_color); frame_size_in_dip_ = frame_size_in_dip; RecomputeDrawsContentAndUVRect(); - for (const auto& mirror : mirrors_) - mirror->dest()->SetShowPrimarySurface(surface_id, frame_size_in_dip, - ref_factory); + for (const auto& mirror : mirrors_) { + mirror->dest()->SetShowPrimarySurface( + surface_id, frame_size_in_dip, default_background_color, ref_factory); + } } void Layer::SetFallbackSurfaceId(const viz::SurfaceId& surface_id) {
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h index 6e5ff80..736c4d5 100644 --- a/ui/compositor/layer.h +++ b/ui/compositor/layer.h
@@ -307,6 +307,7 @@ void SetShowPrimarySurface( const viz::SurfaceId& surface_id, const gfx::Size& frame_size_in_dip, + SkColor default_background_color, scoped_refptr<viz::SurfaceReferenceFactory> surface_ref); // In the event that the primary surface is not yet available in the
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc index 4cb04dbd..b275e39 100644 --- a/ui/compositor/layer_unittest.cc +++ b/ui/compositor/layer_unittest.cc
@@ -1864,6 +1864,7 @@ // Showing surface content changes the underlying cc layer. before = child->cc_layer_for_testing(); child->SetShowPrimarySurface(viz::SurfaceId(), gfx::Size(10, 10), + SK_ColorWHITE, new TestSurfaceReferenceFactory()); EXPECT_TRUE(child->cc_layer_for_testing()); EXPECT_NE(before.get(), child->cc_layer_for_testing()); @@ -1883,7 +1884,7 @@ viz::SurfaceId surface_id( viz::FrameSinkId(0, 1), viz::LocalSurfaceId(2, base::UnguessableToken::Create())); - layer->SetShowPrimarySurface(surface_id, gfx::Size(10, 10), + layer->SetShowPrimarySurface(surface_id, gfx::Size(10, 10), SK_ColorWHITE, reference_factory); const auto mirror = layer->Mirror(); @@ -1896,12 +1897,12 @@ surface_id = viz::SurfaceId(viz::FrameSinkId(1, 2), viz::LocalSurfaceId(3, base::UnguessableToken::Create())); - layer->SetShowPrimarySurface(surface_id, gfx::Size(20, 20), + layer->SetShowPrimarySurface(surface_id, gfx::Size(20, 20), SK_ColorWHITE, reference_factory); // The mirror should continue to use the same cc_layer. EXPECT_EQ(cc_layer, mirror->cc_layer_for_testing()); - layer->SetShowPrimarySurface(surface_id, gfx::Size(20, 20), + layer->SetShowPrimarySurface(surface_id, gfx::Size(20, 20), SK_ColorWHITE, reference_factory); // Surface updates propagate to the mirror. @@ -1923,6 +1924,7 @@ // Showing surface content changes the underlying cc layer. scoped_refptr<cc::Layer> before = layer->cc_layer_for_testing(); layer->SetShowPrimarySurface(viz::SurfaceId(), gfx::Size(10, 10), + SK_ColorWHITE, new TestSurfaceReferenceFactory()); EXPECT_EQ(layer->layer_grayscale(), 0.5f); EXPECT_TRUE(layer->cc_layer_for_testing());
diff --git a/ui/compositor/test/in_process_context_factory.cc b/ui/compositor/test/in_process_context_factory.cc index 2142bbb2..6a26854 100644 --- a/ui/compositor/test/in_process_context_factory.cc +++ b/ui/compositor/test/in_process_context_factory.cc
@@ -255,9 +255,9 @@ display_output_surface->capabilities().max_frames_pending); data->display = std::make_unique<viz::Display>( - &shared_bitmap_manager_, &gpu_memory_buffer_manager_, renderer_settings_, - compositor->frame_sink_id(), std::move(display_output_surface), - std::move(scheduler), compositor->task_runner()); + &shared_bitmap_manager_, renderer_settings_, compositor->frame_sink_id(), + std::move(display_output_surface), std::move(scheduler), + compositor->task_runner()); GetFrameSinkManager()->RegisterBeginFrameSource(begin_frame_source.get(), compositor->frame_sink_id()); // Note that we are careful not to destroy a prior |data->begin_frame_source|
diff --git a/ui/display/display_switches.cc b/ui/display/display_switches.cc index 35f4bda..c121928 100644 --- a/ui/display/display_switches.cc +++ b/ui/display/display_switches.cc
@@ -10,8 +10,8 @@ // TODO(rjkroege): Some of these have an "ash" prefix. When ChromeOS startup // scripts have been updated, the leading "ash" prefix should be removed. -// Enables mirroring across multiple displays. -const char kEnableMultiMirroring[] = "enable-multi-mirroring"; +// Disables mirroring across multiple displays. +const char kDisableMultiMirroring[] = "disable-multi-mirroring"; // Enables software based mirroring. const char kEnableSoftwareMirroring[] = "ash-enable-software-mirroring";
diff --git a/ui/display/display_switches.h b/ui/display/display_switches.h index 239931c..7d7c5e4 100644 --- a/ui/display/display_switches.h +++ b/ui/display/display_switches.h
@@ -13,7 +13,7 @@ namespace switches { // Keep sorted. -DISPLAY_EXPORT extern const char kEnableMultiMirroring[]; +DISPLAY_EXPORT extern const char kDisableMultiMirroring[]; DISPLAY_EXPORT extern const char kEnableSoftwareMirroring[]; DISPLAY_EXPORT extern const char kEnsureForcedColorProfile[]; DISPLAY_EXPORT extern const char kForceColorProfile[];
diff --git a/ui/display/manager/chromeos/display_configurator.cc b/ui/display/manager/chromeos/display_configurator.cc index 6e4e4f8a..eec4479 100644 --- a/ui/display/manager/chromeos/display_configurator.cc +++ b/ui/display/manager/chromeos/display_configurator.cc
@@ -511,8 +511,8 @@ displays_suspended_(false), layout_manager_(new DisplayLayoutManagerImpl(this)), is_multi_mirroring_enabled_( - base::CommandLine::ForCurrentProcess()->HasSwitch( - ::switches::kEnableMultiMirroring)), + !base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kDisableMultiMirroring)), weak_ptr_factory_(this) {} DisplayConfigurator::~DisplayConfigurator() {
diff --git a/ui/display/manager/display_manager.cc b/ui/display/manager/display_manager.cc index 412c49d..2bf6345 100644 --- a/ui/display/manager/display_manager.cc +++ b/ui/display/manager/display_manager.cc
@@ -304,8 +304,8 @@ : screen_(std::move(screen)), layout_store_(new DisplayLayoutStore), is_multi_mirroring_enabled_( - base::CommandLine::ForCurrentProcess()->HasSwitch( - ::switches::kEnableMultiMirroring)), + !base::CommandLine::ForCurrentProcess()->HasSwitch( + ::switches::kDisableMultiMirroring)), weak_ptr_factory_(this) { #if defined(OS_CHROMEOS) configure_displays_ = chromeos::IsRunningAsSystemCompositor();
diff --git a/ui/events/event_utils.cc b/ui/events/event_utils.cc index 881f1b69..dd0da342 100644 --- a/ui/events/event_utils.cc +++ b/ui/events/event_utils.cc
@@ -130,19 +130,4 @@ } } -void ConvertEventLocationToTargetWindowLocation( - const gfx::Point& target_window_origin, - const gfx::Point& current_window_origin, - ui::LocatedEvent* located_event) { - if (current_window_origin == target_window_origin) - return; - - DCHECK(located_event); - gfx::Vector2d offset = current_window_origin - target_window_origin; - gfx::PointF location_in_pixel_in_host = - located_event->location_f() + gfx::Vector2dF(offset); - located_event->set_location_f(location_in_pixel_in_host); - located_event->set_root_location_f(location_in_pixel_in_host); -} - } // namespace ui
diff --git a/ui/events/event_utils.h b/ui/events/event_utils.h index 5e1d931..f15a2dba 100644 --- a/ui/events/event_utils.h +++ b/ui/events/event_utils.h
@@ -177,14 +177,6 @@ // Registers a custom event type. EVENTS_EXPORT int RegisterCustomEventType(); -// Updates the location of |located_event| from |current_window_origin| to be in -// |target_window_origin|'s coordinate system so that it can be dispatched to a -// window based on |target_window_origin|. -EVENTS_EXPORT void ConvertEventLocationToTargetWindowLocation( - const gfx::Point& target_window_origin, - const gfx::Point& current_window_origin, - ui::LocatedEvent* located_event); - } // namespace ui #endif // UI_EVENTS_EVENT_UTILS_H_
diff --git a/ui/gfx/buffer_format_util.cc b/ui/gfx/buffer_format_util.cc index 996c84e..9c48370 100644 --- a/ui/gfx/buffer_format_util.cc +++ b/ui/gfx/buffer_format_util.cc
@@ -198,8 +198,8 @@ } size_t BufferOffsetForBufferFormat(const Size& size, - BufferFormat format, - size_t plane) { + BufferFormat format, + size_t plane) { DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format)); switch (format) { case BufferFormat::ATC: @@ -237,4 +237,51 @@ return 0; } +const char* BufferFormatToString(BufferFormat format) { + switch (format) { + case BufferFormat::ATC: + return "ATC"; + case BufferFormat::ATCIA: + return "ATCIA"; + case BufferFormat::DXT1: + return "DXT1"; + case BufferFormat::DXT5: + return "DXT5"; + case BufferFormat::ETC1: + return "ETC1"; + case BufferFormat::R_8: + return "R_8"; + case BufferFormat::R_16: + return "R_16"; + case BufferFormat::RG_88: + return "RG_88"; + case BufferFormat::BGR_565: + return "BGR_565"; + case BufferFormat::RGBA_4444: + return "RGBA_4444"; + case BufferFormat::RGBX_8888: + return "RGBX_8888"; + case BufferFormat::RGBA_8888: + return "RGBA_8888"; + case BufferFormat::BGRX_8888: + return "BGRX_8888"; + case BufferFormat::BGRX_1010102: + return "BGRX_1010102"; + case BufferFormat::BGRA_8888: + return "BGRA_8888"; + case BufferFormat::RGBA_F16: + return "RGBA_F16"; + case BufferFormat::YVU_420: + return "YVU_420"; + case BufferFormat::YUV_420_BIPLANAR: + return "YUV_420_BIPLANAR"; + case BufferFormat::UYVY_422: + return "UYVY_422"; + } + NOTREACHED() + << "Invalid BufferFormat: " + << static_cast<typename std::underlying_type<BufferFormat>::type>(format); + return "Invalid Format"; +} + } // namespace gfx
diff --git a/ui/gfx/buffer_format_util.h b/ui/gfx/buffer_format_util.h index 55c91305..49263881 100644 --- a/ui/gfx/buffer_format_util.h +++ b/ui/gfx/buffer_format_util.h
@@ -44,6 +44,9 @@ BufferFormat format, size_t plane); +// Returns the name of |format| as a string. +GFX_EXPORT const char* BufferFormatToString(BufferFormat format); + } // namespace gfx #endif // UI_GFX_BUFFER_FORMAT_UTIL_H_
diff --git a/ui/gfx/buffer_types.h b/ui/gfx/buffer_types.h index 458b9361c..53f4518 100644 --- a/ui/gfx/buffer_types.h +++ b/ui/gfx/buffer_types.h
@@ -5,6 +5,8 @@ #ifndef UI_GFX_BUFFER_TYPES_H_ #define UI_GFX_BUFFER_TYPES_H_ +#include <tuple> + namespace gfx { // The format needs to be taken into account when mapping a buffer into the @@ -58,6 +60,20 @@ LAST = GPU_READ_CPU_READ_WRITE_PERSISTENT }; +struct BufferUsageAndFormat { + BufferUsageAndFormat() + : usage(BufferUsage::GPU_READ), format(BufferFormat::RGBA_8888) {} + BufferUsageAndFormat(BufferUsage usage, BufferFormat format) + : usage(usage), format(format) {} + + bool operator==(const BufferUsageAndFormat& other) const { + return std::tie(usage, format) == std::tie(other.usage, other.format); + } + + BufferUsage usage; + BufferFormat format; +}; + } // namespace gfx #endif // UI_GFX_BUFFER_TYPES_H_
diff --git a/ui/gfx/font.cc b/ui/gfx/font.cc index ac7b749..ad69d623 100644 --- a/ui/gfx/font.cc +++ b/ui/gfx/font.cc
@@ -42,6 +42,9 @@ } Font Font::Derive(int size_delta, int style, Font::Weight weight) const { + if (size_delta == 0 && style == GetStyle() && weight == GetWeight()) + return *this; + return platform_font_->DeriveFont(size_delta, style, weight); }
diff --git a/ui/gfx/harfbuzz_font_skia.cc b/ui/gfx/harfbuzz_font_skia.cc index 612ebc2..cad4334 100644 --- a/ui/gfx/harfbuzz_font_skia.cc +++ b/ui/gfx/harfbuzz_font_skia.cc
@@ -292,7 +292,17 @@ if (face_cache->first.get() == NULL) face_cache->first.Init(skia_face.get()); - hb_font_t* harfbuzz_font = hb_font_create(face_cache->first.get()); + hb_font_t* harfbuzz_font = nullptr; +#if defined(OS_MACOSX) + // Since we have a CTFontRef available at the right size, associate it with + // the hb_font_t. This avoids Harfbuzz doing its own lookup by typeface name, + // which requires talking to the font server again. + if (CTFontRef ct_font = SkTypeface_GetCTFontRef(skia_face.get())) + harfbuzz_font = hb_coretext_font_create(ct_font); +#endif + if (!harfbuzz_font) + harfbuzz_font = hb_font_create(face_cache->first.get()); + const int scale = SkiaScalarToHarfBuzzUnits(text_size); hb_font_set_scale(harfbuzz_font, scale, scale); FontData* hb_font_data = new FontData(&face_cache->second);
diff --git a/ui/gfx/ipc/buffer_types/BUILD.gn b/ui/gfx/ipc/buffer_types/BUILD.gn new file mode 100644 index 0000000..a1c2234f --- /dev/null +++ b/ui/gfx/ipc/buffer_types/BUILD.gn
@@ -0,0 +1,24 @@ +# Copyright 2018 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("//build/config/jumbo.gni") + +jumbo_component("buffer_types") { + output_name = "gfx_ipc_buffer_types" + + sources = [ + "gfx_ipc_export.h", + "gfx_param_traits.cc", + "gfx_param_traits.h", + "gfx_param_traits_macros.h", + ] + + defines = [ "GFX_IPC_BUFFER_TYPES_IMPLEMENTATION" ] + + public_deps = [ + "//base", + "//ipc", + "//ui/gfx:buffer_types", + ] +}
diff --git a/ui/gfx/ipc/buffer_types/OWNERS b/ui/gfx/ipc/buffer_types/OWNERS new file mode 100644 index 0000000..146c3c3c --- /dev/null +++ b/ui/gfx/ipc/buffer_types/OWNERS
@@ -0,0 +1,2 @@ +per-file *_param_traits*.*=set noparent +per-file *_param_traits*.*=file://ipc/SECURITY_OWNERS
diff --git a/ui/gfx/ipc/buffer_types/gfx_ipc_export.h b/ui/gfx/ipc/buffer_types/gfx_ipc_export.h new file mode 100644 index 0000000..1a8d3ea --- /dev/null +++ b/ui/gfx/ipc/buffer_types/gfx_ipc_export.h
@@ -0,0 +1,29 @@ +// Copyright 2018 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 GFX_IPC_BUFFER_TYPES_EXPORT_H_ +#define GFX_IPC_BUFFER_TYPES_EXPORT_H_ + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(GFX_IPC_BUFFER_TYPES_IMPLEMENTATION) +#define GFX_IPC_BUFFER_TYPES_EXPORT __declspec(dllexport) +#else +#define GFX_IPC_BUFFER_TYPES_EXPORT __declspec(dllimport) +#endif // defined(GFX_IPC_BUFFER_TYPES_IMPLEMENTATION) + +#else // defined(WIN32) +#if defined(GFX_IPC_BUFFER_TYPES_IMPLEMENTATION) +#define GFX_IPC_BUFFER_TYPES_EXPORT __attribute__((visibility("default"))) +#else +#define GFX_IPC_BUFFER_TYPES_EXPORT +#endif +#endif + +#else // defined(COMPONENT_BUILD) +#define GFX_IPC_BUFFER_TYPES_EXPORT +#endif + +#endif // GFX_IPC_BUFFER_TYPES_EXPORT_H_
diff --git a/ui/gfx/ipc/buffer_types/gfx_param_traits.cc b/ui/gfx/ipc/buffer_types/gfx_param_traits.cc new file mode 100644 index 0000000..4833426 --- /dev/null +++ b/ui/gfx/ipc/buffer_types/gfx_param_traits.cc
@@ -0,0 +1,57 @@ +// Copyright 2018 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 "ui/gfx/ipc/buffer_types/gfx_param_traits.h" + +#include <stddef.h> +#include <stdint.h> + +#include <string> + +namespace IPC { + +void ParamTraits<gfx::BufferUsageAndFormat>::Write( + base::Pickle* m, + const gfx::BufferUsageAndFormat& p) { + WriteParam(m, p.usage); + WriteParam(m, p.format); +} + +bool ParamTraits<gfx::BufferUsageAndFormat>::Read( + const base::Pickle* m, + base::PickleIterator* iter, + gfx::BufferUsageAndFormat* r) { + if (!ReadParam(m, iter, &r->usage) || !ReadParam(m, iter, &r->format)) + return false; + return true; +} + +void ParamTraits<gfx::BufferUsageAndFormat>::Log( + const gfx::BufferUsageAndFormat& p, + std::string* l) { + l->append(base::StringPrintf("(%d, %d)", p.usage, p.format)); +} + +} // namespace IPC + +// Generate param traits write methods. +#include "ipc/param_traits_write_macros.h" +namespace IPC { +#undef UI_GFX_IPC_GFX_BUFFER_TYPES_PARAM_TRAITS_MACROS_H_ +#include "ui/gfx/ipc/buffer_types/gfx_param_traits_macros.h" +} // namespace IPC + +// Generate param traits read methods. +#include "ipc/param_traits_read_macros.h" +namespace IPC { +#undef UI_GFX_IPC_GFX_BUFFER_TYPES_PARAM_TRAITS_MACROS_H_ +#include "ui/gfx/ipc/buffer_types/gfx_param_traits_macros.h" +} // namespace IPC + +// Generate param traits log methods. +#include "ipc/param_traits_log_macros.h" +namespace IPC { +#undef UI_GFX_IPC_GFX_BUFFER_TYPES_PARAM_TRAITS_MACROS_H_ +#include "ui/gfx/ipc/buffer_types/gfx_param_traits_macros.h" +} // namespace IPC
diff --git a/ui/gfx/ipc/buffer_types/gfx_param_traits.h b/ui/gfx/ipc/buffer_types/gfx_param_traits.h new file mode 100644 index 0000000..6bef3e5 --- /dev/null +++ b/ui/gfx/ipc/buffer_types/gfx_param_traits.h
@@ -0,0 +1,29 @@ +// Copyright 2014 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 UI_GFX_IPC_BUFFER_TYPES_GFX_PARAM_TRAITS_H_ +#define UI_GFX_IPC_BUFFER_TYPES_GFX_PARAM_TRAITS_H_ + +#include <string> + +#include "ipc/ipc_message_utils.h" +#include "ipc/param_traits_macros.h" +#include "ui/gfx/ipc/buffer_types/gfx_ipc_export.h" +#include "ui/gfx/ipc/buffer_types/gfx_param_traits_macros.h" + +namespace IPC { + +template <> +struct GFX_IPC_BUFFER_TYPES_EXPORT ParamTraits<gfx::BufferUsageAndFormat> { + typedef gfx::BufferUsageAndFormat param_type; + static void Write(base::Pickle* m, const param_type& p); + static bool Read(const base::Pickle* m, + base::PickleIterator* iter, + param_type* r); + static void Log(const param_type& p, std::string* l); +}; + +} // namespace IPC + +#endif // UI_GFX_IPC_BUFFER_TYPES_GFX_PARAM_TRAITS_H_
diff --git a/ui/gfx/ipc/buffer_types/gfx_param_traits_macros.h b/ui/gfx/ipc/buffer_types/gfx_param_traits_macros.h new file mode 100644 index 0000000..5e7f404 --- /dev/null +++ b/ui/gfx/ipc/buffer_types/gfx_param_traits_macros.h
@@ -0,0 +1,25 @@ +// Copyright 2018 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. + +// Singly or multiply-included shared traits file depending upon circumstances. +// This allows the use of IPC serialization macros in more than one IPC message +// file. +#ifndef UI_GFX_IPC_GFX_BUFFER_TYPES_PARAM_TRAITS_MACROS_H_ +#define UI_GFX_IPC_GFX_BUFFER_TYPES_PARAM_TRAITS_MACROS_H_ + +#include "build/build_config.h" +#include "ipc/ipc_message_macros.h" +#include "ui/gfx/buffer_types.h" + +#undef IPC_MESSAGE_EXPORT +#define IPC_MESSAGE_EXPORT GFX_IPC_BUFFER_TYPES_EXPORT + +IPC_ENUM_TRAITS_MAX_VALUE(gfx::BufferFormat, gfx::BufferFormat::LAST) + +IPC_ENUM_TRAITS_MAX_VALUE(gfx::BufferUsage, gfx::BufferUsage::LAST) + +#undef IPC_MESSAGE_EXPORT +#define IPC_MESSAGE_EXPORT + +#endif // UI_GFX_IPC_GFX_BUFFER_TYPES_PARAM_TRAITS_MACROS_H_
diff --git a/ui/gfx/ipc/gfx_param_traits_macros.h b/ui/gfx/ipc/gfx_param_traits_macros.h index 2ad675f6..229fc65 100644 --- a/ui/gfx/ipc/gfx_param_traits_macros.h +++ b/ui/gfx/ipc/gfx_param_traits_macros.h
@@ -10,7 +10,6 @@ #include "build/build_config.h" #include "ipc/ipc_message_macros.h" -#include "ui/gfx/buffer_types.h" #include "ui/gfx/ca_layer_params.h" #include "ui/gfx/gpu_fence_handle.h" #include "ui/gfx/gpu_memory_buffer.h" @@ -26,10 +25,6 @@ #undef IPC_MESSAGE_EXPORT #define IPC_MESSAGE_EXPORT GFX_IPC_EXPORT -IPC_ENUM_TRAITS_MAX_VALUE(gfx::BufferFormat, gfx::BufferFormat::LAST) - -IPC_ENUM_TRAITS_MAX_VALUE(gfx::BufferUsage, gfx::BufferUsage::LAST) - IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType, gfx::GPU_MEMORY_BUFFER_TYPE_LAST)
diff --git a/ui/gfx/mojo/buffer_types.mojom b/ui/gfx/mojo/buffer_types.mojom index 70a5548..b197b50 100644 --- a/ui/gfx/mojo/buffer_types.mojom +++ b/ui/gfx/mojo/buffer_types.mojom
@@ -42,6 +42,11 @@ LAST = GPU_READ_CPU_READ_WRITE_PERSISTENT }; +struct BufferUsageAndFormat { + BufferUsage usage; + BufferFormat format; +}; + // gfx::GpuMemoryBufferType enum GpuMemoryBufferType { EMPTY_BUFFER,
diff --git a/ui/gfx/mojo/buffer_types.typemap b/ui/gfx/mojo/buffer_types.typemap index ca27a08..40618ea4 100644 --- a/ui/gfx/mojo/buffer_types.typemap +++ b/ui/gfx/mojo/buffer_types.typemap
@@ -18,6 +18,7 @@ type_mappings = [ "gfx.mojom.BufferFormat=gfx::BufferFormat", "gfx.mojom.BufferUsage=gfx::BufferUsage", + "gfx.mojom.BufferUsageAndFormat=gfx::BufferUsageAndFormat", "gfx.mojom.GpuMemoryBufferHandle=gfx::GpuMemoryBufferHandle", "gfx.mojom.GpuMemoryBufferId=gfx::GpuMemoryBufferId[copyable_pass_by_value]", "gfx.mojom.GpuMemoryBufferType=gfx::GpuMemoryBufferType",
diff --git a/ui/gfx/mojo/buffer_types_struct_traits.cc b/ui/gfx/mojo/buffer_types_struct_traits.cc index ddb3fd28..9663837 100644 --- a/ui/gfx/mojo/buffer_types_struct_traits.cc +++ b/ui/gfx/mojo/buffer_types_struct_traits.cc
@@ -9,6 +9,14 @@ namespace mojo { +// static +bool StructTraits<gfx::mojom::BufferUsageAndFormatDataView, + gfx::BufferUsageAndFormat>:: + Read(gfx::mojom::BufferUsageAndFormatDataView data, + gfx::BufferUsageAndFormat* out) { + return data.ReadUsage(&out->usage) && data.ReadFormat(&out->format); +} + std::vector<mojo::ScopedHandle> StructTraits<gfx::mojom::NativePixmapHandleDataView, gfx::NativePixmapHandle>:: fds(const gfx::NativePixmapHandle& pixmap_handle) {
diff --git a/ui/gfx/mojo/buffer_types_struct_traits.h b/ui/gfx/mojo/buffer_types_struct_traits.h index bf1568d..eb83ec0 100644 --- a/ui/gfx/mojo/buffer_types_struct_traits.h +++ b/ui/gfx/mojo/buffer_types_struct_traits.h
@@ -176,6 +176,21 @@ }; template <> +struct StructTraits<gfx::mojom::BufferUsageAndFormatDataView, + gfx::BufferUsageAndFormat> { + static gfx::BufferUsage usage(const gfx::BufferUsageAndFormat& input) { + return input.usage; + } + + static gfx::BufferFormat format(const gfx::BufferUsageAndFormat& input) { + return input.format; + } + + static bool Read(gfx::mojom::BufferUsageAndFormatDataView data, + gfx::BufferUsageAndFormat* out); +}; + +template <> struct EnumTraits<gfx::mojom::GpuMemoryBufferType, gfx::GpuMemoryBufferType> { static gfx::mojom::GpuMemoryBufferType ToMojom( gfx::GpuMemoryBufferType type) {
diff --git a/ui/gfx/native_widget_types.h b/ui/gfx/native_widget_types.h index 313ab22..7ceeee1 100644 --- a/ui/gfx/native_widget_types.h +++ b/ui/gfx/native_widget_types.h
@@ -14,6 +14,8 @@ #include "base/android/scoped_java_ref.h" #elif defined(OS_MACOSX) #include <objc/objc.h> +#elif defined(OS_WIN) +#include "base/win/windows_types.h" #endif // This file provides cross platform typedefs for native widget types. @@ -52,7 +54,6 @@ #endif // defined(USE_AURA) #if defined(OS_WIN) -#include "base/win/windows_types.h" typedef struct HFONT__* HFONT; struct IAccessible; #elif defined(OS_IOS)
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc index 58dc2d89..1f97906 100644 --- a/ui/gfx/render_text.cc +++ b/ui/gfx/render_text.cc
@@ -1270,6 +1270,11 @@ solid_part.Inset(0, 0, gradient_width, 0); } + // CreateFadeShader() expects at least one part to not be empty. + // See https://crbug.com/706835. + if (left_part.IsEmpty() && right_part.IsEmpty()) + return; + Rect text_rect = display_rect(); text_rect.Inset(GetAlignmentOffset(0).x(), 0, 0, 0);
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc index 9985ce3..9577d7b 100644 --- a/ui/gfx/render_text_unittest.cc +++ b/ui/gfx/render_text_unittest.cc
@@ -3616,6 +3616,14 @@ // Test that Zero width characters have the correct line breaking behavior. TEST_P(RenderTextHarfBuzzTest, Multiline_ZeroWidthChars) { RenderTextHarfBuzz* render_text = GetRenderTextHarfBuzz(); + +#if defined(OS_MACOSX) + // Don't use Helvetica Neue on 10.10 - it has a buggy zero-width space that + // actually gets some width. See http://crbug.com/799333. + if (base::mac::IsOS10_10()) + render_text->SetFontList(FontList("Arial, 12px")); +#endif + render_text->SetMultiline(true); render_text->SetWordWrapBehavior(WRAP_LONG_WORDS); @@ -3631,8 +3639,9 @@ render_text->SetDisplayRect(Rect(0, 0, kTestWidth, 0)); render_text->Draw(canvas()); - ASSERT_EQ(3u, test_api()->lines().size()); - for (size_t j = 0; j < test_api()->lines().size(); ++j) { + EXPECT_EQ(3u, test_api()->lines().size()); + for (size_t j = 0; + j < std::min(arraysize(char_ranges), test_api()->lines().size()); ++j) { SCOPED_TRACE(base::StringPrintf("%" PRIuS "-th line", j)); int segment_size = test_api()->lines()[j].segments.size(); ASSERT_GT(segment_size, 0); @@ -4047,7 +4056,11 @@ TEST_P(RenderTextHarfBuzzTest, HarfBuzz_AsciiVariationSelector) { RenderTextHarfBuzz* render_text = GetRenderTextHarfBuzz(); - +#if defined(OS_MACOSX) + // Don't use a system font on macOS - asking for a variation selector on + // ASCII glyphs can tickle OS bugs. See http://crbug.com/785522. + render_text->SetFontList(FontList("Arial, 12px")); +#endif // A variation selector doesn't have to appear with Emoji. It will probably // cause the typesetter to render tofu in this case, but it should not break // a text run.
diff --git a/ui/gfx/test/fontconfig_util_linux.cc b/ui/gfx/test/fontconfig_util_linux.cc index 298860a..d298df61 100644 --- a/ui/gfx/test/fontconfig_util_linux.cc +++ b/ui/gfx/test/fontconfig_util_linux.cc
@@ -56,8 +56,9 @@ const char* const kCloudStorageSyncedFonts[] = { // The DejaVuSans font is used by the css2.1 tests. - "DejaVuSans.ttf", "Lohit-Devanagari.ttf", "Lohit-Tamil.ttf", - "MuktiNarrow.ttf", "NotoSansKhmer-Regular.ttf"}; + "DejaVuSans.ttf", "Garuda.ttf", "Lohit-Devanagari.ttf", + "Lohit-Tamil.ttf", "Lohit-Gurmukhi.ttf", "MuktiNarrow.ttf", + "NotoSansKhmer-Regular.ttf"}; const size_t kNumCloudStorageSyncedFonts = arraysize(kCloudStorageSyncedFonts);
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn index c0160ff3..bff4d77 100644 --- a/ui/gl/BUILD.gn +++ b/ui/gl/BUILD.gn
@@ -365,6 +365,7 @@ sources = [ "test/gl_image_test_support.cc", "test/gl_image_test_support.h", + "test/gl_image_test_template.cc", "test/gl_image_test_template.h", "test/gl_surface_test_support.cc", "test/gl_surface_test_support.h",
diff --git a/ui/gl/gl_context_glx_unittest.cc b/ui/gl/gl_context_glx_unittest.cc index 25478c7..07df174 100644 --- a/ui/gl/gl_context_glx_unittest.cc +++ b/ui/gl/gl_context_glx_unittest.cc
@@ -41,7 +41,7 @@ xevent.xmap.window != xwindow) { } - GLImageTestSupport::InitializeGL(); + GLImageTestSupport::InitializeGL(base::nullopt); auto surface = gl::InitializeGLSurface(base::MakeRefCounted<GLSurfaceGLXX11>(xwindow)); scoped_refptr<GLContext> context =
diff --git a/ui/gl/gl_image_ahardwarebuffer_unittest.cc b/ui/gl/gl_image_ahardwarebuffer_unittest.cc index 156bc5b..f762fed 100644 --- a/ui/gl/gl_image_ahardwarebuffer_unittest.cc +++ b/ui/gl/gl_image_ahardwarebuffer_unittest.cc
@@ -18,7 +18,7 @@ const uint8_t kGreen[] = {0x0, 0xFF, 0x0, 0xFF}; template <gfx::BufferFormat format> -class GLImageAHardwareBufferTestDelegate { +class GLImageAHardwareBufferTestDelegate : public GLImageTestDelegateBase { public: scoped_refptr<GLImage> CreateSolidColorImage(const gfx::Size& size, const uint8_t color[4]) const {
diff --git a/ui/gl/gl_image_dxgi_unittest.cc b/ui/gl/gl_image_dxgi_unittest.cc index 474e74b..38c8b77 100644 --- a/ui/gl/gl_image_dxgi_unittest.cc +++ b/ui/gl/gl_image_dxgi_unittest.cc
@@ -18,7 +18,7 @@ const uint8_t kRGBImageColor[] = {0x30, 0x40, 0x10, 0xFF}; template <gfx::BufferFormat format> -class GLImageDXGITestDelegate { +class GLImageDXGITestDelegate : public GLImageTestDelegateBase { public: scoped_refptr<GLImage> CreateSolidColorImage(const gfx::Size& size, const uint8_t color[4]) const {
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm index e32da07..2f82d1a 100644 --- a/ui/gl/gl_image_io_surface.mm +++ b/ui/gl/gl_image_io_surface.mm
@@ -14,6 +14,7 @@ #include "base/trace_event/memory_dump_manager.h" #include "base/trace_event/process_memory_dump.h" #include "base/trace_event/trace_event.h" +#include "ui/gfx/buffer_format_util.h" #include "ui/gfx/mac/io_surface.h" #include "ui/gl/gl_bindings.h" #include "ui/gl/gl_context.h" @@ -221,7 +222,7 @@ } if (!ValidFormat(format)) { - LOG(ERROR) << "Invalid format: " << static_cast<int>(format); + LOG(ERROR) << "Invalid format: " << gfx::BufferFormatToString(format); return false; }
diff --git a/ui/gl/gl_image_io_surface_unittest.cc b/ui/gl/gl_image_io_surface_unittest.cc index bcb7d0c..f39061f 100644 --- a/ui/gl/gl_image_io_surface_unittest.cc +++ b/ui/gl/gl_image_io_surface_unittest.cc
@@ -17,7 +17,7 @@ const uint8_t kImageColor[] = {0x30, 0x40, 0x10, 0xFF}; template <gfx::BufferFormat format> -class GLImageIOSurfaceTestDelegate { +class GLImageIOSurfaceTestDelegate : public GLImageTestDelegateBase { public: scoped_refptr<GLImage> CreateImage(const gfx::Size& size) const { scoped_refptr<GLImageIOSurface> image(GLImageIOSurface::Create(
diff --git a/ui/gl/gl_image_native_pixmap_unittest.cc b/ui/gl/gl_image_native_pixmap_unittest.cc index baa54d9..99a852db 100644 --- a/ui/gl/gl_image_native_pixmap_unittest.cc +++ b/ui/gl/gl_image_native_pixmap_unittest.cc
@@ -4,101 +4,88 @@ #include "ui/gl/gl_image_native_pixmap.h" -#include "base/files/file_util.h" -#include "base/files/platform_file.h" -#include "base/logging.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "ui/gfx/buffer_format_util.h" -#include "ui/gl/gl_context.h" -#include "ui/gl/gl_surface.h" -#include "ui/gl/init/gl_factory.h" -#include "ui/gl/test/gl_surface_test_support.h" +#include "ui/gl/test/gl_image_test_template.h" namespace gl { namespace { -class GLImageNativePixmapTest : public testing::Test { - protected: - // Overridden from testing::Test: - void SetUp() override { - std::vector<GLImplementation> allowed_impls = - init::GetAllowedGLImplementations(); +const uint8_t kImageColor[] = {0x30, 0x40, 0x10, 0xFF}; - GLImplementation gl_impl = kGLImplementationEGLGLES2; - bool found = false; - for (auto impl : allowed_impls) { - if (impl == gl_impl) { - found = true; - break; - } - } +template <gfx::BufferFormat format> +class GLImageNativePixmapTestDelegate : public GLImageTestDelegateBase { + public: + base::Optional<GLImplementation> GetPreferedGLImplementation() + const override { + return base::Optional<GLImplementation>(kGLImplementationEGLGLES2); + } - if (!found) { - LOG(WARNING) << "Skip test, egl is required"; - return; - } - - GLSurfaceTestSupport::InitializeOneOffImplementation( - gl_impl, /* fallback_to_osmesa */ false); - + bool SkipTest() const override { const std::string dmabuf_import_ext = "EGL_MESA_image_dma_buf_export"; std::string platform_extensions(DriverEGL::GetPlatformExtensions()); ExtensionSet extensions(MakeExtensionSet(platform_extensions)); if (!HasExtension(extensions, dmabuf_import_ext)) { LOG(WARNING) << "Skip test, missing extension " << dmabuf_import_ext; - return; + return true; } - surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); - context_ = - gl::init::CreateGLContext(nullptr, surface_.get(), GLContextAttribs()); - if (!context_->MakeCurrent(surface_.get())) { - LOG(WARNING) << "Skip test, failed to make the GL context current"; - return; - } - - skip_test_ = false; + return false; } - void TearDown() override { - if (context_) - context_->ReleaseCurrent(surface_.get()); - context_ = nullptr; - surface_ = nullptr; - init::ShutdownGL(false); + scoped_refptr<GLImageNativePixmap> CreateSolidColorImage( + const gfx::Size& size, + const uint8_t color[4]) const { + GLuint texture_id = GLTestHelper::CreateTexture(GetTextureTarget()); + EXPECT_NE(0u, texture_id); + + std::unique_ptr<uint8_t[]> pixels( + new uint8_t[BufferSizeForBufferFormat(size, format)]); + GLImageTestSupport::SetBufferDataToColor( + size.width(), size.height(), + static_cast<int>(RowSizeForBufferFormat(size.width(), format, 0)), 0, + format, color, pixels.get()); + + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size.width(), size.height(), 0, + GL_RGBA, GL_UNSIGNED_BYTE, pixels.get()); + + scoped_refptr<gl::GLImageNativePixmap> image(new gl::GLImageNativePixmap( + size, gl::GLImageNativePixmap::GetInternalFormatForTesting(format))); + EXPECT_TRUE(image->InitializeFromTexture(texture_id)); + + glDeleteTextures(1, &texture_id); + return image; } - bool skip_test_ = true; - scoped_refptr<GLSurface> surface_; - scoped_refptr<GLContext> context_; + unsigned GetTextureTarget() const { return GL_TEXTURE_2D; } + + const uint8_t* GetImageColor() const { return kImageColor; } + + int GetAdmissibleError() const { return 0; } + + gfx::BufferFormat GetBufferFormat() const { return format; } }; -void GLTexture2DToDmabuf(gfx::BufferFormat image_format, - GLint tex_internal_format, - GLenum tex_format) { +template <typename GLImageTestDelegate> +class GLImageNativePixmapToDmabufTest + : public GLImageTest<GLImageTestDelegate> {}; + +TYPED_TEST_CASE_P(GLImageNativePixmapToDmabufTest); + +TYPED_TEST_P(GLImageNativePixmapToDmabufTest, GLTexture2DToDmabuf) { + if (this->delegate_.SkipTest()) + return; + const gfx::Size image_size(64, 64); + const uint8_t* image_color = this->delegate_.GetImageColor(); - scoped_refptr<gl::GLImageNativePixmap> image(new gl::GLImageNativePixmap( - image_size, - gl::GLImageNativePixmap::GetInternalFormatForTesting(image_format))); - - GLuint texture_id = 0; - glGenTextures(1, &texture_id); - EXPECT_NE(0u, texture_id); - glBindTexture(GL_TEXTURE_2D, texture_id); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexImage2D(GL_TEXTURE_2D, 0, tex_internal_format, image_size.width(), - image_size.height(), 0, tex_format, GL_UNSIGNED_BYTE, nullptr); - - EXPECT_TRUE(image->InitializeFromTexture(texture_id)); + scoped_refptr<GLImageNativePixmap> image = + this->delegate_.CreateSolidColorImage(image_size, image_color); + ASSERT_TRUE(image); gfx::NativePixmapHandle native_pixmap_handle = image->ExportHandle(); - size_t num_planes = gfx::NumberOfPlanesForBufferFormat(image_format); + size_t num_planes = + gfx::NumberOfPlanesForBufferFormat(this->delegate_.GetBufferFormat()); EXPECT_EQ(num_planes, native_pixmap_handle.planes.size()); std::vector<base::ScopedFD> scoped_fds; @@ -107,24 +94,29 @@ scoped_fds.emplace_back(fd.fd); EXPECT_TRUE(scoped_fds.back().is_valid()); } - - // Close all fds. - scoped_fds.clear(); - - image = nullptr; - glDeleteTextures(1, &texture_id); } -TEST_F(GLImageNativePixmapTest, GLTexture2DToDmabuf) { - if (skip_test_) - return; +// This test verifies that GLImageNativePixmap can be exported as dmabuf fds. +REGISTER_TYPED_TEST_CASE_P(GLImageNativePixmapToDmabufTest, + GLTexture2DToDmabuf); - // Add more cases if needed. - GLTexture2DToDmabuf(gfx::BufferFormat::RGBA_8888, GL_RGBA, GL_RGBA); - GLTexture2DToDmabuf(gfx::BufferFormat::BGRA_8888, GL_RGBA, GL_RGBA); - GLTexture2DToDmabuf(gfx::BufferFormat::RGBX_8888, GL_RGBA, GL_RGBA); - GLTexture2DToDmabuf(gfx::BufferFormat::BGRX_8888, GL_RGBA, GL_RGBA); -} +using GLImageTestTypes = testing::Types< + GLImageNativePixmapTestDelegate<gfx::BufferFormat::RGBX_8888>, + GLImageNativePixmapTestDelegate<gfx::BufferFormat::RGBA_8888>, + GLImageNativePixmapTestDelegate<gfx::BufferFormat::BGRX_8888>, + GLImageNativePixmapTestDelegate<gfx::BufferFormat::BGRA_8888>>; + +INSTANTIATE_TYPED_TEST_CASE_P(GLImageNativePixmap, + GLImageTest, + GLImageTestTypes); + +INSTANTIATE_TYPED_TEST_CASE_P(GLImageNativePixmap, + GLImageOddSizeTest, + GLImageTestTypes); + +INSTANTIATE_TYPED_TEST_CASE_P(GLImageNativePixmap, + GLImageNativePixmapToDmabufTest, + GLImageTestTypes); } // namespace
diff --git a/ui/gl/gl_image_ref_counted_memory_unittest.cc b/ui/gl/gl_image_ref_counted_memory_unittest.cc index 60e2de0..8aa5fc74 100644 --- a/ui/gl/gl_image_ref_counted_memory_unittest.cc +++ b/ui/gl/gl_image_ref_counted_memory_unittest.cc
@@ -17,7 +17,7 @@ const uint8_t kGreen[] = {0x0, 0xFF, 0x0, 0xFF}; template <gfx::BufferFormat format> -class GLImageRefCountedMemoryTestDelegate { +class GLImageRefCountedMemoryTestDelegate : public GLImageTestDelegateBase { public: scoped_refptr<GLImage> CreateSolidColorImage(const gfx::Size& size, const uint8_t color[4]) const {
diff --git a/ui/gl/gl_image_shared_memory_unittest.cc b/ui/gl/gl_image_shared_memory_unittest.cc index 4552f29..fdef8d9 100644 --- a/ui/gl/gl_image_shared_memory_unittest.cc +++ b/ui/gl/gl_image_shared_memory_unittest.cc
@@ -17,7 +17,7 @@ const uint8_t kGreen[] = {0x0, 0x20, 0x0, 0xFF}; template <gfx::BufferFormat format> -class GLImageSharedMemoryTestDelegate { +class GLImageSharedMemoryTestDelegate : public GLImageTestDelegateBase { public: scoped_refptr<GLImage> CreateSolidColorImage(const gfx::Size& size, const uint8_t color[4]) const { @@ -64,7 +64,7 @@ GLImageCopyTest, GLImageTestTypes); -class GLImageSharedMemoryPoolTestDelegate { +class GLImageSharedMemoryPoolTestDelegate : public GLImageTestDelegateBase { public: scoped_refptr<GLImage> CreateSolidColorImage(const gfx::Size& size, const uint8_t color[4]) const {
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc index 3a0bcc8..67255b5 100644 --- a/ui/gl/gl_surface_egl.cc +++ b/ui/gl/gl_surface_egl.cc
@@ -69,19 +69,18 @@ #define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3204 #define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3205 #define EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE 0x3206 +#define EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED_ANGLE 0x3451 +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209 +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE 0x320A +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE 0x345E #endif /* EGL_ANGLE_platform_angle */ #ifndef EGL_ANGLE_platform_angle_d3d #define EGL_ANGLE_platform_angle_d3d 1 #define EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE 0x3207 #define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208 -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209 -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE 0x320A -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE 0x320B -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE 0x320C - -// Hidden enum for the NULL D3D device type. -#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE 0x6AC0 +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE 0x320B +#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_REFERENCE_ANGLE 0x320C #endif /* EGL_ANGLE_platform_angle_d3d */ #ifndef EGL_ANGLE_platform_angle_opengl @@ -217,7 +216,7 @@ if (warpDevice) { DCHECK(!nullDevice); display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE); - display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE); + display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE); } else if (nullDevice) { DCHECK(!warpDevice); display_attribs.push_back(EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE); @@ -289,10 +288,16 @@ return "D3D9"; case ANGLE_D3D11: return "D3D11"; + case ANGLE_D3D11_NULL: + return "D3D11Null"; case ANGLE_OPENGL: return "OpenGL"; + case ANGLE_OPENGL_NULL: + return "OpenGLNull"; case ANGLE_OPENGLES: return "OpenGLES"; + case ANGLE_OPENGLES_NULL: + return "OpenGLESNull"; case ANGLE_NULL: return "Null"; default:
diff --git a/ui/gl/test/gl_image_test_support.cc b/ui/gl/test/gl_image_test_support.cc index 9f50435..a1e1fca 100644 --- a/ui/gl/test/gl_image_test_support.cc +++ b/ui/gl/test/gl_image_test_support.cc
@@ -7,7 +7,6 @@ #include <vector> #include "ui/gfx/half_float.h" -#include "ui/gl/gl_implementation.h" #include "ui/gl/init/gl_factory.h" #include "ui/gl/test/gl_surface_test_support.h" @@ -19,7 +18,8 @@ namespace gl { // static -void GLImageTestSupport::InitializeGL() { +void GLImageTestSupport::InitializeGL( + base::Optional<GLImplementation> prefered_impl) { #if defined(USE_OZONE) ui::OzonePlatform::InitParams params; params.single_process = true; @@ -30,7 +30,10 @@ init::GetAllowedGLImplementations(); DCHECK(!allowed_impls.empty()); - GLImplementation impl = allowed_impls[0]; + GLImplementation impl = prefered_impl ? *prefered_impl : allowed_impls[0]; + DCHECK(std::find(allowed_impls.begin(), allowed_impls.end(), impl) != + allowed_impls.end()); + GLSurfaceTestSupport::InitializeOneOffImplementation(impl, true); #if defined(USE_OZONE) // Make sure all the tasks posted to the current task runner by the
diff --git a/ui/gl/test/gl_image_test_support.h b/ui/gl/test/gl_image_test_support.h index 65708b2..3b82ed1 100644 --- a/ui/gl/test/gl_image_test_support.h +++ b/ui/gl/test/gl_image_test_support.h
@@ -7,15 +7,19 @@ #include <stdint.h> +#include "base/optional.h" #include "ui/gfx/buffer_types.h" #include "ui/gl/gl_bindings.h" +#include "ui/gl/gl_implementation.h" namespace gl { class GLImageTestSupport { public: - // Initialize GL for image testing. - static void InitializeGL(); + // Initialize GL for image testing. |prefered_impl| is the GL implementation + // to select if it is an allowed GL implementation. Otherwise it selects the + // first allowed GL implementation. + static void InitializeGL(base::Optional<GLImplementation> prefered_impl); // Cleanup GL after being initialized for image testing. static void CleanupGL();
diff --git a/ui/gl/test/gl_image_test_template.cc b/ui/gl/test/gl_image_test_template.cc new file mode 100644 index 0000000..ca47fbae --- /dev/null +++ b/ui/gl/test/gl_image_test_template.cc
@@ -0,0 +1,149 @@ +// Copyright 2017 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. + +// This file defines tests that implementations of GLImage should pass in order +// to be conformant. + +#include "ui/gl/test/gl_image_test_template.h" + +namespace gl { + +namespace { + +GLuint LoadVertexShader() { + bool is_desktop_core_profile = + GLContext::GetCurrent()->GetVersionInfo()->is_desktop_core_profile; + std::string vertex_shader = base::StringPrintf( + "%s" // version + "%s vec2 a_position;\n" + "%s vec2 v_texCoord;\n" + "void main() {\n" + " gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);\n" + " v_texCoord = (a_position + vec2(1.0, 1.0)) * 0.5;\n" + "}", + is_desktop_core_profile ? "#version 150\n" : "", + is_desktop_core_profile ? "in" : "attribute", + is_desktop_core_profile ? "out" : "varying"); + return GLHelper::LoadShader(GL_VERTEX_SHADER, vertex_shader.c_str()); +} + +// Compiles a fragment shader for sampling out of a texture of |size| bound to +// |target| and checks for compilation errors. +GLuint LoadFragmentShader(unsigned target, const gfx::Size& size) { + bool is_desktop_core_profile = + GLContext::GetCurrent()->GetVersionInfo()->is_desktop_core_profile; + bool is_gles = GLContext::GetCurrent()->GetVersionInfo()->is_es; + + std::string fragment_shader_main = base::StringPrintf( + "uniform SamplerType a_texture;\n" + "%s vec2 v_texCoord;\n" + "%s" // output variable declaration + "void main() {\n" + " %s = TextureLookup(a_texture, v_texCoord * TextureScale);\n" + "}", + is_desktop_core_profile ? "in" : "varying", + is_desktop_core_profile ? "out vec4 my_FragData;\n" : "", + is_desktop_core_profile ? "my_FragData" : "gl_FragData[0]"); + + switch (target) { + case GL_TEXTURE_2D: + return GLHelper::LoadShader( + GL_FRAGMENT_SHADER, + base::StringPrintf("%s" // version + "%s" // precision + "#define SamplerType sampler2D\n" + "#define TextureLookup %s\n" + "#define TextureScale vec2(1.0, 1.0)\n" + "%s", // main function + is_desktop_core_profile ? "#version 150\n" : "", + is_gles ? "precision mediump float;\n" : "", + is_desktop_core_profile ? "texture" : "texture2D", + fragment_shader_main.c_str()) + .c_str()); + case GL_TEXTURE_RECTANGLE_ARB: + DCHECK(!is_gles); + return GLHelper::LoadShader( + GL_FRAGMENT_SHADER, + base::StringPrintf( + "%s" // version + "%s" // extension + "#define SamplerType sampler2DRect\n" + "#define TextureLookup %s\n" + "#define TextureScale vec2(%f, %f)\n" + "%s", // main function + is_desktop_core_profile ? "#version 150\n" : "", + is_desktop_core_profile + ? "" + : "#extension GL_ARB_texture_rectangle : require\n", + is_desktop_core_profile ? "texture" : "texture2DRect", + static_cast<double>(size.width()), + static_cast<double>(size.height()), fragment_shader_main.c_str()) + .c_str()); + case GL_TEXTURE_EXTERNAL_OES: + DCHECK(is_gles); + return GLHelper::LoadShader( + GL_FRAGMENT_SHADER, + base::StringPrintf("#extension GL_OES_EGL_image_external : require\n" + "%s" // precision + "#define SamplerType samplerExternalOES\n" + "#define TextureLookup texture2D\n" + "#define TextureScale vec2(1.0, 1.0)\n" + "%s", // main function + is_gles ? "precision mediump float;\n" : "", + fragment_shader_main.c_str()) + .c_str()); + default: + NOTREACHED(); + return 0; + } +} + +} // namespace + +namespace internal { + +// Draws texture bound to |target| of texture unit 0 to the currently bound +// frame buffer. +void DrawTextureQuad(GLenum target, const gfx::Size& size) { + GLuint vao = 0; + if (GLHelper::ShouldTestsUseVAOs()) { + glGenVertexArraysOES(1, &vao); + glBindVertexArrayOES(vao); + } + + GLuint vertex_shader = LoadVertexShader(); + GLuint fragment_shader = LoadFragmentShader(target, size); + GLuint program = GLHelper::SetupProgram(vertex_shader, fragment_shader); + EXPECT_NE(program, 0u); + glUseProgram(program); + + GLint sampler_location = glGetUniformLocation(program, "a_texture"); + ASSERT_NE(sampler_location, -1); + glUniform1i(sampler_location, 0); + + GLuint vertex_buffer = GLHelper::SetupQuadVertexBuffer(); + GLHelper::DrawQuad(vertex_buffer); + + if (vao != 0) { + glDeleteVertexArraysOES(1, &vao); + } + + glDeleteShader(vertex_shader); + glDeleteShader(fragment_shader); + glDeleteProgram(program); + glDeleteBuffersARB(1, &vertex_buffer); +} + +} // namespace internal + +base::Optional<GLImplementation> +GLImageTestDelegateBase::GetPreferedGLImplementation() const { + return base::nullopt; +} + +bool GLImageTestDelegateBase::SkipTest() const { + return false; +} + +} // namespace gl
diff --git a/ui/gl/test/gl_image_test_template.h b/ui/gl/test/gl_image_test_template.h index 065ad850..87f4cba 100644 --- a/ui/gl/test/gl_image_test_template.h +++ b/ui/gl/test/gl_image_test_template.h
@@ -12,6 +12,7 @@ #include <memory> +#include "base/optional.h" #include "base/strings/stringize_macros.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" @@ -33,136 +34,27 @@ #endif namespace gl { -namespace { -GLuint LoadVertexShader() { - bool is_desktop_core_profile = - GLContext::GetCurrent()->GetVersionInfo()->is_desktop_core_profile; - std::string vertex_shader = base::StringPrintf( - "%s" // version - "%s vec2 a_position;\n" - "%s vec2 v_texCoord;\n" - "void main() {\n" - " gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);\n" - " v_texCoord = (a_position + vec2(1.0, 1.0)) * 0.5;\n" - "}", - is_desktop_core_profile ? "#version 150\n" : "", - is_desktop_core_profile ? "in" : "attribute", - is_desktop_core_profile ? "out" : "varying"); - return GLHelper::LoadShader(GL_VERTEX_SHADER, vertex_shader.c_str()); +namespace internal { + +void DrawTextureQuad(GLenum target, const gfx::Size& size); } -// Compiles a fragment shader for sampling out of a texture of |size| bound to -// |target| and checks for compilation errors. -GLuint LoadFragmentShader(unsigned target, const gfx::Size& size) { - bool is_desktop_core_profile = - GLContext::GetCurrent()->GetVersionInfo()->is_desktop_core_profile; - bool is_gles = GLContext::GetCurrent()->GetVersionInfo()->is_es; +class GLImageTestDelegateBase { + public: + virtual ~GLImageTestDelegateBase() {} - std::string fragment_shader_main = base::StringPrintf( - "uniform SamplerType a_texture;\n" - "%s vec2 v_texCoord;\n" - "%s" // output variable declaration - "void main() {\n" - " %s = TextureLookup(a_texture, v_texCoord * TextureScale);\n" - "}", - is_desktop_core_profile ? "in" : "varying", - is_desktop_core_profile ? "out vec4 my_FragData;\n" : "", - is_desktop_core_profile ? "my_FragData" : "gl_FragData[0]"); - - switch (target) { - case GL_TEXTURE_2D: - return GLHelper::LoadShader( - GL_FRAGMENT_SHADER, - base::StringPrintf("%s" // version - "%s" // precision - "#define SamplerType sampler2D\n" - "#define TextureLookup %s\n" - "#define TextureScale vec2(1.0, 1.0)\n" - "%s", // main function - is_desktop_core_profile ? "#version 150\n" : "", - is_gles ? "precision mediump float;\n" : "", - is_desktop_core_profile ? "texture" : "texture2D", - fragment_shader_main.c_str()) - .c_str()); - case GL_TEXTURE_RECTANGLE_ARB: - DCHECK(!is_gles); - return GLHelper::LoadShader( - GL_FRAGMENT_SHADER, - base::StringPrintf( - "%s" // version - "%s" // extension - "#define SamplerType sampler2DRect\n" - "#define TextureLookup %s\n" - "#define TextureScale vec2(%f, %f)\n" - "%s", // main function - is_desktop_core_profile ? "#version 150\n" : "", - is_desktop_core_profile - ? "" - : "#extension GL_ARB_texture_rectangle : require\n", - is_desktop_core_profile ? "texture" : "texture2DRect", - static_cast<double>(size.width()), - static_cast<double>(size.height()), fragment_shader_main.c_str()) - .c_str()); - case GL_TEXTURE_EXTERNAL_OES: - DCHECK(is_gles); - return GLHelper::LoadShader( - GL_FRAGMENT_SHADER, - base::StringPrintf("#extension GL_OES_EGL_image_external : require\n" - "%s" // precision - "#define SamplerType samplerExternalOES\n" - "#define TextureLookup texture2D\n" - "#define TextureScale vec2(1.0, 1.0)\n" - "%s", // main function - is_gles ? "precision mediump float;\n" : "", - fragment_shader_main.c_str()) - .c_str()); - default: - NOTREACHED(); - return 0; - } -} - -// Draws texture bound to |target| of texture unit 0 to the currently bound -// frame buffer. -void DrawTextureQuad(GLenum target, const gfx::Size& size) { - GLuint vao = 0; - if (GLHelper::ShouldTestsUseVAOs()) { - glGenVertexArraysOES(1, &vao); - glBindVertexArrayOES(vao); - } - - GLuint vertex_shader = LoadVertexShader(); - GLuint fragment_shader = LoadFragmentShader(target, size); - GLuint program = GLHelper::SetupProgram(vertex_shader, fragment_shader); - EXPECT_NE(program, 0u); - glUseProgram(program); - - GLint sampler_location = glGetUniformLocation(program, "a_texture"); - ASSERT_NE(sampler_location, -1); - glUniform1i(sampler_location, 0); - - GLuint vertex_buffer = GLHelper::SetupQuadVertexBuffer(); - GLHelper::DrawQuad(vertex_buffer); - - if (vao != 0) { - glDeleteVertexArraysOES(1, &vao); - } - - glDeleteShader(vertex_shader); - glDeleteShader(fragment_shader); - glDeleteProgram(program); - glDeleteBuffersARB(1, &vertex_buffer); -} - -} // namespace + virtual base::Optional<GLImplementation> GetPreferedGLImplementation() const; + virtual bool SkipTest() const; +}; template <typename GLImageTestDelegate> class GLImageTest : public testing::Test { protected: // Overridden from testing::Test: void SetUp() override { - GLImageTestSupport::InitializeGL(); + auto prefered_impl = delegate_.GetPreferedGLImplementation(); + GLImageTestSupport::InitializeGL(prefered_impl); surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size()); context_ = gl::init::CreateGLContext(nullptr, surface_.get(), GLContextAttribs()); @@ -184,6 +76,9 @@ TYPED_TEST_CASE_P(GLImageTest); TYPED_TEST_P(GLImageTest, Create) { + if (this->delegate_.SkipTest()) + return; + // NOTE: On some drm devices (mediatek) the mininum width/height to add an fb // for a bo must be 64. const gfx::Size small_image_size(64, 64); @@ -218,6 +113,9 @@ TYPED_TEST_CASE_P(GLImageOddSizeTest); TYPED_TEST_P(GLImageOddSizeTest, Create) { + if (this->delegate_.SkipTest()) + return; + const gfx::Size odd_image_size(17, 53); const uint8_t* image_color = this->delegate_.GetImageColor(); @@ -243,6 +141,9 @@ TYPED_TEST_CASE_P(GLImageZeroInitializeTest); TYPED_TEST_P(GLImageZeroInitializeTest, ZeroInitialize) { + if (this->delegate_.SkipTest()) + return; + #if defined(OS_MACOSX) // This functionality is disabled on Mavericks because it breaks PDF // rendering. https://crbug.com/594343. @@ -276,7 +177,7 @@ EXPECT_TRUE(rv); // Draw |texture| to viewport. - DrawTextureQuad(target, image_size); + internal::DrawTextureQuad(target, image_size); // Release |image| from |texture|. image->ReleaseTexImage(target); @@ -299,6 +200,9 @@ TYPED_TEST_CASE_P(GLImageBindTest); TYPED_TEST_P(GLImageBindTest, BindTexImage) { + if (this->delegate_.SkipTest()) + return; + const gfx::Size image_size(256, 256); const uint8_t* image_color = this->delegate_.GetImageColor(); @@ -326,7 +230,7 @@ glClearColor(0.0f, 0.0f, 1.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); // Draw |texture| to viewport. - DrawTextureQuad(target, image_size); + internal::DrawTextureQuad(target, image_size); // Read back pixels to check expectations. GLTestHelper::CheckPixelsWithError( @@ -346,6 +250,9 @@ TYPED_TEST_CASE_P(GLImageCopyTest); TYPED_TEST_P(GLImageCopyTest, CopyTexImage) { + if (this->delegate_.SkipTest()) + return; + const gfx::Size image_size(256, 256); const uint8_t* image_color = this->delegate_.GetImageColor(); const uint8_t texture_color[] = {0, 0, 0xff, 0xff}; @@ -388,7 +295,7 @@ EXPECT_TRUE(rv); // Draw |texture| to viewport. - DrawTextureQuad(target, image_size); + internal::DrawTextureQuad(target, image_size); // Read back pixels to check expectations. GLTestHelper::CheckPixelsWithError(
diff --git a/ui/keyboard/OWNERS b/ui/keyboard/OWNERS index 282bde2..bf737730 100644 --- a/ui/keyboard/OWNERS +++ b/ui/keyboard/OWNERS
@@ -1,4 +1,6 @@ sadrul@chromium.org +wuyingbing@chromium.org +shuchen@chromium.org bshe@chromium.org yhanada@chromium.org
diff --git a/ui/keyboard/container_floating_behavior.cc b/ui/keyboard/container_floating_behavior.cc index e4d63e4e0..19d71ce 100644 --- a/ui/keyboard/container_floating_behavior.cc +++ b/ui/keyboard/container_floating_behavior.cc
@@ -217,6 +217,7 @@ gfx::Size(kKeyboardWidth, container->bounds().height()); gfx::Point keyboard_location = GetPositionForShowingKeyboard(keyboard_size, display_bounds); + SavePosition(keyboard_location); container->SetBounds(gfx::Rect(keyboard_location, keyboard_size)); }
diff --git a/ui/ozone/BUILD.gn b/ui/ozone/BUILD.gn index 55fb22c..319f5a3 100644 --- a/ui/ozone/BUILD.gn +++ b/ui/ozone/BUILD.gn
@@ -89,6 +89,7 @@ "//ui/gfx", "//ui/gfx/geometry", "//ui/gfx/ipc", + "//ui/gfx/ipc/buffer_types", "//ui/gfx/ipc/geometry", "//ui/gfx/ipc/skia", "//ui/gl",
diff --git a/ui/ozone/common/gpu/ozone_gpu_messages.h b/ui/ozone/common/gpu/ozone_gpu_messages.h index a834bcf..6db409c 100644 --- a/ui/ozone/common/gpu/ozone_gpu_messages.h +++ b/ui/ozone/common/gpu/ozone_gpu_messages.h
@@ -16,6 +16,7 @@ #include "ui/display/types/gamma_ramp_rgb_entry.h" #include "ui/gfx/geometry/point.h" #include "ui/gfx/geometry/rect.h" +#include "ui/gfx/ipc/buffer_types/gfx_param_traits.h" #include "ui/gfx/ipc/color/gfx_param_traits.h" #include "ui/gfx/ipc/geometry/gfx_param_traits.h" #include "ui/gfx/ipc/gfx_param_traits.h"
diff --git a/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc b/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc index 230db68..66e1fefb 100644 --- a/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc +++ b/ui/ozone/gl/gl_image_ozone_native_pixmap_unittest.cc
@@ -22,7 +22,7 @@ const uint8_t kYellow[] = {0xF0, 0xFF, 0x00, 0xFF}; template <gfx::BufferUsage usage, gfx::BufferFormat format> -class GLImageNativePixmapTestDelegate { +class GLImageNativePixmapTestDelegate : public GLImageTestDelegateBase { public: GLImageNativePixmapTestDelegate() { client_pixmap_factory_ = ui::CreateClientNativePixmapFactoryOzone();
diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn index 98f3162..a845514 100644 --- a/ui/views/BUILD.gn +++ b/ui/views/BUILD.gn
@@ -1177,3 +1177,18 @@ sources -= [ "corewm/desktop_capture_controller_unittest.cc" ] } } + +test("views_perftests") { + sources = [ + "controls/label_perftest.cc", + "views_perftests.cc", + ] + + deps = [ + ":test_support", + "//base/test:test_support", + "//cc/base:base", + "//testing/perf", + "//ui/resources:ui_test_pak", + ] +}
diff --git a/ui/views/DEPS b/ui/views/DEPS index edc6d257..8332622 100644 --- a/ui/views/DEPS +++ b/ui/views/DEPS
@@ -31,13 +31,16 @@ "run_all_unittests_main\.cc": [ "+mojo/edk/embedder", ], + "views_perftests\.cc": [ + "+mojo/edk/embedder", + ], "view_unittest\.cc": [ "+cc/playback" ], "views_test_suite\.cc": [ "+gpu/ipc/service", ], - "paint_info_unittest\.cc": [ + ".*test\.cc": [ "+cc/base", ] }
diff --git a/ui/views/controls/button/button.cc b/ui/views/controls/button/button.cc index 59f1af5..e8b9a13 100644 --- a/ui/views/controls/button/button.cc +++ b/ui/views/controls/button/button.cc
@@ -192,8 +192,7 @@ SetState(STATE_PRESSED); AnimateInkDrop(views::InkDropState::ACTION_PENDING, &event); } - if (request_focus_on_press_) - RequestFocus(); + RequestFocusFromEvent(); if (IsTriggerableEvent(event) && notify_action_ == NOTIFY_ON_PRESS) { NotifyClick(event); // NOTE: We may be deleted at this point (by the listener's notification @@ -323,8 +322,7 @@ } else if (event->type() == ui::ET_GESTURE_TAP_DOWN && ShouldEnterPushedState(*event)) { SetState(STATE_PRESSED); - if (request_focus_on_press_) - RequestFocus(); + RequestFocusFromEvent(); event->StopPropagation(); } else if (event->type() == ui::ET_GESTURE_TAP_CANCEL || event->type() == ui::ET_GESTURE_END) { @@ -425,7 +423,7 @@ } void Button::ViewHierarchyChanged(const ViewHierarchyChangedDetails& details) { - if (!details.is_add && state_ != STATE_DISABLED) + if (!details.is_add && state_ != STATE_DISABLED && details.child == this) SetState(STATE_NORMAL); } @@ -487,6 +485,11 @@ return CLICK_NONE; } +void Button::RequestFocusFromEvent() { + if (request_focus_on_press_) + RequestFocus(); +} + void Button::NotifyClick(const ui::Event& event) { if (has_ink_drop_action_on_click_) { AnimateInkDrop(InkDropState::ACTION_TRIGGERED,
diff --git a/ui/views/controls/button/button.h b/ui/views/controls/button/button.h index 0c11374..3942d79 100644 --- a/ui/views/controls/button/button.h +++ b/ui/views/controls/button/button.h
@@ -197,6 +197,10 @@ // events. virtual KeyClickAction GetKeyClickActionForEvent(const ui::KeyEvent& event); + // Called when the button has been clicked or tapped and should request focus + // if necessary. + virtual void RequestFocusFromEvent(); + // Cause the button to notify the listener that a click occurred. virtual void NotifyClick(const ui::Event& event);
diff --git a/ui/views/controls/button/button_unittest.cc b/ui/views/controls/button/button_unittest.cc index 3fc50f4..20f610f 100644 --- a/ui/views/controls/button/button_unittest.cc +++ b/ui/views/controls/button/button_unittest.cc
@@ -247,6 +247,19 @@ #endif // !defined(OS_MACOSX) || defined(USE_AURA) } +// Tests that the hover state is preserved during a view hierarchy update of a +// button's child View. +TEST_F(ButtonTest, HoverStatePreservedOnDescendantViewHierarchyChange) { + ui::test::EventGenerator generator(widget()->GetNativeWindow()); + generator.MoveMouseTo(button()->GetBoundsInScreen().CenterPoint()); + + EXPECT_EQ(Button::STATE_HOVERED, button()->state()); + Label* child = new Label(base::string16()); + button()->AddChildView(child); + delete child; + EXPECT_EQ(Button::STATE_HOVERED, button()->state()); +} + // Tests the different types of NotifyActions. TEST_F(ButtonTest, NotifyAction) { gfx::Point center(10, 10);
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc index 8a823199..536fd01 100644 --- a/ui/views/controls/button/menu_button.cc +++ b/ui/views/controls/button/menu_button.cc
@@ -53,7 +53,7 @@ } MenuButton::PressedLock::~PressedLock() { - if (menu_button_.get()) + if (menu_button_) menu_button_->DecrementPressedLocked(); } @@ -73,18 +73,11 @@ menu_marker_(ui::ResourceBundle::GetSharedInstance() .GetImageNamed(IDR_MENU_DROPARROW) .ToImageSkia()), - destroyed_flag_(nullptr), - pressed_lock_count_(0), - increment_pressed_lock_called_(nullptr), - should_disable_after_press_(false), weak_factory_(this) { SetHorizontalAlignment(gfx::ALIGN_LEFT); } -MenuButton::~MenuButton() { - if (destroyed_flag_) - *destroyed_flag_ = true; -} +MenuButton::~MenuButton() = default; //////////////////////////////////////////////////////////////////////////////// // @@ -122,26 +115,25 @@ static_cast<internal::RootView*>(GetWidget()->GetRootView()) ->SetMouseHandler(nullptr); - bool destroyed = false; - destroyed_flag_ = &destroyed; - DCHECK(increment_pressed_lock_called_ == nullptr); // Observe if IncrementPressedLocked() was called so we can trigger the // correct ink drop animations. bool increment_pressed_lock_called = false; increment_pressed_lock_called_ = &increment_pressed_lock_called; + // Allow for OnMenuButtonClicked() to delete this. + auto ref = weak_factory_.GetWeakPtr(); + // We don't set our state here. It's handled in the MenuController code or // by our click listener. listener_->OnMenuButtonClicked(this, menu_position, event); - if (destroyed) { + if (!ref) { // The menu was deleted while showing. Don't attempt any processing. return false; } increment_pressed_lock_called_ = nullptr; - destroyed_flag_ = nullptr; if (!increment_pressed_lock_called && pressed_lock_count_ == 0) { AnimateInkDrop(InkDropState::ACTION_TRIGGERED, @@ -235,7 +227,10 @@ void MenuButton::OnGestureEvent(ui::GestureEvent* event) { if (state() != STATE_DISABLED) { + auto ref = weak_factory_.GetWeakPtr(); if (IsTriggerableEvent(*event) && !Activate(event)) { + if (!ref) + return; // When |Activate()| returns |false|, it means the click was handled by // a button listener and has handled the gesture event. So, there is no // need to further process the gesture event here. However, if the
diff --git a/ui/views/controls/button/menu_button.h b/ui/views/controls/button/menu_button.h index e38200b..8fb11e1 100644 --- a/ui/views/controls/button/menu_button.h +++ b/ui/views/controls/button/menu_button.h
@@ -138,20 +138,16 @@ // The down arrow used to differentiate the menu button from normal buttons. const gfx::ImageSkia* menu_marker_; - // If non-null the destructor sets this to true. This is set while the menu is - // showing and used to detect if the menu was deleted while running. - bool* destroyed_flag_; - // The current number of "pressed" locks this button has. - int pressed_lock_count_; + int pressed_lock_count_ = 0; // Used to let Activate() know if IncrementPressedLocked() was called. - bool* increment_pressed_lock_called_; + bool* increment_pressed_lock_called_ = nullptr; // True if the button was in a disabled state when a menu was run, and should // return to it once the press is complete. This can happen if, e.g., we // programmatically show a menu on a disabled button. - bool should_disable_after_press_; + bool should_disable_after_press_ = false; base::WeakPtrFactory<MenuButton> weak_factory_;
diff --git a/ui/views/controls/button/menu_button_unittest.cc b/ui/views/controls/button/menu_button_unittest.cc index 500bbc91..4a898fa 100644 --- a/ui/views/controls/button/menu_button_unittest.cc +++ b/ui/views/controls/button/menu_button_unittest.cc
@@ -86,7 +86,6 @@ return gfx::Point(button_->x() - 1, button_->y() - 1); } - private: void CreateMenuButton(MenuButtonListener* menu_button_listener) { CreateWidget(); generator_.reset(new ui::test::EventGenerator(widget_->GetNativeWindow())); @@ -689,4 +688,38 @@ EXPECT_FALSE(ink_drop()->is_hovered()); } +class DestroyButtonInGestureListener : public MenuButtonListener { + public: + DestroyButtonInGestureListener() { + menu_button_ = std::make_unique<MenuButton>(base::string16(), this, true); + } + + ~DestroyButtonInGestureListener() override = default; + + MenuButton* menu_button() { return menu_button_.get(); } + + private: + // MenuButtonListener: + void OnMenuButtonClicked(MenuButton* source, + const gfx::Point& point, + const ui::Event* event) override { + menu_button_.reset(); + } + + std::unique_ptr<MenuButton> menu_button_; + + DISALLOW_COPY_AND_ASSIGN(DestroyButtonInGestureListener); +}; + +// This test ensures there isn't a UAF in MenuButton::OnGestureEvent() if +// the MenuButtonListener::OnMenuButtonClicked() deletes the MenuButton. +TEST_F(MenuButtonTest, DestroyButtonInGesture) { + DestroyButtonInGestureListener listener; + ui::GestureEvent gesture_event(0, 0, 0, base::TimeTicks::Now(), + ui::GestureEventDetails(ui::ET_GESTURE_TAP)); + CreateWidget(); + widget_->SetContentsView(listener.menu_button()); + listener.menu_button()->OnGestureEvent(&gesture_event); +} + } // namespace views
diff --git a/ui/views/controls/button/radio_button.cc b/ui/views/controls/button/radio_button.cc index 0dbf396..bfe4336 100644 --- a/ui/views/controls/button/radio_button.cc +++ b/ui/views/controls/button/radio_button.cc
@@ -104,6 +104,18 @@ SetChecked(true); } +void RadioButton::RequestFocusFromEvent() { + Checkbox::RequestFocusFromEvent(); + // Take focus only if another radio button in the group has focus. + Views views; + GetWidget()->GetRootView()->GetViewsInGroup(GetGroup(), &views); + if (std::find_if(views.begin(), views.end(), [](View* v) -> bool { + return v->HasFocus(); + }) != views.end()) { + RequestFocus(); + } +} + void RadioButton::NotifyClick(const ui::Event& event) { // Set the checked state to true only if we are unchecked, since we can't // be toggled on and off like a checkbox.
diff --git a/ui/views/controls/button/radio_button.h b/ui/views/controls/button/radio_button.h index a0af347..b91ed088 100644 --- a/ui/views/controls/button/radio_button.h +++ b/ui/views/controls/button/radio_button.h
@@ -30,6 +30,7 @@ void OnFocus() override; // Overridden from Button: + void RequestFocusFromEvent() override; void NotifyClick(const ui::Event& event) override; // Overridden from LabelButton:
diff --git a/ui/views/controls/button/radio_button_unittest.cc b/ui/views/controls/button/radio_button_unittest.cc index 3f389b0e..9fe4032e 100644 --- a/ui/views/controls/button/radio_button_unittest.cc +++ b/ui/views/controls/button/radio_button_unittest.cc
@@ -6,6 +6,8 @@ #include "base/strings/utf_string_conversions.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/material_design/material_design_controller.h" +#include "ui/events/base_event_utils.h" #include "ui/views/test/views_test_base.h" namespace { @@ -93,4 +95,41 @@ EXPECT_FALSE(button2->checked()); } +TEST_F(RadioButtonTest, FocusOnClick) { + RadioButton* button1 = new RadioButton(base::string16(), kGroup); + button1->SetSize(gfx::Size(10, 10)); + button_container().AddChildView(button1); + button1->SetChecked(true); + RadioButton* button2 = new RadioButton(base::string16(), kGroup); + button2->SetSize(gfx::Size(10, 10)); + button_container().AddChildView(button2); + + const gfx::Point point(1, 1); + const ui::MouseEvent event(ui::ET_MOUSE_PRESSED, point, point, + ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, + ui::EF_LEFT_MOUSE_BUTTON); + button2->OnMousePressed(event); + button2->OnMouseReleased(event); + + EXPECT_TRUE(button2->checked()); + auto* focus_manager = button_container().GetFocusManager(); + // Focus behavior is different pre/post-Harmony. + if (ui::MaterialDesignController::IsSecondaryUiMaterial()) { + // No focus on click. + EXPECT_EQ(nullptr, focus_manager->GetFocusedView()); + + ui::KeyEvent pressed_tab(ui::ET_KEY_PRESSED, ui::VKEY_TAB, ui::EF_NONE); + focus_manager->OnKeyEvent(pressed_tab); + EXPECT_EQ(button2, focus_manager->GetFocusedView()); + + button1->OnMousePressed(event); + button1->OnMouseReleased(event); + // Button 1 gets focus on click because button 2 already had it. + EXPECT_TRUE(button1->checked()); + EXPECT_EQ(button1, focus_manager->GetFocusedView()); + } else { + EXPECT_EQ(button2, focus_manager->GetFocusedView()); + } +} + } // namespace views
diff --git a/ui/views/controls/label_perftest.cc b/ui/views/controls/label_perftest.cc new file mode 100644 index 0000000..bd0094d --- /dev/null +++ b/ui/views/controls/label_perftest.cc
@@ -0,0 +1,41 @@ +// Copyright 2017 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 "ui/views/controls/label.h" + +#include "base/strings/utf_string_conversions.h" +#include "cc/base/lap_timer.h" +#include "testing/perf/perf_test.h" +#include "ui/views/test/views_test_base.h" + +namespace views { + +using LabelPerfTest = ViewsTestBase; + +// Test the number of text size measurements that can be made made per second. +// This should surface any performance regressions in underlying text layout +// system, e.g., failure to cache font structures. +TEST_F(LabelPerfTest, GetPreferredSize) { + Label label; + + // Alternate between two strings to ensure caches are cleared. + base::string16 string1 = base::ASCIIToUTF16("boring ascii string"); + base::string16 string2 = base::ASCIIToUTF16("another uninteresting sequence"); + + constexpr int kLaps = 5000; // Aim to run in under 3 seconds. + constexpr int kWarmupLaps = 5; + + // The time limit is unused. Use kLaps for the check interval so the time is + // only measured once. + cc::LapTimer timer(kWarmupLaps, base::TimeDelta(), kLaps); + for (int i = 0; i < kLaps + kWarmupLaps; ++i) { + label.SetText(i % 2 == 0 ? string1 : string2); + label.GetPreferredSize(); + timer.NextLap(); + } + perf_test::PrintResult("LabelPerfTest", std::string(), "GetPreferredSize", + timer.LapsPerSecond(), "runs/s", true); +} + +} // namespace views
diff --git a/ui/views/controls/message_box_view.cc b/ui/views/controls/message_box_view.cc index 5b0a00a..c44ebad 100644 --- a/ui/views/controls/message_box_view.cc +++ b/ui/views/controls/message_box_view.cc
@@ -270,7 +270,7 @@ layout->AddPaddingRow(0, inter_row_vertical_spacing_); layout->StartRow(0, kExtraViewColumnSetId); layout->AddView(checkbox_); - trailing_content_type = views::CONTROL; + trailing_content_type = views::TEXT; } if (link_) {
diff --git a/ui/views/controls/styled_label_unittest.cc b/ui/views/controls/styled_label_unittest.cc index 991100b..ac867fb4 100644 --- a/ui/views/controls/styled_label_unittest.cc +++ b/ui/views/controls/styled_label_unittest.cc
@@ -144,10 +144,10 @@ } // https://crbug.com/793184 -#if defined(OS_MACOSX) -#define MAYBE_CorrectWrapAtNewline DISABLED_CorrectWrapAtNewline -#else -#define MAYBE_CorrectWrapAtNewline CorrectWrapAtNewline +#if defined(OS_MACOSX) +#define MAYBE_CorrectWrapAtNewline DISABLED_CorrectWrapAtNewline +#else +#define MAYBE_CorrectWrapAtNewline CorrectWrapAtNewline #endif TEST_F(StyledLabelTest, MAYBE_CorrectWrapAtNewline) { const std::string first_line = "Line one"; @@ -365,10 +365,10 @@ } // https://crbug.com/793184 -#if defined(OS_MACOSX) -#define MAYBE_StyledRangeTextStyleBold DISABLED_StyledRangeTextStyleBold -#else -#define MAYBE_StyledRangeTextStyleBold StyledRangeTextStyleBold +#if defined(OS_MACOSX) +#define MAYBE_StyledRangeTextStyleBold DISABLED_StyledRangeTextStyleBold +#else +#define MAYBE_StyledRangeTextStyleBold StyledRangeTextStyleBold #endif TEST_F(StyledLabelTest, MAYBE_StyledRangeTextStyleBold) { test::TestLayoutProvider bold_provider; @@ -561,10 +561,11 @@ } // https://crbug.com/793184 -#if defined(OS_MACOSX) -#define MAYBE_SetTextContextAndDefaultStyle DISABLED_SetTextContextAndDefaultStyle -#else -#define MAYBE_SetTextContextAndDefaultStyle SetTextContextAndDefaultStyle +#if defined(OS_MACOSX) +#define MAYBE_SetTextContextAndDefaultStyle \ + DISABLED_SetTextContextAndDefaultStyle +#else +#define MAYBE_SetTextContextAndDefaultStyle SetTextContextAndDefaultStyle #endif TEST_F(StyledLabelTest, MAYBE_SetTextContextAndDefaultStyle) { const std::string text("This is a test block of text.");
diff --git a/ui/views/controls/tree/tree_view.cc b/ui/views/controls/tree/tree_view.cc index 36c4c07e..ed567ca 100644 --- a/ui/views/controls/tree/tree_view.cc +++ b/ui/views/controls/tree/tree_view.cc
@@ -51,6 +51,7 @@ // Padding around the text (on each side). static const int kTextVerticalPadding = 3; static const int kTextHorizontalPadding = 2; +static const int kTextHorizontalPaddingWithFocusRing = 4; // How much children are indented from their parent. static const int kIndent = 20; @@ -103,6 +104,16 @@ } text_offset_ = closed_icon_.width() + kImagePadding + kImagePadding + kArrowRegionSize; + + // The horizontal padding will be needed before an editor text field is ever + // constructed, otherwise it would be nice to use editor_->uses_focus_ring() + // or similar. Since Textfields only use focus rings when + // IsSecondaryUiMaterial() and when they have no border, checking that here + // is safe. + text_horizontal_padding_ = + ui::MaterialDesignController::IsSecondaryUiMaterial() + ? kTextHorizontalPaddingWithFocusRing + : kTextHorizontalPadding; } TreeView::~TreeView() { @@ -713,7 +724,7 @@ preferred_size_.SetSize( root_.GetMaxWidth(this, text_offset_, root_shown_ ? 1 : 0) + - kTextHorizontalPadding * 2, + text_horizontal_padding_ * 2, row_height_ * GetRowCount()); } @@ -728,7 +739,7 @@ GetMirroredXWithWidthInView(row_bounds.x(), row_bounds.width())); row_bounds.set_x(row_bounds.x() + text_offset_); row_bounds.set_width(row_bounds.width() - text_offset_); - row_bounds.Inset(kTextHorizontalPadding, kTextVerticalPadding); + row_bounds.Inset(text_horizontal_padding_, kTextVerticalPadding); row_bounds.Inset(-empty_editor_size_.width() / 2, -(empty_editor_size_.height() - font_list_.GetHeight()) / 2); // Give a little extra space for editing. @@ -817,9 +828,9 @@ // Paint the text. const gfx::Rect internal_bounds( - text_bounds.x() + kTextHorizontalPadding, + text_bounds.x() + text_horizontal_padding_, text_bounds.y() + kTextVerticalPadding, - text_bounds.width() - kTextHorizontalPadding * 2, + text_bounds.width() - text_horizontal_padding_ * 2, text_bounds.height() - kTextVerticalPadding * 2); canvas->DrawStringRect( node->model_node()->GetTitle(), font_list_, @@ -920,14 +931,15 @@ // leading aligned. gfx::Rect TreeView::GetAuxiliaryTextBoundsForNode(InternalNode* node) { gfx::Rect text_bounds = GetTextBoundsForNode(node); - int width = base::i18n::IsRTL() ? text_bounds.x() - kTextHorizontalPadding * 2 - : bounds().width() - text_bounds.right() - - 2 * kTextHorizontalPadding; + int width = base::i18n::IsRTL() + ? text_bounds.x() - text_horizontal_padding_ * 2 + : bounds().width() - text_bounds.right() - + 2 * text_horizontal_padding_; if (width < 0) return gfx::Rect(); int x = base::i18n::IsRTL() - ? kTextHorizontalPadding - : bounds().right() - width - kTextHorizontalPadding; + ? text_horizontal_padding_ + : bounds().right() - width - text_horizontal_padding_; return gfx::Rect(x, text_bounds.y(), width, text_bounds.height()); } @@ -936,8 +948,9 @@ int depth) { int width = drawing_provider()->ShouldDrawIconForNode(this, node->model_node()) - ? text_offset_ + node->text_width() + kTextHorizontalPadding * 2 - : kArrowRegionSize + node->text_width() + kTextHorizontalPadding * 2; + ? text_offset_ + node->text_width() + text_horizontal_padding_ * 2 + : kArrowRegionSize + node->text_width() + + text_horizontal_padding_ * 2; gfx::Rect rect(depth * kIndent + kHorizontalInset, row * row_height_, width, row_height_);
diff --git a/ui/views/controls/tree/tree_view.h b/ui/views/controls/tree/tree_view.h index 2ab62a6b..bc7fde5 100644 --- a/ui/views/controls/tree/tree_view.h +++ b/ui/views/controls/tree/tree_view.h
@@ -429,6 +429,9 @@ // control, icon and offsets. int text_offset_; + // Horizontal padding around the text on both sides. + int text_horizontal_padding_ = 0; + std::unique_ptr<PrefixSelector> selector_; // The current drawing provider for this TreeView.
diff --git a/ui/views/examples/box_layout_example.cc b/ui/views/examples/box_layout_example.cc index e3697cd..ef7c914 100644 --- a/ui/views/examples/box_layout_example.cc +++ b/ui/views/examples/box_layout_example.cc
@@ -422,8 +422,8 @@ main_axis_alignment_->selected_index())); layout->SetDefaultFlex(default_flex); layout->set_minimum_cross_axis_size(min_cross_size); - UpdateBorderInsets(); layout_ = box_layout_panel_->SetLayoutManager(std::move(layout)); + UpdateBorderInsets(); for (int i = 0; i < box_layout_panel_->child_count(); ++i) { ChildPanel* panel = static_cast<ChildPanel*>(box_layout_panel_->child_at(i));
diff --git a/ui/views/views_perftests.cc b/ui/views/views_perftests.cc new file mode 100644 index 0000000..c7ace58a --- /dev/null +++ b/ui/views/views_perftests.cc
@@ -0,0 +1,13 @@ +// Copyright 2017 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 "base/test/launcher/unit_test_launcher.h" +#include "ui/views/views_test_suite.h" + +int main(int argc, char** argv) { + views::ViewsTestSuite test_suite(argc, argv); + return base::LaunchUnitTestsSerially( + argc, argv, + base::Bind(&views::ViewsTestSuite::Run, base::Unretained(&test_suite))); +}
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc index 115ec08..15c966c 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -1768,11 +1768,7 @@ } else { // Another DesktopWindowTreeHostX11 has installed itself as // capture. Translate the event's location and dispatch to the other. - DCHECK_EQ(ui::GetScaleFactorForNativeView(window()), - ui::GetScaleFactorForNativeView(g_current_capture->window())); - ConvertEventLocationToTargetWindowLocation( - g_current_capture->GetLocationOnScreenInPixels(), - GetLocationOnScreenInPixels(), event->AsLocatedEvent()); + ConvertEventToDifferentHost(event, g_current_capture); g_current_capture->SendEventToSink(event); } } @@ -1780,11 +1776,7 @@ void DesktopWindowTreeHostX11::DispatchTouchEvent(ui::TouchEvent* event) { if (g_current_capture && g_current_capture != this && event->type() == ui::ET_TOUCH_PRESSED) { - DCHECK_EQ(ui::GetScaleFactorForNativeView(window()), - ui::GetScaleFactorForNativeView(g_current_capture->window())); - ConvertEventLocationToTargetWindowLocation( - g_current_capture->GetLocationOnScreenInPixels(), - GetLocationOnScreenInPixels(), event->AsLocatedEvent()); + ConvertEventToDifferentHost(event, g_current_capture); g_current_capture->SendEventToSink(event); } else { SendEventToSink(event); @@ -1796,6 +1788,20 @@ SendEventToSink(event); } +void DesktopWindowTreeHostX11::ConvertEventToDifferentHost( + ui::LocatedEvent* located_event, + DesktopWindowTreeHostX11* host) { + DCHECK_NE(this, host); + DCHECK_EQ(ui::GetScaleFactorForNativeView(window()), + ui::GetScaleFactorForNativeView(host->window())); + gfx::Vector2d offset = + GetLocationOnScreenInPixels() - host->GetLocationOnScreenInPixels(); + gfx::PointF location_in_pixel_in_host = + located_event->location_f() + gfx::Vector2dF(offset); + located_event->set_location_f(location_in_pixel_in_host); + located_event->set_root_location_f(location_in_pixel_in_host); +} + void DesktopWindowTreeHostX11::ResetWindowRegion() { // If a custom window shape was supplied then apply it. if (custom_window_shape_) {
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h index fcf87700..41bb4117 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -245,6 +245,11 @@ // Dispatches a key event. void DispatchKeyEvent(ui::KeyEvent* event); + // Updates the location of |located_event| to be in |host|'s coordinate system + // so that it can be dispatched to |host|. + void ConvertEventToDifferentHost(ui::LocatedEvent* located_event, + DesktopWindowTreeHostX11* host); + // Resets the window region for the current widget bounds if necessary. void ResetWindowRegion();
diff --git a/url/gurl_unittest.cc b/url/gurl_unittest.cc index 7545c97..3fe78d3 100644 --- a/url/gurl_unittest.cc +++ b/url/gurl_unittest.cc
@@ -865,6 +865,11 @@ {"filesystem:http://a.com#foo", "filesystem:http://a.com#foo", true}, {"filesystem:http://a.com#foo", "filesystem:http://a.com#bar", true}, {"filesystem:http://a.com#foo", "filesystem:http://b.com#bar", false}, + + // Data URLs + {"data:text/html,a#foo", "data:text/html,a#bar", true}, + {"data:text/html,a#foo", "data:text/html,a#foo", true}, + {"data:text/html,a#foo", "data:text/html,b#foo", false}, }; for (const auto& test_case : kTestCases) {
diff --git a/url/ipc/BUILD.gn b/url/ipc/BUILD.gn index 1edbe208..52968a19 100644 --- a/url/ipc/BUILD.gn +++ b/url/ipc/BUILD.gn
@@ -22,17 +22,20 @@ ] } -test("url_ipc_unittests") { - sources = [ - "url_param_traits_unittest.cc", - ] +# IPC unit tests aren't build on iOS. +if (!is_ios) { + test("url_ipc_unittests") { + sources = [ + "url_param_traits_unittest.cc", + ] - deps = [ - ":url_ipc", - "//base", - "//base/test:run_all_unittests", - "//ipc:test_support", - "//testing/gtest", - "//url:url", - ] + deps = [ + ":url_ipc", + "//base", + "//base/test:run_all_unittests", + "//ipc:test_support", + "//testing/gtest", + "//url:url", + ] + } }
diff --git a/url/origin.h b/url/origin.h index a49b04e8..ab52fa1 100644 --- a/url/origin.h +++ b/url/origin.h
@@ -9,8 +9,10 @@ #include <string> +#include "base/debug/alias.h" #include "base/strings/string16.h" #include "base/strings/string_piece.h" +#include "base/strings/string_util.h" #include "url/scheme_host_port.h" #include "url/third_party/mozilla/url_parse.h" #include "url/url_canon.h" @@ -187,6 +189,19 @@ URL_EXPORT bool IsSameOriginWith(const GURL& a, const GURL& b); URL_EXPORT bool IsSamePhysicalOriginWith(const GURL& a, const GURL& b); +// Helper macro used by DEBUG_ALIAS_FOR_ORIGIN below. +// TODO(lukasza): Move this to base/debug/alias.h +#define DEBUG_ALIAS_FOR_CSTR(var_name, c_str, char_count) \ + char var_name[char_count]; \ + base::strlcpy(var_name, (c_str), arraysize(var_name)); \ + base::debug::Alias(var_name); + +// DEBUG_ALIAS_FOR_ORIGIN(var_name, origin) copies |origin| into a new +// stack-allocated variable named |<var_name>|. This helps ensure that the +// value of |origin| gets preserved in crash dumps. +#define DEBUG_ALIAS_FOR_ORIGIN(var_name, origin) \ + DEBUG_ALIAS_FOR_CSTR(var_name, origin.Serialize().c_str(), 128) + } // namespace url #endif // URL_ORIGIN_H_
diff --git a/url/origin_unittest.cc b/url/origin_unittest.cc index 6b79956..d1bb7a2 100644 --- a/url/origin_unittest.cc +++ b/url/origin_unittest.cc
@@ -499,4 +499,12 @@ EXPECT_FALSE(url::Origin().DomainIs("com")); } -} // namespace url +TEST(OriginTest, DebugAlias) { + url::Origin origin1 = url::Origin::Create(GURL("https://foo.com/bar")); + DEBUG_ALIAS_FOR_ORIGIN(origin1_debug_alias, origin1); + EXPECT_STREQ("https://foo.com", origin1_debug_alias); + static_assert(std::is_same<char[128], decltype(origin1_debug_alias)>::value, + "Verification that origin1_debug_alias has expected type"); +} + +} // namespace